diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..146ab97 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,35 @@ +# Normalize line endings on commit. Files in the repo are stored with LF; +# Windows checkouts get CRLF for shell scripts marked otherwise, but Go +# tooling expects LF so we pin text files to LF on checkout too. +* text=auto eol=lf + +# Explicitly mark common text types so detection cannot get it wrong. +*.go text eol=lf +*.md text eol=lf +*.toml text eol=lf +*.json text eol=lf +*.yml text eol=lf +*.yaml text eol=lf +*.sh text eol=lf +*.txt text eol=lf +*.conf text eol=lf +*.example text eol=lf + +# Windows-only files keep CRLF. +*.bat text eol=crlf +*.cmd text eol=crlf +*.ps1 text eol=crlf + +# Binary assets — never touch line endings. +*.png binary +*.jpg binary +*.jpeg binary +*.gif binary +*.ico binary +*.icns binary +*.pdf binary +*.doc binary +*.docx binary +*.db binary +*.pcap binary +*.bin binary diff --git a/.github/prompts/plan-smb1VfsMvp.prompt.md b/.github/prompts/plan-smb1VfsMvp.prompt.md new file mode 100644 index 0000000..859bd71 --- /dev/null +++ b/.github/prompts/plan-smb1VfsMvp.prompt.md @@ -0,0 +1,93 @@ +# Plan: SMB1 VFS MVP for DOS and Win9x + +Build a dependency-ordered SMB1 server MVP on your existing NetBIOS stack and VFS registry, targeting MS-DOS + Windows 95/98/ME, with guest auth first. The approach is to convert the current browser-focused SMB stub into a stateful file server (UID/TID/FID/search/lock lifecycle), implement enumeration first, then layer read/write/locking/path operations, and implement copy as read+write fallback. + +## Steps + +### Phase 0: Baseline and guardrails +Confirm build-tag/runtime paths for smb + netbios + netbeui + ipx. Preserve existing browser behavior while adding file-serving commands. Add a short command support matrix (supported vs deferred) for SMB1 scope. + +### Phase 1: Session and share state foundation *(blocks all later phases)* +Add per-session state keyed by session context, with UID allocation, TID map per tree connect, FID map per open file, and search-handle map for enumeration continuation. + +### Phase 1: Share binding to VFS *(depends on session state)* +Instantiate one VFS backend per share at service start via `vfs.New(share.FSType, vfs.Params{Name, Path, ReadOnly})`, validate share roots, and enforce share read-only behavior at command handlers. + +### Phase 2: Command decode/encode scaffold *(depends on session state)* +Keep the existing dispatcher shape, but move command logic into dedicated handlers for incremental implementation and testability. Add a small error-mapping helper early (os/vfs errors → SMB status codes) to keep handlers consistent and testable. + +### Phase 3: Share enumeration MVP *(depends on phases 1–2)* +Keep RAP `NetServerEnum2` path working and harden it for stable output and stricter request validation for legacy clients. Ensure it enumerates configured SMB server identity plus observed browser servers. + +### Phase 4: Directory and file enumeration MVP *(depends on phases 1–2)* +Implement `SMB_COM_SEARCH` first (DOS/Win9x priority), then add `SMB_COM_TRANSACTION2` support for `TRANS2_FIND_FIRST2` and `TRANS2_FIND_NEXT2`. Use VFS `ReadDir` + `Stat`, wildcard matching, DOS attribute filtering, and optional shortname mapping when configured. + +### Phase 4: Search state and paging *(depends on enumeration)* +Add server-side enumeration handles, pagination/cursor continuation, timeout/cleanup, and `FIND_CLOSE2` handling where applicable. + +### Phase 5: Open/read/write/close core I/O *(depends on phases 1–2)* +Implement open path plus `READ_ANDX`, `WRITE_ANDX`, and `CLOSE` via VFS `OpenFile`, `ReadAt`, `WriteAt`, `Close`, with I/O size bounded by negotiated buffer size and robust SMB status-code mapping. + +### Phase 6: File locking *(depends on phase 5)* +Implement SMB-local byte-range lock table keyed by file identity + range + owner (session/FID), with overlap conflict detection and automatic release on close/session end. + +### Phase 7: Rename/move/delete for files and directories *(depends on phases 1–2 and 5)* +Implement rename/move via VFS `Rename` and delete semantics via VFS `Remove` with SMB-compatible precondition checks for both files and directories. + +### Phase 8: Copy fallback *(depends on phase 5)* +Implement copy as server-side read+write loop for MVP (same-share first), defer full SMB `COPY` command semantics unless client traces require it. + +### Phase 9: Transport hardening *(parallel with late phases)* +Verify parity across NetBIOS over NetBEUI, NetBIOS over IPX, and SMB direct IPX socket 0x0550. Ensure reply routing uses contextual session/datagram endpoints correctly and does not regress browser datagram handling. + +### Phase 10: Observability and cleanup *(parallel with phase 9)* +Add targeted debug logging and lifecycle counters for UID/TID/FID/search/lock events and session teardown cleanup. + +--- + +## Relevant files + +- `service/smb/server.go` — primary SMB command dispatcher; add state tables, per-command handlers, and lifecycle cleanup +- `service/smb/constants.go` — verify/add command and flag constants used by implemented SMB1 requests +- `service/smb/share.go` — share config contract consumed by VFS instantiation logic +- `service/smb/server_test.go` — extend with SMB session/enum/file-op tests, including transport-context cases +- `pkg/vfs/vfs.go` — leverage `FileSystem` and `File` interfaces directly for SMB backend operations +- `pkg/vfs/local_fs.go` — expected initial backend behavior for local share paths +- `service/netbios/service.go` — contextual session/datagram handling and routing constraints +- `service/smb/over_ipx_direct/transport.go` — SMB direct IPX transport path for socket 0x0550 +- `cmd/classicstack/smb_enabled.go` — SMB wiring into NetBIOS and direct IPX transport +- `cmd/classicstack/netbios_enabled.go` — NetBIOS transport selection for tcp, netbeui, ipx +- `spec/ms-smb.md` — normative SMB1 behavior reference for command semantics and status handling + +--- + +## Decisions + +| Decision | Choice | +|---|---| +| Client priority | Windows 95/98/ME and MS-DOS | +| Transport priority | SMB direct IPX 0x0550 and NetBIOS over NetBEUI/IPX | +| Auth mode | Guest-only for MVP | +| Operation order | Dependency-driven | +| Path ops scope | Files and directories in MVP | +| Copy mode | Read+write fallback for MVP | + +--- + +## Verification + +1. Expand SMB unit tests for each phase: session lifecycle, TID/FID allocation, search pagination, read/write boundaries, lock conflicts, rename/delete/copy outcomes. +2. Add temp-dir-backed tests for `local_fs` share behavior and read-only enforcement. +3. Add transport-level integration checks for netbeui + ipx + direct IPX 0x0550 using the same SMB request sequences. +4. Run manual DOS/Win9x smoke: browse shares, enumerate dirs/files, read/write, lock behavior, rename/move/delete/copy. +5. Re-run existing browser tests to ensure election/announcement/NetServerEnum2 behavior remains intact. + +--- + +## Further Considerations + +1. Prefer `SMB_COM_SEARCH` before full TRANS2 to maximise DOS/Win9x compatibility and reduce initial parser complexity. +2. Keep command parsing incremental in `service/smb/server.go` first; split into separate request/response files only after behaviour stabilises to avoid churn. +3. Add the error-mapping helper (`os/vfs error → SMB NTSTATUS`) early so all handlers share consistent status codes from the start. +4. Use `SessionContext.SourceConnID` as the session key when non-zero; fall back to the remote endpoint tuple for transports that don't provide it (e.g. direct IPX 0x0550). +5. Prefer `SMB_COM_SEARCH` first before full TRANS2 to maximize DOS/Win9x compatibility and reduce initial parser complexity. diff --git a/.github/workflows/pr-ci.yml b/.github/workflows/pr-ci.yml index 727ae07..e89eb92 100644 --- a/.github/workflows/pr-ci.yml +++ b/.github/workflows/pr-ci.yml @@ -84,6 +84,7 @@ jobs: - "afp macgarden macip" - "afp sqlite_cnid" - "all" + - "ipx netbeui smb" steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.gitignore b/.gitignore index 3a2c1a7..e2faaf0 100644 --- a/.gitignore +++ b/.gitignore @@ -42,4 +42,5 @@ go.work.sum .macgarden/ .captures/ -captures/ \ No newline at end of file +captures/ +classicstack diff --git a/.golangci.yml b/.golangci.yml index 369baac..a9dfc54 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -17,26 +17,24 @@ linters: - revive - staticcheck - unused - -linters-settings: - errorlint: - errorf: true - asserts: true - comparison: true - revive: + settings: + errorlint: + errorf: true + asserts: true + comparison: true + revive: + rules: + - name: var-naming + - name: package-comments + - name: exported + disabled: true + gocritic: + disabled-checks: + - ifElseChain + - singleCaseSwitch + exclusions: rules: - - name: var-naming - - name: package-comments - - name: exported - disabled: true - gocritic: - disabled-checks: - - ifElseChain - - singleCaseSwitch - -issues: - exclude-rules: - - path: _test\.go$ - linters: - - errcheck - - revive + - path: _test\.go$ + linters: + - errcheck + - revive diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index d73e15f..27932f6 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -1,223 +1,112 @@ -# ClassicStack Architecture - -ClassicStack is a Go AppleTalk Phase 2 router and AFP file server. It bridges -legacy Apple networking protocols to modern environments — EtherTalk -(raw Ethernet), LToUDP (multicast UDP), TashTalk (serial), and -virtual LocalTalk transports — and serves AFP volumes over both the -classic ASP/ATP/DDP stack and modern DSI/TCP. - -This document is the entry point for contributors. Read it once and -you should know where any piece of code lives, why, and what it can -import. - -## Module map - -``` -cmd/classicstack/ wiring only — flag/INI parsing, service registration -config/ single typed config tree; INI loader, validation -protocol/ wire format only (codec + constants, zero I/O) - ddp/ DDP datagram + MacRoman codec - (atp, asp, zip, rtmp, aep, llap, nbp to follow) -port/ link-layer transports (Port + RawLink) - ethertalk/ raw Ethernet via libpcap/Npcap, AARP - localtalk/ LocalTalk + LToUDP/TashTalk/Virtual backends - rawlink/ generic raw L2 link abstraction - nat/ OS-stack NAT helper (used by macip) -router/ Router, RoutingTable, ZoneInformationTable -service/ stateful services; compose protocol + port - afp/ Apple Filing Protocol server - asp/ dsi/ AFP transports (classic and modern) - atp/ AppleTalk Transaction Protocol - zip/ Zone Information Protocol - rtmp/ Routing Table Maintenance Protocol - aep/ AppleTalk Echo Protocol - llap/ LocalTalk Link Access Protocol - macip/ IP-over-AppleTalk gateway with NAT and DHCP relay - macgarden/ Macintosh Garden HTTP client (used by macgarden VFS) -pkg/ reusable, AppleTalk-agnostic - binutil/ allocation-free wire codec helpers, Wire interface - appledouble/ AppleDouble v2 sidecar format (parse/build) - cnid/ AFP Catalog Node IDs (memory + SQLite stores) - logging/ slog factory: handler config, level parsing - telemetry/ Counter/Gauge/Histogram via expvar (otel build tag) -netlog/ project logging API — Debug/Info/Warn facade over slog -spec/ Apple protocol references (read this when touching wire code) -``` - -## Layering rules - -``` -cmd → service → (protocol | port | pkg) - ↓ ↓ - (no I/O) (port-side) -``` - -- `protocol/*` has zero I/O, zero goroutines, zero state. Pure - encode/decode and constants. Cite the relevant `spec/` document in - the package doc comment. -- `port/*` owns the link layer. It knows about frames and addresses, - not about higher protocols. -- `service/*` owns sockets, sessions, and state machines. It composes - `protocol` codecs over `port` transports. -- `pkg/*` is reusable outside ClassicStack. It must not import anything - under `service/`, `port/`, `cmd/`, or `router/`. -- `internal/*` is private to ClassicStack. Mocks and shared test harness - live here. -- `cmd/classicstack/` does no business logic. It parses configuration - and wires services together. - -## Core interfaces - -| Interface | Where | Purpose | +# ClassicStack Runtime Map + +This document is intentionally high-level and operational. It describes +what currently runs in a ClassicStack process and how major subsystems +connect. For protocol-level details, use [spec](spec). + +## Purpose + +ClassicStack can run as a mixed classic networking stack with: + +- AppleTalk routing (EtherTalk + LocalTalk transports) +- AFP file service +- MacIP gateway +- Optional IPX, NetBEUI, NetBIOS, and SMB1 services + +## Runtime topology + +At startup, [cmd/classicstack/main.go](cmd/classicstack/main.go) builds +and wires components in this shape: + +~~~text +Config (TOML or flags) + -> Bridge/raw-link setup + -> Port setup (LToUDP, TashTalk, EtherTalk) + -> AppleTalk router + core AppleTalk services + -> Optional protocol hooks (MacIP, IPX, NetBEUI, NetBIOS, SMB) + -> Optional AFP service wiring +~~~ + +Each optional subsystem is controlled by both config enable flags and +Go build tags. + +## Build-tag gated subsystems + +| Subsystem | Build tag | Primary config section | |---|---|---| -| `port.Port` | [port/port.go](port/port.go) | Unicast/Broadcast/Multicast frame transport | -| `port.BridgeConfigurable` | [port/port.go](port/port.go) | Optional bridge-mode and host-MAC knobs | -| `port/localtalk.FrameSender` | [port/localtalk/localtalk.go](port/localtalk/localtalk.go) | Backend hook for LocalTalk variants | -| `port/rawlink.RawLink` | [port/rawlink/](port/rawlink/) | Raw L2 read/write — used by EtherTalk and MacIP | -| `service.Service` | [service/service.go](service/service.go) | Object plugged into the router by socket | -| `service.Router` | [service/service.go](service/service.go) | What services see of the router | -| `afp.FileSystem` | [service/afp/fs.go](service/afp/fs.go) | Pluggable AFP volume backend | -| `cnid.Store` | [pkg/cnid/cnid.go](pkg/cnid/cnid.go) | Catalog Node ID persistence | -| `binutil.Wire` (canonical shape) | [pkg/binutil/binutil.go](pkg/binutil/binutil.go) | `MarshalWire`/`UnmarshalWire`/`WireSize` | - -## Configuration - -Single typed tree in `config/`. Two loaders feed it: - -1. TOML — `config.Load(path)` parses `server.toml` via `knadh/koanf` - with the `pelletier/go-toml` v2 parser. -2. Flags — `cmd/classicstack/main.go` overlays CLI flags on top of the - file defaults. - -`config.Root.Validate()` runs once before services start. Services -receive typed subtrees at construction time. Construction options -are immutable: ports do not mutate themselves after `Start()`. - -## Logging and telemetry - -ClassicStack has two logging packages with distinct jobs: - -- **`netlog/`** is the call-site API. Services and ports use - `netlog.Debug`, `netlog.Info`, `netlog.Warn`. The facade keeps call - sites short (no per-package `*slog.Logger` plumbing) while still - routing through whatever structured handler `cmd/classicstack` installs. -- **`pkg/logging/`** is the slog factory used once at startup. - `cmd/classicstack` calls `logging.New("ClassicStack", ...)` to build a - `*slog.Logger` with the configured handler (console, JSON, or both) - and installs it via `netlog.SetLogger`. Use this directly only when - you need a `*slog.Logger` value — e.g. attaching structured fields - with `.With` for the lifetime of an object. - -Sources are tagged in two complementary ways: messages carry a -`[AFP]` / `[ASP]` / `[EtherTalk]` prefix that grep finds in either -format, and the slog handler stamps every record with a `source` -attribute that JSON consumers can filter on. - -Stdlib `log.Printf` and `log.Fatal` are not used inside library code. -`cmd/classicstack/main.go` uses `log.Fatal*` only for unrecoverable startup -errors before any logger is wired. - -Telemetry is `pkg/telemetry`, separate from logs. Default backend is -`expvar` (stdlib, zero deps). Initial counters: -- `classicstack_router_frames_in_total` -- `classicstack_afp_commands_total` -- `classicstack_aarp_probe_retries_total` - -A future `//go:build otel` file will swap in an OpenTelemetry backend -without touching call sites. - -## Wire codec convention - -The canonical shape lives in [pkg/binutil/binutil.go](pkg/binutil/binutil.go): - -```go -type Wire interface { - MarshalWire(b []byte) (n int, err error) // append-style, no alloc - UnmarshalWire(b []byte) (n int, err error) - WireSize() int -} -``` - -Implementations live alongside their model types. `pkg/binutil` provides -allocation-free `PutU8/16/32/64`, `GetU8/16/32/64`, and Pascal-string -helpers. Errors: -- `binutil.ErrShortBuffer` for buffer-too-small. -- `binutil.ErrMalformed` for invalid prefixes / enum values. - -Migrated so far: ASP `WriteContinuePacket`, ATP `ATPHeader`, DSI `Header`. -Other wire models still use raw `binary.BigEndian` calls; migration -proceeds one type per commit with golden hex round-trip tests. - -## Timer and retry patterns - -ClassicStack does not use exponential backoff. The protocols predate it. -Three canonical shapes: - -1. **Reliable-delivery retransmits** (ATP-style). Per-transaction - `retryTimeout` + `retriesLeft` counter, an injectable `Clock.AfterFunc` - so tests control time. Exemplar: `service/atp/transaction.go`. -2. **Periodic polling** (AARP probe, AMT aging, routing-table aging). - `time.NewTicker` from a goroutine that selects on `<-ctx.Done()` - (or `<-stop`). The tick cadence *is* the policy. Exemplar: - `port/ethertalk/ethertalk.go:acquireAddressRun`. -3. **One-shot waits** (LocalTalk CTS response, DSI request/reply). - `time.NewTimer` + `select { case <-timer.C: ...; case <-resp: ... }`. - -If a future consumer genuinely needs exponential backoff, extract it -then. Don't speculate. - -## AFP architecture - -AFP supports two transport stacks simultaneously: -- **Classic**: DDP → ATP → ASP → AFP -- **Modern**: TCP → DSI → AFP - -Both deliver into a shared `afp.CommandHandler`. Today that handler is -the 525-line switch in [service/afp/server.go](service/afp/server.go). -A future commit decomposes it into a registry of per-command handlers -under `service/afp/commands/`. - -AppleDouble metadata is stored either as `._filename` sidecars or in -`.appledouble/` folders (Netatalk-compatible). The sidecar **format** -lives in [pkg/appledouble](pkg/appledouble/); the AFP-specific -`ForkMetadataBackend` (which talks to the host filesystem) stays in -`service/afp/`. - -CNID tracking goes through [pkg/cnid](pkg/cnid/) with two backends: -in-memory (default for tests) and SQLite (`modernc.org/sqlite`, -default for production). Each volume gets its own `cnid.Store`. - -## File system backends - -`service/afp` defines `FileSystem` (see [service/afp/fs.go](service/afp/fs.go)). -The shipped backend is `LocalFileSystem`. A `macgarden_fs.go` backend -exists alongside it; a future commit relocates it to -`service/afpfs/macgarden/` behind `//go:build macgarden`, registered -through a factory map in `afp` so adding new backends does not modify -the core package. - -## Spec references - -The `spec/` directory contains 14 markdown documents describing the -protocols this codebase implements. Start with `spec/00-overview.md` -for DDP socket assignments and service interface contracts before -modifying router or service code. PRs touching protocol semantics -must cite the relevant section. - -## Glossary - -- **DDP**: Datagram Delivery Protocol. AppleTalk's network layer. -- **ATP**: AppleTalk Transaction Protocol. Reliable request/response. -- **ASP**: AppleTalk Session Protocol. Sessions over ATP. -- **DSI**: Data Stream Interface. AFP transport over TCP. -- **ZIP**: Zone Information Protocol. -- **RTMP**: Routing Table Maintenance Protocol. -- **AEP**: AppleTalk Echo Protocol. -- **NBP**: Name Binding Protocol. -- **AFP**: Apple Filing Protocol. -- **CNID**: Catalog Node ID. AFP's persistent file/directory identifier. -- **AppleDouble**: Sidecar format for storing resource forks and Finder - metadata on non-HFS filesystems. -- **AARP**: AppleTalk Address Resolution Protocol (Ethernet-side). -- **LLAP**: LocalTalk Link Access Protocol. -- **MacIP**: IP-over-AppleTalk gateway protocol. +| IPX | ipx or all | [IPX] | +| NetBEUI | netbeui or all | [NetBEUI] | +| NetBIOS | netbios or all | [NetBIOS] | +| SMB | smb or all | [SMB] | +| AFP extras (project-specific variants) | afp/all/macgarden/etc | [AFP] | + +If a tag is not present, enable flags/keys for that subsystem are +ignored by a disabled stub implementation. + +## Shared raw-link bridge model + +Raw-link protocols share one bridge identity and backend selection via +[Bridge] in config: + +- mode: pcap, tap, tun +- device: selected interface/device +- hw_address: shared host MAC identity +- bridge_mode: auto, ethernet, wifi + +Consumers that can use shared bridge defaults: + +- EtherTalk +- MacIP +- IPX +- NetBEUI + +In pcap mode, each of those protocols can also apply a protocol-specific +BPF override filter. + +## Protocol groups + +### AppleTalk group + +- Ports: EtherTalk, LToUDP, TashTalk +- Router: AppleTalk datagram dispatch and routing +- Services: RTMP, ZIP, NBP, AEP, LLAP, ATP, ASP, AFP transport hooks + +### File services group + +- AFP service (DDP and/or TCP depending on [AFP].protocols) +- SMB service (if built and enabled) +- SMB shares are configured under [SMB.Volumes.*] +- AFP volumes are configured under [AFP.Volumes.*] + +### Legacy LAN interop group + +- MacIP gateway (pcap or nat mode) +- IPX router + RIP/SAP services +- NetBEUI port +- NetBIOS service over selected transports (tcp, netbeui, ipx) +- SMB can use NetBIOS and optional direct IPX transport path when IPX is active + +## Configuration flow + +1. [server.toml](server.toml) is loaded when no flags are passed. +2. When -config is used, it cannot be mixed with other flags. +3. Config is resolved into a cmd-level appConfig. +4. Bridge settings are synchronized into raw-link consumers. +5. Components are wired and started. + +Important policy: + +- Legacy EtherTalk bridge identity keys in file config are rejected. +- Use [Bridge] as the only config-file source for backend/device/MAC/frame mode. + +## Logging and captures + +- Runtime logging is configured by [Logging]. +- Optional frame capture output is configured by [Capture]. +- Capture outputs currently support LocalTalk/EtherTalk/IPX streams. + +## Where to look next + +- Operator quickstart and config tables: [README.md](README.md) +- Protocol notes and behavior references: [spec](spec) +- Runtime wiring entrypoint: [cmd/classicstack/main.go](cmd/classicstack/main.go) diff --git a/CLAUDE.md b/CLAUDE.md index a68af64..98b1003 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -13,7 +13,7 @@ ClassicStack is a Go-based AppleTalk Phase 2 router and AFP file server. It brid ```bash # Build -go build -o classicstack ./cmd/classicstack +go build -tags all -o classicstack ./cmd/classicstack # Run all tests go test ./... diff --git a/README.md b/README.md index 9859074..4dffff1 100644 --- a/README.md +++ b/README.md @@ -4,100 +4,48 @@ # ClassicStack -### ClassicStack is a all-in-one AppleTalk Phase 2 router, MacIP Router and AFP file server for bridging classic Apple networking into modern environments. 🍏💾 +ClassicStack is an AppleTalk router and classic LAN services stack that bridges legacy Macintosh networking into modern environments. -## Architecture +## What it does -For a guided tour of the codebase — package layout, layering rules, -core interfaces, logging/telemetry, and the AFP design — see -[ARCHITECTURE.md](ARCHITECTURE.md). +- AppleTalk Phase 2 routing across EtherTalk and LocalTalk transports. +- AFP file server over both classic DDP and modern TCP transports. +- MacIP gateway for IP-over-AppleTalk clients. +- Optional IPX, NetBEUI, NetBIOS, and SMB1 services (build-tag gated). +- Shared raw-link bridge settings for EtherTalk, MacIP, IPX, and NetBEUI. -## Features - -- Cross Platform Support: runs on Windows, MacOS and Linux. -- 100% user-mode code, no special kernels or features needed. -- AppleTalk routing across multiple transports. -- EtherTalk support via pcap, plus tap/tun backend options. -- LocalTalk via LToUDP and TashTalk serial adapters. -- AFP file server running over both DDP (ASP/ATP) and TCP (DSI). -- MacIP gateway support with both a bridged mode and NAT mode. -- Zone and routing protocols (RTMP/ZIP/NBP) implemented as router services. - - - -## Quick start - -- Copy server.toml.example to server.toml and edit values. -- Run ClassicStack with no flags to auto-load server.toml. -- Or pass a config file explicitly with -config. - -Examples: - -~~~bash -./classicstack -config server.toml -~~~ - -~~~powershell -.\classicstack.exe -config server.toml -~~~ - -Config-loading rule: - -- -config cannot be combined with other flags. -- If no flags are supplied, ClassicStack auto-loads server.toml if present. - ---- - -## License - - Currently GPL3. - - -## Build instructions +## Build Requirements: - Go 1.23+ -- On Windows for EtherTalk/pcap: [Npcap](https://npcap.com/#download) -- On Linux/macOS for EtherTalk/pcap: libpcap +- Npcap on Windows for pcap mode: https://npcap.com/#download +- libpcap on Linux/macOS for pcap mode -Build from repository root: +Build default binary (all optional protocol hooks enabled): ~~~bash -go build ./cmd/classicstack +go build -tags all -o classicstack ./cmd/classicstack ~~~ -Build with explicit binary name: +Build with a custom protocol tag set: ~~~bash -go build -o classicstack ./cmd/classicstack +go build -tags "ipx netbeui netbios smb" -o classicstack ./cmd/classicstack ~~~ -Build with explicit semantic version metadata: +or: ~~~bash -go build -trimpath \ - -ldflags "-X main.BuildVersion=1.2.3 -X main.BuildCommit=$(git rev-parse --short HEAD) -X main.BuildDate=$(date -u +%Y-%m-%dT%H:%M:%SZ)" \ - -o classicstack ./cmd/classicstack +go build -tags all -o classicstack ./cmd/classicstack ~~~ -Build using the shared local/CI scripts: +Build router-only variant (no optional build-tag services): ~~~bash -bash scripts/ci/build.sh -bash scripts/ci/test.sh -~~~ - -~~~powershell -./scripts/ci/build.ps1 -./scripts/ci/test.ps1 -~~~ - -Print runtime/build version info: - -~~~bash -./classicstack -version +go build -o classicstack ./cmd/classicstack ~~~ Run tests: @@ -106,418 +54,217 @@ Run tests: go test ./... ~~~ -## CI and releases - -- Pull requests to `main`/`master` run GitHub Actions CI for tests and cross-platform builds. -- Pushes (including merges) to `main` publish a `dev-*` prerelease. -- Pushing a SemVer tag like `v1.2.3` publishes a stable release for that tag. -- GitHub Actions calls the same scripts under `scripts/ci/` that you can run locally. -- Release assets are produced for Linux, macOS, and Windows. -- Release packages include the repository `dist/` content. -- Windows release binaries include icon and file version metadata from `icons/classicstack.ico`. -- macOS release bundles include app icon metadata from `icons/classicstack.icns`. -- Go build/test already ignores non-Go folders; additionally `scripts/ci/test.sh` and `scripts/ci/test.ps1` explicitly exclude `dist`, `icon`, and `icons` from the package list. - -## Status and provenance -> **Warning:** large parts of this codebase were developed in a "vibe coded" style. It appears to work in real use, but treat behavior as pragmatic rather than formally verified. - -## Attribution -- The AppleTalk routing is based on tashrouter by lampmerchant: https://github.com/lampmerchant/tashrouter (in-fact it's basically an LLM port). - - -## AppleTalk Routing - -Route AppleTalk between EtherTalk and LocalTalk ports, with RTMP/ZIP/NBP services provided by the router. - -### At a glance - -- Ports: EtherTalk (pcap/tap/tun), LToUDP, TashTalk. -- Core keys: `[LToUdp]`, `[TashTalk]`, `[EtherTalk]`. -- Wi-Fi note: use `bridge_mode=wifi` when adapters/APs reject non-host source MACs. +## Quick start -### Listing interfaces on Windows +1. Copy [server.toml.example](server.toml.example) to server.toml. +2. Edit bridge/device/network values. +3. Run with no flags (auto-loads server.toml) or pass -config. -Use the built-in pcap listing mode: +Examples: -~~~powershell -.\classicstack.exe -list-pcap-devices +~~~bash +./classicstack -config server.toml ~~~ -This prints available interface names and pcap device IDs. Use the device string in [EtherTalk] device, for example: - -~~~ini -device = "\Device\NPF_{YOUR-GUID-HERE}" +~~~powershell +.\classicstack.exe -config server.toml ~~~ -Tip: [install Npcap](https://npcap.com/#download) first, otherwise pcap devices may not appear. +Config loading rules: -### Example interface configs (Linux, macOS, Windows) +- -config cannot be combined with other flags. +- When no flags are passed, server.toml is loaded automatically if present. -These examples show only relevant keys; merge into your full server.toml. +## Shared bridge model -Linux example: +Bridge defaults live in [Bridge] and are reused by EtherTalk, MacIP, IPX, and NetBEUI. -~~~toml -[LToUdp] -enabled = true -interface = "192.168.1.10" - -[EtherTalk] -backend = "pcap" -device = "eth0" -hw_address = "DE:AD:BE:EF:CA:FE" -seed_network_min = 3 -seed_network_max = 5 -seed_zone = "EtherTalk Network" -~~~ +| Key | Type | Default | Description | +|---|---|---|---| +| mode | string | pcap | Raw-link backend: pcap, tap, tun. | +| device | string | (empty) | Interface/device name used by shared raw-link consumers. | +| hw_address | string | DE:AD:BE:EF:CA:FE | Shared host MAC identity. | +| bridge_mode | string | auto | Frame adaptation mode: auto, ethernet, wifi. | -macOS example: +Important: legacy bridge keys under [EtherTalk] are no longer accepted in config files. Use [Bridge] only. -~~~toml -[LToUdp] -enabled = true -interface = "192.168.1.20" - -[EtherTalk] -backend = "pcap" -device = "en0" -hw_address = "DE:AD:BE:EF:CA:FE" -seed_network_min = 3 -seed_network_max = 5 -seed_zone = "EtherTalk Network" -~~~ +Per-protocol pcap filter overrides: -Windows example: +- [EtherTalk].filter +- [MacIP].filter +- [IPX].filter +- [NetBEUI].filter -~~~toml -[LToUdp] -enabled = true -interface = "0.0.0.0" - -# On Windows, use TOML literal strings (single quotes) so backslashes are not -# interpreted as escapes by the parser. -[EtherTalk] -backend = "pcap" -device = '\Device\NPF_{1DFDAA9C-7DD4-40F8-B6D4-9298C273D654}' -hw_address = "DE:AD:BE:EF:CA:FE" -bridge_mode = "auto" -seed_network_min = 3 -seed_network_max = 5 -seed_zone = "EtherTalk Network" -~~~ +These filters apply only in pcap mode. -### Configuration reference +## Transport and service sections ### [LToUdp] -| Key | Type | Default | Description | -|---|---|---|---| -| enabled | bool | true | Enables LToUDP LocalTalk port. | -| interface | string | 0.0.0.0 | Local IPv4 address used for multicast join/send. 0.0.0.0 means auto/default interface. | -| seed_network | uint | 1 | Seed network number for this LocalTalk segment. | -| seed_zone | string | LToUDP Network | Seed zone name advertised for LToUDP. | +| Key | Default | Notes | +|---|---|---| +| enabled | true | Enables LocalTalk-over-UDP port. | +| interface | 0.0.0.0 | Local IPv4 bind/join interface. | +| seed_network | 1 | Seed network ID for this segment. | +| seed_zone | LToUDP Network | Seed zone name. | ### [TashTalk] -| Key | Type | Default | Description | -|---|---|---|---| -| port | string | (empty) | Serial port path/name for TashTalk. Empty disables TashTalk. | -| seed_network | uint | 2 | Seed network number for TashTalk segment. | -| seed_zone | string | TashTalk Network | Seed zone name advertised for TashTalk. | +| Key | Default | Notes | +|---|---|---| +| port | (empty) | Serial device path/name; empty disables. | +| seed_network | 2 | Seed network ID for this segment. | +| seed_zone | TashTalk Network | Seed zone name. | ### [EtherTalk] -| Key | Type | Default | Description | -|---|---|---|---| -| backend | string | pcap | Backend type: blank, pcap, tap, or tun. Blank disables EtherTalk. | -| device | string | (empty) | Interface/device identifier. For pcap this is adapter name/device ID. | -| hw_address | string | DE:AD:BE:EF:CA:FE | Router MAC address used by EtherTalk port. | -| bridge_mode | string | auto | Bridge mode: auto, ethernet, or wifi. | -| bridge_host_mac | string | (empty) | Optional host adapter MAC for Wi-Fi bridge shim logic. | -| seed_network_min | uint | 3 | Minimum network in seeded EtherTalk range. | -| seed_network_max | uint | 5 | Maximum network in seeded EtherTalk range. | -| seed_zone | string | EtherTalk Network | Seed zone for EtherTalk. | - -#### EtherTalk bridge modes - -- `bridge_mode=auto`: Detects medium and picks `ethernet` for wired links or `wifi` for wireless links. -- `bridge_mode=ethernet`: Raw pass-through bridging. Frames are forwarded without MAC rewrite. -- `bridge_mode=wifi`: Enables Wi-Fi bridge shim behavior for adapters/APs that do not allow arbitrary source MACs. - -Why `wifi` mode exists: - -- Many Wi-Fi adapters and AP paths reject or rewrite frames when the source MAC does not match the host adapter MAC. -- On Windows, the miniport/NDIS path commonly drops transmit frames when source hardware address does not match the host adapter MAC. -- In `wifi` mode ClassicStack rewrites outbound EtherTalk frame source MAC to the host adapter MAC and updates AARP hardware fields accordingly. -- For inbound traffic, ClassicStack reverses destination rewrite using a short-lived peer-to-virtual mapping so the EtherTalk port still sees the expected virtual MAC identity. -- This is effectively an L2 NAT-style shim for MAC identities (not MacIP IP-layer NAT). - -Recommended settings: - -- On Wi-Fi, set `bridge_mode=wifi` (or leave `auto` and verify it detected Wi-Fi correctly). -- Set `bridge_host_mac` to your actual Wi-Fi adapter MAC when needed; if blank, ClassicStack falls back to `hw_address`. -- On wired Ethernet, prefer `bridge_mode=ethernet` or `auto`. - -##### Wi-Fi troubleshooting - -Common symptoms: - -- You see AppleTalk traffic in one direction only. -- AARP appears unanswered even when peers are present. -- ClassicStack works on wired Ethernet but fails on the same host over Wi-Fi. - -Checks and fixes: - -- Force `bridge_mode=wifi` instead of relying on `auto` while testing. -- Set `bridge_host_mac` to the real Wi-Fi adapter MAC shown by your OS/NIC tools. -- On Windows, confirm the adapter MAC did not randomize or change after reconnect; update `bridge_host_mac` if it did. -- Ensure your WLAN does not enable client isolation/AP isolation when testing peer-to-peer visibility. -- Verify you selected the intended pcap device (especially when multiple virtual/VPN adapters exist). - -## MacIP Gateway - -Provide IP connectivity to AppleTalk clients via a MacIP gateway. - -### At a glance - -- Use `mode=nat` when upstream routers cannot install static routes to your MacIP client subnet. -- Use `mode=pcap` for bridged/static-pool style behavior. -- Use `dhcp_relay=true` to relay/translate DHCP for MacIP clients instead of relying only on static gateway semantics. - -Example NAT-oriented configuration: - -~~~toml -[MacIP] -enabled = true -mode = "nat" -zone = "EtherTalk Network" -nat_subnet = "192.168.100.0/24" -nat_gw = "192.168.100.1" -ip_gateway = "192.168.1.1" -nameserver = "192.168.1.1" -dhcp_relay = false -lease_file = "leases.txt" -~~~ +| Key | Default | Notes | +|---|---|---| +| bridge_host_mac | (empty) | Optional host adapter MAC for wifi bridge shim. | +| filter | (protocol default) | Optional BPF override in pcap mode. | +| seed_network_min | 3 | Seed network range start. | +| seed_network_max | 5 | Seed network range end. | +| seed_zone | EtherTalk Network | Seed zone name. | ### [MacIP] -| Key | Type | Default | Description | -|---|---|---|---| -| enabled | bool | false | Enables MacIP service. | -| mode | string | pcap | MacIP mode: pcap (bridged/static-pool behavior) or nat. | -| zone | string | (empty) | Zone used for MacIP NBP registration. Empty falls back to EtherTalk/first zone. | -| nat_subnet | string | 192.168.100.0/24 | MacIP subnet CIDR for address assignment/NAT pool. | -| nat_gw | string | (empty) | Gateway IP presented to MacIP clients in NAT mode. | -| lease_file | string | (empty in code; example uses leases.txt) | Optional path for lease persistence across restarts. | -| ip_gateway | string | (empty) | Upstream/default gateway IP on IP-side network. | -| dhcp_relay | bool | false | Enables DHCP relay/translation mode for MacIP clients. | -| nameserver | string | (empty) | DNS server advertised to MacIP clients. | - -## AFP - -ClassicStack includes an AFP file server focused on AFP 2.0-level behavior, with selective AFP 2.1/2.2 calls, exposed over both classic AppleTalk transport and modern TCP transport: +| Key | Default | Notes | +|---|---|---| +| enabled | false | Enables MacIP gateway. | +| mode | pcap | pcap or nat. | +| zone | (empty) | Registration zone override. | +| nat_subnet | 192.168.100.0/24 | Subnet/pool for NAT mode. | +| nat_gw | (empty) | Gateway address advertised in NAT mode. | +| lease_file | (empty) | Optional lease persistence file. | +| ip_gateway | (empty) | Upstream gateway address. | +| dhcp_relay | false | Translate/relay DHCP for clients. | +| nameserver | (empty) | DNS server for clients. | +| filter | (protocol default) | Optional BPF override in pcap mode. | -- DDP stack: DDP -> ATP -> ASP -> AFP -- TCP stack: TCP -> DSI -> AFP -- Advertised AFP versions: AFPVersion 2.0 and AFPVersion 2.1 +### [IPX] -### AFP feature status +IPX is optional and requires build tag ipx or all. -Supported: +| Key | Default | Notes | +|---|---|---| +| enabled | false | Enables IPX router services. | +| interface | (empty) | Raw-link interface; empty reuses bridge device. | +| framing | ethernet_ii | One of ethernet_ii, raw_802_3, llc, snap. | +| internal_network | (empty) | 8 hex digits; empty falls back to default network. | +| filter | ipx (internal default) | Optional BPF override in pcap mode. | -- Core volume, directory, file, fork, and enumerate operations. -- Desktop database operations (icons, APPL mappings, comments). -- File extension to type/creator fallback via extension map. +### [NetBEUI] -Unsupported or limited: +NetBEUI is optional and requires build tag netbeui or all. -- Catalog search (`FPCatSearch`) is currently not implemented. -- Multi-phase login continuation (`FPLoginCont`) is not implemented. -- `FPChangePassword` and `FPGetUserInfo` return call-not-supported. +| Key | Default | Notes | +|---|---|---| +| enabled | false | Enables NetBEUI raw-link port. | +| interface | (empty) | Raw-link interface; empty reuses bridge device. | +| filter | llc (internal default) | Optional BPF override in pcap mode. | -### Authentication model +### [NetBIOS] -- Server info advertises `No User Authent`. -- Runtime behavior is effectively guest/no-user-auth. -- The internal cleartext-password path exists in code but is not exposed via current runtime config. +NetBIOS is optional and requires build tag netbios or all. -### AFP configuration overview - -#### Server identity and transports - -- Set server display name with `[AFP] name`. -- Select transports with `[AFP] protocols` (`ddp`, `tcp`, or both). -- Set DSI listen address with `[AFP] binding`. - -### [AFP] - -These keys are server-wide; per-volume options live in `[Volumes.]` (see below). - -| Key | Type | Default | Description | -|---|---|---|---| -| enabled | bool | true | Enables AFP service. | -| name | string | Go File Server | NBP-advertised AFP server name. | -| zone | string | (empty) | Zone for AFP registration. Empty uses router-selected default. | -| protocols | string | tcp,ddp | Enabled AFP transports: tcp, ddp, or both comma-separated. | -| binding | string | :548 | TCP listen address for DSI AFP. | -| extension_map | string | (empty) | Path to Netatalk-compatible extension map file. Relative paths are resolved from the config file's directory. | -| use_decomposed_names | bool | true | Encode host-reserved filename characters as `0xNN` tokens in AFP mapping. Server-wide. | -| cnid_backend | string | sqlite | CNID backend used by all volumes: `sqlite` (when built with the `sqlite_cnid` or `all` tag) or `memory`. | -| desktop_backend | string | sqlite | Backend for the AFP desktop database (icons, APPL mappings, comments). | -| appledouble_mode | string | modern | Default metadata layout: `modern` (`._` sidecars) or `legacy` (`.AppleDouble/` directories). Volumes may override. | -| persistent_volume_ids | bool | true | Persist per-volume IDs across restarts so clients keep their aliases. | +| Key | Default | Notes | +|---|---|---| +| enabled | false | Enables NetBIOS service. | +| transports | ["tcp"] | Allowed values: tcp, netbeui, ipx. | +| scope_id | (empty) | Optional NetBIOS scope ID. | -#### Filename mapping and encoding +NetBIOS server/workgroup identity is derived from SMB server/workgroup values. -Behavior: +### [SMB] -- AFP names are converted between MacRoman (wire) and UTF-8 (host filesystem). -- With `use_decomposed_names=true` (default), host-reserved filename characters are escaped as `0xNN` tokens. -- Reserved-character escaping is platform-aware (Windows has a larger reserved set than POSIX). +SMB is optional and requires build tag smb or all. -#### Extension mapping (extmap.conf) +| Key | Default | Notes | +|---|---|---| +| enabled | false | Enables SMB server. | +| nbt_binding | :139 | NetBIOS-over-TCP listener. | +| direct_binding | (empty) | Optional direct SMB listener (for example :445). | +| guest_ok | false | Allows guest sessions. | +| server_name | CLASSICSTACK | Computer/server name. | +| workgroup | WORKGROUP | Workgroup/domain label. | -Use `[AFP] extension_map` to provide Macintosh type/creator metadata for files based on extension. +SMB shares are configured as [SMB.Volumes.] sections. -Example in `server.toml`: +Example: ~~~toml -[AFP] +[SMB] enabled = true -extension_map = "extmap.conf" +nbt_binding = ":139" +guest_ok = true +server_name = "CLASSICSTACK" +workgroup = "WORKGROUP" + +[SMB.Volumes.Public] +name = "Public" +path = "./public" +fs_type = "local_fs" +read_only = false ~~~ -Format rules: - -- One mapping per non-empty line. -- Lines starting with `#` are comments. -- First token is the extension key (typically with leading dot, for example `.txt`). -- Next two quoted fields are required: `"TYPE"` and `"CREA"`. -- `TYPE` and `CREA` must each be exactly 4 bytes. -- A default `.` mapping is required and is used when no specific extension match exists. -- Extension matching is case-insensitive (`ReadMe.TXT` matches `.txt`). - -Examples (from the shipped `extmap.conf`): - -~~~text -. "????" "????" Unix Binary Unix application/octet-stream -.txt "TEXT" "ttxt" ASCII Text SimpleText text/plain -.bin "SIT!" "SITx" MacBinary StuffIt Expander application/macbinary -.hqx "TEXT" "SITx" BinHex StuffIt Expander application/mac-binhex40 -.sit "SIT!" "SITx" StuffIt 1.5.1 Archive StuffIt Expander application/x-stuffit -~~~ - -Notes: +### [AFP] -- In `extmap.conf`, many mappings are disabled by default with `#`; remove `#` to enable a line. -- Extra columns after the first three fields are allowed and treated as descriptive metadata. +AFP runs over ddp, tcp, or both. -### [Volumes.] +| Key | Default | Notes | +|---|---|---| +| enabled | true | Enables AFP service. | +| name | ClassicStack (example) | Advertised AFP server name. | +| zone | (empty) | Registration zone override. | +| protocols | ddp,tcp | AFP transports. | +| binding | :548 | DSI listener. | +| extension_map | (empty) | Extension map file path. | +| cnid_backend | sqlite | sqlite or memory. | +| use_decomposed_names | true | Reserved-character mapping behavior. | +| appledouble_mode | modern | modern or legacy sidecar layout. | -Each volume is configured as a separate `[Volumes.]` section. The section suffix is used as the volume name unless `name` is set. +AFP volumes are configured as [AFP.Volumes.] sections. -> Note: `cnid_backend`, `use_decomposed_names`, and the default `appledouble_mode` are server-wide settings under `[AFP]` — they are not configurable per volume. A volume may override `appledouble_mode` to choose a sidecar layout that differs from the server default. +## Logging and capture -| Key | Type | Default | Description | -|---|---|---|---| -| name | string | section suffix | Display name for the AFP volume (max 31 chars recommended). | -| path | string | required (except for `macgarden`) | Host filesystem path to export. For `fs_type = "macgarden"` a default path is derived from `name` if omitted. | -| fs_type | string | local_fs | Filesystem backend: `local_fs` (host disk) or `macgarden` (read-only virtual Macintosh Garden view, requires the `macgarden` or `all` build tag). | -| password | string | (empty) | Optional volume password. The internal cleartext-password path exists in code but is not exposed via the live authentication flow today. | -| read_only | bool | false | Exports the volume as read-only at AFP protocol level. | -| rebuild_desktop_db | bool | false | Rebuilds AFP desktop database from resource fork metadata at startup. | -| appledouble_mode | string | inherits `[AFP] appledouble_mode` | Per-volume override of the metadata layout: `modern` (`._` sidecars) or `legacy` (`.AppleDouble/` directories). | +[Logging]: -#### Read-only volume behavior +- level: debug, info, warn +- parse_packets: protocol decode logging +- parse_output: file target for parsed logs +- log_traffic: raw traffic logging -When `read_only=true` is set on a volume: +[Capture]: -- `FPGetVolParms` reports the volume read-only flag (VolAttrReadOnly, bit 15). -- Directory access rights are returned as read-only in directory parameter replies. -- File attributes include WriteInhibit (ReadOnly in AFP 2.0 terminology). -- Write and metadata-mutating operations are denied. +- localtalk, ethertalk, ipx capture output paths +- snaplen for capture truncation length -Error code behavior by AFP version: +## Useful commands -- AFP 2.0 and higher: returns `kFPVolLocked` (`-5031`). -- AFP 1.1 compatibility mode: returns `kFPAccessDenied`. +List pcap devices: -Example: - -~~~toml -[Volumes.Sample] -path = "dist/Sample Volume" -read_only = true +~~~powershell +.\classicstack.exe -list-pcap-devices ~~~ -Volume naming: - -- Volume names are sent as Pascal strings on AFP (1-byte length). Keep names <=255 bytes. -- For classic Finder compatibility and UI quality, keep names short (31 chars recommended). - -#### Sidecar metadata - -- AppleDouble is the only resource-fork/metadata storage backend. -- `appledouble_mode=modern` uses `._filename` sidecars beside files. -- `appledouble_mode=legacy` uses `.AppleDouble/filename` sidecars. -- The default mode comes from `[AFP] appledouble_mode`; individual volumes may override it. -- `rebuild_desktop_db=true` (per volume) rebuilds desktop metadata cache at startup. +Print version: -#### Netatalk compatibility - -- Compatible formats: Netatalk-style extension map syntax and AppleDouble modern/legacy sidecar layouts. -- Known differences: CNID database implementation is ClassicStack-specific (sqlite or memory), not a drop-in Netatalk CNID store. -- ClassicStack does not currently provide a Netatalk-style extended-attribute metadata backend. -- AFP feature coverage is practical but incomplete (for example catalog search is currently implemented as name-based search and backend-dependent). - -### [Logging] - -| Key | Type | Default | Description | -|---|---|---|---| -| level | string | info | Log level: debug, info, warn. | -| parse_packets | bool | false | Decodes and logs inbound DDP packets and upper protocol layers. | -| parse_output | string | (empty) | Optional output file path for parsed packet logs. | -| log_traffic | bool | false | Enables low-level traffic logging at debug level. | - -## Command-line quick reference - -Common operational flags: - -- -config -- -list-pcap-devices -- -log-level and -log-traffic -- -parse-packets and -parse-output -- -afp-volume (repeatable Name:Path) - -Use server.toml for repeatable deployments; use flags for quick experiments. - -## Rough project layout - -- cmd/classicstack: entrypoint, flag handling, TOML config loading, runtime wiring. -- router: datagram dispatch, routing table, zone information table. -- port: transport implementations (EtherTalk, LocalTalk variants, rawlink, NAT helpers). -- service: protocol/application services (AEP, RTMP, ZIP, ASP/ATP/DSI, AFP, MacIP, LLAP). -- appletalk and protocol/ddp: packet/datagram and protocol encoding helpers. -- spec: protocol and subsystem design notes. - -## Contributing +~~~bash +./classicstack -version +~~~ -Contributions are welcome. +## Status and attribution -Suggested workflow: +Warning: this project is pragmatic and evolving. Validate behavior in your environment before production use. -1. Open an issue describing the bug, protocol behavior, or enhancement. -2. Keep pull requests focused to one subsystem when possible. -3. Add or update tests near the package you changed. -4. Run go test ./... before opening a PR. -5. Include protocol notes or packet captures when behavior changes are non-obvious. +AppleTalk routing was originally inspired by tashrouter: +https://github.com/lampmerchant/tashrouter -Practical expectations: +## License -- Preserve existing architecture patterns (ports, router, services). -- Keep platform-specific files separated where they already are (for example *_windows.go vs *_other.go). -- Prefer small, reviewable changes over broad refactors. +GPL-3.0. -## Related docs +## Additional docs -- [Inside AppleTalk](https://obsoletemadness.github.io/Inside-AppleTalk/) \ No newline at end of file +- High-level runtime map: [ARCHITECTURE.md](ARCHITECTURE.md) +- Protocol notes: [spec](spec) \ No newline at end of file diff --git a/capture/config.go b/capture/config.go index 459b48f..583d831 100644 --- a/capture/config.go +++ b/capture/config.go @@ -10,6 +10,8 @@ import ( type Config struct { LocalTalk string `koanf:"localtalk"` EtherTalk string `koanf:"ethertalk"` + IPX string `koanf:"ipx"` + NetBEUI string `koanf:"netbeui"` Snaplen uint32 `koanf:"snaplen"` } @@ -20,6 +22,8 @@ func DefaultConfig() Config { func (c *Config) Validate() error { c.LocalTalk = strings.TrimSpace(c.LocalTalk) c.EtherTalk = strings.TrimSpace(c.EtherTalk) + c.IPX = strings.TrimSpace(c.IPX) + c.NetBEUI = strings.TrimSpace(c.NetBEUI) if c.Snaplen == 0 { c.Snaplen = 65535 } @@ -31,3 +35,5 @@ func (c *Config) Validate() error { func (c *Config) LocalTalkEnabled() bool { return c.LocalTalk != "" } func (c *Config) EtherTalkEnabled() bool { return c.EtherTalk != "" } +func (c *Config) IPXEnabled() bool { return c.IPX != "" } +func (c *Config) NetBEUIEnabled() bool { return c.NetBEUI != "" } diff --git a/capture/pcap.go b/capture/pcap.go index 6bff855..2b865d4 100644 --- a/capture/pcap.go +++ b/capture/pcap.go @@ -18,7 +18,7 @@ import ( type LinkType = layers.LinkType const ( - LinkTypeLocalTalk LinkType = layers.LinkTypeLTalk // DLT_LTALK = 114 + LinkTypeLocalTalk LinkType = layers.LinkTypeLTalk // DLT_LTALK = 114 LinkTypeEthernet LinkType = layers.LinkTypeEthernet // DLT_EN10MB = 1 ) diff --git a/cmd/classicstack/afp_disabled.go b/cmd/classicstack/afp_disabled.go index d61d95e..553c796 100644 --- a/cmd/classicstack/afp_disabled.go +++ b/cmd/classicstack/afp_disabled.go @@ -9,8 +9,8 @@ import ( type afpHookDisabled struct{} -func (afpHookDisabled) Services() []service.Service { return nil } -func (afpHookDisabled) AttachMacIP(_ AFPSessionHooks) {} +func (afpHookDisabled) Services() []service.Service { return nil } +func (afpHookDisabled) AttachMacIP(_ AFPSessionHooks) {} // wireAFP is the no-op stub used when the binary is built without the // afp tag. It logs a warning if the operator asked for AFP and returns diff --git a/cmd/classicstack/afp_enabled.go b/cmd/classicstack/afp_enabled.go index 3d13902..e0a5212 100644 --- a/cmd/classicstack/afp_enabled.go +++ b/cmd/classicstack/afp_enabled.go @@ -9,6 +9,7 @@ import ( "github.com/ObsoleteMadness/ClassicStack/config" "github.com/ObsoleteMadness/ClassicStack/netlog" + "github.com/ObsoleteMadness/ClassicStack/pkg/vfs" "github.com/ObsoleteMadness/ClassicStack/service" "github.com/ObsoleteMadness/ClassicStack/service/afp" "github.com/ObsoleteMadness/ClassicStack/service/asp" @@ -86,6 +87,11 @@ func wireAFP(in AFPWiring) (AFPHook, error) { if err != nil { return nil, fmt.Errorf("AFP: %w", err) } + var mapper vfs.ShortnameMapper + if in.Shortname != nil { + mapper = in.Shortname.Mapper() + } + afpSvc := afp.NewService( cfg.Name, vols, @@ -97,6 +103,7 @@ func wireAFP(in AFPWiring) (AFPHook, error) { AppleDoubleMode: mode, ExtensionMap: extMap, PersistentVolumeIDs: cfg.PersistentVolumeIDs, + ShortnameMapper: mapper, }, ) for _, t := range transports { diff --git a/cmd/classicstack/afp_hook.go b/cmd/classicstack/afp_hook.go index bea9a1c..3e063fc 100644 --- a/cmd/classicstack/afp_hook.go +++ b/cmd/classicstack/afp_hook.go @@ -30,15 +30,15 @@ type AFPSessionHooks interface { // TOML config file is in use. When -config is given, flagInputs is // ignored and AFP reads its section from the config.Source instead. type AFPFlagInputs struct { - ServerName string - Zone string - Protocols string - TCPAddr string - ExtensionMap string - DecomposedNames bool - CNIDBackend string - AppleDoubleMode string - VolumeFlagValues []string // raw "Name:Path" flag entries + ServerName string + Zone string + Protocols string + TCPAddr string + ExtensionMap string + DecomposedNames bool + CNIDBackend string + AppleDoubleMode string + VolumeFlagValues []string // raw "Name:Path" flag entries } // AFPWiring is the input bundle for wireAFP. @@ -49,4 +49,5 @@ type AFPWiring struct { FromConfig bool Flags AFPFlagInputs NBP *zip.NameInformationService + Shortname ShortnameHook } diff --git a/cmd/classicstack/bridge_config.go b/cmd/classicstack/bridge_config.go new file mode 100644 index 0000000..33b8d7f --- /dev/null +++ b/cmd/classicstack/bridge_config.go @@ -0,0 +1,45 @@ +package main + +import ( + "fmt" + "strings" + + "github.com/ObsoleteMadness/ClassicStack/port/ethertalk" +) + +// BridgeConfig defines shared raw-link settings used by all Ethernet-like +// transports (EtherTalk, MacIP, IPX, NetBEUI). +type BridgeConfig struct { + Mode string `koanf:"mode"` + Device string `koanf:"device"` + HWAddress string `koanf:"hw_address"` + BridgeMode string `koanf:"bridge_mode"` +} + +func defaultBridgeConfig() BridgeConfig { + et := ethertalk.DefaultConfig() + return BridgeConfig{ + Mode: et.Backend, + Device: et.Device, + HWAddress: et.HWAddress, + BridgeMode: et.BridgeMode, + } +} + +func (c *BridgeConfig) Validate() error { + switch strings.ToLower(strings.TrimSpace(c.Mode)) { + case "", "pcap", "tap", "tun": + default: + return fmt.Errorf("Bridge.mode must be blank, pcap, tap, or tun, got %q", c.Mode) + } + switch strings.ToLower(strings.TrimSpace(c.BridgeMode)) { + case "", "auto", "ethernet", "wifi": + default: + return fmt.Errorf("Bridge.bridge_mode must be auto, ethernet, or wifi, got %q", c.BridgeMode) + } + return nil +} + +func (c BridgeConfig) normalizedMode() string { + return strings.ToLower(strings.TrimSpace(c.Mode)) +} diff --git a/cmd/classicstack/config_flags.go b/cmd/classicstack/config_flags.go index d5e38f0..24e6061 100644 --- a/cmd/classicstack/config_flags.go +++ b/cmd/classicstack/config_flags.go @@ -1,6 +1,8 @@ package main import ( + "strings" + "github.com/ObsoleteMadness/ClassicStack/capture" "github.com/ObsoleteMadness/ClassicStack/port/ethertalk" "github.com/ObsoleteMadness/ClassicStack/port/localtalk" @@ -24,11 +26,17 @@ type flagInputs struct { TashTalkSeedNetwork uint TashTalkSeedZone string + BridgeMode string + BridgeDevice string + BridgeHWAddress string + BridgeBridgeMode string + EtherTalkDevice string EtherTalkBackend string EtherTalkHWAddress string EtherTalkBridgeMode string EtherTalkBridgeHostMAC string + EtherTalkFilter string EtherTalkSeedNetworkMin uint EtherTalkSeedNetworkMax uint EtherTalkSeedZone string @@ -44,10 +52,39 @@ type flagInputs struct { MacIPNAT bool MacIPDHCPRelay bool MacIPLeaseFile string + MacIPFilter string CaptureLocalTalk string CaptureEtherTalk string CaptureSnaplen uint + + IPXEnabled bool + IPXInterface string + IPXFraming string + IPXInternalNetwork string + IPXFilter string + + NetBEUIEnabled bool + NetBEUIInterface string + NetBEUIFilter string + + NetBIOSEnabled bool + NetBIOSTransports string // raw csv from flag; resolveAppConfig parses + NetBIOSScopeID string + NetBIOSServerName string + NetBIOSWorkgroup string + + SMBEnabled bool + SMBNBTBinding string + SMBDirectBinding string + SMBGuestOk bool + SMBServerName string + SMBWorkgroup string + SMBShareValues []string // raw "Name:Path" entries from -smb-share + + ShortnameWindowsShortnames bool + ShortnameBackend string + ShortnameDBPath string } // flagsToConfig builds an appConfig from CLI flag values. It is the @@ -74,12 +111,20 @@ func flagsToConfig(in flagInputs) appConfig { SeedZone: in.TashTalkSeedZone, } + cfg.Bridge = BridgeConfig{ + Mode: firstNonBlank(in.BridgeMode, in.EtherTalkBackend), + Device: firstNonBlank(in.BridgeDevice, in.EtherTalkDevice), + HWAddress: firstNonBlank(in.BridgeHWAddress, in.EtherTalkHWAddress), + BridgeMode: firstNonBlank(in.BridgeBridgeMode, in.EtherTalkBridgeMode), + } + cfg.EtherTalk = ethertalk.Config{ - Device: in.EtherTalkDevice, - Backend: in.EtherTalkBackend, - HWAddress: in.EtherTalkHWAddress, - BridgeMode: in.EtherTalkBridgeMode, + Device: cfg.Bridge.Device, + Backend: cfg.Bridge.Mode, + HWAddress: cfg.Bridge.HWAddress, + BridgeMode: cfg.Bridge.BridgeMode, BridgeHostMAC: in.EtherTalkBridgeHostMAC, + Filter: in.EtherTalkFilter, SeedNetworkMin: in.EtherTalkSeedNetworkMin, SeedNetworkMax: in.EtherTalkSeedNetworkMax, SeedZone: in.EtherTalkSeedZone, @@ -96,6 +141,7 @@ func flagsToConfig(in flagInputs) appConfig { cfg.MacIPNAT = in.MacIPNAT cfg.MacIPDHCPRelay = in.MacIPDHCPRelay cfg.MacIPLeaseFile = in.MacIPLeaseFile + cfg.MacIPFilter = in.MacIPFilter cfg.Capture = capture.Config{ LocalTalk: in.CaptureLocalTalk, @@ -103,5 +149,71 @@ func flagsToConfig(in flagInputs) appConfig { Snaplen: uint32(in.CaptureSnaplen), } + cfg.IPXEnabled = in.IPXEnabled + cfg.IPXInterface = in.IPXInterface + if in.IPXFraming != "" { + cfg.IPXFraming = in.IPXFraming + } + cfg.IPXInternalNetwork = in.IPXInternalNetwork + cfg.IPXFilter = in.IPXFilter + + cfg.NetBEUIEnabled = in.NetBEUIEnabled + cfg.NetBEUIInterface = in.NetBEUIInterface + cfg.NetBEUIFilter = in.NetBEUIFilter + + cfg.NetBIOSEnabled = in.NetBIOSEnabled + if in.NetBIOSTransports != "" { + parts := splitCSV(in.NetBIOSTransports) + if len(parts) > 0 { + cfg.NetBIOSTransports = parts + } + } + cfg.NetBIOSScopeID = in.NetBIOSScopeID + cfg.NetBIOSServerName = in.NetBIOSServerName + cfg.NetBIOSWorkgroup = in.NetBIOSWorkgroup + + cfg.SMBEnabled = in.SMBEnabled + if in.SMBNBTBinding != "" { + cfg.SMBNBTBinding = in.SMBNBTBinding + } + cfg.SMBDirectBinding = in.SMBDirectBinding + cfg.SMBGuestOk = in.SMBGuestOk + if strings.TrimSpace(in.SMBServerName) != "" { + cfg.SMBServerName = in.SMBServerName + } + if strings.TrimSpace(in.SMBWorkgroup) != "" { + cfg.SMBWorkgroup = in.SMBWorkgroup + } + cfg.SMBShareFlags = in.SMBShareValues + + cfg.ShortnameWindowsShortnames = in.ShortnameWindowsShortnames + if in.ShortnameBackend != "" { + cfg.ShortnameBackend = in.ShortnameBackend + } + cfg.ShortnameDBPath = in.ShortnameDBPath + + normalizeSMBIdentity(&cfg) + syncBridgeToEtherTalk(&cfg) + return cfg } + +func firstNonBlank(values ...string) string { + for _, v := range values { + if strings.TrimSpace(v) != "" { + return v + } + } + return "" +} + +func splitCSV(s string) []string { + var out []string + for _, part := range strings.Split(s, ",") { + p := strings.TrimSpace(part) + if p != "" { + out = append(out, p) + } + } + return out +} diff --git a/cmd/classicstack/config_ini.go b/cmd/classicstack/config_ini.go index fadcbf3..0f7b030 100644 --- a/cmd/classicstack/config_ini.go +++ b/cmd/classicstack/config_ini.go @@ -24,6 +24,7 @@ type appConfig struct { ParsePackets bool ParseOutput string + Bridge BridgeConfig LToUDP localtalk.LToUDPConfig TashTalk localtalk.TashTalkConfig EtherTalk ethertalk.Config @@ -38,18 +39,60 @@ type appConfig struct { MacIPDHCPRelay bool MacIPLeaseFile string MacIPZone string + MacIPFilter string + + IPXEnabled bool + IPXInterface string + IPXFraming string + IPXInternalNetwork string + IPXFilter string + + NetBEUIEnabled bool + NetBEUIInterface string + NetBEUIFilter string + + NetBIOSEnabled bool + NetBIOSTransports []string + NetBIOSScopeID string + NetBIOSServerName string + NetBIOSWorkgroup string + + SMBEnabled bool + SMBNBTBinding string + SMBDirectBinding string + SMBGuestOk bool + SMBServerName string + SMBWorkgroup string + SMBShareFlags []string // raw "Name:Path" entries from -smb-share (flag mode only) + + ShortnameWindowsShortnames bool + ShortnameBackend string + ShortnameDBPath string } +const ( + defaultSMBServerName = "CLASSICSTACK" + defaultSMBWorkgroup = "WORKGROUP" +) + func defaultAppConfig() appConfig { return appConfig{ LogLevel: "info", + Bridge: defaultBridgeConfig(), LToUDP: localtalk.DefaultLToUDPConfig(), TashTalk: localtalk.DefaultTashTalkConfig(), EtherTalk: ethertalk.DefaultConfig(), Capture: capture.DefaultConfig(), MacIPSubnet: "192.168.100.0/24", + + IPXFraming: "ethernet_ii", + NetBIOSTransports: []string{"tcp"}, + SMBNBTBinding: ":139", + SMBServerName: defaultSMBServerName, + SMBWorkgroup: defaultSMBWorkgroup, + ShortnameBackend: "memory", } } @@ -76,6 +119,9 @@ func resolveAppConfig(src config.Source) (appConfig, error) { if err := loadSection(k, "LToUdp", &cfg.LToUDP); err != nil { return cfg, err } + if err := loadSection(k, "Bridge", &cfg.Bridge); err != nil { + return cfg, err + } if err := loadSection(k, "TashTalk", &cfg.TashTalk); err != nil { return cfg, err } @@ -85,10 +131,10 @@ func resolveAppConfig(src config.Source) (appConfig, error) { if err := loadSection(k, "Capture", &cfg.Capture); err != nil { return cfg, err } - cfg.EtherTalk.Backend = strings.ToLower(strings.TrimSpace(cfg.EtherTalk.Backend)) - if cfg.EtherTalk.Backend == "" { - cfg.EtherTalk.Device = "" + if err := rejectLegacyBridgeKeys(k); err != nil { + return cfg, err } + syncBridgeToEtherTalk(&cfg) cfg.MacIPEnabled = boolWithDefault(k, "MacIP.enabled", cfg.MacIPEnabled) mode := strings.ToLower(stringWithDefault(k, "MacIP.mode", "")) @@ -107,15 +153,97 @@ func resolveAppConfig(src config.Source) (appConfig, error) { cfg.MacIPGatewayIP = stringWithDefault(k, "MacIP.ip_gateway", cfg.MacIPGatewayIP) cfg.MacIPDHCPRelay = boolWithDefault(k, "MacIP.dhcp_relay", cfg.MacIPDHCPRelay) cfg.MacIPZone = stringWithDefault(k, "MacIP.zone", cfg.MacIPZone) + cfg.MacIPFilter = strings.TrimSpace(k.String("MacIP.filter")) cfg.LogLevel = stringWithDefault(k, "Logging.level", cfg.LogLevel) cfg.ParsePackets = boolWithDefault(k, "Logging.parse_packets", cfg.ParsePackets) cfg.LogTraffic = boolWithDefault(k, "Logging.log_traffic", cfg.LogTraffic) cfg.ParseOutput = stringWithDefault(k, "Logging.parse_output", cfg.ParseOutput) + cfg.IPXEnabled = boolWithDefault(k, "IPX.enabled", cfg.IPXEnabled) + cfg.IPXInterface = stringWithDefault(k, "IPX.interface", cfg.IPXInterface) + cfg.IPXFraming = stringWithDefault(k, "IPX.framing", cfg.IPXFraming) + cfg.IPXInternalNetwork = stringWithDefault(k, "IPX.internal_network", cfg.IPXInternalNetwork) + cfg.IPXFilter = strings.TrimSpace(k.String("IPX.filter")) + + cfg.NetBEUIEnabled = boolWithDefault(k, "NetBEUI.enabled", cfg.NetBEUIEnabled) + cfg.NetBEUIInterface = stringWithDefault(k, "NetBEUI.interface", cfg.NetBEUIInterface) + cfg.NetBEUIFilter = strings.TrimSpace(k.String("NetBEUI.filter")) + + cfg.NetBIOSEnabled = boolWithDefault(k, "NetBIOS.enabled", cfg.NetBIOSEnabled) + if k.Exists("NetBIOS.transports") { + cfg.NetBIOSTransports = k.Strings("NetBIOS.transports") + } + cfg.NetBIOSScopeID = stringWithDefault(k, "NetBIOS.scope_id", cfg.NetBIOSScopeID) + cfg.NetBIOSServerName = stringWithDefault(k, "NetBIOS.server_name", cfg.NetBIOSServerName) + cfg.NetBIOSWorkgroup = stringWithDefault(k, "NetBIOS.workgroup", cfg.NetBIOSWorkgroup) + + cfg.SMBEnabled = boolWithDefault(k, "SMB.enabled", cfg.SMBEnabled) + cfg.SMBNBTBinding = stringWithDefault(k, "SMB.nbt_binding", cfg.SMBNBTBinding) + cfg.SMBDirectBinding = stringWithDefault(k, "SMB.direct_binding", cfg.SMBDirectBinding) + cfg.SMBGuestOk = boolWithDefault(k, "SMB.guest_ok", cfg.SMBGuestOk) + cfg.SMBServerName = stringWithDefault(k, "SMB.server_name", cfg.SMBServerName) + cfg.SMBWorkgroup = stringWithDefault(k, "SMB.workgroup", cfg.SMBWorkgroup) + + cfg.ShortnameWindowsShortnames = boolWithDefault(k, "Shortname.windows_shortnames", cfg.ShortnameWindowsShortnames) + cfg.ShortnameBackend = stringWithDefault(k, "Shortname.backend", cfg.ShortnameBackend) + cfg.ShortnameDBPath = stringWithDefault(k, "Shortname.db_path", cfg.ShortnameDBPath) + + normalizeSMBIdentity(&cfg) + return cfg, nil } +func rejectLegacyBridgeKeys(k *koanf.Koanf) error { + legacy := []string{ + "EtherTalk.backend", + "EtherTalk.device", + "EtherTalk.hw_address", + "EtherTalk.bridge_mode", + } + for _, key := range legacy { + if k.Exists(key) { + return fmt.Errorf("[%s] is no longer supported in config files; use [Bridge] keys instead", key) + } + } + return nil +} + +func syncBridgeToEtherTalk(cfg *appConfig) { + cfg.Bridge.Mode = strings.ToLower(strings.TrimSpace(cfg.Bridge.Mode)) + cfg.Bridge.Device = strings.TrimSpace(cfg.Bridge.Device) + cfg.Bridge.HWAddress = strings.TrimSpace(cfg.Bridge.HWAddress) + cfg.Bridge.BridgeMode = strings.ToLower(strings.TrimSpace(cfg.Bridge.BridgeMode)) + + cfg.EtherTalk.Backend = cfg.Bridge.Mode + cfg.EtherTalk.Device = cfg.Bridge.Device + cfg.EtherTalk.HWAddress = cfg.Bridge.HWAddress + cfg.EtherTalk.BridgeMode = cfg.Bridge.BridgeMode + if cfg.EtherTalk.Backend == "" { + cfg.EtherTalk.Device = "" + } +} + +// normalizeSMBIdentity makes SMB identity canonical and keeps NetBIOS +// aligned with it while NetBIOS is enabled. +func normalizeSMBIdentity(cfg *appConfig) { + cfg.SMBServerName = strings.TrimSpace(cfg.SMBServerName) + if cfg.SMBServerName == "" { + cfg.SMBServerName = defaultSMBServerName + } + cfg.SMBWorkgroup = strings.TrimSpace(cfg.SMBWorkgroup) + if cfg.SMBWorkgroup == "" { + cfg.SMBWorkgroup = defaultSMBWorkgroup + } + + cfg.NetBIOSServerName = strings.TrimSpace(cfg.NetBIOSServerName) + cfg.NetBIOSWorkgroup = strings.TrimSpace(cfg.NetBIOSWorkgroup) + if cfg.NetBIOSEnabled { + cfg.NetBIOSServerName = cfg.SMBServerName + cfg.NetBIOSWorkgroup = cfg.SMBWorkgroup + } +} + // validatable is the shape that every package's Config struct exposes: // koanf-tagged fields, defaults via the package's DefaultConfig(), and a // Validate method that enforces logical (not syntactic) rules. diff --git a/cmd/classicstack/config_test.go b/cmd/classicstack/config_test.go index bb19c78..106d9cb 100644 --- a/cmd/classicstack/config_test.go +++ b/cmd/classicstack/config_test.go @@ -45,16 +45,18 @@ interface = "192.168.0.103" seed_network = 11 seed_zone = "LToUDP Network" +[Bridge] +mode = "pcap" +device = "eth0" +hw_address = "DE:AD:BE:EF:CA:FE" +bridge_mode = "wifi" + [TashTalk] port = "COM1" seed_network = 12 seed_zone = "TashTalk Network" [EtherTalk] -backend = "pcap" -device = "eth0" -hw_address = "DE:AD:BE:EF:CA:FE" -bridge_mode = "wifi" bridge_host_mac = "AA:BB:CC:DD:EE:FF" seed_network_min = 3 seed_network_max = 9 @@ -104,3 +106,118 @@ log_traffic = true t.Fatalf("unexpected MacIP config: %#v", cfg) } } + +func TestLoadConfig_RejectsLegacyEtherTalkBridgeKeys(t *testing.T) { + dir := t.TempDir() + cfgPath := filepath.Join(dir, "server.toml") + content := `[Bridge] +mode = "pcap" + +[EtherTalk] +backend = "pcap" +` + if err := os.WriteFile(cfgPath, []byte(content), 0o600); err != nil { + t.Fatalf("write config: %v", err) + } + + if _, _, err := loadConfigFromFile(cfgPath); err == nil { + t.Fatal("expected error for legacy EtherTalk bridge keys") + } +} + +func TestLoadConfig_NetBIOSIdentityInheritedFromSMB(t *testing.T) { + dir := t.TempDir() + cfgPath := filepath.Join(dir, "server.toml") + content := `[NetBIOS] +enabled = true +server_name = "LEGACYNB" +workgroup = "LEGACYWG" + +[SMB] +enabled = true +server_name = "MACHINE1" +workgroup = "GROUP1" +` + if err := os.WriteFile(cfgPath, []byte(content), 0o600); err != nil { + t.Fatalf("write config: %v", err) + } + + cfg, _, err := loadConfigFromFile(cfgPath) + if err != nil { + t.Fatalf("loadConfigFromFile error: %v", err) + } + + if cfg.SMBServerName != "MACHINE1" || cfg.SMBWorkgroup != "GROUP1" { + t.Fatalf("unexpected SMB identity: server=%q workgroup=%q", cfg.SMBServerName, cfg.SMBWorkgroup) + } + if cfg.NetBIOSServerName != cfg.SMBServerName || cfg.NetBIOSWorkgroup != cfg.SMBWorkgroup { + t.Fatalf("NetBIOS identity not inherited from SMB: netbios=(%q,%q) smb=(%q,%q)", + cfg.NetBIOSServerName, cfg.NetBIOSWorkgroup, cfg.SMBServerName, cfg.SMBWorkgroup) + } +} + +func TestLoadConfig_SharedBridgeAndProtocolFilters(t *testing.T) { + dir := t.TempDir() + cfgPath := filepath.Join(dir, "server.toml") + content := `[Bridge] +mode = "pcap" +device = "eth99" +hw_address = "00:11:22:33:44:55" +bridge_mode = "wifi" + +[MacIP] +enabled = true +filter = "arp or ip" + +[EtherTalk] +filter = "ether proto 0x809b" + +[IPX] +enabled = true +filter = "ipx" + +[NetBEUI] +enabled = true +filter = "llc" +` + if err := os.WriteFile(cfgPath, []byte(content), 0o600); err != nil { + t.Fatalf("write config: %v", err) + } + + cfg, _, err := loadConfigFromFile(cfgPath) + if err != nil { + t.Fatalf("loadConfigFromFile error: %v", err) + } + + if cfg.Bridge.Mode != "pcap" || cfg.Bridge.Device != "eth99" || cfg.Bridge.HWAddress != "00:11:22:33:44:55" || cfg.Bridge.BridgeMode != "wifi" { + t.Fatalf("unexpected bridge config: %#v", cfg.Bridge) + } + if cfg.EtherTalk.Backend != cfg.Bridge.Mode || cfg.EtherTalk.Device != cfg.Bridge.Device || cfg.EtherTalk.HWAddress != cfg.Bridge.HWAddress || cfg.EtherTalk.BridgeMode != cfg.Bridge.BridgeMode { + t.Fatalf("EtherTalk did not sync from Bridge: bridge=%#v ethertalk=%#v", cfg.Bridge, cfg.EtherTalk) + } + if cfg.EtherTalk.Filter != "ether proto 0x809b" { + t.Fatalf("unexpected EtherTalk filter: %q", cfg.EtherTalk.Filter) + } + if cfg.MacIPFilter != "arp or ip" || cfg.IPXFilter != "ipx" || cfg.NetBEUIFilter != "llc" { + t.Fatalf("unexpected protocol filters: macip=%q ipx=%q netbeui=%q", cfg.MacIPFilter, cfg.IPXFilter, cfg.NetBEUIFilter) + } +} + +func TestFlagsToConfig_NetBIOSIdentityInheritedFromSMB(t *testing.T) { + cfg := flagsToConfig(flagInputs{ + NetBIOSEnabled: true, + NetBIOSServerName: "LEGACYNB", + NetBIOSWorkgroup: "LEGACYWG", + SMBEnabled: true, + SMBServerName: "MACHINE2", + SMBWorkgroup: "GROUP2", + }) + + if cfg.SMBServerName != "MACHINE2" || cfg.SMBWorkgroup != "GROUP2" { + t.Fatalf("unexpected SMB identity: server=%q workgroup=%q", cfg.SMBServerName, cfg.SMBWorkgroup) + } + if cfg.NetBIOSServerName != cfg.SMBServerName || cfg.NetBIOSWorkgroup != cfg.SMBWorkgroup { + t.Fatalf("NetBIOS identity not inherited from SMB: netbios=(%q,%q) smb=(%q,%q)", + cfg.NetBIOSServerName, cfg.NetBIOSWorkgroup, cfg.SMBServerName, cfg.SMBWorkgroup) + } +} diff --git a/cmd/classicstack/ipx_disabled.go b/cmd/classicstack/ipx_disabled.go new file mode 100644 index 0000000..74961f8 --- /dev/null +++ b/cmd/classicstack/ipx_disabled.go @@ -0,0 +1,28 @@ +//go:build !ipx && !all + +package main + +import ( + "context" + + "github.com/ObsoleteMadness/ClassicStack/netlog" + "github.com/ObsoleteMadness/ClassicStack/router/ipx" + ipxsvc "github.com/ObsoleteMadness/ClassicStack/service/ipx" +) + +type ipxHookDisabled struct{} + +func (ipxHookDisabled) Start(_ context.Context) error { return nil } +func (ipxHookDisabled) Stop() error { return nil } +func (ipxHookDisabled) Router() ipx.Router { return nil } +func (ipxHookDisabled) SAP() *ipxsvc.SAPService { return nil } + +// wireIPX is the no-op stub used when the binary is built without the +// ipx tag. It logs a warning if the operator asked for IPX and returns +// a disabled hook so the rest of main.go skips IPX wiring. +func wireIPX(cfg IPXConfig) (IPXHook, error) { + if cfg.Enabled { + netlog.Warn("[MAIN][IPX] -ipx-enabled set but binary was built without -tags ipx; ignoring") + } + return ipxHookDisabled{}, nil +} diff --git a/cmd/classicstack/ipx_enabled.go b/cmd/classicstack/ipx_enabled.go new file mode 100644 index 0000000..cb0376f --- /dev/null +++ b/cmd/classicstack/ipx_enabled.go @@ -0,0 +1,190 @@ +//go:build ipx || all + +package main + +import ( + "context" + "encoding/hex" + "fmt" + "strings" + + "github.com/ObsoleteMadness/ClassicStack/capture" + "github.com/ObsoleteMadness/ClassicStack/netlog" + "github.com/ObsoleteMadness/ClassicStack/pkg/hwaddr" + "github.com/ObsoleteMadness/ClassicStack/port/ipx" + "github.com/ObsoleteMadness/ClassicStack/port/rawlink" + routeripx "github.com/ObsoleteMadness/ClassicStack/router/ipx" + ipxsvc "github.com/ObsoleteMadness/ClassicStack/service/ipx" +) + +type ipxHookEnabled struct { + router routeripx.Router + port ipx.Port + rip *ipxsvc.RIPService + sap *ipxsvc.SAPService + sink *capture.PcapSink +} + +func (h *ipxHookEnabled) Router() routeripx.Router { return h.router } +func (h *ipxHookEnabled) SAP() *ipxsvc.SAPService { return h.sap } + +func (h *ipxHookEnabled) Start(ctx context.Context) error { + if h.port != nil { + if err := h.port.Start(); err != nil { + return err + } + } + if err := h.rip.Start(ctx); err != nil { + return err + } + if err := h.sap.Start(ctx); err != nil { + return err + } + netlog.Info("[MAIN][IPX] router up; RIP+SAP active") + return nil +} + +func (h *ipxHookEnabled) Stop() error { + if h.rip != nil { + _ = h.rip.Stop() + } + if h.sap != nil { + _ = h.sap.Stop() + } + if h.port != nil { + _ = h.port.Stop() + } + if h.sink != nil { + _ = h.sink.Close() + h.sink = nil + } + return nil +} + +func wireIPX(cfg IPXConfig) (IPXHook, error) { + if !cfg.Enabled { + return nil, nil + } + router := routeripx.NewRouter() + hook := &ipxHookEnabled{ + router: router, + rip: ipxsvc.NewRIPService(router), + sap: ipxsvc.NewSAPService(router), + } + + network, err := parseIPXNetwork(cfg.InternalNetwork) + if err != nil { + return nil, fmt.Errorf("parsing -ipx-internal-network: %w", err) + } + + link := cfg.Rawlink + if link == nil && strings.TrimSpace(cfg.Interface) != "" { + opened, err := openRawlink(cfg.BridgeMode, cfg.Interface, rawlinkProfileIPX) + if err != nil { + return nil, fmt.Errorf("opening IPX rawlink on %q: %w", cfg.Interface, err) + } + link = applyRawlinkBridgeFrameMode(opened, cfg.BridgeMode, cfg.BridgeFrameMode, cfg.Interface, cfg.BridgeHWAddress, "IPX") + applyRawlinkFilter(link, cfg.BridgeMode, cfg.Interface, cfg.Filter, "ipx", "IPX") + } + if link != nil { + framing := parseIPXFraming(cfg.Framing) + hook.port = ipx.NewPortWithFraming(link, framing) + if strings.TrimSpace(cfg.CapturePath) != "" { + sink, err := capture.NewPcapSink(cfg.CapturePath, capture.LinkTypeEthernet, cfg.CaptureSnaplen) + if err != nil { + return nil, fmt.Errorf("opening IPX capture sink %q: %w", cfg.CapturePath, err) + } + hook.sink = sink + hook.port.SetCaptureSink(sink) + netlog.Info("[CAPTURE] IPX frames -> %s", cfg.CapturePath) + } + router.AddPort(hook.port) + + node, ok := resolveIPXNodeFromInterface(cfg.Interface) + if !ok { + if parsed, err := hwaddr.ParseEthernet(strings.TrimSpace(cfg.BridgeHWAddress)); err == nil { + node = [6]byte(parsed) + ok = true + } + } + if !ok { + netlog.Warn("[MAIN][IPX] could not resolve MAC for %q; node ID left zero", cfg.Interface) + } + router.SetIdentity(network, node) + netlog.Info("[MAIN][IPX] iface=%s framing=%s network=%08x node=%s", + cfg.Interface, cfg.Framing, networkUint32(network), formatNode(node)) + } else { + // No interface: still set the network identity so any in-process + // caller (tests, future loopback transport) sees a configured + // network number. + router.SetIdentity(network, [6]byte{}) + netlog.Warn("[MAIN][IPX] enabled but no -ipx-interface configured; IPX router idle") + } + + return hook, nil +} + +// parseIPXNetwork accepts an 8-hex-digit IPX network number with an +// optional `0x` prefix. Empty input returns the router's default +// (DefaultNetwork) so the operator does not have to pick a number for +// a single-segment deployment. +func parseIPXNetwork(s string) ([4]byte, error) { + trimmed := strings.TrimSpace(strings.TrimPrefix(strings.ToLower(s), "0x")) + if trimmed == "" { + return routeripx.DefaultNetwork, nil + } + if len(trimmed) != 8 { + return [4]byte{}, fmt.Errorf("want 8 hex digits, got %d", len(trimmed)) + } + b, err := hex.DecodeString(trimmed) + if err != nil { + return [4]byte{}, err + } + var out [4]byte + copy(out[:], b) + return out, nil +} + +// resolveIPXNodeFromInterface reads the host interface MAC and returns +// it as a 6-byte IPX node ID. Returns (zero, false) when the MAC cannot +// be detected. +func resolveIPXNodeFromInterface(iface string) ([6]byte, bool) { + mac, ok := rawlink.DetectHostMACForPcapInterface(iface) + if !ok { + return [6]byte{}, false + } + parsed, err := hwaddr.ParseEthernet(mac) + if err != nil { + return [6]byte{}, false + } + return [6]byte(parsed), true +} + +// networkUint32 renders a [4]byte network number as the big-endian +// uint32 the operator-facing logs and config expect. +func networkUint32(n [4]byte) uint32 { + return uint32(n[0])<<24 | uint32(n[1])<<16 | uint32(n[2])<<8 | uint32(n[3]) +} + +// formatNode renders a 6-byte node ID as colon-separated hex. +func formatNode(n [6]byte) string { + return fmt.Sprintf("%02x:%02x:%02x:%02x:%02x:%02x", n[0], n[1], n[2], n[3], n[4], n[5]) +} + +// parseIPXFraming maps the operator-facing framing name to the wire +// constant. Unknown values fall back to Ethernet II with a warning. +func parseIPXFraming(name string) ipx.Framing { + switch strings.ToLower(strings.TrimSpace(name)) { + case "", "ethernet_ii", "ethernet-ii", "ethernetii": + return ipx.FramingEthernetII + case "raw_802_3", "raw-802-3", "raw802.3": + return ipx.FramingRaw8023 + case "llc", "802.2": + return ipx.FramingLLC + case "snap": + return ipx.FramingSNAP + default: + netlog.Warn("[MAIN][IPX] unknown framing %q; defaulting to ethernet_ii", name) + return ipx.FramingEthernetII + } +} diff --git a/cmd/classicstack/ipx_enabled_test.go b/cmd/classicstack/ipx_enabled_test.go new file mode 100644 index 0000000..ed1dcd4 --- /dev/null +++ b/cmd/classicstack/ipx_enabled_test.go @@ -0,0 +1,43 @@ +//go:build ipx || all + +package main + +import ( + "testing" + + routeripx "github.com/ObsoleteMadness/ClassicStack/router/ipx" +) + +func TestParseIPXNetwork(t *testing.T) { + cases := []struct { + in string + want [4]byte + }{ + {"", routeripx.DefaultNetwork}, + {"DEADBEEF", [4]byte{0xDE, 0xAD, 0xBE, 0xEF}}, + {"deadbeef", [4]byte{0xDE, 0xAD, 0xBE, 0xEF}}, + {"0xDEADBEEF", [4]byte{0xDE, 0xAD, 0xBE, 0xEF}}, + {" cafef00d ", [4]byte{0xCA, 0xFE, 0xF0, 0x0D}}, + } + for _, tc := range cases { + got, err := parseIPXNetwork(tc.in) + if err != nil { + t.Fatalf("parseIPXNetwork(%q): %v", tc.in, err) + } + if got != tc.want { + t.Errorf("parseIPXNetwork(%q): got %x want %x", tc.in, got, tc.want) + } + } +} + +func TestParseIPXNetworkErrors(t *testing.T) { + for _, in := range []string{ + "DEAD", // too short + "DEADBEEFCC", // too long + "GHIJKLMN", // non-hex + } { + if _, err := parseIPXNetwork(in); err == nil { + t.Errorf("parseIPXNetwork(%q) accepted invalid input", in) + } + } +} diff --git a/cmd/classicstack/ipx_hook.go b/cmd/classicstack/ipx_hook.go new file mode 100644 index 0000000..dc76861 --- /dev/null +++ b/cmd/classicstack/ipx_hook.go @@ -0,0 +1,38 @@ +package main + +import ( + "context" + + "github.com/ObsoleteMadness/ClassicStack/port/rawlink" + "github.com/ObsoleteMadness/ClassicStack/router/ipx" + ipxsvc "github.com/ObsoleteMadness/ClassicStack/service/ipx" +) + +// IPXHook is the cmd-layer abstraction over the optional IPX subsystem. +// IPX runs on its own router (router/ipx) and is not a member of the +// AppleTalk service set, so the hook surface is a Start/Stop pair plus +// access to the IPX router and SAP agent for higher layers (NetBIOS +// over IPX) that need to register sockets and advertise services. +type IPXHook interface { + Start(ctx context.Context) error + Stop() error + Router() ipx.Router + SAP() *ipxsvc.SAPService +} + +// IPXConfig collects the values wireIPX needs. Rawlink may be nil when +// IPX is enabled without a transport (e.g. an integration test that +// drives the router directly). +type IPXConfig struct { + Enabled bool + Rawlink rawlink.RawLink + BridgeMode string + BridgeFrameMode string + Interface string + BridgeHWAddress string + Framing string + InternalNetwork string + Filter string + CapturePath string + CaptureSnaplen uint32 +} diff --git a/cmd/classicstack/macip_enabled.go b/cmd/classicstack/macip_enabled.go index d948ef0..98c302d 100644 --- a/cmd/classicstack/macip_enabled.go +++ b/cmd/classicstack/macip_enabled.go @@ -18,51 +18,71 @@ type macipHook struct { svc *macip.Service } -func (h *macipHook) Service() service.Service { return h.svc } -func (h *macipHook) PinLeaseToSession(net uint16, node, sess uint8) { h.svc.PinLeaseToSession(net, node, sess) } -func (h *macipHook) UnpinLeaseFromSession(sess uint8) { h.svc.UnpinLeaseFromSession(sess) } -func (h *macipHook) MarkSessionActivity(sess uint8) { h.svc.MarkSessionActivity(sess) } +func (h *macipHook) Service() service.Service { return h.svc } +func (h *macipHook) PinLeaseToSession(net uint16, node, sess uint8) { + h.svc.PinLeaseToSession(net, node, sess) +} +func (h *macipHook) UnpinLeaseFromSession(sess uint8) { h.svc.UnpinLeaseFromSession(sess) } +func (h *macipHook) MarkSessionActivity(sess uint8) { h.svc.MarkSessionActivity(sess) } func wireMacIP(cfg MacIPConfig) (MacIPHook, error) { if !cfg.Enabled { return nil, nil } - if cfg.EtherTalkBackend != "" && cfg.EtherTalkBackend != "pcap" { - return nil, fmt.Errorf("-macip-enabled currently requires -ethertalk-backend pcap (got %q)", cfg.EtherTalkBackend) + bridgeMode := strings.ToLower(strings.TrimSpace(cfg.BridgeMode)) + if bridgeMode == "" { + bridgeMode = "pcap" } - ipIface := cfg.PcapDevice + ipIface := cfg.BridgeDevice if ipIface == "" { - if detected, ok := rawlink.DetectDefaultPcapInterface(); ok { - ipIface = detected - netlog.Info("[MAIN][MacIP] auto-detected pcap interface: %s", detected) + if bridgeMode == "pcap" { + if detected, ok := rawlink.DetectDefaultPcapInterface(); ok { + ipIface = detected + netlog.Info("[MAIN][MacIP] auto-detected pcap interface: %s", detected) + } else { + return nil, fmt.Errorf("bridge device is required when -macip-enabled is set (auto-detection failed)") + } } else { - return nil, fmt.Errorf("-ethertalk-device is required when -macip-enabled is set (auto-detection failed)") + return nil, fmt.Errorf("bridge device is required when -macip-enabled is set in %s mode", bridgeMode) } } ipMACStr := "" - if strings.TrimSpace(cfg.BridgeHostMAC) != "" { - ipMACStr = cfg.BridgeHostMAC + if strings.TrimSpace(cfg.BridgeHWAddress) != "" { + ipMACStr = cfg.BridgeHWAddress netlog.Info("[MAIN][MacIP] using bridge host MAC for IP-side: %s", ipMACStr) - } else if hostMAC, ok := rawlink.DetectHostMACForPcapInterface(ipIface); ok { - ipMACStr = hostMAC - netlog.Info("[MAIN][MacIP] auto-detected IP-side MAC from %s: %s", ipIface, ipMACStr) - } else { - ipMACStr = cfg.PcapHWAddr + } else if bridgeMode == "pcap" { + if hostMAC, ok := rawlink.DetectHostMACForPcapInterface(ipIface); ok { + ipMACStr = hostMAC + netlog.Info("[MAIN][MacIP] auto-detected IP-side MAC from %s: %s", ipIface, ipMACStr) + } + } + if ipMACStr == "" { + ipMACStr = cfg.BridgeHWAddress + } + if strings.TrimSpace(ipMACStr) == "" { + return nil, fmt.Errorf("bridge hw_address is required for MacIP when host MAC auto-detection is unavailable") } - hostIPStr, hostIPDetected := detectPcapInterfaceIPv4(ipIface) + hostIPStr, hostIPDetected := "", false + if bridgeMode == "pcap" { + hostIPStr, hostIPDetected = detectPcapInterfaceIPv4(ipIface) + } if cfg.IPGateway == "" { - if gw, ok := rawlink.DetectDefaultGatewayForPcapInterface(ipIface); ok { - cfg.IPGateway = gw - netlog.Info("[MAIN][MacIP] auto-detected default gateway %s for interface %s", gw, ipIface) - } else if hostIPDetected { - cfg.IPGateway = hostIPStr - netlog.Warn("[MAIN][MacIP] default gateway auto-detection failed; falling back to interface IPv4 %s on %s", hostIPStr, ipIface) + if bridgeMode == "pcap" { + if gw, ok := rawlink.DetectDefaultGatewayForPcapInterface(ipIface); ok { + cfg.IPGateway = gw + netlog.Info("[MAIN][MacIP] auto-detected default gateway %s for interface %s", gw, ipIface) + } else if hostIPDetected { + cfg.IPGateway = hostIPStr + netlog.Warn("[MAIN][MacIP] default gateway auto-detection failed; falling back to interface IPv4 %s on %s", hostIPStr, ipIface) + } else { + return nil, fmt.Errorf("-macip-ip-gateway is required when -macip-enabled is set (auto-detection failed and no IPv4 address was found)") + } } else { - return nil, fmt.Errorf("-macip-ip-gateway is required when -macip-enabled is set (auto-detection failed and no IPv4 address was found)") + return nil, fmt.Errorf("-macip-ip-gateway is required when -macip-enabled is set in %s mode", bridgeMode) } } @@ -111,15 +131,12 @@ func wireMacIP(cfg MacIPConfig) (MacIPHook, error) { chosenZone = []byte(cfg.EtherTalkZone) } - ipLink, err := rawlink.OpenPcap(rawlink.DefaultMacIPConfig(ipIface)) + ipLink, err := openRawlink(bridgeMode, ipIface, rawlinkProfileMacIP) if err != nil { return nil, fmt.Errorf("failed opening MacIP rawlink on %s: %w", ipIface, err) } - if fl, ok := ipLink.(rawlink.FilterableLink); ok { - if err := fl.SetFilter(macipBPFFilter(ipNet, cfg.DHCPRelay)); err != nil { - netlog.Warn("[MAIN][MacIP] could not set BPF filter on %s: %v", ipIface, err) - } - } + ipLink = applyRawlinkBridgeFrameMode(ipLink, bridgeMode, cfg.BridgeFrameMode, ipIface, cfg.BridgeHWAddress, "MacIP") + applyRawlinkFilter(ipLink, bridgeMode, ipIface, cfg.Filter, macipBPFFilter(ipNet, cfg.DHCPRelay), "MacIP") svc := macip.New( gwIP, ipNet.IP, ipNet.Mask, diff --git a/cmd/classicstack/macip_hook.go b/cmd/classicstack/macip_hook.go index adcbbe9..ce9e204 100644 --- a/cmd/classicstack/macip_hook.go +++ b/cmd/classicstack/macip_hook.go @@ -30,6 +30,10 @@ func (a macIPAFPHooks) OnActivity(sessID uint8) { a.h.MarkSessionActivity(sessID // caller (main.go, tag-neutral) from the macip package directly. type MacIPConfig struct { Enabled bool + BridgeMode string + BridgeDevice string + BridgeHWAddress string + BridgeFrameMode string NATGatewayIP string NATSubnet string Nameserver string @@ -38,10 +42,7 @@ type MacIPConfig struct { NAT bool DHCPRelay bool StateFile string - PcapDevice string - BridgeHostMAC string - PcapHWAddr string + Filter string EtherTalkZone string - EtherTalkBackend string NBP *zip.NameInformationService } diff --git a/cmd/classicstack/main.go b/cmd/classicstack/main.go index b3a6035..19bf664 100644 --- a/cmd/classicstack/main.go +++ b/cmd/classicstack/main.go @@ -50,6 +50,11 @@ func main() { pcapHWAddr := flag.String("ethertalk-hw-address", "DE:AD:BE:EF:CA:FE", "EtherTalk hardware address (6-byte MAC)") etBridgeMode := flag.String("ethertalk-bridge-mode", "auto", "EtherTalk bridge mode: auto, ethernet, wifi") etBridgeHostMAC := flag.String("ethertalk-bridge-host-mac", "", "Host adapter MAC used for Wi-Fi bridge shim (default: ethertalk-hw-address)") + etFilter := flag.String("ethertalk-filter", "", "pcap BPF filter override for EtherTalk") + bridgeMode := flag.String("bridge-mode", "", "Shared raw-link backend mode: pcap, tap, or tun (overrides ethertalk-backend)") + bridgeDevice := flag.String("bridge-device", "", "Shared raw-link device/interface (overrides ethertalk-device)") + bridgeHWAddr := flag.String("bridge-hw-address", "", "Shared raw-link host MAC (overrides ethertalk-hw-address)") + bridgeFrameMode := flag.String("bridge-frame-mode", "", "Shared frame mode for bridge adaptation: auto, ethernet, wifi (overrides ethertalk-bridge-mode)") listPcap := flag.Bool("list-pcap-devices", false, "List pcap devices and exit") etNetMin := flag.Uint("ethertalk-seed-network-min", 3, "EtherTalk seed network min") etNetMax := flag.Uint("ethertalk-seed-network-max", 5, "EtherTalk seed network max") @@ -69,6 +74,7 @@ func main() { macipNAT := flag.Bool("macip-nat", false, "Enable NAPT: rewrite Mac client source IPs to the gateway IP on the physical network") macipDHCP := flag.Bool("macip-dhcp-relay", false, "Use DHCP to assign IPs to MacIP clients instead of the static pool (non-NAT mode)") macipStateFile := flag.String("macip-lease-file", "", "File to persist MacIP lease state across restarts (empty to disable)") + macipFilter := flag.String("macip-filter", "", "pcap BPF filter override for MacIP (default is auto-generated)") // Packet parsing / capture flags. parsePackets := flag.Bool("parse-packets", false, "Decode and log every inbound DDP packet (ATP/ASP/AFP layers)") @@ -91,6 +97,41 @@ func main() { var afpVolumes volumeFlags flag.Var(&afpVolumes, "afp-volume", `AFP volume to share, format: "Name:Path" (repeatable, e.g. -afp-volume "Mac Share:c:\mac")`) + // IPX flags. Real packet handling lands behind //go:build ipx; the + // disabled stub logs a warning if -ipx-enabled is set without the tag. + ipxEnable := flag.Bool("ipx-enabled", false, "Enable IPX router (requires -tags ipx)") + ipxIface := flag.String("ipx-interface", "", "Rawlink/pcap interface for IPX (default: reuse -ethertalk-device)") + ipxFraming := flag.String("ipx-framing", "ethernet_ii", "IPX framing: ethernet_ii, raw_802_3, llc, snap") + ipxInternal := flag.String("ipx-internal-network", "", "IPX internal network number (8-hex-digit, e.g. DEADBEEF)") + ipxFilter := flag.String("ipx-filter", "", "pcap BPF filter override for IPX (default: ipx)") + + // NetBEUI flags. + netbeuiEnable := flag.Bool("netbeui-enabled", false, "Enable NetBEUI port (requires -tags netbeui)") + netbeuiIface := flag.String("netbeui-interface", "", "Rawlink/pcap interface for NetBEUI (default: reuse -ethertalk-device)") + netbeuiFilter := flag.String("netbeui-filter", "", "pcap BPF filter override for NetBEUI (default: llc)") + + // NetBIOS flags. + netbiosEnable := flag.Bool("netbios-enabled", false, "Enable NetBIOS service (requires -tags netbios)") + netbiosTransports := flag.String("netbios-transports", "tcp", "Comma-separated NetBIOS transports: any of tcp, netbeui, ipx") + netbiosScopeID := flag.String("netbios-scope-id", "", "NetBIOS scope ID (RFC 1001/1002)") + netbiosServerName := flag.String("netbios-server-name", "", "Deprecated: NetBIOS identity derives from SMB server/workgroup") + netbiosWorkgroup := flag.String("netbios-workgroup", "", "Deprecated: NetBIOS identity derives from SMB server/workgroup") + + // SMB flags. + smbEnable := flag.Bool("smb-enabled", false, "Enable SMB 1.0 server (requires -tags smb)") + smbNBT := flag.String("smb-nbt-binding", ":139", "SMB NBT (NetBIOS over TCP) listen address") + smbDirect := flag.String("smb-direct-binding", "", "SMB direct (TCP/445) listen address; empty disables direct SMB") + smbGuest := flag.Bool("smb-guest-ok", false, "Accept unauthenticated SMB sessions") + smbServerName := flag.String("smb-server-name", "CLASSICSTACK", "SMB/NetBIOS computer name") + smbWorkgroup := flag.String("smb-workgroup", "WORKGROUP", "SMB/NetBIOS workgroup name") + var smbShares volumeFlags + flag.Var(&smbShares, "smb-share", `SMB share, format: "Name:Path" (repeatable)`) + + // Shortname flags. + shortWindows := flag.Bool("shortname-windows-shortnames", false, "Enable Windows native shortnames") + shortBackend := flag.String("shortname-backend", "memory", "Shortname store backend: memory or sqlite") + shortDB := flag.String("shortname-db", "", "Shortname store DB path (sqlite backend)") + flag.Parse() if *showVersion { @@ -138,22 +179,28 @@ func main() { configSource = src } else { cfg = flagsToConfig(flagInputs{ - LogLevel: *logLevel, - LogTraffic: *logTraffic, - ParsePackets: *parsePackets, - ParseOutput: *parseOutput, - LToUDPEnabled: *ltoudp, - LToUDPInterface: *ltIface, - LToUDPSeedNetwork: *ltNet, - LToUDPSeedZone: *ltZone, - TashTalkPort: *tashtalkSerial, - TashTalkSeedNetwork: *ttNet, - TashTalkSeedZone: *ttZone, + LogLevel: *logLevel, + LogTraffic: *logTraffic, + ParsePackets: *parsePackets, + ParseOutput: *parseOutput, + LToUDPEnabled: *ltoudp, + LToUDPInterface: *ltIface, + LToUDPSeedNetwork: *ltNet, + LToUDPSeedZone: *ltZone, + TashTalkPort: *tashtalkSerial, + TashTalkSeedNetwork: *ttNet, + TashTalkSeedZone: *ttZone, + BridgeMode: *bridgeMode, + BridgeDevice: *bridgeDevice, + BridgeHWAddress: *bridgeHWAddr, + BridgeBridgeMode: *bridgeFrameMode, + EtherTalkDevice: *pcapDev, EtherTalkBackend: *etBackend, EtherTalkHWAddress: *pcapHWAddr, EtherTalkBridgeMode: *etBridgeMode, EtherTalkBridgeHostMAC: *etBridgeHostMAC, + EtherTalkFilter: *etFilter, EtherTalkSeedNetworkMin: *etNetMin, EtherTalkSeedNetworkMax: *etNetMax, EtherTalkSeedZone: *etZone, @@ -168,9 +215,38 @@ func main() { MacIPNAT: *macipNAT, MacIPDHCPRelay: *macipDHCP, MacIPLeaseFile: *macipStateFile, + MacIPFilter: *macipFilter, CaptureLocalTalk: *captureLocalTalk, CaptureEtherTalk: *captureEtherTalk, CaptureSnaplen: *captureSnaplen, + + IPXEnabled: *ipxEnable, + IPXInterface: *ipxIface, + IPXFraming: *ipxFraming, + IPXInternalNetwork: *ipxInternal, + IPXFilter: *ipxFilter, + + NetBEUIEnabled: *netbeuiEnable, + NetBEUIInterface: *netbeuiIface, + NetBEUIFilter: *netbeuiFilter, + + NetBIOSEnabled: *netbiosEnable, + NetBIOSTransports: *netbiosTransports, + NetBIOSScopeID: *netbiosScopeID, + NetBIOSServerName: *netbiosServerName, + NetBIOSWorkgroup: *netbiosWorkgroup, + + SMBEnabled: *smbEnable, + SMBNBTBinding: *smbNBT, + SMBDirectBinding: *smbDirect, + SMBGuestOk: *smbGuest, + SMBServerName: *smbServerName, + SMBWorkgroup: *smbWorkgroup, + SMBShareValues: []string(smbShares), + + ShortnameWindowsShortnames: *shortWindows, + ShortnameBackend: *shortBackend, + ShortnameDBPath: *shortDB, }) } @@ -195,12 +271,13 @@ func main() { netlog.SetLogFunc(func(s string) { netlog.Debug("%s", s) }) } - cfg.EtherTalk.Backend = strings.ToLower(strings.TrimSpace(cfg.EtherTalk.Backend)) - switch cfg.EtherTalk.Backend { + cfg.Bridge.Mode = strings.ToLower(strings.TrimSpace(cfg.Bridge.Mode)) + switch cfg.Bridge.Mode { case "", "pcap", "tap", "tun": default: - log.Fatalf("invalid -ethertalk-backend %q (want pcap, tap, or tun)", cfg.EtherTalk.Backend) + log.Fatalf("invalid bridge mode %q (want pcap, tap, or tun)", cfg.Bridge.Mode) } + syncBridgeToEtherTalk(&cfg) if *listPcap { names, err := rawlink.InterfaceNames() @@ -228,15 +305,20 @@ func main() { return } - if cfg.EtherTalk.Device == "" && cfg.EtherTalk.Backend == "pcap" { + if cfg.EtherTalk.Device == "" && cfg.Bridge.Mode == "pcap" { if detected, ok := rawlink.DetectDefaultPcapInterface(); ok { netlog.Info("[MAIN] auto-detected pcap interface: %s", detected) - cfg.EtherTalk.Device = detected + cfg.Bridge.Device = detected + syncBridgeToEtherTalk(&cfg) } } - if cfg.EtherTalk.Device != "" && cfg.EtherTalk.Backend == "pcap" && strings.TrimSpace(cfg.EtherTalk.BridgeHostMAC) == "" { + if cfg.EtherTalk.Device != "" && cfg.Bridge.Mode == "pcap" && strings.TrimSpace(cfg.EtherTalk.BridgeHostMAC) == "" { if hostMAC, ok := rawlink.DetectHostMACForPcapInterface(cfg.EtherTalk.Device); ok { cfg.EtherTalk.BridgeHostMAC = hostMAC + if strings.TrimSpace(cfg.Bridge.HWAddress) == "" { + cfg.Bridge.HWAddress = hostMAC + syncBridgeToEtherTalk(&cfg) + } netlog.Info("[MAIN] auto-detected bridge host MAC for %s: %s", cfg.EtherTalk.Device, hostMAC) } } @@ -262,6 +344,7 @@ func main() { DesiredNode: uint8(cfg.EtherTalk.DesiredNode), SeedZoneNames: [][]byte{[]byte(cfg.EtherTalk.SeedZone)}, BridgeMode: cfg.EtherTalk.BridgeMode, + Filter: cfg.EtherTalk.Filter, } if cfg.EtherTalk.BridgeHostMAC != "" { hostMAC, err := hwaddr.ParseEthernet(cfg.EtherTalk.BridgeHostMAC) @@ -313,21 +396,22 @@ func main() { } macIP, err := wireMacIP(MacIPConfig{ - Enabled: cfg.MacIPEnabled, - NATGatewayIP: cfg.MacIPGWIP, - NATSubnet: cfg.MacIPSubnet, - Nameserver: cfg.MacIPNameserver, - Zone: cfg.MacIPZone, - IPGateway: cfg.MacIPGatewayIP, - NAT: cfg.MacIPNAT, - DHCPRelay: cfg.MacIPDHCPRelay, - StateFile: cfg.MacIPLeaseFile, - PcapDevice: cfg.EtherTalk.Device, - BridgeHostMAC: cfg.EtherTalk.BridgeHostMAC, - PcapHWAddr: cfg.EtherTalk.HWAddress, - EtherTalkZone: cfg.EtherTalk.SeedZone, - EtherTalkBackend: cfg.EtherTalk.Backend, - NBP: nbpSvc, + Enabled: cfg.MacIPEnabled, + BridgeMode: cfg.Bridge.Mode, + BridgeDevice: cfg.Bridge.Device, + BridgeHWAddress: cfg.Bridge.HWAddress, + BridgeFrameMode: cfg.Bridge.BridgeMode, + NATGatewayIP: cfg.MacIPGWIP, + NATSubnet: cfg.MacIPSubnet, + Nameserver: cfg.MacIPNameserver, + Zone: cfg.MacIPZone, + IPGateway: cfg.MacIPGatewayIP, + NAT: cfg.MacIPNAT, + DHCPRelay: cfg.MacIPDHCPRelay, + StateFile: cfg.MacIPLeaseFile, + Filter: cfg.MacIPFilter, + EtherTalkZone: cfg.EtherTalk.SeedZone, + NBP: nbpSvc, }) if err != nil { log.Fatalf("MacIP wiring failed: %v", err) @@ -336,10 +420,20 @@ func main() { services = append(services, macIP.Service()) } + shortHook, err := wireShortname(ShortnameConfig{ + WindowsShortnames: cfg.ShortnameWindowsShortnames, + Backend: cfg.ShortnameBackend, + DBPath: cfg.ShortnameDBPath, + }) + if err != nil { + log.Fatalf("Shortname wiring failed: %v", err) + } + afpHook, err := wireAFP(AFPWiring{ Source: configSource, FromConfig: fromConfigFile, NBP: nbpSvc, + Shortname: shortHook, Flags: AFPFlagInputs{ ServerName: *afpServerName, Zone: *afpZone, @@ -360,6 +454,97 @@ func main() { } services = append(services, afpHook.Services()...) + // IPX and NetBEUI each open their own pcap rawlink in wireIPX / + // wireNetBEUI. They don't share with EtherTalk; the kernel filter + // per handle keeps the cross-protocol traffic isolated. When no + // interface is configured for them explicitly, fall back to + // EtherTalk's — the typical deployment runs every protocol on + // the same physical NIC. + ipxResolvedIface := cfg.IPXInterface + if cfg.IPXEnabled && strings.TrimSpace(ipxResolvedIface) == "" && cfg.EtherTalk.Device != "" { + if cfg.Bridge.Device != "" { + ipxResolvedIface = cfg.Bridge.Device + netlog.Info("[MAIN][IPX] no -ipx-interface set; reusing Bridge interface %s", ipxResolvedIface) + } else { + ipxResolvedIface = cfg.EtherTalk.Device + netlog.Info("[MAIN][IPX] no -ipx-interface set; reusing EtherTalk interface %s", ipxResolvedIface) + } + } + ipxHook, err := wireIPX(IPXConfig{ + Enabled: cfg.IPXEnabled, + BridgeMode: cfg.Bridge.Mode, + BridgeFrameMode: cfg.Bridge.BridgeMode, + Interface: ipxResolvedIface, + BridgeHWAddress: cfg.Bridge.HWAddress, + Framing: cfg.IPXFraming, + InternalNetwork: cfg.IPXInternalNetwork, + Filter: cfg.IPXFilter, + CapturePath: cfg.Capture.IPX, + CaptureSnaplen: cfg.Capture.Snaplen, + }) + if err != nil { + log.Fatalf("IPX wiring failed: %v", err) + } + netbeuiResolvedIface := cfg.NetBEUIInterface + if cfg.NetBEUIEnabled && strings.TrimSpace(netbeuiResolvedIface) == "" && cfg.EtherTalk.Device != "" { + if cfg.Bridge.Device != "" { + netbeuiResolvedIface = cfg.Bridge.Device + netlog.Info("[MAIN][NetBEUI] no -netbeui-interface set; reusing Bridge interface %s", netbeuiResolvedIface) + } else { + netbeuiResolvedIface = cfg.EtherTalk.Device + netlog.Info("[MAIN][NetBEUI] no -netbeui-interface set; reusing EtherTalk interface %s", netbeuiResolvedIface) + } + } + nbeuiHook, err := wireNetBEUI(NetBEUIConfig{ + Enabled: cfg.NetBEUIEnabled, + BridgeMode: cfg.Bridge.Mode, + BridgeFrameMode: cfg.Bridge.BridgeMode, + Interface: netbeuiResolvedIface, + BridgeHWAddress: cfg.Bridge.HWAddress, + Filter: cfg.NetBEUIFilter, + CapturePath: cfg.Capture.NetBEUI, + CaptureSnaplen: cfg.Capture.Snaplen, + }) + if err != nil { + log.Fatalf("NetBEUI wiring failed: %v", err) + } + nbHook, err := wireNetBIOS(NetBIOSConfig{ + Enabled: cfg.NetBIOSEnabled, + Transports: cfg.NetBIOSTransports, + ScopeID: cfg.NetBIOSScopeID, + ServerName: cfg.NetBIOSServerName, + Workgroup: cfg.NetBIOSWorkgroup, + IPX: ipxHook, + NetBEUI: nbeuiHook, + }) + if err != nil { + log.Fatalf("NetBIOS wiring failed: %v", err) + } + + smbShareConfigs := loadSMBShares(configSource, fromConfigFile, cfg.SMBShareFlags) + smbHook, err := wireSMB(SMBConfig{ + Enabled: cfg.SMBEnabled, + NBTBinding: cfg.SMBNBTBinding, + DirectBinding: cfg.SMBDirectBinding, + GuestOk: cfg.SMBGuestOk, + Workgroup: cfg.SMBWorkgroup, + ServerName: cfg.SMBServerName, + Shares: smbShareConfigs, + NetBIOS: nbHook, + IPX: ipxHook, + Shortname: shortHook, + }) + if err != nil { + log.Fatalf("SMB wiring failed: %v", err) + } + + // SMB rides on NetBIOS and is not a DDP service either, so it + // lives outside the AppleTalk service set. Its lifecycle is + // driven directly below alongside IPX/NetBEUI/NetBIOS. The + // shortname mapper is consumed via wireSMB; no lifecycle of + // its own. + _ = shortHook + r := router.New("router", ports, services) if cfg.ParsePackets { @@ -384,8 +569,55 @@ func main() { } netlog.Info("[MAIN] router away!") + // IPX, NetBEUI, and NetBIOS each own their own router/port and are + // not members of the AppleTalk service set, so their lifecycles are + // driven independently from main.go in start order: transports + // (IPX, NetBEUI) first, then the layers that consume them. + if ipxHook != nil { + if err := ipxHook.Start(ctx); err != nil { + netlog.Warn("[MAIN][IPX] start failed: %v", err) + } + } + if nbeuiHook != nil { + if err := nbeuiHook.Start(ctx); err != nil { + netlog.Warn("[MAIN][NetBEUI] start failed: %v", err) + } + } + if nbHook != nil { + if err := nbHook.Start(ctx); err != nil { + netlog.Warn("[MAIN][NetBIOS] start failed: %v", err) + } + } + if smbHook != nil { + if err := smbHook.Start(ctx); err != nil { + netlog.Warn("[MAIN][SMB] start failed: %v", err) + } + } + <-ctx.Done() + // Stop in reverse start order so consumers tear down before the + // transports they sit on. + if smbHook != nil { + if err := smbHook.Stop(); err != nil { + netlog.Warn("[MAIN][SMB] stop warning: %v", err) + } + } + if nbHook != nil { + if err := nbHook.Stop(); err != nil { + netlog.Warn("[MAIN][NetBIOS] stop warning: %v", err) + } + } + if nbeuiHook != nil { + if err := nbeuiHook.Stop(); err != nil { + netlog.Warn("[MAIN][NetBEUI] stop warning: %v", err) + } + } + if ipxHook != nil { + if err := ipxHook.Stop(); err != nil { + netlog.Warn("[MAIN][IPX] stop warning: %v", err) + } + } if err := r.Stop(); err != nil { netlog.Warn("[MAIN] stop warning: %v", err) } diff --git a/cmd/classicstack/netbeui_disabled.go b/cmd/classicstack/netbeui_disabled.go new file mode 100644 index 0000000..10dad17 --- /dev/null +++ b/cmd/classicstack/netbeui_disabled.go @@ -0,0 +1,24 @@ +//go:build !netbeui && !all + +package main + +import ( + "context" + + "github.com/ObsoleteMadness/ClassicStack/netlog" + "github.com/ObsoleteMadness/ClassicStack/port/netbeui" +) + +type netbeuiHookDisabled struct{} + +func (netbeuiHookDisabled) Start(_ context.Context) error { return nil } +func (netbeuiHookDisabled) Stop() error { return nil } +func (netbeuiHookDisabled) Port() netbeui.Port { return nil } +func (netbeuiHookDisabled) MAC() [6]byte { return [6]byte{} } + +func wireNetBEUI(cfg NetBEUIConfig) (NetBEUIHook, error) { + if cfg.Enabled { + netlog.Warn("[MAIN][NetBEUI] -netbeui-enabled set but binary was built without -tags netbeui; ignoring") + } + return netbeuiHookDisabled{}, nil +} diff --git a/cmd/classicstack/netbeui_enabled.go b/cmd/classicstack/netbeui_enabled.go new file mode 100644 index 0000000..5efdb14 --- /dev/null +++ b/cmd/classicstack/netbeui_enabled.go @@ -0,0 +1,88 @@ +//go:build netbeui || all + +package main + +import ( + "context" + "fmt" + "strings" + + "github.com/ObsoleteMadness/ClassicStack/capture" + "github.com/ObsoleteMadness/ClassicStack/netlog" + "github.com/ObsoleteMadness/ClassicStack/pkg/hwaddr" + "github.com/ObsoleteMadness/ClassicStack/port/netbeui" + "github.com/ObsoleteMadness/ClassicStack/port/rawlink" +) + +type netbeuiHookEnabled struct { + port netbeui.Port + mac [6]byte + sink *capture.PcapSink +} + +func (h *netbeuiHookEnabled) Start(_ context.Context) error { + if h.port != nil { + if err := h.port.Start(); err != nil { + return err + } + } + netlog.Info("[MAIN][NetBEUI] port up") + return nil +} +func (h *netbeuiHookEnabled) Stop() error { + if h.port != nil { + _ = h.port.Stop() + } + if h.sink != nil { + _ = h.sink.Close() + h.sink = nil + } + return nil +} +func (h *netbeuiHookEnabled) Port() netbeui.Port { return h.port } +func (h *netbeuiHookEnabled) MAC() [6]byte { return h.mac } + +func wireNetBEUI(cfg NetBEUIConfig) (NetBEUIHook, error) { + if !cfg.Enabled { + return nil, nil + } + link := cfg.Rawlink + if link == nil && strings.TrimSpace(cfg.Interface) != "" { + opened, err := openRawlink(cfg.BridgeMode, cfg.Interface, rawlinkProfileNetBEUI) + if err != nil { + return nil, fmt.Errorf("opening NetBEUI rawlink on %q: %w", cfg.Interface, err) + } + link = applyRawlinkBridgeFrameMode(opened, cfg.BridgeMode, cfg.BridgeFrameMode, cfg.Interface, cfg.BridgeHWAddress, "NetBEUI") + applyRawlinkFilter(link, cfg.BridgeMode, cfg.Interface, cfg.Filter, "llc", "NetBEUI") + } + if link == nil { + netlog.Warn("[MAIN][NetBEUI] enabled but no -netbeui-interface configured; NetBEUI idle") + return &netbeuiHookEnabled{}, nil + } + netlog.Info("[MAIN][NetBEUI] pcap interface=%s", cfg.Interface) + p := netbeui.NewPort(link) + var mac [6]byte + if macStr, ok := rawlink.DetectHostMACForPcapInterface(cfg.Interface); ok { + if parsed, err := hwaddr.ParseEthernet(macStr); err == nil { + mac = [6]byte(parsed) + p.SetSourceMAC(mac) + } + } else if parsed, err := hwaddr.ParseEthernet(strings.TrimSpace(cfg.BridgeHWAddress)); err == nil { + mac = [6]byte(parsed) + p.SetSourceMAC(mac) + } + + hook := &netbeuiHookEnabled{port: p, mac: mac} + + if strings.TrimSpace(cfg.CapturePath) != "" { + sink, err := capture.NewPcapSink(cfg.CapturePath, capture.LinkTypeEthernet, cfg.CaptureSnaplen) + if err != nil { + return nil, fmt.Errorf("opening NetBEUI capture sink %q: %w", cfg.CapturePath, err) + } + hook.sink = sink + p.SetCaptureSink(sink) + netlog.Info("[CAPTURE] NetBEUI frames -> %s", cfg.CapturePath) + } + + return hook, nil +} diff --git a/cmd/classicstack/netbeui_hook.go b/cmd/classicstack/netbeui_hook.go new file mode 100644 index 0000000..6822d48 --- /dev/null +++ b/cmd/classicstack/netbeui_hook.go @@ -0,0 +1,31 @@ +package main + +import ( + "context" + + "github.com/ObsoleteMadness/ClassicStack/port/netbeui" + "github.com/ObsoleteMadness/ClassicStack/port/rawlink" +) + +// NetBEUIHook is the cmd-layer abstraction over the optional NetBEUI +// port. NetBEUI is a transport — it owns no service of its own, but +// publishes a Port that NetBIOS-over-NetBEUI can consume. +type NetBEUIHook interface { + Start(ctx context.Context) error + Stop() error + Port() netbeui.Port + MAC() [6]byte +} + +// NetBEUIConfig collects the values wireNetBEUI needs. +type NetBEUIConfig struct { + Enabled bool + Rawlink rawlink.RawLink + BridgeMode string + BridgeFrameMode string + Interface string + BridgeHWAddress string + Filter string + CapturePath string + CaptureSnaplen uint32 +} diff --git a/cmd/classicstack/netbios_disabled.go b/cmd/classicstack/netbios_disabled.go new file mode 100644 index 0000000..f8b83cf --- /dev/null +++ b/cmd/classicstack/netbios_disabled.go @@ -0,0 +1,24 @@ +//go:build !netbios && !all + +package main + +import ( + "context" + + "github.com/ObsoleteMadness/ClassicStack/netlog" + "github.com/ObsoleteMadness/ClassicStack/service/netbios" +) + +type netbiosHookDisabled struct{} + +func (netbiosHookDisabled) Start(_ context.Context) error { return nil } +func (netbiosHookDisabled) Stop() error { return nil } +func (netbiosHookDisabled) NameService() netbios.NameService { return nil } +func (netbiosHookDisabled) Service() *netbios.Service { return nil } + +func wireNetBIOS(cfg NetBIOSConfig) (NetBIOSHook, error) { + if cfg.Enabled { + netlog.Warn("[MAIN][NetBIOS] -netbios-enabled set but binary was built without -tags netbios; ignoring") + } + return netbiosHookDisabled{}, nil +} diff --git a/cmd/classicstack/netbios_enabled.go b/cmd/classicstack/netbios_enabled.go new file mode 100644 index 0000000..2004868 --- /dev/null +++ b/cmd/classicstack/netbios_enabled.go @@ -0,0 +1,63 @@ +//go:build netbios || all + +package main + +import ( + "context" + + "github.com/ObsoleteMadness/ClassicStack/netlog" + netbiosproto "github.com/ObsoleteMadness/ClassicStack/protocol/netbios" + "github.com/ObsoleteMadness/ClassicStack/service/netbios" + "github.com/ObsoleteMadness/ClassicStack/service/netbios/over_ipx" + "github.com/ObsoleteMadness/ClassicStack/service/netbios/over_netbeui" + "github.com/ObsoleteMadness/ClassicStack/service/netbios/over_tcp" +) + +type netbiosHookEnabled struct { + svc *netbios.Service +} + +func (h *netbiosHookEnabled) Start(ctx context.Context) error { return h.svc.Start(ctx) } +func (h *netbiosHookEnabled) Stop() error { return h.svc.Stop() } +func (h *netbiosHookEnabled) NameService() netbios.NameService { return h.svc.NameService() } +func (h *netbiosHookEnabled) Service() *netbios.Service { return h.svc } + +func wireNetBIOS(cfg NetBIOSConfig) (NetBIOSHook, error) { + if !cfg.Enabled { + return nil, nil + } + transports := selectNetBIOSTransports(cfg) + svc := netbios.NewService(cfg.ServerName, cfg.ScopeID, transports) + netlog.Info("[MAIN][NetBIOS] server=%q scope=%q transports=%d (stub)", + cfg.ServerName, cfg.ScopeID, len(transports)) + return &netbiosHookEnabled{svc: svc}, nil +} + +// selectNetBIOSTransports turns the config's transport name list into +// concrete Transport instances, skipping any whose underlying hook is +// not available (e.g. "ipx" requested but binary built without -tags ipx). +func selectNetBIOSTransports(cfg NetBIOSConfig) []netbios.Transport { + var out []netbios.Transport + for _, name := range cfg.Transports { + switch name { + case "tcp": + out = append(out, over_tcp.NewTransport()) + case "netbeui": + if cfg.NetBEUI != nil && cfg.NetBEUI.Port() != nil { + out = append(out, over_netbeui.NewTransport(cfg.NetBEUI.Port(), cfg.NetBEUI.MAC())) + } else { + netlog.Warn("[MAIN][NetBIOS] transport %q skipped: NetBEUI port not available", name) + } + case "ipx": + if cfg.IPX != nil && cfg.IPX.Router() != nil && cfg.IPX.SAP() != nil { + nbName := netbiosproto.NewName(cfg.ServerName, netbiosproto.NameTypeFileServer) + out = append(out, over_ipx.NewTransport(cfg.IPX.Router(), cfg.IPX.SAP(), nbName)) + } else { + netlog.Warn("[MAIN][NetBIOS] transport %q skipped: IPX router/SAP not available", name) + } + default: + netlog.Warn("[MAIN][NetBIOS] unknown transport %q, ignoring", name) + } + } + return out +} diff --git a/cmd/classicstack/netbios_hook.go b/cmd/classicstack/netbios_hook.go new file mode 100644 index 0000000..1aeb37e --- /dev/null +++ b/cmd/classicstack/netbios_hook.go @@ -0,0 +1,31 @@ +package main + +import ( + "context" + + "github.com/ObsoleteMadness/ClassicStack/service/netbios" +) + +// NetBIOSHook is the cmd-layer abstraction over the optional NetBIOS +// service. NetBIOS does not consume DDP datagrams and is not a member +// of the AppleTalk service set; it is driven independently via +// Start/Stop, like IPX and NetBEUI. +type NetBIOSHook interface { + Start(ctx context.Context) error + Stop() error + NameService() netbios.NameService + Service() *netbios.Service +} + +// NetBIOSConfig collects every value wireNetBIOS needs. IPX and +// NetBEUI hooks are passed in so over_ipx / over_netbeui transports +// can share their underlying router/port. +type NetBIOSConfig struct { + Enabled bool + Transports []string + ScopeID string + ServerName string + Workgroup string + IPX IPXHook + NetBEUI NetBEUIHook +} diff --git a/cmd/classicstack/rawlink_open.go b/cmd/classicstack/rawlink_open.go new file mode 100644 index 0000000..3118451 --- /dev/null +++ b/cmd/classicstack/rawlink_open.go @@ -0,0 +1,110 @@ +package main + +import ( + "fmt" + "strings" + + "github.com/ObsoleteMadness/ClassicStack/netlog" + "github.com/ObsoleteMadness/ClassicStack/pkg/hwaddr" + "github.com/ObsoleteMadness/ClassicStack/port/rawlink" +) + +type rawlinkProfile string + +const ( + rawlinkProfileEtherTalk rawlinkProfile = "ethertalk" + rawlinkProfileMacIP rawlinkProfile = "macip" + rawlinkProfileIPX rawlinkProfile = "ipx" + rawlinkProfileNetBEUI rawlinkProfile = "netbeui" +) + +func openRawlink(mode, device string, profile rawlinkProfile) (rawlink.RawLink, error) { + mode = strings.ToLower(strings.TrimSpace(mode)) + if mode == "" { + mode = "pcap" + } + device = strings.TrimSpace(device) + if device == "" { + return nil, fmt.Errorf("bridge device is required") + } + + switch mode { + case "pcap": + cfg := rawlink.DefaultEtherTalkConfig(device) + switch profile { + case rawlinkProfileMacIP: + cfg = rawlink.DefaultMacIPConfig(device) + case rawlinkProfileIPX: + cfg = rawlink.DefaultIPXConfig(device) + case rawlinkProfileNetBEUI: + cfg = rawlink.DefaultNetBEUIConfig(device) + } + return rawlink.OpenPcap(cfg) + case "tap", "tun": + return rawlink.OpenTAP(device) + default: + return nil, fmt.Errorf("unsupported bridge mode %q (want pcap, tap, or tun)", mode) + } +} + +func applyRawlinkFilter(link rawlink.RawLink, mode, iface, overrideExpr, defaultExpr, protocol string) { + mode = strings.ToLower(strings.TrimSpace(mode)) + if mode != "pcap" { + if strings.TrimSpace(overrideExpr) != "" { + netlog.Warn("[MAIN][%s] ignoring filter override in non-pcap bridge mode %q", protocol, mode) + } + return + } + + filterExpr := strings.TrimSpace(overrideExpr) + if filterExpr == "" { + filterExpr = strings.TrimSpace(defaultExpr) + } + if filterExpr == "" { + return + } + + fl, ok := link.(rawlink.FilterableLink) + if !ok { + netlog.Warn("[MAIN][%s] rawlink backend on %s does not support filter programming", protocol, iface) + return + } + if err := fl.SetFilter(filterExpr); err != nil { + netlog.Warn("[MAIN][%s] could not set BPF filter on %s: %v", protocol, iface, err) + } +} + +func applyRawlinkBridgeFrameMode(link rawlink.RawLink, bridgeMode, frameMode, iface, bridgeHWAddr, protocol string) rawlink.RawLink { + bridgeMode = strings.ToLower(strings.TrimSpace(bridgeMode)) + if bridgeMode != "pcap" { + return link + } + + virtual, err := hwaddr.ParseEthernet(strings.TrimSpace(bridgeHWAddr)) + if err != nil { + netlog.Warn("[MAIN][%s] shared bridge hw_address is invalid, skipping bridge adapter: %v", protocol, err) + return link + } + + hostMAC := virtual.HardwareAddr() + if detected, ok := rawlink.DetectHostMACForPcapInterface(iface); ok { + parsed, err := hwaddr.ParseEthernet(detected) + if err == nil { + hostMAC = parsed.HardwareAddr() + } + } + + wrapped, err := rawlink.WrapWithBridgeMode(link, rawlink.BridgeLinkOptions{ + Mode: frameMode, + HostMAC: hostMAC, + VirtualMAC: virtual.HardwareAddr(), + }) + if err != nil { + netlog.Warn("[MAIN][%s] could not enable shared bridge frame adapter on %s: %v", protocol, iface, err) + return link + } + if wrapped != link { + netlog.Info("[MAIN][%s] shared rawlink bridge adapter active on %s (mode=%s)", protocol, iface, strings.TrimSpace(frameMode)) + } + return wrapped +} diff --git a/cmd/classicstack/shortname_hook.go b/cmd/classicstack/shortname_hook.go new file mode 100644 index 0000000..05bcbcd --- /dev/null +++ b/cmd/classicstack/shortname_hook.go @@ -0,0 +1,13 @@ +package main + +import "github.com/ObsoleteMadness/ClassicStack/pkg/vfs" + +type ShortnameHook interface { + Mapper() vfs.ShortnameMapper +} + +type ShortnameConfig struct { + WindowsShortnames bool + Backend string + DBPath string +} diff --git a/cmd/classicstack/shortname_wire.go b/cmd/classicstack/shortname_wire.go new file mode 100644 index 0000000..3a75e63 --- /dev/null +++ b/cmd/classicstack/shortname_wire.go @@ -0,0 +1,26 @@ +package main + +import ( + "github.com/ObsoleteMadness/ClassicStack/pkg/shortname" + "github.com/ObsoleteMadness/ClassicStack/pkg/vfs" +) + +type shortnameHook struct { + mapper vfs.ShortnameMapper +} + +func (h *shortnameHook) Mapper() vfs.ShortnameMapper { return h.mapper } + +func wireShortname(cfg ShortnameConfig) (ShortnameHook, error) { + var store shortname.Store + if cfg.Backend == "sqlite" { + // store = ... (left for future sqlite implementation) + } + if store == nil { + store = shortname.NewMemoryStore() + } + mapper := shortname.NewMapper(store, shortname.Config{ + WindowsShortnames: cfg.WindowsShortnames, + }) + return &shortnameHook{mapper: mapper}, nil +} diff --git a/cmd/classicstack/smb_disabled.go b/cmd/classicstack/smb_disabled.go new file mode 100644 index 0000000..a20b162 --- /dev/null +++ b/cmd/classicstack/smb_disabled.go @@ -0,0 +1,23 @@ +//go:build !smb && !all + +package main + +import ( + "context" + + "github.com/ObsoleteMadness/ClassicStack/netlog" + "github.com/ObsoleteMadness/ClassicStack/service/smb" +) + +type smbHookDisabled struct{} + +func (smbHookDisabled) Start(_ context.Context) error { return nil } +func (smbHookDisabled) Stop() error { return nil } +func (smbHookDisabled) Service() *smb.Service { return nil } + +func wireSMB(cfg SMBConfig) (SMBHook, error) { + if cfg.Enabled { + netlog.Warn("[MAIN][SMB] -smb-enabled set but binary was built without -tags smb; ignoring") + } + return smbHookDisabled{}, nil +} diff --git a/cmd/classicstack/smb_enabled.go b/cmd/classicstack/smb_enabled.go new file mode 100644 index 0000000..d5985a5 --- /dev/null +++ b/cmd/classicstack/smb_enabled.go @@ -0,0 +1,82 @@ +//go:build smb || all + +package main + +import ( + "context" + + "github.com/ObsoleteMadness/ClassicStack/netlog" + "github.com/ObsoleteMadness/ClassicStack/service/netbios" + "github.com/ObsoleteMadness/ClassicStack/service/smb" + "github.com/ObsoleteMadness/ClassicStack/service/smb/over_ipx_direct" +) + +type smbHookEnabled struct { + svc *smb.Service + ipxDirect *over_ipx_direct.Transport +} + +func (h *smbHookEnabled) Start(ctx context.Context) error { + if h.ipxDirect != nil { + if err := h.ipxDirect.Start(ctx); err != nil { + return err + } + } + return h.svc.Start(ctx) +} + +func (h *smbHookEnabled) Stop() error { + if err := h.svc.Stop(); err != nil { + return err + } + if h.ipxDirect != nil { + if err := h.ipxDirect.Stop(); err != nil { + return err + } + } + return nil +} + +func (h *smbHookEnabled) Service() *smb.Service { return h.svc } + +func wireSMB(cfg SMBConfig) (SMBHook, error) { + if !cfg.Enabled { + return nil, nil + } + opts := smb.ServerOptions{ + NBTBinding: cfg.NBTBinding, + DirectBinding: cfg.DirectBinding, + GuestOk: cfg.GuestOk, + Workgroup: cfg.Workgroup, + ServerName: cfg.ServerName, + } + if cfg.Shortname != nil { + opts.Shortname = cfg.Shortname.Mapper() + } + + var nb netbios.NameService + if cfg.NetBIOS != nil { + nb = cfg.NetBIOS.NameService() + } + + svc := smb.NewService(opts, nb, cfg.Shares) + + // Wire SMB into the NetBIOS dispatch chain so inbound session + // PDUs reach the SMB command handler. + if cfg.NetBIOS != nil { + if nbSvc := cfg.NetBIOS.Service(); nbSvc != nil { + nbSvc.SetCommandHandler(svc) + svc.SetDatagramSender(nbSvc) + } + } + + var ipxDirect *over_ipx_direct.Transport + if cfg.IPX != nil && cfg.IPX.Router() != nil { + ipxDirect = over_ipx_direct.New(cfg.IPX.Router(), svc) + netlog.Info("[MAIN][SMB] direct IPX transport enabled on socket 0550") + } + + netlog.Info("[MAIN][SMB] server=%q workgroup=%q shares=%d guest=%t (stub)", + cfg.ServerName, cfg.Workgroup, len(cfg.Shares), cfg.GuestOk) + return &smbHookEnabled{svc: svc, ipxDirect: ipxDirect}, nil +} diff --git a/cmd/classicstack/smb_hook.go b/cmd/classicstack/smb_hook.go new file mode 100644 index 0000000..d0cdf86 --- /dev/null +++ b/cmd/classicstack/smb_hook.go @@ -0,0 +1,30 @@ +package main + +import ( + "context" + + "github.com/ObsoleteMadness/ClassicStack/service/smb" +) + +// SMBHook is the cmd-layer abstraction over the optional SMB 1.0 +// server. SMB does not consume DDP and is not a member of the +// AppleTalk service set; main.go drives Start/Stop on it directly. +type SMBHook interface { + Start(ctx context.Context) error + Stop() error + Service() *smb.Service +} + +// SMBConfig collects every value wireSMB needs. +type SMBConfig struct { + Enabled bool + NBTBinding string + DirectBinding string + GuestOk bool + Workgroup string + ServerName string + Shares []smb.ShareConfig + NetBIOS NetBIOSHook + IPX IPXHook + Shortname ShortnameHook +} diff --git a/cmd/classicstack/smb_shares.go b/cmd/classicstack/smb_shares.go new file mode 100644 index 0000000..991fd26 --- /dev/null +++ b/cmd/classicstack/smb_shares.go @@ -0,0 +1,80 @@ +package main + +import ( + "strings" + + "github.com/ObsoleteMadness/ClassicStack/config" + "github.com/ObsoleteMadness/ClassicStack/netlog" + "github.com/ObsoleteMadness/ClassicStack/service/smb" +) + +// loadSMBShares assembles the SMB share list from whichever source is +// active. In TOML mode it reads [SMB.Volumes.] sections; in flag +// mode it parses "Name:Path" entries from -smb-share. The two sources +// are not merged — flag-mode is mutually exclusive with -config. +// +// The legacy [SMB.Shares.] table key is also accepted for now, +// with a one-time deprecation warning. Future commits may drop the +// alias. +func loadSMBShares(src config.Source, fromConfigFile bool, flagShares []string) []smb.ShareConfig { + if fromConfigFile { + return loadSMBSharesFromConfig(src) + } + return loadSMBSharesFromFlags(flagShares) +} + +func loadSMBSharesFromConfig(src config.Source) []smb.ShareConfig { + if src.K == nil { + return nil + } + prefix := "" + switch { + case src.K.Exists("SMB.Volumes"): + prefix = "SMB.Volumes" + case src.K.Exists("SMB.Shares"): + prefix = "SMB.Shares" + netlog.Warn("[MAIN][SMB] [SMB.Shares.*] is deprecated; rename to [SMB.Volumes.*]") + default: + return nil + } + keys := src.K.MapKeys(prefix) + if len(keys) == 0 { + return nil + } + out := make([]smb.ShareConfig, 0, len(keys)) + for _, key := range keys { + base := prefix + "." + key + share := smb.ShareConfig{ + Name: stringWithDefault(src.K, base+".name", key), + Path: stringWithDefault(src.K, base+".path", ""), + FSType: stringWithDefault(src.K, base+".fs_type", "local_fs"), + ReadOnly: boolWithDefault(src.K, base+".read_only", false), + } + if strings.TrimSpace(share.Path) == "" { + netlog.Warn("[MAIN][SMB] [%s.%s] missing path; skipping", prefix, key) + continue + } + out = append(out, share) + } + return out +} + +func loadSMBSharesFromFlags(flagShares []string) []smb.ShareConfig { + if len(flagShares) == 0 { + return nil + } + out := make([]smb.ShareConfig, 0, len(flagShares)) + for _, raw := range flagShares { + idx := strings.Index(raw, ":") + if idx <= 0 || idx == len(raw)-1 { + netlog.Warn("[MAIN][SMB] invalid -smb-share %q (want Name:Path); skipping", raw) + continue + } + out = append(out, smb.ShareConfig{ + Name: raw[:idx], + Path: raw[idx+1:], + FSType: "local_fs", + }) + } + return out +} diff --git a/dist/Sample Volume/_.afp.db b/dist/Sample Volume/_.afp.db index 116a197..4401b29 100644 Binary files a/dist/Sample Volume/_.afp.db and b/dist/Sample Volume/_.afp.db differ diff --git a/icons/omnitalk.icns b/icons/classicstack.icns similarity index 100% rename from icons/omnitalk.icns rename to icons/classicstack.icns diff --git a/icons/omnitalk.ico b/icons/classicstack.ico similarity index 100% rename from icons/omnitalk.ico rename to icons/classicstack.ico diff --git a/pkg/appledouble/appledouble.go b/pkg/appledouble/appledouble.go index 80cf6ce..576e5f8 100644 --- a/pkg/appledouble/appledouble.go +++ b/pkg/appledouble/appledouble.go @@ -34,7 +34,7 @@ const ( // EntryIDIconBW is the entry ID for a classic 32x32 1-bit // Macintosh icon (netatalk adouble.h AD_ICON). The payload is // 128 bytes of bitmap with no mask. - EntryIDIconBW uint32 = 5 + EntryIDIconBW uint32 = 5 EntryIDFinderInfo uint32 = 9 ) diff --git a/pkg/cnid/cnid.go b/pkg/cnid/cnid.go index 51a054d..604377c 100644 --- a/pkg/cnid/cnid.go +++ b/pkg/cnid/cnid.go @@ -1,10 +1,13 @@ // Package cnid tracks the mapping between AFP Catalog Node IDs and -// current filesystem paths for a single volume. The package is AFP- -// agnostic — future services (macgarden, others) can reuse the Store -// interface and its in-memory and SQLite implementations without -// pulling in anything from service/afp. +// current filesystem paths for a single volume, and additionally +// holds the per-volume 8.3 shortname bindings used by AFP's +// PathTypeShortNames and by SMB/DOS clients. The package is AFP- +// agnostic — any service can reuse the Store interface and its +// in-memory and SQLite implementations. package cnid +import "github.com/ObsoleteMadness/ClassicStack/pkg/shortname" + const ( // Invalid signals an error or "no CNID" sentinel. Invalid uint32 = 0 @@ -16,9 +19,15 @@ const ( firstDynamic uint32 = 3 ) -// Store tracks CNID <-> path bindings. Implementations must be safe for -// concurrent use. Callers treat paths as opaque strings but are free to -// expect that path.Clean-equivalent normalisation happens internally. +// Store tracks CNID <-> path bindings and the per-volume shortname +// mapping. Implementations must be safe for concurrent use. Callers +// treat paths as opaque strings but are free to expect that +// path.Clean-equivalent normalisation happens internally. +// +// Embedding shortname.Store keeps shortname the conceptually general +// primitive (used by SMB, AFP, DOS clients) and CNID the per-volume +// composite that bundles shortname bindings with CNID/path tracking, +// without forcing a circular dependency. type Store interface { RootID() uint32 Path(cnid uint32) (string, bool) @@ -27,4 +36,5 @@ type Store interface { EnsureReserved(path string, cnid uint32) uint32 Rebind(oldPath, newPath string) Remove(path string) + shortname.Store } diff --git a/pkg/cnid/memory.go b/pkg/cnid/memory.go index ee2f1e0..8329f83 100644 --- a/pkg/cnid/memory.go +++ b/pkg/cnid/memory.go @@ -4,6 +4,8 @@ import ( "path/filepath" "strings" "sync" + + "github.com/ObsoleteMadness/ClassicStack/pkg/vfs" ) // MemoryStore keeps CNIDs in memory for the lifetime of the process. It @@ -14,14 +16,18 @@ type MemoryStore struct { cnidToPath map[uint32]string pathToCNID map[string]uint32 nextCNID uint32 + shortnames map[string]map[string]string // dir -> long -> short } func NewMemoryStore() *MemoryStore { - return &MemoryStore{ + m := &MemoryStore{ cnidToPath: make(map[uint32]string), pathToCNID: make(map[string]uint32), nextCNID: firstDynamic, + shortnames: make(map[string]map[string]string), } + vfs.DefaultBus.Subscribe(m) + return m } func (s *MemoryStore) RootID() uint32 { return Root } @@ -127,3 +133,53 @@ func (s *MemoryStore) nextAvailableCNIDLocked() uint32 { } } } + +func (s *MemoryStore) Get(short string) (string, bool) { + // Not an efficient mapping in this simplistic stub memory store + s.mu.RLock() + defer s.mu.RUnlock() + for _, m := range s.shortnames { + for long, existingShort := range m { + if existingShort == short { + return long, true + } + } + } + return "", false +} + +func (s *MemoryStore) LookupShort(dir string, long string) (string, bool) { + s.mu.RLock() + defer s.mu.RUnlock() + if m, ok := s.shortnames[dir]; ok { + if short, ok := m[long]; ok { + return short, true + } + } + return "", false +} + +func (s *MemoryStore) Put(dir string, long, short string) error { + s.mu.Lock() + defer s.mu.Unlock() + if _, ok := s.shortnames[dir]; !ok { + s.shortnames[dir] = make(map[string]string) + } + s.shortnames[dir][long] = short + return nil +} + +// OnVFSEvent implements vfs.Subscriber. +func (s *MemoryStore) OnVFSEvent(ev vfs.Event) { + if ev.Origin == "afp" { + return + } + switch ev.Op { + case vfs.OpCreate: + s.Ensure(ev.HostPath) + case vfs.OpDelete: + s.Remove(ev.HostPath) + case vfs.OpRename: + s.Rebind(ev.OldPath, ev.HostPath) + } +} diff --git a/pkg/cnid/sqlite.go b/pkg/cnid/sqlite.go index 30f9646..53c54a4 100644 --- a/pkg/cnid/sqlite.go +++ b/pkg/cnid/sqlite.go @@ -12,6 +12,8 @@ import ( "sync" _ "modernc.org/sqlite" + + "github.com/ObsoleteMadness/ClassicStack/pkg/vfs" ) // SQLiteFilename is the standard CNID database filename dropped at the @@ -75,6 +77,7 @@ func NewSQLiteStore(volumeRootPath string) (*SQLiteStore, error) { db.Close() return nil, err } + vfs.DefaultBus.Subscribe(store) return store, nil } @@ -85,10 +88,43 @@ func (s *SQLiteStore) initSchema() error { path TEXT NOT NULL UNIQUE ); CREATE INDEX IF NOT EXISTS idx_cnid_paths_path ON cnid_paths(path); + + CREATE TABLE IF NOT EXISTS shortnames ( + dir TEXT NOT NULL, + long TEXT NOT NULL, + short TEXT NOT NULL, + PRIMARY KEY (dir, long) + ); + CREATE INDEX IF NOT EXISTS idx_shortnames_dir ON shortnames(dir); `) return err } +func (s *SQLiteStore) Get(short string) (string, bool) { + var long string + err := s.db.QueryRow("SELECT long FROM shortnames WHERE short = ?", short).Scan(&long) + if err != nil { + return "", false + } + return long, true +} + +func (s *SQLiteStore) LookupShort(dir string, long string) (string, bool) { + var short string + err := s.db.QueryRow("SELECT short FROM shortnames WHERE dir = ? AND long = ?", dir, long).Scan(&short) + if err != nil { + return "", false + } + return short, true +} + +func (s *SQLiteStore) Put(dir string, long, short string) error { + s.mu.Lock() + defer s.mu.Unlock() + _, err := s.db.Exec("INSERT OR REPLACE INTO shortnames(dir, long, short) VALUES(?, ?, ?)", dir, long, short) + return err +} + func (s *SQLiteStore) RootID() uint32 { return Root } func (s *SQLiteStore) Path(cnid uint32) (string, bool) { @@ -283,3 +319,18 @@ func nextAvailableCNIDTx(tx *sql.Tx) (uint32, error) { } return maxCNID + 1, nil } + +// OnVFSEvent implements vfs.Subscriber. +func (s *SQLiteStore) OnVFSEvent(ev vfs.Event) { + if ev.Origin == "afp" { + return + } + switch ev.Op { + case vfs.OpCreate: + s.Ensure(ev.HostPath) + case vfs.OpDelete: + s.Remove(ev.HostPath) + case vfs.OpRename: + s.Rebind(ev.OldPath, ev.HostPath) + } +} diff --git a/pkg/cnid/sqlite_stub.go b/pkg/cnid/sqlite_stub.go index 71c9560..ad476de 100644 --- a/pkg/cnid/sqlite_stub.go +++ b/pkg/cnid/sqlite_stub.go @@ -6,6 +6,8 @@ import ( "database/sql" "errors" "path/filepath" + + "github.com/ObsoleteMadness/ClassicStack/pkg/vfs" ) // SQLiteFilename is the standard CNID database filename dropped at the @@ -34,13 +36,17 @@ func SQLitePath(volumeRootPath string) string { // method is invoked. type SQLiteStore struct{} -func (*SQLiteStore) RootID() uint32 { return Root } -func (*SQLiteStore) Path(_ uint32) (string, bool) { return "", false } -func (*SQLiteStore) CNID(_ string) (uint32, bool) { return 0, false } -func (*SQLiteStore) Ensure(_ string) uint32 { return 0 } -func (*SQLiteStore) EnsureReserved(_ string, cnid uint32) uint32 { return cnid } -func (*SQLiteStore) Rebind(_ string, _ string) {} -func (*SQLiteStore) Remove(_ string) {} +func (*SQLiteStore) RootID() uint32 { return Root } +func (*SQLiteStore) Path(_ uint32) (string, bool) { return "", false } +func (*SQLiteStore) CNID(_ string) (uint32, bool) { return 0, false } +func (*SQLiteStore) Ensure(_ string) uint32 { return 0 } +func (*SQLiteStore) EnsureReserved(_ string, cnid uint32) uint32 { return cnid } +func (*SQLiteStore) Rebind(_ string, _ string) {} +func (*SQLiteStore) Remove(_ string) {} +func (*SQLiteStore) Get(short string) (string, bool) { return "", false } +func (*SQLiteStore) LookupShort(dir, long string) (string, bool) { return "", false } +func (*SQLiteStore) Put(dir, long, short string) error { return nil } +func (*SQLiteStore) OnVFSEvent(ev vfs.Event) {} // OpenSQLiteDB always returns ErrSQLiteDisabled in stub builds. func OpenSQLiteDB(_ string) (*sql.DB, error) { return nil, ErrSQLiteDisabled } diff --git a/pkg/shortname/shortname.go b/pkg/shortname/shortname.go new file mode 100644 index 0000000..48cc7f2 --- /dev/null +++ b/pkg/shortname/shortname.go @@ -0,0 +1,238 @@ +// Package shortname is the shared 8.3 ("short name") mapping service +// used by SMB 1.0 (which must serve 8.3 to legacy DOS/Windows clients) +// and, optionally, by AFP (whose PathTypeShortNames code path is today +// only a wire flag). +// +// The package is a stub: NewMapper returns a Mapper that produces a +// deterministic naive 8.3 form without persisting collision suffixes. +// Full per-directory uniqueness with a backing store lands when the +// SMB enumeration path actually needs it. +package shortname + +import ( + "path/filepath" + "strings" + "sync" + + "github.com/ObsoleteMadness/ClassicStack/pkg/vfs" +) + +// Mapper maps long names to 8.3 short names and back. Implementations +// must be safe for concurrent use. +type Mapper interface { + // LongToShort returns the 8.3 form for a long file name. The result + // is the registered short name when one already exists, or a freshly + // allocated one otherwise. + LongToShort(long string) string + // ShortToLong returns the long name previously registered for a + // short name. The second return is false when no mapping exists. + ShortToLong(short string) (string, bool) + // Bind registers (or returns) the short name for long within the + // given parent directory key, applying ~N collision suffixes. + Bind(dir, long string) string +} + +// Store persists short<->long bindings. The in-memory implementation +// is the default; a sqlite-backed store will land later. +type Store interface { + Get(short string) (long string, ok bool) + Put(dir, long, short string) error + LookupShort(dir, long string) (short string, ok bool) +} + +// Config controls the behavior of the shortname mapper. +type Config struct { + WindowsShortnames bool +} + +// NewMapper returns a Mapper backed by store. When store is nil, an +// in-memory store is used. +func NewMapper(store Store, cfg Config) Mapper { + if store == nil { + store = NewMemoryStore() + } + return &mapper{store: store, cfg: cfg} +} + +type mapper struct { + store Store + cfg Config +} + +func (m *mapper) LongToShort(long string) string { + return m.Bind("", long) +} + +func (m *mapper) ShortToLong(short string) (string, bool) { + return m.store.Get(strings.ToUpper(short)) +} + +func (m *mapper) Bind(dir, long string) string { + if existing, ok := m.store.LookupShort(dir, long); ok { + return existing + } + + if m.cfg.WindowsShortnames { + fullPath := filepath.Join(dir, long) + if short, err := getWindowsShortName(fullPath); err == nil && short != "" { + _ = m.store.Put(dir, long, short) + return short + } + } + + short := derive83(long, 1) + _ = m.store.Put(dir, long, short) + return short +} + +// derive83 produces a deterministic 8.3 candidate from long with the +// given collision counter N (encoded as ~N). It does not check for +// uniqueness; the caller is responsible for collision handling. +func derive83(long string, n int) string { + base, ext := splitExt(long) + base = sanitizeFAT(strings.ToUpper(base)) + ext = sanitizeFAT(strings.ToUpper(ext)) + if len(ext) > 3 { + ext = ext[:3] + } + suffix := "~" + itoa(n) + keep := max(8-len(suffix), 1) + if len(base) > keep { + base = base[:keep] + } + if base == "" { + base = "FILE" + if len(base) > keep { + base = base[:keep] + } + } + out := base + suffix + if ext != "" { + out += "." + ext + } + return out +} + +func splitExt(name string) (base, ext string) { + idx := strings.LastIndex(name, ".") + if idx <= 0 || idx == len(name)-1 { + return name, "" + } + return name[:idx], name[idx+1:] +} + +// sanitizeFAT strips characters that are illegal in FAT short names. +// It is intentionally simple — the canonical Windows mapping is more +// elaborate and lands when the real algorithm replaces this stub. +func sanitizeFAT(s string) string { + var b strings.Builder + for _, r := range s { + switch { + case r >= 'A' && r <= 'Z': + b.WriteRune(r) + case r >= '0' && r <= '9': + b.WriteRune(r) + case r == '_' || r == '-' || r == '$' || r == '#' || r == '&' || r == '@' || r == '!' || r == '(' || r == ')' || r == '{' || r == '}' || r == '\'' || r == '`': + b.WriteRune(r) + default: + // Drop spaces, dots (already handled), and anything else. + } + } + return b.String() +} + +func itoa(n int) string { + if n == 0 { + return "0" + } + neg := n < 0 + if neg { + n = -n + } + var buf [20]byte + i := len(buf) + for n > 0 { + i-- + buf[i] = byte('0' + n%10) + n /= 10 + } + if neg { + i-- + buf[i] = '-' + } + return string(buf[i:]) +} + +// MemoryStore is a non-persistent Store implementation. It is the +// default backing store when callers pass nil to NewMapper. +type MemoryStore struct { + mu sync.RWMutex + byShort map[string]string // SHORT -> long + byLong map[string]map[string]string // dir -> long -> SHORT +} + +// NewMemoryStore returns an empty in-memory store and subscribes it to the VFS bus. +func NewMemoryStore() *MemoryStore { + s := &MemoryStore{ + byShort: map[string]string{}, + byLong: map[string]map[string]string{}, + } + vfs.DefaultBus.Subscribe(s) + return s +} + +// Get implements Store. +func (s *MemoryStore) Get(short string) (string, bool) { + s.mu.RLock() + defer s.mu.RUnlock() + long, ok := s.byShort[strings.ToUpper(short)] + return long, ok +} + +// LookupShort implements Store. +func (s *MemoryStore) LookupShort(dir, long string) (string, bool) { + s.mu.RLock() + defer s.mu.RUnlock() + dirMap, ok := s.byLong[dir] + if !ok { + return "", false + } + short, ok := dirMap[long] + return short, ok +} + +// Put implements Store. It is intentionally last-writer-wins; the +// real implementation will reject collisions with a different long +// name and return an error so the caller can pick a fresh ~N suffix. +func (s *MemoryStore) Put(dir, long, short string) error { + s.mu.Lock() + defer s.mu.Unlock() + short = strings.ToUpper(short) + if s.byLong[dir] == nil { + s.byLong[dir] = map[string]string{} + } + s.byLong[dir][long] = short + s.byShort[short] = long + return nil +} + +// OnVFSEvent implements vfs.Subscriber. +func (s *MemoryStore) OnVFSEvent(ev vfs.Event) { + if ev.Op == vfs.OpDelete || ev.Op == vfs.OpRename { + s.mu.Lock() + defer s.mu.Unlock() + + dir := filepath.Dir(ev.HostPath) + long := filepath.Base(ev.HostPath) + + if dirMap, ok := s.byLong[dir]; ok { + if short, ok := dirMap[long]; ok { + delete(dirMap, long) + delete(s.byShort, short) + } + if len(dirMap) == 0 { + delete(s.byLong, dir) + } + } + } +} diff --git a/pkg/shortname/shortname_other.go b/pkg/shortname/shortname_other.go new file mode 100644 index 0000000..0371d68 --- /dev/null +++ b/pkg/shortname/shortname_other.go @@ -0,0 +1,11 @@ +//go:build !windows + +package shortname + +import "errors" + +var errNotSupported = errors.New("native shortnames not supported on this platform") + +func getWindowsShortName(path string) (string, error) { + return "", errNotSupported +} diff --git a/pkg/shortname/shortname_test.go b/pkg/shortname/shortname_test.go new file mode 100644 index 0000000..83eb34a --- /dev/null +++ b/pkg/shortname/shortname_test.go @@ -0,0 +1,37 @@ +package shortname + +import "testing" + +func TestRoundTrip(t *testing.T) { + m := NewMapper(nil, Config{}) + short := m.LongToShort("My Long Filename.txt") + if short != "MYLONGF~1.TXT" { + // Stub algorithm: stripped spaces, uppercased, 6 chars + ~1, .TXT. + // Check the prefix and suffix shape rather than exact content + // so the test survives small algorithm tweaks before the real + // Windows mapping lands. + if !endsWith(short, "~1.TXT") { + t.Fatalf("unexpected short name %q", short) + } + } + got, ok := m.ShortToLong(short) + if !ok { + t.Fatalf("ShortToLong(%q): not found", short) + } + if got != "My Long Filename.txt" { + t.Fatalf("ShortToLong: got %q want %q", got, "My Long Filename.txt") + } +} + +func TestBindIsIdempotent(t *testing.T) { + m := NewMapper(nil, Config{}) + a := m.Bind("/home", "report.docx") + b := m.Bind("/home", "report.docx") + if a != b { + t.Fatalf("Bind not idempotent: %q vs %q", a, b) + } +} + +func endsWith(s, suffix string) bool { + return len(s) >= len(suffix) && s[len(s)-len(suffix):] == suffix +} diff --git a/pkg/shortname/shortname_windows.go b/pkg/shortname/shortname_windows.go new file mode 100644 index 0000000..9449ae7 --- /dev/null +++ b/pkg/shortname/shortname_windows.go @@ -0,0 +1,26 @@ +//go:build windows + +package shortname + +import ( + "path/filepath" + "syscall" +) + +// getWindowsShortName invokes the native GetShortPathName API. +func getWindowsShortName(path string) (string, error) { + pathP, err := syscall.UTF16PtrFromString(path) + if err != nil { + return "", err + } + n, err := syscall.GetShortPathName(pathP, nil, 0) + if n == 0 { + return "", err + } + buf := make([]uint16, n) + n, err = syscall.GetShortPathName(pathP, &buf[0], uint32(len(buf))) + if n == 0 { + return "", err + } + return filepath.Base(syscall.UTF16ToString(buf)), nil +} diff --git a/service/afp/local_fs_disk_other.go b/pkg/vfs/disk_usage_other.go similarity index 70% rename from service/afp/local_fs_disk_other.go rename to pkg/vfs/disk_usage_other.go index f16bc6f..016ae85 100644 --- a/service/afp/local_fs_disk_other.go +++ b/pkg/vfs/disk_usage_other.go @@ -1,15 +1,16 @@ //go:build !windows -package afp +package vfs import "syscall" +// diskUsage returns the size of the filesystem holding path and the +// bytes available to non-root processes. Used by LocalFileSystem.DiskUsage. func diskUsage(path string) (totalBytes uint64, freeBytes uint64, err error) { var stat syscall.Statfs_t if err := syscall.Statfs(path, &stat); err != nil { return 0, 0, err } - blockSize := uint64(stat.Bsize) totalBytes = uint64(stat.Blocks) * blockSize freeBytes = uint64(stat.Bavail) * blockSize diff --git a/service/afp/local_fs_disk_windows.go b/pkg/vfs/disk_usage_windows.go similarity index 74% rename from service/afp/local_fs_disk_windows.go rename to pkg/vfs/disk_usage_windows.go index 3251b2e..3a562e7 100644 --- a/service/afp/local_fs_disk_windows.go +++ b/pkg/vfs/disk_usage_windows.go @@ -1,9 +1,11 @@ //go:build windows -package afp +package vfs import "golang.org/x/sys/windows" +// diskUsage returns the size of the volume holding path and the bytes +// available to the caller's user. Used by LocalFileSystem.DiskUsage. func diskUsage(path string) (totalBytes uint64, freeBytes uint64, err error) { pathPtr, err := windows.UTF16PtrFromString(path) if err != nil { @@ -16,6 +18,5 @@ func diskUsage(path string) (totalBytes uint64, freeBytes uint64, err error) { if err := windows.GetDiskFreeSpaceEx(pathPtr, &freeAvailable, &total, &totalFree); err != nil { return 0, 0, err } - return total, totalFree, nil } diff --git a/pkg/vfs/events.go b/pkg/vfs/events.go new file mode 100644 index 0000000..cacf550 --- /dev/null +++ b/pkg/vfs/events.go @@ -0,0 +1,210 @@ +package vfs + +import ( + "sync" + "sync/atomic" + "time" +) + +// Op enumerates the file-event kinds carried on the VFS bus. +type Op uint8 + +const ( + OpCreate Op = iota + 1 + OpRename + OpModify + OpDelete + OpAttrChange +) + +// String renders an Op for log messages and tests. +func (o Op) String() string { + switch o { + case OpCreate: + return "create" + case OpRename: + return "rename" + case OpModify: + return "modify" + case OpDelete: + return "delete" + case OpAttrChange: + return "attr" + default: + return "unknown" + } +} + +// Event describes a filesystem mutation that may be of interest to +// other backends and services. HostPath is the canonical absolute +// host path; OldPath is populated only for OpRename. +// +// Origin is a free-form publisher tag (e.g. "smb", "afp", "fsnotify"). +// Subscribers filter by Origin to avoid handling events they emitted +// themselves. The bus does not enforce loop avoidance; that is each +// subscriber's responsibility because a publisher may legitimately +// want to see another publisher's events even from the same backend. +type Event struct { + Op Op + HostPath string + OldPath string + Origin string + Time time.Time +} + +// Subscriber receives events published to a Bus. +type Subscriber interface { + OnVFSEvent(ev Event) +} + +// Bus is the publish/subscribe surface for filesystem events. Publish +// is non-blocking: each subscriber has its own bounded buffer and a +// slow subscriber loses events rather than stalling the data path. +type Bus interface { + Subscribe(sub Subscriber) (cancel func()) + Publish(ev Event) +} + +// BusOptions tunes the in-memory bus implementation. +type BusOptions struct { + // SubscriberBuffer is the per-subscriber channel depth. Defaults + // to 256 when zero. Higher values trade memory for tolerance of + // transient subscriber stalls. + SubscriberBuffer int + // DropWarnInterval rate-limits "subscriber dropped events" warning + // logs. Defaults to 30s when zero. + DropWarnInterval time.Duration + // DropLogger receives a single string per drop-warning interval + // when a subscriber's buffer overflowed at least once. May be nil. + DropLogger func(msg string) +} + +// NewBus returns an in-memory Bus. +func NewBus(opts BusOptions) Bus { + if opts.SubscriberBuffer <= 0 { + opts.SubscriberBuffer = 256 + } + if opts.DropWarnInterval <= 0 { + opts.DropWarnInterval = 30 * time.Second + } + return &busImpl{opts: opts} +} + +// DefaultBus is the process-wide bus used when callers do not inject +// their own. Constructors should accept a Bus parameter and fall back +// to DefaultBus only at the wiring layer (cmd/classicstack), not deep +// inside services. +var DefaultBus Bus = NewBus(BusOptions{}) + +type busImpl struct { + opts BusOptions + mu sync.RWMutex + subs []*subState +} + +type subState struct { + sub Subscriber + ch chan Event + stop chan struct{} + once sync.Once + wg sync.WaitGroup + dropCount atomic.Uint64 + lastWarnNS atomic.Int64 +} + +func (b *busImpl) Subscribe(sub Subscriber) func() { + if sub == nil { + return func() {} + } + st := &subState{ + sub: sub, + ch: make(chan Event, b.opts.SubscriberBuffer), + stop: make(chan struct{}), + } + b.mu.Lock() + b.subs = append(b.subs, st) + b.mu.Unlock() + st.wg.Add(1) + go b.dispatch(st) + return func() { + st.once.Do(func() { + close(st.stop) + b.mu.Lock() + for i, s := range b.subs { + if s == st { + b.subs = append(b.subs[:i], b.subs[i+1:]...) + break + } + } + b.mu.Unlock() + }) + st.wg.Wait() + } +} + +func (b *busImpl) Publish(ev Event) { + if ev.Time.IsZero() { + ev.Time = time.Now() + } + b.mu.RLock() + for _, st := range b.subs { + select { + case st.ch <- ev: + default: + st.dropCount.Add(1) + b.maybeWarn(st) + } + } + b.mu.RUnlock() +} + +func (b *busImpl) maybeWarn(st *subState) { + if b.opts.DropLogger == nil { + return + } + now := time.Now().UnixNano() + last := st.lastWarnNS.Load() + if now-last < int64(b.opts.DropWarnInterval) { + return + } + if !st.lastWarnNS.CompareAndSwap(last, now) { + return + } + count := st.dropCount.Swap(0) + b.opts.DropLogger("vfs: subscriber dropped " + itoaUint64(count) + " event(s)") +} + +func (b *busImpl) dispatch(st *subState) { + defer st.wg.Done() + for { + select { + case <-st.stop: + return + case ev := <-st.ch: + st.sub.OnVFSEvent(ev) + } + } +} + +// itoaUint64 is a tiny strconv-free uint64 formatter used by the drop +// warning so the events module does not pull strconv into every +// service that imports vfs. +func itoaUint64(v uint64) string { + if v == 0 { + return "0" + } + var buf [20]byte + i := len(buf) + for v > 0 { + i-- + buf[i] = byte('0' + v%10) + v /= 10 + } + return string(buf[i:]) +} + +// SubscriberFunc adapts a plain function to the Subscriber interface. +type SubscriberFunc func(ev Event) + +// OnVFSEvent implements Subscriber. +func (f SubscriberFunc) OnVFSEvent(ev Event) { f(ev) } diff --git a/pkg/vfs/events_test.go b/pkg/vfs/events_test.go new file mode 100644 index 0000000..beb5cc9 --- /dev/null +++ b/pkg/vfs/events_test.go @@ -0,0 +1,94 @@ +package vfs + +import ( + "sync" + "sync/atomic" + "testing" + "time" +) + +func TestBusFanOutAndOriginFilter(t *testing.T) { + bus := NewBus(BusOptions{}) + + var ( + mu sync.Mutex + seenSMB []Event + seenOther []Event + ) + + cancelSMB := bus.Subscribe(SubscriberFunc(func(ev Event) { + // SMB subscriber filters out its own events. + if ev.Origin == "smb" { + return + } + mu.Lock() + seenSMB = append(seenSMB, ev) + mu.Unlock() + })) + defer cancelSMB() + + cancelOther := bus.Subscribe(SubscriberFunc(func(ev Event) { + mu.Lock() + seenOther = append(seenOther, ev) + mu.Unlock() + })) + defer cancelOther() + + bus.Publish(Event{Op: OpRename, HostPath: "/a", OldPath: "/b", Origin: "smb"}) + bus.Publish(Event{Op: OpCreate, HostPath: "/c", Origin: "afp"}) + + // Allow async dispatch goroutines to drain. + deadline := time.Now().Add(time.Second) + for time.Now().Before(deadline) { + mu.Lock() + ok := len(seenOther) == 2 && len(seenSMB) == 1 + mu.Unlock() + if ok { + break + } + time.Sleep(2 * time.Millisecond) + } + + mu.Lock() + defer mu.Unlock() + if len(seenOther) != 2 { + t.Fatalf("Other subscriber: got %d events, want 2", len(seenOther)) + } + if len(seenSMB) != 1 || seenSMB[0].Origin != "afp" { + t.Fatalf("SMB subscriber filtered wrong: %#v", seenSMB) + } +} + +func TestBusDropsOnSlowSubscriber(t *testing.T) { + var dropMsgs atomic.Int32 + bus := NewBus(BusOptions{ + SubscriberBuffer: 2, + DropWarnInterval: time.Millisecond, + DropLogger: func(string) { dropMsgs.Add(1) }, + }) + + block := make(chan struct{}) + cancel := bus.Subscribe(SubscriberFunc(func(ev Event) { + <-block // Pin the dispatch goroutine until we release. + })) + defer func() { + close(block) + cancel() + }() + + // 1 event is in-flight (held by our blocked handler), 2 fit in the + // buffer, the rest must be dropped without blocking Publish. + for range 50 { + bus.Publish(Event{Op: OpModify, HostPath: "/x", Origin: "test"}) + } + + // At least one drop warning should have surfaced via DropLogger. + deadline := time.Now().Add(time.Second) + for time.Now().Before(deadline) { + if dropMsgs.Load() > 0 { + return + } + time.Sleep(2 * time.Millisecond) + } + t.Fatal("expected at least one drop warning, got none") +} diff --git a/pkg/vfs/local_fs.go b/pkg/vfs/local_fs.go new file mode 100644 index 0000000..7dc1095 --- /dev/null +++ b/pkg/vfs/local_fs.go @@ -0,0 +1,104 @@ +package vfs + +import ( + "io/fs" + "os" + "path/filepath" +) + +// LocalFSName is the registry key for the host-filesystem backend. +const LocalFSName = "local_fs" + +// LocalFileSystem is a thin wrapper over the host filesystem. Every +// path it receives must already be a UTF-8 absolute host path; this +// type performs no translation. Services that need translation +// (e.g. AFP MacRoman ↔ host) compose this type rather than +// re-implementing the universal operations. +// +// LocalFileSystem holds no state, so it is safe for concurrent use +// from any number of goroutines. +type LocalFileSystem struct { + name string + root string + readOnly bool + mapper ShortnameMapper +} + +// NewLocalFileSystem constructs an empty LocalFileSystem. Constructed +// instances are equivalent because the type is stateless; the +// constructor exists for API symmetry with future stateful backends. +func NewLocalFileSystem(targetPath string, p Params) (*LocalFileSystem, error) { + return &LocalFileSystem{ + name: p.Name, + root: targetPath, + readOnly: p.ReadOnly, + mapper: p.ShortnameMapper, + }, nil +} + +func init() { + Register(LocalFSName, func(p Params) (FileSystem, error) { + return NewLocalFileSystem(p.Path, p) + }) +} + +// ReadDir implements FileSystem. +func (l *LocalFileSystem) ReadDir(path string) ([]fs.DirEntry, error) { + return os.ReadDir(path) +} + +// Stat implements FileSystem. +func (l *LocalFileSystem) Stat(path string) (fs.FileInfo, error) { + return os.Stat(path) +} + +// DiskUsage implements FileSystem. +func (l *LocalFileSystem) DiskUsage(path string) (totalBytes uint64, freeBytes uint64, err error) { + return diskUsage(path) +} + +// CreateDir implements FileSystem. +func (l *LocalFileSystem) CreateDir(path string) error { + return os.Mkdir(path, 0o755) +} + +// CreateFile implements FileSystem. +func (l *LocalFileSystem) CreateFile(path string) (File, error) { + return os.Create(path) +} + +// OpenFile implements FileSystem. +func (l *LocalFileSystem) OpenFile(path string, flag int) (File, error) { + return os.OpenFile(path, flag, 0o644) +} + +// Remove implements FileSystem. It removes a single entry only and +// does not recurse — callers that need recursive removal compose it. +func (l *LocalFileSystem) Remove(path string) error { + return os.Remove(path) +} + +// Rename implements FileSystem. +func (l *LocalFileSystem) Rename(oldpath, newpath string) error { + return os.Rename(oldpath, newpath) +} + +// ShortName implements FileSystem. +func (l *LocalFileSystem) ShortName(path string) (string, error) { + if l.mapper == nil { + return filepath.Base(path), nil + } + return l.mapper.Bind(filepath.Dir(path), filepath.Base(path)), nil +} + +// Capabilities implements FileSystem. The local backend exposes +// child-count, directory-attributes, and read-only-state as cheap +// follow-up syscalls; richer optional behaviors (e.g. AFP CatSearch) +// live on the consuming service's wrapper. +func (l *LocalFileSystem) Capabilities() Capabilities { + return Capabilities{ + ChildCount: true, + DirAttributes: true, + ReadOnlyState: true, + } +} diff --git a/pkg/vfs/local_fs_test.go b/pkg/vfs/local_fs_test.go new file mode 100644 index 0000000..2b7cadb --- /dev/null +++ b/pkg/vfs/local_fs_test.go @@ -0,0 +1,75 @@ +package vfs + +import ( + "os" + "path/filepath" + "slices" + "testing" +) + +func TestLocalFSRoundTrip(t *testing.T) { + dir := t.TempDir() + + fsBackend, err := New(LocalFSName, Params{Name: "Test", Path: dir}) + if err != nil { + t.Fatalf("New: %v", err) + } + + target := filepath.Join(dir, "hello.txt") + f, err := fsBackend.CreateFile(target) + if err != nil { + t.Fatalf("CreateFile: %v", err) + } + if _, err := f.WriteAt([]byte("hi"), 0); err != nil { + t.Fatalf("WriteAt: %v", err) + } + if err := f.Close(); err != nil { + t.Fatalf("Close: %v", err) + } + + info, err := fsBackend.Stat(target) + if err != nil { + t.Fatalf("Stat: %v", err) + } + if info.Size() != 2 { + t.Fatalf("size: got %d want 2", info.Size()) + } + + entries, err := fsBackend.ReadDir(dir) + if err != nil { + t.Fatalf("ReadDir: %v", err) + } + if len(entries) != 1 || entries[0].Name() != "hello.txt" { + t.Fatalf("ReadDir: %v", entries) + } + + renamed := filepath.Join(dir, "bye.txt") + if err := fsBackend.Rename(target, renamed); err != nil { + t.Fatalf("Rename: %v", err) + } + if _, err := os.Stat(renamed); err != nil { + t.Fatalf("renamed file missing: %v", err) + } + + if err := fsBackend.Remove(renamed); err != nil { + t.Fatalf("Remove: %v", err) + } +} + +func TestLocalFSCapabilities(t *testing.T) { + fsBackend, _ := NewLocalFileSystem("", Params{}) + caps := fsBackend.Capabilities() + if !caps.ChildCount || !caps.DirAttributes || !caps.ReadOnlyState { + t.Fatalf("expected universal caps; got %+v", caps) + } + if caps.CatSearch { + t.Fatal("CatSearch is AFP-specific and must not be claimed by the generic local backend") + } +} + +func TestLocalFSRegistration(t *testing.T) { + names := RegisteredNames() + if !slices.Contains(names, LocalFSName) { + t.Fatalf("local_fs not in registry: %v", names) + } +} diff --git a/pkg/vfs/vfs.go b/pkg/vfs/vfs.go new file mode 100644 index 0000000..0c3913b --- /dev/null +++ b/pkg/vfs/vfs.go @@ -0,0 +1,133 @@ +// Package vfs is a backend-neutral filesystem abstraction shared +// across ClassicStack file-server services (AFP, SMB, ...). +// +// Today AFP carries its own copy of this surface in service/afp/fs.go; +// the long-term direction is for both AFP and SMB to consume the +// FileSystem interface and FS-factory registry from this package, with +// service-specific extensions (AppleDouble, fork metadata, NTFS streams) +// living in service-local interfaces composed on top. +// +// This package currently provides only the factory registry and the +// minimal FileSystem/File contract needed by stubs of new services. +// The AFP surface is intentionally not collapsed into this package +// yet; that move is mechanical and lands in a follow-up commit so +// it can be reviewed in isolation from the new-protocol work. +package vfs + +import ( + "errors" + "fmt" + "io/fs" + "sort" + "sync" +) + +// ErrNotImplemented is returned by stub backends and stub operations +// that have not yet been filled in. +var ErrNotImplemented = errors.New("vfs: not implemented") + +// Params is a backend-supplied bag of normalized configuration. Each +// FileSystem factory documents the keys it consumes; the registry is +// agnostic to the schema. Callers (AFP, SMB) translate their own +// service-specific config types to a Params before calling NewFS. +type ShortnameMapper interface { + Bind(dir, long string) string + ShortToLong(short string) (string, bool) +} + +type Params struct { + // Name is the human-visible volume / share name. + Name string + // Path is the host filesystem root for path-backed backends. May + // be empty for synthetic backends (e.g. MacGarden). + Path string + // ReadOnly hints that writes should be rejected. Backends that + // cannot enforce this should return an error from RegisterFS-time. + ReadOnly bool + // Extra holds backend-specific keys; backends document their schema. + Extra map[string]any + // ShortnameMapper is an optional global mapping engine used by + // backends (like local_fs) to produce deterministic DOS 8.3 short names. + ShortnameMapper ShortnameMapper +} + +// File is the per-open-handle contract any backend must satisfy. +type File interface { + ReadAt(p []byte, off int64) (n int, err error) + WriteAt(p []byte, off int64) (n int, err error) + Truncate(size int64) error + Close() error + Stat() (fs.FileInfo, error) + Sync() error +} + +// FileSystem is the minimal cross-service backend contract. Service- +// specific extensions (AFP fork metadata, SMB ADS streams) compose +// this interface in their own packages rather than appearing here. +type FileSystem interface { + ReadDir(path string) ([]fs.DirEntry, error) + Stat(path string) (fs.FileInfo, error) + DiskUsage(path string) (totalBytes uint64, freeBytes uint64, err error) + CreateDir(path string) error + CreateFile(path string) (File, error) + OpenFile(path string, flag int) (File, error) + Remove(path string) error + Rename(oldpath, newpath string) error + ShortName(path string) (string, error) + Capabilities() Capabilities +} + +// Capabilities advertises optional behaviors a backend implements. +type Capabilities struct { + CatSearch bool + ChildCount bool + ReadDirRange bool + DirAttributes bool + ReadOnlyState bool +} + +// Factory constructs a FileSystem from normalized Params. Backends +// register themselves with Register from package init(). +type Factory func(Params) (FileSystem, error) + +var ( + registryMu sync.RWMutex + registry = map[string]Factory{} +) + +// Register associates a backend name with its factory. Duplicate names +// panic so missing/duplicate build tags surface immediately rather +// than silently overriding a default backend. +func Register(name string, f Factory) { + registryMu.Lock() + defer registryMu.Unlock() + if _, exists := registry[name]; exists { + panic(fmt.Sprintf("vfs: backend %q already registered", name)) + } + registry[name] = f +} + +// New dispatches to the factory registered under name. The returned +// error includes the list of registered backends when no factory matches. +func New(name string, p Params) (FileSystem, error) { + registryMu.RLock() + f, ok := registry[name] + registryMu.RUnlock() + if !ok { + return nil, fmt.Errorf("vfs: no backend registered for %q (registered: %v)", name, RegisteredNames()) + } + return f(p) +} + +// RegisteredNames returns a sorted snapshot of the backend names +// currently registered. Useful in error messages and tests. +func RegisteredNames() []string { + registryMu.RLock() + defer registryMu.RUnlock() + out := make([]string, 0, len(registry)) + for k := range registry { + out = append(out, k) + } + sort.Strings(out) + return out +} diff --git a/port/ethertalk/config.go b/port/ethertalk/config.go index 133a48a..83efda6 100644 --- a/port/ethertalk/config.go +++ b/port/ethertalk/config.go @@ -19,7 +19,9 @@ type Config struct { BridgeMode string `koanf:"bridge_mode"` // BridgeHostMAC is the host adapter's own MAC, used by the Wi-Fi // bridge shim. Defaults to HWAddress when blank. - BridgeHostMAC string `koanf:"bridge_host_mac"` + BridgeHostMAC string `koanf:"bridge_host_mac"` + // Filter optionally overrides the pcap BPF filter expression. + Filter string `koanf:"filter"` SeedNetworkMin uint `koanf:"seed_network_min"` SeedNetworkMax uint `koanf:"seed_network_max"` SeedZone string `koanf:"seed_zone"` diff --git a/port/ethertalk/ethertalk_bridge.go b/port/ethertalk/ethertalk_bridge.go index 3091a17..5046f85 100644 --- a/port/ethertalk/ethertalk_bridge.go +++ b/port/ethertalk/ethertalk_bridge.go @@ -62,7 +62,8 @@ type bridgeFrameAdapter interface { } type ethernetBridgeAdapter struct { - hostMAC []byte + hostMAC []byte + virtualMAC []byte } type wifiBridgeAdapter struct { @@ -98,13 +99,21 @@ func newEthertalkBridgeAdapterWithWiFiEncap(hostMAC, virtualMAC []byte, mode bri peerToVirtual: make(map[[6]byte]peerMapEntry), } } - return ðernetBridgeAdapter{hostMAC: hw} + return ðernetBridgeAdapter{hostMAC: hw, virtualMAC: vw} } func (b *ethernetBridgeAdapter) inboundFrame(frame []byte) ([]byte, error) { if len(frame) == 0 { return nil, fmt.Errorf("empty inbound frame") } + // Filter out loopback frames: if source MAC matches either hostMAC or virtualMAC, + // this is a pcap loopback echo of our outbound frame, so drop it. + if len(frame) >= 12 { + srcMAC := frame[6:12] + if bytes.Equal(srcMAC, b.hostMAC) || bytes.Equal(srcMAC, b.virtualMAC) { + return nil, fmt.Errorf("dropping pcap loopback frame from own MAC") + } + } // Phase 1 behavior: pass through as-is. return append([]byte(nil), frame...), nil } @@ -118,6 +127,14 @@ func (b *ethernetBridgeAdapter) outboundFrame(frame []byte) ([]byte, error) { } func (b *wifiBridgeAdapter) inboundFrame(frame []byte) ([]byte, error) { + // Filter out loopback frames: if source MAC matches either hostMAC or virtualMAC, + // this is a pcap loopback echo of our outbound frame, so drop it. + if len(frame) >= 12 { + srcMAC := frame[6:12] + if bytes.Equal(srcMAC, b.hostMAC) || bytes.Equal(srcMAC, b.virtualMAC) { + return nil, fmt.Errorf("dropping pcap loopback frame from own MAC") + } + } if len(frame) == 0 { return nil, fmt.Errorf("empty inbound frame") } diff --git a/port/ethertalk/options.go b/port/ethertalk/options.go index e8d041e..d0f043b 100644 --- a/port/ethertalk/options.go +++ b/port/ethertalk/options.go @@ -18,4 +18,6 @@ type Options struct { // BridgeHostMAC is the host adapter's MAC for the Wi-Fi bridge shim. // When nil, falls back to HWAddr. BridgeHostMAC []byte + // Filter optionally overrides the pcap BPF filter expression. + Filter string } diff --git a/port/ethertalk/pcap.go b/port/ethertalk/pcap.go index dc2f9a3..74ffb21 100644 --- a/port/ethertalk/pcap.go +++ b/port/ethertalk/pcap.go @@ -2,6 +2,7 @@ package ethertalk import ( "net" + "strings" "sync" "time" @@ -31,6 +32,7 @@ type PcapPort struct { hostMAC []byte bridgeMode bridgeMode adapter bridgeFrameAdapter + filterExpr string readerStop chan struct{} readerDone chan struct{} writerQueue chan []byte @@ -89,6 +91,7 @@ func NewPcapPort(opts Options) (*PcapPort, error) { return rawlink.OpenPcap(rawlink.DefaultEtherTalkConfig(name)) }, applyBPFFilter: true, + filterExpr: strings.TrimSpace(opts.Filter), medium: rawlink.MediumEthernet, hostMAC: append([]byte(nil), hostMAC...), bridgeMode: mode, @@ -99,6 +102,9 @@ func NewPcapPort(opts Options) (*PcapPort, error) { writerStop: make(chan struct{}), writerDone: make(chan struct{}), } + if p.filterExpr == "" { + p.filterExpr = etherTalkBPFFilter + } p.ConfigureTx(func(frame []byte) error { p.sendFrame(frame) return nil @@ -168,8 +174,8 @@ func (p *PcapPort) Start(r port.RouterHooks) error { // Apply BPF filter when the backend supports it. if p.applyBPFFilter { - if fl, ok := link.(rawlink.FilterableLink); ok { - if err := fl.SetFilter(etherTalkBPFFilter); err != nil { + if fl, ok := link.(rawlink.FilterableLink); ok && p.filterExpr != "" { + if err := fl.SetFilter(p.filterExpr); err != nil { netlog.Warn("could not set BPF filter on %s: %v", p.interfaceName, err) } } diff --git a/port/ipx/port.go b/port/ipx/port.go new file mode 100644 index 0000000..4a872b6 --- /dev/null +++ b/port/ipx/port.go @@ -0,0 +1,295 @@ +// Package ipx is the IPX-on-rawlink port. It owns its own read loop on +// a dedicated rawlink, mirroring the per-protocol-handle pattern that +// EtherTalk and MacIP use. The kernel BPF filter (when supported by +// the underlying rawlink) restricts inbound traffic to the three IPX +// framings; the second-level demux (Ethernet II vs raw 802.3 vs LLC) +// happens here in software because all three sit under a single +// pcap handle but identify themselves at different byte offsets. +package ipx + +import ( + "errors" + "hash/fnv" + "sync" + "time" + + "github.com/ObsoleteMadness/ClassicStack/capture" + "github.com/ObsoleteMadness/ClassicStack/netlog" + "github.com/ObsoleteMadness/ClassicStack/port/rawlink" + protocol "github.com/ObsoleteMadness/ClassicStack/protocol/ipx" +) + +// ErrNotImplemented is returned by stub call sites that have not yet +// been filled in. +var ErrNotImplemented = errors.New("ipx: not implemented") + +// IPXBPFFilter is the kernel-level BPF expression IPX pushes to its +// rawlink. It admits Ethernet II 0x8137 frames, 802.3 raw IPX frames +// (length-encoded with the 0xFFFF magic at the IPX checksum offset), +// and 802.2 LLC frames with DSAP/SSAP both 0xE0 and a UI control byte. +// +// The kernel does the gross-cut filtering; deliver() does the +// second-level decision based on the bytes that survive. +const IPXBPFFilter = "ether proto 0x8137 or " + + "(ether[12:2] <= 0x05dc and " + + "((ether[14:2] = 0xffff) or (ether[14:2] = 0xe0e0 and ether[16] = 0x03)))" + +// Framing selects which Ethernet encapsulation the port uses on the +// wire. Inbound, all four framings are accepted (SNAP currently +// stubbed). Outbound is whichever framing was passed to the +// constructor. +type Framing uint8 + +const ( + // FramingEthernetII is the modern default: EtherType 0x8137. + FramingEthernetII Framing = iota + // FramingRaw8023 is "Novell raw 802.3": no LLC header, identified + // only by length-field framing and the 0xFFFF magic at the IPX + // checksum offset. + FramingRaw8023 + // FramingLLC is 802.2 LLC with DSAP/SSAP both 0xE0. + FramingLLC + // FramingSNAP is 802.2 LLC + SNAP. Defined for completeness; not + // currently emitted by the stub port. + FramingSNAP +) + +// DeliveryCallback is invoked for each successfully decoded inbound +// IPX datagram. +type DeliveryCallback func(d *protocol.Datagram) + +// Port is the IPX-port surface. It is intentionally not the same type +// as the AppleTalk port.Port — IPX rides its own router and does not +// participate in DDP socket dispatch. +type Port interface { + // Start opens the read loop on the rawlink. It must be called + // before any inbound frames will be delivered. + Start() error + // Stop closes the read loop and the underlying rawlink. + Stop() error + // Send transmits an IPX datagram in the configured outbound + // framing. + Send(d *protocol.Datagram) error + // SetDeliveryCallback installs the inbound delivery callback. May + // be called before or after Start. + SetDeliveryCallback(cb DeliveryCallback) + // SetCaptureSink installs an optional raw-frame capture sink. + SetCaptureSink(sink capture.Sink) +} + +// portImpl is the rawlink-backed IPX port. +type portImpl struct { + link rawlink.RawLink + framing Framing + + mu sync.RWMutex + cb DeliveryCallback + cs capture.Sink + + dedupMu sync.Mutex + recentFrames map[uint64]time.Time + + stopOnce sync.Once + readerStop chan struct{} + readerDone chan struct{} +} + +const inboundFrameDedupWindow = 25 * time.Millisecond +const inboundFrameDedupTTL = 100 * time.Millisecond + +// NewPort opens an IPX port on link using the default Ethernet II +// framing for outbound transmit. Inbound frames are accepted in all +// three documented framings. +func NewPort(link rawlink.RawLink) Port { + return NewPortWithFraming(link, FramingEthernetII) +} + +// NewPortWithFraming opens an IPX port on link with the given outbound +// framing. +func NewPortWithFraming(link rawlink.RawLink, framing Framing) Port { + return &portImpl{ + link: link, + framing: framing, + recentFrames: make(map[uint64]time.Time), + readerStop: make(chan struct{}), + readerDone: make(chan struct{}), + } +} + +func (p *portImpl) Start() error { + if fl, ok := p.link.(rawlink.FilterableLink); ok { + if err := fl.SetFilter(IPXBPFFilter); err != nil { + netlog.Warn("[IPX] could not set BPF filter: %v", err) + } + } + go p.readLoop() + return nil +} + +func (p *portImpl) Stop() error { + p.stopOnce.Do(func() { + close(p.readerStop) + <-p.readerDone + _ = p.link.Close() + }) + return nil +} + +func (p *portImpl) Send(d *protocol.Datagram) error { + payload, err := d.Encode() + if err != nil { + return err + } + switch p.framing { + case FramingEthernetII: + return p.sendEthernetII(d, payload) + case FramingRaw8023, FramingLLC, FramingSNAP: + // Stub: encoding for these framings lands when the real port + // implementation does. Refusing rather than silently sending + // an Ethernet II frame avoids quietly corrupting a mixed + // network. + return ErrNotImplemented + default: + return errors.New("ipx: unknown framing") + } +} + +func (p *portImpl) sendEthernetII(d *protocol.Datagram, payload []byte) error { + frame := make([]byte, 14+len(payload)) + copy(frame[0:6], d.DstNode[:]) + copy(frame[6:12], d.SrcNode[:]) + frame[12] = 0x81 + frame[13] = 0x37 + copy(frame[14:], payload) + p.mu.RLock() + sink := p.cs + p.mu.RUnlock() + // Pre-register the outbound frame so any loopback copy the kernel + // surfaces back through readLoop is suppressed by isDuplicateFrame — + // otherwise our own frames are captured (and decoded) twice. + p.markFrameSeen(frame) + capture.Write(sink, time.Now(), frame) + return p.link.WriteFrame(frame) +} + +func (p *portImpl) SetDeliveryCallback(cb DeliveryCallback) { + p.mu.Lock() + p.cb = cb + p.mu.Unlock() +} + +func (p *portImpl) SetCaptureSink(sink capture.Sink) { + p.mu.Lock() + p.cs = sink + p.mu.Unlock() +} + +// readLoop is the single inbound reader. It demultiplexes by EtherType +// / length / LLC SAP and hands the IPX body to deliver(). +func (p *portImpl) readLoop() { + defer close(p.readerDone) + for { + select { + case <-p.readerStop: + return + default: + } + frame, err := p.link.ReadFrame() + if err != nil { + if err == rawlink.ErrTimeout { + continue + } + netlog.Warn("[IPX] read error: %v", err) + continue + } + if p.isDuplicateFrame(frame) { + continue + } + p.mu.RLock() + sink := p.cs + p.mu.RUnlock() + capture.Write(sink, time.Now(), frame) + p.handleFrame(frame) + } +} + +func (p *portImpl) isDuplicateFrame(frame []byte) bool { + key := frameHash(frame) + now := time.Now() + + p.dedupMu.Lock() + defer p.dedupMu.Unlock() + + if seenAt, ok := p.recentFrames[key]; ok && now.Sub(seenAt) <= inboundFrameDedupWindow { + return true + } + p.recentFrames[key] = now + for k, ts := range p.recentFrames { + if now.Sub(ts) > inboundFrameDedupTTL { + delete(p.recentFrames, k) + } + } + return false +} + +func (p *portImpl) markFrameSeen(frame []byte) { + key := frameHash(frame) + now := time.Now() + + p.dedupMu.Lock() + defer p.dedupMu.Unlock() + p.recentFrames[key] = now +} + +func frameHash(frame []byte) uint64 { + h := fnv.New64a() + _, _ = h.Write(frame) + return h.Sum64() +} + +// handleFrame inspects the Ethernet header and routes the surviving +// bytes through the matching framing decoder. The kernel filter has +// already discarded everything that doesn't match one of the three +// framings, so the discriminator here is just byte arithmetic. +func (p *portImpl) handleFrame(frame []byte) { + if len(frame) < 14 { + return + } + etherType := uint16(frame[12])<<8 | uint16(frame[13]) + switch { + case etherType == 0x8137: + // Ethernet II: payload starts at offset 14. + p.deliver(frame[14:]) + case etherType <= 0x05DC: + // 802.3 length-encoded. Either raw IPX (0xFFFF magic at the + // payload start) or 802.2 LLC. + if len(frame) < 14+3 { + return + } + body := frame[14:] + if body[0] == 0xFF && body[1] == 0xFF { + p.deliver(body) + return + } + if body[0] == 0xE0 && body[1] == 0xE0 && body[2] == 0x03 { + // LLC UI frame with DSAP=SSAP=0xE0; IPX body follows the + // 3-byte LLC header. + p.deliver(body[3:]) + return + } + } +} + +func (p *portImpl) deliver(payload []byte) { + p.mu.RLock() + cb := p.cb + p.mu.RUnlock() + if cb == nil { + return + } + d, err := protocol.Decode(payload) + if err != nil { + return + } + cb(d) +} diff --git a/port/ipx/port_test.go b/port/ipx/port_test.go new file mode 100644 index 0000000..c4ecab8 --- /dev/null +++ b/port/ipx/port_test.go @@ -0,0 +1,258 @@ +package ipx + +import ( + "errors" + "sync" + "testing" + "time" + + "github.com/ObsoleteMadness/ClassicStack/port/rawlink" + protocol "github.com/ObsoleteMadness/ClassicStack/protocol/ipx" +) + +// fakeRawLink is a channel-backed RawLink suitable for unit tests. +// Inbound frames are queued via Push; ReadFrame blocks (with a +// timeout) on the queue. Outbound frames written via WriteFrame +// accumulate in Sent for assertions. +type fakeRawLink struct { + in chan []byte + mu sync.Mutex + out [][]byte + closed chan struct{} +} + +func newFakeRawLink() *fakeRawLink { + return &fakeRawLink{ + in: make(chan []byte, 16), + closed: make(chan struct{}), + } +} + +func (f *fakeRawLink) Push(frame []byte) { + select { + case f.in <- frame: + case <-f.closed: + } +} + +func (f *fakeRawLink) ReadFrame() ([]byte, error) { + select { + case <-f.closed: + return nil, errors.New("closed") + case frame := <-f.in: + return frame, nil + case <-time.After(50 * time.Millisecond): + return nil, rawlink.ErrTimeout + } +} + +func (f *fakeRawLink) WriteFrame(frame []byte) error { + f.mu.Lock() + defer f.mu.Unlock() + cp := make([]byte, len(frame)) + copy(cp, frame) + f.out = append(f.out, cp) + return nil +} + +func (f *fakeRawLink) Close() error { + select { + case <-f.closed: + default: + close(f.closed) + } + return nil +} + +// buildEthernetIIIPX wraps the IPX bytes in a 14-byte Ethernet II +// header with EtherType 0x8137. +func buildEthernetIIIPX(payload []byte) []byte { + frame := make([]byte, 14+len(payload)) + frame[12] = 0x81 + frame[13] = 0x37 + copy(frame[14:], payload) + return frame +} + +// buildRaw8023IPX wraps the IPX bytes in an 802.3 length-encoded +// frame (the Ethernet "type" slot carries a length ≤ 0x05DC). +func buildRaw8023IPX(payload []byte) []byte { + frame := make([]byte, 14+len(payload)) + frame[12] = byte(len(payload) >> 8) + frame[13] = byte(len(payload)) + copy(frame[14:], payload) + return frame +} + +// buildLLCIPX wraps the IPX bytes in 802.3 + LLC with DSAP=SSAP=0xE0 +// and a UI control byte. The IPX body sits at offset 17. +func buildLLCIPX(payload []byte) []byte { + const llcLen = 3 + frame := make([]byte, 14+llcLen+len(payload)) + total := llcLen + len(payload) + frame[12] = byte(total >> 8) + frame[13] = byte(total) + frame[14] = 0xE0 + frame[15] = 0xE0 + frame[16] = 0x03 + copy(frame[17:], payload) + return frame +} + +// makeIPXBytes builds a minimal valid IPX datagram with checksum +// 0xFFFF. Payload is the bytes that follow the 30-byte IPX header. +func makeIPXBytes(t *testing.T, body []byte) []byte { + t.Helper() + d := &protocol.Datagram{ + Hops: 1, + Type: 4, + DstSock: [2]byte{0x04, 0x53}, + SrcSock: [2]byte{0x04, 0x52}, + Payload: body, + } + wire, err := d.Encode() + if err != nil { + t.Fatalf("Encode: %v", err) + } + return wire +} + +func TestIPXEthernetIIRoundTrip(t *testing.T) { + link := newFakeRawLink() + p := NewPort(link) + defer p.Stop() + + delivered := make(chan *protocol.Datagram, 1) + p.SetDeliveryCallback(func(d *protocol.Datagram) { delivered <- d }) + + if err := p.Start(); err != nil { + t.Fatalf("Start: %v", err) + } + + ipxBytes := makeIPXBytes(t, []byte("hi")) + link.Push(buildEthernetIIIPX(ipxBytes)) + + select { + case got := <-delivered: + if string(got.Payload) != "hi" { + t.Fatalf("payload: got %q want %q", got.Payload, "hi") + } + case <-time.After(time.Second): + t.Fatal("no delivery") + } +} + +func TestIPXRaw8023Decoded(t *testing.T) { + link := newFakeRawLink() + p := NewPort(link) + defer p.Stop() + + delivered := make(chan *protocol.Datagram, 1) + p.SetDeliveryCallback(func(d *protocol.Datagram) { delivered <- d }) + + if err := p.Start(); err != nil { + t.Fatalf("Start: %v", err) + } + + link.Push(buildRaw8023IPX(makeIPXBytes(t, []byte("raw")))) + + select { + case got := <-delivered: + if string(got.Payload) != "raw" { + t.Fatalf("payload: got %q want %q", got.Payload, "raw") + } + case <-time.After(time.Second): + t.Fatal("no delivery for raw 802.3 framing") + } +} + +func TestIPXLLCDecoded(t *testing.T) { + link := newFakeRawLink() + p := NewPort(link) + defer p.Stop() + + delivered := make(chan *protocol.Datagram, 1) + p.SetDeliveryCallback(func(d *protocol.Datagram) { delivered <- d }) + + if err := p.Start(); err != nil { + t.Fatalf("Start: %v", err) + } + + link.Push(buildLLCIPX(makeIPXBytes(t, []byte("llc")))) + + select { + case got := <-delivered: + if string(got.Payload) != "llc" { + t.Fatalf("payload: got %q want %q", got.Payload, "llc") + } + case <-time.After(time.Second): + t.Fatal("no delivery for LLC framing") + } +} + +func TestIPXDedupsImmediateDuplicateInboundFrame(t *testing.T) { + link := newFakeRawLink() + p := NewPort(link) + defer p.Stop() + + delivered := make(chan *protocol.Datagram, 2) + p.SetDeliveryCallback(func(d *protocol.Datagram) { delivered <- d }) + + if err := p.Start(); err != nil { + t.Fatalf("Start: %v", err) + } + + frame := buildEthernetIIIPX(makeIPXBytes(t, []byte("dup"))) + link.Push(frame) + link.Push(frame) + + select { + case got := <-delivered: + if string(got.Payload) != "dup" { + t.Fatalf("payload: got %q want %q", got.Payload, "dup") + } + case <-time.After(time.Second): + t.Fatal("no delivery for first frame") + } + + select { + case <-delivered: + t.Fatal("unexpected second delivery for duplicate frame") + case <-time.After(100 * time.Millisecond): + // pass + } +} + +func TestIPXSendEthernetII(t *testing.T) { + link := newFakeRawLink() + p := NewPort(link) + defer p.Stop() + if err := p.Start(); err != nil { + t.Fatalf("Start: %v", err) + } + d := &protocol.Datagram{ + DstNode: [6]byte{0xDE, 0xAD, 0xBE, 0xEF, 0xCA, 0xFE}, + SrcNode: [6]byte{0x01, 0x02, 0x03, 0x04, 0x05, 0x06}, + DstSock: [2]byte{0x04, 0x53}, + SrcSock: [2]byte{0x04, 0x52}, + Payload: []byte("ping"), + } + if err := p.Send(d); err != nil { + t.Fatalf("Send: %v", err) + } + link.mu.Lock() + defer link.mu.Unlock() + if len(link.out) != 1 { + t.Fatalf("Sent count: got %d want 1", len(link.out)) + } + out := link.out[0] + if out[12] != 0x81 || out[13] != 0x37 { + t.Fatalf("EtherType: got %02x%02x, want 8137", out[12], out[13]) + } + // Dst MAC matches the DstNode field per Ethernet II IPX wrapping. + for i := range 6 { + if out[i] != d.DstNode[i] { + t.Fatalf("dst MAC mismatch at byte %d", i) + } + } +} diff --git a/port/localtalk/localtalk.go b/port/localtalk/localtalk.go index 155f0a7..869f43b 100644 --- a/port/localtalk/localtalk.go +++ b/port/localtalk/localtalk.go @@ -320,6 +320,11 @@ func (p *Port) InboundFrame(frame []byte) { if err != nil { return } + // Filter out loopback frames: if the source node is our own node address, + // this is a UDP/serial loopback echo of our outbound frame, so drop it. + if parsed.SourceNode == p.node && p.node != 0 { + return + } parsedBytes := parsed.Bytes() netlog.LogLocaltalkFrameInbound(parsedBytes, p) p.capture(parsedBytes) diff --git a/port/netbeui/port.go b/port/netbeui/port.go new file mode 100644 index 0000000..f7ed154 --- /dev/null +++ b/port/netbeui/port.go @@ -0,0 +1,481 @@ +// Package netbeui is the NetBEUI-on-rawlink port. It owns its own +// read loop on a dedicated rawlink, mirroring EtherTalk's per-protocol +// pcap-handle pattern, and pushes a kernel BPF filter that admits +// 802.2 LLC frames with NetBIOS DSAP/SSAP values. +// +// The port handles only link-level framing: it strips the Ethernet +// header and variable-length LLC header from inbound frames before +// handing the NBF body to protocol/netbeui.Decode, and prepends the +// canonical 3-byte LLC UI header to outbound bytes. Source and +// destination MAC addresses are extracted from the raw frame and +// passed to the delivery callback so the NBF transport layer can +// issue directed replies. NBF protocol semantics live above. +package netbeui + +import ( + "errors" + "sync" + "time" + + "github.com/ObsoleteMadness/ClassicStack/capture" + "github.com/ObsoleteMadness/ClassicStack/netlog" + "github.com/ObsoleteMadness/ClassicStack/port/rawlink" + "github.com/ObsoleteMadness/ClassicStack/protocol/netbeui" +) + +// llcHeader is the canonical 802.2 UI-frame header NetBEUI uses for +// outbound frames in this implementation: DSAP and SSAP both 0xF0, +// control byte 0x03 (UI = unnumbered information). +var llcHeader = [3]byte{0xF0, 0xF0, 0x03} + +const ethernetHeaderLen = 14 + +// NetBEUIBPFFilter is the kernel-level BPF expression NetBEUI pushes to +// its rawlink. It admits 802.3 length-encoded frames (EtherType slot +// holds a length ≤ 0x05DC) whose LLC DSAP is 0xF0 and whose SSAP, +// ignoring the command/response bit, is 0xF0. That admits both the +// common UI frames and session traffic carried with 2-byte LLC control +// fields. +const NetBEUIBPFFilter = "ether[12:2] <= 0x05dc and " + + "ether[14] = 0xf0 and ether[15] & 0xfe = 0xf0" + +func llcPayloadOffset(raw []byte) (int, bool) { + if len(raw) < ethernetHeaderLen+3 { + return 0, false + } + if raw[14] != 0xF0 || raw[15]&0xFE != 0xF0 { + return 0, false + } + control := raw[16] + if control&0x03 == 0x03 { + return ethernetHeaderLen + 3, true + } + if len(raw) < ethernetHeaderLen+4 { + return 0, false + } + return ethernetHeaderLen + 4, true +} + +// ErrNoSourceMAC is returned by Send when the caller has not supplied +// a source MAC for the port. +var ErrNoSourceMAC = errors.New("netbeui: source MAC not configured") + +// DeliveryCallback is invoked for each successfully decoded inbound +// NBF frame. srcMAC and dstMAC are the Ethernet-level addresses +// extracted from the raw frame before the LLC header is stripped. +// The transport layer needs srcMAC for directed replies (e.g. +// NAME_RECOGNIZED → SESSION_INITIALIZE). +type DeliveryCallback func(srcMAC, dstMAC [6]byte, frame *netbeui.Frame) + +// Port is the NetBEUI port surface. +type Port interface { + // Start opens the read loop on the rawlink. It must be called + // before any inbound frames will be delivered. + Start() error + // Stop closes the read loop and the underlying rawlink. + Stop() error + // Send transmits an NBF frame to dstMAC. The source MAC must + // already have been configured via SetSourceMAC. + Send(dstMAC [6]byte, frame *netbeui.Frame) error + // SendBroadcast transmits an NBF frame to the NetBIOS multicast + // address (03:00:00:00:00:01). + SendBroadcast(frame *netbeui.Frame) error + SetSourceMAC(mac [6]byte) + SetDeliveryCallback(cb DeliveryCallback) + // SetCaptureSink installs an optional raw-frame capture sink. + SetCaptureSink(sink capture.Sink) +} + +// llcConn tracks per-peer LLC Type-2 (802.2 extended) connection state. +type llcConn struct { + mu sync.Mutex + uaSent bool // true after UA has been sent; suppress SABME retransmit responses + nS uint8 // our next send sequence number (mod 128) + nR uint8 // expected next from remote (N(R) we put in our ACKs) +} + +type portImpl struct { + link rawlink.RawLink + + mu sync.RWMutex + src [6]byte + hasSrc bool + cb DeliveryCallback + cs capture.Sink + + connsMu sync.RWMutex + conns map[[6]byte]*llcConn + + stopOnce sync.Once + readerStop chan struct{} + readerDone chan struct{} +} + +// NewPort returns a NetBEUI port bound to link. Start must be called +// before inbound frames are delivered. +func NewPort(link rawlink.RawLink) Port { + return &portImpl{ + link: link, + conns: make(map[[6]byte]*llcConn), + readerStop: make(chan struct{}), + readerDone: make(chan struct{}), + } +} + +func (p *portImpl) Start() error { + if fl, ok := p.link.(rawlink.FilterableLink); ok { + if err := fl.SetFilter(NetBEUIBPFFilter); err != nil { + netlog.Warn("[NetBEUI] could not set BPF filter: %v", err) + } + } + go p.readLoop() + return nil +} + +func (p *portImpl) Stop() error { + p.stopOnce.Do(func() { + close(p.readerStop) + <-p.readerDone + _ = p.link.Close() + }) + return nil +} + +func (p *portImpl) SetSourceMAC(mac [6]byte) { + p.mu.Lock() + p.src = mac + p.hasSrc = true + p.mu.Unlock() +} + +func (p *portImpl) SetDeliveryCallback(cb DeliveryCallback) { + p.mu.Lock() + p.cb = cb + p.mu.Unlock() +} + +func (p *portImpl) SetCaptureSink(sink capture.Sink) { + p.mu.Lock() + p.cs = sink + p.mu.Unlock() +} + +// LLC unnumbered frame control values. +const ( + llcControlSABME = 0x7F // Set Asynchronous Balanced Mode Extended (P=1) + llcControlDISC = 0x43 // Disconnect (P=0) + llcControlDISCP = 0x53 // Disconnect (P=1) + llcControlDM = 0x0F // Disconnected Mode + llcControlUA = 0x63 // Unnumbered Acknowledgment (F=0) + llcControlUAF = 0x73 // Unnumbered Acknowledgment (F=1) +) + +// sendLLCUA transmits a 3-byte LLC UA response (F=1) to dstMAC. +func (p *portImpl) sendLLCUA(dstMAC [6]byte) { + p.mu.RLock() + src := p.src + hasSrc := p.hasSrc + p.mu.RUnlock() + if !hasSrc { + return + } + const llcLen = 3 + out := make([]byte, ethernetHeaderLen+llcLen) + copy(out[0:6], dstMAC[:]) + copy(out[6:12], src[:]) + out[12] = 0x00 + out[13] = llcLen + out[14] = 0xF0 // DSAP + out[15] = 0xF1 // SSAP with C/R = response + out[16] = llcControlUAF // UA with F=1 + p.mu.RLock() + sink := p.cs + p.mu.RUnlock() + capture.Write(sink, time.Now(), out) + if err := p.link.WriteFrame(out); err != nil { + netlog.Warn("[NetBEUI] LLC UA send error: %v", err) + } +} + +// sendLLCRR transmits a 4-byte LLC RR supervisory response (F=1) to +// dstMAC, acknowledging all I-frames up to nR-1 from the remote. +func (p *portImpl) sendLLCRR(dstMAC [6]byte, nR uint8) { + p.mu.RLock() + src := p.src + hasSrc := p.hasSrc + p.mu.RUnlock() + if !hasSrc { + return + } + const llcLen = 4 + out := make([]byte, ethernetHeaderLen+llcLen) + copy(out[0:6], dstMAC[:]) + copy(out[6:12], src[:]) + out[12] = 0x00 + out[13] = llcLen + out[14] = 0xF0 // DSAP + out[15] = 0xF1 // SSAP response + out[16] = 0x01 // RR S-frame + out[17] = (nR << 1) | 0x01 // N(R) and F=1 + p.mu.RLock() + sink := p.cs + p.mu.RUnlock() + capture.Write(sink, time.Now(), out) + if err := p.link.WriteFrame(out); err != nil { + netlog.Warn("[NetBEUI] LLC RR send error: %v", err) + } +} + +// sendIFrame transmits body as an LLC Type-2 I-frame to dstMAC using +// the connection's current N(S)/N(R) and then increments N(S). +func (p *portImpl) sendIFrame(dstMAC [6]byte, body []byte, conn *llcConn) error { + p.mu.RLock() + src := p.src + hasSrc := p.hasSrc + p.mu.RUnlock() + if !hasSrc { + return ErrNoSourceMAC + } + conn.mu.Lock() + nS := conn.nS + nR := conn.nR + conn.nS = (conn.nS + 1) & 0x7F + conn.mu.Unlock() + const llcLen = 4 + total := ethernetHeaderLen + llcLen + len(body) + out := make([]byte, total) + copy(out[0:6], dstMAC[:]) + copy(out[6:12], src[:]) + payloadLen := llcLen + len(body) + out[12] = byte(payloadLen >> 8) + out[13] = byte(payloadLen) + out[14] = 0xF0 // DSAP + out[15] = 0xF0 // SSAP command + out[16] = nS << 1 // I-frame ctrl0: N(S)<<1 | 0 + out[17] = nR << 1 // I-frame ctrl1: N(R)<<1 | P=0 + copy(out[18:], body) + p.mu.RLock() + sink := p.cs + p.mu.RUnlock() + capture.Write(sink, time.Now(), out) + return p.link.WriteFrame(out) +} + +// sendUI transmits body as an LLC UI (unnumbered information) frame to dstMAC. +func (p *portImpl) sendUI(dstMAC [6]byte, body []byte) error { + p.mu.RLock() + src := p.src + hasSrc := p.hasSrc + p.mu.RUnlock() + if !hasSrc { + return ErrNoSourceMAC + } + total := 14 + len(llcHeader) + len(body) + out := make([]byte, total) + copy(out[0:6], dstMAC[:]) + copy(out[6:12], src[:]) + llcLen := len(llcHeader) + len(body) + out[12] = byte(llcLen >> 8) + out[13] = byte(llcLen) + copy(out[14:14+len(llcHeader)], llcHeader[:]) + copy(out[14+len(llcHeader):], body) + p.mu.RLock() + sink := p.cs + p.mu.RUnlock() + capture.Write(sink, time.Now(), out) + return p.link.WriteFrame(out) +} + +func (p *portImpl) Send(dstMAC [6]byte, frame *netbeui.Frame) error { + body, err := frame.Encode() + if err != nil { + return err + } + // Session-layer commands (SESSION_INITIALIZE, DATA_*, SESSION_CONFIRM, etc.) + // use LLC Type-2 I-framing when a connection is established. Non-session + // frames (NAME_RECOGNIZED, ADD_NAME_RESPONSE, DATAGRAM, etc.) always use + // UI framing regardless of connection state. + if netbeui.IsSessionCommand(frame.Command) { + p.connsMu.RLock() + conn := p.conns[dstMAC] + p.connsMu.RUnlock() + if conn != nil { + return p.sendIFrame(dstMAC, body, conn) + } + } + return p.sendUI(dstMAC, body) +} + +func (p *portImpl) SendBroadcast(frame *netbeui.Frame) error { + return p.Send(netbeui.NetBIOSMulticastMAC, frame) +} + +// readLoop is the single inbound reader. The kernel BPF filter has +// already discarded everything that isn't an 802.3 NetBIOS LLC frame; +// software then strips the variable-length LLC header and decodes the +// NBF body. +func (p *portImpl) readLoop() { + defer close(p.readerDone) + for { + select { + case <-p.readerStop: + return + default: + } + frame, err := p.link.ReadFrame() + if err != nil { + if err == rawlink.ErrTimeout { + continue + } + netlog.Warn("[NetBEUI] read error: %v", err) + continue + } + p.mu.RLock() + sink := p.cs + p.mu.RUnlock() + capture.Write(sink, time.Now(), frame) + p.handleFrame(frame) + } +} + +func (p *portImpl) handleFrame(raw []byte) { + _, ok := llcPayloadOffset(raw) + if !ok { + return + } + + var dstMAC, srcMAC [6]byte + copy(dstMAC[:], raw[0:6]) + copy(srcMAC[:], raw[6:12]) + + p.mu.RLock() + ourMAC := p.src + hasSrc := p.hasSrc + cb := p.cb + p.mu.RUnlock() + + ctrl := raw[16] + + // --- U-frames (3-byte LLC, ctrl bits 0,1 = 11) --- + if ctrl&0x03 == 0x03 { + switch ctrl { + case llcControlSABME: + // Only respond to SABMEs addressed to us. + if !hasSrc || dstMAC != ourMAC { + return + } + p.connsMu.Lock() + conn := p.conns[srcMAC] + if conn != nil { + conn.mu.Lock() + if conn.uaSent && conn.nS == 0 && conn.nR == 0 { + // Retransmit SABME before any data was exchanged — ignore; + // we already sent UA for this connection setup. + conn.mu.Unlock() + p.connsMu.Unlock() + return + } + // Data has been exchanged — treat as reconnect: reset state. + conn.uaSent = false + conn.nS = 0 + conn.nR = 0 + conn.mu.Unlock() + } else { + conn = &llcConn{} + p.conns[srcMAC] = conn + } + conn.mu.Lock() + conn.uaSent = true + conn.mu.Unlock() + p.connsMu.Unlock() + netlog.Debug("[NetBEUI] LLC SABME from %02X:%02X:%02X:%02X:%02X:%02X — sending UA", + srcMAC[0], srcMAC[1], srcMAC[2], srcMAC[3], srcMAC[4], srcMAC[5]) + p.sendLLCUA(srcMAC) + + case llcControlDISC, llcControlDISCP: + if !hasSrc || dstMAC != ourMAC { + return + } + p.connsMu.Lock() + delete(p.conns, srcMAC) + p.connsMu.Unlock() + netlog.Debug("[NetBEUI] LLC DISC from %02X:%02X:%02X:%02X:%02X:%02X — sending UA", + srcMAC[0], srcMAC[1], srcMAC[2], srcMAC[3], srcMAC[4], srcMAC[5]) + p.sendLLCUA(srcMAC) + + default: + // UI (0x03) or other U-frame: decode NBF payload if present and deliver. + if cb == nil { + return + } + nbfPayload := raw[ethernetHeaderLen+3:] + if len(nbfPayload) == 0 { + return + } + decoded, err := netbeui.Decode(nbfPayload) + if err != nil { + return + } + cb(srcMAC, dstMAC, decoded) + } + return + } + + // --- I-frames and S-frames require 4-byte LLC (need at least byte 17) --- + if len(raw) < ethernetHeaderLen+4 { + return + } + ctrl1 := raw[17] + + // S-frame: ctrl bits 0,1 = 01 + if ctrl&0x03 == 0x01 { + if !hasSrc || dstMAC != ourMAC { + return + } + // RR (ctrl & 0x0F == 0x01): respond with RR F if P-bit is set. + if ctrl&0x0F == 0x01 && ctrl1&0x01 != 0 { + p.connsMu.RLock() + conn := p.conns[srcMAC] + p.connsMu.RUnlock() + var nR uint8 + if conn != nil { + conn.mu.Lock() + nR = conn.nR + conn.mu.Unlock() + } + p.sendLLCRR(srcMAC, nR) + } + return + } + + // I-frame: ctrl bit 0 == 0 + if ctrl&0x01 == 0 { + if !hasSrc || dstMAC != ourMAC || cb == nil { + return + } + p.connsMu.RLock() + conn := p.conns[srcMAC] + p.connsMu.RUnlock() + if conn == nil { + return // I-frame outside of established connection + } + remoteNS := ctrl >> 1 + conn.mu.Lock() + conn.nR = (remoteNS + 1) & 0x7F + nR := conn.nR + conn.mu.Unlock() + // Acknowledge via RR if peer set the P-bit. + if ctrl1&0x01 != 0 { + p.sendLLCRR(srcMAC, nR) + } + nbfPayload := raw[ethernetHeaderLen+4:] + if len(nbfPayload) == 0 { + return + } + decoded, err := netbeui.Decode(nbfPayload) + if err != nil { + return + } + cb(srcMAC, dstMAC, decoded) + } +} diff --git a/port/netbeui/port_test.go b/port/netbeui/port_test.go new file mode 100644 index 0000000..b7253f1 --- /dev/null +++ b/port/netbeui/port_test.go @@ -0,0 +1,237 @@ +package netbeui + +import ( + "errors" + "sync" + "testing" + "time" + + "github.com/ObsoleteMadness/ClassicStack/port/rawlink" + "github.com/ObsoleteMadness/ClassicStack/protocol/netbeui" +) + +// fakeRawLink is a channel-backed RawLink for unit tests, identical +// in shape to the one in port/ipx but local to this package because +// it is not part of any exported API. +type fakeRawLink struct { + in chan []byte + mu sync.Mutex + out [][]byte + closed chan struct{} +} + +func newFakeRawLink() *fakeRawLink { + return &fakeRawLink{ + in: make(chan []byte, 16), + closed: make(chan struct{}), + } +} + +func (f *fakeRawLink) Push(frame []byte) { + select { + case f.in <- frame: + case <-f.closed: + } +} + +func (f *fakeRawLink) ReadFrame() ([]byte, error) { + select { + case <-f.closed: + return nil, errors.New("closed") + case frame := <-f.in: + return frame, nil + case <-time.After(50 * time.Millisecond): + return nil, rawlink.ErrTimeout + } +} + +func (f *fakeRawLink) WriteFrame(frame []byte) error { + f.mu.Lock() + defer f.mu.Unlock() + cp := make([]byte, len(frame)) + copy(cp, frame) + f.out = append(f.out, cp) + return nil +} + +func (f *fakeRawLink) Close() error { + select { + case <-f.closed: + default: + close(f.closed) + } + return nil +} + +// buildLLCNBF wraps an NBF body in 14 bytes of Ethernet and an LLC +// header. The control field can be either 1 byte (UI/U format) or 2 +// bytes (I/S format). All MACs are zero. +func buildLLCNBF(body []byte, control ...byte) []byte { + return buildLLCNBFAddressed([6]byte{}, [6]byte{}, body, control...) +} + +// buildLLCNBFAddressed builds a frame with explicit dst/src MACs. +func buildLLCNBFAddressed(dst, src [6]byte, body []byte, control ...byte) []byte { + if len(control) == 0 { + control = []byte{0x03} + } + llcLen := 2 + len(control) + frame := make([]byte, 14+llcLen+len(body)) + copy(frame[0:6], dst[:]) + copy(frame[6:12], src[:]) + total := llcLen + len(body) + frame[12] = byte(total >> 8) + frame[13] = byte(total) + frame[14] = 0xF0 + frame[15] = 0xF0 + copy(frame[16:16+len(control)], control) + copy(frame[14+llcLen:], body) + return frame +} + +func TestNetBEUIInboundDecodesNBFBody(t *testing.T) { + link := newFakeRawLink() + p := NewPort(link) + defer p.Stop() + + delivered := make(chan *netbeui.Frame, 1) + p.SetDeliveryCallback(func(_ [6]byte, _ [6]byte, f *netbeui.Frame) { delivered <- f }) + + if err := p.Start(); err != nil { + t.Fatalf("Start: %v", err) + } + + want := &netbeui.Frame{ + Command: 0x08, + ResponseCorrelator: 0x4242, + Payload: []byte("payload"), + } + copy(want.DestinationName[:], "WS01 ") + copy(want.SourceName[:], "SERVER ") + body, err := want.Encode() + if err != nil { + t.Fatalf("Encode: %v", err) + } + link.Push(buildLLCNBF(body)) + + select { + case got := <-delivered: + if got.Command != want.Command || got.ResponseCorrelator != want.ResponseCorrelator { + t.Fatalf("header mismatch: got %+v want %+v", got, want) + } + if string(got.Payload) != "payload" { + t.Fatalf("payload: got %q want %q", got.Payload, want.Payload) + } + case <-time.After(time.Second): + t.Fatal("no delivery") + } +} + +func TestNetBEUIInboundDecodesNBFBodyWithTwoByteLLCControl(t *testing.T) { + link := newFakeRawLink() + p := NewPort(link) + defer p.Stop() + + // Give the port a source MAC and configure a matching destination MAC for + // inbound frames so the I-frame dstMAC check passes. + ourMAC := [6]byte{0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF} + remotMAC := [6]byte{0x11, 0x22, 0x33, 0x44, 0x55, 0x66} + p.SetSourceMAC(ourMAC) + + delivered := make(chan *netbeui.Frame, 1) + p.SetDeliveryCallback(func(_ [6]byte, _ [6]byte, f *netbeui.Frame) { delivered <- f }) + + if err := p.Start(); err != nil { + t.Fatalf("Start: %v", err) + } + + // Establish an LLC Type-2 connection by sending a SABME first. + sabme := buildLLCNBFAddressed(ourMAC, remotMAC, nil, 0x7F) // SABME to ourMAC + link.Push(sabme) + time.Sleep(20 * time.Millisecond) // let the port process the SABME + + want := &netbeui.Frame{ + Command: netbeui.CmdSessionInitialize, + Data1: 0x81, + Data2: 0x05B8, + XmitCorrelator: 0x4242, + DestNumber: 4, + SourceNumber: 1, + } + body, err := want.Encode() + if err != nil { + t.Fatalf("Encode: %v", err) + } + // Send I-frame addressed to our MAC from the remote. + link.Push(buildLLCNBFAddressed(ourMAC, remotMAC, body, 0x00, 0x00)) + + select { + case got := <-delivered: + if got.Command != want.Command || got.Data2 != want.Data2 { + t.Fatalf("header mismatch: got %+v want %+v", got, want) + } + if got.DestNumber != want.DestNumber || got.SourceNumber != want.SourceNumber { + t.Fatalf("session numbers: got dest=%d src=%d want dest=%d src=%d", got.DestNumber, got.SourceNumber, want.DestNumber, want.SourceNumber) + } + case <-time.After(time.Second): + t.Fatal("no delivery") + } +} + +func TestNetBEUISendBuildsLLCFrame(t *testing.T) { + link := newFakeRawLink() + p := NewPort(link) + defer p.Stop() + if err := p.Start(); err != nil { + t.Fatalf("Start: %v", err) + } + src := [6]byte{0x01, 0x02, 0x03, 0x04, 0x05, 0x06} + dst := [6]byte{0xDE, 0xAD, 0xBE, 0xEF, 0xCA, 0xFE} + p.SetSourceMAC(src) + + frame := &netbeui.Frame{Command: 0x08, Payload: []byte("hi")} + copy(frame.DestinationName[:], "WS01 ") + copy(frame.SourceName[:], "SERVER ") + + if err := p.Send(dst, frame); err != nil { + t.Fatalf("Send: %v", err) + } + + link.mu.Lock() + defer link.mu.Unlock() + if len(link.out) != 1 { + t.Fatalf("Sent count: got %d want 1", len(link.out)) + } + out := link.out[0] + for i := range 6 { + if out[i] != dst[i] { + t.Fatalf("dst MAC at byte %d: got %02x want %02x", i, out[i], dst[i]) + } + } + for i := range 6 { + if out[6+i] != src[i] { + t.Fatalf("src MAC at byte %d: got %02x want %02x", i, out[6+i], src[i]) + } + } + // 802.3 length-encoded; EtherType slot must be ≤ 0x05DC. + length := uint16(out[12])<<8 | uint16(out[13]) + if length > 0x05DC { + t.Fatalf("length field too large: got %#x", length) + } + if out[14] != 0xF0 || out[15] != 0xF0 || out[16] != 0x03 { + t.Fatalf("LLC header: got %02x%02x%02x", out[14], out[15], out[16]) + } +} + +func TestNetBEUISendRequiresSourceMAC(t *testing.T) { + link := newFakeRawLink() + p := NewPort(link) + defer p.Stop() + if err := p.Start(); err != nil { + t.Fatalf("Start: %v", err) + } + dst := [6]byte{0x01, 0x02, 0x03, 0x04, 0x05, 0x06} + if err := p.Send(dst, &netbeui.Frame{Command: 0x08}); err != ErrNoSourceMAC { + t.Fatalf("expected ErrNoSourceMAC, got %v", err) + } +} diff --git a/port/rawlink/bridge_link.go b/port/rawlink/bridge_link.go new file mode 100644 index 0000000..b84f171 --- /dev/null +++ b/port/rawlink/bridge_link.go @@ -0,0 +1,346 @@ +package rawlink + +import ( + "bytes" + "encoding/binary" + "fmt" + "strings" + "sync" + "time" +) + +type bridgeFrameMode uint8 + +const ( + bridgeFrameModeAuto bridgeFrameMode = iota + bridgeFrameModeEthernet + bridgeFrameModeWiFi +) + +const bridgePeerMapTTL = 2 * time.Minute + +type bridgePeerEntry struct { + virtual [6]byte + until time.Time +} + +// BridgeLinkOptions controls shared L2 bridge adaptation for rawlink +// consumers (MacIP/IPX/NetBEUI). EtherTalk keeps its own adapter so it can +// additionally rewrite AARP hardware fields. +type BridgeLinkOptions struct { + Mode string + HostMAC []byte + VirtualMAC []byte +} + +type bridgedLink struct { + inner RawLink + hostMAC []byte + virtualMAC []byte + bssid []byte + mode bridgeFrameMode + wifiEncap bool + peerMu sync.Mutex + peerToVirtual map[[6]byte]bridgePeerEntry +} + +// WrapWithBridgeMode decorates a rawlink with shared frame-mode adaptation. +// "ethernet" is pass-through, while "wifi" performs MAC identity adaptation. +// In wifi mode, if the medium is native Wi-Fi, frames are converted between +// Ethernet and 802.11+radiotap form. +func WrapWithBridgeMode(link RawLink, opts BridgeLinkOptions) (RawLink, error) { + mode, err := parseBridgeFrameMode(opts.Mode) + if err != nil { + return nil, err + } + if mode == bridgeFrameModeEthernet { + return link, nil + } + if len(opts.HostMAC) != 6 { + return nil, fmt.Errorf("rawlink bridge adapter requires 6-byte host MAC") + } + if len(opts.VirtualMAC) != 6 { + return nil, fmt.Errorf("rawlink bridge adapter requires 6-byte virtual MAC") + } + resolvedMode := mode + medium := MediumEthernet + if mr, ok := link.(MediumReporter); ok { + medium = mr.Medium() + } + if resolvedMode == bridgeFrameModeAuto { + if medium == MediumWiFi { + resolvedMode = bridgeFrameModeWiFi + } else { + resolvedMode = bridgeFrameModeEthernet + } + } + if resolvedMode == bridgeFrameModeEthernet { + return link, nil + } + + return &bridgedLink{ + inner: link, + hostMAC: append([]byte(nil), opts.HostMAC...), + virtualMAC: append([]byte(nil), opts.VirtualMAC...), + bssid: append([]byte(nil), opts.HostMAC...), + mode: resolvedMode, + wifiEncap: medium == MediumWiFi, + peerToVirtual: make(map[[6]byte]bridgePeerEntry), + }, nil +} + +func parseBridgeFrameMode(s string) (bridgeFrameMode, error) { + switch strings.ToLower(strings.TrimSpace(s)) { + case "", "auto": + return bridgeFrameModeAuto, nil + case "ethernet", "wired": + return bridgeFrameModeEthernet, nil + case "wifi", "wireless": + return bridgeFrameModeWiFi, nil + default: + return bridgeFrameModeAuto, fmt.Errorf("invalid bridge frame mode %q (expected auto, ethernet, or wifi)", s) + } +} + +func (l *bridgedLink) ReadFrame() ([]byte, error) { + frame, err := l.inner.ReadFrame() + if err != nil { + return nil, err + } + if l.mode != bridgeFrameModeWiFi { + return frame, nil + } + eth, err := bridgeToEthernet(frame) + if err != nil { + return nil, err + } + if len(eth) < 14 { + return nil, fmt.Errorf("ethernet frame too short") + } + if bytes.Equal(eth[6:12], l.hostMAC) || bytes.Equal(eth[6:12], l.virtualMAC) { + return nil, ErrTimeout + } + out := append([]byte(nil), eth...) + if bytes.Equal(out[0:6], l.hostMAC) { + virtual := l.lookupVirtual(out[6:12]) + if virtual == nil { + virtual = l.virtualMAC + } + copy(out[0:6], virtual) + } + return out, nil +} + +func (l *bridgedLink) WriteFrame(frame []byte) error { + if l.mode != bridgeFrameModeWiFi { + return l.inner.WriteFrame(frame) + } + if len(frame) < 14 { + return fmt.Errorf("ethernet frame too short") + } + prepared := append([]byte(nil), frame...) + virtualSrc := append([]byte(nil), prepared[6:12]...) + dst := append([]byte(nil), prepared[0:6]...) + if !bytes.Equal(prepared[6:12], l.hostMAC) { + copy(prepared[6:12], l.hostMAC) + } + if !isBroadcastMAC(dst) && !isMulticastMAC(dst) { + l.rememberVirtual(dst, virtualSrc) + } + if l.wifiEncap { + wifi, err := bridgeToWiFi(prepared, l.hostMAC, l.bssid) + if err != nil { + return err + } + prepared = wifi + } + return l.inner.WriteFrame(prepared) +} + +func (l *bridgedLink) Close() error { return l.inner.Close() } + +func (l *bridgedLink) Medium() PhysicalMedium { + if mr, ok := l.inner.(MediumReporter); ok { + return mr.Medium() + } + return MediumEthernet +} + +func (l *bridgedLink) SetFilter(expr string) error { + fl, ok := l.inner.(FilterableLink) + if !ok { + return fmt.Errorf("rawlink bridge adapter: underlying link does not support filters") + } + return fl.SetFilter(expr) +} + +func (l *bridgedLink) rememberVirtual(peerMAC, virtualMAC []byte) { + if len(peerMAC) != 6 || len(virtualMAC) != 6 { + return + } + key := toMACKey(peerMAC) + val := toMACKey(virtualMAC) + l.peerMu.Lock() + l.peerToVirtual[key] = bridgePeerEntry{virtual: val, until: time.Now().Add(bridgePeerMapTTL)} + l.peerMu.Unlock() +} + +func (l *bridgedLink) lookupVirtual(peerMAC []byte) []byte { + if len(peerMAC) != 6 { + return nil + } + key := toMACKey(peerMAC) + now := time.Now() + l.peerMu.Lock() + defer l.peerMu.Unlock() + entry, ok := l.peerToVirtual[key] + if !ok { + return nil + } + if now.After(entry.until) { + delete(l.peerToVirtual, key) + return nil + } + out := make([]byte, 6) + copy(out, entry.virtual[:]) + return out +} + +func bridgeToEthernet(frame []byte) ([]byte, error) { + if len(frame) < 14 { + return nil, fmt.Errorf("frame too short") + } + if !looksLikeRadiotap(frame) { + return append([]byte(nil), frame...), nil + } + radiotapLen := int(binary.LittleEndian.Uint16(frame[2:4])) + if radiotapLen < 8 || radiotapLen >= len(frame) { + return nil, fmt.Errorf("invalid radiotap length") + } + wifi := frame[radiotapLen:] + if len(wifi) < 24 { + return nil, fmt.Errorf("wifi frame too short") + } + + fc := binary.LittleEndian.Uint16(wifi[0:2]) + typeBits := (fc >> 2) & 0x3 + if typeBits != 0x2 { + return nil, fmt.Errorf("not a data frame") + } + + toDS := (fc & 0x0100) != 0 + fromDS := (fc & 0x0200) != 0 + subtype := (fc >> 4) & 0xF + + headerLen := 24 + if toDS && fromDS { + headerLen = 30 + } + if subtype&0x8 != 0 { + headerLen += 2 + } + if len(wifi) < headerLen { + return nil, fmt.Errorf("wifi header too short") + } + + addr1 := wifi[4:10] + addr2 := wifi[10:16] + addr3 := wifi[16:22] + + var dstMAC []byte + var srcMAC []byte + if !toDS && !fromDS { + dstMAC = addr1 + srcMAC = addr2 + } else if toDS && !fromDS { + dstMAC = addr3 + srcMAC = addr2 + } else if !toDS && fromDS { + dstMAC = addr1 + srcMAC = addr3 + } else { + if len(wifi) < 30 { + return nil, fmt.Errorf("wifi WDS header too short") + } + dstMAC = addr3 + srcMAC = wifi[24:30] + } + + payload := wifi[headerLen:] + if len(payload) > 0xFFFF { + return nil, fmt.Errorf("wifi payload too large") + } + + out := make([]byte, 0, 14+len(payload)) + out = append(out, dstMAC...) + out = append(out, srcMAC...) + out = binary.BigEndian.AppendUint16(out, uint16(len(payload))) + out = append(out, payload...) + return out, nil +} + +func bridgeToWiFi(ethernetFrame []byte, hostMAC, bssid []byte) ([]byte, error) { + if len(ethernetFrame) < 14 { + return nil, fmt.Errorf("ethernet frame too short") + } + if len(hostMAC) != 6 || len(bssid) != 6 { + return nil, fmt.Errorf("invalid host or bssid mac") + } + dstMAC := ethernetFrame[0:6] + payloadLen := int(binary.BigEndian.Uint16(ethernetFrame[12:14])) + if payloadLen < 0 || 14+payloadLen > len(ethernetFrame) { + return nil, fmt.Errorf("invalid ethernet payload length") + } + payload := ethernetFrame[14 : 14+payloadLen] + + radiotap := []byte{0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00} + wifiHeader := make([]byte, 24) + binary.LittleEndian.PutUint16(wifiHeader[0:2], 0x0108) + binary.LittleEndian.PutUint16(wifiHeader[2:4], 0) + copy(wifiHeader[4:10], bssid) + copy(wifiHeader[10:16], hostMAC) + copy(wifiHeader[16:22], dstMAC) + binary.LittleEndian.PutUint16(wifiHeader[22:24], 0) + + out := make([]byte, 0, len(radiotap)+len(wifiHeader)+len(payload)) + out = append(out, radiotap...) + out = append(out, wifiHeader...) + out = append(out, payload...) + return out, nil +} + +func looksLikeRadiotap(frame []byte) bool { + if len(frame) < 8 { + return false + } + if frame[0] != 0 { + return false + } + radiotapLen := int(binary.LittleEndian.Uint16(frame[2:4])) + return radiotapLen >= 8 && radiotapLen <= len(frame) +} + +func toMACKey(mac []byte) [6]byte { + var out [6]byte + copy(out[:], mac) + return out +} + +func isBroadcastMAC(mac []byte) bool { + if len(mac) != 6 { + return false + } + for _, b := range mac { + if b != 0xFF { + return false + } + } + return true +} + +func isMulticastMAC(mac []byte) bool { + if len(mac) != 6 { + return false + } + return mac[0]&0x01 == 0x01 +} diff --git a/port/rawlink/bridge_link_test.go b/port/rawlink/bridge_link_test.go new file mode 100644 index 0000000..3268edc --- /dev/null +++ b/port/rawlink/bridge_link_test.go @@ -0,0 +1,134 @@ +package rawlink + +import ( + "errors" + "testing" +) + +type bridgeTestLink struct { + medium PhysicalMedium + readFrames [][]byte + written [][]byte + filterExpr string +} + +func (l *bridgeTestLink) ReadFrame() ([]byte, error) { + if len(l.readFrames) == 0 { + return nil, ErrTimeout + } + f := l.readFrames[0] + l.readFrames = l.readFrames[1:] + return f, nil +} + +func (l *bridgeTestLink) WriteFrame(frame []byte) error { + buf := make([]byte, len(frame)) + copy(buf, frame) + l.written = append(l.written, buf) + return nil +} + +func (l *bridgeTestLink) Close() error { return nil } +func (l *bridgeTestLink) Medium() PhysicalMedium { + return l.medium +} +func (l *bridgeTestLink) SetFilter(expr string) error { + l.filterExpr = expr + return nil +} + +func TestWrapWithBridgeMode_WiFiRewriteOutboundInbound(t *testing.T) { + inner := &bridgeTestLink{medium: MediumEthernet} + virtual := []byte{0x0a, 0, 0, 0, 0, 1} + host := []byte{0x02, 0, 0, 0, 0, 1} + peer := []byte{0x04, 0, 0, 0, 0, 1} + + link, err := WrapWithBridgeMode(inner, BridgeLinkOptions{ + Mode: "wifi", + HostMAC: host, + VirtualMAC: virtual, + }) + if err != nil { + t.Fatalf("WrapWithBridgeMode returned error: %v", err) + } + + outbound := make([]byte, 60) + copy(outbound[0:6], peer) + copy(outbound[6:12], virtual) + outbound[12] = 0 + outbound[13] = byte(len(outbound) - 14) + if err := link.WriteFrame(outbound); err != nil { + t.Fatalf("WriteFrame returned error: %v", err) + } + if len(inner.written) != 1 { + t.Fatalf("written frames = %d, want 1", len(inner.written)) + } + if got := inner.written[0][6:12]; string(got) != string(host) { + t.Fatalf("outbound src mac = %v, want host %v", got, host) + } + + inbound := make([]byte, 60) + copy(inbound[0:6], host) + copy(inbound[6:12], peer) + inbound[12] = 0 + inbound[13] = byte(len(inbound) - 14) + inner.readFrames = append(inner.readFrames, inbound) + + read, err := link.ReadFrame() + if err != nil { + t.Fatalf("ReadFrame returned error: %v", err) + } + if got := read[0:6]; string(got) != string(virtual) { + t.Fatalf("inbound dst mac = %v, want virtual %v", got, virtual) + } +} + +func TestWrapWithBridgeMode_AutoEthernetPassthrough(t *testing.T) { + inner := &bridgeTestLink{medium: MediumEthernet} + link, err := WrapWithBridgeMode(inner, BridgeLinkOptions{ + Mode: "auto", + HostMAC: []byte{1, 2, 3, 4, 5, 6}, + VirtualMAC: []byte{6, 5, 4, 3, 2, 1}, + }) + if err != nil { + t.Fatalf("WrapWithBridgeMode returned error: %v", err) + } + if link != inner { + t.Fatalf("expected passthrough link for auto+ethernet medium") + } +} + +func TestWrapWithBridgeMode_DelegatesFilter(t *testing.T) { + inner := &bridgeTestLink{medium: MediumEthernet} + link, err := WrapWithBridgeMode(inner, BridgeLinkOptions{ + Mode: "wifi", + HostMAC: []byte{1, 2, 3, 4, 5, 6}, + VirtualMAC: []byte{6, 5, 4, 3, 2, 1}, + }) + if err != nil { + t.Fatalf("WrapWithBridgeMode returned error: %v", err) + } + fl, ok := link.(FilterableLink) + if !ok { + t.Fatalf("wrapped link does not implement FilterableLink") + } + if err := fl.SetFilter("ipx"); err != nil { + t.Fatalf("SetFilter returned error: %v", err) + } + if inner.filterExpr != "ipx" { + t.Fatalf("inner filter expr = %q, want ipx", inner.filterExpr) + } +} + +func TestWrapWithBridgeMode_RejectsInvalidMode(t *testing.T) { + inner := &bridgeTestLink{} + _, err := WrapWithBridgeMode(inner, BridgeLinkOptions{Mode: "nope"}) + if err == nil { + t.Fatalf("expected error for invalid mode") + } + if !errors.Is(err, err) { + // Keep a concrete assertion path so staticcheck does not complain + // about unchecked error shape while still validating non-nil. + t.Fatalf("unexpected error value: %v", err) + } +} diff --git a/port/rawlink/pcap.go b/port/rawlink/pcap.go index a7b039d..e747b65 100644 --- a/port/rawlink/pcap.go +++ b/port/rawlink/pcap.go @@ -41,6 +41,34 @@ func DefaultMacIPConfig(iface string) PcapConfig { } } +// DefaultIPXConfig returns a PcapConfig suitable for IPX: promiscuous, +// immediate mode, 250ms read timeout. The handle is shaped like +// EtherTalk's because IPX has the same low-latency requirements for +// RIP/SAP/NCP exchanges. +func DefaultIPXConfig(iface string) PcapConfig { + return PcapConfig{ + Interface: iface, + SnapLen: 65535, + Promiscuous: true, + ReadTimeout: 250 * time.Millisecond, + ImmediateMode: true, + } +} + +// DefaultNetBEUIConfig returns a PcapConfig suitable for NetBEUI: +// promiscuous, immediate mode, 250ms read timeout. NetBEUI session +// state is sensitive to round-trip latency, so the handle uses the +// same low-latency shape as EtherTalk. +func DefaultNetBEUIConfig(iface string) PcapConfig { + return PcapConfig{ + Interface: iface, + SnapLen: 65535, + Promiscuous: true, + ReadTimeout: 250 * time.Millisecond, + ImmediateMode: true, + } +} + // pcapLink implements RawLink, MediumReporter, and FilterableLink using libpcap. type pcapLink struct { handle *pcap.Handle // handle is the underlying libpcap handle used for I/O. diff --git a/port/rawlink/rawlink.go b/port/rawlink/rawlink.go index b3f20b4..e1d1798 100644 --- a/port/rawlink/rawlink.go +++ b/port/rawlink/rawlink.go @@ -66,3 +66,4 @@ type FilterableLink interface { // the expression is invalid or unsupported by the backend. SetFilter(expr string) error } + diff --git a/protocol/ipx/datagram.go b/protocol/ipx/datagram.go new file mode 100644 index 0000000..4dbc7ca --- /dev/null +++ b/protocol/ipx/datagram.go @@ -0,0 +1,87 @@ +package ipx + +import "errors" + +var ErrNotImplemented = errors.New("not implemented") + +// Datagram represents an IPX packet header and payload. +type Datagram struct { + Checksum [2]byte + Length uint16 + Hops uint8 + Type uint8 + DstNet [4]byte + DstNode [6]byte + DstSock [2]byte + SrcNet [4]byte + SrcNode [6]byte + SrcSock [2]byte + Payload []byte +} + +// Encode serializes the Datagram to bytes. +func (d *Datagram) Encode() ([]byte, error) { + totalLen := 30 + len(d.Payload) + if totalLen > 65535 { + return nil, errors.New("ipx: payload too large") + } + + b := make([]byte, totalLen) + + // Default checksum to 0xFFFF if not set + if d.Checksum[0] == 0 && d.Checksum[1] == 0 { + b[0] = 0xFF + b[1] = 0xFF + } else { + b[0] = d.Checksum[0] + b[1] = d.Checksum[1] + } + + b[2] = byte(totalLen >> 8) + b[3] = byte(totalLen) + b[4] = d.Hops + b[5] = d.Type + copy(b[6:10], d.DstNet[:]) + copy(b[10:16], d.DstNode[:]) + copy(b[16:18], d.DstSock[:]) + copy(b[18:22], d.SrcNet[:]) + copy(b[22:28], d.SrcNode[:]) + copy(b[28:30], d.SrcSock[:]) + copy(b[30:], d.Payload) + + return b, nil +} + +// Decode deserializes bytes into an IPX Datagram. +func Decode(b []byte) (*Datagram, error) { + if len(b) < 30 { + return nil, errors.New("ipx: packet too short") + } + + totalLen := (int(b[2]) << 8) | int(b[3]) + if totalLen < 30 { + return nil, errors.New("ipx: invalid length") + } + if len(b) < totalLen { + return nil, errors.New("ipx: packet truncated") + } + + d := &Datagram{ + Length: uint16(totalLen), + Hops: b[4], + Type: b[5], + } + copy(d.Checksum[:], b[0:2]) + copy(d.DstNet[:], b[6:10]) + copy(d.DstNode[:], b[10:16]) + copy(d.DstSock[:], b[16:18]) + copy(d.SrcNet[:], b[18:22]) + copy(d.SrcNode[:], b[22:28]) + copy(d.SrcSock[:], b[28:30]) + + payloadLen := totalLen - 30 + d.Payload = make([]byte, payloadLen) + copy(d.Payload, b[30:30+payloadLen]) + + return d, nil +} diff --git a/protocol/ipx/datagram_test.go b/protocol/ipx/datagram_test.go new file mode 100644 index 0000000..f77ff11 --- /dev/null +++ b/protocol/ipx/datagram_test.go @@ -0,0 +1,47 @@ +package ipx + +import ( + "bytes" + "testing" +) + +func TestEncodeDecodeRoundTrip(t *testing.T) { + want := &Datagram{ + Hops: 1, + Type: 4, + DstNet: [4]byte{0, 0, 0, 1}, + DstNode: [6]byte{0xDE, 0xAD, 0xBE, 0xEF, 0xCA, 0xFE}, + DstSock: [2]byte{0x04, 0x53}, + SrcNet: [4]byte{0, 0, 0, 2}, + SrcNode: [6]byte{0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC}, + SrcSock: [2]byte{0x04, 0x52}, + Payload: []byte("hello"), + } + + wire, err := want.Encode() + if err != nil { + t.Fatalf("Encode: %v", err) + } + got, err := Decode(wire) + if err != nil { + t.Fatalf("Decode: %v", err) + } + if got.Hops != want.Hops || got.Type != want.Type { + t.Fatalf("hops/type mismatch: got %v want %v", got, want) + } + if got.DstNet != want.DstNet || got.DstNode != want.DstNode || got.DstSock != want.DstSock { + t.Fatalf("dst mismatch") + } + if got.SrcNet != want.SrcNet || got.SrcNode != want.SrcNode || got.SrcSock != want.SrcSock { + t.Fatalf("src mismatch") + } + if !bytes.Equal(got.Payload, want.Payload) { + t.Fatalf("payload: got %q want %q", got.Payload, want.Payload) + } +} + +func TestDecodeShortPacket(t *testing.T) { + if _, err := Decode([]byte{1, 2, 3}); err == nil { + t.Fatal("expected error decoding short packet") + } +} diff --git a/protocol/nbp/nbp_test.go b/protocol/nbp/nbp_test.go index b6bb8ce..e5139c3 100644 --- a/protocol/nbp/nbp_test.go +++ b/protocol/nbp/nbp_test.go @@ -13,9 +13,9 @@ func TestParsePacketLkUp(t *testing.T) { (CtrlLkUp << 4) | 1, // function | tuple count 0x77, // NBPID 0x00, 0x01, // network 1 - 0x02, // node - 0x03, // socket - 0x04, // enumerator + 0x02, // node + 0x03, // socket + 0x04, // enumerator byte(len(obj)), } data = append(data, obj...) diff --git a/protocol/netbeui/commands.go b/protocol/netbeui/commands.go new file mode 100644 index 0000000..14544b0 --- /dev/null +++ b/protocol/netbeui/commands.go @@ -0,0 +1,143 @@ +package netbeui + +// NBF command codes from IBM SC30-3587, Chapter 5, Table 5-1/5-2. +// +// Commands 0x00–0x13 are carried as DLC UI frames (connectionless, +// broadcast or directed). Commands 0x14–0x1F are session-layer +// commands normally carried as DLC I-format LPDUs (connection-oriented); +// in this Ethernet-only implementation they ride UI frames with NBF-level +// acknowledgment (DATA_ACK). + +// --- Name Management (UI frames) --- + +const ( + // CmdAddGroupNameQuery (0x00) verifies that a group name to be + // added does not already exist as a unique name on the network. + // Broadcast to the NetBIOS functional address. + CmdAddGroupNameQuery uint8 = 0x00 + + // CmdAddNameQuery (0x01) verifies that a unique name to be added + // is not already in use on the network. Broadcast to the NetBIOS + // functional address. + CmdAddNameQuery uint8 = 0x01 + + // CmdNameInConflict (0x02) indicates that a duplicate name has + // been detected — the same name is registered at more than one + // adapter. Broadcast to the NetBIOS functional address. + CmdNameInConflict uint8 = 0x02 + + // CmdStatusQuery (0x03) requests adapter status from a remote + // node. Broadcast (or directed after RND lookup). + CmdStatusQuery uint8 = 0x03 +) + +// --- Trace / Misc (UI frames) --- + +const ( + // CmdTerminateTraceRemote (0x07) terminates traces at remote nodes. + CmdTerminateTraceRemote uint8 = 0x07 +) + +// --- Datagram (UI frames) --- + +const ( + // CmdDatagram (0x08) carries an application datagram directed to + // a specific name. Broadcast to the NetBIOS functional address (or + // directed when the destination MAC is known). + CmdDatagram uint8 = 0x08 + + // CmdDatagramBroadcast (0x09) carries an application broadcast + // datagram. Broadcast to the NetBIOS functional address. + CmdDatagramBroadcast uint8 = 0x09 +) + +// --- Session Establishment / Name Resolution (UI frames) --- + +const ( + // CmdNameQuery (0x0A) locates a name on the network, used both + // for FIND.NAME and for CALL session establishment. Broadcast to + // the NetBIOS functional address. + CmdNameQuery uint8 = 0x0A + + // CmdAddNameResponse (0x0D) is a negative response indicating + // that a name in an ADD_NAME_QUERY or ADD_GROUP_NAME_QUERY is + // already in use. Directed UI to the query originator. + CmdAddNameResponse uint8 = 0x0D + + // CmdNameRecognized (0x0E) responds to a NAME_QUERY, indicating + // whether a session can be established. Directed UI with general + // broadcast. + CmdNameRecognized uint8 = 0x0E + + // CmdStatusResponse (0x0F) returns adapter status data in + // response to a STATUS_QUERY. Directed UI, no broadcast. + CmdStatusResponse uint8 = 0x0F + + // CmdTerminateTraceLocal (0x13) terminates traces at both local + // and remote nodes. Broadcast to the NetBIOS functional address. + CmdTerminateTraceLocal uint8 = 0x13 +) + +// --- Session Data Transfer (I-format LPDU / UI in this implementation) --- + +const ( + // CmdDataAck (0x14) positively acknowledges a DATA_ONLY_LAST frame. + CmdDataAck uint8 = 0x14 + + // CmdDataFirstMiddle (0x15) carries a session data segment that + // is not the last segment of a message (segmentation). + CmdDataFirstMiddle uint8 = 0x15 + + // CmdDataOnlyLast (0x16) carries a session data segment that is + // the only or last segment of a message. + CmdDataOnlyLast uint8 = 0x16 + + // CmdSessionConfirm (0x17) acknowledges a SESSION_INITIALIZE, + // completing session establishment. + CmdSessionConfirm uint8 = 0x17 + + // CmdSessionEnd (0x18) terminates a session. + CmdSessionEnd uint8 = 0x18 + + // CmdSessionInitialize (0x19) starts session setup after a + // NAME_RECOGNIZED indicated willingness to establish a session. + CmdSessionInitialize uint8 = 0x19 + + // CmdNoReceive (0x1A) indicates the receiver has no RECEIVE + // command pending to accept data. + CmdNoReceive uint8 = 0x1A + + // CmdReceiveOutstanding (0x1B) requests retransmission of the + // last data frame; a RECEIVE is now available. + CmdReceiveOutstanding uint8 = 0x1B + + // CmdReceiveContinue (0x1C) indicates a RECEIVE is pending and + // more data can be sent. + CmdReceiveContinue uint8 = 0x1C + + // CmdSessionAlive (0x1F) is a keepalive probe verifying that a + // session is still active. + CmdSessionAlive uint8 = 0x1F +) + +// IsSessionCommand returns true if cmd is a session-layer command +// (0x14–0x1F) that uses the 14-byte session header with destination +// and source session numbers instead of 16-byte names. +func IsSessionCommand(cmd uint8) bool { + return cmd >= 0x14 && cmd <= 0x1F +} + +// NonSessionHeaderLength is the total length of a non-session NBF +// frame header (commands 0x00–0x13): 12-byte common prefix + +// 16-byte dest name + 16-byte source name = 44 bytes. +const NonSessionHeaderLength = 44 + +// SessionHeaderLength is the total length of a session NBF frame +// header (commands 0x14–0x1F): 12-byte common prefix + +// 1-byte dest number + 1-byte source number = 14 bytes. +const SessionHeaderLength = 14 + +// NetBIOSMulticastMAC is the well-known Ethernet multicast address +// used for NetBIOS functional-address broadcasts on Ethernet +// (03:00:00:00:00:01). All NBF UI broadcasts target this address. +var NetBIOSMulticastMAC = [6]byte{0x03, 0x00, 0x00, 0x00, 0x00, 0x01} diff --git a/protocol/netbeui/frame.go b/protocol/netbeui/frame.go new file mode 100644 index 0000000..1854e9f --- /dev/null +++ b/protocol/netbeui/frame.go @@ -0,0 +1,200 @@ +// Package netbeui implements the NetBIOS Frames Protocol (NBF) frame +// format. NBF rides on 802.2 LLC directly over Ethernet (DSAP/SSAP +// both 0xF0); this package handles only the NBF body that follows the +// 3-byte LLC header — link-layer framing is the port's job. +// +// NBF defines two distinct header shapes on the wire (IBM SC30-3587 +// §5.5.3): +// +// 1. Non-session frames (commands 0x00–0x13, DLC UI): +// 44 bytes total — 12-byte common prefix + 16-byte dest name + +// 16-byte source name, optionally followed by user data +// (STATUS_RESPONSE). +// +// 2. Session frames (commands 0x14–0x1F, DLC I-format LPDU): +// 14 bytes total — 12-byte common prefix + 1-byte dest session +// number + 1-byte source session number, followed by user data. +// +// Common prefix layout (both shapes): +// +// +0 uint16 LENGTH (little-endian, includes this field) +// +2 uint16 DELIMITER (0xEFFF) +// +4 uint8 COMMAND +// +5 uint8 DATA1 (option flags / reserved) +// +6 uint16 DATA2 (per-command, LE) +// +8 uint16 XMIT CORRELATOR (LE) +// +10 uint16 RSP CORRELATOR (LE) +// +// This package provides a unified Frame type that carries the decoded +// header fields for both shapes, discriminated by IsSessionCommand(). +package netbeui + +import ( + "encoding/binary" + "errors" +) + +// NBFDelimiter is the constant 0xEFFF "NBF" delimiter that follows +// the length field in every NBF body. +const NBFDelimiter uint16 = 0xEFFF + +// HeaderLength is kept as an alias for NonSessionHeaderLength for +// backward compatibility with callers that reference it. +const HeaderLength = NonSessionHeaderLength + +// commonPrefixLen is the 12-byte prefix shared by both header shapes. +const commonPrefixLen = 12 + +// --- Errors --- + +// ErrNotImplemented is returned by call sites that have not been +// filled in. +var ErrNotImplemented = errors.New("netbeui: not implemented") + +// ErrShortFrame is returned by Decode when the input cannot contain +// even a common prefix. +var ErrShortFrame = errors.New("netbeui: short frame") + +// ErrBadDelimiter is returned by Decode when the 0xEFFF delimiter is +// missing — a strong signal the input is not an NBF body. +var ErrBadDelimiter = errors.New("netbeui: bad delimiter") + +// ErrFrameTooLarge is returned by Encode when the frame exceeds the +// maximum length encodable in the 16-bit length field. +var ErrFrameTooLarge = errors.New("netbeui: frame too large") + +// --- Frame --- + +// Frame represents a decoded NBF frame. The Command field determines +// which header shape was on the wire: +// +// - Commands 0x00–0x13 (non-session): DestinationName and SourceName +// are populated; DestNumber and SourceNumber are zero. +// - Commands 0x14–0x1F (session): DestNumber and SourceNumber are +// populated; DestinationName and SourceName are zero. +// +// Use IsSessionCommand(f.Command) to discriminate. +type Frame struct { + // Common prefix fields (both shapes) + Command uint8 + Data1 uint8 + Data2 uint16 + XmitCorrelator uint16 + RspCorrelator uint16 + + // Non-session header fields (commands 0x00–0x13) + DestinationName [16]byte + SourceName [16]byte + + // Session header fields (commands 0x14–0x1F) + DestNumber uint8 + SourceNumber uint8 + + // Payload follows the header (may be empty). + Payload []byte + + // --- Deprecated aliases for backward compatibility --- + + // ResponseCorrelator is an alias for RspCorrelator. + // Deprecated: use RspCorrelator. + ResponseCorrelator uint16 +} + +// Encode serializes the NBF frame to bytes. The result starts at the +// length field; callers prepend the 3-byte 802.2 LLC header at the +// link layer. +func (f *Frame) Encode() ([]byte, error) { + // Resolve deprecated alias: if the caller set ResponseCorrelator + // but not RspCorrelator, honour the deprecated field. + rspCorr := f.RspCorrelator + if rspCorr == 0 && f.ResponseCorrelator != 0 { + rspCorr = f.ResponseCorrelator + } + + session := IsSessionCommand(f.Command) + + var hdrLen int + if session { + hdrLen = SessionHeaderLength + } else { + hdrLen = NonSessionHeaderLength + } + + total := hdrLen + len(f.Payload) + if total > 0xFFFF { + return nil, ErrFrameTooLarge + } + + b := make([]byte, total) + + // Common prefix + binary.LittleEndian.PutUint16(b[0:2], uint16(total)) + binary.LittleEndian.PutUint16(b[2:4], NBFDelimiter) + b[4] = f.Command + b[5] = f.Data1 + binary.LittleEndian.PutUint16(b[6:8], f.Data2) + binary.LittleEndian.PutUint16(b[8:10], f.XmitCorrelator) + binary.LittleEndian.PutUint16(b[10:12], rspCorr) + + if session { + b[12] = f.DestNumber + b[13] = f.SourceNumber + } else { + copy(b[12:28], f.DestinationName[:]) + copy(b[28:44], f.SourceName[:]) + } + + if len(f.Payload) > 0 { + copy(b[hdrLen:], f.Payload) + } + return b, nil +} + +// Decode parses an NBF body (without the leading LLC header). The +// command byte determines which header shape is expected. +func Decode(b []byte) (*Frame, error) { + if len(b) < commonPrefixLen { + return nil, ErrShortFrame + } + if binary.LittleEndian.Uint16(b[2:4]) != NBFDelimiter { + return nil, ErrBadDelimiter + } + + cmd := b[4] + session := IsSessionCommand(cmd) + + var hdrLen int + if session { + hdrLen = SessionHeaderLength + } else { + hdrLen = NonSessionHeaderLength + } + + if len(b) < hdrLen { + return nil, ErrShortFrame + } + + f := &Frame{ + Command: cmd, + Data1: b[5], + Data2: binary.LittleEndian.Uint16(b[6:8]), + XmitCorrelator: binary.LittleEndian.Uint16(b[8:10]), + RspCorrelator: binary.LittleEndian.Uint16(b[10:12]), + } + // Populate deprecated alias + f.ResponseCorrelator = f.RspCorrelator + + if session { + f.DestNumber = b[12] + f.SourceNumber = b[13] + } else { + copy(f.DestinationName[:], b[12:28]) + copy(f.SourceName[:], b[28:44]) + } + + if len(b) > hdrLen { + f.Payload = make([]byte, len(b)-hdrLen) + copy(f.Payload, b[hdrLen:]) + } + return f, nil +} diff --git a/protocol/netbeui/frame_test.go b/protocol/netbeui/frame_test.go new file mode 100644 index 0000000..445b705 --- /dev/null +++ b/protocol/netbeui/frame_test.go @@ -0,0 +1,288 @@ +package netbeui + +import ( + "bytes" + "encoding/binary" + "testing" +) + +func TestNonSessionRoundTrip(t *testing.T) { + // ADD_NAME_QUERY (0x01) — spec Table 5-12: fixed length 0x002C (44). + f := &Frame{ + Command: CmdAddNameQuery, + Data1: 0x00, + Data2: 0x0000, + RspCorrelator: 0x1234, + } + copy(f.SourceName[:], []byte("TESTSERVER\x20\x20\x20\x20\x20\x00")) + + encoded, err := f.Encode() + if err != nil { + t.Fatalf("Encode: %v", err) + } + if len(encoded) != NonSessionHeaderLength { + t.Fatalf("expected %d bytes, got %d", NonSessionHeaderLength, len(encoded)) + } + // Verify wire length field + wireLen := binary.LittleEndian.Uint16(encoded[0:2]) + if wireLen != uint16(NonSessionHeaderLength) { + t.Fatalf("wire length = 0x%04X, want 0x%04X", wireLen, NonSessionHeaderLength) + } + // Verify delimiter + delim := binary.LittleEndian.Uint16(encoded[2:4]) + if delim != NBFDelimiter { + t.Fatalf("delimiter = 0x%04X, want 0x%04X", delim, NBFDelimiter) + } + // Verify command + if encoded[4] != CmdAddNameQuery { + t.Fatalf("command = 0x%02X, want 0x%02X", encoded[4], CmdAddNameQuery) + } + + decoded, err := Decode(encoded) + if err != nil { + t.Fatalf("Decode: %v", err) + } + if decoded.Command != f.Command { + t.Errorf("Command = 0x%02X, want 0x%02X", decoded.Command, f.Command) + } + if decoded.RspCorrelator != f.RspCorrelator { + t.Errorf("RspCorrelator = 0x%04X, want 0x%04X", decoded.RspCorrelator, f.RspCorrelator) + } + if decoded.SourceName != f.SourceName { + t.Errorf("SourceName mismatch") + } + if decoded.Payload != nil { + t.Errorf("expected nil payload, got %d bytes", len(decoded.Payload)) + } +} + +func TestSessionRoundTrip(t *testing.T) { + // DATA_ONLY_LAST (0x16) — spec Table 5-25: length 0x000E (14) + data. + payload := []byte("Hello, NetBEUI!") + f := &Frame{ + Command: CmdDataOnlyLast, + Data1: 0x00, + XmitCorrelator: 0xABCD, + RspCorrelator: 0x5678, + DestNumber: 0x01, + SourceNumber: 0x02, + Payload: payload, + } + + encoded, err := f.Encode() + if err != nil { + t.Fatalf("Encode: %v", err) + } + expectedLen := SessionHeaderLength + len(payload) + if len(encoded) != expectedLen { + t.Fatalf("expected %d bytes, got %d", expectedLen, len(encoded)) + } + // Verify wire length field + wireLen := binary.LittleEndian.Uint16(encoded[0:2]) + if wireLen != uint16(expectedLen) { + t.Fatalf("wire length = %d, want %d", wireLen, expectedLen) + } + // Verify session numbers at offsets 12–13 + if encoded[12] != 0x01 || encoded[13] != 0x02 { + t.Fatalf("session nums = %02X/%02X, want 01/02", encoded[12], encoded[13]) + } + + decoded, err := Decode(encoded) + if err != nil { + t.Fatalf("Decode: %v", err) + } + if decoded.Command != CmdDataOnlyLast { + t.Errorf("Command = 0x%02X, want 0x%02X", decoded.Command, CmdDataOnlyLast) + } + if decoded.DestNumber != 0x01 { + t.Errorf("DestNumber = %d, want 1", decoded.DestNumber) + } + if decoded.SourceNumber != 0x02 { + t.Errorf("SourceNumber = %d, want 2", decoded.SourceNumber) + } + if decoded.XmitCorrelator != 0xABCD { + t.Errorf("XmitCorrelator = 0x%04X, want 0xABCD", decoded.XmitCorrelator) + } + if !bytes.Equal(decoded.Payload, payload) { + t.Errorf("payload mismatch: got %q", decoded.Payload) + } +} + +func TestDataAckMinimal(t *testing.T) { + // DATA_ACK (0x14) — spec Table 5-23: exactly 14 bytes, no payload. + f := &Frame{ + Command: CmdDataAck, + XmitCorrelator: 0x0042, + DestNumber: 0x03, + SourceNumber: 0x04, + } + + encoded, err := f.Encode() + if err != nil { + t.Fatalf("Encode: %v", err) + } + if len(encoded) != SessionHeaderLength { + t.Fatalf("expected %d bytes, got %d", SessionHeaderLength, len(encoded)) + } + + decoded, err := Decode(encoded) + if err != nil { + t.Fatalf("Decode: %v", err) + } + if decoded.Command != CmdDataAck { + t.Errorf("Command = 0x%02X, want 0x%02X", decoded.Command, CmdDataAck) + } + if decoded.DestNumber != 0x03 || decoded.SourceNumber != 0x04 { + t.Errorf("session nums = %d/%d, want 3/4", decoded.DestNumber, decoded.SourceNumber) + } + if decoded.Payload != nil { + t.Errorf("expected nil payload") + } +} + +func TestNameInConflictRoundTrip(t *testing.T) { + // NAME_IN_CONFLICT (0x02) — spec Table 5-13: 44 bytes. + conflictName := [16]byte{} + copy(conflictName[:], "CONFLICT\x20\x20\x20\x20\x20\x20\x20\x00") + + // Source = NAME_NUMBER_1: 10 zero bytes + 6 MAC bytes + srcName := [16]byte{} + copy(srcName[10:], []byte{0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF}) + + f := &Frame{ + Command: CmdNameInConflict, + DestinationName: conflictName, + SourceName: srcName, + } + + encoded, err := f.Encode() + if err != nil { + t.Fatalf("Encode: %v", err) + } + if len(encoded) != NonSessionHeaderLength { + t.Fatalf("expected %d bytes, got %d", NonSessionHeaderLength, len(encoded)) + } + + decoded, err := Decode(encoded) + if err != nil { + t.Fatalf("Decode: %v", err) + } + if decoded.DestinationName != conflictName { + t.Errorf("DestinationName mismatch") + } + if decoded.SourceName != srcName { + t.Errorf("SourceName mismatch") + } +} + +func TestStatusResponseWithPayload(t *testing.T) { + // STATUS_RESPONSE (0x0F) — non-session with status data payload. + statusData := make([]byte, 60) + for i := range statusData { + statusData[i] = byte(i) + } + f := &Frame{ + Command: CmdStatusResponse, + Data1: 0x01, // NetBIOS 2.1 + XmitCorrelator: 0x9999, + Payload: statusData, + } + copy(f.SourceName[:], "REMOTE\x20\x20\x20\x20\x20\x20\x20\x20\x20\x00") + + encoded, err := f.Encode() + if err != nil { + t.Fatalf("Encode: %v", err) + } + expectedLen := NonSessionHeaderLength + len(statusData) + if len(encoded) != expectedLen { + t.Fatalf("expected %d bytes, got %d", expectedLen, len(encoded)) + } + + decoded, err := Decode(encoded) + if err != nil { + t.Fatalf("Decode: %v", err) + } + if !bytes.Equal(decoded.Payload, statusData) { + t.Errorf("payload mismatch") + } +} + +func TestDecodeShortFrame(t *testing.T) { + _, err := Decode([]byte{0x00, 0x01}) + if err != ErrShortFrame { + t.Fatalf("expected ErrShortFrame, got %v", err) + } +} + +func TestDecodeBadDelimiter(t *testing.T) { + b := make([]byte, NonSessionHeaderLength) + binary.LittleEndian.PutUint16(b[0:2], NonSessionHeaderLength) + binary.LittleEndian.PutUint16(b[2:4], 0xBEEF) // wrong delimiter + b[4] = CmdAddNameQuery + _, err := Decode(b) + if err != ErrBadDelimiter { + t.Fatalf("expected ErrBadDelimiter, got %v", err) + } +} + +func TestDecodeSessionShortFrame(t *testing.T) { + // Provide valid common prefix but too short for session header. + b := make([]byte, commonPrefixLen) + binary.LittleEndian.PutUint16(b[0:2], uint16(SessionHeaderLength)) + binary.LittleEndian.PutUint16(b[2:4], NBFDelimiter) + b[4] = CmdDataAck // session command + + _, err := Decode(b) + if err != ErrShortFrame { + t.Fatalf("expected ErrShortFrame, got %v", err) + } +} + +func TestBackwardCompatResponseCorrelator(t *testing.T) { + // Verify the deprecated ResponseCorrelator alias works. + f := &Frame{ + Command: CmdAddNameQuery, + ResponseCorrelator: 0x4321, + } + + encoded, err := f.Encode() + if err != nil { + t.Fatalf("Encode: %v", err) + } + decoded, err := Decode(encoded) + if err != nil { + t.Fatalf("Decode: %v", err) + } + if decoded.RspCorrelator != 0x4321 { + t.Errorf("RspCorrelator = 0x%04X, want 0x4321", decoded.RspCorrelator) + } + if decoded.ResponseCorrelator != 0x4321 { + t.Errorf("ResponseCorrelator alias = 0x%04X, want 0x4321", decoded.ResponseCorrelator) + } +} + +func TestIsSessionCommand(t *testing.T) { + nonSession := []uint8{ + CmdAddGroupNameQuery, CmdAddNameQuery, CmdNameInConflict, + CmdStatusQuery, CmdTerminateTraceRemote, CmdDatagram, + CmdDatagramBroadcast, CmdNameQuery, CmdAddNameResponse, + CmdNameRecognized, CmdStatusResponse, CmdTerminateTraceLocal, + } + for _, cmd := range nonSession { + if IsSessionCommand(cmd) { + t.Errorf("IsSessionCommand(0x%02X) = true, want false", cmd) + } + } + + session := []uint8{ + CmdDataAck, CmdDataFirstMiddle, CmdDataOnlyLast, + CmdSessionConfirm, CmdSessionEnd, CmdSessionInitialize, + CmdNoReceive, CmdReceiveOutstanding, CmdReceiveContinue, + CmdSessionAlive, + } + for _, cmd := range session { + if !IsSessionCommand(cmd) { + t.Errorf("IsSessionCommand(0x%02X) = false, want true", cmd) + } + } +} diff --git a/protocol/netbios/nbipx.go b/protocol/netbios/nbipx.go new file mode 100644 index 0000000..a6e85f7 --- /dev/null +++ b/protocol/netbios/nbipx.go @@ -0,0 +1,272 @@ +package netbios + +import ( + "encoding/binary" + "errors" +) + +// NetBIOS-over-IPX uses two IPX packet types depending on the +// purpose: +// +// - IPX type 20 ("NetBIOS broadcast / forwarding") for name +// service operations: name claim, name query, name in conflict. +// Travels broadcast and may traverse up to 8 routers. +// +// - IPX type 4 ("Packet Exchange Protocol") on socket 0x0455 for +// session-layer traffic: session establishment, data, teardown. +// Carries the 16-byte NB-IPX session header below. +// +// The session-header constants and the name-service packet shape are +// the same on the wire whether the sender is OS/2 LAN Server, Win95, +// or NetWare-based. The codec below captures the agreed-upon layout. + +// IPXTypeNetBIOS is the IPX packet-type code (0x14 = 20) used for +// NetBIOS-over-IPX broadcast forwarding (name claim / query). +const IPXTypeNetBIOS uint8 = 0x14 + +// IPXTypePEP is the IPX packet-type code (0x04) used for the NB-IPX +// session protocol on socket 0x0455. +const IPXTypePEP uint8 = 0x04 + +// NB-IPX session header: data_stream_type values seen on the wire. +// Each names what the packet means at the session layer; the +// per-flag connection-control byte refines behaviour (ACK, EOM, ...). +const ( + NBIPXFindName uint8 = 0x01 // name service request + NBIPXNameRecognized uint8 = 0x02 // name service reply (positive) + NBIPXCheckName uint8 = 0x03 + NBIPXNameInUse uint8 = 0x04 + NBIPXDeregisterName uint8 = 0x05 + NBIPXSessionInit uint8 = 0x05 + NBIPXSessionConfirm uint8 = 0x06 + NBIPXSessionEnd uint8 = 0x07 + NBIPXSessionEndAck uint8 = 0x08 + NBIPXStatusQuery uint8 = 0x09 + NBIPXStatusResponse uint8 = 0x0A + NBIPXDirectedDatagram uint8 = 0x0B + NBIPXDataAck uint8 = 0x14 + NBIPXDataOnlyLast uint8 = 0x15 + NBIPXDataFirstMiddle uint8 = 0x16 +) + +// NB-IPX session header: connection-control flag bits (high nibble +// of conn_ctrl_flag). +const ( + NBIPXConnFlagSYS uint8 = 0x80 // system packet + NBIPXConnFlagACK uint8 = 0x40 // requesting an ACK + NBIPXConnFlagATT uint8 = 0x20 // attention + NBIPXConnFlagEOM uint8 = 0x10 // end of message +) + +// NBIPXSessionHeader is the 16-byte session header that prefixes +// every NB-IPX session-family payload (everything carried over IPX +// type 4 on socket 0x0455). +type NBIPXSessionHeader struct { + ConnCtrlFlag uint8 // SYS|ACK|ATT|EOM bitfield + DataStreamType uint8 // NBIPXFindName, NBIPXSessionInit, ... + SourceConnID uint16 + DestConnID uint16 + SendSeq uint16 + TotalDataLen uint16 + Offset uint16 + DataLen uint16 + ConnCtrlByte uint8 + Reserved uint8 +} + +// NBIPXSessionHeaderLen is the wire length of NBIPXSessionHeader. +const NBIPXSessionHeaderLen = 16 + +// EncodeSessionHeader serialises an NB-IPX session header. The header +// is followed by DataLen bytes of payload, but encoding the payload +// is the caller's job — callers typically build a single buffer +// `[header || payload]` so they can write it as one IPX datagram body. +func EncodeSessionHeader(h *NBIPXSessionHeader) []byte { + out := make([]byte, NBIPXSessionHeaderLen) + out[0] = h.ConnCtrlFlag + out[1] = h.DataStreamType + binary.BigEndian.PutUint16(out[2:4], h.SourceConnID) + binary.BigEndian.PutUint16(out[4:6], h.DestConnID) + binary.BigEndian.PutUint16(out[6:8], h.SendSeq) + binary.BigEndian.PutUint16(out[8:10], h.TotalDataLen) + binary.BigEndian.PutUint16(out[10:12], h.Offset) + binary.BigEndian.PutUint16(out[12:14], h.DataLen) + out[14] = h.ConnCtrlByte + out[15] = h.Reserved + return out +} + +// DecodeSessionHeader parses the first 16 bytes of an NB-IPX session +// payload. Returns ErrShortNBIPX when input is shorter than the +// header. +func DecodeSessionHeader(b []byte) (*NBIPXSessionHeader, error) { + if len(b) < NBIPXSessionHeaderLen { + return nil, ErrShortNBIPX + } + return &NBIPXSessionHeader{ + ConnCtrlFlag: b[0], + DataStreamType: b[1], + SourceConnID: binary.BigEndian.Uint16(b[2:4]), + DestConnID: binary.BigEndian.Uint16(b[4:6]), + SendSeq: binary.BigEndian.Uint16(b[6:8]), + TotalDataLen: binary.BigEndian.Uint16(b[8:10]), + Offset: binary.BigEndian.Uint16(b[10:12]), + DataLen: binary.BigEndian.Uint16(b[12:14]), + ConnCtrlByte: b[14], + Reserved: b[15], + }, nil +} + +const ( + NBIPXWANRouterCount = 8 + NBIPXWANRouterBytes = 4 * NBIPXWANRouterCount + NBIPXNameServiceHeaderLen = 2 // NameTypeFlag + DataStreamType + NBIPXNameServiceLen = NBIPXWANRouterBytes + NBIPXNameServiceHeaderLen + NameLength + NMPIFixedHeaderLen = NBIPXWANRouterBytes + 1 + 1 + 2 + NameLength + NameLength +) + +const ( + // NMPI opcodes used on sockets 0x0551/0x0553. + NMPIOpNameClaim uint8 = 0xF1 + NMPIOpNameDelete uint8 = 0xF2 + NMPIOpNameQuery uint8 = 0xF3 + NMPIOpNameFound uint8 = 0xF4 + NMPIOpMsgHangup uint8 = 0xF5 + NMPIOpMailslotSend uint8 = 0xFC + NMPIOpMailslotFind uint8 = 0xFD + NMPIOpMailslotName uint8 = 0xFE +) + +const ( + NMPINameTypeMachine uint8 = 0x01 + NMPINameTypeWorkgroup uint8 = 0x02 + NMPINameTypeBrowser uint8 = 0x03 +) + +// NMPIPacket is the Name Management Protocol over IPX payload layout +// used by browser mailslot and name-query traffic on sockets 0x0551/0x0553. +type NMPIPacket struct { + Routers [NBIPXWANRouterCount][4]byte + Opcode uint8 + NameType uint8 + MessageID uint16 // little-endian on wire + RequestedName Name + SourceName Name + Payload []byte +} + +// EncodeNMPIPacket serializes an NMPI packet using the fixed 52-byte +// header followed by optional payload. +func EncodeNMPIPacket(p *NMPIPacket) []byte { + out := make([]byte, NMPIFixedHeaderLen+len(p.Payload)) + off := 0 + for i := range NBIPXWANRouterCount { + copy(out[off:off+4], p.Routers[i][:]) + off += 4 + } + out[off] = p.Opcode + off++ + out[off] = p.NameType + off++ + binary.LittleEndian.PutUint16(out[off:off+2], p.MessageID) + off += 2 + copy(out[off:off+NameLength], p.RequestedName[:]) + off += NameLength + copy(out[off:off+NameLength], p.SourceName[:]) + off += NameLength + copy(out[off:], p.Payload) + return out +} + +// DecodeNMPIPacket parses an NMPI packet from the fixed 52-byte +// header plus optional trailing payload. +func DecodeNMPIPacket(b []byte) (*NMPIPacket, error) { + if len(b) < NMPIFixedHeaderLen { + return nil, ErrShortNBIPX + } + var p NMPIPacket + off := 0 + for i := range NBIPXWANRouterCount { + copy(p.Routers[i][:], b[off:off+4]) + off += 4 + } + p.Opcode = b[off] + off++ + p.NameType = b[off] + off++ + p.MessageID = binary.LittleEndian.Uint16(b[off : off+2]) + off += 2 + copy(p.RequestedName[:], b[off:off+NameLength]) + off += NameLength + copy(p.SourceName[:], b[off:off+NameLength]) + off += NameLength + p.Payload = make([]byte, len(b)-off) + copy(p.Payload, b[off:]) + return &p, nil +} + +// NBIPXNameServicePacket is the body carried inside an IPX type-20 +// WAN-broadcast name packet: +// +// 32 bytes: 8 router network numbers (4 bytes each) +// 1 byte: NameTypeFlag +// 1 byte: DataStreamType (NBIPXFindName, NBIPXNameRecognized, ...) +// 16 bytes: NetBIOS name +// +// Router entries are zero-filled for same-segment broadcasts. +type NBIPXNameServicePacket struct { + Routers [NBIPXWANRouterCount][4]byte + NameTypeFlag uint8 + DataStreamType uint8 + Name Name +} + +// EncodeNameService serialises a name-service body to the canonical +// WAN-broadcast wire form (50 bytes). The IPX header (with Type=20) +// is the caller's job. +func EncodeNameService(p *NBIPXNameServicePacket) []byte { + out := make([]byte, NBIPXNameServiceLen) + off := 0 + for i := range NBIPXWANRouterCount { + copy(out[off:off+4], p.Routers[i][:]) + off += 4 + } + out[off] = p.NameTypeFlag + off++ + out[off] = p.DataStreamType + off++ + copy(out[off:off+NameLength], p.Name[:]) + return out +} + +// DecodeNameService parses a name-service body. It accepts both the +// canonical 50-byte WAN-broadcast form and the legacy 16-byte +// name-only form for compatibility with earlier builds. +func DecodeNameService(b []byte) (*NBIPXNameServicePacket, error) { + if len(b) < NameLength { + return nil, ErrShortNBIPX + } + var p NBIPXNameServicePacket + if len(b) >= NBIPXNameServiceLen { + off := 0 + for i := range NBIPXWANRouterCount { + copy(p.Routers[i][:], b[off:off+4]) + off += 4 + } + p.NameTypeFlag = b[off] + off++ + p.DataStreamType = b[off] + off++ + copy(p.Name[:], b[off:off+NameLength]) + return &p, nil + } + + // Legacy: payload carried only the 16-byte NetBIOS name. + p.DataStreamType = NBIPXFindName + copy(p.Name[:], b[:NameLength]) + return &p, nil +} + +// ErrShortNBIPX indicates an NB-IPX packet body too short to contain +// the header (or, for name-service packets, the name). +var ErrShortNBIPX = errors.New("netbios: short NB-IPX packet") diff --git a/protocol/netbios/nbipx_test.go b/protocol/netbios/nbipx_test.go new file mode 100644 index 0000000..c86955e --- /dev/null +++ b/protocol/netbios/nbipx_test.go @@ -0,0 +1,187 @@ +package netbios + +import ( + "bytes" + "testing" +) + +func TestNewNamePadsAndUppercases(t *testing.T) { + n := NewName("classicstack", NameTypeFileServer) + want := []byte("CLASSICSTACK ") + if !bytes.Equal(n[:NameLength-1], want) { + t.Fatalf("name bytes: got %q want %q", n[:NameLength-1], want) + } + if n.Type() != NameTypeFileServer { + t.Fatalf("type: got %#x want %#x", n.Type(), NameTypeFileServer) + } + if n.String() != "CLASSICSTACK" { + t.Fatalf("String: got %q", n.String()) + } +} + +func TestNewNameTruncates(t *testing.T) { + n := NewName("ABCDEFGHIJKLMNOPQRSTUV", NameTypeWorkstation) + if n.String() != "ABCDEFGHIJKLMNO" { + t.Fatalf("truncated: got %q want first 15 chars", n.String()) + } +} + +func TestSessionHeaderRoundTrip(t *testing.T) { + want := &NBIPXSessionHeader{ + ConnCtrlFlag: NBIPXConnFlagSYS | NBIPXConnFlagACK, + DataStreamType: NBIPXSessionInit, + SourceConnID: 0x1234, + DestConnID: 0xFFFF, // unassigned during session init + SendSeq: 1, + TotalDataLen: 0, + Offset: 0, + DataLen: 0, + ConnCtrlByte: 0, + Reserved: 0, + } + wire := EncodeSessionHeader(want) + if len(wire) != NBIPXSessionHeaderLen { + t.Fatalf("header length: got %d want %d", len(wire), NBIPXSessionHeaderLen) + } + got, err := DecodeSessionHeader(wire) + if err != nil { + t.Fatalf("Decode: %v", err) + } + if *got != *want { + t.Fatalf("round-trip mismatch:\n got %+v\nwant %+v", *got, *want) + } +} + +func TestSessionHeaderShort(t *testing.T) { + if _, err := DecodeSessionHeader([]byte{1, 2, 3}); err != ErrShortNBIPX { + t.Fatalf("expected ErrShortNBIPX, got %v", err) + } +} + +func TestNameServiceRoundTrip(t *testing.T) { + want := &NBIPXNameServicePacket{ + NameTypeFlag: 0x40, + DataStreamType: NBIPXFindName, + Name: NewName("CLASSICSTACK", NameTypeFileServer), + } + want.Routers[0] = [4]byte{0xCA, 0xFE, 0xF0, 0x0D} + wire := EncodeNameService(want) + if len(wire) != NBIPXNameServiceLen { + t.Fatalf("wire length: got %d want %d", len(wire), NBIPXNameServiceLen) + } + got, err := DecodeNameService(wire) + if err != nil { + t.Fatalf("Decode: %v", err) + } + if got.NameTypeFlag != want.NameTypeFlag { + t.Fatalf("NameTypeFlag: got %#x want %#x", got.NameTypeFlag, want.NameTypeFlag) + } + if got.DataStreamType != want.DataStreamType { + t.Fatalf("DataStreamType: got %#x want %#x", got.DataStreamType, want.DataStreamType) + } + if got.Name != want.Name { + t.Fatalf("name mismatch: got %q want %q", got.Name.String(), want.Name.String()) + } + if got.Routers[0] != want.Routers[0] { + t.Fatalf("router[0] mismatch: got %v want %v", got.Routers[0], want.Routers[0]) + } +} + +func TestNameServiceShort(t *testing.T) { + if _, err := DecodeNameService([]byte{1, 2, 3}); err != ErrShortNBIPX { + t.Fatalf("expected ErrShortNBIPX, got %v", err) + } +} + +func TestNameServiceDecodeLegacyNameOnly(t *testing.T) { + legacy := NewName("CLASSICSTACK", NameTypeFileServer) + wire := make([]byte, NameLength) + copy(wire, legacy[:]) + got, err := DecodeNameService(wire) + if err != nil { + t.Fatalf("Decode: %v", err) + } + if got.DataStreamType != NBIPXFindName { + t.Fatalf("DataStreamType: got %#x want %#x", got.DataStreamType, NBIPXFindName) + } + if got.Name != legacy { + t.Fatalf("name mismatch: got %q want %q", got.Name.String(), legacy.String()) + } +} + +func TestDatagramRoundTrip(t *testing.T) { + want := &Datagram{ + Destination: NewName("WORKGROUP", NameTypeGroup), + Source: NewName("CLASSICSTACK", NameTypeFileServer), + Payload: []byte("payload"), + } + wire, err := want.Encode() + if err != nil { + t.Fatalf("Encode: %v", err) + } + got, err := DecodeDatagram(wire) + if err != nil { + t.Fatalf("Decode: %v", err) + } + if got.Destination != want.Destination { + t.Fatalf("destination mismatch: got %q want %q", got.Destination.String(), want.Destination.String()) + } + if got.Source != want.Source { + t.Fatalf("source mismatch: got %q want %q", got.Source.String(), want.Source.String()) + } + if !bytes.Equal(got.Payload, want.Payload) { + t.Fatalf("payload mismatch: got %q want %q", got.Payload, want.Payload) + } +} + +func TestDatagramShort(t *testing.T) { + if _, err := DecodeDatagram([]byte{1, 2, 3}); err != ErrShortDatagram { + t.Fatalf("expected ErrShortDatagram, got %v", err) + } +} + +func TestEncodeNMPIPacketLayout(t *testing.T) { + p := &NMPIPacket{ + Opcode: NMPIOpMailslotSend, + NameType: NMPINameTypeMachine, + MessageID: 0x1234, + RequestedName: NewName("WORKGROUP", NameTypeGroup), + SourceName: NewName("CLASSICSTACK", NameTypeFileServer), + Payload: []byte("payload"), + } + wire := EncodeNMPIPacket(p) + if len(wire) != NMPIFixedHeaderLen+len(p.Payload) { + t.Fatalf("wire length: got %d want %d", len(wire), NMPIFixedHeaderLen+len(p.Payload)) + } + if wire[32] != NMPIOpMailslotSend { + t.Fatalf("opcode: got %#x want %#x", wire[32], NMPIOpMailslotSend) + } + if wire[33] != NMPINameTypeMachine { + t.Fatalf("name type: got %#x want %#x", wire[33], NMPINameTypeMachine) + } + if wire[34] != 0x34 || wire[35] != 0x12 { + t.Fatalf("message id bytes: got [%#x %#x] want [0x34 0x12]", wire[34], wire[35]) + } +} + +func TestDecodeNMPIPacketRoundTrip(t *testing.T) { + want := &NMPIPacket{ + Opcode: NMPIOpNameQuery, + NameType: NMPINameTypeMachine, + MessageID: 0x0042, + RequestedName: NewName("CLASSICSTACK", NameTypeFileServer), + SourceName: NewName("W98CLIENT", NameTypeWorkstation), + Payload: []byte("x"), + } + wire := EncodeNMPIPacket(want) + got, err := DecodeNMPIPacket(wire) + if err != nil { + t.Fatalf("Decode: %v", err) + } + if got.Opcode != want.Opcode || got.NameType != want.NameType || got.MessageID != want.MessageID { + t.Fatalf("header mismatch: got opcode=%#x nameType=%#x msg=%#x", got.Opcode, got.NameType, got.MessageID) + } + if got.RequestedName != want.RequestedName || got.SourceName != want.SourceName { + t.Fatalf("name mismatch") + } +} diff --git a/protocol/netbios/netbios.go b/protocol/netbios/netbios.go new file mode 100644 index 0000000..9a37c25 --- /dev/null +++ b/protocol/netbios/netbios.go @@ -0,0 +1,133 @@ +package netbios + +import ( + "errors" + "strings" +) + +var ErrNotImplemented = errors.New("not implemented") +var ErrShortDatagram = errors.New("netbios: datagram too short") + +// NameLength is the wire length of a NetBIOS name. The 16th byte is +// the *type* code (workstation, server, group, etc.) — not part of +// the human-visible name. +const NameLength = 16 + +// Standard NetBIOS name type bytes. The 16th byte of every name on +// the wire selects the resource type; clients form a "name + type" +// composite when claiming or resolving. +const ( + NameTypeWorkstation uint8 = 0x00 + NameTypeFileServer uint8 = 0x20 // SMB / file-server + NameTypeGroup uint8 = 0x1E +) + +// Name represents a 16-byte padded NetBIOS name. Bytes 0..14 carry +// the human-visible name (uppercase, space-padded); byte 15 is the +// type code (NameTypeWorkstation, NameTypeFileServer, ...). +type Name [NameLength]byte + +// NewName builds a NetBIOS name from a human-facing string and a +// type byte. The name is uppercased, truncated to 15 bytes, and +// space-padded; the type goes in byte 15. +func NewName(name string, typ uint8) Name { + var n Name + upper := strings.ToUpper(strings.TrimSpace(name)) + if len(upper) > NameLength-1 { + upper = upper[:NameLength-1] + } + for i := range NameLength - 1 { + if i < len(upper) { + n[i] = upper[i] + } else { + n[i] = ' ' + } + } + n[NameLength-1] = typ + return n +} + +// String renders the human-visible portion of the name with trailing +// spaces trimmed. The type byte is not included. +func (n Name) String() string { + return strings.TrimRight(string(n[:NameLength-1]), " ") +} + +// Type returns the type byte (byte 15). +func (n Name) Type() uint8 { return n[NameLength-1] } + +// Datagram represents a NetBIOS datagram. +type Datagram struct { + Destination Name + Source Name + Payload []byte +} + +func (d *Datagram) Encode() ([]byte, error) { + out := make([]byte, NameLength+NameLength+len(d.Payload)) + copy(out[0:NameLength], d.Destination[:]) + copy(out[NameLength:2*NameLength], d.Source[:]) + copy(out[2*NameLength:], d.Payload) + return out, nil +} + +func DecodeDatagram(b []byte) (*Datagram, error) { + if len(b) < 2*NameLength { + return nil, ErrShortDatagram + } + var d Datagram + copy(d.Destination[:], b[0:NameLength]) + copy(d.Source[:], b[NameLength:2*NameLength]) + d.Payload = make([]byte, len(b)-2*NameLength) + copy(d.Payload, b[2*NameLength:]) + return &d, nil +} + +type SessionPacketType uint8 + +const ( + SessionMessage SessionPacketType = 0x00 + SessionRequest SessionPacketType = 0x81 + PositiveSessionResponse SessionPacketType = 0x82 + NegativeSessionResponse SessionPacketType = 0x83 + RetargetSessionResponse SessionPacketType = 0x84 + SessionKeepAlive SessionPacketType = 0x85 +) + +// SessionPacket represents an RFC 1002 / MS-SMB2 Direct TCP session packet. +type SessionPacket struct { + Type SessionPacketType + Payload []byte +} + +func (s *SessionPacket) Encode() ([]byte, error) { + l := len(s.Payload) + if l > 16777215 { // MaxDirectTcpPacketLength + return nil, errors.New("payload too large") + } + + b := make([]byte, 4+l) + b[0] = byte(s.Type) + b[1] = byte(l >> 16) + b[2] = byte(l >> 8) + b[3] = byte(l) + copy(b[4:], s.Payload) + return b, nil +} + +func DecodeSessionPacket(b []byte) (*SessionPacket, error) { + if len(b) < 4 { + return nil, errors.New("packet too short") + } + l := (int(b[1]) << 16) | (int(b[2]) << 8) | int(b[3]) + if len(b) < 4+l { + return nil, errors.New("packet truncated") + } + // Copy the payload so the caller doesn't pin the underlying buffer. + payload := make([]byte, l) + copy(payload, b[4:4+l]) + return &SessionPacket{ + Type: SessionPacketType(b[0]), + Payload: payload, + }, nil +} diff --git a/protocol/netbios/session_table.go b/protocol/netbios/session_table.go new file mode 100644 index 0000000..2e7ccda --- /dev/null +++ b/protocol/netbios/session_table.go @@ -0,0 +1,135 @@ +package netbios + +import ( + "sync" + "sync/atomic" +) + +// SessionState tracks the lifecycle of a NetBIOS session independent +// of the underlying transport. +type SessionState uint8 + +const ( + SessionStateInit SessionState = iota + SessionStateActive + SessionStateClosing + SessionStateClosed +) + +// Session is a transport-agnostic session record. +// +// RemoteAddr carries transport-specific peer addressing information +// (for example Ethernet MAC for NBF or IPX endpoint for NBIPX). +type Session[Remote comparable] struct { + Mu sync.Mutex + + LocalNum uint8 + RemoteNum uint8 + RemoteAddr Remote + State SessionState + + // LastXmitCorrelator tracks the most recent outbound correlator + // used by transports that require wire-level ACK correlation. + LastXmitCorrelator uint16 +} + +type sessionKey[Remote comparable] struct { + remote Remote + local uint8 +} + +// SessionTable manages active sessions for a specific transport +// address type. +type SessionTable[Remote comparable] struct { + mu sync.RWMutex + sessions map[sessionKey[Remote]]*Session[Remote] + nextNum atomic.Uint32 + minNum uint8 + maxNum uint8 +} + +// NewSessionTable creates a session table that allocates local +// session numbers in the inclusive range [minNum, maxNum]. +func NewSessionTable[Remote comparable](minNum, maxNum uint8) *SessionTable[Remote] { + if minNum == 0 { + minNum = 1 + } + if maxNum < minNum { + maxNum = minNum + } + st := &SessionTable[Remote]{ + sessions: make(map[sessionKey[Remote]]*Session[Remote]), + minNum: minNum, + maxNum: maxNum, + } + st.nextNum.Store(uint32(minNum)) + return st +} + +// allocNum returns the next available local session number. +func (st *SessionTable[Remote]) allocNum() uint8 { + for { + cur := st.nextNum.Load() + next := cur + 1 + if next > uint32(st.maxNum) { + next = uint32(st.minNum) + } + if st.nextNum.CompareAndSwap(cur, next) { + return uint8(cur) + } + } +} + +// Create allocates a new session for a remote peer. +func (st *SessionTable[Remote]) Create(remote Remote) *Session[Remote] { + num := st.allocNum() + s := &Session[Remote]{ + LocalNum: num, + RemoteAddr: remote, + State: SessionStateInit, + } + key := sessionKey[Remote]{remote: remote, local: num} + st.mu.Lock() + st.sessions[key] = s + st.mu.Unlock() + return s +} + +// Lookup returns the session for (remote, localNum), or nil. +func (st *SessionTable[Remote]) Lookup(remote Remote, localNum uint8) *Session[Remote] { + key := sessionKey[Remote]{remote: remote, local: localNum} + st.mu.RLock() + defer st.mu.RUnlock() + return st.sessions[key] +} + +// LookupByRemote returns the first session matching remote+remoteNum. +func (st *SessionTable[Remote]) LookupByRemote(remote Remote, remoteNum uint8) *Session[Remote] { + st.mu.RLock() + defer st.mu.RUnlock() + for _, s := range st.sessions { + if s.RemoteAddr == remote && s.RemoteNum == remoteNum { + return s + } + } + return nil +} + +// Remove deletes a session from the table. +func (st *SessionTable[Remote]) Remove(remote Remote, localNum uint8) { + key := sessionKey[Remote]{remote: remote, local: localNum} + st.mu.Lock() + delete(st.sessions, key) + st.mu.Unlock() +} + +// All returns a snapshot of active sessions. +func (st *SessionTable[Remote]) All() []*Session[Remote] { + st.mu.RLock() + defer st.mu.RUnlock() + out := make([]*Session[Remote], 0, len(st.sessions)) + for _, s := range st.sessions { + out = append(out, s) + } + return out +} diff --git a/router/ipx/router.go b/router/ipx/router.go new file mode 100644 index 0000000..ba5f89a --- /dev/null +++ b/router/ipx/router.go @@ -0,0 +1,215 @@ +// Package ipx is the IPX socket-dispatch router. It is a peer of the +// AppleTalk router, not a member of it: IPX has its own address space +// (network number + 6-byte node ID + 2-byte socket) and its own +// inbound dispatch. +// +// The router holds a single IPX identity for the process: one network +// number (per-segment, configured by the operator) and one node ID +// (typically the interface MAC). The single-identity model is by +// design — bridging two IPX segments would need per-port identity, +// which is out of scope. +package ipx + +import ( + "errors" + "sync" + + "github.com/ObsoleteMadness/ClassicStack/netlog" + "github.com/ObsoleteMadness/ClassicStack/port/ipx" + protocol "github.com/ObsoleteMadness/ClassicStack/protocol/ipx" +) + +// BroadcastNode is the IPX node-ID broadcast address (all-ones) used +// for SAP, RIP, and NetBIOS-over-IPX name claims. +var BroadcastNode = [6]byte{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF} + +// DefaultNetwork is the fall-back IPX network number when the +// operator has not configured one. The all-zeros value ("local +// segment, unknown") matches the network number that Win98/NWLink +// uses before a NetWare server assigns a real network number, so +// ClassicStack and its clients appear on the same segment and can +// reach each other without routing. Operators running alongside a +// real NetWare server should configure an explicit network number. +var DefaultNetwork = [4]byte{0x00, 0x00, 0x00, 0x00} + +// ErrNotImplemented is returned by stub call sites that have not yet +// been filled in. +var ErrNotImplemented = errors.New("ipx: not implemented") + +// SocketHandler receives IPX datagrams whose destination socket +// matches a Register call. +type SocketHandler interface { + HandleDatagram(d *protocol.Datagram) +} + +// Router dispatches inbound IPX datagrams to socket handlers and +// fills source addresses on outbound datagrams. Implementations must +// be safe for concurrent use. +type Router interface { + // SetIdentity configures the network and node ID this router + // presents on the wire. Calling it after Start is allowed but + // callers should not change identity while traffic is in flight. + SetIdentity(network [4]byte, node [6]byte) + // Network returns the configured IPX network number. + Network() [4]byte + // Node returns the configured IPX node ID. + Node() [6]byte + // RegisterSocket attaches handler to inbound datagrams whose + // destination socket matches. Returns an error when socket is + // already registered. + RegisterSocket(socket [2]byte, handler SocketHandler) error + // Send fills SrcNet/SrcNode on d (when zero) and forwards to the + // first attached port. Returns an error when no port is attached. + Send(d *protocol.Datagram) error + // AddPort attaches a port to the router and installs the inbound + // delivery callback that drives Inbound. + AddPort(p ipx.Port) + // Inbound is called by attached ports for each decoded inbound + // datagram. The router enforces the address filter (DstNet/DstNode + // match ours or broadcast) before dispatching to a SocketHandler. + Inbound(d *protocol.Datagram) +} + +type routerImpl struct { + mu sync.RWMutex + network [4]byte + node [6]byte + sockets map[[2]byte]SocketHandler + ports []ipx.Port +} + +// NewRouter returns a router with the default network number and a +// zero node ID. Callers should set both via SetIdentity before any +// traffic flows. +func NewRouter() Router { + return &routerImpl{ + network: DefaultNetwork, + sockets: make(map[[2]byte]SocketHandler), + } +} + +func (r *routerImpl) SetIdentity(network [4]byte, node [6]byte) { + r.mu.Lock() + r.network = network + r.node = node + r.mu.Unlock() +} + +func (r *routerImpl) Network() [4]byte { + r.mu.RLock() + defer r.mu.RUnlock() + return r.network +} + +func (r *routerImpl) Node() [6]byte { + r.mu.RLock() + defer r.mu.RUnlock() + return r.node +} + +func (r *routerImpl) RegisterSocket(socket [2]byte, handler SocketHandler) error { + r.mu.Lock() + defer r.mu.Unlock() + if _, exists := r.sockets[socket]; exists { + return errors.New("ipx: socket already registered") + } + r.sockets[socket] = handler + netlog.Debug("[IPX][Router] registered socket=%02x%02x", socket[0], socket[1]) + return nil +} + +func (r *routerImpl) AddPort(p ipx.Port) { + r.mu.Lock() + r.ports = append(r.ports, p) + r.mu.Unlock() + p.SetDeliveryCallback(r.Inbound) +} + +// Send fills SrcNet and SrcNode on the outgoing datagram (when zero) +// and writes it through the first attached port. Source fields that +// are already set are respected so callers that need to override +// (e.g. for forwarding traffic) still can. +func (r *routerImpl) Send(d *protocol.Datagram) error { + r.mu.RLock() + if len(r.ports) == 0 { + r.mu.RUnlock() + return errors.New("ipx: no ports attached") + } + port := r.ports[0] + if isZero4(d.SrcNet) { + d.SrcNet = r.network + } + if isZero6(d.SrcNode) { + d.SrcNode = r.node + } + r.mu.RUnlock() + netlog.Debug("[IPX][Router] tx type=0x%02x src=%x.%x:%02x%02x dst=%x.%x:%02x%02x payload=%d", + d.Type, + d.SrcNet, d.SrcNode, d.SrcSock[0], d.SrcSock[1], + d.DstNet, d.DstNode, d.DstSock[0], d.DstSock[1], + len(d.Payload), + ) + return port.Send(d) +} + +// Inbound is the port-side delivery callback. It enforces the +// addressed-to-us filter (kernel pcap delivers every IPX frame on the +// wire; the kernel filter only narrows by framing, not by destination) +// before dispatching to the registered socket handler. +func (r *routerImpl) Inbound(d *protocol.Datagram) { + accepted, reason := r.acceptsDest(d.DstNet, d.DstNode) + if !accepted { + r.mu.RLock() + ours := r.network + myNode := r.node + r.mu.RUnlock() + netlog.Debug("[IPX][Router] drop inbound (dest mismatch: %s) type=0x%02x src=%x.%x:%02x%02x dst=%x.%x:%02x%02x local=%x.%x payload=%d", + reason, + d.Type, + d.SrcNet, d.SrcNode, d.SrcSock[0], d.SrcSock[1], + d.DstNet, d.DstNode, d.DstSock[0], d.DstSock[1], + ours, myNode, + len(d.Payload), + ) + return + } + netlog.Debug("[IPX][Router] rx type=0x%02x src=%x.%x:%02x%02x dst=%x.%x:%02x%02x payload=%d", + d.Type, + d.SrcNet, d.SrcNode, d.SrcSock[0], d.SrcSock[1], + d.DstNet, d.DstNode, d.DstSock[0], d.DstSock[1], + len(d.Payload), + ) + r.mu.RLock() + handler, ok := r.sockets[d.DstSock] + r.mu.RUnlock() + if !ok { + netlog.Debug("[IPX][Router] no handler for socket=%02x%02x", d.DstSock[0], d.DstSock[1]) + return + } + handler.HandleDatagram(d) +} + +// acceptsDest returns true when (network, node) matches the router's +// identity or is a broadcast address. Network 0 ("local segment, +// unknown") is also accepted because some clients send name-claim +// broadcasts that way before learning the network number. +func (r *routerImpl) acceptsDest(network [4]byte, node [6]byte) (bool, string) { + r.mu.RLock() + ours := r.network + myNode := r.node + r.mu.RUnlock() + + if !isZero4(network) && network != ours { + return false, "network" + } + if node == BroadcastNode { + return true, "" + } + if node != myNode { + return false, "node" + } + return true, "" +} + +func isZero4(b [4]byte) bool { return b == [4]byte{} } +func isZero6(b [6]byte) bool { return b == [6]byte{} } diff --git a/router/ipx/router_test.go b/router/ipx/router_test.go new file mode 100644 index 0000000..cd501e2 --- /dev/null +++ b/router/ipx/router_test.go @@ -0,0 +1,252 @@ +package ipx + +import ( + "sync" + "sync/atomic" + "testing" + + "github.com/ObsoleteMadness/ClassicStack/capture" + "github.com/ObsoleteMadness/ClassicStack/port/ipx" + protocol "github.com/ObsoleteMadness/ClassicStack/protocol/ipx" +) + +// fakeHandler captures the last datagram delivered to it. +type fakeHandler struct { + mu sync.Mutex + last *protocol.Datagram + hits atomic.Int32 +} + +func (f *fakeHandler) HandleDatagram(d *protocol.Datagram) { + f.mu.Lock() + f.last = d + f.mu.Unlock() + f.hits.Add(1) +} + +// fakePort captures Send calls and exposes a SetDeliveryCallback hook +// the test can drive directly. +type fakePort struct { + mu sync.Mutex + sent []*protocol.Datagram + cb ipx.DeliveryCallback +} + +func (p *fakePort) Start() error { return nil } +func (p *fakePort) Stop() error { return nil } +func (p *fakePort) Send(d *protocol.Datagram) error { + p.mu.Lock() + defer p.mu.Unlock() + p.sent = append(p.sent, d) + return nil +} +func (p *fakePort) SetDeliveryCallback(cb ipx.DeliveryCallback) { + p.mu.Lock() + p.cb = cb + p.mu.Unlock() +} +func (p *fakePort) SetCaptureSink(_ capture.Sink) {} + +func ours() ([4]byte, [6]byte) { + return [4]byte{0xCA, 0xFE, 0xF0, 0x0D}, [6]byte{0x02, 0x00, 0x00, 0x00, 0x00, 0x42} +} + +func TestRouterAcceptsAddressedToUs(t *testing.T) { + r := NewRouter() + net, node := ours() + r.SetIdentity(net, node) + + h := &fakeHandler{} + if err := r.RegisterSocket([2]byte{0x04, 0x53}, h); err != nil { + t.Fatalf("RegisterSocket: %v", err) + } + + d := &protocol.Datagram{ + DstNet: net, + DstNode: node, + DstSock: [2]byte{0x04, 0x53}, + } + r.Inbound(d) + if h.hits.Load() != 1 { + t.Fatalf("expected 1 dispatch, got %d", h.hits.Load()) + } +} + +func TestRouterAcceptsBroadcastNode(t *testing.T) { + r := NewRouter() + net, node := ours() + r.SetIdentity(net, node) + + h := &fakeHandler{} + _ = r.RegisterSocket([2]byte{0x04, 0x52}, h) // SAP + + d := &protocol.Datagram{ + DstNet: net, + DstNode: BroadcastNode, + DstSock: [2]byte{0x04, 0x52}, + } + r.Inbound(d) + if h.hits.Load() != 1 { + t.Fatalf("broadcast not delivered") + } +} + +func TestRouterAcceptsZeroNetwork(t *testing.T) { + // Network=0 ("local segment, unknown") is accepted because some + // clients send name-claim broadcasts that way before learning the + // network number. + r := NewRouter() + net, node := ours() + r.SetIdentity(net, node) + + h := &fakeHandler{} + _ = r.RegisterSocket([2]byte{0x04, 0x55}, h) + + d := &protocol.Datagram{ + DstNet: [4]byte{}, // zero + DstNode: BroadcastNode, + DstSock: [2]byte{0x04, 0x55}, + } + r.Inbound(d) + if h.hits.Load() != 1 { + t.Fatalf("zero-network broadcast not delivered") + } +} + +func TestRouterRejectsForeignNetwork(t *testing.T) { + r := NewRouter() + net, node := ours() + r.SetIdentity(net, node) + + h := &fakeHandler{} + _ = r.RegisterSocket([2]byte{0x04, 0x53}, h) + + d := &protocol.Datagram{ + DstNet: [4]byte{0xAA, 0xBB, 0xCC, 0xDD}, // not ours + DstNode: node, + DstSock: [2]byte{0x04, 0x53}, + } + r.Inbound(d) + if h.hits.Load() != 0 { + t.Fatalf("foreign network was accepted") + } +} + +func TestRouterRejectsForeignNode(t *testing.T) { + r := NewRouter() + net, node := ours() + r.SetIdentity(net, node) + + h := &fakeHandler{} + _ = r.RegisterSocket([2]byte{0x04, 0x53}, h) + + d := &protocol.Datagram{ + DstNet: net, + DstNode: [6]byte{0xDE, 0xAD, 0xBE, 0xEF, 0xCA, 0xFE}, // not us, not broadcast + DstSock: [2]byte{0x04, 0x53}, + } + r.Inbound(d) + if h.hits.Load() != 0 { + t.Fatalf("foreign-node packet was accepted") + } +} + +func TestRouterRejectsUnregisteredSocket(t *testing.T) { + r := NewRouter() + net, node := ours() + r.SetIdentity(net, node) + + h := &fakeHandler{} + _ = r.RegisterSocket([2]byte{0x04, 0x53}, h) + + d := &protocol.Datagram{ + DstNet: net, + DstNode: node, + DstSock: [2]byte{0x04, 0x52}, // not the one we registered + } + r.Inbound(d) + if h.hits.Load() != 0 { + t.Fatalf("unregistered-socket dispatch happened") + } +} + +func TestSendFillsZeroSourceFields(t *testing.T) { + r := NewRouter() + net, node := ours() + r.SetIdentity(net, node) + + port := &fakePort{} + r.AddPort(port) + + d := &protocol.Datagram{ + DstNet: [4]byte{0x00, 0x00, 0x00, 0x01}, + DstNode: BroadcastNode, + DstSock: [2]byte{0x04, 0x52}, + } + if err := r.Send(d); err != nil { + t.Fatalf("Send: %v", err) + } + port.mu.Lock() + defer port.mu.Unlock() + if len(port.sent) != 1 { + t.Fatalf("send count: got %d want 1", len(port.sent)) + } + got := port.sent[0] + if got.SrcNet != net { + t.Fatalf("SrcNet: got %x want %x", got.SrcNet, net) + } + if got.SrcNode != node { + t.Fatalf("SrcNode: got %x want %x", got.SrcNode, node) + } +} + +func TestSendPreservesPreSetSourceFields(t *testing.T) { + r := NewRouter() + net, node := ours() + r.SetIdentity(net, node) + + port := &fakePort{} + r.AddPort(port) + + pre := &protocol.Datagram{ + SrcNet: [4]byte{0x11, 0x22, 0x33, 0x44}, // not zero + SrcNode: [6]byte{0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA}, + DstNode: BroadcastNode, + } + if err := r.Send(pre); err != nil { + t.Fatalf("Send: %v", err) + } + got := port.sent[0] + if got.SrcNet == net || got.SrcNode == node { + t.Fatalf("Send overwrote pre-set source fields") + } +} + +func TestSendWithNoPort(t *testing.T) { + r := NewRouter() + if err := r.Send(&protocol.Datagram{}); err == nil { + t.Fatal("expected error sending with no attached port") + } +} + +func TestRegisterSocketRejectsDuplicates(t *testing.T) { + r := NewRouter() + h := &fakeHandler{} + if err := r.RegisterSocket([2]byte{0x04, 0x53}, h); err != nil { + t.Fatalf("first Register: %v", err) + } + if err := r.RegisterSocket([2]byte{0x04, 0x53}, h); err == nil { + t.Fatal("duplicate Register accepted") + } +} + +func TestNewRouterDefaults(t *testing.T) { + r := NewRouter() + if r.Network() != DefaultNetwork { + t.Fatalf("default network: got %x want %x", r.Network(), DefaultNetwork) + } + var zeroNode [6]byte + if r.Node() != zeroNode { + t.Fatalf("default node: got %x want zero", r.Node()) + } +} diff --git a/scripts/ci/test.ps1 b/scripts/ci/test.ps1 index 78d4ed1..9b8bede 100644 --- a/scripts/ci/test.ps1 +++ b/scripts/ci/test.ps1 @@ -1,8 +1,24 @@ $ErrorActionPreference = 'Stop' -$packages = go list ./... | Where-Object { $_ -notmatch '(^|/)(dist|icon|icons)($|/)' } -if (-not $packages) { - throw 'No packages found to test' -} +$tagSets = @( + '' + 'afp' + 'afp macgarden' + 'afp macip' + 'afp macgarden macip' + 'afp sqlite_cnid' + 'all' + 'ipx netbeui smb' +) -go test $packages +foreach ($tags in $tagSets) { + Write-Host "=== go test -tags `"$tags`" ===" + $packages = & go list -tags $tags ./... | Where-Object { $_ -notmatch '(^|/)(dist|icon|icons)($|/)' } + if (-not $packages) { + throw "No packages found to test for tags=`"$tags`"" + } + & go test -tags $tags $packages + if ($LASTEXITCODE -ne 0) { + throw "go test failed for tags=`"$tags`"" + } +} diff --git a/scripts/ci/test.sh b/scripts/ci/test.sh index b4c6da2..1ccef67 100644 --- a/scripts/ci/test.sh +++ b/scripts/ci/test.sh @@ -12,6 +12,7 @@ tag_sets=( "afp macgarden macip" "afp sqlite_cnid" "all" + "ipx netbeui smb" ) for tags in "${tag_sets[@]}"; do diff --git a/server.toml b/server.toml index 8e034e2..9a7dec7 100644 --- a/server.toml +++ b/server.toml @@ -1,3 +1,11 @@ +[Bridge] +mode = "pcap" +#device = '\Device\NPF_{B7D4E073-2185-4912-BBE8-3948C6636D02}' +device = '\Device\NPF_{7A63BBB0-EBC1-4FA7-A397-8E7F42E39A73}' +#device = '\Device\NPF_{9354BA7F-DE41-4A33-88F4-408A0F4A3C02}' +hw_address = "DE:AD:BE:EF:CA:FE" +bridge_mode = "auto" + [LToUdp] # LocalTalk over UDP Settings (used by Mini vMac UDP builds and SNOW emu) enabled = true # Enable LToUDP - true for on, false for off @@ -12,14 +20,9 @@ seed_zone = "TashTalk Network" [EtherTalk] # EtherTalk is a pcap-based network bridge -backend = "pcap" # supported: pcap, tap, tun. Leave blank to disable EtherTalk. -device = '\Device\NPF_{B7D4E073-2185-4912-BBE8-3948C6636D02}' -# device = '\Device\NPF_{7A63BBB0-EBC1-4FA7-A397-8E7F42E39A73}' -hw_address = "DE:AD:BE:EF:CA:FE" # EtherTalk hardware address for the router seed_network_min = 3 seed_network_max = 5 seed_zone = "EtherTalk Network" -bridge_mode = "auto" # auto (default), ethernet, or wifi bridge_host_mac = "" # optional host adapter MAC for Wi-Fi bridge shim [MacIP] @@ -76,4 +79,44 @@ log_traffic = false # DLT_LTALK (114); EtherTalk captures use DLT_EN10MB (1). localtalk = "./captures/afp-localtalk.pcap" # e.g. "captures/classicstack-localtalk.pcap" ethertalk = "./captures/afp-ethertalk.pcap" # e.g. "captures/classicstack-ethertalk.pcap" -snaplen = 65535 # per-frame snap length \ No newline at end of file +ipx = "./captures/ipx.pcap" # IPX rawlink capture (same DLT_EN10MB link type) +netbeui = "./captures/netbeui.pcap" # NBF over rawlink capture. +snaplen = 65535 # per-frame snap length + +[IPX] +enabled = true +framing = "ethernet_ii" # ethernet_ii|raw_802_3|llc|snap +# internal_network = "" + +[NetBEUI] +enabled = true + +[NetBIOS] +enabled = true +# transports = ["netbeui", "ipx", "tcp"] +transports = ["ipx", "netbeui"] +# scope_id = "" + +[SMB] +enabled = true +# nbt_binding = ":139" +# direct_binding = ":445" +# guest_ok = true +server_name = "ClassicStack" +workgroup = "WORKGROUP" + + +[SMB.Volumes.Public] +name = "Public" +path = "C:\\Mac" +fs_type = "local_fs" +read_only = false + +# [Shortname] +# enabled = false +# backend = "memory" # memory|sqlite +# db_path = "shortname.db" + +# [VFSBus] +# subscriber_buffer = 256 +# drop_warn_interval = "30s" diff --git a/server.toml.example b/server.toml.example index 28500c9..d66958f 100644 --- a/server.toml.example +++ b/server.toml.example @@ -1,3 +1,10 @@ +[Bridge] +# Shared raw-link settings used by EtherTalk, MacIP, IPX, and NetBEUI. +mode = "pcap" # pcap, tap, or tun +device = '\\Device\\NPF_{1DFDAA9C-7DD4-40F8-B6D4-9298C273D654}' +hw_address = "DE:AD:BE:EF:CA:FE" # host/bridge MAC used by raw-link consumers +bridge_mode = "auto" # auto, ethernet, or wifi frame adaptation mode + [LToUdp] # LocalTalk over UDP Settings (used by Mini vMac UDP builds and SNOW emu) enabled = true # Enable LToUDP - true for on, false for off @@ -13,14 +20,8 @@ seed_zone = "TashTalk Network" # TashTalk seed zone name [EtherTalk] # EtherTalk is a pcap-based network bridge -backend = "pcap" # supported: pcap, tap, tun. Leave blank to disable EtherTalk. -# device = '\Device\NPF_{B7D4E073-2185-4912-BBE8-3948C6636D02}' -# PCap device name. Blank to disable EtherTalk. Use literal strings (single quotes) on Windows -# so the backslashes are not interpreted as TOML escapes. Linux: "/dev/eth0". -device = '\Device\NPF_{1DFDAA9C-7DD4-40F8-B6D4-9298C273D654}' -hw_address = "DE:AD:BE:EF:CA:FE" # EtherTalk hardware address for the router -bridge_mode = "auto" # auto (default), ethernet, or wifi. Use wifi for bridge-shim rewriting on Wi-Fi adapters. bridge_host_mac = "" # optional host adapter MAC for Wi-Fi bridge shim. Defaults to hw_address when blank. +filter = "" # optional pcap BPF filter override seed_network_min = 3 # EtherTalk seed network minimum seed_network_max = 5 # EtherTalk seed network maximum seed_zone = "EtherTalk Network" @@ -36,6 +37,7 @@ lease_file = "leases.txt" # in NAT mode, persist DHCP leases to this file ip_gateway = "192.168.0.1" # upstream/default gateway on the IP-side network dhcp_relay = true # convert MacTCP auto-config to DHCP requests nameserver = "1.1.1.1" # DNS nameserver +filter = "" # optional pcap BPF filter override [AFP] # Apple Filing Protocol server settings @@ -75,4 +77,47 @@ log_traffic = false # DLT_LTALK (114); EtherTalk captures use DLT_EN10MB (1). localtalk = "" # e.g. "captures/classicstack-localtalk.pcap" ethertalk = "" # e.g. "captures/classicstack-ethertalk.pcap" +ipx = "" # e.g. "captures/classicstack-ipx.pcap" snaplen = 65535 # per-frame snap length + +# [IPX] +# enabled = false +# interface = "" # blank: reuse [EtherTalk] device +# framing = "ethernet_ii" # ethernet_ii|raw_802_3|llc|snap +# internal_network = "" # 8 hex digits; blank: 00000001 +# filter = "" # optional pcap BPF filter override (default: ipx) + +# [NetBEUI] +# enabled = false +# interface = "" # blank: reuse [EtherTalk] device +# filter = "" # optional pcap BPF filter override (default: llc) + +# [NetBIOS] +# enabled = false +# transports = ["netbeui", "ipx", "tcp"] +# scope_id = "" + +# [SMB] +# enabled = false +# nbt_binding = ":139" +# direct_binding = "" # ":445" enables direct SMB; SMB1 conventionally NBT-only +# guest_ok = false +# server_name = "CLASSICSTACK" +# workgroup = "WORKGROUP" + +# Each SMB share gets a [SMB.Volumes.] section, mirroring +# [AFP.Volumes.]. fs_type selects a pkg/vfs backend. +# [SMB.Volumes.Public] +# name = "Public" +# path = 'C:\Public' +# fs_type = "local_fs" +# read_only = false + +# [Shortname] +# enabled = false +# backend = "memory" # memory|sqlite +# db_path = "shortname.db" + +# [VFSBus] +# subscriber_buffer = 256 +# drop_warn_interval = "30s" diff --git a/service/afp/catsearch_test.go b/service/afp/catsearch_test.go index 0200fa1..2c64c59 100644 --- a/service/afp/catsearch_test.go +++ b/service/afp/catsearch_test.go @@ -44,6 +44,10 @@ func (f *catSearchCaptureFS) Stat(path string) (fs.FileInfo, error) { } func (f *catSearchCaptureFS) DiskUsage(path string) (uint64, uint64, error) { return 0, 0, nil } + +func (f *catSearchCaptureFS) ShortName(path string) (string, error) { + return filepath.Base(path), nil +} func (f *catSearchCaptureFS) CreateDir(path string) error { return fs.ErrPermission } func (f *catSearchCaptureFS) CreateFile(path string) (File, error) { return nil, fs.ErrPermission } func (f *catSearchCaptureFS) OpenFile(path string, flag int) (File, error) { diff --git a/service/afp/cnid.go b/service/afp/cnid.go index b2ea57f..9a1a469 100644 --- a/service/afp/cnid.go +++ b/service/afp/cnid.go @@ -5,6 +5,7 @@ package afp import ( "github.com/ObsoleteMadness/ClassicStack/netlog" "github.com/ObsoleteMadness/ClassicStack/pkg/cnid" + "github.com/ObsoleteMadness/ClassicStack/pkg/vfs" ) // CNID constants and the Store interface now live in pkg/cnid. These @@ -74,3 +75,24 @@ func resolveCNIDBackend(options Options) CNIDBackend { return SQLiteCNIDBackend{} } } + +// CNIDEventSubscriber implements vfs.Subscriber to watch for OpRename +// and OpDelete events, updating the CNID DB when a HostPath falls within +// a mounted volume. +type CNIDEventSubscriber struct { + // In the future this will hold references to mounted volumes +} + +// OnVFSEvent implements vfs.Subscriber. +func (s *CNIDEventSubscriber) OnVFSEvent(ev vfs.Event) { + if ev.Origin == "afp" { + return + } + if ev.Op == vfs.OpRename || ev.Op == vfs.OpDelete { + netlog.Debug("[AFP][CNID] vfs event %s on %s (origin: %s)", ev.Op, ev.HostPath, ev.Origin) + } +} + +func init() { + vfs.DefaultBus.Subscribe(&CNIDEventSubscriber{}) +} diff --git a/service/afp/directory.go b/service/afp/directory.go index 6d16803..6beacc1 100644 --- a/service/afp/directory.go +++ b/service/afp/directory.go @@ -8,8 +8,10 @@ import ( "io/fs" "os" "path/filepath" + "time" "github.com/ObsoleteMadness/ClassicStack/netlog" + "github.com/ObsoleteMadness/ClassicStack/pkg/vfs" ) func (s *Service) handleOpenDir(req *FPOpenDirReq) (*FPOpenDirRes, int32) { @@ -340,6 +342,14 @@ func (s *Service) handleCreateDir(req *FPCreateDirReq) (*FPCreateDirRes, int32) } return &FPCreateDirRes{}, ErrAccessDenied } + + vfs.DefaultBus.Publish(vfs.Event{ + Op: vfs.OpCreate, + HostPath: targetPath, + Origin: "afp", + Time: time.Now(), + }) + newDID := s.getPathDID(req.VolumeID, targetPath) return &FPCreateDirRes{DirID: newDID}, NoErr } diff --git a/service/afp/enumerate_encoding_test.go b/service/afp/enumerate_encoding_test.go index e5710a8..5f992e8 100644 --- a/service/afp/enumerate_encoding_test.go +++ b/service/afp/enumerate_encoding_test.go @@ -73,6 +73,10 @@ func (s *childCountSpyFS) Stat(path string) (fs.FileInfo, error) { } func (s *childCountSpyFS) DiskUsage(path string) (uint64, uint64, error) { return 0, 0, nil } + +func (s *childCountSpyFS) ShortName(path string) (string, error) { + return filepath.Base(path), nil +} func (s *childCountSpyFS) CreateDir(path string) error { return fs.ErrPermission } func (s *childCountSpyFS) CreateFile(path string) (File, error) { return nil, fs.ErrPermission } func (s *childCountSpyFS) OpenFile(path string, flag int) (File, error) { return nil, fs.ErrPermission } @@ -108,6 +112,10 @@ func (s *rangeSpyFS) Stat(path string) (fs.FileInfo, error) { } func (s *rangeSpyFS) DiskUsage(path string) (uint64, uint64, error) { return 0, 0, nil } + +func (s *rangeSpyFS) ShortName(path string) (string, error) { + return filepath.Base(path), nil +} func (s *rangeSpyFS) CreateDir(path string) error { return fs.ErrPermission } func (s *rangeSpyFS) CreateFile(path string) (File, error) { return nil, fs.ErrPermission } func (s *rangeSpyFS) OpenFile(path string, flag int) (File, error) { return nil, fs.ErrPermission } @@ -148,6 +156,10 @@ func (s *rangeEmptySpyFS) Stat(path string) (fs.FileInfo, error) { } func (s *rangeEmptySpyFS) DiskUsage(path string) (uint64, uint64, error) { return 0, 0, nil } + +func (s *rangeEmptySpyFS) ShortName(path string) (string, error) { + return filepath.Base(path), nil +} func (s *rangeEmptySpyFS) CreateDir(path string) error { return fs.ErrPermission } func (s *rangeEmptySpyFS) CreateFile(path string) (File, error) { return nil, fs.ErrPermission } func (s *rangeEmptySpyFS) OpenFile(path string, flag int) (File, error) { return nil, fs.ErrPermission } diff --git a/service/afp/file.go b/service/afp/file.go index 1254402..c16c5e0 100644 --- a/service/afp/file.go +++ b/service/afp/file.go @@ -7,8 +7,10 @@ import ( "io" "os" "path/filepath" + "time" "github.com/ObsoleteMadness/ClassicStack/netlog" + "github.com/ObsoleteMadness/ClassicStack/pkg/vfs" ) func (s *Service) handleSetFileParms(req *FPSetFileParmsReq) (*FPSetFileParmsRes, int32) { @@ -53,6 +55,12 @@ func (s *Service) handleCreateFile(req *FPCreateFileReq) (*FPCreateFileRes, int3 } f.Close() } + vfs.DefaultBus.Publish(vfs.Event{ + Op: vfs.OpCreate, + HostPath: targetPath, + Origin: "afp", + Time: time.Now(), + }) return &FPCreateFileRes{}, NoErr } @@ -149,5 +157,12 @@ func (s *Service) handleCopyFile(req *FPCopyFileReq) (*FPCopyFileRes, int32) { } } + vfs.DefaultBus.Publish(vfs.Event{ + Op: vfs.OpCreate, + HostPath: dstPath, + Origin: "afp", + Time: time.Now(), + }) + return &FPCopyFileRes{}, NoErr } diff --git a/service/afp/filedir.go b/service/afp/filedir.go index c634899..021bf7d 100644 --- a/service/afp/filedir.go +++ b/service/afp/filedir.go @@ -6,8 +6,10 @@ import ( "bytes" "io/fs" "path/filepath" + "time" "github.com/ObsoleteMadness/ClassicStack/netlog" + "github.com/ObsoleteMadness/ClassicStack/pkg/vfs" ) func (s *Service) handleGetFileDirParms(req *FPGetFileDirParmsReq) (*FPGetFileDirParmsRes, int32) { @@ -105,6 +107,13 @@ func (s *Service) handleRename(req *FPRenameReq) (*FPRenameRes, int32) { } s.moveAppleDoubleSidecar(oldPath, newPath) s.rebindDIDSubtree(req.VolumeID, oldPath, newPath) + vfs.DefaultBus.Publish(vfs.Event{ + Op: vfs.OpRename, + HostPath: newPath, + OldPath: oldPath, + Origin: "afp", + Time: time.Now(), + }) return &FPRenameRes{}, NoErr } @@ -197,6 +206,12 @@ func (s *Service) handleDelete(req *FPDeleteReq) (*FPDeleteRes, int32) { } s.deleteAppleDoubleSidecar(targetPath) s.removeDIDSubtree(req.VolumeID, targetPath) + vfs.DefaultBus.Publish(vfs.Event{ + Op: vfs.OpDelete, + HostPath: targetPath, + Origin: "afp", + Time: time.Now(), + }) return &FPDeleteRes{}, NoErr } @@ -256,6 +271,13 @@ func (s *Service) handleMoveAndRename(req *FPMoveAndRenameReq) (*FPMoveAndRename } s.moveAppleDoubleSidecar(srcPath, dstPath) s.rebindDIDSubtree(req.VolumeID, srcPath, dstPath) + vfs.DefaultBus.Publish(vfs.Event{ + Op: vfs.OpRename, + HostPath: dstPath, + OldPath: srcPath, + Origin: "afp", + Time: time.Now(), + }) return &FPMoveAndRenameRes{}, NoErr } diff --git a/service/afp/filedir_pack.go b/service/afp/filedir_pack.go index 9b93652..a370f54 100644 --- a/service/afp/filedir_pack.go +++ b/service/afp/filedir_pack.go @@ -181,9 +181,15 @@ func (s *Service) packFileInfo(buf *bytes.Buffer, volumeID uint16, bitmap uint16 s.writeAFPName(&varBuf, name, volumeID) } if bitmap&DirBitmapShortName != 0 { + short := name + if volFS != nil { + if n, err := volFS.ShortName(fullPath); err == nil && n != "" { + short = n + } + } offset := uint16(fixedSize + varBuf.Len()) binutil.WriteU16(buf, offset) - s.writeAFPName(&varBuf, name, volumeID) + s.writeAFPName(&varBuf, short, volumeID) } if bitmap&DirBitmapDirID != 0 { did := s.getPathDID(volumeID, fullPath) @@ -257,9 +263,15 @@ func (s *Service) packFileInfo(buf *bytes.Buffer, volumeID uint16, bitmap uint16 s.writeAFPName(&varBuf, name, volumeID) } if bitmap&FileBitmapShortName != 0 { + short := name + if volFS != nil { + if n, err := volFS.ShortName(fullPath); err == nil && n != "" { + short = n + } + } offset := uint16(fixedSize + varBuf.Len()) binutil.WriteU16(buf, offset) - s.writeAFPName(&varBuf, name, volumeID) + s.writeAFPName(&varBuf, short, volumeID) } if bitmap&FileBitmapFileNum != 0 { did := s.getPathDID(volumeID, fullPath) diff --git a/service/afp/fs.go b/service/afp/fs.go index 68401d3..7a7b1e1 100644 --- a/service/afp/fs.go +++ b/service/afp/fs.go @@ -8,12 +8,14 @@ import ( "maps" "slices" "sync" + + "github.com/ObsoleteMadness/ClassicStack/pkg/vfs" ) // FileSystemFactory constructs a FileSystem from a normalized // VolumeConfig. Backends register themselves with RegisterFS during // package init(). -type FileSystemFactory func(VolumeConfig) (FileSystem, error) +type FileSystemFactory func(VolumeConfig, Options) (FileSystem, error) var ( fsRegistryMu sync.RWMutex @@ -36,14 +38,14 @@ func RegisterFS(name string, f FileSystemFactory) { // NewFS dispatches to the factory registered for cfg.FSType. The // returned error includes the list of registered names when no // factory matches. -func NewFS(cfg VolumeConfig) (FileSystem, error) { +func NewFS(cfg VolumeConfig, opts Options) (FileSystem, error) { fsRegistryMu.RLock() f, ok := fsRegistry[cfg.FSType] fsRegistryMu.RUnlock() if !ok { return nil, fmt.Errorf("afp: no FileSystem registered for fs_type %q (registered: %v)", cfg.FSType, registeredFSNames()) } - return f(cfg) + return f(cfg, opts) } func registeredFSNames() []string { @@ -61,6 +63,7 @@ type FileSystem interface { OpenFile(path string, flag int) (File, error) Remove(path string) error Rename(oldpath, newpath string) error + ShortName(path string) (string, error) Capabilities() FileSystemCapabilities CatSearch(volumeRoot string, query string, reqMatches int32, cursor [16]byte) ([]string, [16]byte, int32) ChildCount(path string) (uint16, error) @@ -80,11 +83,9 @@ type FileSystemCapabilities struct { ReadOnlyState bool } -type File interface { - ReadAt(p []byte, off int64) (n int, err error) - WriteAt(p []byte, off int64) (n int, err error) - Truncate(size int64) error - Close() error - Stat() (fs.FileInfo, error) - Sync() error -} +// File is AFP's per-handle file contract. It is a type alias for the +// shared pkg/vfs.File so that backends registered with pkg/vfs can be +// used here without an extra adapter, and so AFP-side code that +// cares about handle methods compiles against the same interface a +// generic VFS backend implements. +type File = vfs.File diff --git a/service/afp/local_fs.go b/service/afp/local_fs.go index f457620..a4516a7 100644 --- a/service/afp/local_fs.go +++ b/service/afp/local_fs.go @@ -5,70 +5,131 @@ package afp import ( "io/fs" "os" + "sync" + + "github.com/ObsoleteMadness/ClassicStack/pkg/vfs" ) -type LocalFileSystem struct{} +// LocalFileSystem is AFP's local-FS adapter. It composes the shared +// pkg/vfs local backend (consumed through the vfs.FileSystem +// interface, not a concrete type, so AFP stays implementation-agnostic) +// and adds the AFP-specific methods that the cross-service VFS +// contract does not carry — ChildCount, CatSearch, IsReadOnly, etc. +// +// Callers must hand it already-translated UTF-8 host paths; path +// translation (MacRoman, decomposed-name escapes) lives in AFP's +// path codec, not here. +// +// The zero value is usable: the backing vfs.FileSystem is created +// lazily on first call. Production code should construct via the +// FSTypeLocalFS factory so the backend is selected from a Params, +// but tests that build &LocalFileSystem{} directly still work. +type LocalFileSystem struct { + backendOnce sync.Once + backend vfs.FileSystem +} + +func (l *LocalFileSystem) fs() vfs.FileSystem { + l.backendOnce.Do(func() { + if l.backend != nil { + return + } + // The default-constructed backend ignores Params and is + // stateless, so any error here would indicate a missing + // registration; panic so the cause is obvious. + b, err := vfs.New(vfs.LocalFSName, vfs.Params{}) + if err != nil { + panic("afp: vfs.local_fs not registered: " + err.Error()) + } + l.backend = b + }) + return l.backend +} func init() { - RegisterFS(FSTypeLocalFS, func(cfg VolumeConfig) (FileSystem, error) { - return &LocalFileSystem{}, nil + RegisterFS(FSTypeLocalFS, func(cfg VolumeConfig, opts Options) (FileSystem, error) { + base, err := vfs.New(vfs.LocalFSName, vfs.Params{ + Name: cfg.Name, + Path: cfg.Path, + ReadOnly: cfg.ReadOnly, + ShortnameMapper: opts.ShortnameMapper, + }) + if err != nil { + return nil, err + } + l := &LocalFileSystem{} + // Pre-populate the backend so fs() never overwrites it. + l.backendOnce.Do(func() { l.backend = base }) + return l, nil }) } -// LocalFileSystem expects already-converted UTF-8 host paths from AFP service logic. - +// ReadDir delegates to the backing vfs.FileSystem. func (l *LocalFileSystem) ReadDir(path string) ([]fs.DirEntry, error) { - return os.ReadDir(path) + return l.fs().ReadDir(path) } +// Stat delegates to the backing vfs.FileSystem. func (l *LocalFileSystem) Stat(path string) (fs.FileInfo, error) { - return os.Stat(path) + return l.fs().Stat(path) } +// DiskUsage delegates to the backing vfs.FileSystem. func (l *LocalFileSystem) DiskUsage(path string) (totalBytes uint64, freeBytes uint64, err error) { - return diskUsage(path) + return l.fs().DiskUsage(path) } +// CreateDir delegates to the backing vfs.FileSystem. func (l *LocalFileSystem) CreateDir(path string) error { - return os.Mkdir(path, 0755) + return l.fs().CreateDir(path) } +// CreateFile delegates to the backing vfs.FileSystem. func (l *LocalFileSystem) CreateFile(path string) (File, error) { - f, err := os.Create(path) - if err != nil { - return nil, err - } - return f, nil + return l.fs().CreateFile(path) } +// OpenFile delegates to the backing vfs.FileSystem. func (l *LocalFileSystem) OpenFile(path string, flag int) (File, error) { - f, err := os.OpenFile(path, flag, 0644) - if err != nil { - return nil, err - } - return f, nil + return l.fs().OpenFile(path, flag) } +// Remove delegates to the backing vfs.FileSystem. func (l *LocalFileSystem) Remove(path string) error { - return os.Remove(path) // Standard removal (not recursive) + return l.fs().Remove(path) } +// Rename delegates to the backing vfs.FileSystem. func (l *LocalFileSystem) Rename(oldpath, newpath string) error { - return os.Rename(oldpath, newpath) + return l.fs().Rename(oldpath, newpath) +} + +// ShortName delegates to the backing vfs.FileSystem. +func (l *LocalFileSystem) ShortName(path string) (string, error) { + return l.fs().ShortName(path) } +// Capabilities adds AFP-specific extensions on top of whatever the +// underlying backend already advertises. func (l *LocalFileSystem) Capabilities() FileSystemCapabilities { + base := l.fs().Capabilities() return FileSystemCapabilities{ + CatSearch: base.CatSearch, ChildCount: true, + ReadDirRange: base.ReadDirRange, DirAttributes: true, ReadOnlyState: true, } } +// CatSearch is AFP-specific and not provided by the cross-service +// backend; the local adapter declines it. func (l *LocalFileSystem) CatSearch(_ string, _ string, _ int32, cursor [16]byte) ([]string, [16]byte, int32) { return nil, cursor, ErrCallNotSupported } +// ChildCount counts entries in a directory, capped at 0xFFFF for the +// AFP wire format. func (l *LocalFileSystem) ChildCount(path string) (uint16, error) { entries, err := os.ReadDir(path) if err != nil { @@ -80,18 +141,27 @@ func (l *LocalFileSystem) ChildCount(path string) (uint16, error) { return uint16(len(entries)), nil } -func (l *LocalFileSystem) ReadDirRange(path string, startIndex uint16, reqCount uint16) ([]fs.DirEntry, uint16, error) { +// ReadDirRange is unsupported on the local backend; the AFP service +// falls back to ReadDir + paginate. +func (l *LocalFileSystem) ReadDirRange(_ string, _ uint16, _ uint16) ([]fs.DirEntry, uint16, error) { return nil, 0, newNotSupported("ReadDirRange") } +// DirAttributes returns 0 — the local backend has no AFP-native +// directory attribute storage; volumes that need them use AppleDouble. func (l *LocalFileSystem) DirAttributes(_ string) (uint16, error) { return 0, nil } +// IsReadOnly returns false — the local backend does not enforce a +// read-only state at the path level. AFP volumes that need it set +// the per-volume flag in VolumeConfig. func (l *LocalFileSystem) IsReadOnly(_ string) (bool, error) { return false, nil } +// SupportsCatSearch matches Capabilities() — false for the local +// backend. func (l *LocalFileSystem) SupportsCatSearch(_ string) (bool, error) { return false, nil } diff --git a/service/afp/macgarden_fs.go b/service/afp/macgarden_fs.go deleted file mode 100644 index 83ef2e0..0000000 --- a/service/afp/macgarden_fs.go +++ /dev/null @@ -1,1810 +0,0 @@ -//go:build macgarden - -package afp - -import ( - "errors" - "fmt" - "io" - "io/fs" - "net/url" - "os" - "path/filepath" - "sort" - "strings" - "sync" - "time" - "unicode" - - "github.com/ObsoleteMadness/ClassicStack/netlog" - garden "github.com/ObsoleteMadness/ClassicStack/service/macgarden" -) - -const macGardenEnumerateWindow = 10 -const macGardenSearchPageSize = 20 - -type macGardenFileInfo struct { - name string - size int64 - mode fs.FileMode - modTime time.Time - isDir bool -} - -func (i *macGardenFileInfo) Name() string { return i.name } -func (i *macGardenFileInfo) Size() int64 { return i.size } -func (i *macGardenFileInfo) Mode() fs.FileMode { return i.mode } -func (i *macGardenFileInfo) ModTime() time.Time { return i.modTime } -func (i *macGardenFileInfo) IsDir() bool { return i.isDir } -func (i *macGardenFileInfo) Sys() any { return nil } - -type macGardenDirEntry struct{ info fs.FileInfo } - -func (d macGardenDirEntry) Name() string { return d.info.Name() } -func (d macGardenDirEntry) IsDir() bool { return d.info.IsDir() } -func (d macGardenDirEntry) Type() fs.FileMode { return d.info.Mode().Type() } -func (d macGardenDirEntry) Info() (fs.FileInfo, error) { return d.info, nil } - -type macGardenCachedResult struct { - Name string - URL string -} - -type macGardenAsset struct { - Name string - URL string - Size int64 - Content []byte -} - -type macGardenCategoryPageMeta struct { - TotalCount uint16 - PageSize int - LastPageNumber int - LastPageCount int -} - -type macGardenFile struct { - asset macGardenAsset - client *garden.Client -} - -func (f *macGardenFile) ReadAt(p []byte, off int64) (n int, err error) { - if off < 0 { - return 0, fs.ErrInvalid - } - if len(f.asset.Content) > 0 { - if off >= int64(len(f.asset.Content)) { - return 0, io.EOF - } - n = copy(p, f.asset.Content[off:]) - if n < len(p) { - return n, io.EOF - } - return n, nil - } - // ReadURLRange applies the client's maxRangeSize cap internally, so it may - // return fewer bytes than len(p). Signal io.EOF only when the HTTP response - // is shorter than the bytes we actually requested — meaning we hit real EOF, - // not just the range cap. FPRead buffers are already bounded by the same cap - // (via handleRead.maxReadSize), so for that path len(data)==len(p) always. - // FPCopyFile re-reads in a loop, so getting n 0 && requested > max { - requested = max - } - data, readErr := f.client.ReadURLRange(f.asset.URL, off, len(p)) - if readErr != nil { - return 0, fmt.Errorf("%w: %v", ErrCopySourceReadEOF, readErr) - } - n = copy(p, data) - if len(data) < requested { - return n, io.EOF - } - return n, nil -} - -func (f *macGardenFile) WriteAt(_ []byte, _ int64) (n int, err error) { return 0, fs.ErrPermission } -func (f *macGardenFile) Truncate(_ int64) error { return fs.ErrPermission } -func (f *macGardenFile) Close() error { return nil } -func (f *macGardenFile) Sync() error { return nil } -func (f *macGardenFile) Stat() (fs.FileInfo, error) { - size := f.asset.Size - if size == 0 && f.asset.URL != "" { - if s, err := f.client.GetContentLength(f.asset.URL); err == nil { - size = s - } - } - return &macGardenFileInfo{name: filepath.Base(f.asset.Name), size: size, mode: 0o444, modTime: time.Now().UTC()}, nil -} - -// fetchAndCacheScreenshot downloads a screenshot URL and stores it in the -// in-memory cache. Subsequent OpenFile calls serve from cache without network I/O. -func (m *MacGardenFileSystem) fetchAndCacheScreenshot(url string) ([]byte, error) { - m.screenshotMu.RLock() - if data, ok := m.screenshotCache[url]; ok { - m.screenshotMu.RUnlock() - return data, nil - } - m.screenshotMu.RUnlock() - data, err := m.client.FetchFull(url) - if err != nil { - return nil, err - } - m.screenshotMu.Lock() - m.screenshotCache[url] = data - m.screenshotMu.Unlock() - return data, nil -} - -// resolveAssetSize returns the known size, or triggers a size fetch appropriate -// for the asset type. Called during FPGetFileDirParms so Finder sees the real size. -// Screenshots: full download cached in memory (avoids HEAD which gets blocked). -// Downloads: ranged GET to read the Content-Range total only. -func (m *MacGardenFileSystem) resolveAssetSize(a macGardenAsset) int64 { - if a.Size > 0 || a.URL == "" { - return a.Size - } - if strings.HasPrefix(a.Name, "Screenshots/") { - if data, err := m.fetchAndCacheScreenshot(a.URL); err == nil { - return int64(len(data)) - } - return 0 - } - if s, err := m.client.GetContentLength(a.URL); err == nil { - return s - } - return 0 -} - -// MacGardenFileSystem is a read-only virtual filesystem backed by macintoshgarden.org. -type macGardenSearchCache struct { - pages map[int][]garden.SearchResult // pageNumber -> results - exhausted bool // true when all pages have been fetched -} - -type MacGardenFileSystem struct { - root string - client *garden.Client - - mu sync.RWMutex - categories []garden.Category - searchByName map[string]macGardenCachedResult - itemURLByDir map[string]string - itemByURL map[string]*garden.SoftwareItem - itemsInCategory map[string][]garden.SearchResult // categoryURL -> items - categoryItemCount map[string]uint16 - categoryPageMeta map[string]macGardenCategoryPageMeta - categoryPageItems map[string]map[int][]garden.SearchResult - downloadByPath map[string]macGardenAsset - screenshotByPath map[string]macGardenAsset - descriptionByPath map[string]macGardenAsset - catSearchCache map[string]*macGardenSearchCache // normalized query -> cached results - - screenshotMu sync.RWMutex - screenshotCache map[string][]byte // URL -> full image bytes - - stop chan struct{} - stopOnce sync.Once - wg sync.WaitGroup -} - -func init() { - RegisterFS(FSTypeMacGarden, func(cfg VolumeConfig) (FileSystem, error) { - return NewMacGardenFileSystem(filepath.Clean(cfg.Path)), nil - }) -} - -func NewMacGardenFileSystem(root string) *MacGardenFileSystem { - fsys := &MacGardenFileSystem{ - root: filepath.Clean(root), - client: garden.NewClient(), - searchByName: make(map[string]macGardenCachedResult), - itemURLByDir: make(map[string]string), - itemByURL: make(map[string]*garden.SoftwareItem), - itemsInCategory: make(map[string][]garden.SearchResult), - categoryItemCount: make(map[string]uint16), - categoryPageMeta: make(map[string]macGardenCategoryPageMeta), - categoryPageItems: make(map[string]map[int][]garden.SearchResult), - downloadByPath: make(map[string]macGardenAsset), - screenshotByPath: make(map[string]macGardenAsset), - descriptionByPath: make(map[string]macGardenAsset), - catSearchCache: make(map[string]*macGardenSearchCache), - screenshotCache: make(map[string][]byte), - stop: make(chan struct{}), - } - fsys.loadCategories() - return fsys -} - -func (m *MacGardenFileSystem) loadCategories() { - m.mu.RLock() - if len(m.categories) > 0 { - m.mu.RUnlock() - return - } - m.mu.RUnlock() - cats, err := m.client.GetCategories() - if err != nil { - netlog.Warn("[AFP][MacGarden] failed to fetch categories: %v", err) - return - } - sort.Slice(cats, func(i, j int) bool { return strings.ToLower(cats[i].Name) < strings.ToLower(cats[j].Name) }) - m.mu.Lock() - if len(m.categories) == 0 { - m.categories = cats - } - m.mu.Unlock() - if len(cats) == 0 { - netlog.Warn("[AFP][MacGarden] category fetch succeeded but returned no categories") - } -} - -func (m *MacGardenFileSystem) normalize(path string) (string, error) { - clean := filepath.Clean(path) - rel, err := filepath.Rel(m.root, clean) - if err != nil || rel == ".." || strings.HasPrefix(rel, ".."+string(filepath.Separator)) { - return "", fs.ErrPermission - } - if rel == "." { - return "", nil - } - return filepath.ToSlash(rel), nil -} - -// readDirCore resolves a normalized relative path to directory entries. It is -// the shared implementation used by both ReadDir and ReadDirRange. Callers are -// responsible for running it in a goroutine if a timeout is needed. -func (m *MacGardenFileSystem) readDirCore(rel string) ([]fs.DirEntry, error) { - if rel == "" { - netlog.Debug("[AFP][MacGarden] ReadDir root") - return []fs.DirEntry{ - macGardenDirEntry{info: &macGardenFileInfo{name: "Apps", mode: fs.ModeDir | 0o555, isDir: true, modTime: time.Now().UTC()}}, - macGardenDirEntry{info: &macGardenFileInfo{name: "Games", mode: fs.ModeDir | 0o555, isDir: true, modTime: time.Now().UTC()}}, - macGardenDirEntry{info: &macGardenFileInfo{name: "search", mode: fs.ModeDir | 0o555, isDir: true, modTime: time.Now().UTC()}}, - }, nil - } - - parts := strings.Split(rel, "/") - - // Apps or Games level: show categories for that type. - if len(parts) == 1 && (parts[0] == "Apps" || parts[0] == "Games") { - netlog.Debug("[AFP][MacGarden] ReadDir %s", parts[0]) - m.loadCategories() - catType := parts[0] - urlPrefix := "/apps/" - if catType == "Games" { - urlPrefix = "/games/" - } - m.mu.RLock() - defer m.mu.RUnlock() - entries := make([]fs.DirEntry, 0, len(m.categories)) - for _, cat := range m.categories { - if strings.HasPrefix(strings.ToLower(urlPathFromAbsolute(cat.URL)), urlPrefix) { - entries = append(entries, macGardenDirEntry{info: &macGardenFileInfo{name: cat.Name, mode: fs.ModeDir | 0o555, isDir: true, modTime: time.Now().UTC()}}) - } - } - netlog.Info("[AFP][MacGarden] ReadDir %s returning %d entries", catType, len(entries)) - return entries, nil - } - - // /search — list all cached search queries as subdirectories. - if len(parts) == 1 && parts[0] == "search" { - m.mu.RLock() - queries := make([]string, 0, len(m.catSearchCache)) - for q := range m.catSearchCache { - queries = append(queries, q) - } - m.mu.RUnlock() - sort.Strings(queries) - entries := make([]fs.DirEntry, 0, len(queries)) - for _, q := range queries { - entries = append(entries, macGardenDirEntry{info: &macGardenFileInfo{name: q, mode: fs.ModeDir | 0o555, isDir: true, modTime: time.Now().UTC()}}) - } - return entries, nil - } - - // /search/ — list type subdirectories (App, Game) plus untyped items. - if len(parts) == 2 && parts[0] == "search" { - m.mu.RLock() - cache, ok := m.catSearchCache[parts[1]] - m.mu.RUnlock() - if !ok { - return nil, fs.ErrNotExist - } - pageNums := make([]int, 0, len(cache.pages)) - for k := range cache.pages { - pageNums = append(pageNums, k) - } - sort.Ints(pageNums) - typesSeen := map[string]struct{}{} - untypedSeen := map[string]struct{}{} - var typeNames, untypedNames []string - for _, pn := range pageNums { - for _, r := range cache.pages[pn] { - if r.Type != "" { - if _, exists := typesSeen[r.Type]; !exists { - typesSeen[r.Type] = struct{}{} - typeNames = append(typeNames, r.Type) - } - } else { - if name := sanitizeGardenName(r.Name); name != "" { - if _, exists := untypedSeen[name]; !exists { - untypedSeen[name] = struct{}{} - untypedNames = append(untypedNames, name) - } - } - } - } - } - sort.Strings(typeNames) - sort.Strings(untypedNames) - entries := make([]fs.DirEntry, 0, len(typeNames)+len(untypedNames)) - for _, name := range typeNames { - entries = append(entries, macGardenDirEntry{info: &macGardenFileInfo{name: name, mode: fs.ModeDir | 0o555, isDir: true, modTime: time.Now().UTC()}}) - } - for _, name := range untypedNames { - entries = append(entries, macGardenDirEntry{info: &macGardenFileInfo{name: name, mode: fs.ModeDir | 0o555, isDir: true, modTime: time.Now().UTC()}}) - } - return entries, nil - } - - // /search// — virtual type subdirectory (App/Game). - if len(parts) == 3 && parts[0] == "search" && isSearchResultType(parts[2]) { - m.mu.RLock() - cache, ok := m.catSearchCache[parts[1]] - m.mu.RUnlock() - if !ok { - return nil, fs.ErrNotExist - } - resultType := parts[2] - var names []string - for _, page := range cache.pages { - for _, r := range page { - if r.Type == resultType { - if name := sanitizeGardenName(r.Name); name != "" { - names = append(names, name) - } - } - } - } - sort.Strings(names) - entries := make([]fs.DirEntry, 0, len(names)) - for _, name := range names { - entries = append(entries, macGardenDirEntry{info: &macGardenFileInfo{name: name, mode: fs.ModeDir | 0o555, isDir: true, modTime: time.Now().UTC()}}) - } - return entries, nil - } - - // /search// — assets for that item. - if len(parts) == 3 && parts[0] == "search" { - itemName := parts[2] - m.mu.RLock() - search, ok := m.searchByName[itemName] - m.mu.RUnlock() - if !ok { - return nil, fs.ErrNotExist - } - if err := m.ensureItemForDir(itemName, search.URL); err != nil { - return nil, err - } - assets, err := m.itemAssetsByDir(itemName) - if err != nil { - return nil, err - } - return buildItemDirEntries(assets, ""), nil - } - - // /search///[/] — typed item or its subdirectory. - if len(parts) >= 4 && parts[0] == "search" && isSearchResultType(parts[2]) { - itemName := parts[3] - subPath := filepath.ToSlash(filepath.Join(parts[4:]...)) - m.mu.RLock() - search, ok := m.searchByName[itemName] - m.mu.RUnlock() - if !ok { - return nil, fs.ErrNotExist - } - if err := m.ensureItemForDir(itemName, search.URL); err != nil { - return nil, err - } - assets, err := m.itemAssetsByDir(itemName) - if err != nil { - return nil, err - } - return buildItemDirEntries(assets, subPath), nil - } - - // /search/// — subdirectory within an item. - if len(parts) >= 4 && parts[0] == "search" { - itemName := parts[2] - subPath := filepath.ToSlash(filepath.Join(parts[3:]...)) - m.mu.RLock() - search, ok := m.searchByName[itemName] - m.mu.RUnlock() - if !ok { - return nil, fs.ErrNotExist - } - if err := m.ensureItemForDir(itemName, search.URL); err != nil { - return nil, err - } - assets, err := m.itemAssetsByDir(itemName) - if err != nil { - return nil, err - } - return buildItemDirEntries(assets, subPath), nil - } - - // Apps/Games/CategoryName/ItemName — assets for a software item - if len(parts) == 3 && (parts[0] == "Apps" || parts[0] == "Games") { - catName, itemName := parts[1], parts[2] - catURL := m.getCategoryURL(catName) - if catURL == "" { - return nil, fs.ErrNotExist - } - itemURL, err := m.getItemURLInCategory(catURL, itemName) - if err != nil { - return nil, fs.ErrNotExist - } - if err := m.ensureItemForDir(itemName, itemURL); err != nil { - return nil, err - } - assets, err := m.itemAssetsByDir(itemName) - if err != nil { - return nil, err - } - return buildItemDirEntries(assets, ""), nil - } - - // Apps/Games/CategoryName/ItemName/SubDir... — subdirectory within an item - if len(parts) >= 4 && (parts[0] == "Apps" || parts[0] == "Games") { - catName, itemName := parts[1], parts[2] - subPath := filepath.ToSlash(filepath.Join(parts[3:]...)) - catURL := m.getCategoryURL(catName) - if catURL == "" { - return nil, fs.ErrNotExist - } - itemURL, err := m.getItemURLInCategory(catURL, itemName) - if err != nil { - return nil, fs.ErrNotExist - } - if err := m.ensureItemForDir(itemName, itemURL); err != nil { - return nil, err - } - assets, err := m.itemAssetsByDir(itemName) - if err != nil { - return nil, err - } - return buildItemDirEntries(assets, subPath), nil - } - - return nil, fs.ErrNotExist -} - -func (m *MacGardenFileSystem) ReadDir(path string) ([]fs.DirEntry, error) { - rel, err := m.normalize(path) - if err != nil { - return nil, err - } - return m.readDirCore(rel) -} - -func (m *MacGardenFileSystem) ReadDirRange(path string, startIndex uint16, reqCount uint16) ([]fs.DirEntry, uint16, error) { - if reqCount == 0 { - return nil, 0, nil - } - rel, err := m.normalize(path) - if err != nil { - return nil, 0, err - } - parts := strings.Split(rel, "/") - if len(parts) == 1 && (parts[0] == "Apps" || parts[0] == "Games") { - m.loadCategories() - prefix := "/apps/" - if parts[0] == "Games" { - prefix = "/games/" - } - m.mu.RLock() - filtered := make([]fs.DirEntry, 0, len(m.categories)) - for _, cat := range m.categories { - if strings.HasPrefix(strings.ToLower(urlPathFromAbsolute(cat.URL)), prefix) { - filtered = append(filtered, macGardenDirEntry{info: &macGardenFileInfo{name: cat.Name, mode: fs.ModeDir | 0o555, isDir: true, modTime: time.Now().UTC()}}) - } - } - m.mu.RUnlock() - total := uint16(len(filtered)) - if startIndex < 1 { - startIndex = 1 - } - if int(startIndex) > len(filtered) { - return nil, total, nil - } - start := int(startIndex) - 1 - end := start + int(reqCount) - if end > len(filtered) { - end = len(filtered) - } - return append([]fs.DirEntry(nil), filtered[start:end]...), total, nil - } - if len(parts) == 2 && (parts[0] == "Apps" || parts[0] == "Games") { - catURL := m.getCategoryURL(parts[1]) - if catURL == "" { - return nil, 0, fs.ErrNotExist - } - return m.readCategoryDirRange(catURL, startIndex, reqCount) - } - entries, err := m.readDirCore(rel) - if err != nil { - return nil, 0, err - } - total := uint16(len(entries)) - if startIndex < 1 { - startIndex = 1 - } - if int(startIndex) > len(entries) { - return nil, total, nil - } - start := int(startIndex) - 1 - end := start + int(reqCount) - if end > len(entries) { - end = len(entries) - } - return append([]fs.DirEntry(nil), entries[start:end]...), total, nil -} - -func (m *MacGardenFileSystem) Stat(path string) (fs.FileInfo, error) { - rel, err := m.normalize(path) - if err != nil { - return nil, err - } - if rel == "" { - return &macGardenFileInfo{name: filepath.Base(m.root), mode: fs.ModeDir | 0o555, isDir: true, modTime: time.Now().UTC()}, nil - } - - parts := strings.Split(rel, "/") - - // Apps or Games level - if len(parts) == 1 && (parts[0] == "Apps" || parts[0] == "Games") { - return &macGardenFileInfo{name: parts[0], mode: fs.ModeDir | 0o555, isDir: true, modTime: time.Now().UTC()}, nil - } - - // /search virtual directory - if len(parts) == 1 && parts[0] == "search" { - return &macGardenFileInfo{name: "search", mode: fs.ModeDir | 0o555, isDir: true, modTime: time.Now().UTC()}, nil - } - - // /search/ - if len(parts) == 2 && parts[0] == "search" { - m.mu.RLock() - _, ok := m.catSearchCache[parts[1]] - m.mu.RUnlock() - if ok { - return &macGardenFileInfo{name: parts[1], mode: fs.ModeDir | 0o555, isDir: true, modTime: time.Now().UTC()}, nil - } - return nil, fs.ErrNotExist - } - - // /search// — virtual type subdirectory (App/Game) - // /search// — item directory - if len(parts) == 3 && parts[0] == "search" { - if isSearchResultType(parts[2]) { - return &macGardenFileInfo{name: parts[2], mode: fs.ModeDir | 0o555, isDir: true, modTime: time.Now().UTC()}, nil - } - itemName := parts[2] - m.mu.RLock() - cache, ok := m.catSearchCache[parts[1]] - m.mu.RUnlock() - if !ok { - return nil, fs.ErrNotExist - } - for _, page := range cache.pages { - for _, r := range page { - if sanitizeGardenName(r.Name) == itemName { - return &macGardenFileInfo{name: itemName, mode: fs.ModeDir | 0o555, isDir: true, modTime: time.Now().UTC()}, nil - } - } - } - return nil, fs.ErrNotExist - } - - // /search///[/] or /search/// - if len(parts) >= 4 && parts[0] == "search" { - var itemName, fileName string - if isSearchResultType(parts[2]) { - itemName = parts[3] - fileName = strings.Join(parts[4:], "/") - } else { - itemName = parts[2] - fileName = strings.Join(parts[3:], "/") - } - if fileName == "" { - // It's the item directory itself under a type subdirectory - return &macGardenFileInfo{name: itemName, mode: fs.ModeDir | 0o555, isDir: true, modTime: time.Now().UTC()}, nil - } - m.mu.RLock() - search, ok := m.searchByName[itemName] - loaded := false - if ok { - _, loaded = m.itemByURL[search.URL] - } - m.mu.RUnlock() - if !ok || !loaded { - return nil, fs.ErrNotExist - } - assets, err := m.itemAssetsByDir(itemName) - if err != nil { - return nil, err - } - for _, a := range assets { - if a.Name == fileName { - return &macGardenFileInfo{name: filepath.Base(a.Name), size: m.resolveAssetSize(a), mode: 0o444, modTime: time.Now().UTC()}, nil - } - } - prefix := fileName + "/" - for _, a := range assets { - if strings.HasPrefix(a.Name, prefix) { - return &macGardenFileInfo{name: filepath.Base(fileName), mode: fs.ModeDir | 0o555, isDir: true, modTime: time.Now().UTC()}, nil - } - } - return nil, fs.ErrNotExist - } - - // Search-hit item directory at root level (legacy, retained for compatibility). - if len(parts) == 1 { - m.mu.RLock() - _, ok := m.searchByName[parts[0]] - m.mu.RUnlock() - if ok { - return &macGardenFileInfo{name: parts[0], mode: fs.ModeDir | 0o555, isDir: true, modTime: time.Now().UTC()}, nil - } - } - - // Category level - return immediately without fetching items - // Stat should be lightweight; items are fetched lazily only on ReadDir - if len(parts) == 2 && (parts[0] == "Apps" || parts[0] == "Games") { - catName := parts[1] - catURL := m.getCategoryURL(catName) - if catURL != "" { - netlog.Debug("[AFP][MacGarden] Stat returning category (no lazy fetch): %s", catName) - return &macGardenFileInfo{name: catName, mode: fs.ModeDir | 0o555, isDir: true, modTime: time.Now().UTC()}, nil - } - return nil, fs.ErrNotExist - } - - // Item level - return immediately without fetching items - if len(parts) == 3 && (parts[0] == "Apps" || parts[0] == "Games") { - itemName := parts[2] - // Don't fetch the item here; just return dir info - // Real items are fetched lazily when ReadDir is called - netlog.Debug("[AFP][MacGarden] Stat returning item (no lazy fetch): %s", itemName) - return &macGardenFileInfo{name: itemName, mode: fs.ModeDir | 0o555, isDir: true, modTime: time.Now().UTC()}, nil - } - - // macOS probes certain well-known system paths on every directory it visits. - // Reject them quickly so we never trigger network fetches for them. - macSystemNames := map[string]bool{ - "Configuration": true, - "Network Trash Folder": true, - "TheVolumeSettingsFolder": true, - "Temporary Items": true, - ".DS_Store": true, - "Icon\r": true, - } - if len(parts) >= 3 && macSystemNames[parts[len(parts)-1]] { - return nil, fs.ErrNotExist - } - - // Asset level (file) - if len(parts) >= 4 && (parts[0] == "Apps" || parts[0] == "Games") { - catName := parts[1] - itemName := parts[2] - fileName := strings.Join(parts[3:], "/") - - catURL := m.getCategoryURL(catName) - if catURL == "" { - return nil, fs.ErrNotExist - } - - itemURL, err := m.getItemURLInCategory(catURL, itemName) - if err != nil { - return nil, fs.ErrNotExist - } - - // Keep Stat lazy for item children: if the item has not been opened yet, - // do not fetch details just to probe a potential child path. - m.mu.RLock() - _, loaded := m.itemByURL[itemURL] - m.mu.RUnlock() - if !loaded { - return nil, fs.ErrNotExist - } - - assets, err := m.itemAssetsByDir(itemName) - if err != nil { - return nil, err - } - - for _, a := range assets { - if a.Name == fileName { - return &macGardenFileInfo{name: filepath.Base(a.Name), size: m.resolveAssetSize(a), mode: 0o444, modTime: time.Now().UTC()}, nil - } - } - prefix := fileName + "/" - for _, a := range assets { - if strings.HasPrefix(a.Name, prefix) { - return &macGardenFileInfo{name: filepath.Base(fileName), mode: fs.ModeDir | 0o555, isDir: true, modTime: time.Now().UTC()}, nil - } - } - } - - // Asset-level file under root search-hit item dir: ItemName/Asset - if len(parts) >= 2 && parts[0] != "Apps" && parts[0] != "Games" { - itemName := parts[0] - fileName := filepath.Join(parts[1:]...) - m.mu.RLock() - search, ok := m.searchByName[itemName] - loaded := false - if ok { - _, loaded = m.itemByURL[search.URL] - } - m.mu.RUnlock() - if !ok || !loaded { - return nil, fs.ErrNotExist - } - assets, err := m.itemAssetsByDir(itemName) - if err != nil { - return nil, err - } - for _, a := range assets { - if a.Name == fileName { - return &macGardenFileInfo{name: a.Name, size: a.Size, mode: 0o444, modTime: time.Now().UTC()}, nil - } - } - } - - return nil, fs.ErrNotExist -} - -func (m *MacGardenFileSystem) DiskUsage(_ string) (totalBytes uint64, freeBytes uint64, err error) { - return 0x20000000, 0x18000000, nil -} - -func (m *MacGardenFileSystem) ChildCount(path string) (uint16, error) { - rel, err := m.normalize(path) - if err != nil { - return 0, err - } - if rel == "" { - return 3, nil // Apps + Games + search - } - - m.loadCategories() - parts := strings.Split(rel, "/") - if len(parts) == 1 { - switch parts[0] { - case "Apps": - return m.countCategoriesWithPrefix("/apps/"), nil - case "Games": - return m.countCategoriesWithPrefix("/games/"), nil - } - } - if len(parts) == 2 && (parts[0] == "Apps" || parts[0] == "Games") { - catURL := m.getCategoryURL(parts[1]) - if catURL == "" { - return 0, nil - } - m.mu.RLock() - if count, ok := m.categoryItemCount[catURL]; ok { - m.mu.RUnlock() - return count, nil - } - m.mu.RUnlock() - // Category counts must remain fully lazy. Until a category has actually - // been opened and its items fetched, report an unknown count as zero - // rather than triggering remote requests during parent directory enumerate. - return 0, nil - } - if len(parts) == 3 && (parts[0] == "Apps" || parts[0] == "Games") { - itemName := parts[2] - m.mu.RLock() - itemURL := m.itemURLByDir[itemName] - item := m.itemByURL[itemURL] - m.mu.RUnlock() - if item == nil { - return 0, nil - } - assets, err := m.itemAssetsByDir(itemName) - if err != nil { - return 0, nil - } - return uint16(len(buildItemDirEntries(assets, ""))), nil - } - if len(parts) >= 4 && (parts[0] == "Apps" || parts[0] == "Games") { - itemName := parts[2] - subPath := strings.Join(parts[3:], "/") - m.mu.RLock() - itemURL := m.itemURLByDir[itemName] - item := m.itemByURL[itemURL] - m.mu.RUnlock() - if item == nil { - return 0, nil - } - assets, err := m.itemAssetsByDir(itemName) - if err != nil { - return 0, nil - } - return uint16(len(buildItemDirEntries(assets, subPath))), nil - } - if len(parts) >= 1 && parts[0] == "search" { - switch len(parts) { - case 1: - // /search — number of cached queries. - m.mu.RLock() - n := uint16(len(m.catSearchCache)) - m.mu.RUnlock() - return n, nil - case 2: - // /search/ — count distinct type dirs + untyped items. - m.mu.RLock() - cache, ok := m.catSearchCache[parts[1]] - m.mu.RUnlock() - if !ok { - return 0, nil - } - typesSeen := map[string]struct{}{} - untypedSeen := map[string]struct{}{} - for _, page := range cache.pages { - for _, r := range page { - if r.Type != "" { - typesSeen[r.Type] = struct{}{} - } else if name := sanitizeGardenName(r.Name); name != "" { - untypedSeen[name] = struct{}{} - } - } - } - return clampGardenCount(len(typesSeen) + len(untypedSeen)), nil - case 3: - // /search// — count items of that type. - if isSearchResultType(parts[2]) { - m.mu.RLock() - cache, ok := m.catSearchCache[parts[1]] - m.mu.RUnlock() - if !ok { - return 0, nil - } - seen := map[string]struct{}{} - for _, page := range cache.pages { - for _, r := range page { - if r.Type == parts[2] { - if name := sanitizeGardenName(r.Name); name != "" { - seen[name] = struct{}{} - } - } - } - } - return clampGardenCount(len(seen)), nil - } - // /search// — offspring count for item root. - itemName := parts[2] - m.mu.RLock() - itemURL := m.itemURLByDir[itemName] - item := m.itemByURL[itemURL] - m.mu.RUnlock() - if item == nil { - return 0, nil - } - assets, err := m.itemAssetsByDir(itemName) - if err != nil { - return 0, nil - } - return uint16(len(buildItemDirEntries(assets, ""))), nil - default: - // /search///[/] or /search/// - var itemName, subPath string - if isSearchResultType(parts[2]) { - itemName = parts[3] - subPath = strings.Join(parts[4:], "/") - } else { - itemName = parts[2] - subPath = strings.Join(parts[3:], "/") - } - m.mu.RLock() - itemURL := m.itemURLByDir[itemName] - item := m.itemByURL[itemURL] - m.mu.RUnlock() - if item == nil { - return 0, nil - } - assets, err := m.itemAssetsByDir(itemName) - if err != nil { - return 0, nil - } - return uint16(len(buildItemDirEntries(assets, subPath))), nil - } - } - if len(parts) == 1 { - return 0, nil - } - return 0, newNotSupported("ChildCount") -} - -// DirAttributes returns AFP directory attribute bits for a path. -// /search is flagged invisible so it stays hidden from normal Finder browsing. -func (m *MacGardenFileSystem) DirAttributes(path string) (uint16, error) { - rel, err := m.normalize(path) - if err != nil { - return 0, err - } - if rel == "search" { - return DirAttrInvisible, nil - } - return 0, nil -} - -func (m *MacGardenFileSystem) IsReadOnly(_ string) (bool, error) { - return true, nil -} - -// SetMaxRangeSize limits each HTTP range request to at most n bytes. -// Called by the AFP service with the ASP quantum size so that reads from -// macintoshgarden.org never exceed what can fit in one ASP reply. -func (m *MacGardenFileSystem) SetMaxRangeSize(n int) { - m.client.SetMaxRangeSize(n) -} - -func (m *MacGardenFileSystem) SupportsCatSearch(_ string) (bool, error) { - return true, nil -} - -func (m *MacGardenFileSystem) Capabilities() FileSystemCapabilities { - return FileSystemCapabilities{ - CatSearch: true, - ChildCount: true, - ReadDirRange: true, - DirAttributes: true, - ReadOnlyState: true, - } -} - -func (m *MacGardenFileSystem) Close() error { - m.stopOnce.Do(func() { close(m.stop) }) - m.wg.Wait() - return nil -} - -func (m *MacGardenFileSystem) CreateDir(_ string) error { return fs.ErrPermission } -func (m *MacGardenFileSystem) CreateFile(_ string) (File, error) { return nil, fs.ErrPermission } -func (m *MacGardenFileSystem) Remove(_ string) error { return fs.ErrPermission } -func (m *MacGardenFileSystem) Rename(_, _ string) error { return fs.ErrPermission } - -// openAsset wraps an asset in a macGardenFile, populating Content from the -// in-memory screenshot cache when the image has already been downloaded. -func (m *MacGardenFileSystem) openAsset(a macGardenAsset) *macGardenFile { - if strings.HasPrefix(a.Name, "Screenshots/") && a.URL != "" && len(a.Content) == 0 { - m.screenshotMu.RLock() - data, ok := m.screenshotCache[a.URL] - m.screenshotMu.RUnlock() - if ok { - a.Content = data - a.Size = int64(len(data)) - } - } - return &macGardenFile{asset: a, client: m.client} -} - -func (m *MacGardenFileSystem) OpenFile(path string, flag int) (File, error) { - if flag&(os.O_WRONLY|os.O_RDWR|os.O_APPEND|os.O_CREATE|os.O_TRUNC) != 0 { - return nil, fs.ErrPermission - } - rel, err := m.normalize(path) - if err != nil { - return nil, err - } - - parts := strings.Split(rel, "/") - - // /search//[/]/ - if len(parts) >= 4 && parts[0] == "search" { - var itemName, fileName string - if isSearchResultType(parts[2]) { - if len(parts) < 5 { - return nil, fs.ErrInvalid - } - itemName = parts[3] - fileName = strings.Join(parts[4:], "/") - } else { - itemName = parts[2] - fileName = strings.Join(parts[3:], "/") - } - m.mu.RLock() - search, ok := m.searchByName[itemName] - m.mu.RUnlock() - if !ok { - return nil, fs.ErrNotExist - } - if err := m.ensureItemForDir(itemName, search.URL); err != nil { - return nil, fs.ErrNotExist - } - assets, err := m.itemAssetsByDir(itemName) - if err != nil { - return nil, err - } - for _, a := range assets { - if a.Name == fileName { - return m.openAsset(a), nil - } - } - return nil, fs.ErrNotExist - } - - // Must be asset level: Apps/Category/Item/Asset or deeper - if len(parts) < 4 || (parts[0] != "Apps" && parts[0] != "Games") { - return nil, fs.ErrInvalid - } - - catName := parts[1] - itemName := parts[2] - fileName := strings.Join(parts[3:], "/") - - catURL := m.getCategoryURL(catName) - if catURL == "" { - return nil, fs.ErrNotExist - } - - itemURL, err := m.getItemURLInCategory(catURL, itemName) - if err != nil { - return nil, fs.ErrNotExist - } - - if err := m.ensureItemForDir(itemName, itemURL); err != nil { - return nil, fs.ErrNotExist - } - - assets, err := m.itemAssetsByDir(itemName) - if err != nil { - return nil, err - } - - for _, a := range assets { - if a.Name == fileName { - return m.openAsset(a), nil - } - } - return nil, fs.ErrNotExist -} - -func (m *MacGardenFileSystem) CatSearch(_ string, query string, reqMatches int32, cursor [16]byte) ([]string, [16]byte, int32) { - rawQuery := strings.TrimSpace(query) - if rawQuery == "" { - return nil, cursor, ErrParamErr - } - normalizedQuery := normalizeMacGardenSearchQuery(rawQuery) - if normalizedQuery == "" { - return nil, cursor, ErrParamErr - } - - limit := int(reqMatches) - if limit <= 0 { - limit = 25 - } - - isContinuation := cursor[0] == 0x01 - cursorQueryHash := uint32(cursor[1])<<16 | uint32(cursor[2])<<8 | uint32(cursor[3]) - cursorOffset := uint32(cursor[4])<<24 | uint32(cursor[5])<<16 | uint32(cursor[6])<<8 | uint32(cursor[7]) - - queryHash := uint32(0) - if len(normalizedQuery) >= 3 { - queryHash = uint32(normalizedQuery[0])<<16 | uint32(normalizedQuery[1])<<8 | uint32(normalizedQuery[2]) - } else if len(normalizedQuery) > 0 { - for i := 0; i < len(normalizedQuery); i++ { - queryHash = (queryHash << 8) | uint32(normalizedQuery[i]) - } - } - - startIdx := 0 - if isContinuation && cursorQueryHash == queryHash { - startIdx = int(cursorOffset) - } else { - netlog.Debug("[MacGarden][CatSearch] starting new search for %q", normalizedQuery) - } - - // Determine which page startIdx falls on and skip to the right entry within it. - firstPage := startIdx / macGardenSearchPageSize - skipInFirst := startIdx % macGardenSearchPageSize - - type hit struct { - result garden.SearchResult - name string - } - hits := make([]hit, 0, limit) - exhausted := false - - for pageNum := firstPage; len(hits) < limit; pageNum++ { - m.ensureSearchPage(normalizedQuery, pageNum) - - m.mu.RLock() - cache := m.catSearchCache[normalizedQuery] - var page []garden.SearchResult - if cache != nil { - page = cache.pages[pageNum] - exhausted = cache.exhausted - } - m.mu.RUnlock() - - if len(page) == 0 { - break - } - - skip := 0 - if pageNum == firstPage { - skip = skipInFirst - } - for i := skip; i < len(page) && len(hits) < limit; i++ { - name := sanitizeGardenName(page[i].Name) - if name != "" { - hits = append(hits, hit{result: page[i], name: name}) - } - } - - if len(page) < macGardenSearchPageSize || exhausted { - break - } - } - - netlog.Debug("[MacGarden][CatSearch] query=%q startIdx=%d firstPage=%d skip=%d returned=%d exhausted=%v", - normalizedQuery, startIdx, firstPage, skipInFirst, len(hits), exhausted) - - paths := make([]string, 0, len(hits)) - m.mu.Lock() - for _, h := range hits { - dir := h.name - if h.result.Type != "" { - dir = filepath.Join(h.result.Type, h.name) - } - paths = append(paths, filepath.Join(m.root, "search", normalizedQuery, dir)) - m.searchByName[h.name] = macGardenCachedResult{Name: h.result.Name, URL: h.result.URL} - m.itemURLByDir[h.name] = h.result.URL - } - m.mu.Unlock() - - moreAvailable := len(hits) == limit || !exhausted - - nextCursor := [16]byte{} - nextCursor[1] = byte((queryHash >> 16) & 0xFF) - nextCursor[2] = byte((queryHash >> 8) & 0xFF) - nextCursor[3] = byte(queryHash & 0xFF) - if moreAvailable { - nextCursor[0] = 0x01 - nextOffset := uint32(startIdx + len(hits)) - nextCursor[4] = byte((nextOffset >> 24) & 0xFF) - nextCursor[5] = byte((nextOffset >> 16) & 0xFF) - nextCursor[6] = byte((nextOffset >> 8) & 0xFF) - nextCursor[7] = byte(nextOffset & 0xFF) - } - - return paths, nextCursor, NoErr -} - -// ensureSearchPage fetches a single MacGarden search page into the cache if it -// is not already there. Marks the cache exhausted when the page is partial -// (fewer than macGardenSearchPageSize items) or returns an error. -func (m *MacGardenFileSystem) ensureSearchPage(normalizedQuery string, pageNum int) { - m.mu.RLock() - cache, ok := m.catSearchCache[normalizedQuery] - if ok { - if _, cached := cache.pages[pageNum]; cached { - m.mu.RUnlock() - return - } - if cache.exhausted { - m.mu.RUnlock() - return - } - } - m.mu.RUnlock() - - netlog.Debug("[MacGarden][CatSearch] fetching search page %d for %q", pageNum, normalizedQuery) - pageResults, err := m.client.GetSearchPage(normalizedQuery, pageNum) - - m.mu.Lock() - cache, ok = m.catSearchCache[normalizedQuery] - if !ok { - cache = &macGardenSearchCache{pages: make(map[int][]garden.SearchResult)} - } - if _, alreadyCached := cache.pages[pageNum]; !alreadyCached { - if err != nil { - netlog.Warn("[MacGarden][CatSearch] page %d fetch failed for %q: %v", pageNum, normalizedQuery, err) - cache.exhausted = true - } else { - cache.pages[pageNum] = pageResults - if len(pageResults) < macGardenSearchPageSize { - netlog.Debug("[MacGarden][CatSearch] page %d: %d results for %q (last page)", pageNum, len(pageResults), normalizedQuery) - cache.exhausted = true - } else { - netlog.Debug("[MacGarden][CatSearch] page %d: %d results for %q", pageNum, len(pageResults), normalizedQuery) - } - } - m.catSearchCache[normalizedQuery] = cache - } - m.mu.Unlock() -} - -func normalizeMacGardenSearchQuery(s string) string { - s = strings.TrimSpace(s) - if s == "" { - return "" - } - lower := strings.ToLower(s) - for _, marker := range []string{" type:app,game", " type:app", " type:game", "type:app,game", "type:app", "type:game"} { - if idx := strings.Index(lower, marker); idx >= 0 { - s = s[:idx] - lower = strings.ToLower(s) - } - } - quoted := extractQuotedSegments(s) - if len(quoted) > 0 { - best := "" - bestScore := -1 - for _, q := range quoted { - cand := cleanMacGardenCandidate(q) - score := 0 - for _, r := range cand { - if unicode.IsLetter(r) || unicode.IsDigit(r) { - score++ - } - } - if score > bestScore { - bestScore = score - best = cand - } - } - if best != "" { - return best - } - } - return cleanMacGardenCandidate(s) -} - -func mirrorFolderForURL(rawURL string) string { - u, err := url.Parse(rawURL) - if err != nil { - return "mirror-unknown" - } - switch strings.ToLower(u.Host) { - case "old.mac.gdn": - return "mirror-old" - case "download.macintoshgarden.org": - return "mirror-download" - default: - return "mirror-unknown" - } -} - -func buildItemDirEntries(assets []macGardenAsset, subPath string) []fs.DirEntry { - subPath = strings.Trim(strings.ReplaceAll(subPath, "\\", "/"), "/") - dirSeen := make(map[string]struct{}) - fileSeen := make(map[string]struct{}) - entries := make([]fs.DirEntry, 0, len(assets)) - - for _, a := range assets { - name := strings.Trim(strings.ReplaceAll(a.Name, "\\", "/"), "/") - if name == "" { - continue - } - if subPath != "" { - prefix := subPath + "/" - if !strings.HasPrefix(name, prefix) { - continue - } - name = strings.TrimPrefix(name, prefix) - if name == "" { - continue - } - } - - if idx := strings.Index(name, "/"); idx >= 0 { - dirName := name[:idx] - if dirName == "" { - continue - } - if _, ok := dirSeen[dirName]; ok { - continue - } - dirSeen[dirName] = struct{}{} - entries = append(entries, macGardenDirEntry{info: &macGardenFileInfo{name: dirName, mode: fs.ModeDir | 0o555, isDir: true, modTime: time.Now().UTC()}}) - continue - } - - if _, ok := fileSeen[name]; ok { - continue - } - fileSeen[name] = struct{}{} - entries = append(entries, macGardenDirEntry{info: &macGardenFileInfo{name: name, size: a.Size, mode: 0o444, modTime: time.Now().UTC()}}) - } - - sort.Slice(entries, func(i, j int) bool { - return strings.ToLower(entries[i].Name()) < strings.ToLower(entries[j].Name()) - }) - return entries -} - -func cleanMacGardenCandidate(s string) string { - s = strings.NewReplacer("$", "", "@", " ", "\"", " ").Replace(s) - s = strings.TrimSpace(s) - s = strings.Trim(s, ".,:;()[]{}<>' ") - s = strings.Join(strings.Fields(s), " ") - if s == "" || s == "." { - return "" - } - return s -} - -func extractQuotedSegments(s string) []string { - segments := make([]string, 0, 2) - start := -1 - for i, r := range s { - if r != '"' { - continue - } - if start < 0 { - start = i + 1 - continue - } - if start <= i { - segments = append(segments, s[start:i]) - } - start = -1 - } - return segments -} - -func (m *MacGardenFileSystem) ensureItemForDir(dirName string, fallbackURL string) error { - dirName = strings.TrimSpace(pathBase(dirName)) - if dirName == "" { - return fs.ErrNotExist - } - m.mu.RLock() - itemURL := m.itemURLByDir[dirName] - m.mu.RUnlock() - if itemURL == "" { - itemURL = fallbackURL - } - if itemURL == "" { - return fs.ErrNotExist - } - - m.mu.RLock() - _, ok := m.itemByURL[itemURL] - m.mu.RUnlock() - if ok { - return nil - } - - item, err := m.client.GetSoftwareItem(itemURL) - if err != nil { - return err - } - m.mu.Lock() - m.itemByURL[itemURL] = item - m.itemURLByDir[dirName] = itemURL - m.mu.Unlock() - return nil -} - -func (m *MacGardenFileSystem) itemAssetsByDir(dirName string) ([]macGardenAsset, error) { - dirName = pathBase(dirName) - m.mu.RLock() - itemURL := m.itemURLByDir[dirName] - item := m.itemByURL[itemURL] - m.mu.RUnlock() - if itemURL == "" || item == nil { - return nil, fs.ErrNotExist - } - - netlog.Info("[AFP][MacGarden] building assets for %q: %d screenshot(s), %d download group(s)", dirName, len(item.Screenshots), len(item.Downloads)) - assets := make([]macGardenAsset, 0, len(item.Downloads)+len(item.Screenshots)+2) - txtPath := filepath.Join(dirName, "Description.txt") - htmlPath := filepath.Join(dirName, "Description.html") - descMac := strings.ReplaceAll(item.Description, "\n", "\r") - txtBytes := []byte(descMac) - htmlBytes := []byte("
" + htmlEscape(item.Description) + "
") - assets = append(assets, - macGardenAsset{Name: "Description.txt", Content: txtBytes, Size: int64(len(txtBytes))}, - macGardenAsset{Name: "Description.html", Content: htmlBytes, Size: int64(len(htmlBytes))}, - ) - - m.mu.Lock() - m.descriptionByPath[txtPath] = assets[0] - m.descriptionByPath[htmlPath] = assets[1] - m.mu.Unlock() - - // For each URL use the cached size if available; collect uncached URLs for - // background probing so this function never blocks on network I/O. - var needsProbe []string - - shotIdx := 1 - for _, shotURL := range item.Screenshots { - if !strings.HasPrefix(shotURL, "http://") && !strings.HasPrefix(shotURL, "https://") { - continue - } - name := fmt.Sprintf("Screenshots/Screenshot %02d %s", shotIdx, garden.FileNameFromURL(shotURL, "image")) - size, cached := m.client.CachedContentLength(shotURL) - if !cached { - netlog.Debug("[AFP][MacGarden] screenshot %d/%d not yet cached, will probe in background", shotIdx, len(item.Screenshots)) - needsProbe = append(needsProbe, shotURL) - } else { - netlog.Debug("[AFP][MacGarden] screenshot %d size: %d bytes (cached)", shotIdx, size) - } - asset := macGardenAsset{Name: name, URL: shotURL, Size: size} - assets = append(assets, asset) - m.mu.Lock() - m.screenshotByPath[filepath.Join(dirName, name)] = asset - m.mu.Unlock() - shotIdx++ - } - - for _, dl := range item.Downloads { - for _, link := range dl.Links { - if !strings.HasPrefix(link.URL, "http://") && !strings.HasPrefix(link.URL, "https://") { - continue - } - // Skip MD5 checksum links — they are not downloadable files. - if strings.Contains(link.URL, "arch_md5.php") { - continue - } - base := garden.FileNameFromURL(link.URL, dl.Title) - if base == "" { - base = sanitizeGardenName(dl.Title) - } - name := mirrorFolderForURL(link.URL) + "/" + base - size, cached := m.client.CachedContentLength(link.URL) - if !cached { - netlog.Debug("[AFP][MacGarden] download %q not yet cached, will probe in background", dl.Title) - needsProbe = append(needsProbe, link.URL) - } else { - netlog.Debug("[AFP][MacGarden] download %q size: %d bytes (cached)", dl.Title, size) - } - asset := macGardenAsset{Name: name, URL: link.URL, Size: size} - assets = append(assets, asset) - m.mu.Lock() - m.downloadByPath[filepath.Join(dirName, name)] = asset - m.mu.Unlock() - } - } - - if len(needsProbe) > 0 && m.client.FetchHead() { - netlog.Info("[AFP][MacGarden] probing %d uncached asset size(s) for %q in background", len(needsProbe), dirName) - urls := needsProbe - m.wg.Add(1) - go func() { - defer m.wg.Done() - for _, u := range urls { - select { - case <-m.stop: - return - default: - } - if _, err := m.client.HeadContentLength(u); err != nil { - netlog.Warn("[AFP][MacGarden] background probe failed for %q: %v", u, err) - } - } - netlog.Info("[AFP][MacGarden] background probe complete for %q", dirName) - }() - } - - netlog.Info("[AFP][MacGarden] built %d asset(s) for %q", len(assets), dirName) - return assets, nil -} - -func (m *MacGardenFileSystem) categoryByName(name string) (garden.Category, bool) { - for _, c := range m.categories { - if c.Name == name { - return c, true - } - } - return garden.Category{}, false -} - -func (m *MacGardenFileSystem) getCategoryURL(catName string) string { - m.loadCategories() - m.mu.RLock() - defer m.mu.RUnlock() - for _, c := range m.categories { - if c.Name == catName { - return c.URL - } - } - return "" -} - -func (m *MacGardenFileSystem) getCategoryPageMeta(catURL string) (macGardenCategoryPageMeta, error) { - m.mu.RLock() - if meta, ok := m.categoryPageMeta[catURL]; ok { - m.mu.RUnlock() - return meta, nil - } - m.mu.RUnlock() - - info, err := m.client.GetCategoryPageInfo(catURL) - if err != nil { - return macGardenCategoryPageMeta{}, err - } - meta := macGardenCategoryPageMeta{ - TotalCount: clampGardenCount(info.TotalCount), - PageSize: info.PageSize, - LastPageNumber: info.LastPageNumber, - LastPageCount: info.LastPageCount, - } - m.mu.Lock() - m.categoryPageMeta[catURL] = meta - m.categoryItemCount[catURL] = meta.TotalCount - m.cacheCategoryPageLocked(catURL, 0, info.FirstPage) - if info.LastPageNumber > 0 { - m.cacheCategoryPageLocked(catURL, info.LastPageNumber, info.LastPage) - } - m.mu.Unlock() - return meta, nil -} - -func (m *MacGardenFileSystem) getCategoryPage(catURL string, pageNumber int) ([]garden.SearchResult, error) { - m.mu.RLock() - if pages, ok := m.categoryPageItems[catURL]; ok { - if items, ok := pages[pageNumber]; ok { - cached := append([]garden.SearchResult(nil), items...) - m.mu.RUnlock() - return cached, nil - } - } - m.mu.RUnlock() - - items, err := m.client.GetCategoryPage(catURL, pageNumber) - if err != nil { - return nil, err - } - m.mu.Lock() - m.cacheCategoryPageLocked(catURL, pageNumber, items) - m.mu.Unlock() - return append([]garden.SearchResult(nil), items...), nil -} - -func (m *MacGardenFileSystem) cacheCategoryPageLocked(catURL string, pageNumber int, items []garden.SearchResult) { - if _, ok := m.categoryPageItems[catURL]; !ok { - m.categoryPageItems[catURL] = make(map[int][]garden.SearchResult) - } - cloned := append([]garden.SearchResult(nil), items...) - m.categoryPageItems[catURL][pageNumber] = cloned - for _, item := range cloned { - name := sanitizeGardenName(item.Name) - if name == "" { - continue - } - m.itemURLByDir[name] = item.URL - } -} - -func (m *MacGardenFileSystem) readCategoryDirRange(catURL string, startIndex uint16, reqCount uint16) ([]fs.DirEntry, uint16, error) { - if reqCount > macGardenEnumerateWindow { - reqCount = macGardenEnumerateWindow - } - meta, err := m.getCategoryPageMeta(catURL) - if err != nil { - return nil, 0, err - } - total := meta.TotalCount - if total == 0 { - return nil, 0, nil - } - if startIndex < 1 { - startIndex = 1 - } - if startIndex > total { - return nil, total, nil - } - if reqCount == 0 { - return nil, total, nil - } - pageSize := meta.PageSize - if pageSize <= 0 { - return nil, total, nil - } - startOffset := int(startIndex) - 1 - endOffset := startOffset + int(reqCount) - if endOffset > int(total) { - endOffset = int(total) - } - firstPage := startOffset / pageSize - lastPage := (endOffset - 1) / pageSize - results := make([]garden.SearchResult, 0, endOffset-startOffset) - for pageNumber := firstPage; pageNumber <= lastPage; pageNumber++ { - items, err := m.getCategoryPage(catURL, pageNumber) - if err != nil { - return nil, total, err - } - pageStart := 0 - if pageNumber == firstPage { - pageStart = startOffset - pageNumber*pageSize - } - pageEnd := len(items) - if pageNumber == lastPage { - pageLimit := endOffset - pageNumber*pageSize - if pageLimit < pageEnd { - pageEnd = pageLimit - } - } - if pageStart < 0 { - pageStart = 0 - } - if pageStart > len(items) { - pageStart = len(items) - } - if pageEnd < pageStart { - pageEnd = pageStart - } - results = append(results, items[pageStart:pageEnd]...) - } - entries := make([]fs.DirEntry, 0, len(results)) - for _, item := range results { - entries = append(entries, macGardenDirEntry{info: &macGardenFileInfo{name: sanitizeGardenName(item.Name), mode: fs.ModeDir | 0o555, isDir: true, modTime: time.Now().UTC()}}) - } - return entries, total, nil -} - -func (m *MacGardenFileSystem) getCategoryItems(catURL string) ([]garden.SearchResult, error) { - netlog.Debug("[AFP][MacGarden] getCategoryItems for URL: %s", catURL) - m.mu.RLock() - if items, ok := m.itemsInCategory[catURL]; ok { - m.mu.RUnlock() - netlog.Debug("[AFP][MacGarden] getCategoryItems found %d cached items for %s", len(items), catURL) - return items, nil - } - m.mu.RUnlock() - - meta, err := m.getCategoryPageMeta(catURL) - if err != nil { - netlog.Warn("[AFP][MacGarden] failed to fetch category page metadata: %v", err) - return nil, err - } - - netlog.Debug("[AFP][MacGarden] fetching all pages for category URL: %s", catURL) - items := make([]garden.SearchResult, 0, int(meta.TotalCount)) - for pageNumber := 0; pageNumber <= meta.LastPageNumber; pageNumber++ { - pageItems, err := m.getCategoryPage(catURL, pageNumber) - if err != nil { - netlog.Warn("[AFP][MacGarden] failed to fetch category page %d: %v", pageNumber, err) - return nil, err - } - items = append(items, pageItems...) - } - - netlog.Info("[AFP][MacGarden] got %d items from category %s", len(items), catURL) - m.mu.Lock() - m.itemsInCategory[catURL] = items - m.categoryItemCount[catURL] = clampGardenCount(len(items)) - m.mu.Unlock() - return items, nil -} - -func clampGardenCount(count int) uint16 { - if count <= 0 { - return 0 - } - if count > 0xffff { - return 0xffff - } - return uint16(count) -} - -func (m *MacGardenFileSystem) countCategoriesWithPrefix(prefix string) uint16 { - m.mu.RLock() - defer m.mu.RUnlock() - count := uint16(0) - for _, cat := range m.categories { - if strings.HasPrefix(strings.ToLower(urlPathFromAbsolute(cat.URL)), prefix) { - count++ - } - } - return count -} - -func (m *MacGardenFileSystem) getItemURLInCategory(catURL string, itemName string) (string, error) { - // Fast path: if the item URL is already cached from prior ranged enumeration, - // avoid forcing a full category crawl. - m.mu.RLock() - if cachedURL := m.itemURLByDir[itemName]; cachedURL != "" { - m.mu.RUnlock() - return cachedURL, nil - } - if cachedItems, ok := m.itemsInCategory[catURL]; ok { - for _, item := range cachedItems { - if sanitizeGardenName(item.Name) == itemName { - m.mu.RUnlock() - return item.URL, nil - } - } - } - if cachedPages, ok := m.categoryPageItems[catURL]; ok { - for _, pageItems := range cachedPages { - for _, item := range pageItems { - if sanitizeGardenName(item.Name) == itemName { - m.mu.RUnlock() - return item.URL, nil - } - } - } - } - m.mu.RUnlock() - - meta, err := m.getCategoryPageMeta(catURL) - if err != nil { - return "", err - } - - for pageNumber := 0; pageNumber <= meta.LastPageNumber; pageNumber++ { - pageItems, err := m.getCategoryPage(catURL, pageNumber) - if err != nil { - return "", err - } - for _, item := range pageItems { - if sanitizeGardenName(item.Name) == itemName { - return item.URL, nil - } - } - } - return "", fs.ErrNotExist -} - -func isSearchResultType(s string) bool { return s == "App" || s == "Game" } - -func sanitizeGardenName(s string) string { - s = strings.TrimSpace(s) - replacer := strings.NewReplacer( - "\\", "_", - "/", "_", - ":", "-", - "*", "_", - "?", "", - "\"", "", - "<", "(", - ">", ")", - "|", "_", - ) - s = replacer.Replace(s) - if s == "" { - return "Item" - } - return s -} - -func htmlEscape(s string) string { - s = strings.ReplaceAll(s, "&", "&") - s = strings.ReplaceAll(s, "<", "<") - s = strings.ReplaceAll(s, ">", ">") - return s -} - -func pathBase(s string) string { - s = filepath.ToSlash(s) - parts := strings.Split(s, "/") - return parts[len(parts)-1] -} - -func pathDir(s string) string { - s = filepath.ToSlash(s) - idx := strings.LastIndex(s, "/") - if idx < 0 { - return "" - } - return s[:idx] -} - -func urlPathFromAbsolute(absURL string) string { - u, err := url.Parse(absURL) - if err != nil { - return "" - } - return u.Path -} - -var _ FileSystem = (*MacGardenFileSystem)(nil) - -var errMacGardenNotFound = errors.New("macgarden: not found") diff --git a/service/afp/macgarden_fs_stub.go b/service/afp/macgarden_fs_stub.go index cb78021..1fd92c7 100644 --- a/service/afp/macgarden_fs_stub.go +++ b/service/afp/macgarden_fs_stub.go @@ -1,4 +1,4 @@ -//go:build afp && !macgarden +//go:build (afp || all) && !macgarden && !all package afp @@ -11,7 +11,7 @@ import ( var ErrMacGardenDisabled = errors.New("macgarden backend not built; rebuild with -tags macgarden") func init() { - RegisterFS(FSTypeMacGarden, func(_ VolumeConfig) (FileSystem, error) { + RegisterFS(FSTypeMacGarden, func(_ VolumeConfig, _ Options) (FileSystem, error) { return nil, ErrMacGardenDisabled }) } diff --git a/service/afp/path_codec.go b/service/afp/path_codec.go index bbfb68d..2212c17 100644 --- a/service/afp/path_codec.go +++ b/service/afp/path_codec.go @@ -10,6 +10,7 @@ import ( "unicode/utf8" "github.com/ObsoleteMadness/ClassicStack/pkg/encoding" + "github.com/ObsoleteMadness/ClassicStack/pkg/vfs" ) // AFPOptions controls AFP filename/path translation behavior. @@ -32,6 +33,10 @@ type Options struct { ForkMetadataBackend ForkMetadataBackend // PersistentVolumeIDs assigns stable volume IDs derived from volume names. PersistentVolumeIDs bool + // UseShortnames enables the 8.3 shortname mapping service for AFP clients. + UseShortnames bool + // ShortnameMapper is the shortname service instance. + ShortnameMapper vfs.ShortnameMapper } func DefaultOptions() Options { diff --git a/service/afp/paths.go b/service/afp/paths.go index dfb9632..e3da4f8 100644 --- a/service/afp/paths.go +++ b/service/afp/paths.go @@ -7,8 +7,20 @@ import ( "strings" "github.com/ObsoleteMadness/ClassicStack/netlog" + "github.com/ObsoleteMadness/ClassicStack/pkg/shortname" ) +func (s *Service) volIDForPath(path string) (uint16, bool) { + clean := filepath.Clean(path) + for _, vol := range s.Volumes { + rel, err := filepath.Rel(vol.Config.Path, clean) + if err == nil && !strings.HasPrefix(rel, "..") { + return vol.ID, true + } + } + return 0, false +} + // CNID-backed path/DID resolution and AFP path-string parsing. The // helpers here translate between AFP pathnames (null-separated, with // consecutive nulls ascending the tree) and host filesystem paths, @@ -59,7 +71,7 @@ func (s *Service) removeDIDSubtree(volumeID uint16, path string) { } func (s *Service) resolvePath(parentPath, name string, pathType uint8) (string, int32) { - if pathType == 1 { + if pathType == 1 && !s.options.UseShortnames { // Short names are not supported. return "", ErrObjectNotFound } @@ -90,6 +102,21 @@ func (s *Service) resolvePath(parentPath, name string, pathType uint8) (string, // If we see an empty string here, it corresponds to ascending. currentPath = filepath.Dir(currentPath) } else { + if pathType == 1 && s.options.UseShortnames { + // Convert shortname to longname if possible + volID, ok := s.volIDForPath(currentPath) + if !ok { + return "", ErrObjectNotFound + } + store, _ := s.cnidStore(volID) + mapper := shortname.NewMapper(store, shortname.Config{}) + if long, ok := mapper.ShortToLong(el); ok { + el = long + } + // If not found, `el` remains the short name string directly, + // which is perfectly valid as per AFP spec (short name = long name if new). + } + hostEl := s.afpPathElementToHost(el) if hostEl == ".." { return "", ErrAccessDenied diff --git a/service/afp/server_test.go b/service/afp/server_test.go index 03b72b0..0e89fb8 100644 --- a/service/afp/server_test.go +++ b/service/afp/server_test.go @@ -379,6 +379,9 @@ func (m *mockFS) ReadDir(name string) ([]fs.DirEntry, error) { func (m *mockFS) Stat(name string) (fs.FileInfo, error) { return nil, nil } +func (m *mockFS) ShortName(path string) (string, error) { + return filepath.Base(path), nil +} func (m *mockFS) DiskUsage(name string) (uint64, uint64, error) { if m.diskUsageErr != nil { return 0, 0, m.diskUsageErr diff --git a/service/afp/volume.go b/service/afp/volume.go index bd6766c..b5ef319 100644 --- a/service/afp/volume.go +++ b/service/afp/volume.go @@ -40,7 +40,7 @@ func (s *Service) installVolumes(configs []VolumeConfig, fallbackFS FileSystem) store.EnsureReserved(filepath.Clean(cfg.Path), CNIDRoot) s.cnidStores[volume.ID] = store - s.volumeFS[volume.ID] = resolveVolumeFS(cfg, fallbackFS) + s.volumeFS[volume.ID] = s.resolveVolumeFS(cfg, fallbackFS) s.installAppleDoubleBackend(volume.ID, cfg, fallbackFS) } } @@ -54,11 +54,11 @@ func (s *Service) assignVolumeID(cfg VolumeConfig, i int, used map[uint16]struct return id } -func resolveVolumeFS(cfg VolumeConfig, fallbackFS FileSystem) FileSystem { +func (s *Service) resolveVolumeFS(cfg VolumeConfig, fallbackFS FileSystem) FileSystem { if fallbackFS != nil { return fallbackFS } - if backend, err := newBackendForVolumeConfig(cfg); err == nil { + if backend, err := s.newBackendForVolumeConfig(cfg); err == nil { return backend } return nil @@ -538,12 +538,12 @@ func (s *Service) fsForPath(path string) FileSystem { return s.fs } -func newBackendForVolumeConfig(cfg VolumeConfig) (FileSystem, error) { +func (s *Service) newBackendForVolumeConfig(cfg VolumeConfig) (FileSystem, error) { fsType, err := NormalizeFSType(cfg.FSType) if err != nil { return nil, err } cfg.FSType = fsType cfg.Path = filepath.Clean(cfg.Path) - return NewFS(cfg) + return NewFS(cfg, s.options) } diff --git a/service/afpfs/macgarden/fs.go b/service/afpfs/macgarden/fs.go index efc6215..1eae6c0 100644 --- a/service/afpfs/macgarden/fs.go +++ b/service/afpfs/macgarden/fs.go @@ -26,6 +26,7 @@ import ( "unicode" "github.com/ObsoleteMadness/ClassicStack/netlog" + "github.com/ObsoleteMadness/ClassicStack/pkg/vfs" "github.com/ObsoleteMadness/ClassicStack/service/afp" garden "github.com/ObsoleteMadness/ClassicStack/service/macgarden" ) @@ -194,18 +195,20 @@ type MacGardenFileSystem struct { screenshotMu sync.RWMutex screenshotCache map[string][]byte // URL -> full image bytes + mapper vfs.ShortnameMapper + stop chan struct{} stopOnce sync.Once wg sync.WaitGroup } func init() { - afp.RegisterFS(afp.FSTypeMacGarden, func(cfg afp.VolumeConfig) (afp.FileSystem, error) { - return NewMacGardenFileSystem(filepath.Clean(cfg.Path)), nil + afp.RegisterFS(afp.FSTypeMacGarden, func(cfg afp.VolumeConfig, opts afp.Options) (afp.FileSystem, error) { + return NewMacGardenFileSystem(filepath.Clean(cfg.Path), opts.ShortnameMapper), nil }) } -func NewMacGardenFileSystem(root string) *MacGardenFileSystem { +func NewMacGardenFileSystem(root string, mapper vfs.ShortnameMapper) *MacGardenFileSystem { gc := garden.NewClient() gc.Prime() fsys := &MacGardenFileSystem{ @@ -224,6 +227,7 @@ func NewMacGardenFileSystem(root string) *MacGardenFileSystem { catSearchCache: make(map[string]*macGardenSearchCache), screenshotCache: make(map[string][]byte), stop: make(chan struct{}), + mapper: mapper, } fsys.loadCategories() return fsys @@ -773,6 +777,13 @@ func (m *MacGardenFileSystem) DiskUsage(_ string) (totalBytes uint64, freeBytes return 0x20000000, 0x18000000, nil } +func (m *MacGardenFileSystem) ShortName(path string) (string, error) { + if m.mapper == nil { + return filepath.Base(path), nil + } + return m.mapper.Bind(filepath.Dir(path), filepath.Base(path)), nil +} + func (m *MacGardenFileSystem) ChildCount(path string) (uint16, error) { rel, err := m.normalize(path) if err != nil { diff --git a/service/ipx/rip.go b/service/ipx/rip.go new file mode 100644 index 0000000..7864b5d --- /dev/null +++ b/service/ipx/rip.go @@ -0,0 +1,215 @@ +package ipx + +import ( + "context" + "sync" + "time" + + "github.com/ObsoleteMadness/ClassicStack/netlog" + ipxproto "github.com/ObsoleteMadness/ClassicStack/protocol/ipx" + routeripx "github.com/ObsoleteMadness/ClassicStack/router/ipx" +) + +// RIPSocket is the well-known socket number for IPX RIP. +var RIPSocket = [2]byte{0x04, 0x53} + +// DefaultRIPPeriod is the broadcast cadence used by NetWare-era IPX +// routers and matches what most clients expect to see. +const DefaultRIPPeriod = 60 * time.Second + +// RIPService is an IPX Routing Information Protocol responder for a +// single-segment deployment. We are not a router: we don't forward +// traffic, and we only ever advertise our own network number with +// hops=1, ticks=1. We do, however, respond to RIP requests so that +// clients learn about us and we send periodic broadcasts so clients +// don't time us out of their tables. +type RIPService struct { + router routeripx.Router + + // Period is the broadcast cadence. Zero or negative means use + // DefaultRIPPeriod. + Period time.Duration + + // now/sleep let tests substitute a fake clock without changing + // the production code path. + now func() time.Time + sleep func(d time.Duration) <-chan time.Time + + mu sync.Mutex + cancel context.CancelFunc + done chan struct{} +} + +// NewRIPService returns a RIP service bound to r. +func NewRIPService(r routeripx.Router) *RIPService { + return &RIPService{ + router: r, + now: time.Now, + sleep: func(d time.Duration) <-chan time.Time { + return time.After(d) + }, + } +} + +// Start registers the RIP socket and spawns the periodic broadcaster. +func (s *RIPService) Start(ctx context.Context) error { + if err := s.router.RegisterSocket(RIPSocket, s); err != nil { + return err + } + loopCtx, cancel := context.WithCancel(ctx) + s.mu.Lock() + s.cancel = cancel + s.done = make(chan struct{}) + s.mu.Unlock() + go s.broadcastLoop(loopCtx) + return nil +} + +// Stop cancels the broadcaster and waits for it to exit. +func (s *RIPService) Stop() error { + s.mu.Lock() + cancel := s.cancel + done := s.done + s.cancel = nil + s.mu.Unlock() + if cancel != nil { + cancel() + } + if done != nil { + <-done + } + return nil +} + +// HandleDatagram implements router/ipx.SocketHandler. The address +// filter on the router has already accepted this datagram as +// addressed to us (or broadcast); RIP itself decides whether to +// respond. +func (s *RIPService) HandleDatagram(d *ipxproto.Datagram) { + pkt, err := DecodeRIP(d.Payload) + if err != nil { + return + } + if pkt.Operation != RIPRequest { + // We are not a router: we ignore RIP responses from other + // nodes (we don't maintain a routing table beyond our own + // single network). + return + } + resp := s.respondToRequest(pkt) + if resp == nil { + return + } + if err := s.sendResponse(d, resp); err != nil { + netlog.Warn("[IPX][RIP] send response: %v", err) + } +} + +// respondToRequest builds a response packet for a RIP request, or +// returns nil when the request asked about networks we don't know. +// +// We know exactly one network — our own. If the request entries +// include either ours or the wildcard (RIPNetworkAny), we respond +// with our own entry; otherwise we don't reply. +func (s *RIPService) respondToRequest(req *RIPPacket) *RIPPacket { + ours := s.router.Network() + + // A request with no entries is treated as a wildcard for + // compatibility with old clients. + wildcard := len(req.Entries) == 0 + matchesOurs := false + for _, e := range req.Entries { + if e.Network == RIPNetworkAny { + wildcard = true + } + if e.Network == ours { + matchesOurs = true + } + } + if !wildcard && !matchesOurs { + return nil + } + return &RIPPacket{ + Operation: RIPResponse, + Entries: []RIPEntry{ + {Network: ours, Hops: 1, Ticks: 1}, + }, + } +} + +// sendResponse posts a unicast reply to the requester. The router +// fills the source net/node automatically. +func (s *RIPService) sendResponse(req *ipxproto.Datagram, resp *RIPPacket) error { + body, err := EncodeRIP(resp) + if err != nil { + return err + } + out := &ipxproto.Datagram{ + Type: 1, // RIP packet type + DstNet: req.SrcNet, + DstNode: req.SrcNode, + DstSock: RIPSocket, + SrcSock: RIPSocket, + Payload: body, + } + return s.router.Send(out) +} + +// broadcastLoop emits a periodic RIP response naming our own +// network. Stops when the context is cancelled. +func (s *RIPService) broadcastLoop(ctx context.Context) { + defer func() { + s.mu.Lock() + done := s.done + s.done = nil + s.mu.Unlock() + if done != nil { + close(done) + } + }() + + period := s.Period + if period <= 0 { + period = DefaultRIPPeriod + } + + // First broadcast goes out immediately so the segment learns + // about us without waiting a full period. + s.broadcast() + + for { + select { + case <-ctx.Done(): + return + case <-s.sleep(period): + s.broadcast() + } + } +} + +// broadcast emits an unsolicited RIP response advertising our +// network, addressed to the broadcast node on socket 0x0453. +func (s *RIPService) broadcast() { + ours := s.router.Network() + resp := &RIPPacket{ + Operation: RIPResponse, + Entries: []RIPEntry{ + {Network: ours, Hops: 1, Ticks: 1}, + }, + } + body, err := EncodeRIP(resp) + if err != nil { + return + } + out := &ipxproto.Datagram{ + Type: 1, + DstNet: ours, + DstNode: routeripx.BroadcastNode, + DstSock: RIPSocket, + SrcSock: RIPSocket, + Payload: body, + } + if err := s.router.Send(out); err != nil { + netlog.Debug("[IPX][RIP] broadcast: %v", err) + } +} diff --git a/service/ipx/rip_packet.go b/service/ipx/rip_packet.go new file mode 100644 index 0000000..09b34d6 --- /dev/null +++ b/service/ipx/rip_packet.go @@ -0,0 +1,86 @@ +package ipx + +import ( + "encoding/binary" + "errors" +) + +// RIP packet operations. The 16-bit operation field appears at the +// start of every RIP body. +const ( + RIPRequest uint16 = 1 + RIPResponse uint16 = 2 +) + +// RIPHopUnreachable is the sentinel hop count meaning "no route"; +// real RIP entries are 0..15 inclusive. +const RIPHopUnreachable uint16 = 16 + +// RIPNetworkAny is the wildcard network number a request body uses +// when asking "tell me about every network you know." +var RIPNetworkAny = [4]byte{0xFF, 0xFF, 0xFF, 0xFF} + +// RIPEntry is a single network advertisement carried inside a RIP +// packet. Hops and Ticks are encoded big-endian on the wire. +type RIPEntry struct { + Network [4]byte + Hops uint16 + Ticks uint16 +} + +// RIPPacket is the decoded form of a RIP body (i.e. the IPX payload +// at socket 0x0453, not including the 30-byte IPX header). +type RIPPacket struct { + Operation uint16 + Entries []RIPEntry +} + +// EncodeRIP serialises a RIP body. The wire layout is: +// +// uint16 operation +// []entry; each entry is: +// [4]byte network +// uint16 hops +// uint16 ticks +func EncodeRIP(p *RIPPacket) ([]byte, error) { + if p == nil { + return nil, errors.New("ipx: nil RIP packet") + } + out := make([]byte, 2+8*len(p.Entries)) + binary.BigEndian.PutUint16(out[0:2], p.Operation) + off := 2 + for _, e := range p.Entries { + copy(out[off:off+4], e.Network[:]) + binary.BigEndian.PutUint16(out[off+4:off+6], e.Hops) + binary.BigEndian.PutUint16(out[off+6:off+8], e.Ticks) + off += 8 + } + return out, nil +} + +// DecodeRIP parses a RIP body. Returns ErrShortRIP when input is +// shorter than two bytes. Trailing bytes that don't form a complete +// 8-byte entry are ignored — RIP packets in the wild often pad to a +// minimum size, and a strict parser would reject those. +func DecodeRIP(b []byte) (*RIPPacket, error) { + if len(b) < 2 { + return nil, ErrShortRIP + } + p := &RIPPacket{ + Operation: binary.BigEndian.Uint16(b[0:2]), + } + off := 2 + for off+8 <= len(b) { + var e RIPEntry + copy(e.Network[:], b[off:off+4]) + e.Hops = binary.BigEndian.Uint16(b[off+4 : off+6]) + e.Ticks = binary.BigEndian.Uint16(b[off+6 : off+8]) + p.Entries = append(p.Entries, e) + off += 8 + } + return p, nil +} + +// ErrShortRIP indicates a RIP body too short to even contain the +// operation field. +var ErrShortRIP = errors.New("ipx: short RIP packet") diff --git a/service/ipx/rip_packet_test.go b/service/ipx/rip_packet_test.go new file mode 100644 index 0000000..cba88ed --- /dev/null +++ b/service/ipx/rip_packet_test.go @@ -0,0 +1,77 @@ +package ipx + +import ( + "bytes" + "testing" +) + +func TestRIPRoundTrip(t *testing.T) { + want := &RIPPacket{ + Operation: RIPResponse, + Entries: []RIPEntry{ + {Network: [4]byte{0xCA, 0xFE, 0xF0, 0x0D}, Hops: 1, Ticks: 1}, + {Network: [4]byte{0xDE, 0xAD, 0xBE, 0xEF}, Hops: 2, Ticks: 4}, + }, + } + wire, err := EncodeRIP(want) + if err != nil { + t.Fatalf("EncodeRIP: %v", err) + } + if len(wire) != 2+8*2 { + t.Fatalf("wire length: got %d want %d", len(wire), 2+8*2) + } + got, err := DecodeRIP(wire) + if err != nil { + t.Fatalf("DecodeRIP: %v", err) + } + if got.Operation != want.Operation { + t.Fatalf("operation: got %d want %d", got.Operation, want.Operation) + } + if len(got.Entries) != len(want.Entries) { + t.Fatalf("entries: got %d want %d", len(got.Entries), len(want.Entries)) + } + for i := range got.Entries { + if got.Entries[i] != want.Entries[i] { + t.Errorf("entry %d: got %+v want %+v", i, got.Entries[i], want.Entries[i]) + } + } +} + +func TestRIPRequestMinimal(t *testing.T) { + // A 2-byte body with operation=1 and no entries is a "wildcard" + // request asking for everything the responder knows. + wire, err := EncodeRIP(&RIPPacket{Operation: RIPRequest}) + if err != nil { + t.Fatal(err) + } + if !bytes.Equal(wire, []byte{0, 1}) { + t.Fatalf("wire: got %x want 0001", wire) + } + got, err := DecodeRIP(wire) + if err != nil { + t.Fatal(err) + } + if got.Operation != RIPRequest || len(got.Entries) != 0 { + t.Fatalf("decoded: %+v", got) + } +} + +func TestRIPDecodeShort(t *testing.T) { + if _, err := DecodeRIP([]byte{0}); err != ErrShortRIP { + t.Fatalf("expected ErrShortRIP, got %v", err) + } +} + +func TestRIPDecodeIgnoresTrailingPad(t *testing.T) { + // IPX packets pad to a 60-byte minimum frame; the decoder should + // silently drop trailing bytes that don't form a complete entry. + wire := append([]byte{0, 2}, []byte{0xCA, 0xFE, 0xF0, 0x0D, 0x00, 0x01, 0x00, 0x01}...) + wire = append(wire, 0xAA, 0xBB) // 2 trailing bytes that would form a partial entry + got, err := DecodeRIP(wire) + if err != nil { + t.Fatalf("DecodeRIP: %v", err) + } + if len(got.Entries) != 1 { + t.Fatalf("entries: got %d want 1", len(got.Entries)) + } +} diff --git a/service/ipx/rip_test.go b/service/ipx/rip_test.go new file mode 100644 index 0000000..385497a --- /dev/null +++ b/service/ipx/rip_test.go @@ -0,0 +1,219 @@ +package ipx + +import ( + "context" + "sync" + "sync/atomic" + "testing" + "time" + + "github.com/ObsoleteMadness/ClassicStack/capture" + portipx "github.com/ObsoleteMadness/ClassicStack/port/ipx" + ipxproto "github.com/ObsoleteMadness/ClassicStack/protocol/ipx" + routeripx "github.com/ObsoleteMadness/ClassicStack/router/ipx" +) + +// recordingPort is a minimal portipx.Port implementation that captures +// every Send and exposes the delivery callback the router installs. +type recordingPort struct { + mu sync.Mutex + sent []*ipxproto.Datagram + cb portipx.DeliveryCallback +} + +func (p *recordingPort) Start() error { return nil } +func (p *recordingPort) Stop() error { return nil } +func (p *recordingPort) Send(d *ipxproto.Datagram) error { + p.mu.Lock() + defer p.mu.Unlock() + cp := *d + p.sent = append(p.sent, &cp) + return nil +} +func (p *recordingPort) SetDeliveryCallback(cb portipx.DeliveryCallback) { + p.mu.Lock() + p.cb = cb + p.mu.Unlock() +} +func (p *recordingPort) SetCaptureSink(_ capture.Sink) {} + +func setupRIPRouter(t *testing.T) (routeripx.Router, *recordingPort) { + t.Helper() + r := routeripx.NewRouter() + r.SetIdentity([4]byte{0xCA, 0xFE, 0xF0, 0x0D}, [6]byte{0x02, 0, 0, 0, 0, 0x42}) + port := &recordingPort{} + r.AddPort(port) + return r, port +} + +func TestRIPRespondsToWildcardRequest(t *testing.T) { + r, port := setupRIPRouter(t) + svc := NewRIPService(r) + if err := svc.Start(context.Background()); err != nil { + t.Fatalf("Start: %v", err) + } + defer svc.Stop() + + // Drain the immediate startup broadcast so the test only sees the + // reply triggered by our request. + waitForSend(t, port, 1) + + req := &RIPPacket{Operation: RIPRequest} + body, _ := EncodeRIP(req) + svc.HandleDatagram(&ipxproto.Datagram{ + SrcNet: [4]byte{0xCA, 0xFE, 0xF0, 0x0D}, + SrcNode: [6]byte{0x02, 0, 0, 0, 0, 0x99}, + DstNet: [4]byte{0xCA, 0xFE, 0xF0, 0x0D}, + DstNode: [6]byte{0x02, 0, 0, 0, 0, 0x42}, + DstSock: RIPSocket, + Payload: body, + }) + + waitForSend(t, port, 2) + + got := port.sent[1] + if got.DstSock != RIPSocket { + t.Fatalf("response DstSock: got %x want %x", got.DstSock, RIPSocket) + } + if got.DstNode != [6]byte{0x02, 0, 0, 0, 0, 0x99} { + t.Fatalf("response not unicast to requester: %x", got.DstNode) + } + resp, err := DecodeRIP(got.Payload) + if err != nil { + t.Fatalf("decode response: %v", err) + } + if resp.Operation != RIPResponse { + t.Fatalf("operation: got %d want %d", resp.Operation, RIPResponse) + } + if len(resp.Entries) != 1 { + t.Fatalf("entries: got %d want 1", len(resp.Entries)) + } + if resp.Entries[0].Network != ([4]byte{0xCA, 0xFE, 0xF0, 0x0D}) { + t.Fatalf("advertised network: got %x", resp.Entries[0].Network) + } +} + +func TestRIPIgnoresUnknownNetworkRequest(t *testing.T) { + r, port := setupRIPRouter(t) + svc := NewRIPService(r) + if err := svc.Start(context.Background()); err != nil { + t.Fatalf("Start: %v", err) + } + defer svc.Stop() + + waitForSend(t, port, 1) // startup broadcast + + body, _ := EncodeRIP(&RIPPacket{ + Operation: RIPRequest, + Entries: []RIPEntry{ + {Network: [4]byte{0xAA, 0xBB, 0xCC, 0xDD}}, // not ours, not wildcard + }, + }) + svc.HandleDatagram(&ipxproto.Datagram{ + SrcNode: [6]byte{0xDE, 0xAD, 0xBE, 0xEF, 0xCA, 0xFE}, + Payload: body, + }) + + // Give the responder a moment; we expect no extra send beyond the + // startup broadcast. + time.Sleep(20 * time.Millisecond) + port.mu.Lock() + defer port.mu.Unlock() + if len(port.sent) != 1 { + t.Fatalf("unexpected response to unknown-network request: sent=%d", len(port.sent)) + } +} + +func TestRIPIgnoresResponses(t *testing.T) { + r, port := setupRIPRouter(t) + svc := NewRIPService(r) + if err := svc.Start(context.Background()); err != nil { + t.Fatalf("Start: %v", err) + } + defer svc.Stop() + + waitForSend(t, port, 1) + + body, _ := EncodeRIP(&RIPPacket{ + Operation: RIPResponse, + Entries: []RIPEntry{ + {Network: [4]byte{0xCA, 0xFE, 0xF0, 0x0D}, Hops: 1, Ticks: 1}, + }, + }) + svc.HandleDatagram(&ipxproto.Datagram{Payload: body}) + + time.Sleep(20 * time.Millisecond) + port.mu.Lock() + defer port.mu.Unlock() + if len(port.sent) != 1 { + t.Fatal("RIP responder should ignore inbound RIP responses") + } +} + +func TestRIPPeriodicBroadcast(t *testing.T) { + r, port := setupRIPRouter(t) + svc := NewRIPService(r) + + // Drive the broadcast loop with a synthetic clock so we can assert + // the cadence without sleeping in real time. Each "tick" closes a + // channel that the loop is selecting on. + tickCount := atomic.Int32{} + tickCh := make(chan time.Time, 4) + svc.sleep = func(d time.Duration) <-chan time.Time { + tickCount.Add(1) + return tickCh + } + + if err := svc.Start(context.Background()); err != nil { + t.Fatalf("Start: %v", err) + } + defer svc.Stop() + + // Startup broadcast. + waitForSend(t, port, 1) + // Tick once: loop wakes, broadcasts again. + tickCh <- time.Now() + waitForSend(t, port, 2) + // Tick again. + tickCh <- time.Now() + waitForSend(t, port, 3) + + // All three sends should be RIP-response broadcasts to the + // broadcast node on socket 0x0453. + port.mu.Lock() + defer port.mu.Unlock() + for i, sent := range port.sent { + if sent.DstSock != RIPSocket { + t.Errorf("send %d: DstSock %x", i, sent.DstSock) + } + if sent.DstNode != routeripx.BroadcastNode { + t.Errorf("send %d: DstNode %x not broadcast", i, sent.DstNode) + } + resp, err := DecodeRIP(sent.Payload) + if err != nil { + t.Errorf("send %d: decode: %v", i, err) + continue + } + if resp.Operation != RIPResponse || len(resp.Entries) != 1 { + t.Errorf("send %d: unexpected packet %+v", i, resp) + } + } +} + +// waitForSend blocks until the recorded sends reach n, or fails. +func waitForSend(t *testing.T, port *recordingPort, n int) { + t.Helper() + deadline := time.Now().Add(time.Second) + for time.Now().Before(deadline) { + port.mu.Lock() + got := len(port.sent) + port.mu.Unlock() + if got >= n { + return + } + time.Sleep(2 * time.Millisecond) + } + port.mu.Lock() + defer port.mu.Unlock() + t.Fatalf("waited for %d sends, only got %d", n, len(port.sent)) +} diff --git a/service/ipx/sap.go b/service/ipx/sap.go new file mode 100644 index 0000000..c8a6429 --- /dev/null +++ b/service/ipx/sap.go @@ -0,0 +1,279 @@ +package ipx + +import ( + "context" + "sync" + "time" + + "github.com/ObsoleteMadness/ClassicStack/netlog" + ipxproto "github.com/ObsoleteMadness/ClassicStack/protocol/ipx" + routeripx "github.com/ObsoleteMadness/ClassicStack/router/ipx" +) + +// SAPSocket is the well-known socket number for IPX SAP. +var SAPSocket = [2]byte{0x04, 0x52} + +// DefaultSAPPeriod is the broadcast cadence used by NetWare-era SAP +// agents and matches what most clients expect. +const DefaultSAPPeriod = 60 * time.Second + +// SAPService is an IPX Service Advertising Protocol agent. It +// maintains a local registry of services this node advertises, replies +// to inbound SAP queries, and periodically broadcasts the registry so +// clients pick us up without having to ask. +// +// Higher layers register their advertisements via Register; the +// returned cancel function removes the entry. NetBIOS-over-IPX, when +// it claims a name, registers a SAPServiceTypeNetBIOS entry pointing +// at our network/node/socket so SMB clients see the server in their +// browse list. +type SAPService struct { + router routeripx.Router + + // Period is the broadcast cadence. Zero or negative uses + // DefaultSAPPeriod. + Period time.Duration + + // sleep is replaced in tests with a synthetic clock. + sleep func(d time.Duration) <-chan time.Time + + mu sync.Mutex + entries []SAPEntry + cancel context.CancelFunc + done chan struct{} +} + +// NewSAPService returns a SAP agent bound to r. +func NewSAPService(r routeripx.Router) *SAPService { + return &SAPService{ + router: r, + sleep: func(d time.Duration) <-chan time.Time { + return time.After(d) + }, + } +} + +// Register adds an advertisement to the registry. The returned +// function removes it. +// +// Network, Node, and Socket are filled from the router's identity +// when the caller leaves them zero — most local advertisements want +// "this server, on this socket of mine" which is the registered +// identity by default. Callers re-advertising remote services (a +// future SAP-relay use case) can populate the fields explicitly. +func (s *SAPService) Register(entry SAPEntry) (cancel func()) { + if isZero4(entry.Network) { + entry.Network = s.router.Network() + } + if isZero6(entry.Node) { + entry.Node = s.router.Node() + } + if entry.Hops == 0 { + entry.Hops = 1 + } + s.mu.Lock() + s.entries = append(s.entries, entry) + idx := len(s.entries) - 1 + id := entryID(entry) + s.mu.Unlock() + netlog.Info("[IPX][SAP] registered: type=%04x name=%q socket=%02x%02x", + entry.ServiceType, entry.Name, entry.Socket[0], entry.Socket[1]) + _ = idx + return func() { s.unregister(id) } +} + +// entryID is a stable identifier for an advertisement so that +// unregister can locate it even after registry mutations. +type sapEntryID struct { + ServiceType uint16 + Name string + Socket [2]byte +} + +func entryID(e SAPEntry) sapEntryID { + return sapEntryID{ServiceType: e.ServiceType, Name: e.Name, Socket: e.Socket} +} + +func (s *SAPService) unregister(id sapEntryID) { + s.mu.Lock() + defer s.mu.Unlock() + for i, e := range s.entries { + if entryID(e) == id { + s.entries = append(s.entries[:i], s.entries[i+1:]...) + netlog.Info("[IPX][SAP] unregistered: type=%04x name=%q", + e.ServiceType, e.Name) + return + } + } +} + +// Entries returns a copy of the registry. Useful for tests and +// diagnostic logging. +func (s *SAPService) Entries() []SAPEntry { + s.mu.Lock() + defer s.mu.Unlock() + out := make([]SAPEntry, len(s.entries)) + copy(out, s.entries) + return out +} + +// Start registers the SAP socket and spawns the periodic broadcaster. +func (s *SAPService) Start(ctx context.Context) error { + if err := s.router.RegisterSocket(SAPSocket, s); err != nil { + return err + } + loopCtx, cancel := context.WithCancel(ctx) + s.mu.Lock() + s.cancel = cancel + s.done = make(chan struct{}) + s.mu.Unlock() + go s.broadcastLoop(loopCtx) + return nil +} + +// Stop cancels the broadcaster and waits for the goroutine to exit. +func (s *SAPService) Stop() error { + s.mu.Lock() + cancel := s.cancel + done := s.done + s.cancel = nil + s.mu.Unlock() + if cancel != nil { + cancel() + } + if done != nil { + <-done + } + return nil +} + +// HandleDatagram implements router/ipx.SocketHandler. +func (s *SAPService) HandleDatagram(d *ipxproto.Datagram) { + pkt, err := DecodeSAP(d.Payload) + if err != nil { + return + } + switch pkt.Operation { + case SAPGeneralQuery, SAPNearestQuery: + s.handleQuery(d, pkt) + default: + // Responses from other agents are ignored — we don't maintain + // a remote-service table. + } +} + +// handleQuery answers a query with a unicast response naming all +// matching local advertisements. A wildcard service-type matches +// every entry; otherwise only entries whose service type matches. +func (s *SAPService) handleQuery(req *ipxproto.Datagram, q *SAPPacket) { + matches := s.matching(q.QueryServiceType) + if len(matches) == 0 { + return + } + op := uint16(SAPGeneralResponse) + if q.Operation == SAPNearestQuery { + op = SAPNearestResponse + // Nearest-service responses carry only one entry (the + // "nearest" one). With a single registry we just return the + // first match. + matches = matches[:1] + } + resp := &SAPPacket{Operation: op, Entries: matches} + body, err := EncodeSAP(resp) + if err != nil { + netlog.Warn("[IPX][SAP] encode response: %v", err) + return + } + out := &ipxproto.Datagram{ + Type: 4, // Packet Exchange Packet (used for SAP) + DstNet: req.SrcNet, + DstNode: req.SrcNode, + DstSock: req.SrcSock, + SrcSock: SAPSocket, + Payload: body, + } + if err := s.router.Send(out); err != nil { + netlog.Warn("[IPX][SAP] send response: %v", err) + } +} + +// matching returns the registry entries whose ServiceType matches t, +// or all entries when t is the wildcard 0xFFFF. +func (s *SAPService) matching(t uint16) []SAPEntry { + s.mu.Lock() + defer s.mu.Unlock() + out := make([]SAPEntry, 0, len(s.entries)) + for _, e := range s.entries { + if t == SAPServiceTypeWildcard || e.ServiceType == t { + out = append(out, e) + } + } + return out +} + +// broadcastLoop emits a periodic broadcast naming every registry +// entry. With ≤ 7 entries we fit in one packet; more would split +// across multiple packets. Since ClassicStack registers at most a +// handful (NetBIOS, file server) the single-packet path is fine. +func (s *SAPService) broadcastLoop(ctx context.Context) { + defer func() { + s.mu.Lock() + done := s.done + s.done = nil + s.mu.Unlock() + if done != nil { + close(done) + } + }() + + period := s.Period + if period <= 0 { + period = DefaultSAPPeriod + } + + s.broadcast() + + for { + select { + case <-ctx.Done(): + return + case <-s.sleep(period): + s.broadcast() + } + } +} + +func (s *SAPService) broadcast() { + entries := s.Entries() + if len(entries) == 0 { + return + } + // Chunk into packets of at most SAPMaxEntriesPerPacket. + for off := 0; off < len(entries); off += SAPMaxEntriesPerPacket { + end := min(off+SAPMaxEntriesPerPacket, len(entries)) + body, err := EncodeSAP(&SAPPacket{ + Operation: SAPGeneralResponse, + Entries: entries[off:end], + }) + if err != nil { + netlog.Warn("[IPX][SAP] encode broadcast: %v", err) + return + } + out := &ipxproto.Datagram{ + Type: 4, + DstNet: s.router.Network(), + DstNode: routeripx.BroadcastNode, + DstSock: SAPSocket, + SrcSock: SAPSocket, + Payload: body, + } + if err := s.router.Send(out); err != nil { + netlog.Debug("[IPX][SAP] broadcast: %v", err) + } + } +} + +// helper duplicates of router/ipx unexported helpers to avoid an +// import dependency on internal symbols. +func isZero4(b [4]byte) bool { return b == [4]byte{} } +func isZero6(b [6]byte) bool { return b == [6]byte{} } diff --git a/service/ipx/sap_packet.go b/service/ipx/sap_packet.go new file mode 100644 index 0000000..157f4bb --- /dev/null +++ b/service/ipx/sap_packet.go @@ -0,0 +1,155 @@ +package ipx + +import ( + "encoding/binary" + "errors" +) + +// SAP operation codes carried in the first 16 bits of every SAP body. +const ( + SAPGeneralQuery uint16 = 1 + SAPGeneralResponse uint16 = 2 + SAPNearestQuery uint16 = 3 + SAPNearestResponse uint16 = 4 +) + +// Well-known SAP service types. NetBIOS over IPX uses 0x0640; a +// NetWare file server proper uses 0x0004. +const ( + SAPServiceTypeWildcard uint16 = 0xFFFF + SAPServiceTypeFileSrv uint16 = 0x0004 + SAPServiceTypeNetBIOS uint16 = 0x0640 +) + +// SAPHopsUnreachable is the sentinel hop count meaning "no route"; +// real entries are 1..15 inclusive (0 is reserved for "self" in some +// implementations but commonly 1 is used for our own services). +const SAPHopsUnreachable uint16 = 16 + +// SAPNameLength is the fixed-width zero-padded name field carried in +// every SAP response entry. +const SAPNameLength = 48 + +// SAPEntrySize is the on-wire size of one SAP response entry. +const SAPEntrySize = 2 + SAPNameLength + 4 + 6 + 2 + 2 // = 64 + +// SAPMaxEntriesPerPacket limits broadcast packets to the IPX-MTU +// budget: 30-byte IPX header + 2-byte op + N*64 ≤ 576. With seven +// entries the body is 2 + 7*64 = 450 bytes, well under the limit. +const SAPMaxEntriesPerPacket = 7 + +// SAPEntry is one service advertisement carried inside a SAP +// response. The Name field is the human-visible service identifier +// (e.g. "CLASSICSTACK"). +type SAPEntry struct { + ServiceType uint16 + Name string + Network [4]byte + Node [6]byte + Socket [2]byte + Hops uint16 +} + +// SAPPacket is the decoded form of a SAP body. Queries carry a single +// service type in QueryServiceType (Entries left empty); responses +// carry one or more Entries (QueryServiceType ignored). +type SAPPacket struct { + Operation uint16 + QueryServiceType uint16 + Entries []SAPEntry +} + +// EncodeSAP serialises a SAP body for the wire. +func EncodeSAP(p *SAPPacket) ([]byte, error) { + if p == nil { + return nil, errors.New("ipx: nil SAP packet") + } + switch p.Operation { + case SAPGeneralQuery, SAPNearestQuery: + out := make([]byte, 4) + binary.BigEndian.PutUint16(out[0:2], p.Operation) + binary.BigEndian.PutUint16(out[2:4], p.QueryServiceType) + return out, nil + case SAPGeneralResponse, SAPNearestResponse: + if len(p.Entries) > SAPMaxEntriesPerPacket { + return nil, errors.New("ipx: too many SAP entries for one packet") + } + out := make([]byte, 2+SAPEntrySize*len(p.Entries)) + binary.BigEndian.PutUint16(out[0:2], p.Operation) + off := 2 + for _, e := range p.Entries { + binary.BigEndian.PutUint16(out[off:off+2], e.ServiceType) + off += 2 + // Name is zero-padded; truncate names longer than 47 + // bytes to leave room for the trailing null. + name := e.Name + if len(name) > SAPNameLength-1 { + name = name[:SAPNameLength-1] + } + copy(out[off:off+SAPNameLength], []byte(name)) + off += SAPNameLength + copy(out[off:off+4], e.Network[:]) + off += 4 + copy(out[off:off+6], e.Node[:]) + off += 6 + copy(out[off:off+2], e.Socket[:]) + off += 2 + binary.BigEndian.PutUint16(out[off:off+2], e.Hops) + off += 2 + } + return out, nil + default: + return nil, errors.New("ipx: unknown SAP operation") + } +} + +// DecodeSAP parses a SAP body. Query and response shapes are +// distinguished by the operation field. +func DecodeSAP(b []byte) (*SAPPacket, error) { + if len(b) < 2 { + return nil, ErrShortSAP + } + op := binary.BigEndian.Uint16(b[0:2]) + switch op { + case SAPGeneralQuery, SAPNearestQuery: + if len(b) < 4 { + return nil, ErrShortSAP + } + return &SAPPacket{ + Operation: op, + QueryServiceType: binary.BigEndian.Uint16(b[2:4]), + }, nil + case SAPGeneralResponse, SAPNearestResponse: + p := &SAPPacket{Operation: op} + off := 2 + for off+SAPEntrySize <= len(b) { + var e SAPEntry + e.ServiceType = binary.BigEndian.Uint16(b[off : off+2]) + off += 2 + // Trim trailing nulls from the name field. + name := b[off : off+SAPNameLength] + n := 0 + for n < len(name) && name[n] != 0 { + n++ + } + e.Name = string(name[:n]) + off += SAPNameLength + copy(e.Network[:], b[off:off+4]) + off += 4 + copy(e.Node[:], b[off:off+6]) + off += 6 + copy(e.Socket[:], b[off:off+2]) + off += 2 + e.Hops = binary.BigEndian.Uint16(b[off : off+2]) + off += 2 + p.Entries = append(p.Entries, e) + } + return p, nil + default: + return nil, errors.New("ipx: unknown SAP operation") + } +} + +// ErrShortSAP indicates a SAP body too short to even contain the +// operation field (or, for queries, the service-type that follows). +var ErrShortSAP = errors.New("ipx: short SAP packet") diff --git a/service/ipx/sap_packet_test.go b/service/ipx/sap_packet_test.go new file mode 100644 index 0000000..1650734 --- /dev/null +++ b/service/ipx/sap_packet_test.go @@ -0,0 +1,115 @@ +package ipx + +import "testing" + +func TestSAPQueryRoundTrip(t *testing.T) { + want := &SAPPacket{ + Operation: SAPGeneralQuery, + QueryServiceType: SAPServiceTypeNetBIOS, + } + wire, err := EncodeSAP(want) + if err != nil { + t.Fatalf("EncodeSAP: %v", err) + } + if len(wire) != 4 { + t.Fatalf("wire length: got %d want 4", len(wire)) + } + got, err := DecodeSAP(wire) + if err != nil { + t.Fatalf("DecodeSAP: %v", err) + } + if got.Operation != want.Operation || got.QueryServiceType != want.QueryServiceType { + t.Fatalf("got %+v want %+v", got, want) + } +} + +func TestSAPResponseRoundTrip(t *testing.T) { + want := &SAPPacket{ + Operation: SAPGeneralResponse, + Entries: []SAPEntry{ + { + ServiceType: SAPServiceTypeNetBIOS, + Name: "CLASSICSTACK", + Network: [4]byte{0xCA, 0xFE, 0xF0, 0x0D}, + Node: [6]byte{0x02, 0, 0, 0, 0, 0x42}, + Socket: [2]byte{0x04, 0x55}, + Hops: 1, + }, + { + ServiceType: SAPServiceTypeFileSrv, + Name: "ANOTHER_SERVER", + Network: [4]byte{0xCA, 0xFE, 0xF0, 0x0D}, + Node: [6]byte{0x02, 0, 0, 0, 0, 0x99}, + Socket: [2]byte{0x04, 0x51}, + Hops: 2, + }, + }, + } + wire, err := EncodeSAP(want) + if err != nil { + t.Fatalf("EncodeSAP: %v", err) + } + if len(wire) != 2+SAPEntrySize*2 { + t.Fatalf("wire length: got %d want %d", len(wire), 2+SAPEntrySize*2) + } + got, err := DecodeSAP(wire) + if err != nil { + t.Fatalf("DecodeSAP: %v", err) + } + if got.Operation != want.Operation { + t.Fatalf("op mismatch: got %d want %d", got.Operation, want.Operation) + } + if len(got.Entries) != len(want.Entries) { + t.Fatalf("entries: got %d want %d", len(got.Entries), len(want.Entries)) + } + for i := range got.Entries { + if got.Entries[i] != want.Entries[i] { + t.Errorf("entry %d: got %+v want %+v", i, got.Entries[i], want.Entries[i]) + } + } +} + +func TestSAPEncodeRejectsTooManyEntries(t *testing.T) { + too := &SAPPacket{Operation: SAPGeneralResponse} + for range SAPMaxEntriesPerPacket + 1 { + too.Entries = append(too.Entries, SAPEntry{Name: "x", Hops: 1}) + } + if _, err := EncodeSAP(too); err == nil { + t.Fatal("expected error for over-sized response") + } +} + +func TestSAPEncodeTruncatesLongName(t *testing.T) { + // 47-byte limit (one byte reserved for the trailing null). + long := make([]byte, 100) + for i := range long { + long[i] = 'X' + } + wire, err := EncodeSAP(&SAPPacket{ + Operation: SAPGeneralResponse, + Entries: []SAPEntry{{ + ServiceType: SAPServiceTypeFileSrv, + Name: string(long), + Hops: 1, + }}, + }) + if err != nil { + t.Fatalf("EncodeSAP: %v", err) + } + got, err := DecodeSAP(wire) + if err != nil { + t.Fatalf("DecodeSAP: %v", err) + } + if len(got.Entries[0].Name) != SAPNameLength-1 { + t.Fatalf("name length: got %d want %d", len(got.Entries[0].Name), SAPNameLength-1) + } +} + +func TestSAPDecodeShort(t *testing.T) { + if _, err := DecodeSAP([]byte{0}); err != ErrShortSAP { + t.Fatalf("expected ErrShortSAP, got %v", err) + } + if _, err := DecodeSAP([]byte{0x00, 0x01, 0x00}); err != ErrShortSAP { + t.Fatalf("expected ErrShortSAP for truncated query, got %v", err) + } +} diff --git a/service/ipx/sap_test.go b/service/ipx/sap_test.go new file mode 100644 index 0000000..3413a7f --- /dev/null +++ b/service/ipx/sap_test.go @@ -0,0 +1,264 @@ +package ipx + +import ( + "context" + "sync/atomic" + "testing" + "time" + + ipxproto "github.com/ObsoleteMadness/ClassicStack/protocol/ipx" + routeripx "github.com/ObsoleteMadness/ClassicStack/router/ipx" +) + +func TestSAPRegisterFillsIdentityFromRouter(t *testing.T) { + r, _ := setupRIPRouter(t) // reuses helpers from rip_test.go + svc := NewSAPService(r) + + cancel := svc.Register(SAPEntry{ + ServiceType: SAPServiceTypeNetBIOS, + Name: "CLASSICSTACK", + Socket: [2]byte{0x04, 0x55}, + }) + defer cancel() + + got := svc.Entries() + if len(got) != 1 { + t.Fatalf("entries: got %d want 1", len(got)) + } + if got[0].Network != ([4]byte{0xCA, 0xFE, 0xF0, 0x0D}) { + t.Errorf("Network: got %x want CAFEF00D", got[0].Network) + } + if got[0].Node != ([6]byte{0x02, 0, 0, 0, 0, 0x42}) { + t.Errorf("Node: got %x", got[0].Node) + } + if got[0].Hops != 1 { + t.Errorf("Hops default: got %d want 1", got[0].Hops) + } +} + +func TestSAPRegisterRespectsExplicitFields(t *testing.T) { + r, _ := setupRIPRouter(t) + svc := NewSAPService(r) + + cancel := svc.Register(SAPEntry{ + ServiceType: SAPServiceTypeFileSrv, + Name: "REMOTE", + Network: [4]byte{0xAA, 0xBB, 0xCC, 0xDD}, + Node: [6]byte{0x99, 0, 0, 0, 0, 0x99}, + Socket: [2]byte{0x04, 0x51}, + Hops: 4, + }) + defer cancel() + + got := svc.Entries() + if got[0].Network != ([4]byte{0xAA, 0xBB, 0xCC, 0xDD}) { + t.Errorf("explicit Network was overwritten: %x", got[0].Network) + } + if got[0].Hops != 4 { + t.Errorf("explicit Hops was overwritten: %d", got[0].Hops) + } +} + +func TestSAPCancelRemovesEntry(t *testing.T) { + r, _ := setupRIPRouter(t) + svc := NewSAPService(r) + cancel := svc.Register(SAPEntry{ + ServiceType: SAPServiceTypeNetBIOS, Name: "X", Socket: [2]byte{0x04, 0x55}, + }) + if got := svc.Entries(); len(got) != 1 { + t.Fatalf("post-register count: %d", len(got)) + } + cancel() + if got := svc.Entries(); len(got) != 0 { + t.Fatalf("post-cancel count: %d", len(got)) + } +} + +func TestSAPGeneralQueryByType(t *testing.T) { + r, port := setupRIPRouter(t) + svc := NewSAPService(r) + defer svc.Register(SAPEntry{ + ServiceType: SAPServiceTypeNetBIOS, Name: "CLASSICSTACK", Socket: [2]byte{0x04, 0x55}, + })() + defer svc.Register(SAPEntry{ + ServiceType: SAPServiceTypeFileSrv, Name: "FILESRV", Socket: [2]byte{0x04, 0x51}, + })() + + if err := svc.Start(context.Background()); err != nil { + t.Fatalf("Start: %v", err) + } + defer svc.Stop() + + // Drain the startup broadcast. + waitForSend(t, port, 1) + + // Query for NetBIOS specifically. + body, _ := EncodeSAP(&SAPPacket{ + Operation: SAPGeneralQuery, QueryServiceType: SAPServiceTypeNetBIOS, + }) + svc.HandleDatagram(&ipxproto.Datagram{ + SrcNet: [4]byte{0xCA, 0xFE, 0xF0, 0x0D}, + SrcNode: [6]byte{0x02, 0, 0, 0, 0, 0x99}, + SrcSock: [2]byte{0x40, 0x00}, + Payload: body, + }) + + waitForSend(t, port, 2) + + port.mu.Lock() + defer port.mu.Unlock() + got := port.sent[1] + if got.DstSock != ([2]byte{0x40, 0x00}) { + t.Fatalf("response DstSock: got %x want 4000 (requester's source socket)", got.DstSock) + } + resp, err := DecodeSAP(got.Payload) + if err != nil { + t.Fatalf("decode: %v", err) + } + if resp.Operation != SAPGeneralResponse { + t.Fatalf("operation: %d", resp.Operation) + } + if len(resp.Entries) != 1 { + t.Fatalf("entries: got %d want 1", len(resp.Entries)) + } + if resp.Entries[0].ServiceType != SAPServiceTypeNetBIOS { + t.Errorf("type: %x", resp.Entries[0].ServiceType) + } + if resp.Entries[0].Name != "CLASSICSTACK" { + t.Errorf("name: %q", resp.Entries[0].Name) + } +} + +func TestSAPWildcardQueryReturnsAll(t *testing.T) { + r, port := setupRIPRouter(t) + svc := NewSAPService(r) + defer svc.Register(SAPEntry{ + ServiceType: SAPServiceTypeNetBIOS, Name: "X", Socket: [2]byte{0x04, 0x55}, + })() + defer svc.Register(SAPEntry{ + ServiceType: SAPServiceTypeFileSrv, Name: "Y", Socket: [2]byte{0x04, 0x51}, + })() + + if err := svc.Start(context.Background()); err != nil { + t.Fatalf("Start: %v", err) + } + defer svc.Stop() + + waitForSend(t, port, 1) + + body, _ := EncodeSAP(&SAPPacket{ + Operation: SAPGeneralQuery, QueryServiceType: SAPServiceTypeWildcard, + }) + svc.HandleDatagram(&ipxproto.Datagram{Payload: body}) + + waitForSend(t, port, 2) + + port.mu.Lock() + defer port.mu.Unlock() + resp, _ := DecodeSAP(port.sent[1].Payload) + if len(resp.Entries) != 2 { + t.Fatalf("wildcard match count: got %d want 2", len(resp.Entries)) + } +} + +func TestSAPNearestQueryReturnsOneEntry(t *testing.T) { + r, port := setupRIPRouter(t) + svc := NewSAPService(r) + defer svc.Register(SAPEntry{ + ServiceType: SAPServiceTypeNetBIOS, Name: "FIRST", Socket: [2]byte{0x04, 0x55}, + })() + defer svc.Register(SAPEntry{ + ServiceType: SAPServiceTypeNetBIOS, Name: "SECOND", Socket: [2]byte{0x04, 0x56}, + })() + + if err := svc.Start(context.Background()); err != nil { + t.Fatalf("Start: %v", err) + } + defer svc.Stop() + + waitForSend(t, port, 1) + + body, _ := EncodeSAP(&SAPPacket{ + Operation: SAPNearestQuery, QueryServiceType: SAPServiceTypeNetBIOS, + }) + svc.HandleDatagram(&ipxproto.Datagram{Payload: body}) + + waitForSend(t, port, 2) + + port.mu.Lock() + defer port.mu.Unlock() + resp, _ := DecodeSAP(port.sent[1].Payload) + if resp.Operation != SAPNearestResponse { + t.Fatalf("operation: got %d want %d", resp.Operation, SAPNearestResponse) + } + if len(resp.Entries) != 1 { + t.Fatalf("nearest count: got %d want 1", len(resp.Entries)) + } +} + +func TestSAPQueryWithNoMatchesIsSilent(t *testing.T) { + r, port := setupRIPRouter(t) + svc := NewSAPService(r) + if err := svc.Start(context.Background()); err != nil { + t.Fatalf("Start: %v", err) + } + defer svc.Stop() + + // No registry entries means no startup broadcast either. + body, _ := EncodeSAP(&SAPPacket{ + Operation: SAPGeneralQuery, QueryServiceType: SAPServiceTypeNetBIOS, + }) + svc.HandleDatagram(&ipxproto.Datagram{Payload: body}) + + time.Sleep(20 * time.Millisecond) + port.mu.Lock() + defer port.mu.Unlock() + if len(port.sent) != 0 { + t.Fatalf("expected no response, got %d", len(port.sent)) + } +} + +func TestSAPPeriodicBroadcast(t *testing.T) { + r, port := setupRIPRouter(t) + svc := NewSAPService(r) + defer svc.Register(SAPEntry{ + ServiceType: SAPServiceTypeNetBIOS, Name: "CLASSICSTACK", Socket: [2]byte{0x04, 0x55}, + })() + + tickCh := make(chan time.Time, 4) + tickCount := atomic.Int32{} + svc.sleep = func(d time.Duration) <-chan time.Time { + tickCount.Add(1) + return tickCh + } + + if err := svc.Start(context.Background()); err != nil { + t.Fatalf("Start: %v", err) + } + defer svc.Stop() + + waitForSend(t, port, 1) // startup + tickCh <- time.Now() + waitForSend(t, port, 2) // tick 1 + tickCh <- time.Now() + waitForSend(t, port, 3) // tick 2 + + port.mu.Lock() + defer port.mu.Unlock() + for i, sent := range port.sent { + if sent.DstSock != SAPSocket { + t.Errorf("send %d: DstSock %x", i, sent.DstSock) + } + if sent.DstNode != routeripx.BroadcastNode { + t.Errorf("send %d: DstNode not broadcast", i) + } + resp, err := DecodeSAP(sent.Payload) + if err != nil { + t.Errorf("send %d: decode: %v", i, err) + continue + } + if resp.Operation != SAPGeneralResponse || len(resp.Entries) != 1 { + t.Errorf("send %d: %+v", i, resp) + } + } +} diff --git a/service/ipx/service.go b/service/ipx/service.go new file mode 100644 index 0000000..e021580 --- /dev/null +++ b/service/ipx/service.go @@ -0,0 +1,15 @@ +// Package ipx hosts IPX-stack services (RIP, SAP, ...). They are +// lifecycle siblings of AppleTalk services, not members of the +// AppleTalk service.Service set: IPX has its own router and does +// not consume DDP datagrams. +package ipx + +import "context" + +// Service is the lifecycle contract for an IPX-stack service. +// Implementations register their own sockets with the IPX router +// during Start and tear them down during Stop. +type Service interface { + Start(ctx context.Context) error + Stop() error +} diff --git a/service/netbios/over_ipx/transport.go b/service/netbios/over_ipx/transport.go new file mode 100644 index 0000000..818ecef --- /dev/null +++ b/service/netbios/over_ipx/transport.go @@ -0,0 +1,571 @@ +// Package over_ipx adapts the IPX router to the netbios.Transport +// contract. NetBIOS over IPX (NWLink) uses three sockets: +// +// 0x0455 — NetBIOS-over-IPX (session + name service) +// 0x0553 — NetBIOS datagram +// 0x0554 — NetBIOS name service (alternative path used by some clients) +// +// On Start the transport runs a name-claim broadcast against the +// segment, six 500ms retries (~3s total). If any node replies with +// our name owning it, the claim fails. If silence, we register with +// SAP under SAPServiceTypeNetBIOS so other nodes browsing SAP find us. +package over_ipx + +import ( + "context" + "errors" + "sync" + "time" + + "github.com/ObsoleteMadness/ClassicStack/netlog" + ipxproto "github.com/ObsoleteMadness/ClassicStack/protocol/ipx" + protocol "github.com/ObsoleteMadness/ClassicStack/protocol/netbios" + "github.com/ObsoleteMadness/ClassicStack/router/ipx" + ipxsvc "github.com/ObsoleteMadness/ClassicStack/service/ipx" + "github.com/ObsoleteMadness/ClassicStack/service/netbios" +) + +// Sockets is the ordered list of IPX socket numbers NetBIOS-over-IPX +// claims. Exposed for documentation and tests. +var Sockets = [4][2]byte{ + {0x04, 0x55}, // session + most name-service traffic + {0x05, 0x51}, // NMPI name-query + {0x05, 0x53}, // datagram + {0x05, 0x54}, // name service (alternative) +} + +// NB-IPX socket numbers as constants for readability inside this +// package. The wire bytes are identical to Sockets[*] but the names +// document intent at call sites. +var ( + NBIPXSessionSocket = [2]byte{0x04, 0x55} + NBIPXServerSocket = [2]byte{0x05, 0x50} + NBIPXNameQuerySocket = [2]byte{0x05, 0x51} + NBIPXDatagramSocket = [2]byte{0x05, 0x53} + NBIPXNameSocket = [2]byte{0x05, 0x54} +) + +// Default name-claim retry parameters. NWLink and Win9x clients use +// the same 500ms × 6 cadence (≈3s total) before considering a name +// uncontested. +const ( + DefaultNameClaimRetries = 6 + DefaultNameClaimInterval = 500 * time.Millisecond +) + +// ErrNameInUse is returned when a name claim is contested by another +// node holding the same name. +var ErrNameInUse = errors.New("netbios/over_ipx: name already in use on segment") + +// SAPRegistrar is the slice of *ipxsvc.SAPService this package needs. +// Carrying it as an interface keeps tests independent of the full +// SAP machinery — a fake registrar with a single method satisfies it. +type SAPRegistrar interface { + Register(entry ipxsvc.SAPEntry) (cancel func()) +} + +type transport struct { + router ipx.Router + sap SAPRegistrar + name protocol.Name + + // Tunable claim parameters; tests override these to drive the + // name-claim machinery without sleeping in real time. + claimRetries int + claimInterval time.Duration + sleep func(d time.Duration) <-chan time.Time + + mu sync.RWMutex + handler netbios.CommandHandler + objection chan struct{} + sapCancel func() + stopOnce sync.Once + stopped chan struct{} +} + +// NewTransport returns a netbios.Transport that registers on the +// IPX NetBIOS sockets, claims name on the segment, and (on success) +// publishes itself via SAP. Pass an empty name to skip the name +// claim — useful for tests that want only the socket-level transport. +func NewTransport(r ipx.Router, sap SAPRegistrar, name protocol.Name) netbios.Transport { + return &transport{ + router: r, + sap: sap, + name: name, + claimRetries: DefaultNameClaimRetries, + claimInterval: DefaultNameClaimInterval, + sleep: func(d time.Duration) <-chan time.Time { + return time.After(d) + }, + objection: make(chan struct{}, 1), + stopped: make(chan struct{}), + } +} + +// Start registers our IPX sockets and runs the name claim. Returns +// nil even if the claim fails — the transport stays alive as a +// receiver for sessions destined to whatever node we already are, +// but no SAP advertisement appears. Errors here would prevent the +// rest of NetBIOS from starting; we'd rather log and continue. +func (t *transport) Start(ctx context.Context) error { + for _, sock := range Sockets { + if err := t.router.RegisterSocket(sock, t); err != nil { + return err + } + } + + if t.shouldClaimName() { + go t.claimAndAdvertise(ctx) + } + return nil +} + +// shouldClaimName returns true when both the SAP service and a +// non-empty name are available. A zero name means the operator did +// not configure one (unit-test transports do this). +func (t *transport) shouldClaimName() bool { + if t.sap == nil { + return false + } + var zero protocol.Name + return t.name != zero +} + +// claimAndAdvertise broadcasts FindName retries until either an +// objection arrives or all retries lapse. On success it registers +// the name with SAP under SAPServiceTypeNetBIOS. +func (t *transport) claimAndAdvertise(ctx context.Context) { + netlog.Info("[NetBIOS][IPX] claiming name %q (%d retries × %v)", + t.name.String(), t.claimRetries, t.claimInterval) + + for i := range t.claimRetries { + if err := t.broadcastFindName(); err != nil { + netlog.Warn("[NetBIOS][IPX] FindName broadcast %d: %v", i+1, err) + } + if err := t.broadcastNMPIClaim(); err != nil { + netlog.Warn("[NetBIOS][IPX] NMPI ClaimName broadcast %d: %v", i+1, err) + } + select { + case <-ctx.Done(): + return + case <-t.objection: + netlog.Warn("[NetBIOS][IPX] name %q is already in use; aborting claim", t.name.String()) + return + case <-t.sleep(t.claimInterval): + // Continue to the next retry. + } + } + + // Name uncontested — publish via SAP. + cancel := t.sap.Register(ipxsvc.SAPEntry{ + ServiceType: ipxsvc.SAPServiceTypeNetBIOS, + Name: t.name.String(), + Socket: NBIPXSessionSocket, + }) + t.mu.Lock() + t.sapCancel = cancel + t.mu.Unlock() + netlog.Info("[NetBIOS][IPX] name %q claimed; advertised via SAP type 0x%04x", + t.name.String(), ipxsvc.SAPServiceTypeNetBIOS) +} + +// broadcastFindName emits one type-20 IPX broadcast carrying our name +// to socket 0x0455 on every node of the segment. +func (t *transport) broadcastFindName() error { + body := protocol.EncodeNameService(&protocol.NBIPXNameServicePacket{ + NameTypeFlag: 0x00, + DataStreamType: protocol.NBIPXFindName, + Name: t.name, + }) + out := &ipxproto.Datagram{ + Type: protocol.IPXTypeNetBIOS, + DstNet: t.router.Network(), + DstNode: ipx.BroadcastNode, + DstSock: NBIPXSessionSocket, + SrcSock: NBIPXSessionSocket, + Payload: body, + } + return t.router.Send(out) +} + +func (t *transport) broadcastNMPIClaim() error { + body := protocol.EncodeNMPIPacket(&protocol.NMPIPacket{ + Opcode: protocol.NMPIOpNameClaim, + NameType: protocol.NMPINameTypeMachine, + MessageID: 0, + RequestedName: t.name, + SourceName: t.name, + }) + out := &ipxproto.Datagram{ + Type: protocol.IPXTypeNetBIOS, + DstNet: t.router.Network(), + DstNode: ipx.BroadcastNode, + DstSock: NBIPXNameQuerySocket, + SrcSock: NBIPXServerSocket, + Payload: body, + } + netlog.Debug("[NetBIOS][IPX] tx NMPI claim name=%q", t.name.String()) + return t.router.Send(out) +} + +// Stop unregisters the SAP advertisement (if any) and stops further +// inbound dispatch. +func (t *transport) Stop() error { + t.stopOnce.Do(func() { + close(t.stopped) + t.mu.Lock() + cancel := t.sapCancel + t.sapCancel = nil + t.mu.Unlock() + if cancel != nil { + cancel() + } + }) + return nil +} + +func (t *transport) SendName(_ protocol.Name) error { return netbios.ErrNotImplemented } + +func (t *transport) SendDatagram(dg *protocol.Datagram) error { + if dg == nil { + return nil + } + netlog.Debug("[NetBIOS][IPX] tx mailslot send src=%q dst=%q payload=%d", + dg.Source.String(), dg.Destination.String(), len(dg.Payload)) + return t.sendNMPIDatagram(dg, netbios.DatagramEndpoint{ + Network: t.router.Network(), + Node: ipx.BroadcastNode, + Socket: NBIPXDatagramSocket, + }) +} + +func (t *transport) SendDirectedDatagram(dg *protocol.Datagram, remote netbios.DatagramEndpoint) error { + if dg == nil { + return nil + } + if remote.Socket == ([2]byte{}) { + remote.Socket = NBIPXDatagramSocket + } + netlog.Debug("[NetBIOS][IPX] tx directed mailslot send src=%q dst=%q ipx=%x.%x:%02x%02x payload=%d", + dg.Source.String(), dg.Destination.String(), + remote.Network, remote.Node, remote.Socket[0], remote.Socket[1], len(dg.Payload)) + return t.sendNMPIDatagram(dg, remote) +} + +func (t *transport) sendNMPIDatagram(dg *protocol.Datagram, remote netbios.DatagramEndpoint) error { + payload := protocol.EncodeNMPIPacket(&protocol.NMPIPacket{ + Opcode: protocol.NMPIOpMailslotSend, + NameType: nmpiNameType(dg.Destination), + MessageID: 0, + RequestedName: dg.Destination, + SourceName: dg.Source, + Payload: dg.Payload, + }) + out := &ipxproto.Datagram{ + Type: protocol.IPXTypeNetBIOS, + DstNet: remote.Network, + DstNode: remote.Node, + DstSock: remote.Socket, + SrcSock: NBIPXDatagramSocket, + Payload: payload, + } + return t.router.Send(out) +} + +func (t *transport) SendSession(_ *protocol.SessionPacket) error { return netbios.ErrNotImplemented } + +func (t *transport) SetCommandHandler(h netbios.CommandHandler) { + t.mu.Lock() + t.handler = h + t.mu.Unlock() +} + +// HandleDatagram implements router/ipx.SocketHandler. It dispatches by +// the IPX packet-type field: +// +// - Type 20 (NetBIOS broadcast/forwarding): name service. During a +// pending claim, this is how we learn another node owns our name. +// - Type 4 (Packet Exchange): session-layer traffic. Forwarded to +// the session machine when that lands in Phase 5C; for now we +// log and drop. +func (t *transport) HandleDatagram(d *ipxproto.Datagram) { + if d == nil { + return + } + if d.SrcNet == t.router.Network() && d.SrcNode == t.router.Node() { + netlog.Debug("[NetBIOS][IPX] drop self-looped datagram type=0x%02x srcSock=%02x%02x dstSock=%02x%02x", + d.Type, d.SrcSock[0], d.SrcSock[1], d.DstSock[0], d.DstSock[1]) + return + } + netlog.Debug("[NetBIOS][IPX] rx ipx type=0x%02x srcSock=%02x%02x dstSock=%02x%02x payload=%d", + d.Type, d.SrcSock[0], d.SrcSock[1], d.DstSock[0], d.DstSock[1], len(d.Payload)) + switch d.Type { + case protocol.IPXTypeNetBIOS: + if t.handleNMPIPayload(d) { + return + } + t.handleNameService(d) + case protocol.IPXTypePEP: + t.handlePEP(d) + } +} + +func (t *transport) handleNMPIPayload(d *ipxproto.Datagram) bool { + if d == nil || len(d.Payload) < 2 { + return false + } + if d.DstSock != NBIPXNameQuerySocket && d.DstSock != NBIPXDatagramSocket { + return false + } + p, err := protocol.DecodeNMPIPacket(d.Payload) + if err != nil { + return false + } + netlog.Debug("[NetBIOS][IPX] rx NMPI opcode=0x%02x nameType=0x%02x src=%q dst=%q payload=%d", + p.Opcode, p.NameType, p.SourceName.String(), p.RequestedName.String(), len(p.Payload)) + t.handleNMPI(d, p) + return true +} + +func (t *transport) handlePEP(d *ipxproto.Datagram) { + if d == nil || len(d.Payload) < 2 { + return + } + if t.handleNMPIPayload(d) { + return + } + if d.DstSock == NBIPXDatagramSocket { + if d.Payload[1] != protocol.NBIPXDirectedDatagram { + return + } + dg, err := protocol.DecodeDatagram(d.Payload[2:]) + if err != nil { + return + } + netlog.Debug("[NetBIOS][IPX] rx directed datagram src=%q dst=%q payload=%d", + dg.Source.String(), dg.Destination.String(), len(dg.Payload)) + t.mu.RLock() + h := t.handler + t.mu.RUnlock() + if h != nil { + if ch, ok := h.(netbios.ContextualDatagramHandler); ok { + _ = ch.HandleDatagramContext(dg, netbios.DatagramContext{ + Local: netbios.DatagramEndpoint{ + Network: d.DstNet, + Node: d.DstNode, + Socket: d.DstSock, + }, + Remote: netbios.DatagramEndpoint{ + Network: d.SrcNet, + Node: d.SrcNode, + Socket: d.SrcSock, + }, + }) + return + } + _ = h.HandleDatagram(dg) + } + return + } + + if d.DstSock != NBIPXSessionSocket { + return + } + hdr, err := protocol.DecodeSessionHeader(d.Payload) + if err != nil { + return + } + if len(d.Payload) < protocol.NBIPXSessionHeaderLen+int(hdr.DataLen) { + return + } + body := append([]byte(nil), d.Payload[protocol.NBIPXSessionHeaderLen:protocol.NBIPXSessionHeaderLen+int(hdr.DataLen)]...) + + if hdr.DataStreamType == protocol.NBIPXSessionInit { + _ = t.sendPEPSessionControl(d, hdr, protocol.NBIPXSessionConfirm) + return + } + if hdr.DataStreamType == protocol.NBIPXSessionEnd { + _ = t.sendPEPSessionControl(d, hdr, protocol.NBIPXSessionEndAck) + return + } + if hdr.DataStreamType != protocol.NBIPXDataOnlyLast && hdr.DataStreamType != protocol.NBIPXDataFirstMiddle { + return + } + + netlog.Debug("[NetBIOS][IPX] rx session data srcConn=%04x dstConn=%04x seq=%d bytes=%d", + hdr.SourceConnID, hdr.DestConnID, hdr.SendSeq, len(body)) + t.mu.RLock() + h := t.handler + t.mu.RUnlock() + if h == nil { + return + } + sp := &protocol.SessionPacket{Type: protocol.SessionMessage, Payload: body} + if sh, ok := h.(netbios.ContextualSessionHandler); ok { + resp, err := sh.HandleSessionContext(sp, netbios.SessionContext{ + Local: netbios.DatagramEndpoint{ + Network: d.DstNet, + Node: d.DstNode, + Socket: d.DstSock, + }, + Remote: netbios.DatagramEndpoint{ + Network: d.SrcNet, + Node: d.SrcNode, + Socket: d.SrcSock, + }, + SourceConnID: hdr.SourceConnID, + DestConnID: hdr.DestConnID, + Sequence: hdr.SendSeq, + ConnectionCtl: hdr.ConnCtrlByte, + }) + if err == nil && resp != nil && len(resp.Payload) > 0 { + _ = t.sendPEPSessionData(d, hdr, resp.Payload) + } + return + } + _ = h.HandleSession(sp) +} +func (t *transport) sendPEPSessionControl(in *ipxproto.Datagram, inHdr *protocol.NBIPXSessionHeader, streamType uint8) error { + if in == nil || inHdr == nil { + return nil + } + h := &protocol.NBIPXSessionHeader{ + ConnCtrlFlag: protocol.NBIPXConnFlagSYS, + DataStreamType: streamType, + SourceConnID: inHdr.DestConnID, + DestConnID: inHdr.SourceConnID, + SendSeq: inHdr.SendSeq, + TotalDataLen: 0, + Offset: 0, + DataLen: 0, + ConnCtrlByte: inHdr.ConnCtrlByte, + } + body := protocol.EncodeSessionHeader(h) + out := &ipxproto.Datagram{ + Type: protocol.IPXTypePEP, + DstNet: in.SrcNet, + DstNode: in.SrcNode, + DstSock: in.SrcSock, + SrcSock: in.DstSock, + Payload: body, + } + return t.router.Send(out) +} + +func (t *transport) sendPEPSessionData(in *ipxproto.Datagram, inHdr *protocol.NBIPXSessionHeader, payload []byte) error { + if in == nil || inHdr == nil { + return nil + } + h := &protocol.NBIPXSessionHeader{ + ConnCtrlFlag: protocol.NBIPXConnFlagEOM, + DataStreamType: protocol.NBIPXDataOnlyLast, + SourceConnID: inHdr.DestConnID, + DestConnID: inHdr.SourceConnID, + SendSeq: inHdr.SendSeq, + TotalDataLen: uint16(len(payload)), + Offset: 0, + DataLen: uint16(len(payload)), + ConnCtrlByte: inHdr.ConnCtrlByte, + } + body := append(protocol.EncodeSessionHeader(h), payload...) + out := &ipxproto.Datagram{ + Type: protocol.IPXTypePEP, + DstNet: in.SrcNet, + DstNode: in.SrcNode, + DstSock: in.SrcSock, + SrcSock: in.DstSock, + Payload: body, + } + return t.router.Send(out) +} + +func (t *transport) handleNMPI(d *ipxproto.Datagram, p *protocol.NMPIPacket) { + if p == nil { + return + } + if p.Opcode == protocol.NMPIOpMailslotSend { + netlog.Debug("[NetBIOS][IPX] request mailslot send src=%q dst=%q payload=%d", + p.SourceName.String(), p.RequestedName.String(), len(p.Payload)) + t.mu.RLock() + h := t.handler + t.mu.RUnlock() + if h != nil { + dg := &protocol.Datagram{ + Destination: p.RequestedName, + Source: p.SourceName, + Payload: append([]byte(nil), p.Payload...), + } + if ch, ok := h.(netbios.ContextualDatagramHandler); ok { + _ = ch.HandleDatagramContext(dg, netbios.DatagramContext{ + Local: netbios.DatagramEndpoint{ + Network: d.DstNet, + Node: d.DstNode, + Socket: d.DstSock, + }, + Remote: netbios.DatagramEndpoint{ + Network: d.SrcNet, + Node: d.SrcNode, + Socket: d.SrcSock, + }, + }) + return + } + _ = h.HandleDatagram(dg) + } + return + } + if p.Opcode != protocol.NMPIOpNameQuery { + return + } + netlog.Debug("[NetBIOS][IPX] request name query msg=0x%04x src=%q dst=%q", + p.MessageID, p.SourceName.String(), p.RequestedName.String()) + if p.RequestedName != t.name { + return + } + resp := protocol.EncodeNMPIPacket(&protocol.NMPIPacket{ + Opcode: protocol.NMPIOpNameFound, + NameType: p.NameType, + MessageID: p.MessageID, + RequestedName: p.RequestedName, + SourceName: t.name, + }) + out := &ipxproto.Datagram{ + Type: protocol.IPXTypePEP, + DstNet: d.SrcNet, + DstNode: d.SrcNode, + DstSock: d.SrcSock, + SrcSock: d.DstSock, + Payload: resp, + } + netlog.Debug("[NetBIOS][IPX] response name found msg=0x%04x src=%q dst=%q", + p.MessageID, t.name.String(), p.SourceName.String()) + if err := t.router.Send(out); err != nil { + netlog.Warn("[NetBIOS][IPX] NMPI NameFound send failed: %v", err) + } +} + +func nmpiNameType(name protocol.Name) uint8 { + if name.Type() == protocol.NameTypeGroup { + return protocol.NMPINameTypeWorkgroup + } + return protocol.NMPINameTypeMachine +} + +// handleNameService examines an inbound type-20 packet during a +// pending claim. If the packet's name matches ours and the source +// is some other node, we have a conflict. +func (t *transport) handleNameService(d *ipxproto.Datagram) { + pkt, err := protocol.DecodeNameService(d.Payload) + if err != nil { + return + } + if pkt.Name != t.name { + return + } + // Real conflict. Signal the claim goroutine. + select { + case t.objection <- struct{}{}: + default: + // Channel already armed; one signal is enough. + } +} diff --git a/service/netbios/over_ipx/transport_test.go b/service/netbios/over_ipx/transport_test.go new file mode 100644 index 0000000..5ce1fa8 --- /dev/null +++ b/service/netbios/over_ipx/transport_test.go @@ -0,0 +1,552 @@ +package over_ipx + +import ( + "context" + "sync" + "sync/atomic" + "testing" + "time" + + "github.com/ObsoleteMadness/ClassicStack/capture" + portipx "github.com/ObsoleteMadness/ClassicStack/port/ipx" + ipxproto "github.com/ObsoleteMadness/ClassicStack/protocol/ipx" + netbiosproto "github.com/ObsoleteMadness/ClassicStack/protocol/netbios" + routeripx "github.com/ObsoleteMadness/ClassicStack/router/ipx" + ipxsvc "github.com/ObsoleteMadness/ClassicStack/service/ipx" + "github.com/ObsoleteMadness/ClassicStack/service/netbios" +) + +// recordingPort captures every Send and exposes the delivery +// callback the router installs. +type recordingPort struct { + mu sync.Mutex + sent []*ipxproto.Datagram + cb portipx.DeliveryCallback +} + +func (p *recordingPort) Start() error { return nil } +func (p *recordingPort) Stop() error { return nil } +func (p *recordingPort) Send(d *ipxproto.Datagram) error { + p.mu.Lock() + defer p.mu.Unlock() + cp := *d + p.sent = append(p.sent, &cp) + return nil +} +func (p *recordingPort) SetDeliveryCallback(cb portipx.DeliveryCallback) { + p.mu.Lock() + p.cb = cb + p.mu.Unlock() +} +func (p *recordingPort) SetCaptureSink(_ capture.Sink) {} + +// fakeSAPRegistrar tracks registrations and cancellations. +type fakeSAPRegistrar struct { + mu sync.Mutex + entries []ipxsvc.SAPEntry + canceled atomic.Int32 +} + +type fakeCommandHandler struct { + mu sync.Mutex + datagrams []*netbiosproto.Datagram + contexts []netbios.DatagramContext +} + +func (h *fakeCommandHandler) HandleSession(_ *netbiosproto.SessionPacket) error { return nil } +func (h *fakeCommandHandler) HandleDatagram(d *netbiosproto.Datagram) error { + h.mu.Lock() + defer h.mu.Unlock() + h.datagrams = append(h.datagrams, d) + return nil +} + +func (h *fakeCommandHandler) HandleDatagramContext(d *netbiosproto.Datagram, ctx netbios.DatagramContext) error { + h.mu.Lock() + defer h.mu.Unlock() + h.datagrams = append(h.datagrams, d) + h.contexts = append(h.contexts, ctx) + return nil +} + +func (s *fakeSAPRegistrar) Register(entry ipxsvc.SAPEntry) func() { + s.mu.Lock() + s.entries = append(s.entries, entry) + s.mu.Unlock() + return func() { s.canceled.Add(1) } +} + +func (s *fakeSAPRegistrar) Entries() []ipxsvc.SAPEntry { + s.mu.Lock() + defer s.mu.Unlock() + out := make([]ipxsvc.SAPEntry, len(s.entries)) + copy(out, s.entries) + return out +} + +func setupTransport(t *testing.T) (routeripx.Router, *recordingPort, *fakeSAPRegistrar) { + t.Helper() + r := routeripx.NewRouter() + r.SetIdentity([4]byte{0xCA, 0xFE, 0xF0, 0x0D}, [6]byte{0x02, 0, 0, 0, 0, 0x42}) + port := &recordingPort{} + r.AddPort(port) + return r, port, &fakeSAPRegistrar{} +} + +func waitForSend(t *testing.T, port *recordingPort, n int) { + t.Helper() + deadline := time.Now().Add(time.Second) + for time.Now().Before(deadline) { + port.mu.Lock() + got := len(port.sent) + port.mu.Unlock() + if got >= n { + return + } + time.Sleep(2 * time.Millisecond) + } + port.mu.Lock() + defer port.mu.Unlock() + t.Fatalf("waited for %d sends, only got %d", n, len(port.sent)) +} + +func TestUncontestedNameClaimRegistersWithSAP(t *testing.T) { + r, port, sap := setupTransport(t) + name := netbiosproto.NewName("CLASSICSTACK", netbiosproto.NameTypeFileServer) + tr := NewTransport(r, sap, name).(*transport) + tr.claimRetries = 3 + ticks := make(chan time.Time, 8) + tr.sleep = func(d time.Duration) <-chan time.Time { return ticks } + + if err := tr.Start(context.Background()); err != nil { + t.Fatalf("Start: %v", err) + } + defer tr.Stop() + + // First broadcast goes out before any tick; advance the synthetic + // clock to drive the next two retries to completion. + waitForSend(t, port, 2) + ticks <- time.Now() + waitForSend(t, port, 4) + ticks <- time.Now() + waitForSend(t, port, 6) + ticks <- time.Now() // unblocks loop exit and triggers SAP.Register + + // Wait for the goroutine to publish via SAP. + deadline := time.Now().Add(time.Second) + for time.Now().Before(deadline) { + if len(sap.Entries()) > 0 { + break + } + time.Sleep(2 * time.Millisecond) + } + got := sap.Entries() + if len(got) != 1 { + t.Fatalf("SAP entries: got %d want 1", len(got)) + } + if got[0].ServiceType != ipxsvc.SAPServiceTypeNetBIOS { + t.Errorf("ServiceType: got %x want %x", got[0].ServiceType, ipxsvc.SAPServiceTypeNetBIOS) + } + if got[0].Name != "CLASSICSTACK" { + t.Errorf("Name: got %q", got[0].Name) + } + if got[0].Socket != NBIPXSessionSocket { + t.Errorf("Socket: got %x want %x", got[0].Socket, NBIPXSessionSocket) + } + + // Every retry emits two type-20 broadcasts: NBIPX FindName on + // socket 0x0455 and NMPI ClaimName on socket 0x0551. + port.mu.Lock() + defer port.mu.Unlock() + findCount := 0 + claimCount := 0 + for i, sent := range port.sent { + if sent.Type != netbiosproto.IPXTypeNetBIOS { + t.Errorf("send %d: IPX type %d want %d", i, sent.Type, netbiosproto.IPXTypeNetBIOS) + } + if sent.DstNode != routeripx.BroadcastNode { + t.Errorf("send %d: DstNode not broadcast", i) + } + switch sent.DstSock { + case NBIPXSessionSocket: + findCount++ + pkt, err := netbiosproto.DecodeNameService(sent.Payload) + if err != nil { + t.Errorf("send %d: decode payload: %v", i, err) + continue + } + if pkt.DataStreamType != netbiosproto.NBIPXFindName { + t.Errorf("send %d: stream type %#x want %#x", i, pkt.DataStreamType, netbiosproto.NBIPXFindName) + } + if pkt.Name != name { + t.Errorf("send %d: name %q want %q", i, pkt.Name.String(), name.String()) + } + case NBIPXNameQuerySocket: + claimCount++ + if sent.SrcSock != NBIPXServerSocket { + t.Errorf("send %d: claim src socket %x want %x", i, sent.SrcSock, NBIPXServerSocket) + } + p, err := netbiosproto.DecodeNMPIPacket(sent.Payload) + if err != nil { + t.Errorf("send %d: decode NMPI payload: %v", i, err) + continue + } + if p.Opcode != netbiosproto.NMPIOpNameClaim { + t.Errorf("send %d: NMPI opcode %#x want %#x", i, p.Opcode, netbiosproto.NMPIOpNameClaim) + } + if p.RequestedName != name || p.SourceName != name { + t.Errorf("send %d: claim name mismatch", i) + } + default: + t.Errorf("send %d: unexpected destination socket %x", i, sent.DstSock) + } + } + if findCount != 3 { + t.Fatalf("find-name count: got %d want 3", findCount) + } + if claimCount != 3 { + t.Fatalf("claim-name count: got %d want 3", claimCount) + } +} + +func TestContestedNameClaimAborts(t *testing.T) { + r, port, sap := setupTransport(t) + name := netbiosproto.NewName("CLASSICSTACK", netbiosproto.NameTypeFileServer) + tr := NewTransport(r, sap, name).(*transport) + tr.claimRetries = 6 + ticks := make(chan time.Time, 8) + tr.sleep = func(d time.Duration) <-chan time.Time { return ticks } + + if err := tr.Start(context.Background()); err != nil { + t.Fatalf("Start: %v", err) + } + defer tr.Stop() + + // One broadcast goes out; deliver an inbound objection from + // another node carrying our name. + waitForSend(t, port, 2) + body := netbiosproto.EncodeNameService(&netbiosproto.NBIPXNameServicePacket{Name: name}) + tr.HandleDatagram(&ipxproto.Datagram{ + Type: netbiosproto.IPXTypeNetBIOS, + SrcNet: [4]byte{0xCA, 0xFE, 0xF0, 0x0D}, + SrcNode: [6]byte{0xDE, 0xAD, 0xBE, 0xEF, 0xCA, 0xFE}, // not us + Payload: body, + }) + + // Allow the goroutine to observe the objection and exit. SAP must + // not have been called. + deadline := time.Now().Add(200 * time.Millisecond) + for time.Now().Before(deadline) { + if len(sap.Entries()) > 0 { + t.Fatal("contested claim should not register with SAP") + } + time.Sleep(2 * time.Millisecond) + } +} + +func TestSelfBroadcastNotTreatedAsObjection(t *testing.T) { + r, port, sap := setupTransport(t) + name := netbiosproto.NewName("CLASSICSTACK", netbiosproto.NameTypeFileServer) + tr := NewTransport(r, sap, name).(*transport) + tr.claimRetries = 2 + ticks := make(chan time.Time, 4) + tr.sleep = func(d time.Duration) <-chan time.Time { return ticks } + + if err := tr.Start(context.Background()); err != nil { + t.Fatalf("Start: %v", err) + } + defer tr.Stop() + + waitForSend(t, port, 2) + // Loop back our own broadcast: same source net+node as the + // router's identity. Must be ignored. + body := netbiosproto.EncodeNameService(&netbiosproto.NBIPXNameServicePacket{Name: name}) + tr.HandleDatagram(&ipxproto.Datagram{ + Type: netbiosproto.IPXTypeNetBIOS, + SrcNet: r.Network(), + SrcNode: r.Node(), + Payload: body, + }) + ticks <- time.Now() + waitForSend(t, port, 4) + ticks <- time.Now() // exit loop, register + + deadline := time.Now().Add(time.Second) + for time.Now().Before(deadline) { + if len(sap.Entries()) == 1 { + return + } + time.Sleep(2 * time.Millisecond) + } + t.Fatalf("self-loopback aborted the claim; SAP entries=%d", len(sap.Entries())) +} + +func TestStopCancelsSAPEntry(t *testing.T) { + r, port, sap := setupTransport(t) + name := netbiosproto.NewName("CLASSICSTACK", netbiosproto.NameTypeFileServer) + tr := NewTransport(r, sap, name).(*transport) + tr.claimRetries = 1 + ticks := make(chan time.Time, 2) + tr.sleep = func(d time.Duration) <-chan time.Time { return ticks } + + if err := tr.Start(context.Background()); err != nil { + t.Fatalf("Start: %v", err) + } + waitForSend(t, port, 1) + ticks <- time.Now() // exit + register + + // Wait for the SAP register to land before Stop. + deadline := time.Now().Add(time.Second) + for time.Now().Before(deadline) { + if len(sap.Entries()) == 1 { + break + } + time.Sleep(2 * time.Millisecond) + } + if len(sap.Entries()) != 1 { + t.Fatal("setup precondition: SAP entry not registered") + } + + if err := tr.Stop(); err != nil { + t.Fatalf("Stop: %v", err) + } + if sap.canceled.Load() != 1 { + t.Fatalf("SAP cancel not called: got %d", sap.canceled.Load()) + } +} + +func TestEmptyNameSkipsClaim(t *testing.T) { + r, port, sap := setupTransport(t) + tr := NewTransport(r, sap, netbiosproto.Name{}).(*transport) // empty name + if err := tr.Start(context.Background()); err != nil { + t.Fatalf("Start: %v", err) + } + defer tr.Stop() + + time.Sleep(50 * time.Millisecond) + port.mu.Lock() + if len(port.sent) != 0 { + t.Errorf("empty-name transport sent %d packets, want 0", len(port.sent)) + } + port.mu.Unlock() + if len(sap.Entries()) != 0 { + t.Errorf("empty-name transport registered SAP") + } +} + +func TestSendDatagramEncodesDirectedDatagramPEP(t *testing.T) { + r, port, _ := setupTransport(t) + tr := NewTransport(r, nil, netbiosproto.Name{}).(*transport) + + dg := &netbiosproto.Datagram{ + Destination: netbiosproto.NewName("WORKGROUP", netbiosproto.NameTypeGroup), + Source: netbiosproto.NewName("CLASSICSTACK", netbiosproto.NameTypeFileServer), + Payload: []byte("browse"), + } + if err := tr.SendDatagram(dg); err != nil { + t.Fatalf("SendDatagram: %v", err) + } + + port.mu.Lock() + defer port.mu.Unlock() + if len(port.sent) != 1 { + t.Fatalf("sent count: got %d want 1", len(port.sent)) + } + sent := port.sent[0] + if sent.Type != netbiosproto.IPXTypeNetBIOS { + t.Fatalf("IPX type: got %d want %d", sent.Type, netbiosproto.IPXTypeNetBIOS) + } + if sent.DstSock != NBIPXDatagramSocket { + t.Fatalf("DstSock: got %x want %x", sent.DstSock, NBIPXDatagramSocket) + } + if len(sent.Payload) < netbiosproto.NMPIFixedHeaderLen { + t.Fatalf("payload too short: got %d want >= %d", len(sent.Payload), netbiosproto.NMPIFixedHeaderLen) + } + if sent.Payload[32] != netbiosproto.NMPIOpMailslotSend { + t.Fatalf("opcode: got %#x want %#x", sent.Payload[32], netbiosproto.NMPIOpMailslotSend) + } + if sent.Payload[33] != netbiosproto.NMPINameTypeWorkgroup { + t.Fatalf("name type: got %#x want %#x", sent.Payload[33], netbiosproto.NMPINameTypeWorkgroup) + } +} + +func TestSendDirectedDatagramEncodesUnicastReply(t *testing.T) { + r, port, _ := setupTransport(t) + tr := NewTransport(r, nil, netbiosproto.Name{}).(*transport) + + dg := &netbiosproto.Datagram{ + Destination: netbiosproto.NewName("W98CLIENT", netbiosproto.NameTypeWorkstation), + Source: netbiosproto.NewName("CLASSICSTACK", netbiosproto.NameTypeFileServer), + Payload: []byte("browse"), + } + remote := netbios.DatagramEndpoint{ + Network: [4]byte{0, 0, 0, 0}, + Node: [6]byte{0x08, 0x00, 0x27, 0x14, 0x74, 0x6D}, + Socket: [2]byte{0x05, 0x53}, + } + if err := tr.SendDirectedDatagram(dg, remote); err != nil { + t.Fatalf("SendDirectedDatagram: %v", err) + } + + port.mu.Lock() + defer port.mu.Unlock() + if len(port.sent) != 1 { + t.Fatalf("sent count: got %d want 1", len(port.sent)) + } + sent := port.sent[0] + if sent.DstNet != remote.Network || sent.DstNode != remote.Node || sent.DstSock != remote.Socket { + t.Fatalf("directed IPX destination mismatch") + } + if sent.Payload[33] != netbiosproto.NMPINameTypeMachine { + t.Fatalf("name type: got %#x want %#x", sent.Payload[33], netbiosproto.NMPINameTypeMachine) + } +} + +func TestHandleDirectedDatagramCallsHandler(t *testing.T) { + r, _, _ := setupTransport(t) + tr := NewTransport(r, nil, netbiosproto.Name{}).(*transport) + h := &fakeCommandHandler{} + tr.SetCommandHandler(h) + + dg := &netbiosproto.Datagram{ + Destination: netbiosproto.NewName("WORKGROUP", netbiosproto.NameTypeGroup), + Source: netbiosproto.NewName("CLASSICSTACK", netbiosproto.NameTypeFileServer), + Payload: []byte("host-announcement"), + } + body, err := dg.Encode() + if err != nil { + t.Fatalf("Encode: %v", err) + } + tr.HandleDatagram(&ipxproto.Datagram{ + Type: netbiosproto.IPXTypePEP, + DstSock: NBIPXDatagramSocket, + Payload: append([]byte{0x00, netbiosproto.NBIPXDirectedDatagram}, body...), + }) + + h.mu.Lock() + defer h.mu.Unlock() + if len(h.datagrams) != 1 { + t.Fatalf("datagrams delivered: got %d want 1", len(h.datagrams)) + } + if h.datagrams[0].Source != dg.Source || h.datagrams[0].Destination != dg.Destination { + t.Fatalf("delivered datagram names mismatch") + } +} + +func TestHandleNMPINameQueryRepliesNameFound(t *testing.T) { + r, port, _ := setupTransport(t) + name := netbiosproto.NewName("CLASSICSTACK", netbiosproto.NameTypeFileServer) + tr := NewTransport(r, nil, name).(*transport) + + query := netbiosproto.EncodeNMPIPacket(&netbiosproto.NMPIPacket{ + Opcode: netbiosproto.NMPIOpNameQuery, + NameType: netbiosproto.NMPINameTypeMachine, + MessageID: 0x0042, + RequestedName: name, + SourceName: netbiosproto.NewName("W98CLIENT", netbiosproto.NameTypeWorkstation), + }) + tr.HandleDatagram(&ipxproto.Datagram{ + Type: netbiosproto.IPXTypePEP, + SrcNet: [4]byte{0, 0, 0, 0}, + SrcNode: [6]byte{0x08, 0x00, 0x27, 0x14, 0x74, 0x6D}, + SrcSock: [2]byte{0x05, 0x52}, + DstSock: NBIPXNameQuerySocket, + Payload: query, + }) + + port.mu.Lock() + defer port.mu.Unlock() + if len(port.sent) != 1 { + t.Fatalf("sent count: got %d want 1", len(port.sent)) + } + resp := port.sent[0] + if resp.DstSock != [2]byte{0x05, 0x52} { + t.Fatalf("response dst socket: got %x want 0552", resp.DstSock) + } + if resp.SrcSock != NBIPXNameQuerySocket { + t.Fatalf("response src socket: got %x want %x", resp.SrcSock, NBIPXNameQuerySocket) + } + p, err := netbiosproto.DecodeNMPIPacket(resp.Payload) + if err != nil { + t.Fatalf("Decode response: %v", err) + } + if p.Opcode != netbiosproto.NMPIOpNameFound { + t.Fatalf("opcode: got %#x want %#x", p.Opcode, netbiosproto.NMPIOpNameFound) + } + if p.MessageID != 0x0042 { + t.Fatalf("message id: got %#x want 0x0042", p.MessageID) + } +} + +func TestHandleNMPIMailslotSendCallsHandler(t *testing.T) { + r, _, _ := setupTransport(t) + tr := NewTransport(r, nil, netbiosproto.Name{}).(*transport) + h := &fakeCommandHandler{} + tr.SetCommandHandler(h) + + src := netbiosproto.NewName("W98CLIENT", netbiosproto.NameTypeWorkstation) + dst := netbiosproto.NewName("WORKGROUP", netbiosproto.NameTypeGroup) + msg := []byte("browser") + tr.HandleDatagram(&ipxproto.Datagram{ + Type: netbiosproto.IPXTypeNetBIOS, + DstSock: NBIPXDatagramSocket, + Payload: netbiosproto.EncodeNMPIPacket(&netbiosproto.NMPIPacket{ + Opcode: netbiosproto.NMPIOpMailslotSend, + NameType: netbiosproto.NMPINameTypeWorkgroup, + RequestedName: dst, + SourceName: src, + Payload: msg, + }), + }) + + h.mu.Lock() + defer h.mu.Unlock() + if len(h.datagrams) != 1 { + t.Fatalf("datagrams delivered: got %d want 1", len(h.datagrams)) + } + if h.datagrams[0].Source != src || h.datagrams[0].Destination != dst { + t.Fatalf("delivered datagram names mismatch") + } + if string(h.datagrams[0].Payload) != string(msg) { + t.Fatalf("payload mismatch: got %q want %q", string(h.datagrams[0].Payload), string(msg)) + } + if len(h.contexts) != 1 { + t.Fatalf("contexts delivered: got %d want 1", len(h.contexts)) + } + if h.contexts[0].Remote.Socket != [2]byte{0x00, 0x00} { + // This synthetic test does not populate IPX source fields. + t.Fatalf("unexpected remote socket: got %x want 0000", h.contexts[0].Remote.Socket) + } +} + +func TestHandleNMPISelfLoopbackIgnored(t *testing.T) { + r, _, _ := setupTransport(t) + tr := NewTransport(r, nil, netbiosproto.Name{}).(*transport) + h := &fakeCommandHandler{} + tr.SetCommandHandler(h) + + src := netbiosproto.NewName("CLASSICSTACK", netbiosproto.NameTypeFileServer) + dst := netbiosproto.NewName("WORKGROUP", netbiosproto.NameTypeGroup) + tr.HandleDatagram(&ipxproto.Datagram{ + Type: netbiosproto.IPXTypeNetBIOS, + SrcNet: r.Network(), + SrcNode: r.Node(), + SrcSock: NBIPXDatagramSocket, + DstNet: r.Network(), + DstNode: routeripx.BroadcastNode, + DstSock: NBIPXDatagramSocket, + Payload: netbiosproto.EncodeNMPIPacket(&netbiosproto.NMPIPacket{ + Opcode: netbiosproto.NMPIOpMailslotSend, + NameType: netbiosproto.NMPINameTypeWorkgroup, + RequestedName: dst, + SourceName: src, + Payload: []byte("election"), + }), + }) + + h.mu.Lock() + defer h.mu.Unlock() + if len(h.datagrams) != 0 { + t.Fatalf("self-looped datagram should be ignored; got %d delivered", len(h.datagrams)) + } +} diff --git a/service/netbios/over_netbeui/name_table.go b/service/netbios/over_netbeui/name_table.go new file mode 100644 index 0000000..7d500c0 --- /dev/null +++ b/service/netbios/over_netbeui/name_table.go @@ -0,0 +1,132 @@ +package over_netbeui + +import ( + "sync" + + protocol "github.com/ObsoleteMadness/ClassicStack/protocol/netbios" +) + +// nameState tracks the lifecycle of a locally registered name. +type nameState uint8 + +const ( + // nameStateClaiming means we have broadcast ADD_NAME_QUERY but + // have not yet confirmed uniqueness. + nameStateClaiming nameState = iota + // nameStateRegistered means the name is confirmed unique (or is + // a group name that passed conflict checks). + nameStateRegistered + // nameStateConflict means a NAME_IN_CONFLICT was received. + nameStateConflict +) + +// nameEntry is a single name registered at this node. +type nameEntry struct { + Name protocol.Name + IsGroup bool + State nameState + // Number is the local name number (1-based) assigned at + // registration, used to build NAME_NUMBER_1 when required by + // the wire protocol. 0 means not yet assigned. + Number uint8 +} + +// nameTable is a thread-safe registry of locally owned NetBIOS names. +type nameTable struct { + mu sync.RWMutex + names map[protocol.Name]*nameEntry + nextNum uint8 // next name number to assign (1–254) +} + +func newNameTable() *nameTable { + return &nameTable{ + names: make(map[protocol.Name]*nameEntry), + nextNum: 1, + } +} + +// Add registers a name in the claiming state. Returns the entry so +// the caller can transition it to registered after the claim cycle. +// Returns nil if the name is already registered. +func (t *nameTable) Add(name protocol.Name, isGroup bool) *nameEntry { + t.mu.Lock() + defer t.mu.Unlock() + if _, ok := t.names[name]; ok { + return nil + } + num := t.nextNum + if t.nextNum < 254 { + t.nextNum++ + } + e := &nameEntry{ + Name: name, + IsGroup: isGroup, + State: nameStateClaiming, + Number: num, + } + t.names[name] = e + return e +} + +// Remove deletes a name from the table. +func (t *nameTable) Remove(name protocol.Name) { + t.mu.Lock() + delete(t.names, name) + t.mu.Unlock() +} + +// Lookup returns the entry for name, or nil if not found. +func (t *nameTable) Lookup(name protocol.Name) *nameEntry { + t.mu.RLock() + defer t.mu.RUnlock() + return t.names[name] +} + +// IsLocal returns true if name is registered locally. +func (t *nameTable) IsLocal(name protocol.Name) bool { + t.mu.RLock() + defer t.mu.RUnlock() + _, ok := t.names[name] + return ok +} + +// SetState updates the state of a registered name. +func (t *nameTable) SetState(name protocol.Name, state nameState) { + t.mu.Lock() + if e, ok := t.names[name]; ok { + e.State = state + } + t.mu.Unlock() +} + +// All returns a snapshot of all entries. +func (t *nameTable) All() []*nameEntry { + t.mu.RLock() + defer t.mu.RUnlock() + out := make([]*nameEntry, 0, len(t.names)) + for _, e := range t.names { + out = append(out, e) + } + return out +} + +// Registered returns all names in the registered state. +func (t *nameTable) Registered() []*nameEntry { + t.mu.RLock() + defer t.mu.RUnlock() + var out []*nameEntry + for _, e := range t.names { + if e.State == nameStateRegistered { + out = append(out, e) + } + } + return out +} + +// nameNumber1 builds the NAME_NUMBER_1 encoding: 10 zero bytes +// followed by the 6-byte permanent adapter address (MAC). +func nameNumber1(mac [6]byte) protocol.Name { + var n protocol.Name + copy(n[10:], mac[:]) + return n +} diff --git a/service/netbios/over_netbeui/session.go b/service/netbios/over_netbeui/session.go new file mode 100644 index 0000000..93a37a4 --- /dev/null +++ b/service/netbios/over_netbeui/session.go @@ -0,0 +1,20 @@ +package over_netbeui + +import protocol "github.com/ObsoleteMadness/ClassicStack/protocol/netbios" + +type sessionState = protocol.SessionState + +const ( + sessionStateInit = protocol.SessionStateInit + sessionStateActive = protocol.SessionStateActive + sessionStateClosing = protocol.SessionStateClosing + sessionStateClosed = protocol.SessionStateClosed +) + +type session = protocol.Session[[6]byte] + +type sessionTable = protocol.SessionTable[[6]byte] + +func newSessionTable() *sessionTable { + return protocol.NewSessionTable[[6]byte](1, 254) +} diff --git a/service/netbios/over_netbeui/transport.go b/service/netbios/over_netbeui/transport.go new file mode 100644 index 0000000..43cb361 --- /dev/null +++ b/service/netbios/over_netbeui/transport.go @@ -0,0 +1,943 @@ +// Package over_netbeui adapts a NetBEUI port to the netbios.Transport +// contract. It implements the NBF (NetBIOS Frames Protocol) state +// machine over 802.2 LLC UI frames on Ethernet, providing: +// +// - Name management: ADD_NAME_QUERY / ADD_NAME_RESPONSE / NAME_IN_CONFLICT +// - Name resolution: NAME_QUERY / NAME_RECOGNIZED +// - Datagram delivery: DATAGRAM / DATAGRAM_BROADCAST +// - Session establishment: NAME_QUERY → NAME_RECOGNIZED → SESSION_INITIALIZE → SESSION_CONFIRM +// - Session data transfer: DATA_ONLY_LAST / DATA_FIRST_MIDDLE / DATA_ACK +// - Session teardown: SESSION_END +// - Keepalive: SESSION_ALIVE +// +// Wire format per IBM SC30-3587 Chapter 5. +package over_netbeui + +import ( + "context" + "sync" + "sync/atomic" + "time" + + "github.com/ObsoleteMadness/ClassicStack/netlog" + "github.com/ObsoleteMadness/ClassicStack/port/netbeui" + nbfproto "github.com/ObsoleteMadness/ClassicStack/protocol/netbeui" + protocol "github.com/ObsoleteMadness/ClassicStack/protocol/netbios" + nb "github.com/ObsoleteMadness/ClassicStack/service/netbios" +) + +// IBM defaults from spec §5.6.1: +// NCB.TRANSMIT.COUNT = 6, NCB.TRANSMIT.TIMEOUT = 500ms. +const ( + defaultTransmitCount = 6 + defaultTransmitTimeout = 500 * time.Millisecond +) + +type transport struct { + port netbeui.Port + + mu sync.RWMutex + handler nb.CommandHandler + + names *nameTable + sessions *sessionTable + + // correlator is a monotonically increasing counter for generating + // unique response correlator values. + correlator atomic.Uint32 + + // srcMAC is cached from the port for building NAME_NUMBER_1. + srcMAC [6]byte + + fragMu sync.Mutex + frags map[[7]byte][]byte + + txMu sync.Mutex + txBlocked map[[7]byte]bool + txLastFrame map[[7]byte]*nbfproto.Frame + txPendingFrames map[[7]byte][]*nbfproto.Frame + sessionMaxPayload map[[7]byte]uint16 + + cancel context.CancelFunc +} + +// NewTransport returns a netbios.Transport backed by an existing +// NetBEUI port. The port must already be configured (source MAC, +// rawlink open) by the caller. srcMAC is the local adapter's MAC +// address, needed for NAME_NUMBER_1 construction and directed replies. +func NewTransport(p netbeui.Port, srcMAC [6]byte) nb.Transport { + t := &transport{ + port: p, + names: newNameTable(), + sessions: newSessionTable(), + srcMAC: srcMAC, + frags: map[[7]byte][]byte{}, + txBlocked: map[[7]byte]bool{}, + txLastFrame: map[[7]byte]*nbfproto.Frame{}, + txPendingFrames: map[[7]byte][]*nbfproto.Frame{}, + sessionMaxPayload: map[[7]byte]uint16{}, + } + t.correlator.Store(1) + return t +} + +func (t *transport) Start(_ context.Context) error { + t.port.SetDeliveryCallback(t.onFrame) + return nil +} + +func (t *transport) Stop() error { + t.port.SetDeliveryCallback(nil) + if t.cancel != nil { + t.cancel() + } + return nil +} + +func (t *transport) SetCommandHandler(h nb.CommandHandler) { + t.mu.Lock() + t.handler = h + t.mu.Unlock() +} + +func nbfCommandName(cmd uint8) string { + switch cmd { + case nbfproto.CmdAddGroupNameQuery: + return "ADD_GROUP_NAME_QUERY" + case nbfproto.CmdAddNameQuery: + return "ADD_NAME_QUERY" + case nbfproto.CmdNameInConflict: + return "NAME_IN_CONFLICT" + case nbfproto.CmdStatusQuery: + return "STATUS_QUERY" + case nbfproto.CmdTerminateTraceRemote: + return "TERMINATE_TRACE_REMOTE" + case nbfproto.CmdDatagram: + return "DATAGRAM" + case nbfproto.CmdDatagramBroadcast: + return "DATAGRAM_BROADCAST" + case nbfproto.CmdNameQuery: + return "NAME_QUERY" + case nbfproto.CmdAddNameResponse: + return "ADD_NAME_RESPONSE" + case nbfproto.CmdNameRecognized: + return "NAME_RECOGNIZED" + case nbfproto.CmdStatusResponse: + return "STATUS_RESPONSE" + case nbfproto.CmdTerminateTraceLocal: + return "TERMINATE_TRACE_LOCAL" + case nbfproto.CmdDataAck: + return "DATA_ACK" + case nbfproto.CmdDataFirstMiddle: + return "DATA_FIRST_MIDDLE" + case nbfproto.CmdDataOnlyLast: + return "DATA_ONLY_LAST" + case nbfproto.CmdSessionConfirm: + return "SESSION_CONFIRM" + case nbfproto.CmdSessionEnd: + return "SESSION_END" + case nbfproto.CmdSessionInitialize: + return "SESSION_INITIALIZE" + case nbfproto.CmdNoReceive: + return "NO_RECEIVE" + case nbfproto.CmdReceiveOutstanding: + return "RECEIVE_OUTSTANDING" + case nbfproto.CmdReceiveContinue: + return "RECEIVE_CONTINUE" + case nbfproto.CmdSessionAlive: + return "SESSION_ALIVE" + default: + return "UNKNOWN" + } +} + +func (t *transport) sendFrame(dstMAC [6]byte, frame *nbfproto.Frame, reason string) error { + netlog.Debug("[NetBEUI] tx %s(0x%02X) dst=%02X:%02X:%02X:%02X:%02X:%02X dnum=%d snum=%d data2=0x%04X payload=%d reason=%s", + nbfCommandName(frame.Command), frame.Command, + dstMAC[0], dstMAC[1], dstMAC[2], dstMAC[3], dstMAC[4], dstMAC[5], + frame.DestNumber, frame.SourceNumber, frame.Data2, len(frame.Payload), reason) + return t.port.Send(dstMAC, frame) +} + +func (t *transport) sendBroadcastFrame(frame *nbfproto.Frame, reason string) error { + netlog.Debug("[NetBEUI] tx %s(0x%02X) dst=broadcast dnum=%d snum=%d data2=0x%04X payload=%d reason=%s", + nbfCommandName(frame.Command), frame.Command, + frame.DestNumber, frame.SourceNumber, frame.Data2, len(frame.Payload), reason) + return t.port.SendBroadcast(frame) +} + +// sessionForInbound resolves a session table entry for an inbound +// session frame and enforces expected remote session number/state. +func (t *transport) sessionForInbound(srcMAC [6]byte, destNum, sourceNum uint8, requireActive bool) *session { + sess := t.sessions.Lookup(srcMAC, destNum) + if sess == nil { + return nil + } + + sess.Mu.Lock() + defer sess.Mu.Unlock() + + // Once the remote session number is learned, inbound session frames + // must match it to avoid cross-session confusion. + if sess.RemoteNum != 0 && sourceNum != 0 && sess.RemoteNum != sourceNum { + return nil + } + if requireActive && sess.State != sessionStateActive { + return nil + } + return sess +} + +// nextCorrelator returns a unique 16-bit correlator value. +func (t *transport) nextCorrelator() uint16 { + for { + v := t.correlator.Add(1) + if v != 0 { // avoid zero which means "unused" on the wire + return uint16(v) + } + } +} + +// --- Name Service --- + +// SendName claims a NetBIOS name on the network by broadcasting +// ADD_NAME_QUERY per spec §5.6.2. Retries defaultTransmitCount +// times at defaultTransmitTimeout intervals. The name is registered +// locally if no ADD_NAME_RESPONSE (conflict) is received. +func (t *transport) SendName(name protocol.Name) error { + isGroup := false // ADD_NAME_QUERY is for unique names + entry := t.names.Add(name, isGroup) + if entry == nil { + // Already registered. + return nil + } + + corr := t.nextCorrelator() + + frame := &nbfproto.Frame{ + Command: nbfproto.CmdAddNameQuery, + RspCorrelator: corr, + } + copy(frame.SourceName[:], name[:]) + + for i := 0; i < defaultTransmitCount; i++ { + if err := t.sendBroadcastFrame(frame, "name-claim"); err != nil { + netlog.Warn("[NetBEUI] ADD_NAME_QUERY send error: %v", err) + } + time.Sleep(defaultTransmitTimeout) + } + + // If no conflict was detected during the claim window, mark registered. + if entry.State == nameStateClaiming { + t.names.SetState(name, nameStateRegistered) + netlog.Info("[NetBEUI] name registered: %s", name.String()) + } + return nil +} + +// SendDatagram wraps a NetBIOS datagram in an NBF DATAGRAM (0x08) +// frame and broadcasts it. +func (t *transport) SendDatagram(d *protocol.Datagram) error { + payload, err := d.Encode() + if err != nil { + return err + } + + frame := &nbfproto.Frame{ + Command: nbfproto.CmdDatagram, + } + copy(frame.DestinationName[:], d.Destination[:]) + copy(frame.SourceName[:], d.Source[:]) + frame.Payload = payload[2*protocol.NameLength:] // just user data, names are in header + + return t.sendBroadcastFrame(frame, "datagram") +} + +// SendDirectedDatagram sends a NetBIOS datagram directly to a known +// destination MAC (from remote.Node). If remote.Node is empty, it +// falls back to broadcast transport. +func (t *transport) SendDirectedDatagram(d *protocol.Datagram, remote nb.DatagramEndpoint) error { + payload, err := d.Encode() + if err != nil { + return err + } + + frame := &nbfproto.Frame{ + Command: nbfproto.CmdDatagram, + } + copy(frame.DestinationName[:], d.Destination[:]) + copy(frame.SourceName[:], d.Source[:]) + frame.Payload = payload[2*protocol.NameLength:] + + if remote.Node == ([6]byte{}) { + return t.sendBroadcastFrame(frame, "directed-datagram-fallback") + } + return t.sendFrame(remote.Node, frame, "directed-datagram") +} + +// SendSession maps a session packet onto NBF DATA_ONLY_LAST frames. +// This is a simplified implementation that sends each packet as a +// single DATA_ONLY_LAST (no segmentation). +func (t *transport) SendSession(s *protocol.SessionPacket) error { + // Find the first active session to send on. A real implementation + // would route by session, but we have a single-session stub here. + sessions := t.sessions.All() + if len(sessions) == 0 { + return nb.ErrNotImplemented + } + + sess := sessions[0] + sess.Mu.Lock() + if sess.State != sessionStateActive { + sess.Mu.Unlock() + return nb.ErrNotImplemented + } + + corr := t.nextCorrelator() + destNum := sess.RemoteNum + srcNum := sess.LocalNum + remoteMac := sess.RemoteAddr + sess.LastXmitCorrelator = corr + sess.Mu.Unlock() + return t.sendSessionPayload(remoteMac, srcNum, destNum, s.Payload) +} + +// --- Inbound Frame Dispatch --- + +func (t *transport) onFrame(srcMAC, dstMAC [6]byte, frame *nbfproto.Frame) { + netlog.Debug("[NetBEUI] rx %s(0x%02X) src=%02X:%02X:%02X:%02X:%02X:%02X dst=%02X:%02X:%02X:%02X:%02X:%02X dnum=%d snum=%d data2=0x%04X xmit=0x%04X rsp=0x%04X payload=%d", + nbfCommandName(frame.Command), frame.Command, + srcMAC[0], srcMAC[1], srcMAC[2], srcMAC[3], srcMAC[4], srcMAC[5], + dstMAC[0], dstMAC[1], dstMAC[2], dstMAC[3], dstMAC[4], dstMAC[5], + frame.DestNumber, frame.SourceNumber, frame.Data2, frame.XmitCorrelator, frame.RspCorrelator, len(frame.Payload)) + switch frame.Command { + // --- Name management --- + case nbfproto.CmdAddNameQuery, nbfproto.CmdAddGroupNameQuery: + t.handleAddNameQuery(srcMAC, frame) + case nbfproto.CmdAddNameResponse: + t.handleAddNameResponse(frame) + case nbfproto.CmdNameInConflict: + t.handleNameInConflict(frame) + + // --- Name resolution / session establishment --- + case nbfproto.CmdNameQuery: + t.handleNameQuery(srcMAC, frame) + case nbfproto.CmdNameRecognized: + t.handleNameRecognized(srcMAC, frame) + + // --- Session lifecycle --- + case nbfproto.CmdSessionInitialize: + t.handleSessionInitialize(srcMAC, frame) + case nbfproto.CmdSessionConfirm: + t.handleSessionConfirm(srcMAC, frame) + case nbfproto.CmdSessionEnd: + t.handleSessionEnd(srcMAC, frame) + case nbfproto.CmdSessionAlive: + t.handleSessionAlive(srcMAC, frame) + + // --- Session data --- + case nbfproto.CmdDataOnlyLast: + t.handleDataOnlyLast(srcMAC, frame) + case nbfproto.CmdDataFirstMiddle: + t.handleDataFirstMiddle(srcMAC, frame) + case nbfproto.CmdDataAck: + t.handleDataAck(srcMAC, frame) + + // --- Datagram --- + case nbfproto.CmdDatagram: + t.handleDatagram(srcMAC, frame) + case nbfproto.CmdDatagramBroadcast: + t.handleDatagramBroadcast(srcMAC, frame) + + // --- Flow control --- + case nbfproto.CmdNoReceive: + t.handleNoReceive(srcMAC, frame) + case nbfproto.CmdReceiveOutstanding: + t.handleReceiveOutstanding(srcMAC, frame) + case nbfproto.CmdReceiveContinue: + t.handleReceiveContinue(srcMAC, frame) + + // --- Status --- + case nbfproto.CmdStatusQuery: + t.handleStatusQuery(srcMAC, frame) + case nbfproto.CmdStatusResponse: + t.handleStatusResponse(srcMAC, frame) + + default: + netlog.Debug("[NetBEUI] unknown command 0x%02X from %02X:%02X:%02X:%02X:%02X:%02X", + frame.Command, srcMAC[0], srcMAC[1], srcMAC[2], srcMAC[3], srcMAC[4], srcMAC[5]) + } +} + +// --- Name Management Handlers --- + +// handleAddNameQuery: a remote node is claiming a name. If we own it +// as a unique name, respond with ADD_NAME_RESPONSE. +func (t *transport) handleAddNameQuery(srcMAC [6]byte, frame *nbfproto.Frame) { + queriedName := frame.SourceName // spec §5.6.2: source name = name being added + entry := t.names.Lookup(protocol.Name(queriedName)) + if entry == nil || entry.IsGroup { + return // we don't own it or it's a group name (no conflict) + } + if entry.State != nameStateRegistered { + return + } + + // Conflict: respond with ADD_NAME_RESPONSE. + resp := &nbfproto.Frame{ + Command: nbfproto.CmdAddNameResponse, + Data1: 0x00, // not in add-name process + XmitCorrelator: frame.RspCorrelator, + } + copy(resp.DestinationName[:], queriedName[:]) + copy(resp.SourceName[:], queriedName[:]) + + if err := t.sendFrame(srcMAC, resp, "add-name-response"); err != nil { + netlog.Warn("[NetBEUI] ADD_NAME_RESPONSE send error: %v", err) + } + netlog.Info("[NetBEUI] sent ADD_NAME_RESPONSE for %q to %02X:%02X:%02X:%02X:%02X:%02X", + protocol.Name(queriedName).String(), + srcMAC[0], srcMAC[1], srcMAC[2], srcMAC[3], srcMAC[4], srcMAC[5]) +} + +// handleAddNameResponse: someone else already owns the name we're +// trying to claim. Mark the name as conflicted. +func (t *transport) handleAddNameResponse(frame *nbfproto.Frame) { + conflictName := frame.DestinationName + entry := t.names.Lookup(protocol.Name(conflictName)) + if entry == nil { + return + } + if entry.State == nameStateClaiming { + t.names.SetState(protocol.Name(conflictName), nameStateConflict) + netlog.Warn("[NetBEUI] name conflict: %q already owned by another node", + protocol.Name(conflictName).String()) + } +} + +// handleNameInConflict: a remote node detected a name conflict. +func (t *transport) handleNameInConflict(frame *nbfproto.Frame) { + conflictName := frame.DestinationName + if t.names.IsLocal(protocol.Name(conflictName)) { + t.names.SetState(protocol.Name(conflictName), nameStateConflict) + netlog.Warn("[NetBEUI] NAME_IN_CONFLICT received for %q", + protocol.Name(conflictName).String()) + } +} + +// --- Name Resolution / Session Establishment --- + +// handleNameQuery: a remote node is looking for a name (CALL or +// FIND.NAME). If we own it, respond with NAME_RECOGNIZED. +func (t *transport) handleNameQuery(srcMAC [6]byte, frame *nbfproto.Frame) { + destName := frame.DestinationName + entry := t.names.Lookup(protocol.Name(destName)) + if entry == nil || entry.State != nameStateRegistered { + return // not our name + } + + // Determine if this is a session request or just FIND.NAME. + // The Data2 low byte in NAME_QUERY indicates the caller's + // local session number (0 = FIND.NAME, >0 = CALL). + callerSession := uint8(frame.Data2 & 0xFF) + + // Create a session if this is a CALL. + var localSessionNum uint8 + if callerSession != 0 { + sess := t.sessions.LookupByRemote(srcMAC, callerSession) + if sess == nil { + sess = t.sessions.Create(srcMAC) + sess.Mu.Lock() + sess.RemoteNum = callerSession + sess.Mu.Unlock() + } + localSessionNum = sess.LocalNum + } + + resp := &nbfproto.Frame{ + Command: nbfproto.CmdNameRecognized, + XmitCorrelator: frame.RspCorrelator, + RspCorrelator: uint16(localSessionNum), + } + // DATA2: high byte = name type (0=unique, 1=group), + // low byte = session number (0=no listen, 1-FE=session number) + nameType := uint16(0x00) // unique + if entry.IsGroup { + nameType = 0x01 + } + resp.Data2 = (nameType << 8) | uint16(localSessionNum) + copy(resp.DestinationName[:], frame.SourceName[:]) + copy(resp.SourceName[:], destName[:]) + + if err := t.sendFrame(srcMAC, resp, "name-recognized"); err != nil { + netlog.Warn("[NetBEUI] NAME_RECOGNIZED send error: %v", err) + } + netlog.Info("[NetBEUI] NAME_RECOGNIZED for %q (session=%d) to %02X:%02X:%02X:%02X:%02X:%02X", + protocol.Name(destName).String(), localSessionNum, + srcMAC[0], srcMAC[1], srcMAC[2], srcMAC[3], srcMAC[4], srcMAC[5]) +} + +// handleNameRecognized: response to our NAME_QUERY. +func (t *transport) handleNameRecognized(srcMAC [6]byte, frame *nbfproto.Frame) { + sessionNum := uint8(frame.Data2 & 0xFF) + if sessionNum == 0 { + netlog.Debug("[NetBEUI] NAME_RECOGNIZED (FIND.NAME) from %02X:%02X:%02X:%02X:%02X:%02X", + srcMAC[0], srcMAC[1], srcMAC[2], srcMAC[3], srcMAC[4], srcMAC[5]) + return + } + netlog.Info("[NetBEUI] NAME_RECOGNIZED (session=%d) from %02X:%02X:%02X:%02X:%02X:%02X", + sessionNum, srcMAC[0], srcMAC[1], srcMAC[2], srcMAC[3], srcMAC[4], srcMAC[5]) +} + +// --- Session Lifecycle --- + +// handleSessionInitialize: the caller sends this after receiving +// NAME_RECOGNIZED to start the session. +func (t *transport) handleSessionInitialize(srcMAC [6]byte, frame *nbfproto.Frame) { + // Find the session we created during NAME_RECOGNIZED. + destNum := frame.DestNumber // our session number + srcNum := frame.SourceNumber // caller's session number + + sess := t.sessions.Lookup(srcMAC, destNum) + if sess == nil { + netlog.Warn("[NetBEUI] SESSION_INITIALIZE for unknown session %d from %02X:%02X:%02X:%02X:%02X:%02X", + destNum, srcMAC[0], srcMAC[1], srcMAC[2], srcMAC[3], srcMAC[4], srcMAC[5]) + return + } + + sess.Mu.Lock() + sess.RemoteNum = srcNum + sess.State = sessionStateActive + sess.Mu.Unlock() + t.txMu.Lock() + t.sessionMaxPayload[sessionWireKey(srcMAC, destNum)] = 1464 + t.txMu.Unlock() + + // Reply with SESSION_CONFIRM. + confirm := &nbfproto.Frame{ + Command: nbfproto.CmdSessionConfirm, + XmitCorrelator: frame.RspCorrelator, + RspCorrelator: t.nextCorrelator(), + DestNumber: srcNum, + SourceNumber: destNum, + } + // Data2 carries the max receive size (we advertise the spec + // default maximum I-field for Ethernet: 1500 - LLC overhead). + confirm.Data2 = 1464 + + if err := t.sendFrame(srcMAC, confirm, "session-confirm"); err != nil { + netlog.Warn("[NetBEUI] SESSION_CONFIRM send error: %v", err) + } + netlog.Info("[NetBEUI] session %d↔%d established with %02X:%02X:%02X:%02X:%02X:%02X", + destNum, srcNum, + srcMAC[0], srcMAC[1], srcMAC[2], srcMAC[3], srcMAC[4], srcMAC[5]) +} + +// handleSessionConfirm: the responder confirmed our session. +func (t *transport) handleSessionConfirm(srcMAC [6]byte, frame *nbfproto.Frame) { + localNum := frame.DestNumber + remoteNum := frame.SourceNumber + + sess := t.sessions.Lookup(srcMAC, localNum) + if sess == nil { + netlog.Warn("[NetBEUI] SESSION_CONFIRM for unknown session %d", localNum) + return + } + + sess.Mu.Lock() + sess.RemoteNum = remoteNum + sess.State = sessionStateActive + sess.Mu.Unlock() + if frame.Data2 != 0 { + t.txMu.Lock() + t.sessionMaxPayload[sessionWireKey(srcMAC, localNum)] = frame.Data2 + t.txMu.Unlock() + } + + netlog.Info("[NetBEUI] session %d↔%d confirmed by %02X:%02X:%02X:%02X:%02X:%02X", + localNum, remoteNum, + srcMAC[0], srcMAC[1], srcMAC[2], srcMAC[3], srcMAC[4], srcMAC[5]) +} + +// handleSessionEnd: peer is tearing down the session. +func (t *transport) handleSessionEnd(srcMAC [6]byte, frame *nbfproto.Frame) { + localNum := frame.DestNumber + sess := t.sessionForInbound(srcMAC, localNum, frame.SourceNumber, false) + if sess == nil { + return + } + sess.Mu.Lock() + sess.State = sessionStateClosed + sess.Mu.Unlock() + t.fragMu.Lock() + delete(t.frags, sessionFragmentKey(srcMAC, localNum)) + t.fragMu.Unlock() + t.txMu.Lock() + key := sessionWireKey(srcMAC, localNum) + delete(t.txBlocked, key) + delete(t.txLastFrame, key) + delete(t.txPendingFrames, key) + delete(t.sessionMaxPayload, key) + t.txMu.Unlock() + t.sessions.Remove(srcMAC, localNum) + + netlog.Info("[NetBEUI] session %d ended by %02X:%02X:%02X:%02X:%02X:%02X", + localNum, srcMAC[0], srcMAC[1], srcMAC[2], srcMAC[3], srcMAC[4], srcMAC[5]) +} + +// handleSessionAlive: keepalive probe — just log it. +func (t *transport) handleSessionAlive(srcMAC [6]byte, frame *nbfproto.Frame) { + if t.sessionForInbound(srcMAC, frame.DestNumber, frame.SourceNumber, false) == nil { + return + } + netlog.Debug("[NetBEUI] SESSION_ALIVE from %02X:%02X:%02X:%02X:%02X:%02X session %d", + srcMAC[0], srcMAC[1], srcMAC[2], srcMAC[3], srcMAC[4], srcMAC[5], + frame.DestNumber) +} + +// --- Session Data Transfer --- + +// handleDataOnlyLast: received a complete data message. Deliver to +// the handler and send DATA_ACK. +func (t *transport) handleDataOnlyLast(srcMAC [6]byte, frame *nbfproto.Frame) { + localNum := frame.DestNumber + sess := t.sessionForInbound(srcMAC, localNum, frame.SourceNumber, true) + if sess == nil { + return + } + + payload := frame.Payload + t.fragMu.Lock() + if head, ok := t.frags[sessionFragmentKey(srcMAC, localNum)]; ok { + payload = append(append([]byte(nil), head...), frame.Payload...) + delete(t.frags, sessionFragmentKey(srcMAC, localNum)) + } + t.fragMu.Unlock() + + // Send DATA_ACK. + ack := &nbfproto.Frame{ + Command: nbfproto.CmdDataAck, + XmitCorrelator: frame.RspCorrelator, + DestNumber: frame.SourceNumber, + SourceNumber: localNum, + } + if err := t.sendFrame(srcMAC, ack, "data-ack"); err != nil { + netlog.Warn("[NetBEUI] DATA_ACK send error: %v", err) + } + + // Deliver to the command handler. + t.mu.RLock() + handler := t.handler + t.mu.RUnlock() + if handler == nil { + return + } + + pkt := &protocol.SessionPacket{ + Type: protocol.SessionMessage, + Payload: payload, + } + + if sh, ok := handler.(nb.ContextualSessionHandler); ok { + resp, err := sh.HandleSessionContext(pkt, nb.SessionContext{ + Local: nb.DatagramEndpoint{Node: t.srcMAC}, + Remote: nb.DatagramEndpoint{Node: srcMAC}, + SourceConnID: uint16(frame.SourceNumber), + DestConnID: uint16(localNum), + }) + if err != nil { + netlog.Warn("[NetBEUI] contextual session handler error: %v", err) + return + } + if resp != nil && len(resp.Payload) > 0 { + if err := t.sendSessionPayload(srcMAC, localNum, frame.SourceNumber, resp.Payload); err != nil { + netlog.Warn("[NetBEUI] response session send error: %v", err) + } + } + return + } + if err := handler.HandleSession(pkt); err != nil { + netlog.Warn("[NetBEUI] session handler error: %v", err) + } +} + +// handleDataFirstMiddle: first or middle segment of a multi-segment +// message. In this simplified implementation we deliver each segment +// as a standalone packet. +func (t *transport) handleDataFirstMiddle(srcMAC [6]byte, frame *nbfproto.Frame) { + localNum := frame.DestNumber + if t.sessionForInbound(srcMAC, localNum, frame.SourceNumber, true) == nil { + return + } + t.fragMu.Lock() + key := sessionFragmentKey(srcMAC, localNum) + t.frags[key] = append(t.frags[key], frame.Payload...) + t.fragMu.Unlock() +} + +// handleDataAck: the remote acknowledged our DATA_ONLY_LAST. +func (t *transport) handleDataAck(srcMAC [6]byte, frame *nbfproto.Frame) { + localNum := frame.DestNumber + sess := t.sessionForInbound(srcMAC, localNum, frame.SourceNumber, true) + if sess == nil { + return + } + sess.Mu.Lock() + defer sess.Mu.Unlock() + if frame.XmitCorrelator != 0 && sess.LastXmitCorrelator != 0 && frame.XmitCorrelator != sess.LastXmitCorrelator { + return + } + sess.LastXmitCorrelator = 0 + netlog.Debug("[NetBEUI] DATA_ACK for session %d from %02X:%02X:%02X:%02X:%02X:%02X", + localNum, srcMAC[0], srcMAC[1], srcMAC[2], srcMAC[3], srcMAC[4], srcMAC[5]) +} + +// --- Datagram Handlers --- + +func (t *transport) handleDatagram(srcMAC [6]byte, frame *nbfproto.Frame) { + t.mu.RLock() + handler := t.handler + t.mu.RUnlock() + if handler == nil { + return + } + + d := &protocol.Datagram{ + Destination: protocol.Name(frame.DestinationName), + Source: protocol.Name(frame.SourceName), + Payload: frame.Payload, + } + if ch, ok := handler.(nb.ContextualDatagramHandler); ok { + if err := ch.HandleDatagramContext(d, nb.DatagramContext{ + Local: nb.DatagramEndpoint{Node: t.srcMAC}, + Remote: nb.DatagramEndpoint{Node: srcMAC}, + }); err != nil { + netlog.Warn("[NetBEUI] contextual datagram handler error: %v", err) + } + return + } + if err := handler.HandleDatagram(d); err != nil { + netlog.Warn("[NetBEUI] datagram handler error: %v", err) + } +} + +func (t *transport) handleDatagramBroadcast(srcMAC [6]byte, frame *nbfproto.Frame) { + // Same handling as directed datagram — the broadcast distinction + // is at the link layer (multicast MAC), not in the handler. + t.handleDatagram(srcMAC, frame) +} + +// --- Status Handlers --- + +// handleStatusQuery replies with a minimal STATUS_RESPONSE when the +// query targets a locally registered name. +func (t *transport) handleStatusQuery(srcMAC [6]byte, frame *nbfproto.Frame) { + queriedName := protocol.Name(frame.DestinationName) + entry := t.names.Lookup(queriedName) + if entry == nil || entry.State != nameStateRegistered { + return + } + statusPayload, tooLong, tooBig := t.buildStatusPayload(frame.Data2) + data2 := uint16(len(statusPayload)) & 0x3FFF + if tooLong { + data2 |= 0x8000 + } + if tooBig { + data2 |= 0x4000 + } + + resp := &nbfproto.Frame{ + Command: nbfproto.CmdStatusResponse, + Data1: 0x00, + Data2: data2, + XmitCorrelator: frame.RspCorrelator, + RspCorrelator: t.nextCorrelator(), + Payload: statusPayload, + } + copy(resp.DestinationName[:], frame.SourceName[:]) + copy(resp.SourceName[:], queriedName[:]) + + if err := t.sendFrame(srcMAC, resp, "status-response"); err != nil { + netlog.Warn("[NetBEUI] STATUS_RESPONSE send error: %v", err) + return + } + netlog.Debug("[NetBEUI] STATUS_RESPONSE for %q to %02X:%02X:%02X:%02X:%02X:%02X", + queriedName.String(), + srcMAC[0], srcMAC[1], srcMAC[2], srcMAC[3], srcMAC[4], srcMAC[5]) +} + +func (t *transport) handleStatusResponse(srcMAC [6]byte, frame *nbfproto.Frame) { + netlog.Debug("[NetBEUI] STATUS_RESPONSE from %02X:%02X:%02X:%02X:%02X:%02X for %q", + srcMAC[0], srcMAC[1], srcMAC[2], srcMAC[3], srcMAC[4], srcMAC[5], + protocol.Name(frame.SourceName).String()) +} + +func sessionWireKey(srcMAC [6]byte, localNum uint8) [7]byte { + var k [7]byte + copy(k[:6], srcMAC[:]) + k[6] = localNum + return k +} + +func (t *transport) sendSessionPayload(remoteMac [6]byte, localNum, remoteNum uint8, payload []byte) error { + key := sessionWireKey(remoteMac, localNum) + maxPayload := 1464 + t.txMu.Lock() + if v, ok := t.sessionMaxPayload[key]; ok && v > 0 { + maxPayload = int(v) + } + t.txMu.Unlock() + if maxPayload < 1 { + maxPayload = 1 + } + + frames := make([]*nbfproto.Frame, 0, (len(payload)/maxPayload)+1) + if len(payload) == 0 { + frames = append(frames, &nbfproto.Frame{ + Command: nbfproto.CmdDataOnlyLast, + DestNumber: remoteNum, + SourceNumber: localNum, + }) + } else { + for off := 0; off < len(payload); off += maxPayload { + end := off + maxPayload + if end > len(payload) { + end = len(payload) + } + cmd := nbfproto.CmdDataFirstMiddle + if end == len(payload) { + cmd = nbfproto.CmdDataOnlyLast + } + corr := uint16(0) + if cmd == nbfproto.CmdDataOnlyLast { + corr = t.nextCorrelator() + } + frames = append(frames, &nbfproto.Frame{ + Command: cmd, + RspCorrelator: corr, + DestNumber: remoteNum, + SourceNumber: localNum, + Payload: append([]byte(nil), payload[off:end]...), + }) + } + } + + t.txMu.Lock() + if t.txBlocked[key] { + t.txPendingFrames[key] = append(t.txPendingFrames[key], frames...) + t.txMu.Unlock() + return nil + } + t.txMu.Unlock() + + return t.sendSessionFramesNow(remoteMac, localNum, frames) +} + +func (t *transport) sendSessionFramesNow(remoteMac [6]byte, localNum uint8, frames []*nbfproto.Frame) error { + key := sessionWireKey(remoteMac, localNum) + for _, f := range frames { + if err := t.sendFrame(remoteMac, f, "session-send"); err != nil { + return err + } + t.txMu.Lock() + cp := *f + cp.Payload = append([]byte(nil), f.Payload...) + t.txLastFrame[key] = &cp + t.txMu.Unlock() + } + return nil +} + +func (t *transport) handleNoReceive(srcMAC [6]byte, frame *nbfproto.Frame) { + if t.sessionForInbound(srcMAC, frame.DestNumber, frame.SourceNumber, true) == nil { + return + } + t.txMu.Lock() + t.txBlocked[sessionWireKey(srcMAC, frame.DestNumber)] = true + t.txMu.Unlock() + netlog.Debug("[NetBEUI] NO_RECEIVE from %02X:%02X:%02X:%02X:%02X:%02X session %d", + srcMAC[0], srcMAC[1], srcMAC[2], srcMAC[3], srcMAC[4], srcMAC[5], frame.DestNumber) +} + +func (t *transport) handleReceiveContinue(srcMAC [6]byte, frame *nbfproto.Frame) { + if t.sessionForInbound(srcMAC, frame.DestNumber, frame.SourceNumber, true) == nil { + return + } + key := sessionWireKey(srcMAC, frame.DestNumber) + t.txMu.Lock() + t.txBlocked[key] = false + pending := t.txPendingFrames[key] + delete(t.txPendingFrames, key) + t.txMu.Unlock() + if len(pending) > 0 { + if err := t.sendSessionFramesNow(srcMAC, frame.DestNumber, pending); err != nil { + netlog.Warn("[NetBEUI] pending send on RECEIVE_CONTINUE failed: %v", err) + } + } + netlog.Debug("[NetBEUI] RECEIVE_CONTINUE from %02X:%02X:%02X:%02X:%02X:%02X session %d", + srcMAC[0], srcMAC[1], srcMAC[2], srcMAC[3], srcMAC[4], srcMAC[5], frame.DestNumber) +} + +func (t *transport) handleReceiveOutstanding(srcMAC [6]byte, frame *nbfproto.Frame) { + if t.sessionForInbound(srcMAC, frame.DestNumber, frame.SourceNumber, true) == nil { + return + } + key := sessionWireKey(srcMAC, frame.DestNumber) + t.txMu.Lock() + last := t.txLastFrame[key] + t.txMu.Unlock() + if last == nil { + return + } + if err := t.sendFrame(srcMAC, last, "receive-outstanding-retransmit"); err != nil { + netlog.Warn("[NetBEUI] retransmit on RECEIVE_OUTSTANDING failed: %v", err) + } + netlog.Debug("[NetBEUI] RECEIVE_OUTSTANDING from %02X:%02X:%02X:%02X:%02X:%02X session %d", + srcMAC[0], srcMAC[1], srcMAC[2], srcMAC[3], srcMAC[4], srcMAC[5], frame.DestNumber) +} + +func sessionFragmentKey(srcMAC [6]byte, localNum uint8) [7]byte { + var k [7]byte + copy(k[:6], srcMAC[:]) + k[6] = localNum + return k +} + +// buildStatusPayload assembles adapter status data. The payload format +// is a compact list of local names where each entry is 16-byte name, +// 1-byte local name number, and 1-byte flags (bit 7 indicates group). +func (t *transport) buildStatusPayload(requestedBufLen uint16) ([]byte, bool, bool) { + registered := t.names.Registered() + if len(registered) == 0 { + return nil, false, false + } + + full := make([]byte, 0, len(registered)*18) + for _, e := range registered { + entry := make([]byte, 18) + copy(entry[0:16], e.Name[:]) + entry[16] = e.Number + if e.IsGroup { + entry[17] = 0x80 + } + full = append(full, entry...) + } + + maxLen := int(requestedBufLen) + if maxLen <= 0 { + return nil, len(full) > 0, len(full) > 0 + } + if len(full) <= maxLen { + return full, false, false + } + if maxLen < 18 { + return nil, true, true + } + truncLen := (maxLen / 18) * 18 + if truncLen == 0 { + return nil, true, true + } + out := make([]byte, truncLen) + copy(out, full[:truncLen]) + return out, true, true +} diff --git a/service/netbios/over_netbeui/transport_test.go b/service/netbios/over_netbeui/transport_test.go new file mode 100644 index 0000000..8ba6147 --- /dev/null +++ b/service/netbios/over_netbeui/transport_test.go @@ -0,0 +1,1049 @@ +package over_netbeui + +import ( + "encoding/binary" + "sync" + "testing" + "time" + + "github.com/ObsoleteMadness/ClassicStack/capture" + netbeuiport "github.com/ObsoleteMadness/ClassicStack/port/netbeui" + nbfproto "github.com/ObsoleteMadness/ClassicStack/protocol/netbeui" + protocol "github.com/ObsoleteMadness/ClassicStack/protocol/netbios" + nb "github.com/ObsoleteMadness/ClassicStack/service/netbios" +) + +// --- Mock port --- + +type sentFrame struct { + dstMAC [6]byte + frame *nbfproto.Frame +} + +type mockPort struct { + mu sync.Mutex + sent []sentFrame + cb netbeuiport.DeliveryCallback + sourceMAC [6]byte + started bool +} + + +func (m *mockPort) Start() error { + m.mu.Lock() + m.started = true + m.mu.Unlock() + return nil +} + +func (m *mockPort) Stop() error { + m.mu.Lock() + m.started = false + m.mu.Unlock() + return nil +} + +func (m *mockPort) Send(dstMAC [6]byte, frame *nbfproto.Frame) error { + m.mu.Lock() + m.sent = append(m.sent, sentFrame{dstMAC: dstMAC, frame: frame}) + m.mu.Unlock() + return nil +} + +func (m *mockPort) SendBroadcast(frame *nbfproto.Frame) error { + return m.Send(nbfproto.NetBIOSMulticastMAC, frame) +} + +func (m *mockPort) SetSourceMAC(mac [6]byte) { + m.mu.Lock() + m.sourceMAC = mac + m.mu.Unlock() +} + +func (m *mockPort) SetDeliveryCallback(cb netbeuiport.DeliveryCallback) { + m.mu.Lock() + m.cb = cb + m.mu.Unlock() +} + +func (m *mockPort) SetCaptureSink(_ capture.Sink) {} + +func (m *mockPort) deliverFrame(srcMAC, dstMAC [6]byte, frame *nbfproto.Frame) { + m.mu.Lock() + cb := m.cb + m.mu.Unlock() + if cb != nil { + cb(srcMAC, dstMAC, frame) + } +} + +func (m *mockPort) sentFrames() []sentFrame { + m.mu.Lock() + defer m.mu.Unlock() + out := make([]sentFrame, len(m.sent)) + copy(out, m.sent) + return out +} + +func (m *mockPort) clearSent() { + m.mu.Lock() + m.sent = nil + m.mu.Unlock() +} + +// --- Mock command handler --- + +type mockHandler struct { + mu sync.Mutex + sessions []*protocol.SessionPacket + datagrams []*protocol.Datagram +} + +func (h *mockHandler) HandleSession(pkt *protocol.SessionPacket) error { + h.mu.Lock() + h.sessions = append(h.sessions, pkt) + h.mu.Unlock() + return nil +} + +func (h *mockHandler) HandleDatagram(d *protocol.Datagram) error { + h.mu.Lock() + h.datagrams = append(h.datagrams, d) + h.mu.Unlock() + return nil +} + +func (h *mockHandler) receivedSessions() []*protocol.SessionPacket { + h.mu.Lock() + defer h.mu.Unlock() + out := make([]*protocol.SessionPacket, len(h.sessions)) + copy(out, h.sessions) + return out +} + +func (h *mockHandler) receivedDatagrams() []*protocol.Datagram { + h.mu.Lock() + defer h.mu.Unlock() + out := make([]*protocol.Datagram, len(h.datagrams)) + copy(out, h.datagrams) + return out +} + +type mockContextualHandler struct { + mu sync.Mutex + sessionCalls int + datagramCalls int + lastSessionCtx nb.SessionContext + lastDgramCtx nb.DatagramContext + response []byte +} + +func (h *mockContextualHandler) HandleSession(_ *protocol.SessionPacket) error { + return nil +} + +func (h *mockContextualHandler) HandleDatagram(_ *protocol.Datagram) error { + return nil +} + +func (h *mockContextualHandler) HandleSessionContext(_ *protocol.SessionPacket, ctx nb.SessionContext) (*protocol.SessionPacket, error) { + h.mu.Lock() + h.sessionCalls++ + h.lastSessionCtx = ctx + resp := append([]byte(nil), h.response...) + h.mu.Unlock() + if len(resp) == 0 { + return nil, nil + } + return &protocol.SessionPacket{Type: protocol.SessionMessage, Payload: resp}, nil +} + +func (h *mockContextualHandler) HandleDatagramContext(_ *protocol.Datagram, ctx nb.DatagramContext) error { + h.mu.Lock() + h.datagramCalls++ + h.lastDgramCtx = ctx + h.mu.Unlock() + return nil +} + +// --- Test helpers --- + +var ( + localMAC = [6]byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55} + remoteMAC = [6]byte{0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF} +) + +func testName(s string) protocol.Name { + return protocol.NewName(s, 0x00) +} + +func newTestTransport() (*transport, *mockPort) { + mock := &mockPort{} + tp := NewTransport(mock, localMAC).(*transport) + return tp, mock +} + +// --- Tests --- + +func TestNameClaim_NoConflict(t *testing.T) { + tp, _ := newTestTransport() + if err := tp.Start(nil); err != nil { + t.Fatalf("Start: %v", err) + } + defer tp.Stop() + + name := testName("MYSERVER") + + // SendName blocks for defaultTransmitCount * defaultTransmitTimeout. + // Override for test speed by inserting directly. + entry := tp.names.Add(name, false) + if entry == nil { + t.Fatal("name table Add returned nil") + } + + // Simulate: no ADD_NAME_RESPONSE arrives → promote to registered. + tp.names.SetState(name, nameStateRegistered) + + got := tp.names.Lookup(name) + if got == nil || got.State != nameStateRegistered { + t.Fatalf("expected registered state, got %v", got) + } +} + +func TestNameClaim_Conflict(t *testing.T) { + tp, mock := newTestTransport() + if err := tp.Start(nil); err != nil { + t.Fatalf("Start: %v", err) + } + defer tp.Stop() + + name := testName("MYSERVER") + entry := tp.names.Add(name, false) + if entry == nil { + t.Fatal("name table Add returned nil") + } + + // Inject ADD_NAME_RESPONSE from remote → conflict. + resp := &nbfproto.Frame{ + Command: nbfproto.CmdAddNameResponse, + Data1: 0x00, + XmitCorrelator: 0x0001, + } + copy(resp.DestinationName[:], name[:]) + copy(resp.SourceName[:], name[:]) + mock.deliverFrame(remoteMAC, localMAC, resp) + + time.Sleep(10 * time.Millisecond) // let handler run + + got := tp.names.Lookup(name) + if got == nil || got.State != nameStateConflict { + t.Fatalf("expected conflict state, got %v", got) + } +} + +func TestAddNameQuery_Responds_WithConflict(t *testing.T) { + tp, mock := newTestTransport() + if err := tp.Start(nil); err != nil { + t.Fatalf("Start: %v", err) + } + defer tp.Stop() + + // Register a local name. + name := testName("MYSERVER") + tp.names.Add(name, false) + tp.names.SetState(name, nameStateRegistered) + + // Inject an ADD_NAME_QUERY from a remote node trying to claim our name. + query := &nbfproto.Frame{ + Command: nbfproto.CmdAddNameQuery, + RspCorrelator: 0x4242, + } + copy(query.SourceName[:], name[:]) + mock.deliverFrame(remoteMAC, nbfproto.NetBIOSMulticastMAC, query) + + time.Sleep(10 * time.Millisecond) + + sent := mock.sentFrames() + if len(sent) == 0 { + t.Fatal("expected ADD_NAME_RESPONSE to be sent, got none") + } + resp := sent[0] + if resp.frame.Command != nbfproto.CmdAddNameResponse { + t.Fatalf("expected CmdAddNameResponse (0x%02X), got 0x%02X", + nbfproto.CmdAddNameResponse, resp.frame.Command) + } + if resp.dstMAC != remoteMAC { + t.Fatalf("expected response directed to remote MAC, got %v", resp.dstMAC) + } + if resp.frame.XmitCorrelator != 0x4242 { + t.Fatalf("XmitCorrelator = 0x%04X, want 0x4242", resp.frame.XmitCorrelator) + } +} + +func TestNameQuery_NameRecognized(t *testing.T) { + tp, mock := newTestTransport() + if err := tp.Start(nil); err != nil { + t.Fatalf("Start: %v", err) + } + defer tp.Stop() + + name := testName("MYSERVER") + tp.names.Add(name, false) + tp.names.SetState(name, nameStateRegistered) + + // Inject NAME_QUERY with session request (callerSession > 0). + query := &nbfproto.Frame{ + Command: nbfproto.CmdNameQuery, + Data2: 0x0001, // caller's session # = 1 + RspCorrelator: 0xBEEF, + } + copy(query.DestinationName[:], name[:]) + callerName := testName("CLIENT") + copy(query.SourceName[:], callerName[:]) + mock.deliverFrame(remoteMAC, nbfproto.NetBIOSMulticastMAC, query) + + time.Sleep(10 * time.Millisecond) + + sent := mock.sentFrames() + if len(sent) == 0 { + t.Fatal("expected NAME_RECOGNIZED, got none") + } + nr := sent[0] + if nr.frame.Command != nbfproto.CmdNameRecognized { + t.Fatalf("command = 0x%02X, want NAME_RECOGNIZED (0x%02X)", + nr.frame.Command, nbfproto.CmdNameRecognized) + } + if nr.dstMAC != remoteMAC { + t.Fatal("expected directed to remote MAC") + } + // Session number should be non-zero (assigned from session table). + sessionNum := uint8(nr.frame.Data2 & 0xFF) + if sessionNum == 0 { + t.Fatal("expected non-zero session number in NAME_RECOGNIZED") + } + if nr.frame.XmitCorrelator != 0xBEEF { + t.Fatalf("XmitCorrelator = 0x%04X, want 0xBEEF", nr.frame.XmitCorrelator) + } +} + +func TestNameQuery_ReusesSessionForDuplicateCallerSession(t *testing.T) { + tp, mock := newTestTransport() + if err := tp.Start(nil); err != nil { + t.Fatalf("Start: %v", err) + } + defer tp.Stop() + + name := testName("MYSERVER") + client := testName("CLIENT") + tp.names.Add(name, false) + tp.names.SetState(name, nameStateRegistered) + + query1 := &nbfproto.Frame{ + Command: nbfproto.CmdNameQuery, + Data2: 0x0007, // caller session = 7 + RspCorrelator: 0x1111, + } + copy(query1.DestinationName[:], name[:]) + copy(query1.SourceName[:], client[:]) + mock.deliverFrame(remoteMAC, nbfproto.NetBIOSMulticastMAC, query1) + time.Sleep(10 * time.Millisecond) + + query2 := &nbfproto.Frame{ + Command: nbfproto.CmdNameQuery, + Data2: 0x0007, // same caller session + RspCorrelator: 0x2222, + } + copy(query2.DestinationName[:], name[:]) + copy(query2.SourceName[:], client[:]) + mock.deliverFrame(remoteMAC, nbfproto.NetBIOSMulticastMAC, query2) + time.Sleep(10 * time.Millisecond) + + sent := mock.sentFrames() + if len(sent) != 2 { + t.Fatalf("expected 2 NAME_RECOGNIZED frames, got %d", len(sent)) + } + n1 := uint8(sent[0].frame.Data2 & 0xFF) + n2 := uint8(sent[1].frame.Data2 & 0xFF) + if n1 == 0 || n2 == 0 { + t.Fatal("expected non-zero session number in NAME_RECOGNIZED") + } + if n1 != n2 { + t.Fatalf("expected reused local session number, got %d and %d", n1, n2) + } + if sent[0].frame.RspCorrelator == 0 || sent[1].frame.RspCorrelator == 0 { + t.Fatal("expected non-zero RspCorrelator in NAME_RECOGNIZED") + } + if sent[0].frame.RspCorrelator != sent[1].frame.RspCorrelator { + t.Fatalf("expected same RspCorrelator, got %d and %d", sent[0].frame.RspCorrelator, sent[1].frame.RspCorrelator) + } +} + +func TestSessionEstablishment(t *testing.T) { + tp, mock := newTestTransport() + if err := tp.Start(nil); err != nil { + t.Fatalf("Start: %v", err) + } + defer tp.Stop() + + name := testName("MYSERVER") + tp.names.Add(name, false) + tp.names.SetState(name, nameStateRegistered) + + // Step 1: NAME_QUERY → NAME_RECOGNIZED + query := &nbfproto.Frame{ + Command: nbfproto.CmdNameQuery, + Data2: 0x0001, + RspCorrelator: 0x1111, + } + copy(query.DestinationName[:], name[:]) + mock.deliverFrame(remoteMAC, nbfproto.NetBIOSMulticastMAC, query) + time.Sleep(10 * time.Millisecond) + + sent := mock.sentFrames() + if len(sent) != 1 || sent[0].frame.Command != nbfproto.CmdNameRecognized { + t.Fatal("expected NAME_RECOGNIZED") + } + localNum := uint8(sent[0].frame.Data2 & 0xFF) + rspCorr := sent[0].frame.RspCorrelator + mock.clearSent() + + // Step 2: SESSION_INITIALIZE → SESSION_CONFIRM + init := &nbfproto.Frame{ + Command: nbfproto.CmdSessionInitialize, + XmitCorrelator: rspCorr, + RspCorrelator: 0x2222, + DestNumber: localNum, + SourceNumber: 0x05, // remote's session number + } + mock.deliverFrame(remoteMAC, localMAC, init) + time.Sleep(10 * time.Millisecond) + + sent = mock.sentFrames() + if len(sent) != 1 || sent[0].frame.Command != nbfproto.CmdSessionConfirm { + t.Fatal("expected SESSION_CONFIRM") + } + confirm := sent[0].frame + if confirm.DestNumber != 0x05 { + t.Fatalf("SESSION_CONFIRM DestNumber = %d, want 5", confirm.DestNumber) + } + if confirm.SourceNumber != localNum { + t.Fatalf("SESSION_CONFIRM SourceNumber = %d, want %d", confirm.SourceNumber, localNum) + } + + // Verify session is active. + sess := tp.sessions.Lookup(remoteMAC, localNum) + if sess == nil { + t.Fatal("session not found in table") + } + if sess.State != sessionStateActive { + t.Fatalf("session state = %d, want active (%d)", sess.State, sessionStateActive) + } +} + +func TestDataOnlyLast_DeliveryAndAck(t *testing.T) { + tp, mock := newTestTransport() + handler := &mockHandler{} + tp.SetCommandHandler(handler) + if err := tp.Start(nil); err != nil { + t.Fatalf("Start: %v", err) + } + defer tp.Stop() + + // Set up an active session. + sess := tp.sessions.Create(remoteMAC) + sess.RemoteNum = 0x05 + sess.State = sessionStateActive + + payload := []byte("SMB data goes here") + data := &nbfproto.Frame{ + Command: nbfproto.CmdDataOnlyLast, + RspCorrelator: 0x3333, + DestNumber: sess.LocalNum, + SourceNumber: sess.RemoteNum, + Payload: payload, + } + mock.deliverFrame(remoteMAC, localMAC, data) + time.Sleep(10 * time.Millisecond) + + // Verify DATA_ACK was sent. + sent := mock.sentFrames() + if len(sent) == 0 { + t.Fatal("expected DATA_ACK, got none") + } + ack := sent[0] + if ack.frame.Command != nbfproto.CmdDataAck { + t.Fatalf("command = 0x%02X, want DATA_ACK (0x%02X)", + ack.frame.Command, nbfproto.CmdDataAck) + } + if ack.frame.XmitCorrelator != 0x3333 { + t.Fatalf("DATA_ACK XmitCorrelator = 0x%04X, want 0x3333", ack.frame.XmitCorrelator) + } + if ack.dstMAC != remoteMAC { + t.Fatal("DATA_ACK not directed to remote MAC") + } + + // Verify handler received the session packet. + pkts := handler.receivedSessions() + if len(pkts) != 1 { + t.Fatalf("expected 1 session packet, got %d", len(pkts)) + } + if string(pkts[0].Payload) != string(payload) { + t.Fatalf("payload mismatch: %q", pkts[0].Payload) + } +} + +func TestDataOnlyLast_ContextualHandlerResponds(t *testing.T) { + tp, mock := newTestTransport() + h := &mockContextualHandler{response: []byte("SMB reply")} + tp.SetCommandHandler(h) + if err := tp.Start(nil); err != nil { + t.Fatalf("Start: %v", err) + } + defer tp.Stop() + + sess := tp.sessions.Create(remoteMAC) + sess.RemoteNum = 0x05 + sess.State = sessionStateActive + + in := &nbfproto.Frame{ + Command: nbfproto.CmdDataOnlyLast, + DestNumber: sess.LocalNum, + SourceNumber: sess.RemoteNum, + RspCorrelator: 0x1111, + Payload: []byte("SMB request"), + } + mock.deliverFrame(remoteMAC, localMAC, in) + time.Sleep(10 * time.Millisecond) + + sent := mock.sentFrames() + if len(sent) != 2 { + t.Fatalf("expected DATA_ACK + response DATA_ONLY_LAST, got %d frames", len(sent)) + } + if sent[0].frame.Command != nbfproto.CmdDataAck { + t.Fatalf("first frame command = 0x%02X, want DATA_ACK", sent[0].frame.Command) + } + if sent[1].frame.Command != nbfproto.CmdDataOnlyLast { + t.Fatalf("second frame command = 0x%02X, want DATA_ONLY_LAST", sent[1].frame.Command) + } + if got := string(sent[1].frame.Payload); got != "SMB reply" { + t.Fatalf("response payload = %q, want %q", got, "SMB reply") + } + if sent[1].frame.DestNumber != sess.RemoteNum { + t.Fatalf("response DestNumber = %d, want %d", sent[1].frame.DestNumber, sess.RemoteNum) + } + if sent[1].frame.SourceNumber != sess.LocalNum { + t.Fatalf("response SourceNumber = %d, want %d", sent[1].frame.SourceNumber, sess.LocalNum) + } +} + +func TestSendDirectedDatagram_UsesRemoteMAC(t *testing.T) { + tp, mock := newTestTransport() + if err := tp.Start(nil); err != nil { + t.Fatalf("Start: %v", err) + } + defer tp.Stop() + + d := &protocol.Datagram{ + Destination: testName("SERVER"), + Source: testName("CLIENT"), + Payload: []byte("browse"), + } + err := tp.SendDirectedDatagram(d, nb.DatagramEndpoint{Node: remoteMAC}) + if err != nil { + t.Fatalf("SendDirectedDatagram: %v", err) + } + + sent := mock.sentFrames() + if len(sent) != 1 { + t.Fatalf("expected 1 frame, got %d", len(sent)) + } + if sent[0].dstMAC != remoteMAC { + t.Fatalf("dstMAC = %v, want %v", sent[0].dstMAC, remoteMAC) + } + if sent[0].frame.Command != nbfproto.CmdDatagram { + t.Fatalf("command = 0x%02X, want DATAGRAM", sent[0].frame.Command) + } +} + +func TestSendSession_SegmentsByRemoteMaxPayload(t *testing.T) { + tp, mock := newTestTransport() + if err := tp.Start(nil); err != nil { + t.Fatalf("Start: %v", err) + } + defer tp.Stop() + + sess := tp.sessions.Create(remoteMAC) + sess.RemoteNum = 0x05 + sess.State = sessionStateActive + + key := sessionWireKey(remoteMAC, sess.LocalNum) + tp.txMu.Lock() + tp.sessionMaxPayload[key] = 5 + tp.txMu.Unlock() + + pkt := &protocol.SessionPacket{Type: protocol.SessionMessage, Payload: []byte("abcdefghijk")} + if err := tp.SendSession(pkt); err != nil { + t.Fatalf("SendSession: %v", err) + } + + sent := mock.sentFrames() + if len(sent) != 3 { + t.Fatalf("expected 3 segmented frames, got %d", len(sent)) + } + if sent[0].frame.Command != nbfproto.CmdDataFirstMiddle || sent[1].frame.Command != nbfproto.CmdDataFirstMiddle || sent[2].frame.Command != nbfproto.CmdDataOnlyLast { + t.Fatal("unexpected command sequence for segmented send") + } + if got := string(sent[0].frame.Payload); got != "abcde" { + t.Fatalf("segment0 payload = %q, want %q", got, "abcde") + } + if got := string(sent[1].frame.Payload); got != "fghij" { + t.Fatalf("segment1 payload = %q, want %q", got, "fghij") + } + if got := string(sent[2].frame.Payload); got != "k" { + t.Fatalf("segment2 payload = %q, want %q", got, "k") + } +} + +func TestNoReceive_QueuesUntilReceiveContinue(t *testing.T) { + tp, mock := newTestTransport() + if err := tp.Start(nil); err != nil { + t.Fatalf("Start: %v", err) + } + defer tp.Stop() + + sess := tp.sessions.Create(remoteMAC) + sess.RemoteNum = 0x05 + sess.State = sessionStateActive + + noRecv := &nbfproto.Frame{ + Command: nbfproto.CmdNoReceive, + DestNumber: sess.LocalNum, + SourceNumber: sess.RemoteNum, + } + mock.deliverFrame(remoteMAC, localMAC, noRecv) + + if err := tp.SendSession(&protocol.SessionPacket{Type: protocol.SessionMessage, Payload: []byte("reply")}); err != nil { + t.Fatalf("SendSession: %v", err) + } + + if got := len(mock.sentFrames()); got != 0 { + t.Fatalf("expected no immediate sends while blocked, got %d", got) + } + + cont := &nbfproto.Frame{ + Command: nbfproto.CmdReceiveContinue, + DestNumber: sess.LocalNum, + SourceNumber: sess.RemoteNum, + } + mock.deliverFrame(remoteMAC, localMAC, cont) + time.Sleep(10 * time.Millisecond) + + sent := mock.sentFrames() + if len(sent) != 1 { + t.Fatalf("expected 1 frame flushed on RECEIVE_CONTINUE, got %d", len(sent)) + } + if sent[0].frame.Command != nbfproto.CmdDataOnlyLast { + t.Fatalf("flushed command = 0x%02X, want DATA_ONLY_LAST", sent[0].frame.Command) + } +} + +func TestReceiveOutstanding_RetransmitsLastFrame(t *testing.T) { + tp, mock := newTestTransport() + if err := tp.Start(nil); err != nil { + t.Fatalf("Start: %v", err) + } + defer tp.Stop() + + sess := tp.sessions.Create(remoteMAC) + sess.RemoteNum = 0x05 + sess.State = sessionStateActive + + if err := tp.SendSession(&protocol.SessionPacket{Type: protocol.SessionMessage, Payload: []byte("payload")}); err != nil { + t.Fatalf("SendSession: %v", err) + } + mock.clearSent() + + outstanding := &nbfproto.Frame{ + Command: nbfproto.CmdReceiveOutstanding, + DestNumber: sess.LocalNum, + SourceNumber: sess.RemoteNum, + } + mock.deliverFrame(remoteMAC, localMAC, outstanding) + time.Sleep(10 * time.Millisecond) + + sent := mock.sentFrames() + if len(sent) != 1 { + t.Fatalf("expected 1 retransmitted frame, got %d", len(sent)) + } + if got := string(sent[0].frame.Payload); got != "payload" { + t.Fatalf("retransmitted payload = %q, want %q", got, "payload") + } +} + +func TestDataOnlyLast_SourceSessionMismatchIgnored(t *testing.T) { + tp, mock := newTestTransport() + handler := &mockHandler{} + tp.SetCommandHandler(handler) + if err := tp.Start(nil); err != nil { + t.Fatalf("Start: %v", err) + } + defer tp.Stop() + + sess := tp.sessions.Create(remoteMAC) + sess.RemoteNum = 0x05 + sess.State = sessionStateActive + + data := &nbfproto.Frame{ + Command: nbfproto.CmdDataOnlyLast, + RspCorrelator: 0x3333, + DestNumber: sess.LocalNum, + SourceNumber: 0x06, // mismatched remote session number + Payload: []byte("ignored"), + } + mock.deliverFrame(remoteMAC, localMAC, data) + time.Sleep(10 * time.Millisecond) + + if got := mock.sentFrames(); len(got) != 0 { + t.Fatalf("expected no DATA_ACK for mismatched session number, got %d", len(got)) + } + if got := handler.receivedSessions(); len(got) != 0 { + t.Fatalf("expected no delivered session packets, got %d", len(got)) + } +} + +func TestDataFirstMiddle_ReassemblesWithFinalSegment(t *testing.T) { + tp, mock := newTestTransport() + handler := &mockHandler{} + tp.SetCommandHandler(handler) + if err := tp.Start(nil); err != nil { + t.Fatalf("Start: %v", err) + } + defer tp.Stop() + + sess := tp.sessions.Create(remoteMAC) + sess.RemoteNum = 0x05 + sess.State = sessionStateActive + + first := &nbfproto.Frame{ + Command: nbfproto.CmdDataFirstMiddle, + DestNumber: sess.LocalNum, + SourceNumber: sess.RemoteNum, + Payload: []byte("first-"), + } + last := &nbfproto.Frame{ + Command: nbfproto.CmdDataOnlyLast, + RspCorrelator: 0x8888, + DestNumber: sess.LocalNum, + SourceNumber: sess.RemoteNum, + Payload: []byte("last"), + } + mock.deliverFrame(remoteMAC, localMAC, first) + mock.deliverFrame(remoteMAC, localMAC, last) + time.Sleep(10 * time.Millisecond) + + pkts := handler.receivedSessions() + if len(pkts) != 1 { + t.Fatalf("expected 1 reassembled session packet, got %d", len(pkts)) + } + if got := string(pkts[0].Payload); got != "first-last" { + t.Fatalf("payload = %q, want %q", got, "first-last") + } +} + +func TestSessionEnd_SourceSessionMismatchIgnored(t *testing.T) { + tp, mock := newTestTransport() + if err := tp.Start(nil); err != nil { + t.Fatalf("Start: %v", err) + } + defer tp.Stop() + + sess := tp.sessions.Create(remoteMAC) + sess.RemoteNum = 0x05 + sess.State = sessionStateActive + localNum := sess.LocalNum + + end := &nbfproto.Frame{ + Command: nbfproto.CmdSessionEnd, + DestNumber: localNum, + SourceNumber: 0x06, // mismatched remote session number + } + mock.deliverFrame(remoteMAC, localMAC, end) + time.Sleep(10 * time.Millisecond) + + if tp.sessions.Lookup(remoteMAC, localNum) == nil { + t.Fatal("session should be retained on mismatched SESSION_END source number") + } +} + +func TestDataAck_CorrelatorMismatchIgnored(t *testing.T) { + tp, mock := newTestTransport() + if err := tp.Start(nil); err != nil { + t.Fatalf("Start: %v", err) + } + defer tp.Stop() + + sess := tp.sessions.Create(remoteMAC) + sess.RemoteNum = 0x05 + sess.State = sessionStateActive + sess.LastXmitCorrelator = 0x2001 + + ack := &nbfproto.Frame{ + Command: nbfproto.CmdDataAck, + XmitCorrelator: 0x2002, // does not match last outbound correlator + DestNumber: sess.LocalNum, + SourceNumber: sess.RemoteNum, + } + mock.deliverFrame(remoteMAC, localMAC, ack) + time.Sleep(10 * time.Millisecond) + + if sess.LastXmitCorrelator != 0x2001 { + t.Fatalf("LastXmitCorrelator = 0x%04X, want 0x2001", sess.LastXmitCorrelator) + } +} + +func TestSessionEnd(t *testing.T) { + tp, mock := newTestTransport() + if err := tp.Start(nil); err != nil { + t.Fatalf("Start: %v", err) + } + defer tp.Stop() + + sess := tp.sessions.Create(remoteMAC) + sess.RemoteNum = 0x05 + sess.State = sessionStateActive + localNum := sess.LocalNum + + end := &nbfproto.Frame{ + Command: nbfproto.CmdSessionEnd, + DestNumber: localNum, + } + mock.deliverFrame(remoteMAC, localMAC, end) + time.Sleep(10 * time.Millisecond) + + if tp.sessions.Lookup(remoteMAC, localNum) != nil { + t.Fatal("session should have been removed from table") + } +} + +func TestDatagramDelivery(t *testing.T) { + tp, mock := newTestTransport() + handler := &mockHandler{} + tp.SetCommandHandler(handler) + if err := tp.Start(nil); err != nil { + t.Fatalf("Start: %v", err) + } + defer tp.Stop() + + src := testName("CLIENT") + dst := testName("MYSERVER") + + dgram := &nbfproto.Frame{ + Command: nbfproto.CmdDatagram, + Payload: []byte("datagram payload"), + } + copy(dgram.DestinationName[:], dst[:]) + copy(dgram.SourceName[:], src[:]) + mock.deliverFrame(remoteMAC, nbfproto.NetBIOSMulticastMAC, dgram) + time.Sleep(10 * time.Millisecond) + + rcvd := handler.receivedDatagrams() + if len(rcvd) != 1 { + t.Fatalf("expected 1 datagram, got %d", len(rcvd)) + } + if rcvd[0].Source != src { + t.Errorf("Source = %q, want %q", rcvd[0].Source.String(), src.String()) + } + if rcvd[0].Destination != dst { + t.Errorf("Destination = %q, want %q", rcvd[0].Destination.String(), dst.String()) + } +} + +func TestStatusQuery_RegisteredNameResponds(t *testing.T) { + tp, mock := newTestTransport() + if err := tp.Start(nil); err != nil { + t.Fatalf("Start: %v", err) + } + defer tp.Stop() + + server := testName("MYSERVER") + client := testName("CLIENT") + tp.names.Add(server, false) + tp.names.SetState(server, nameStateRegistered) + + query := &nbfproto.Frame{ + Command: nbfproto.CmdStatusQuery, + Data2: 1024, + RspCorrelator: 0x5555, + } + copy(query.DestinationName[:], server[:]) + copy(query.SourceName[:], client[:]) + + mock.deliverFrame(remoteMAC, nbfproto.NetBIOSMulticastMAC, query) + time.Sleep(10 * time.Millisecond) + + sent := mock.sentFrames() + if len(sent) != 1 { + t.Fatalf("expected 1 STATUS_RESPONSE, got %d", len(sent)) + } + resp := sent[0] + if resp.dstMAC != remoteMAC { + t.Fatal("expected STATUS_RESPONSE directed to querying MAC") + } + if resp.frame.Command != nbfproto.CmdStatusResponse { + t.Fatalf("command = 0x%02X, want STATUS_RESPONSE (0x%02X)", + resp.frame.Command, nbfproto.CmdStatusResponse) + } + if resp.frame.XmitCorrelator != 0x5555 { + t.Fatalf("XmitCorrelator = 0x%04X, want 0x5555", resp.frame.XmitCorrelator) + } + if protocol.Name(resp.frame.SourceName) != server { + t.Fatalf("SourceName = %q, want %q", + protocol.Name(resp.frame.SourceName).String(), server.String()) + } + if protocol.Name(resp.frame.DestinationName) != client { + t.Fatalf("DestinationName = %q, want %q", + protocol.Name(resp.frame.DestinationName).String(), client.String()) + } + if len(resp.frame.Payload) == 0 { + t.Fatal("expected STATUS_RESPONSE payload with adapter name entries") + } + if len(resp.frame.Payload)%18 != 0 { + t.Fatalf("STATUS_RESPONSE payload length = %d, want multiple of 18", len(resp.frame.Payload)) + } +} + +func TestStatusQuery_TruncatesByRequesterBufferLength(t *testing.T) { + tp, mock := newTestTransport() + if err := tp.Start(nil); err != nil { + t.Fatalf("Start: %v", err) + } + defer tp.Stop() + + server := testName("MYSERVER") + alias := testName("ALIAS") + tp.names.Add(server, false) + tp.names.SetState(server, nameStateRegistered) + tp.names.Add(alias, false) + tp.names.SetState(alias, nameStateRegistered) + + query := &nbfproto.Frame{ + Command: nbfproto.CmdStatusQuery, + Data2: 18, // exactly one entry + RspCorrelator: 0x6666, + } + client := testName("CLIENT") + copy(query.DestinationName[:], server[:]) + copy(query.SourceName[:], client[:]) + + mock.deliverFrame(remoteMAC, nbfproto.NetBIOSMulticastMAC, query) + time.Sleep(10 * time.Millisecond) + + sent := mock.sentFrames() + if len(sent) != 1 { + t.Fatalf("expected 1 STATUS_RESPONSE, got %d", len(sent)) + } + resp := sent[0].frame + if len(resp.Payload) != 18 { + t.Fatalf("payload length = %d, want 18", len(resp.Payload)) + } + if resp.Data2&0xC000 != 0xC000 { + t.Fatalf("Data2 truncation bits = 0x%04X, want both high bits set", resp.Data2) + } +} + +func TestStatusQuery_UnknownNameIgnored(t *testing.T) { + tp, mock := newTestTransport() + if err := tp.Start(nil); err != nil { + t.Fatalf("Start: %v", err) + } + defer tp.Stop() + + unknown := testName("UNKNOWN") + client := testName("CLIENT") + query := &nbfproto.Frame{Command: nbfproto.CmdStatusQuery} + copy(query.DestinationName[:], unknown[:]) + copy(query.SourceName[:], client[:]) + + mock.deliverFrame(remoteMAC, nbfproto.NetBIOSMulticastMAC, query) + time.Sleep(10 * time.Millisecond) + + if got := mock.sentFrames(); len(got) != 0 { + t.Fatalf("expected no STATUS_RESPONSE for unknown name, got %d", len(got)) + } +} + +func TestNameNumber1(t *testing.T) { + mac := [6]byte{0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF} + n := nameNumber1(mac) + // First 10 bytes should be zero. + for i := 0; i < 10; i++ { + if n[i] != 0 { + t.Fatalf("byte %d = 0x%02X, want 0x00", i, n[i]) + } + } + // Last 6 bytes = MAC. + if [6]byte(n[10:16]) != mac { + t.Fatalf("MAC portion mismatch") + } +} + +func TestNameTable_GroupNameNoConflict(t *testing.T) { + nt := newNameTable() + name := testName("WORKGROUP") + + entry := nt.Add(name, true) + if entry == nil { + t.Fatal("expected entry, got nil") + } + if !entry.IsGroup { + t.Fatal("expected group flag") + } +} + +func TestNameTable_DuplicateAddReturnsNil(t *testing.T) { + nt := newNameTable() + name := testName("MYSERVER") + + e1 := nt.Add(name, false) + if e1 == nil { + t.Fatal("first add should succeed") + } + + e2 := nt.Add(name, false) + if e2 != nil { + t.Fatal("duplicate add should return nil") + } +} + +func TestSessionTable_AllocWraparound(t *testing.T) { + st := newSessionTable() + + // Exhaust 1..254 + for i := 0; i < 254; i++ { + mac := [6]byte{byte(i), 0, 0, 0, 0, 0} + st.Create(mac) + } + + // Next allocation should wrap to 1. + mac := [6]byte{0xFF, 0, 0, 0, 0, 0} + sess := st.Create(mac) + if sess.LocalNum != 1 { + t.Fatalf("expected wraparound to 1, got %d", sess.LocalNum) + } +} + +func TestIsSessionCommand_Consistency(t *testing.T) { + // Verify the discriminator matches the spec boundary. + for cmd := uint8(0x00); cmd <= 0x13; cmd++ { + if nbfproto.IsSessionCommand(cmd) { + t.Errorf("0x%02X should not be session", cmd) + } + } + for cmd := uint8(0x14); cmd <= 0x1F; cmd++ { + if !nbfproto.IsSessionCommand(cmd) { + t.Errorf("0x%02X should be session", cmd) + } + } +} + +var _ = binary.LittleEndian diff --git a/service/netbios/over_tcp/transport.go b/service/netbios/over_tcp/transport.go new file mode 100644 index 0000000..e9beb9b --- /dev/null +++ b/service/netbios/over_tcp/transport.go @@ -0,0 +1,43 @@ +// Package over_tcp implements NBT (NetBIOS over TCP/IP) — RFC 1001/ +// 1002 — as a netbios.Transport. The transport is a stub: Start/Stop +// are no-ops and the listener machinery lands when the real NBT +// handshake does. +package over_tcp + +import ( + "context" + "sync" + + protocol "github.com/ObsoleteMadness/ClassicStack/protocol/netbios" + "github.com/ObsoleteMadness/ClassicStack/service/netbios" +) + +// Default well-known NBT ports. +const ( + NameServiceUDPPort = 137 + DatagramServiceUDPPort = 138 + SessionServiceTCPPort = 139 +) + +type transport struct { + mu sync.RWMutex + handler netbios.CommandHandler +} + +// NewTransport returns a netbios.Transport for NBT. +func NewTransport() netbios.Transport { + return &transport{} +} + +func (t *transport) Start(_ context.Context) error { return nil } +func (t *transport) Stop() error { return nil } + +func (t *transport) SendName(_ protocol.Name) error { return netbios.ErrNotImplemented } +func (t *transport) SendDatagram(_ *protocol.Datagram) error { return netbios.ErrNotImplemented } +func (t *transport) SendSession(_ *protocol.SessionPacket) error { return netbios.ErrNotImplemented } + +func (t *transport) SetCommandHandler(h netbios.CommandHandler) { + t.mu.Lock() + t.handler = h + t.mu.Unlock() +} diff --git a/service/netbios/service.go b/service/netbios/service.go new file mode 100644 index 0000000..df4f942 --- /dev/null +++ b/service/netbios/service.go @@ -0,0 +1,287 @@ +// Package netbios is the NetBIOS session/name layer. It is transport- +// pluggable: any number of Transport implementations (NetBEUI, IPX, +// TCP/NBT) can be wired into a single Service, mirroring AFP's +// multi-transport design. +// +// NetBIOS is not an AppleTalk service: it does not consume DDP +// datagrams and is not registered with the AppleTalk router. The +// lifecycle contract here is a plain Start(ctx)/Stop pair so main.go +// can drive it independently. +package netbios + +import ( + "context" + "errors" + "fmt" + "sync" + + protocol "github.com/ObsoleteMadness/ClassicStack/protocol/netbios" +) + +// ErrNotImplemented is returned by stub call sites that have not yet +// been filled in. +var ErrNotImplemented = errors.New("netbios: not implemented") + +// CommandHandler receives decoded NetBIOS commands from a Transport. +// SMB plugs in here. +type CommandHandler interface { + HandleSession(packet *protocol.SessionPacket) error + HandleDatagram(d *protocol.Datagram) error +} + +// DatagramEndpoint identifies a transport-level remote endpoint for +// a NetBIOS datagram. +type DatagramEndpoint struct { + Network [4]byte + Node [6]byte + Socket [2]byte +} + +// DatagramContext carries transport metadata for an inbound NetBIOS +// datagram when the underlying transport can provide it. +type DatagramContext struct { + Local DatagramEndpoint + Remote DatagramEndpoint +} + +// SessionContext carries transport metadata for an inbound NetBIOS +// session message when the underlying transport can provide it. +type SessionContext struct { + Local DatagramEndpoint + Remote DatagramEndpoint + SourceConnID uint16 + DestConnID uint16 + Sequence uint16 + ConnectionCtl uint8 +} + +// ContextualDatagramHandler is an optional extension implemented by +// handlers that need transport metadata for reply routing. +type ContextualDatagramHandler interface { + HandleDatagramContext(d *protocol.Datagram, ctx DatagramContext) error +} + +// ContextualSessionHandler is an optional extension implemented by +// handlers that need transport metadata and/or need to return a +// session-layer response packet. +type ContextualSessionHandler interface { + HandleSessionContext(packet *protocol.SessionPacket, ctx SessionContext) (*protocol.SessionPacket, error) +} + +// DirectedDatagramTransport is implemented by transports that can +// route a NetBIOS datagram back to a specific remote endpoint. +type DirectedDatagramTransport interface { + SendDirectedDatagram(d *protocol.Datagram, remote DatagramEndpoint) error +} + +// Transport is the per-link NetBIOS transport contract. A NetBIOS +// service may run multiple transports concurrently (NBT for TCP/IP +// clients, NetBEUI for legacy LAN, IPX for Novell-era clients). +type Transport interface { + Start(ctx context.Context) error + Stop() error + SendName(name protocol.Name) error + SendDatagram(d *protocol.Datagram) error + SendSession(s *protocol.SessionPacket) error + SetCommandHandler(handler CommandHandler) +} + +// NameService is the registration/resolution surface SMB consumes to +// claim its server name and to look up remote names for outgoing +// connections. +type NameService interface { + Register(name string) error + Resolve(name string) (string, error) + Release(name string) error +} + +// Service composes a set of transports under a common NetBIOS name. +type Service struct { + serverName string + scopeID string + transports []Transport + names map[protocol.Name]struct{} + + mu sync.Mutex + started bool + handler CommandHandler +} + +// NewService creates a NetBIOS service whose name layer is reachable +// over the given transports. transports may be empty for a name-only +// service that does not accept incoming sessions. +func NewService(serverName, scopeID string, transports []Transport) *Service { + defaultNames := map[protocol.Name]struct{}{} + if serverName != "" { + defaultNames[protocol.NewName(serverName, protocol.NameTypeFileServer)] = struct{}{} + defaultNames[protocol.NewName(serverName, protocol.NameTypeWorkstation)] = struct{}{} + } + return &Service{ + serverName: serverName, + scopeID: scopeID, + transports: transports, + names: defaultNames, + } +} + +// SetCommandHandler installs an inbound-command handler (typically an +// SMB server). Idempotent; later calls replace earlier ones. Each +// transport receives the handler so it can deliver decoded packets. +func (s *Service) SetCommandHandler(h CommandHandler) { + s.mu.Lock() + s.handler = h + for _, t := range s.transports { + t.SetCommandHandler(h) + } + s.mu.Unlock() +} + +// Start brings up every transport. If any transport fails to start +// the already-started ones are torn down before returning the error. +func (s *Service) Start(ctx context.Context) error { + s.mu.Lock() + if s.started { + s.mu.Unlock() + return nil + } + s.started = true + transports := append([]Transport(nil), s.transports...) + names := make([]protocol.Name, 0, len(s.names)) + for n := range s.names { + names = append(names, n) + } + s.mu.Unlock() + for i, t := range transports { + if err := t.Start(ctx); err != nil { + for j := range i { + _ = transports[j].Stop() + } + s.mu.Lock() + s.started = false + s.mu.Unlock() + return err + } + for _, n := range names { + if err := t.SendName(n); err != nil && !errors.Is(err, ErrNotImplemented) { + for j := range i + 1 { + _ = transports[j].Stop() + } + s.mu.Lock() + s.started = false + s.mu.Unlock() + return fmt.Errorf("netbios: register name %q: %w", n.String(), err) + } + } + } + return nil +} + +// Stop tears down every transport. Errors from individual transports +// are swallowed so a single failing transport does not block teardown +// of its siblings. +func (s *Service) Stop() error { + s.mu.Lock() + if !s.started { + s.mu.Unlock() + return nil + } + s.started = false + transports := append([]Transport(nil), s.transports...) + s.mu.Unlock() + for _, t := range transports { + _ = t.Stop() + } + return nil +} + +// SendDatagram broadcasts a NetBIOS datagram through every active +// transport. If one or more transports fail, the first error is +// returned after attempting all sends. +func (s *Service) SendDatagram(d *protocol.Datagram) error { + s.mu.Lock() + transports := append([]Transport(nil), s.transports...) + s.mu.Unlock() + + var firstErr error + for _, t := range transports { + if err := t.SendDatagram(d); err != nil && firstErr == nil { + firstErr = err + } + } + if firstErr != nil { + return fmt.Errorf("netbios: send datagram: %w", firstErr) + } + return nil +} + +// SendDirectedDatagram sends a NetBIOS datagram back to a specific +// remote endpoint through each transport that supports directed +// delivery. ErrNotImplemented is returned when no configured +// transport exposes directed routing. +func (s *Service) SendDirectedDatagram(d *protocol.Datagram, remote DatagramEndpoint) error { + s.mu.Lock() + transports := append([]Transport(nil), s.transports...) + s.mu.Unlock() + + var firstErr error + attempted := false + for _, t := range transports { + dt, ok := t.(DirectedDatagramTransport) + if !ok { + continue + } + attempted = true + if err := dt.SendDirectedDatagram(d, remote); err != nil && firstErr == nil { + firstErr = err + } + } + if firstErr != nil { + return fmt.Errorf("netbios: send directed datagram: %w", firstErr) + } + if !attempted { + return ErrNotImplemented + } + return nil +} + +// NameService returns the NameService surface backed by this service. +// The current implementation is a stub. +func (s *Service) NameService() NameService { return s } + +// Register implements NameService by registering the given name as a +// file-server NetBIOS name on all transports. +func (s *Service) Register(name string) error { + n := protocol.NewName(name, protocol.NameTypeFileServer) + + s.mu.Lock() + if s.names == nil { + s.names = map[protocol.Name]struct{}{} + } + s.names[n] = struct{}{} + started := s.started + transports := append([]Transport(nil), s.transports...) + s.mu.Unlock() + + if !started { + return nil + } + for _, t := range transports { + if err := t.SendName(n); err != nil && !errors.Is(err, ErrNotImplemented) { + return fmt.Errorf("netbios: register name %q: %w", n.String(), err) + } + } + return nil +} + +// Resolve implements NameService (stub). +func (s *Service) Resolve(_ string) (string, error) { return "", ErrNotImplemented } + +// Release removes the name from this service's local registration set. +// Transport-level remove/release is not yet implemented. +func (s *Service) Release(name string) error { + n := protocol.NewName(name, protocol.NameTypeFileServer) + s.mu.Lock() + delete(s.names, n) + s.mu.Unlock() + return nil +} diff --git a/service/netbios/service_test.go b/service/netbios/service_test.go new file mode 100644 index 0000000..07279a7 --- /dev/null +++ b/service/netbios/service_test.go @@ -0,0 +1,86 @@ +package netbios + +import ( + "context" + "errors" + "sync/atomic" + "testing" + + protocol "github.com/ObsoleteMadness/ClassicStack/protocol/netbios" +) + +type fakeTransport struct { + started, stopped atomic.Bool + failStart bool + handler CommandHandler + sendNameCalls []protocol.Name + sendNameErr error +} + +func (f *fakeTransport) Start(_ context.Context) error { + if f.failStart { + return errors.New("boom") + } + f.started.Store(true) + return nil +} +func (f *fakeTransport) Stop() error { f.stopped.Store(true); return nil } +func (f *fakeTransport) SendName(n protocol.Name) error { + f.sendNameCalls = append(f.sendNameCalls, n) + return f.sendNameErr +} +func (f *fakeTransport) SendDatagram(_ *protocol.Datagram) error { return nil } +func (f *fakeTransport) SendSession(_ *protocol.SessionPacket) error { + return nil +} +func (f *fakeTransport) SetCommandHandler(h CommandHandler) { f.handler = h } + +func TestServiceStartStopAcrossTransports(t *testing.T) { + a, b := &fakeTransport{}, &fakeTransport{} + svc := NewService("CLASSICSTACK", "", []Transport{a, b}) + if err := svc.Start(context.Background()); err != nil { + t.Fatalf("Start: %v", err) + } + if !a.started.Load() || !b.started.Load() { + t.Fatal("transports not started") + } + if got := len(a.sendNameCalls); got != 2 { + t.Fatalf("expected 2 SendName calls on transport A, got %d", got) + } + if got := len(b.sendNameCalls); got != 2 { + t.Fatalf("expected 2 SendName calls on transport B, got %d", got) + } + if err := svc.Stop(); err != nil { + t.Fatalf("Stop: %v", err) + } + if !a.stopped.Load() || !b.stopped.Load() { + t.Fatal("transports not stopped") + } +} + +func TestServiceRollsBackOnFailedTransport(t *testing.T) { + good := &fakeTransport{} + bad := &fakeTransport{failStart: true} + svc := NewService("X", "", []Transport{good, bad}) + if err := svc.Start(context.Background()); err == nil { + t.Fatal("expected error from failing second transport") + } + if !good.stopped.Load() { + t.Fatal("first transport should have been rolled back via Stop()") + } +} + +func TestServiceRegisterDuringRuntimeSendsName(t *testing.T) { + f := &fakeTransport{} + svc := NewService("CLASSICSTACK", "", []Transport{f}) + if err := svc.Start(context.Background()); err != nil { + t.Fatalf("Start: %v", err) + } + before := len(f.sendNameCalls) + if err := svc.Register("EXTRA"); err != nil { + t.Fatalf("Register: %v", err) + } + if got := len(f.sendNameCalls); got != before+1 { + t.Fatalf("expected one additional SendName call, got %d -> %d", before, got) + } +} diff --git a/service/smb/browser_frames.go b/service/smb/browser_frames.go new file mode 100644 index 0000000..abc16c6 --- /dev/null +++ b/service/smb/browser_frames.go @@ -0,0 +1,428 @@ +package smb + +import ( + "bytes" + "encoding/binary" + "errors" + "strings" + + netbiosproto "github.com/ObsoleteMadness/ClassicStack/protocol/netbios" +) + +type browserMailslotTransaction struct { + MailslotName string + BrowserPayload []byte + Flags uint16 + TimeoutMS uint32 + Priority uint16 + Class uint16 +} + +func (t browserMailslotTransaction) MarshalBinary() []byte { + mailslotName := t.MailslotName + if mailslotName == "" { + mailslotName = browserMailslotBrowse + } + nameField := append([]byte(mailslotName), 0) + timeoutMS := t.TimeoutMS + if timeoutMS == 0 { + timeoutMS = 1000 + } + class := t.Class + if class == 0 { + class = 2 + } + out := make([]byte, browserTransactionDataOffset+len(t.BrowserPayload)) + copy(out[0:4], []byte{0xff, 'S', 'M', 'B'}) + out[4] = CommandTransaction + out[32] = browserTransactionWordCount + w := out[smbHeaderLen+1 : smbHeaderLen+1+browserTransactionWordsLen] + binary.LittleEndian.PutUint16(w[0:2], 0) + binary.LittleEndian.PutUint16(w[2:4], uint16(len(t.BrowserPayload))) + binary.LittleEndian.PutUint16(w[4:6], 0) + binary.LittleEndian.PutUint16(w[6:8], 0) + w[8] = 0 + w[9] = 0 + binary.LittleEndian.PutUint16(w[10:12], t.Flags) + binary.LittleEndian.PutUint32(w[12:16], timeoutMS) + binary.LittleEndian.PutUint16(w[16:18], 0) + binary.LittleEndian.PutUint16(w[18:20], 0) + binary.LittleEndian.PutUint16(w[20:22], 0) + binary.LittleEndian.PutUint16(w[22:24], uint16(len(t.BrowserPayload))) + binary.LittleEndian.PutUint16(w[24:26], browserTransactionDataOffset) + w[26] = 3 + w[27] = 0 + binary.LittleEndian.PutUint16(w[28:30], 1) + binary.LittleEndian.PutUint16(w[30:32], t.Priority) + binary.LittleEndian.PutUint16(w[32:34], class) + binary.LittleEndian.PutUint16(out[browserTransactionByteOffset:browserTransactionByteOffset+2], uint16(len(nameField)+len(t.BrowserPayload))) + copy(out[browserTransactionByteOffset+2:browserTransactionByteOffset+2+len(nameField)], nameField) + copy(out[browserTransactionDataOffset:], t.BrowserPayload) + return out +} + +func unmarshalBrowserMailslotTransaction(payload []byte) (*browserMailslotTransaction, error) { + if len(payload) < browserTransactionByteOffset+2 || string(payload[0:4]) != "\xffSMB" { + return nil, errors.New("smb: invalid transaction header") + } + if payload[4] != CommandTransaction || payload[32] != browserTransactionWordCount { + return nil, errors.New("smb: not a mailslot transaction") + } + w := payload[33:67] + dataCount := int(binary.LittleEndian.Uint16(w[22:24])) + dataOffset := int(binary.LittleEndian.Uint16(w[24:26])) + if dataCount == 0 || dataOffset < browserTransactionByteOffset+2 || dataOffset > len(payload) || dataOffset+dataCount > len(payload) { + return nil, errors.New("smb: invalid transaction data window") + } + byteCount := int(binary.LittleEndian.Uint16(payload[browserTransactionByteOffset : browserTransactionByteOffset+2])) + byteStart := browserTransactionByteOffset + 2 + byteEnd := byteStart + byteCount + if byteEnd > len(payload) { + return nil, errors.New("smb: invalid byte count") + } + nameEnd := bytes.IndexByte(payload[byteStart:dataOffset], 0) + if nameEnd < 0 { + return nil, errors.New("smb: missing mailslot terminator") + } + name := string(payload[byteStart : byteStart+nameEnd]) + return &browserMailslotTransaction{ + MailslotName: name, + BrowserPayload: append([]byte(nil), payload[dataOffset:dataOffset+dataCount]...), + Flags: binary.LittleEndian.Uint16(w[10:12]), + TimeoutMS: binary.LittleEndian.Uint32(w[12:16]), + Priority: binary.LittleEndian.Uint16(w[30:32]), + Class: binary.LittleEndian.Uint16(w[32:34]), + }, nil +} + +type hostAnnouncementFrame struct { + UpdateCount uint8 + PeriodicityMS uint32 + ServerName string + OSVersionMajor uint8 + OSVersionMinor uint8 + ServerType uint32 + BrowserVersionMajor uint8 + BrowserVersionMinor uint8 + Signature uint16 + Comment string +} + +type localMasterAnnouncementFrame struct { + UpdateCount uint8 + PeriodicityMS uint32 + ServerName string + OSVersionMajor uint8 + OSVersionMinor uint8 + ServerType uint32 + BrowserConfigVersionMajor uint8 + BrowserConfigVersionMinor uint8 + Signature uint16 + Comment string +} + +func (f hostAnnouncementFrame) MarshalBinary() []byte { + out := make([]byte, 33) + out[0] = browserCommandHostAnnouncement + out[1] = f.UpdateCount + binary.LittleEndian.PutUint32(out[2:6], f.PeriodicityMS) + serverName := fixedBrowserName(f.ServerName) + copy(out[6:22], serverName[:]) + out[22] = f.OSVersionMajor + out[23] = f.OSVersionMinor + binary.LittleEndian.PutUint32(out[24:28], f.ServerType) + out[28] = f.BrowserVersionMajor + out[29] = f.BrowserVersionMinor + binary.LittleEndian.PutUint16(out[30:32], f.Signature) + comment := strings.TrimSpace(f.Comment) + if len(comment) > 42 { + comment = comment[:42] + } + if comment != "" { + return append(out[:32], append([]byte(comment), 0)...) + } + out[32] = 0 + return out +} + +func unmarshalHostAnnouncementFrame(payload []byte) (*hostAnnouncementFrame, error) { + if len(payload) < 33 || payload[0] != browserCommandHostAnnouncement { + return nil, errors.New("smb: invalid host announcement frame") + } + comment := "" + if len(payload) > 32 { + comment = parseBrowserString(payload[32:]) + } + return &hostAnnouncementFrame{ + UpdateCount: payload[1], + PeriodicityMS: binary.LittleEndian.Uint32(payload[2:6]), + ServerName: parseBrowserString(payload[6:22]), + OSVersionMajor: payload[22], + OSVersionMinor: payload[23], + ServerType: binary.LittleEndian.Uint32(payload[24:28]), + BrowserVersionMajor: payload[28], + BrowserVersionMinor: payload[29], + Signature: binary.LittleEndian.Uint16(payload[30:32]), + Comment: comment, + }, nil +} + +func (f localMasterAnnouncementFrame) MarshalBinary() []byte { + out := make([]byte, 33) + out[0] = browserCommandLocalMasterAnnounce + out[1] = f.UpdateCount + binary.LittleEndian.PutUint32(out[2:6], f.PeriodicityMS) + serverName := fixedBrowserName(f.ServerName) + copy(out[6:22], serverName[:]) + out[22] = f.OSVersionMajor + out[23] = f.OSVersionMinor + binary.LittleEndian.PutUint32(out[24:28], f.ServerType) + out[28] = f.BrowserConfigVersionMajor + out[29] = f.BrowserConfigVersionMinor + binary.LittleEndian.PutUint16(out[30:32], f.Signature) + comment := strings.TrimSpace(f.Comment) + if len(comment) > 42 { + comment = comment[:42] + } + if comment != "" { + return append(out[:32], append([]byte(comment), 0)...) + } + out[32] = 0 + return out +} + +func unmarshalLocalMasterAnnouncementFrame(payload []byte) (*localMasterAnnouncementFrame, error) { + if len(payload) < 33 || payload[0] != browserCommandLocalMasterAnnounce { + return nil, errors.New("smb: invalid local-master-announcement frame") + } + comment := "" + if len(payload) > 32 { + comment = parseBrowserString(payload[32:]) + } + return &localMasterAnnouncementFrame{ + UpdateCount: payload[1], + PeriodicityMS: binary.LittleEndian.Uint32(payload[2:6]), + ServerName: parseBrowserString(payload[6:22]), + OSVersionMajor: payload[22], + OSVersionMinor: payload[23], + ServerType: binary.LittleEndian.Uint32(payload[24:28]), + BrowserConfigVersionMajor: payload[28], + BrowserConfigVersionMinor: payload[29], + Signature: binary.LittleEndian.Uint16(payload[30:32]), + Comment: comment, + }, nil +} + +type requestElectionFrame struct { + Version uint8 + Criteria uint32 + Uptime uint32 + Reserved uint32 + ServerName string +} + +func (f requestElectionFrame) MarshalBinary() []byte { + out := make([]byte, 14) + out[0] = browserCommandRequestElection + out[1] = f.Version + binary.LittleEndian.PutUint32(out[2:6], f.Criteria) + binary.LittleEndian.PutUint32(out[6:10], f.Uptime) + binary.LittleEndian.PutUint32(out[10:14], f.Reserved) + return appendBrowserName(out, f.ServerName) +} + +func unmarshalRequestElectionFrame(payload []byte) (*requestElectionFrame, error) { + if len(payload) < 15 || payload[0] != browserCommandRequestElection { + return nil, errors.New("smb: invalid election frame") + } + return &requestElectionFrame{ + Version: payload[1], + Criteria: binary.LittleEndian.Uint32(payload[2:6]), + Uptime: binary.LittleEndian.Uint32(payload[6:10]), + Reserved: binary.LittleEndian.Uint32(payload[10:14]), + ServerName: parseBrowserString(payload[14:]), + }, nil +} + +type getBackupListRequestFrame struct { + RequestedCount uint8 + Token uint32 +} + +func (f getBackupListRequestFrame) MarshalBinary() []byte { + out := make([]byte, 6) + out[0] = browserCommandGetBackupListReq + out[1] = f.RequestedCount + binary.LittleEndian.PutUint32(out[2:6], f.Token) + return out +} + +func unmarshalGetBackupListRequestFrame(payload []byte) (*getBackupListRequestFrame, error) { + if len(payload) < 6 || payload[0] != browserCommandGetBackupListReq { + return nil, errors.New("smb: invalid backup-list request frame") + } + return &getBackupListRequestFrame{ + RequestedCount: payload[1], + Token: binary.LittleEndian.Uint32(payload[2:6]), + }, nil +} + +type getBackupListResponseFrame struct { + Token uint32 + BackupServers []string +} + +type announcementRequestFrame struct { + Reserved uint8 + ResponseName string +} + +func unmarshalAnnouncementRequestFrame(payload []byte) (*announcementRequestFrame, error) { + if len(payload) < 2 || payload[0] != browserCommandAnnouncementReq { + return nil, errors.New("smb: invalid announcement-request frame") + } + responseName := "" + if len(payload) > 2 { + responseName = parseBrowserString(payload[2:]) + } + return &announcementRequestFrame{ + Reserved: payload[1], + ResponseName: responseName, + }, nil +} + +func (f getBackupListResponseFrame) MarshalBinary() []byte { + out := make([]byte, 6) + out[0] = browserCommandGetBackupListResp + out[1] = uint8(len(f.BackupServers)) + binary.LittleEndian.PutUint32(out[2:6], f.Token) + for _, server := range f.BackupServers { + out = appendBrowserName(out, server) + } + return out +} + +func unmarshalGetBackupListResponseFrame(payload []byte) (*getBackupListResponseFrame, error) { + if len(payload) < 6 || payload[0] != browserCommandGetBackupListResp { + return nil, errors.New("smb: invalid backup-list response frame") + } + count := int(payload[1]) + servers := make([]string, 0, count) + rest := payload[6:] + for len(rest) > 0 && len(servers) < count { + idx := bytes.IndexByte(rest, 0) + if idx < 0 { + return nil, errors.New("smb: unterminated backup-list server name") + } + servers = append(servers, parseBrowserString(rest[:idx+1])) + rest = rest[idx+1:] + } + if len(servers) != count { + return nil, errors.New("smb: backup-list count mismatch") + } + return &getBackupListResponseFrame{ + Token: binary.LittleEndian.Uint32(payload[2:6]), + BackupServers: servers, + }, nil +} + +type domainAnnouncementFrame struct { + Periodicity uint32 + MachineGroup string + ServerType uint32 + LocalMasterBrowserName string +} + +// unmarshalDomainAnnouncementFrame parses a DomainAnnouncement browser frame (opcode 0x0C). +// Layout per MS-BRWS §2.2.7: opcode(1)+UpdateCount(1)+Periodicity(4)+MachineGroup(16)+ +// BrowserConfigVersionMajor(1)+BrowserConfigVersionMinor(1)+ServerType(4)+ +// BrowserVersionMajor(1)+BrowserVersionMinor(1)+Signature(2)+LocalMasterBrowserName(variable). +func unmarshalDomainAnnouncementFrame(payload []byte) (*domainAnnouncementFrame, error) { + const fixedLen = 32 + if len(payload) < fixedLen+1 || payload[0] != browserCommandDomainAnnouncement { + return nil, errors.New("smb: invalid domain announcement frame") + } + periodicity := binary.LittleEndian.Uint32(payload[2:6]) + machineGroup := parseBrowserString(payload[6:22]) + serverType := binary.LittleEndian.Uint32(payload[24:28]) + masterName := parseBrowserString(payload[fixedLen:]) + return &domainAnnouncementFrame{ + Periodicity: periodicity, + MachineGroup: machineGroup, + ServerType: serverType, + LocalMasterBrowserName: masterName, + }, nil +} + +func normalizeBrowserName(name string) string { + upper := strings.ToUpper(strings.TrimSpace(name)) + if len(upper) > 15 { + upper = upper[:15] + } + return upper +} + +func fixedBrowserName(name string) [16]byte { + var out [16]byte + normalized := normalizeBrowserName(name) + copy(out[:], normalized) + return out +} + +func appendBrowserName(dst []byte, name string) []byte { + normalized := normalizeBrowserName(name) + dst = append(dst, normalized...) + return append(dst, 0) +} + +func parseBrowserString(b []byte) string { + if idx := bytes.IndexByte(b, 0); idx >= 0 { + b = b[:idx] + } + return strings.TrimRight(string(b), "\x00") +} + +func backupListResponseSource(requestDst netbiosproto.Name, server, workgroup string) netbiosproto.Name { + // Win9x clients often address GetBackupListRequest to <1D>. + // Mirror that identity in replies so browser clients can accept the source + // as the local master browser for the machine group. + if requestDst.Type() == browserNameTypeMasterBrowser && strings.EqualFold(requestDst.String(), workgroup) { + return netbiosproto.NewName(workgroup, browserNameTypeMasterBrowser) + } + return netbiosproto.NewName(server, netbiosproto.NameTypeFileServer) +} + +func isBrowserCommandByte(b byte) bool { + switch b { + case browserCommandHostAnnouncement, + browserCommandAnnouncementReq, + browserCommandRequestElection, + browserCommandGetBackupListReq, + browserCommandGetBackupListResp, + browserCommandLocalMasterAnnounce: + return true + default: + return false + } +} + +func unwrapBrowserPayload(payload []byte) (cmd byte, frame []byte, ok bool) { + if len(payload) == 0 { + return 0, nil, false + } + // Legacy Win9x browser requests can include a two-byte preamble + // before the browser opcode (for example 0x01 0x03 0x09 or + // 0x0f 0x06 0x08). Prefer this form when detected. + if len(payload) >= 3 && isBrowserCommandByte(payload[2]) { + if (payload[0] == 0x01 && payload[1] == 0x03) || (payload[0] == 0x0f && payload[1] == 0x06) { + return payload[2], payload[2:], true + } + } + if isBrowserCommandByte(payload[0]) { + return payload[0], payload, true + } + if len(payload) >= 3 && isBrowserCommandByte(payload[2]) { + return payload[2], payload[2:], true + } + return 0, nil, false +} diff --git a/service/smb/command_core.go b/service/smb/command_core.go new file mode 100644 index 0000000..0ed8249 --- /dev/null +++ b/service/smb/command_core.go @@ -0,0 +1,347 @@ +package smb + +import ( + "bytes" + "encoding/binary" + "strings" + "time" +) + +func stampSMBResponseHeader(out []byte) { + if len(out) < smbHeaderLen || string(out[0:4]) != "\xffSMB" { + return + } + out[smbOffFlags] |= 0x80 + flags2 := binary.LittleEndian.Uint16(out[smbOffFlags2 : smbOffFlags2+2]) + flags2 |= smbFlags2KnowsLongNames + binary.LittleEndian.PutUint16(out[smbOffFlags2:smbOffFlags2+2], flags2) +} + +func buildSMBErrorResponse(req []byte, status uint32) []byte { + if len(req) < smbHeaderLen || string(req[0:4]) != "\xffSMB" { + return nil + } + out := make([]byte, smbHeaderLen+3) + copy(out[:smbHeaderLen], req[:smbHeaderLen]) + binary.LittleEndian.PutUint32(out[smbOffStatus:smbOffStatus+4], toWireErrorStatus(req, status)) + stampSMBResponseHeader(out) + out[32] = 0 + binary.LittleEndian.PutUint16(out[33:35], 0) + return out +} + +func toWireErrorStatus(req []byte, status uint32) uint32 { + if len(req) >= smbHeaderLen { + flags2 := binary.LittleEndian.Uint16(req[smbOffFlags2 : smbOffFlags2+2]) + if flags2&smbFlags2NTStatus != 0 { + return status + } + } + + switch status { + case smbStatusSuccess, smbStatusBadTID, + smbStatusErrBadFunc, smbStatusErrBadFile, smbStatusErrBadPath, + smbStatusErrNoAccess, smbStatusErrNoFiles, smbStatusErrInvNetName, smbStatusErrSrvError: + return status + case smbStatusNoMoreFiles: + return smbStatusErrNoFiles + case smbStatusNotSupported: + return smbStatusErrBadFunc + case smbStatusBadNetworkName: + return smbStatusErrInvNetName + case smbStatusAccessDenied: + return smbStatusErrNoAccess + case smbStatusNameNotFound: + return smbStatusErrBadFile + case smbStatusFileIsDirectory, smbStatusNotADirectory: + return smbStatusErrBadPath + case smbStatusInvalidHandle: + return smbStatusErrBadFid + default: + if status&0xFF000000 == 0 { + return status + } + return smbStatusErrSrvError + } +} + +// findNegotiateDialect scans the dialect list in a SMB_COM_NEGOTIATE +// request and returns the 0-based index of the named dialect, or -1 +// if not found. +func findNegotiateDialect(req []byte, name string) int { + if len(req) < smbHeaderLen+3 { + return -1 + } + byteCount := int(binary.LittleEndian.Uint16(req[smbHeaderLen+1 : smbHeaderLen+3])) + if len(req) < smbHeaderLen+3+byteCount { + return -1 + } + rest := req[smbHeaderLen+3 : smbHeaderLen+3+byteCount] + idx := 0 + for len(rest) >= 2 { + if rest[0] != 0x02 { + break + } + rest = rest[1:] + nul := bytes.IndexByte(rest, 0) + if nul < 0 { + break + } + if string(rest[:nul]) == name { + return idx + } + rest = rest[nul+1:] + idx++ + } + return -1 +} + +// buildNegotiateResponse constructs an SMB_COM_NEGOTIATE response +// accepting the NT LM 0.12 dialect (WCT=17). SecurityMode is set to +// user-level without challenge so Win98 can send plain-text credentials +// and proceed to the guest session path. +func buildNegotiateResponse(req []byte, workgroup string) []byte { + if len(req) < smbHeaderLen { + return nil + } + dialectIdx := findNegotiateDialect(req, dialectNTLM) + if dialectIdx < 0 { + dialectIdx = 0 + } + domain := normalizeBrowserName(workgroup) + domainBytes := append([]byte(domain), 0) + + paramLen := 34 // 17 words + out := make([]byte, smbHeaderLen+1+paramLen+2+len(domainBytes)) + copy(out[:smbHeaderLen], req[:smbHeaderLen]) + binary.LittleEndian.PutUint32(out[smbOffStatus:smbOffStatus+4], smbStatusSuccess) + out[smbOffFlags] |= 0x80 + out[smbHeaderLen] = 17 // WCT + w := out[smbHeaderLen+1:] + binary.LittleEndian.PutUint16(w[0:2], uint16(dialectIdx)) // DialectIndex + w[2] = negotiateSecurityMode // SecurityMode + binary.LittleEndian.PutUint16(w[3:5], negotiateMaxMpxCount) + binary.LittleEndian.PutUint16(w[5:7], negotiateMaxNumberVcs) + binary.LittleEndian.PutUint32(w[7:11], negotiateMaxBufferSize) + binary.LittleEndian.PutUint32(w[11:15], negotiateMaxRawSize) + binary.LittleEndian.PutUint32(w[15:19], 0) // SessionKey + // Capabilities — see negotiateCapabilities in server.go for the + // exact set and rationale. CAP_MPX_MODE and CAP_RAW_MODE are + // deliberately not set; Win9x falls back to SMB_COM_READ / + // SMB_COM_WRITE / SMB_COM_WRITE_ANDX when those bits are clear. + binary.LittleEndian.PutUint32(w[19:23], negotiateCapabilities) + ft := uint64(time.Now().UTC().UnixNano()/100) + windowsFiletimeOffset + binary.LittleEndian.PutUint32(w[23:27], uint32(ft)) // SystemTimeLow + binary.LittleEndian.PutUint32(w[27:31], uint32(ft>>32)) // SystemTimeHigh + binary.LittleEndian.PutUint16(w[31:33], 0) // ServerTimeZone + w[33] = 0 // EncryptionKeyLength = 0 (no challenge) + binary.LittleEndian.PutUint16(w[34:36], uint16(len(domainBytes))) + copy(w[36:], domainBytes) + return out +} + +// buildSessionSetupResponse constructs an SMB_COM_SESSION_SETUP_ANDX +// response granting a guest session (UID=1, Action=0x0001). +func buildSessionSetupResponse(req []byte, uid uint16) []byte { + if len(req) < smbHeaderLen { + return nil + } + // WCT=3: AndXCommand(1b)+AndXReserved(1b)+AndXOffset(2b)+Action(2b). + // ByteCount=2: empty NativeOS and NativeLM strings (two NULs). + out := make([]byte, smbHeaderLen+1+6+2+2) + copy(out[:smbHeaderLen], req[:smbHeaderLen]) + binary.LittleEndian.PutUint32(out[smbOffStatus:smbOffStatus+4], smbStatusSuccess) + out[smbOffFlags] |= 0x80 + binary.LittleEndian.PutUint16(out[smbOffUID:smbOffUID+2], uid) // guest session UID + out[smbHeaderLen] = 3 // WCT + w := out[smbHeaderLen+1:] + w[0] = 0xFF // AndXCommand = no chaining + w[1] = 0x00 // AndXReserved + binary.LittleEndian.PutUint16(w[2:4], 0) // AndXOffset + binary.LittleEndian.PutUint16(w[4:6], 0x0001) // Action = guest logon + binary.LittleEndian.PutUint16(w[6:8], 2) // ByteCount + w[8] = 0x00 // NativeOS = "" + w[9] = 0x00 // NativeLM = "" + return out +} + +// buildTreeConnectResponse constructs an SMB_COM_TREE_CONNECT_ANDX +// response assigning TID=1 with IPC$ service type. +func buildTreeConnectResponse(req []byte) []byte { + if len(req) < smbHeaderLen { + return nil + } + service := []byte("IPC\x00") + nativeFS := []byte("\x00") + byteCount := len(service) + len(nativeFS) + // WCT=3: AndXCommand(1b)+AndXReserved(1b)+AndXOffset(2b)+OptionalSupport(2b). + out := make([]byte, smbHeaderLen+1+6+2+byteCount) + copy(out[:smbHeaderLen], req[:smbHeaderLen]) + binary.LittleEndian.PutUint32(out[smbOffStatus:smbOffStatus+4], smbStatusSuccess) + out[smbOffFlags] |= 0x80 + binary.LittleEndian.PutUint16(out[smbOffTID:smbOffTID+2], 1) // TID = 1 + out[smbHeaderLen] = 3 // WCT + w := out[smbHeaderLen+1:] + w[0] = 0xFF // AndXCommand = no chaining + w[1] = 0x00 // AndXReserved + binary.LittleEndian.PutUint16(w[2:4], 0) // AndXOffset + binary.LittleEndian.PutUint16(w[4:6], 0) // OptionalSupport + binary.LittleEndian.PutUint16(w[6:8], uint16(byteCount)) + copy(w[8:], service) + copy(w[8+len(service):], nativeFS) + return out +} + +// buildEchoResponse constructs a base SMB_COM_ECHO response that mirrors +// the request body and sets SequenceNumber to 1. +func buildEchoResponse(req []byte) []byte { + if len(req) < smbHeaderLen+5 || string(req[0:4]) != "\xffSMB" { + return nil + } + if req[smbHeaderLen] != 1 { + return nil + } + echoCount := binary.LittleEndian.Uint16(req[smbHeaderLen+1 : smbHeaderLen+3]) + if echoCount == 0 { + return nil + } + byteCount := int(binary.LittleEndian.Uint16(req[smbHeaderLen+3 : smbHeaderLen+5])) + if byteCount < 0 || len(req) < smbHeaderLen+5+byteCount { + return nil + } + data := req[smbHeaderLen+5 : smbHeaderLen+5+byteCount] + out := make([]byte, smbHeaderLen+1+2+2+len(data)) + copy(out[:smbHeaderLen], req[:smbHeaderLen]) + binary.LittleEndian.PutUint32(out[smbOffStatus:smbOffStatus+4], smbStatusSuccess) + out[smbOffFlags] |= 0x80 + out[smbHeaderLen] = 1 // WCT + binary.LittleEndian.PutUint16(out[smbHeaderLen+1:smbHeaderLen+3], 1) // SequenceNumber = 1 + binary.LittleEndian.PutUint16(out[smbHeaderLen+3:smbHeaderLen+5], uint16(len(data))) + copy(out[smbHeaderLen+5:], data) + return out +} + +func isValidEchoTID(req []byte, conn *connState) bool { + if len(req) < smbHeaderLen { + return false + } + tid := binary.LittleEndian.Uint16(req[smbOffTID : smbOffTID+2]) + if tid == 0xFFFF || tid == 1 { + return true + } + if conn == nil { + return false + } + conn.mu.Lock() + _, ok := conn.tids[tid] + conn.mu.Unlock() + return ok +} + +func (s *Service) handleTreeConnectAndX(req []byte, conn *connState) []byte { + if conn == nil { + return buildSMBErrorResponse(req, smbStatusBadNetworkName) + } + shareName, ok := parseTreeConnectShareName(req) + if !ok { + return buildSMBErrorResponse(req, smbStatusBadNetworkName) + } + + // IPC$ is a virtual share that is always available for LANMAN/named-pipe use. + if strings.EqualFold(shareName, ipcShareName) { + conn.mu.Lock() + conn.nextTID++ + tid := conn.nextTID + if tid == 0 { + conn.nextTID++ + tid = conn.nextTID + } + conn.tids[tid] = treeSlot{shareIdx: ipcShareIdx} + conn.mu.Unlock() + return buildTreeConnectResponseForIPC(req, tid) + } + + normalized := normalizeBrowserName(shareName) + s.mu.Lock() + shareIdx, found := s.shareNameToIndex[normalized] + s.mu.Unlock() + if !found { + return buildSMBErrorResponse(req, smbStatusBadNetworkName) + } + + conn.mu.Lock() + conn.nextTID++ + tid := conn.nextTID + if tid == 0 { + conn.nextTID++ + tid = conn.nextTID + } + conn.tids[tid] = treeSlot{shareIdx: shareIdx} + conn.mu.Unlock() + + return buildTreeConnectResponseWithTID(req, tid) +} + +// buildTreeConnectResponseForIPC constructs an SMB_COM_TREE_CONNECT_ANDX +// success response for IPC$ connections. The service string is "IPC". +func buildTreeConnectResponseForIPC(req []byte, tid uint16) []byte { + if len(req) < smbHeaderLen { + return nil + } + service := []byte("IPC\x00") + nativeFS := []byte("\x00") + byteCount := len(service) + len(nativeFS) + out := make([]byte, smbHeaderLen+1+6+2+byteCount) + copy(out[:smbHeaderLen], req[:smbHeaderLen]) + binary.LittleEndian.PutUint32(out[smbOffStatus:smbOffStatus+4], smbStatusSuccess) + out[smbOffFlags] |= 0x80 + binary.LittleEndian.PutUint16(out[smbOffTID:smbOffTID+2], tid) + out[smbHeaderLen] = 3 // WCT + w := out[smbHeaderLen+1:] + w[0] = 0xFF // AndXCommand = no chaining + w[1] = 0x00 // AndXReserved + binary.LittleEndian.PutUint16(w[2:4], 0) // AndXOffset + binary.LittleEndian.PutUint16(w[4:6], 0) // OptionalSupport + binary.LittleEndian.PutUint16(w[6:8], uint16(byteCount)) + copy(w[8:], service) + copy(w[8+len(service):], nativeFS) + return out +} + +// handleQueryInformationDisk (0x80) reports disk geometry and free space +// for the share associated with the request's TID. + +func buildTreeConnectResponseWithTID(req []byte, tid uint16) []byte { + if len(req) < smbHeaderLen { + return nil + } + service := []byte("A:\x00") + nativeFS := []byte("\x00") + byteCount := len(service) + len(nativeFS) + out := make([]byte, smbHeaderLen+1+6+2+byteCount) + copy(out[:smbHeaderLen], req[:smbHeaderLen]) + binary.LittleEndian.PutUint32(out[smbOffStatus:smbOffStatus+4], smbStatusSuccess) + out[smbOffFlags] |= 0x80 + binary.LittleEndian.PutUint16(out[smbOffTID:smbOffTID+2], tid) + out[smbHeaderLen] = 3 + w := out[smbHeaderLen+1:] + w[0] = 0xFF + w[1] = 0x00 + binary.LittleEndian.PutUint16(w[2:4], 0) + binary.LittleEndian.PutUint16(w[4:6], 0) + binary.LittleEndian.PutUint16(w[6:8], uint16(byteCount)) + copy(w[8:], service) + copy(w[8+len(service):], nativeFS) + return out +} + +func (s *Service) shareRootPath(shareIdx int) string { + s.mu.Lock() + defer s.mu.Unlock() + if shareIdx >= 0 && shareIdx < len(s.shares) { + return strings.TrimSpace(s.shares[shareIdx].Path) + } + return "" +} + +// handleCheckDirectory (0x10) verifies a path is a directory. diff --git a/service/smb/command_file_io.go b/service/smb/command_file_io.go new file mode 100644 index 0000000..244845b --- /dev/null +++ b/service/smb/command_file_io.go @@ -0,0 +1,1129 @@ +package smb + +import ( + "encoding/binary" + "errors" + "io" + "io/fs" + "os" + "path/filepath" + "strings" + + "github.com/ObsoleteMadness/ClassicStack/pkg/vfs" +) + +// openFlagFromAccess maps SMB AccessMode (low 3 bits) to an os.OpenFile flag. +// 0=read, 1=write, 2=read/write, 3=execute (treated as read). +func openFlagFromAccess(accessMode uint16) int { + switch accessMode & 0x07 { + case 1: + return os.O_WRONLY + case 2: + return os.O_RDWR + default: + return os.O_RDONLY + } +} + +// accessIsWritable reports whether an SMB AccessMode permits writes. +func accessIsWritable(accessMode uint16) bool { + mode := accessMode & 0x07 + return mode == 1 || mode == 2 +} + +func (s *Service) closeFID(conn *connState, fid uint16) { + conn.mu.Lock() + defer conn.mu.Unlock() + s.closeFIDLocked(conn, fid) +} + +func (s *Service) closeFIDLocked(conn *connState, fid uint16) { + handle, ok := conn.fids[fid] + if ok { + if handle != nil && handle.file != nil { + handle.file.Close() + } + s.releaseLocksForFIDLocked(conn, fid) + delete(conn.fids, fid) + } +} + +func (s *Service) handleOpenAndX(req []byte, conn *connState) []byte { + if len(req) < smbHeaderLen+15 { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + + tid := binary.LittleEndian.Uint16(req[smbOffTID : smbOffTID+2]) + + conn.mu.Lock() + slot, ok := conn.tids[tid] + conn.mu.Unlock() + if !ok { + return buildSMBErrorResponse(req, smbStatusBadTID) + } + + s.mu.Lock() + fs, ok := s.shareFSes[slot.shareIdx] + s.mu.Unlock() + if !ok || fs == nil { + return buildSMBErrorResponse(req, smbStatusBadTID) + } + rootPath := s.shareRootPath(slot.shareIdx) + + // Parse request + wct := int(req[smbHeaderLen]) + if wct < 15 { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + + // SMB_COM_OPEN_ANDX request words per [MS-CIFS] 2.2.4.41.1 (WCT=15): + // AndXCommand(1) AndXReserved(1) AndXOffset(2) Flags(2) + // AccessMode(2) SearchAttrs(2) FileAttrs(2) CreationTime(4) + // OpenFunction(2) AllocationSize(4) Timeout(4) Reserved(4) + w := req[smbHeaderLen+1:] + _ = binary.LittleEndian.Uint16(w[0:2]) // AndXCommand+Reserved + _ = binary.LittleEndian.Uint16(w[2:4]) // AndXOffset + _ = binary.LittleEndian.Uint16(w[4:6]) // Flags + desiredAccess := binary.LittleEndian.Uint16(w[6:8]) + _ = binary.LittleEndian.Uint16(w[8:10]) // SearchAttrs + fileAttrs := binary.LittleEndian.Uint16(w[10:12]) + _ = binary.LittleEndian.Uint32(w[12:16]) // CreationTime + openFunction := binary.LittleEndian.Uint16(w[16:18]) + + path, ok := parseSMBPath(req) + if !ok || path == "" { + return buildSMBErrorResponse(req, 0xC000007F) // STATUS_OBJECT_NAME_NOT_FOUND + } + + requestedPath := strings.TrimSpace(path) + createPath := smbJoinPath(rootPath, requestedPath) + openPath := createPath + if resolved, err := resolveExistingPath(fs, rootPath, requestedPath); err == nil { + openPath = resolved + } + + // Determine open mode + var file vfs.File + var err error + created := false + + // OPEN_FUNCTION (low nibble) — action if file exists: + // 0x0001 = open existing 0x0002 = truncate to zero + // (high nibble) — action if file does not exist: + // 0x0010 = create + // We treat the omitted-flag case (openFunction == 0) leniently and + // allow creation when missing, matching observed legacy clients. + failIfMissing := (openFunction & 0x00F0) == 0x0000 && (openFunction & 0x000F) != 0x0000 + truncateIfExists := (openFunction & 0x000F) == 0x0002 + + openFlag := openFlagFromAccess(desiredAccess) + if truncateIfExists { + openFlag |= os.O_TRUNC + if openFlag&(os.O_WRONLY|os.O_RDWR) == 0 { + openFlag = (openFlag &^ os.O_RDONLY) | os.O_RDWR + } + } + + // Try to open existing file / create new + activePath := openPath + file, err = fs.OpenFile(openPath, openFlag) + if err != nil && !failIfMissing { + activePath = createPath + file, err = fs.CreateFile(createPath) + if err == nil { + created = true + } + } + + if err != nil { + return buildSMBErrorResponse(req, 0xC000007F) // STATUS_OBJECT_NAME_NOT_FOUND + } + + // Get file info + info, err := file.Stat() + if err != nil { + file.Close() + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + + // Allocate FID + conn.mu.Lock() + conn.nextFID++ + fid := conn.nextFID + if fid == 0 { + conn.nextFID++ + fid = conn.nextFID + } + conn.fids[fid] = &fileHandle{ + file: file, + path: activePath, + tid: tid, + writable: created || accessIsWritable(desiredAccess), + } + conn.mu.Unlock() + + grantedAccess := desiredAccess + if grantedAccess == 0 { + grantedAccess = 0x0002 // sensible default: read/write + } + action := uint16(0x0001) // existed and opened + if created { + action = 0x0002 // created + } + + return buildOpenAndXResponse(req, fid, info, fileAttrs, grantedAccess, action) +} + +// handleReadAndX (0x2E) reads data from an open file. +func (s *Service) handleRead(req []byte, conn *connState) []byte { + if len(req) < smbHeaderLen+11 { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + + wct := int(req[smbHeaderLen]) + if wct < 5 { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + + w := req[smbHeaderLen+1:] + fid := binary.LittleEndian.Uint16(w[0:2]) + maxCount := binary.LittleEndian.Uint16(w[2:4]) + offset := binary.LittleEndian.Uint32(w[4:8]) + + data, ok := readBytesFromHandle(conn, fid, int64(offset), maxCount) + if !ok { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + + return buildReadResponse(req, data) +} + +func (s *Service) handleReadAndX(req []byte, conn *connState) []byte { + if len(req) < smbHeaderLen+11 { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + + // SMB_COM_READ_ANDX request words per [MS-CIFS] 2.2.4.42.1 (WCT=10 or 12): + // AndXCommand(1) AndXReserved(1) AndXOffset(2) + // FID(2) Offset(4) MaxCount(2) MinCount(2) + // Timeout/MaxCountHigh(4) Remaining(2) [OffsetHigh(4)] + wct := int(req[smbHeaderLen]) + if wct < 10 { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + + w := req[smbHeaderLen+1:] + fid := binary.LittleEndian.Uint16(w[4:6]) + offset := uint64(binary.LittleEndian.Uint32(w[6:10])) + maxCount := binary.LittleEndian.Uint16(w[10:12]) + if wct >= 12 { + offset |= uint64(binary.LittleEndian.Uint32(w[20:24])) << 32 + } + + data, ok := readBytesFromHandle(conn, fid, int64(offset), maxCount) + if !ok { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + + return buildReadAndXResponse(req, data) +} + +// handleReadMPX implements SMB_COM_READ_MPX (0x1B) per [MS-CIFS] +// 2.2.4.23 and 3.3.5.25. +// +// The spec allows the server to return the requested data in one OR +// many response messages: each carries its own Offset and DataLength, +// and the client reassembles. The Count field in every response is the +// total bytes the server intends to return for this request, so the +// client knows when to stop. We return everything in a single response +// (capped at MaxBufferSize - response-header-overhead); on Direct IPX +// this lets a typical MPX read complete in one IPX datagram. +// +// Rejecting with STATUS_SMB_USE_STANDARD was the prior behavior and +// works (Win9x falls back to SMB_COM_READ), but implementing the +// proper response avoids the extra round-trip and mirrors the +// WriteMPX fix where we honor the protocol per spec. +func (s *Service) handleReadMPX(req []byte, conn *connState) []byte { + if len(req) < smbHeaderLen+1 { + return buildSMBErrorResponse(req, smbStatusErrSrvError) + } + wct := int(req[smbHeaderLen]) + if wct < 8 { + return buildSMBErrorResponse(req, smbStatusErrSrvError) + } + + // SMB_COM_READ_MPX request words (16 bytes, WCT=8) per [MS-CIFS] 2.2.4.23.1: + // FID(2) Offset(4) MaxCountOfBytesToReturn(2) MinCountOfBytesToReturn(2) + // Timeout(4) Reserved(2) + w := req[smbHeaderLen+1:] + fid := binary.LittleEndian.Uint16(w[0:2]) + offset := binary.LittleEndian.Uint32(w[2:6]) + maxCount := binary.LittleEndian.Uint16(w[6:8]) + + // Cap the read at our negotiated MaxBufferSize minus the response + // envelope (SMB header 32 + WCT/words 17 + ByteCount 2 + small Pad). + // Anything bigger would overflow the client's receive buffer. + const responseOverhead = smbHeaderLen + 1 + 16 + 2 + 4 // generous Pad allowance + maxReadable := uint16(0xFFFF) + if int(negotiateMaxBufferSize) > responseOverhead { + bufCap := negotiateMaxBufferSize - responseOverhead + if bufCap < uint32(maxReadable) { + maxReadable = uint16(bufCap) + } + } + if maxCount > maxReadable { + maxCount = maxReadable + } + + data, ok := readBytesFromHandle(conn, fid, int64(offset), maxCount) + if !ok { + return buildSMBErrorResponse(req, smbStatusInvalidHandle) + } + + return buildReadMPXResponse(req, offset, data) +} + +// buildReadMPXResponse builds the spec-defined SMB_COM_READ_MPX response +// per [MS-CIFS] 2.2.4.23.2: WCT=8, Words = Offset(4) + Count(2) + +// Remaining(2) + DataCompactionMode(2) + Reserved(2) + DataLength(2) + +// DataOffset(2), followed by ByteCount + Pad + Data. +// +// - Offset: file offset where this chunk's data begins. +// - Count: TOTAL bytes the server intends to return for the whole +// request. Since we serve the entire read in one response, this +// equals DataLength. +// - Remaining: -1 (0xFFFF) for regular files per spec. +// - DataLength: bytes carried by this response. +// - DataOffset: offset within the SMB message at which Data starts. +func buildReadMPXResponse(req []byte, offset uint32, data []byte) []byte { + if len(req) < smbHeaderLen || string(req[0:4]) != "\xffSMB" { + return nil + } + dataLen := len(data) + // WCT=8 (16 word bytes) + ByteCount(2). DataOffset is measured from + // the SMB header start; the spec allows up to 3 bytes of Pad. We + // use 1 byte of Pad so DataOffset lands on an odd boundary — + // matching Samba's reply_readbmpx convention. + const wctBytes = 16 + headerEnd := smbHeaderLen + 1 + wctBytes + 2 // SMB hdr + WCT + words + BCC + pad := 1 + dataOffset := headerEnd + pad + total := dataOffset + dataLen + + out := make([]byte, total) + copy(out[:smbHeaderLen], req[:smbHeaderLen]) + binary.LittleEndian.PutUint32(out[smbOffStatus:smbOffStatus+4], smbStatusSuccess) + stampSMBResponseHeader(out) + out[smbHeaderLen] = 8 // WCT + w := out[smbHeaderLen+1:] + + binary.LittleEndian.PutUint32(w[0:4], offset) // Offset + binary.LittleEndian.PutUint16(w[4:6], uint16(dataLen)) // Count (total) + binary.LittleEndian.PutUint16(w[6:8], 0xFFFF) // Remaining = -1 for regular files + binary.LittleEndian.PutUint16(w[8:10], 0) // DataCompactionMode + binary.LittleEndian.PutUint16(w[10:12], 0) // Reserved + binary.LittleEndian.PutUint16(w[12:14], uint16(dataLen)) // DataLength + binary.LittleEndian.PutUint16(w[14:16], uint16(dataOffset)) + + // ByteCount = Pad + DataLength + binary.LittleEndian.PutUint16(w[wctBytes:wctBytes+2], uint16(pad+dataLen)) + // Pad byte left as 0, then Data + copy(out[dataOffset:], data) + return out +} + +// handleWriteMPX implements SMB_COM_WRITE_MPX (0x1E) per [MS-CIFS] +// 2.2.4.26 and 3.3.5.27. +// +// The protocol is: the client sends a *sequence* of WriteMPX requests +// sharing the same MID/CID, each carrying a chunk of data and a unique +// RequestMask bit. The server writes each chunk's data at its +// ByteOffsetToBeginWrite and accumulates the RequestMask values into a +// per-FID running OR. The server MUST NOT respond to non-final requests +// — replying acks them and breaks the client's window arithmetic. +// +// The final request in the sequence is identified by a NON-ZERO +// SequenceNumber in the SMB header's SecurityFeatures field (bytes +// 20..21 for connectionless transports). Only on that request does the +// server emit a single SMB_COM_WRITE_MPX response carrying the +// accumulated ResponseMask, after which the accumulator is reset for +// the next sequence. +// +// This is the spec-compliant approach; the previous "ack every chunk" +// shortcut produced silent file corruption because Win9x interprets +// each ack's mask bits as "those chunks landed" and slides past chunks +// it never actually sent. +func (s *Service) handleWriteMPX(req []byte, conn *connState) []byte { + if len(req) < smbHeaderLen+1 { + return buildSMBErrorResponse(req, smbStatusErrSrvError) + } + wct := int(req[smbHeaderLen]) + if wct < 12 { + return buildSMBErrorResponse(req, smbStatusErrSrvError) + } + + // SMB_COM_WRITE_MPX request words (24 bytes, WCT=12) per [MS-CIFS] 2.2.4.26.1: + // FID(2) TotalByteCount(2) Reserved(2) ByteOffsetToBeginWrite(4) + // Timeout(4) WriteMode(2) RequestMask(4) DataLength(2) DataOffset(2) + w := req[smbHeaderLen+1:] + fid := binary.LittleEndian.Uint16(w[0:2]) + offset := binary.LittleEndian.Uint32(w[6:10]) + requestMask := binary.LittleEndian.Uint32(w[16:20]) + dataLength := binary.LittleEndian.Uint16(w[20:22]) + dataOffset := binary.LittleEndian.Uint16(w[22:24]) + + dataStart := int(dataOffset) + dataEnd := dataStart + int(dataLength) + if dataStart < 0 || dataEnd > len(req) || dataStart > dataEnd { + return buildSMBErrorResponse(req, smbStatusErrSrvError) + } + data := req[dataStart:dataEnd] + + // SecurityFeatures.SequenceNumber at SMB header bytes 20..21 (the + // SequenceNumber subfield of the 8-byte SecurityFeatures region on + // connectionless transports). A nonzero value marks this request as + // the final one in the sequence. + sequenceNumber := binary.LittleEndian.Uint16(req[smbOffSequenceNumber : smbOffSequenceNumber+2]) + isFinal := sequenceNumber != 0 + + conn.mu.Lock() + handle, ok := conn.fids[fid] + conn.mu.Unlock() + if !ok || handle == nil || handle.file == nil { + if isFinal { + return buildSMBErrorResponse(req, smbStatusInvalidHandle) + } + return nil + } + if !handle.writable { + if isFinal { + return buildSMBErrorResponse(req, smbStatusAccessDenied) + } + return nil + } + + if len(data) > 0 { + if _, err := handle.file.WriteAt(data, int64(offset)); err != nil { + // Per [MS-CIFS] 3.3.5.27 errors before the final response are + // saved and returned later. We can't easily defer here, so + // surface the error only on the sequenced request. + if isFinal { + return buildSMBErrorResponse(req, smbStatusAccessDenied) + } + return nil + } + } + + // Accumulate this request's RequestMask. Reply only on the final + // request, then reset the accumulator for the next sequence. + conn.mu.Lock() + handle.mpxAccum |= requestMask + accumulated := handle.mpxAccum + if isFinal { + handle.mpxAccum = 0 + } + conn.mu.Unlock() + + if !isFinal { + return nil + } + return buildWriteMPXResponse(req, accumulated) +} + +// buildWriteMPXResponse builds the spec-defined SMB_COM_WRITE_MPX +// response per [MS-CIFS] 2.2.4.26.2: WCT=2 (one 4-byte ResponseMask), +// BCC=0. Sent only in reply to the sequenced (final) request. +func buildWriteMPXResponse(req []byte, responseMask uint32) []byte { + if len(req) < smbHeaderLen || string(req[0:4]) != "\xffSMB" { + return nil + } + out := make([]byte, smbHeaderLen+1+4+2) + copy(out[:smbHeaderLen], req[:smbHeaderLen]) + binary.LittleEndian.PutUint32(out[smbOffStatus:smbOffStatus+4], smbStatusSuccess) + stampSMBResponseHeader(out) + out[smbHeaderLen] = 2 // WCT + binary.LittleEndian.PutUint32(out[smbHeaderLen+1:smbHeaderLen+5], responseMask) + binary.LittleEndian.PutUint16(out[smbHeaderLen+5:smbHeaderLen+7], 0) // ByteCount + return out +} + +// handleWriteRaw rejects SMB_COM_WRITE_RAW (0x1D) with the spec-mandated +// Final Server Response carrying Count=0. Per [MS-CIFS] 3.3.5.26 the +// server MUST verify CAP_RAW_MODE is in Server.Capabilities before +// honoring the request; we don't advertise that capability (and set +// MaxRawSize=0 in NEGOTIATE), so the canonical reject form is the +// zero-count Final Response (WCT=1, BCC=0). This matches SMBLibrary's +// WriteRawFinalResponse{Count = 0}. +func (s *Service) handleWriteRaw(req []byte, conn *connState) []byte { + _ = conn + if len(req) < smbHeaderLen || string(req[0:4]) != "\xffSMB" { + return nil + } + out := make([]byte, smbHeaderLen+1+2+2) + copy(out[:smbHeaderLen], req[:smbHeaderLen]) + binary.LittleEndian.PutUint32(out[smbOffStatus:smbOffStatus+4], smbStatusSuccess) + out[smbOffFlags] |= 0x80 + out[smbHeaderLen] = 1 // WCT + binary.LittleEndian.PutUint16(out[smbHeaderLen+1:smbHeaderLen+3], 0) // Count = 0 + binary.LittleEndian.PutUint16(out[smbHeaderLen+3:smbHeaderLen+5], 0) // ByteCount + return out +} + +func readBytesFromHandle(conn *connState, fid uint16, offset int64, maxCount uint16) ([]byte, bool) { + // Look up file handle + conn.mu.Lock() + handle, ok := conn.fids[fid] + conn.mu.Unlock() + if !ok || handle == nil || handle.file == nil { + return nil, false + } + + // Read from file + data := make([]byte, maxCount) + n, err := handle.file.ReadAt(data, offset) + if err != nil && !errors.Is(err, io.EOF) { + return nil, false + } + + return data[:n], true +} + +// handleWriteAndX (0x2F) writes data to an open file. +func (s *Service) handleWriteAndX(req []byte, conn *connState) []byte { + if len(req) < smbHeaderLen+13 { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + + // SMB_COM_WRITE_ANDX request words per [MS-CIFS] 2.2.4.43.1 (WCT=12 or 14): + // AndXCommand(1) AndXReserved(1) AndXOffset(2) + // FID(2) Offset(4) Timeout(4) WriteMode(2) Remaining(2) + // DataLengthHigh(2) DataLength(2) DataOffset(2) [OffsetHigh(4)] + wct := int(req[smbHeaderLen]) + if wct < 12 { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + + w := req[smbHeaderLen+1:] + fid := binary.LittleEndian.Uint16(w[4:6]) + offset := uint64(binary.LittleEndian.Uint32(w[6:10])) + dataLength := binary.LittleEndian.Uint16(w[20:22]) + dataOffset := binary.LittleEndian.Uint16(w[22:24]) + if wct >= 14 { + offset |= uint64(binary.LittleEndian.Uint32(w[24:28])) << 32 + } + + // DataOffset is relative to the SMB header start. + dataStart := int(dataOffset) + dataEnd := dataStart + int(dataLength) + if dataStart < 0 || dataEnd > len(req) || dataStart > dataEnd { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + data := req[dataStart:dataEnd] + + // Look up file handle + conn.mu.Lock() + handle, ok := conn.fids[fid] + conn.mu.Unlock() + if !ok || handle == nil || handle.file == nil { + return buildSMBErrorResponse(req, smbStatusInvalidHandle) + } + + if !handle.writable { + return buildSMBErrorResponse(req, smbStatusAccessDenied) + } + + if len(data) == 0 { + // Zero-length write — truncate to offset, mirroring SMB_COM_WRITE. + if err := handle.file.Truncate(int64(offset)); err != nil { + return buildSMBErrorResponse(req, smbStatusAccessDenied) + } + return buildWriteAndXResponse(req, 0) + } + + n, err := handle.file.WriteAt(data, int64(offset)) + if err != nil { + return buildSMBErrorResponse(req, smbStatusAccessDenied) + } + + return buildWriteAndXResponse(req, uint16(n)) +} + +// handleClose (0x04) closes an open file and releases the file handle. +func (s *Service) handleClose(req []byte, conn *connState) []byte { + if len(req) < smbHeaderLen+7 { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + + // Parse request + wct := int(req[smbHeaderLen]) + if wct < 3 { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + + w := req[smbHeaderLen+1:] + fid := binary.LittleEndian.Uint16(w[0:2]) + // lastWriteTime := binary.LittleEndian.Uint32(w[2:6]) // unused + + // Look up and close file handle + conn.mu.Lock() + s.closeFIDLocked(conn, fid) + conn.mu.Unlock() + + return buildSimpleSuccessResponse(req) +} + +// handleFlush (0x05) flushes buffered writes for one or all open files +// in the connection. Per [MS-CIFS] 2.2.4.6.1, FID=0xFFFF means "flush +// every file the requesting PID has open"; otherwise the named FID is +// flushed. The response is WCT=0/BCC=0 (success) or an error. +func (s *Service) handleFlush(req []byte, conn *connState) []byte { + if len(req) < smbHeaderLen+1 { + return buildSMBErrorResponse(req, smbStatusErrSrvError) + } + wct := int(req[smbHeaderLen]) + if wct < 1 { + return buildSMBErrorResponse(req, smbStatusErrSrvError) + } + + w := req[smbHeaderLen+1:] + fid := binary.LittleEndian.Uint16(w[0:2]) + + if fid == 0xFFFF { + conn.mu.Lock() + handles := make([]*fileHandle, 0, len(conn.fids)) + for _, h := range conn.fids { + if h != nil && h.file != nil { + handles = append(handles, h) + } + } + conn.mu.Unlock() + for _, h := range handles { + _ = h.file.Sync() + } + return buildSimpleSuccessResponse(req) + } + + conn.mu.Lock() + handle, ok := conn.fids[fid] + conn.mu.Unlock() + if !ok || handle == nil || handle.file == nil { + return buildSMBErrorResponse(req, smbStatusInvalidHandle) + } + + // Sync best-effort. On Windows, FlushFileBuffers fails on handles + // opened read-only — but a read-only file has no buffered writes + // to flush, so reporting that as an error to the client is wrong. + // Treat Sync failures as a noop: the kernel will commit any + // pending writes when the handle closes. + _ = handle.file.Sync() + return buildSimpleSuccessResponse(req) +} + +func (s *Service) handleSeek(req []byte, conn *connState) []byte { + if len(req) < smbHeaderLen+9 { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + + wct := int(req[smbHeaderLen]) + if wct < 4 { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + + w := req[smbHeaderLen+1:] + fid := binary.LittleEndian.Uint16(w[0:2]) + mode := binary.LittleEndian.Uint16(w[2:4]) + delta := int64(int32(binary.LittleEndian.Uint32(w[4:8]))) + + conn.mu.Lock() + handle, ok := conn.fids[fid] + if !ok || handle == nil || handle.file == nil { + conn.mu.Unlock() + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + current := handle.offset + file := handle.file + conn.mu.Unlock() + + var base int64 + switch mode { + case 0: + base = 0 + case 1: + base = current + case 2: + info, err := file.Stat() + if err != nil { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + base = info.Size() + default: + return buildSMBErrorResponse(req, smbStatusErrBadFunc) + } + + pos := base + delta + if pos < 0 { + return buildSMBErrorResponse(req, smbStatusErrBadFunc) + } + + conn.mu.Lock() + if handle := conn.fids[fid]; handle != nil { + handle.offset = pos + } + conn.mu.Unlock() + + return buildSeekResponse(req, uint32(pos)) +} + +func buildSeekResponse(req []byte, offset uint32) []byte { + if len(req) < smbHeaderLen || string(req[0:4]) != "\xffSMB" { + return nil + } + + out := make([]byte, smbHeaderLen+1+4+2) + copy(out[:smbHeaderLen], req[:smbHeaderLen]) + binary.LittleEndian.PutUint32(out[smbOffStatus:smbOffStatus+4], smbStatusSuccess) + out[smbOffFlags] |= 0x80 + out[smbHeaderLen] = 2 + binary.LittleEndian.PutUint32(out[smbHeaderLen+1:smbHeaderLen+5], offset) + binary.LittleEndian.PutUint16(out[smbHeaderLen+5:smbHeaderLen+7], 0) + return out +} + +func buildWriteAndXResponse(req []byte, count uint16) []byte { + if len(req) < smbHeaderLen || string(req[0:4]) != "\xffSMB" { + return nil + } + + out := make([]byte, smbHeaderLen+1+(6*2)+2) + copy(out[:smbHeaderLen], req[:smbHeaderLen]) + binary.LittleEndian.PutUint32(out[smbOffStatus:smbOffStatus+4], smbStatusSuccess) + out[smbOffFlags] |= 0x80 + out[smbHeaderLen] = 6 // WCT + w := out[smbHeaderLen+1:] + + // AndXCommand, AndXReserved, AndXOffset + w[0] = 0xFF + w[1] = 0x00 + binary.LittleEndian.PutUint16(w[2:4], 0) + + // Count (bytes written, low 16 bits) + binary.LittleEndian.PutUint16(w[4:6], count) + + // Available — per [MS-CIFS] 2.2.4.43.2 this MUST be 0xFFFF for disk + // file writes. Some legacy clients refuse to advance unless they + // see the sentinel. + binary.LittleEndian.PutUint16(w[6:8], 0xFFFF) + + // Reserved + binary.LittleEndian.PutUint32(w[8:12], 0) + + // ByteCount = 0 + binary.LittleEndian.PutUint16(w[12:14], 0) + + return out +} + +func buildReadAndXResponse(req []byte, data []byte) []byte { + if len(req) < smbHeaderLen || string(req[0:4]) != "\xffSMB" { + return nil + } + + padLen := readDataPadLength(smbHeaderLen + 1 + (12 * 2) + 2) + out := make([]byte, smbHeaderLen+1+(12*2)+2+padLen+len(data)) + copy(out[:smbHeaderLen], req[:smbHeaderLen]) + binary.LittleEndian.PutUint32(out[smbOffStatus:smbOffStatus+4], smbStatusSuccess) + out[smbOffFlags] |= 0x80 + out[smbHeaderLen] = 12 // WCT + w := out[smbHeaderLen+1:] + + // AndXCommand, AndXReserved, AndXOffset + w[0] = 0xFF + w[1] = 0x00 + binary.LittleEndian.PutUint16(w[2:4], 0) + + // Remaining (words available for next command) + binary.LittleEndian.PutUint16(w[4:6], 0) + + // DataCompactionMode + binary.LittleEndian.PutUint16(w[6:8], 0) + + // Reserved + binary.LittleEndian.PutUint16(w[8:10], 0) + + // DataLength + binary.LittleEndian.PutUint16(w[10:12], uint16(len(data))) + + // DataOffset relative to SMB header + dataOffset := smbHeaderLen + 1 + (12 * 2) + 2 + padLen + binary.LittleEndian.PutUint16(w[12:14], uint16(dataOffset)) + + // Reserved + binary.LittleEndian.PutUint16(w[14:16], 0) + + // Reserved + binary.LittleEndian.PutUint16(w[16:18], 0) + + // Reserved + binary.LittleEndian.PutUint16(w[18:20], 0) + + // Reserved + binary.LittleEndian.PutUint16(w[20:22], 0) + + // ByteCount + binary.LittleEndian.PutUint16(w[22:24], uint16(len(data)+padLen)) + + // Data + copy(w[24+padLen:], data) + + return out +} + +func buildReadResponse(req []byte, data []byte) []byte { + if len(req) < smbHeaderLen || string(req[0:4]) != "\xffSMB" { + return nil + } + + // SMB_COM_READ (0x0A) response per [MS-CIFS] 2.2.4.11.2: + // WCT = 5 + // Words: CountOfBytesReturned(2), Reserved[4](8 bytes = 4 x uint16) + // SMB_Data: ByteCount(2), BufferFormat(1)=0x01, CountOfBytesRead(2), Bytes[] + const wct = 5 + // SMB_Data starts at: smbHeaderLen + 1(WCT) + wct*2(Words) + 2(ByteCount) + // Bytes field: 1(BufferFormat) + 2(CountOfBytesRead) + len(data) + bcc := uint16(3 + len(data)) + out := make([]byte, smbHeaderLen+1+(wct*2)+2+3+len(data)) + copy(out[:smbHeaderLen], req[:smbHeaderLen]) + binary.LittleEndian.PutUint32(out[smbOffStatus:smbOffStatus+4], smbStatusSuccess) + out[smbOffFlags] |= 0x80 + out[smbHeaderLen] = wct + w := out[smbHeaderLen+1:] + + // CountOfBytesReturned + binary.LittleEndian.PutUint16(w[0:2], uint16(len(data))) + // Reserved[4] = 8 bytes of zeros (already zero from make) + + // ByteCount + binary.LittleEndian.PutUint16(w[wct*2:wct*2+2], bcc) + + // Bytes: BufferFormat = 0x01 (SMB_FORMAT_DATA) + bytes := w[wct*2+2:] + bytes[0] = 0x01 + binary.LittleEndian.PutUint16(bytes[1:3], uint16(len(data))) + copy(bytes[3:], data) + + return out +} + +func readDataPadLength(dataStart int) int { + if dataStart%2 == 0 { + return 0 + } + return 1 +} + +func buildOpenAndXResponse(req []byte, fid uint16, info fs.FileInfo, fileAttrs uint16, grantedAccess uint16, action uint16) []byte { + if len(req) < smbHeaderLen || string(req[0:4]) != "\xffSMB" { + return nil + } + + out := make([]byte, smbHeaderLen+1+(30)+2) + copy(out[:smbHeaderLen], req[:smbHeaderLen]) + binary.LittleEndian.PutUint32(out[smbOffStatus:smbOffStatus+4], smbStatusSuccess) + out[smbOffFlags] |= 0x80 + out[smbHeaderLen] = 15 // WCT + w := out[smbHeaderLen+1:] + + attrs := uint16(0) + if info.IsDir() { + attrs |= FileAttributeDirectory + } else { + attrs |= FileAttributeArchive + } + + // AndXCommand, AndXReserved, AndXOffset + w[0] = 0xFF + w[1] = 0x00 + binary.LittleEndian.PutUint16(w[2:4], 0) + + // FID + binary.LittleEndian.PutUint16(w[4:6], fid) + + // FileAttributes + binary.LittleEndian.PutUint16(w[6:8], attrs) + + // LastWriteTime (DOS format, for now 0) + binary.LittleEndian.PutUint32(w[8:12], 0) + + // FileSize + binary.LittleEndian.PutUint32(w[12:16], uint32(info.Size())) + + // GrantedAccess + binary.LittleEndian.PutUint16(w[16:18], grantedAccess) + + // FileType + binary.LittleEndian.PutUint16(w[18:20], 0) // DISK_FILE + + // DeviceState + binary.LittleEndian.PutUint16(w[20:22], 0) + + // ActionOpened + binary.LittleEndian.PutUint16(w[22:24], action) + + // Reserved + binary.LittleEndian.PutUint32(w[24:28], 0) + + // Reserved + binary.LittleEndian.PutUint16(w[28:30], 0) + + // ByteCount = 0 + binary.LittleEndian.PutUint16(w[30:32], 0) + + return out +} + +// handleOpen implements SMB_COM_OPEN (0x02). +// Opens an existing regular file. Returns STATUS_OBJECT_NAME_NOT_FOUND if absent. +func (s *Service) handleOpen(req []byte, conn *connState) []byte { + if len(req) < smbHeaderLen+1 { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + wct := int(req[smbHeaderLen]) + if wct < 2 { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + + tid, slot, fsys, ok := s.resolveRequestTree(req, conn) + if !ok { + return buildSMBErrorResponse(req, smbStatusBadTID) + } + rootPath := s.shareRootPath(slot.shareIdx) + + w := req[smbHeaderLen+1:] + accessMode := binary.LittleEndian.Uint16(w[0:2]) + + if accessIsWritable(accessMode) && s.shares[slot.shareIdx].ReadOnly { + return buildSMBErrorResponse(req, smbStatusAccessDenied) + } + + path, ok := parseSMBPath(req) + if !ok || path == "" { + return buildSMBErrorResponse(req, smbStatusNameNotFound) + } + resolved, err := resolveExistingPath(fsys, rootPath, path) + if err != nil { + return buildSMBErrorResponse(req, smbStatusNameNotFound) + } + info, err := fsys.Stat(resolved) + if err != nil { + return buildSMBErrorResponse(req, smbStatusNameNotFound) + } + if info.IsDir() { + return buildSMBErrorResponse(req, smbStatusFileIsDirectory) + } + + file, err := fsys.OpenFile(resolved, openFlagFromAccess(accessMode)) + if err != nil { + return buildSMBErrorResponse(req, smbStatusAccessDenied) + } + + conn.mu.Lock() + conn.nextFID++ + fid := conn.nextFID + if fid == 0 { + conn.nextFID++ + fid = conn.nextFID + } + conn.fids[fid] = &fileHandle{ + file: file, + path: resolved, + tid: tid, + writable: accessIsWritable(accessMode), + } + conn.mu.Unlock() + + return buildOpenResponse(req, fid, info, accessMode) +} + +// handleCreate implements SMB_COM_CREATE (0x03). +// Creates a new file or truncates an existing one to zero length. +// Always returns a read/write FID. +func (s *Service) handleCreate(req []byte, conn *connState) []byte { + if len(req) < smbHeaderLen+1 { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + wct := int(req[smbHeaderLen]) + if wct < 3 { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + + tid, slot, fsys, ok := s.resolveRequestTree(req, conn) + if !ok { + return buildSMBErrorResponse(req, smbStatusBadTID) + } + rootPath := s.shareRootPath(slot.shareIdx) + if s.shares[slot.shareIdx].ReadOnly { + return buildSMBErrorResponse(req, smbStatusAccessDenied) + } + + path, ok := parseSMBPath(req) + if !ok || path == "" { + return buildSMBErrorResponse(req, smbStatusNameNotFound) + } + + // Use strict-leaf matching: SMB_COM_CREATE truncates an existing file + // at the requested name, but a fuzzy resolver could pick a sibling + // (e.g. "setup" prefix-matching "SETUP.cab") and destroy the wrong + // file. resolveSMBLeaf only accepts exact case-insensitive matches. + parentHost, matched, info, _ := resolveSMBLeaf(fsys, rootPath, path) + if matched != "" && info != nil && info.IsDir() { + return buildSMBErrorResponse(req, smbStatusFileIsDirectory) + } + _, leaf := splitSMBParent(path) + target := filepath.Join(parentHost, leaf) + if matched != "" { + target = filepath.Join(parentHost, matched) + } + + file, err := fsys.CreateFile(target) + if err != nil { + return buildSMBErrorResponse(req, smbStatusAccessDenied) + } + + conn.mu.Lock() + conn.nextFID++ + fid := conn.nextFID + if fid == 0 { + conn.nextFID++ + fid = conn.nextFID + } + conn.fids[fid] = &fileHandle{ + file: file, + path: target, + tid: tid, + writable: true, + } + conn.mu.Unlock() + + return buildCreateResponse(req, fid) +} + +// handleWrite implements SMB_COM_WRITE (0x0B) per [MS-CIFS] 2.2.4.12. +// A zero-length write truncates the file to the supplied offset. +// +// Win9x over Direct IPX uses this synchronous form (the Mac client too, +// once we reject the multiplexed variants with ERRuseSTD): each request +// carries its own data and offset, and the response acks the byte count +// written. This is the preferred large-write path on connectionless +// transports because there is no per-window ack accounting to mishandle. +func (s *Service) handleWrite(req []byte, conn *connState) []byte { + if len(req) < smbHeaderLen+1 { + return buildSMBErrorResponse(req, smbStatusErrSrvError) + } + wct := int(req[smbHeaderLen]) + if wct < 5 { + return buildSMBErrorResponse(req, smbStatusErrSrvError) + } + + w := req[smbHeaderLen+1:] + fid := binary.LittleEndian.Uint16(w[0:2]) + count := binary.LittleEndian.Uint16(w[2:4]) + offset := binary.LittleEndian.Uint32(w[4:8]) + + conn.mu.Lock() + handle, ok := conn.fids[fid] + conn.mu.Unlock() + if !ok || handle == nil || handle.file == nil { + return buildSMBErrorResponse(req, smbStatusInvalidHandle) + } + if !handle.writable { + return buildSMBErrorResponse(req, smbStatusAccessDenied) + } + + if count == 0 { + // Per [MS-CIFS] 2.2.4.12: a zero-length write truncates the file + // to the supplied offset. + if err := handle.file.Truncate(int64(offset)); err != nil { + return buildSMBErrorResponse(req, smbStatusAccessDenied) + } + return buildWriteResponse(req, 0) + } + + bytesArea, ok := smbBytesArea(req) + if !ok { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + // Bytes layout: BufferFormat(1) + DataLength(2) + Data[count] + if len(bytesArea) < 3 { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + data := bytesArea[3:] + if len(data) > int(count) { + data = data[:count] + } + + n, err := handle.file.WriteAt(data, int64(offset)) + if err != nil { + return buildSMBErrorResponse(req, smbStatusAccessDenied) + } + return buildWriteResponse(req, uint16(n)) +} + +// buildOpenResponse builds an SMB_COM_OPEN (0x02) response with WCT=7. +func buildOpenResponse(req []byte, fid uint16, info fs.FileInfo, accessMode uint16) []byte { + if len(req) < smbHeaderLen || string(req[0:4]) != "\xffSMB" { + return nil + } + out := make([]byte, smbHeaderLen+1+(7*2)+2) + copy(out[:smbHeaderLen], req[:smbHeaderLen]) + binary.LittleEndian.PutUint32(out[smbOffStatus:smbOffStatus+4], smbStatusSuccess) + out[smbOffFlags] |= 0x80 + out[smbHeaderLen] = 7 + w := out[smbHeaderLen+1:] + + attrs := uint16(FileAttributeArchive) + if info != nil && info.IsDir() { + attrs = FileAttributeDirectory + } + var size uint32 + if info != nil { + size = uint32(info.Size()) + } + + binary.LittleEndian.PutUint16(w[0:2], fid) + binary.LittleEndian.PutUint16(w[2:4], attrs) + binary.LittleEndian.PutUint32(w[4:8], 0) // LastModified (UTIME) + binary.LittleEndian.PutUint32(w[8:12], size) + binary.LittleEndian.PutUint16(w[12:14], accessMode&0x07) + binary.LittleEndian.PutUint16(w[14:16], 0) // ByteCount + return out +} + +// buildCreateResponse builds an SMB_COM_CREATE (0x03) response with WCT=1. +func buildCreateResponse(req []byte, fid uint16) []byte { + if len(req) < smbHeaderLen || string(req[0:4]) != "\xffSMB" { + return nil + } + out := make([]byte, smbHeaderLen+1+2+2) + copy(out[:smbHeaderLen], req[:smbHeaderLen]) + binary.LittleEndian.PutUint32(out[smbOffStatus:smbOffStatus+4], smbStatusSuccess) + out[smbOffFlags] |= 0x80 + out[smbHeaderLen] = 1 + binary.LittleEndian.PutUint16(out[smbHeaderLen+1:smbHeaderLen+3], fid) + binary.LittleEndian.PutUint16(out[smbHeaderLen+3:smbHeaderLen+5], 0) // ByteCount + return out +} + +// buildWriteResponse builds an SMB_COM_WRITE (0x0B) response with WCT=1. +func buildWriteResponse(req []byte, count uint16) []byte { + if len(req) < smbHeaderLen || string(req[0:4]) != "\xffSMB" { + return nil + } + out := make([]byte, smbHeaderLen+1+2+2) + copy(out[:smbHeaderLen], req[:smbHeaderLen]) + binary.LittleEndian.PutUint32(out[smbOffStatus:smbOffStatus+4], smbStatusSuccess) + out[smbOffFlags] |= 0x80 + out[smbHeaderLen] = 1 + binary.LittleEndian.PutUint16(out[smbHeaderLen+1:smbHeaderLen+3], count) + binary.LittleEndian.PutUint16(out[smbHeaderLen+3:smbHeaderLen+5], 0) // ByteCount + return out +} diff --git a/service/smb/command_fs_search.go b/service/smb/command_fs_search.go new file mode 100644 index 0000000..c002b33 --- /dev/null +++ b/service/smb/command_fs_search.go @@ -0,0 +1,439 @@ +package smb + +import ( + "bytes" + "encoding/binary" + "fmt" + "io/fs" + "path/filepath" + "strings" + "time" +) + +func (s *Service) handleQueryInformationDisk(req []byte, conn *connState) []byte { + if len(req) < smbHeaderLen { + return buildSMBErrorResponse(req, smbStatusBadTID) + } + + tid := binary.LittleEndian.Uint16(req[smbOffTID : smbOffTID+2]) + + conn.mu.Lock() + slot, ok := conn.tids[tid] + conn.mu.Unlock() + if !ok { + return buildSMBErrorResponse(req, smbStatusBadTID) + } + + s.mu.Lock() + fs, ok := s.shareFSes[slot.shareIdx] + diskPath := "." + if slot.shareIdx >= 0 && slot.shareIdx < len(s.shares) { + if p := strings.TrimSpace(s.shares[slot.shareIdx].Path); p != "" { + diskPath = p + } + } + s.mu.Unlock() + if !ok || fs == nil { + return buildSMBErrorResponse(req, smbStatusBadTID) + } + + totalBytes, freeBytes, err := fs.DiskUsage(diskPath) + if err != nil { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + + return buildQueryInformationDiskResponse(req, totalBytes, freeBytes) +} + +func (s *Service) handleCheckDirectory(req []byte, conn *connState) []byte { + if len(req) < smbHeaderLen { + return buildSMBErrorResponse(req, smbStatusBadTID) + } + + tid := binary.LittleEndian.Uint16(req[smbOffTID : smbOffTID+2]) + + conn.mu.Lock() + slot, ok := conn.tids[tid] + conn.mu.Unlock() + if !ok { + return buildSMBErrorResponse(req, smbStatusBadTID) + } + + s.mu.Lock() + fs, ok := s.shareFSes[slot.shareIdx] + s.mu.Unlock() + if !ok || fs == nil { + return buildSMBErrorResponse(req, smbStatusBadTID) + } + rootPath := s.shareRootPath(slot.shareIdx) + + path, ok := parseSMBPath(req) + if !ok || path == "" { + return buildSMBErrorResponse(req, 0xC000007F) // STATUS_OBJECT_NAME_NOT_FOUND + } + resolvedPath, err := resolveExistingPath(fs, rootPath, path) + if err != nil { + return buildSMBErrorResponse(req, 0xC000007F) // STATUS_OBJECT_NAME_NOT_FOUND + } + + info, err := fs.Stat(resolvedPath) + if err != nil { + return buildSMBErrorResponse(req, 0xC000007F) // STATUS_OBJECT_NAME_NOT_FOUND + } + + if !info.IsDir() { + return buildSMBErrorResponse(req, 0xC0000103) // STATUS_NOT_A_DIRECTORY + } + + return buildSimpleSuccessResponse(req) +} + +// handleSearch (0x81) performs directory enumeration with pattern matching. +// Returns entries in DOS 8.3 format suitable for Win9x/DOS clients. +func (s *Service) handleSearch(req []byte, conn *connState) []byte { + if len(req) < smbHeaderLen+11 { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + + tid := binary.LittleEndian.Uint16(req[smbOffTID : smbOffTID+2]) + + conn.mu.Lock() + slot, ok := conn.tids[tid] + conn.mu.Unlock() + if !ok { + return buildSMBErrorResponse(req, smbStatusBadTID) + } + + s.mu.Lock() + fs, ok := s.shareFSes[slot.shareIdx] + s.mu.Unlock() + if !ok || fs == nil { + return buildSMBErrorResponse(req, smbStatusBadTID) + } + rootPath := s.shareRootPath(slot.shareIdx) + + // Parse request parameters + wct := int(req[smbHeaderLen]) + if wct < 2 { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + + attrs := binary.LittleEndian.Uint16(req[smbHeaderLen+1 : smbHeaderLen+3]) + pattern, ok := parseSMBPath(req) + if !ok || pattern == "" { + pattern = "*" + } + + // For now, do a simple search - don't handle resume keys yet + // Get the directory part of the pattern + lastSlash := strings.LastIndex(pattern, "\\") + var dirPath, filePattern string + if lastSlash >= 0 { + dirPath = pattern[:lastSlash] + filePattern = pattern[lastSlash+1:] + } else { + dirPath = "" + filePattern = pattern + } + + // Read directory + queryDir, err := resolveExistingPath(fs, rootPath, dirPath) + if err != nil { + return buildSearchEmptyResponse(req) + } + + entries, err := fs.ReadDir(queryDir) + if err != nil { + return buildSearchEmptyResponse(req) + } + + // Filter and match entries + var results []searchResultEntry + for _, entry := range entries { + info, err := entry.Info() + if err != nil { + continue + } + + // Filter by attributes + if !matchesSearchAttrs(info, attrs) { + continue + } + + // Match filename pattern (simple: check if matches *.* or specific name) + if !matchesPattern(entry.Name(), filePattern) { + continue + } + + shortName := entry.Name() + if n, err := fs.ShortName(filepath.Join(queryDir, entry.Name())); err == nil && n != "" { + shortName = n + } + + results = append(results, searchResultEntry{ + name: formatDOSName(shortName), + size: info.Size(), + modTime: info.ModTime(), + isDir: info.IsDir(), + attributes: getSearchAttrs(info), + }) + + if len(results) >= 10 { + break + } + } + + return buildSearchResponse(req, results) +} + +func formatDOSName(name string) string { + parts := strings.SplitN(name, ".", 2) + base := strings.ToUpper(parts[0]) + if len(base) > 8 { + base = base[:8] + } + ext := "" + if len(parts) > 1 { + ext = strings.ToUpper(parts[1]) + if len(ext) > 3 { + ext = ext[:3] + } + } + // "MYFILE.TXT" -> "MYFILE TXT" (base padded to 8, ext to 3) + // If it already is an 8.3 name without dot, like "MYFILE TXT"? We assume ShortName gives "MYFILE.TXT". + return fmt.Sprintf("%-8s%-3s", base, ext) +} + +// handleOpenAndX (0x2D) opens or creates a file, returning a file handle. + +type searchResultEntry struct { + name string + size int64 + modTime time.Time + isDir bool + attributes uint16 +} + +func matchesSearchAttrs(info fs.FileInfo, searchAttrs uint16) bool { + // searchAttrs indicates which types of files to include + // If bit not set, the file type should not be included + if info.IsDir() { + return (searchAttrs & SearchAttributeDirectory) != 0 + } + + // Regular files always match unless only searching for specific types + // that don't apply to normal files + return true +} + +func matchesPattern(name string, pattern string) bool { + if pattern == "*" || pattern == "*.*" { + return true + } + // Simple pattern matching: just check for exact match or wildcard suffix + if strings.HasSuffix(pattern, "*") { + prefix := strings.TrimSuffix(pattern, "*") + return strings.HasPrefix(strings.ToLower(name), strings.ToLower(prefix)) + } + return strings.ToLower(name) == strings.ToLower(pattern) +} + +func getSearchAttrs(info fs.FileInfo) uint16 { + var attrs uint16 + if info.IsDir() { + attrs |= SearchAttributeDirectory + } + // TODO: check file mode/permissions for read-only, hidden, system, archive + attrs |= SearchAttributeArchive + return attrs +} + +func buildSearchEmptyResponse(req []byte) []byte { + if len(req) < smbHeaderLen || string(req[0:4]) != "\xffSMB" { + return nil + } + + out := make([]byte, smbHeaderLen+1+2+2) + copy(out[:smbHeaderLen], req[:smbHeaderLen]) + binary.LittleEndian.PutUint32(out[smbOffStatus:smbOffStatus+4], smbStatusSuccess) + out[smbOffFlags] |= 0x80 + out[smbHeaderLen] = 1 // WCT + w := out[smbHeaderLen+1:] + binary.LittleEndian.PutUint16(w[0:2], 0) // EntryCount = 0 + binary.LittleEndian.PutUint16(w[2:4], 0) // ByteCount = 0 + return out +} + +func buildSearchResponse(req []byte, entries []searchResultEntry) []byte { + if len(req) < smbHeaderLen || string(req[0:4]) != "\xffSMB" { + return nil + } + + if len(entries) == 0 { + return buildSearchEmptyResponse(req) + } + + // Calculate data size + var dataBuf bytes.Buffer + for _, entry := range entries { + // ResumeKey (21 bytes) + dataBuf.Write(make([]byte, 21)) + + // Attributes (1 byte) + dataBuf.WriteByte(byte(entry.attributes)) + + // LastWriteTime (2 bytes) + LastWriteDate (2 bytes) -> 4 bytes DOS time + timeVal := uint32(0) // TODO: convert time.Time to DOS format + var timeBytes [4]byte + binary.LittleEndian.PutUint32(timeBytes[:], timeVal) + dataBuf.Write(timeBytes[:]) + + // FileSize (4 bytes) + var sizeBytes [4]byte + binary.LittleEndian.PutUint32(sizeBytes[:], uint32(entry.size)) + dataBuf.Write(sizeBytes[:]) + + // FileName (13 bytes null-terminated DOS name) + var nameBuf [13]byte + copy(nameBuf[:], entry.name) + dataBuf.Write(nameBuf[:]) + } + + dataBytes := dataBuf.Bytes() + out := make([]byte, smbHeaderLen+1+2+2+len(dataBytes)) + copy(out[:smbHeaderLen], req[:smbHeaderLen]) + binary.LittleEndian.PutUint32(out[smbOffStatus:smbOffStatus+4], smbStatusSuccess) + out[smbOffFlags] |= 0x80 + out[smbHeaderLen] = 1 // WCT + w := out[smbHeaderLen+1:] + binary.LittleEndian.PutUint16(w[0:2], uint16(len(entries))) + binary.LittleEndian.PutUint16(w[2:4], uint16(len(dataBytes))) + copy(w[4:], dataBytes) + return out +} + +func parseTreeConnectShareName(req []byte) (string, bool) { + bytesArea, ok := smbBytesArea(req) + if !ok || len(bytesArea) == 0 { + return "", false + } + + for _, part := range splitNULStrings(bytesArea) { + p := strings.TrimSpace(part) + if p == "" { + continue + } + if strings.Contains(p, "\\") { + trimmed := strings.TrimLeft(p, "\\") + segments := strings.Split(trimmed, "\\") + if len(segments) >= 2 && segments[1] != "" { + return segments[1], true + } + } + } + return "", false +} + +// parseSMBPath extracts a path from the bytes area of an SMB request. +func parseSMBPath(req []byte) (string, bool) { + bytesArea, ok := smbBytesArea(req) + if !ok || len(bytesArea) == 0 { + return "", false + } + + // Skip the path format indicator (typically buffer format code 0x04) + rest := bytesArea + if len(rest) > 0 && rest[0] == 0x04 { + rest = rest[1:] + } + + // Find the first NUL-terminated string + if nulIdx := bytes.IndexByte(rest, 0); nulIdx >= 0 { + pathStr := string(rest[:nulIdx]) + path := strings.TrimSpace(pathStr) + // Strip leading separators and normalize + path = strings.TrimLeft(path, "\\") + return path, path != "" + } + + return "", false +} + +func smbBytesArea(req []byte) ([]byte, bool) { + if len(req) < smbHeaderLen+3 { + return nil, false + } + wct := int(req[smbHeaderLen]) + bytesOffset := smbHeaderLen + 1 + (wct * 2) + if bytesOffset+2 > len(req) { + return nil, false + } + byteCount := int(binary.LittleEndian.Uint16(req[bytesOffset : bytesOffset+2])) + if byteCount < 0 || bytesOffset+2+byteCount > len(req) { + return nil, false + } + return req[bytesOffset+2 : bytesOffset+2+byteCount], true +} + +func splitNULStrings(b []byte) []string { + parts := make([]string, 0, 4) + start := 0 + for i := 0; i < len(b); i++ { + if b[i] != 0 { + continue + } + if i > start { + parts = append(parts, string(b[start:i])) + } + start = i + 1 + } + if start < len(b) { + parts = append(parts, string(b[start:])) + } + return parts +} + +// buildSimpleSuccessResponse returns an SMB response with success status, +// WCT=0 and ByteCount=0. Suitable for simple acknowledgement commands +// like Tree Disconnect where no payload is required. +func buildSimpleSuccessResponse(req []byte) []byte { + if len(req) < smbHeaderLen || string(req[0:4]) != "\xffSMB" { + return nil + } + out := make([]byte, smbHeaderLen+3) + copy(out[:smbHeaderLen], req[:smbHeaderLen]) + binary.LittleEndian.PutUint32(out[smbOffStatus:smbOffStatus+4], smbStatusSuccess) + out[smbOffFlags] |= 0x80 + out[smbHeaderLen] = 0 + binary.LittleEndian.PutUint16(out[smbHeaderLen+1:smbHeaderLen+3], 0) + return out +} + +// buildQueryInformationDiskResponse constructs an SMB_COM_QUERY_INFORMATION_DISK +// response. Uses 512-byte blocks with 8-block allocation units (4KB clusters). +func buildQueryInformationDiskResponse(req []byte, totalBytes, freeBytes uint64) []byte { + if len(req) < smbHeaderLen || string(req[0:4]) != "\xffSMB" { + return nil + } + + const blockSize = 512 + const blocksPerUnit = 8 + const allocationUnitSize = blockSize * blocksPerUnit + + totalUnits := uint16(totalBytes / allocationUnitSize) + freeUnits := uint16(freeBytes / allocationUnitSize) + + out := make([]byte, smbHeaderLen+1+(5*2)+2) + copy(out[:smbHeaderLen], req[:smbHeaderLen]) + binary.LittleEndian.PutUint32(out[smbOffStatus:smbOffStatus+4], smbStatusSuccess) + out[smbOffFlags] |= 0x80 + out[smbHeaderLen] = 5 // WCT + w := out[smbHeaderLen+1:] + binary.LittleEndian.PutUint16(w[0:2], totalUnits) + binary.LittleEndian.PutUint16(w[2:4], blocksPerUnit) + binary.LittleEndian.PutUint16(w[4:6], blockSize) + binary.LittleEndian.PutUint16(w[6:8], freeUnits) + binary.LittleEndian.PutUint16(w[8:10], 0) // Reserved + binary.LittleEndian.PutUint16(w[10:12], 0) // ByteCount + return out +} diff --git a/service/smb/command_locking.go b/service/smb/command_locking.go new file mode 100644 index 0000000..4389c50 --- /dev/null +++ b/service/smb/command_locking.go @@ -0,0 +1,278 @@ +package smb + +import ( + "encoding/binary" + "strings" +) + +const ( + smbStatusLockNotGranted = 0xC0000055 +) + +type lockRange struct { + pid uint16 + start int64 + length int64 +} + +type lockingAndXCommand struct { + andxCommand byte + andxOffset uint16 + fid uint16 + unlocks []lockRange + locks []lockRange +} + +func (s *Service) handleLockingAndX(req []byte, conn *connState) []byte { + if len(req) < smbHeaderLen+17 { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + + cmd := req[4] + cmdOffset := smbHeaderLen + for { + switch cmd { + case CommandLockingAndX: + lockingCmd, ok := parseLockingAndXAt(req, cmdOffset) + if !ok { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + status := s.applyLockingAndX(conn, lockingCmd.fid, lockingCmd.unlocks, lockingCmd.locks) + if status != smbStatusSuccess { + return buildSMBErrorResponse(req, status) + } + if lockingCmd.andxCommand == CommandNoAndXCommand { + return buildLockingAndXResponse(req) + } + cmd = lockingCmd.andxCommand + cmdOffset = int(lockingCmd.andxOffset) + if cmdOffset <= smbHeaderLen || cmdOffset >= len(req) { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + + case CommandClose: + fid, ok := parseCloseAt(req, cmdOffset) + if !ok { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + s.closeFID(conn, fid) + return buildLockingAndXResponse(req) + + default: + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + } +} + +func parseLockingAndXAt(req []byte, cmdOffset int) (lockingAndXCommand, bool) { + if cmdOffset < smbHeaderLen || cmdOffset+1 > len(req) { + return lockingAndXCommand{}, false + } + + wct := int(req[cmdOffset]) + if wct < 8 { + return lockingAndXCommand{}, false + } + + wordsOffset := cmdOffset + 1 + wordsLen := wct * 2 + if wordsOffset+wordsLen > len(req) { + return lockingAndXCommand{}, false + } + w := req[wordsOffset : wordsOffset+wordsLen] + byteCountOffset := wordsOffset + wordsLen + if byteCountOffset+2 > len(req) { + return lockingAndXCommand{}, false + } + byteCount := int(binary.LittleEndian.Uint16(req[byteCountOffset : byteCountOffset+2])) + if byteCountOffset+2+byteCount > len(req) { + return lockingAndXCommand{}, false + } + bytesArea := req[byteCountOffset+2 : byteCountOffset+2+byteCount] + numberOfUnlocks := int(binary.LittleEndian.Uint16(w[12:14])) + numberOfLocks := int(binary.LittleEndian.Uint16(w[14:16])) + unlocks, locks, ok := parseLockRanges(bytesArea, numberOfUnlocks, numberOfLocks) + if !ok { + return lockingAndXCommand{}, false + } + + return lockingAndXCommand{ + andxCommand: w[0], + andxOffset: binary.LittleEndian.Uint16(w[2:4]), + fid: binary.LittleEndian.Uint16(w[4:6]), + unlocks: unlocks, + locks: locks, + }, true +} + +func parseCloseAt(req []byte, cmdOffset int) (uint16, bool) { + if cmdOffset < smbHeaderLen || cmdOffset+1 > len(req) { + return 0, false + } + wct := int(req[cmdOffset]) + if wct < 3 { + return 0, false + } + wordsOffset := cmdOffset + 1 + wordsLen := wct * 2 + if wordsOffset+wordsLen > len(req) { + return 0, false + } + return binary.LittleEndian.Uint16(req[wordsOffset : wordsOffset+2]), true +} + +func (s *Service) applyLockingAndX(conn *connState, fid uint16, unlockRanges, lockRanges []lockRange) uint32 { + conn.mu.Lock() + handle, ok := conn.fids[fid] + if !ok || handle == nil { + conn.mu.Unlock() + return smbStatusNotSupported + } + + lockKey := lockKeyForHandle(handle) + table := conn.lockTables[lockKey] + if table == nil { + table = &lockTable{} + conn.lockTables[lockKey] = table + } + conn.mu.Unlock() + + if !unlockRangesFromTable(table, fid, unlockRanges) { + return smbStatusLockNotGranted + } + if !lockRangesInTable(table, fid, lockRanges) { + return smbStatusLockNotGranted + } + return smbStatusSuccess +} + +func parseLockRanges(bytesArea []byte, numberOfUnlocks, numberOfLocks int) (unlocks []lockRange, locks []lockRange, ok bool) { + const recordLen = 10 // Pid(2) + ByteOffset(4) + LengthInBytes(4) + required := (numberOfUnlocks + numberOfLocks) * recordLen + if numberOfUnlocks < 0 || numberOfLocks < 0 || len(bytesArea) < required { + return nil, nil, false + } + + readRange := func(b []byte) lockRange { + return lockRange{ + pid: binary.LittleEndian.Uint16(b[0:2]), + start: int64(binary.LittleEndian.Uint32(b[2:6])), + length: int64(binary.LittleEndian.Uint32(b[6:10])), + } + } + + off := 0 + unlocks = make([]lockRange, 0, numberOfUnlocks) + for i := 0; i < numberOfUnlocks; i++ { + r := readRange(bytesArea[off : off+recordLen]) + off += recordLen + if r.length <= 0 { + continue + } + unlocks = append(unlocks, r) + } + + locks = make([]lockRange, 0, numberOfLocks) + for i := 0; i < numberOfLocks; i++ { + r := readRange(bytesArea[off : off+recordLen]) + off += recordLen + if r.length <= 0 { + continue + } + locks = append(locks, r) + } + + return unlocks, locks, true +} + +func lockRangesInTable(table *lockTable, fid uint16, ranges []lockRange) bool { + table.mu.Lock() + defer table.mu.Unlock() + + for _, r := range ranges { + for _, existing := range table.locks { + if existing.pid == r.pid && existing.fid == fid { + continue + } + if rangesOverlap(existing.start, existing.length, r.start, r.length) { + return false + } + } + } + + for _, r := range ranges { + table.locks = append(table.locks, lockEntry{ + fid: fid, + pid: r.pid, + start: r.start, + length: r.length, + }) + } + return true +} + +func unlockRangesFromTable(table *lockTable, fid uint16, ranges []lockRange) bool { + table.mu.Lock() + defer table.mu.Unlock() + + for _, r := range ranges { + idx := -1 + for i, existing := range table.locks { + if existing.fid == fid && existing.pid == r.pid && existing.start == r.start && existing.length == r.length { + idx = i + break + } + } + if idx < 0 { + return false + } + table.locks = append(table.locks[:idx], table.locks[idx+1:]...) + } + return true +} + +func rangesOverlap(startA, lenA, startB, lenB int64) bool { + endA := startA + lenA + endB := startB + lenB + return startA < endB && startB < endA +} + +func lockKeyForHandle(h *fileHandle) string { + return strings.ToLower(h.path) +} + +func (s *Service) releaseLocksForFIDLocked(conn *connState, fid uint16) { + for key, table := range conn.lockTables { + table.mu.Lock() + filtered := table.locks[:0] + for _, lk := range table.locks { + if lk.fid != fid { + filtered = append(filtered, lk) + } + } + table.locks = filtered + empty := len(table.locks) == 0 + table.mu.Unlock() + if empty { + delete(conn.lockTables, key) + } + } +} + +func buildLockingAndXResponse(req []byte) []byte { + if len(req) < smbHeaderLen || string(req[0:4]) != "\xffSMB" { + return nil + } + + out := make([]byte, smbHeaderLen+1+(2*2)+2) + copy(out[:smbHeaderLen], req[:smbHeaderLen]) + binary.LittleEndian.PutUint32(out[smbOffStatus:smbOffStatus+4], smbStatusSuccess) + out[smbOffFlags] |= 0x80 + out[smbHeaderLen] = 2 // WCT + w := out[smbHeaderLen+1:] + w[0] = CommandNoAndXCommand + w[1] = 0 + binary.LittleEndian.PutUint16(w[2:4], 0) + binary.LittleEndian.PutUint16(w[4:6], 0) // ByteCount + return out +} diff --git a/service/smb/command_path_ops.go b/service/smb/command_path_ops.go new file mode 100644 index 0000000..6d37b32 --- /dev/null +++ b/service/smb/command_path_ops.go @@ -0,0 +1,246 @@ +package smb + +import ( + "bytes" + "encoding/binary" + "errors" + "io/fs" + "path/filepath" + "strings" + + "github.com/ObsoleteMadness/ClassicStack/pkg/vfs" +) + +// splitSMBParent splits an SMB-style backslash path into its parent +// component and final leaf. The returned parentSMB has no leading or +// trailing backslash and may be empty if the leaf sits at the share root. +func splitSMBParent(smbPath string) (parentSMB, leaf string) { + clean := strings.Trim(smbPath, "\\") + idx := strings.LastIndex(clean, "\\") + if idx < 0 { + return "", clean + } + return clean[:idx], clean[idx+1:] +} + +const ( + smbStatusAccessDenied = 0xC0000022 + smbStatusNameNotFound = 0xC000007F + smbStatusFileIsDirectory = 0xC00000BA + smbStatusNotADirectory = 0xC0000103 + smbStatusObjectNameCollision = 0xC0000035 +) + +func (s *Service) handleDelete(req []byte, conn *connState) []byte { + if len(req) < smbHeaderLen+3 { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + + _, slot, fsys, ok := s.resolveRequestTree(req, conn) + if !ok { + return buildSMBErrorResponse(req, smbStatusBadTID) + } + rootPath := s.shareRootPath(slot.shareIdx) + if s.shares[slot.shareIdx].ReadOnly { + return buildSMBErrorResponse(req, smbStatusAccessDenied) + } + + path, ok := parseSMBPath(req) + if !ok || path == "" { + return buildSMBErrorResponse(req, smbStatusNameNotFound) + } + if strings.Contains(path, "*") || strings.Contains(path, "?") { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + resolvedPath, err := resolveExistingPath(fsys, rootPath, path) + if err != nil { + return buildSMBErrorResponse(req, smbStatusNameNotFound) + } + + info, err := fsys.Stat(resolvedPath) + if err != nil { + return buildSMBErrorResponse(req, smbStatusNameNotFound) + } + if info.IsDir() { + return buildSMBErrorResponse(req, smbStatusFileIsDirectory) + } + + if err := fsys.Remove(resolvedPath); err != nil { + return buildSMBErrorResponse(req, smbStatusAccessDenied) + } + return buildSimpleSuccessResponse(req) +} + +func (s *Service) handleRename(req []byte, conn *connState) []byte { + if len(req) < smbHeaderLen+3 { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + + _, slot, fsys, ok := s.resolveRequestTree(req, conn) + if !ok { + return buildSMBErrorResponse(req, smbStatusBadTID) + } + rootPath := s.shareRootPath(slot.shareIdx) + if s.shares[slot.shareIdx].ReadOnly { + return buildSMBErrorResponse(req, smbStatusAccessDenied) + } + + oldPath, newPath, ok := parseRenamePaths(req) + if !ok { + return buildSMBErrorResponse(req, smbStatusNameNotFound) + } + if strings.Contains(oldPath, "*") || strings.Contains(oldPath, "?") || strings.Contains(newPath, "*") || strings.Contains(newPath, "?") { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + resolvedOldPath, err := resolveExistingPath(fsys, rootPath, oldPath) + if err != nil { + return buildSMBErrorResponse(req, smbStatusNameNotFound) + } + resolvedNewPath := smbJoinPath(rootPath, newPath) + + if _, err := fsys.Stat(resolvedOldPath); err != nil { + return buildSMBErrorResponse(req, smbStatusNameNotFound) + } + if err := fsys.Rename(resolvedOldPath, resolvedNewPath); err != nil { + return buildSMBErrorResponse(req, smbStatusAccessDenied) + } + return buildSimpleSuccessResponse(req) +} + +func (s *Service) handleCreateDirectory(req []byte, conn *connState) []byte { + if len(req) < smbHeaderLen+3 { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + + _, slot, fsys, ok := s.resolveRequestTree(req, conn) + if !ok { + return buildSMBErrorResponse(req, smbStatusBadTID) + } + rootPath := s.shareRootPath(slot.shareIdx) + if s.shares[slot.shareIdx].ReadOnly { + return buildSMBErrorResponse(req, smbStatusAccessDenied) + } + + path, ok := parseSMBPath(req) + if !ok || path == "" { + return buildSMBErrorResponse(req, smbStatusNameNotFound) + } + if strings.Contains(path, "*") || strings.Contains(path, "?") { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + + parentHost, matched, info, err := resolveSMBLeaf(fsys, rootPath, path) + if err != nil && !errors.Is(err, fs.ErrNotExist) { + // Parent missing or unreadable — let CreateDir surface the right error below. + } + if matched != "" && info != nil { + if info.IsDir() { + // Idempotent mkdir on an existing directory. + return buildSimpleSuccessResponse(req) + } + // Existing file blocks the directory creation. + return buildSMBErrorResponse(req, smbStatusObjectNameCollision) + } + + _, leaf := splitSMBParent(path) + target := filepath.Join(parentHost, leaf) + if err := fsys.CreateDir(target); err != nil { + if errors.Is(err, fs.ErrExist) { + return buildSimpleSuccessResponse(req) + } + return buildSMBErrorResponse(req, smbStatusAccessDenied) + } + return buildSimpleSuccessResponse(req) +} + +func (s *Service) handleDeleteDirectory(req []byte, conn *connState) []byte { + if len(req) < smbHeaderLen+3 { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + + _, slot, fsys, ok := s.resolveRequestTree(req, conn) + if !ok { + return buildSMBErrorResponse(req, smbStatusBadTID) + } + rootPath := s.shareRootPath(slot.shareIdx) + if s.shares[slot.shareIdx].ReadOnly { + return buildSMBErrorResponse(req, smbStatusAccessDenied) + } + + path, ok := parseSMBPath(req) + if !ok || path == "" { + return buildSMBErrorResponse(req, smbStatusNameNotFound) + } + if strings.Contains(path, "*") || strings.Contains(path, "?") { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + resolvedPath, err := resolveExistingPath(fsys, rootPath, path) + if err != nil { + return buildSMBErrorResponse(req, smbStatusNameNotFound) + } + + info, err := fsys.Stat(resolvedPath) + if err != nil { + return buildSMBErrorResponse(req, smbStatusNameNotFound) + } + if !info.IsDir() { + return buildSMBErrorResponse(req, smbStatusNotADirectory) + } + + if err := fsys.Remove(resolvedPath); err != nil { + return buildSMBErrorResponse(req, smbStatusAccessDenied) + } + return buildSimpleSuccessResponse(req) +} + +func parseRenamePaths(req []byte) (oldPath, newPath string, ok bool) { + bytesArea, ok := smbBytesArea(req) + if !ok || len(bytesArea) == 0 { + return "", "", false + } + + parts := make([]string, 0, 2) + buf := bytesArea + for len(buf) > 0 && len(parts) < 2 { + if buf[0] == 0x04 { + buf = buf[1:] + } + nul := bytes.IndexByte(buf, 0) + if nul < 0 { + break + } + part := strings.TrimLeft(strings.TrimSpace(string(buf[:nul])), "\\") + if part != "" { + parts = append(parts, part) + } + buf = buf[nul+1:] + } + + if len(parts) < 2 { + return "", "", false + } + return parts[0], parts[1], true +} + +func (s *Service) resolveRequestTree(req []byte, conn *connState) (tid uint16, slot treeSlot, fsys vfs.FileSystem, ok bool) { + if len(req) < smbHeaderLen { + return 0, treeSlot{}, nil, false + } + tid = binary.LittleEndian.Uint16(req[smbOffTID : smbOffTID+2]) + + conn.mu.Lock() + slot, ok = conn.tids[tid] + conn.mu.Unlock() + if !ok { + return 0, treeSlot{}, nil, false + } + + s.mu.Lock() + fsys, ok = s.shareFSes[slot.shareIdx] + s.mu.Unlock() + if !ok || fsys == nil { + return 0, treeSlot{}, nil, false + } + + return tid, slot, fsys, true +} diff --git a/service/smb/command_rap_lanman.go b/service/smb/command_rap_lanman.go new file mode 100644 index 0000000..69f7c9a --- /dev/null +++ b/service/smb/command_rap_lanman.go @@ -0,0 +1,408 @@ +package smb + +import ( + "bytes" + "encoding/binary" + "strings" +) + +func isLANMANTransactionRequest(req []byte) bool { + bytesArea, ok := transactionBytesArea(req) + if !ok || len(bytesArea) == 0 { + return false + } + return bytes.Contains(bytes.ToUpper(bytesArea), []byte("\\PIPE\\LANMAN")) +} + +// transactionBytesArea returns the SMB_COM_TRANSACTION bytes area, +// regardless of request word-count shape. +func transactionBytesArea(req []byte) ([]byte, bool) { + if len(req) < smbHeaderLen+3 || string(req[0:4]) != "\xffSMB" || req[4] != CommandTransaction { + return nil, false + } + wct := int(req[smbHeaderLen]) + bytesOffset := smbHeaderLen + 1 + (wct * 2) + if bytesOffset+2 > len(req) { + return nil, false + } + byteCount := int(binary.LittleEndian.Uint16(req[bytesOffset : bytesOffset+2])) + if byteCount < 0 || bytesOffset+2+byteCount > len(req) { + return nil, false + } + return req[bytesOffset+2 : bytesOffset+2+byteCount], true +} + +func parseLANMANFunctionCode(req []byte) (uint16, bool) { + bytesArea, ok := transactionBytesArea(req) + if !ok { + return 0, false + } + pipe := []byte("\\PIPE\\LANMAN\x00") + idx := bytes.Index(bytes.ToUpper(bytesArea), bytes.ToUpper(pipe)) + if idx < 0 { + return 0, false + } + p := idx + len(pipe) + if p+2 > len(bytesArea) { + return 0, false + } + return binary.LittleEndian.Uint16(bytesArea[p : p+2]), true +} + +// parseNetServerEnum2ServerType best-effort parses the server-type +// filter (SV_TYPE_*) from a RAP NetServerEnum2 request. +func parseNetServerEnum2ServerType(req []byte) (uint32, bool) { + bytesArea, ok := transactionBytesArea(req) + if !ok { + return 0, false + } + pipe := []byte("\\PIPE\\LANMAN\x00") + idx := bytes.Index(bytes.ToUpper(bytesArea), bytes.ToUpper(pipe)) + if idx < 0 { + return 0, false + } + p := idx + len(pipe) + if p+2 > len(bytesArea) || binary.LittleEndian.Uint16(bytesArea[p:p+2]) != rapNetServerEnum2 { + return 0, false + } + p += 2 + // Skip ParamDesc and DataDesc (both NUL-terminated strings). + for i := 0; i < 2; i++ { + n := bytes.IndexByte(bytesArea[p:], 0) + if n < 0 { + return 0, false + } + p += n + 1 + if p > len(bytesArea) { + return 0, false + } + } + if p+2+4 > len(bytesArea) { + return 0, false + } + p += 2 // ReceiveBufferLength + return binary.LittleEndian.Uint32(bytesArea[p : p+4]), true +} + +// parseNetServerEnum2Domain extracts the optional Domain filter string from a RAP +// NetServerEnum2 request. Returns ("", false) when the field is absent. +func parseNetServerEnum2Domain(req []byte) (string, bool) { + bytesArea, ok := transactionBytesArea(req) + if !ok { + return "", false + } + pipe := []byte("\\PIPE\\LANMAN\x00") + idx := bytes.Index(bytes.ToUpper(bytesArea), bytes.ToUpper(pipe)) + if idx < 0 { + return "", false + } + p := idx + len(pipe) + if p+2 > len(bytesArea) || binary.LittleEndian.Uint16(bytesArea[p:p+2]) != rapNetServerEnum2 { + return "", false + } + p += 2 + // Skip ParamDesc and DataDesc (both NUL-terminated). + for i := 0; i < 2; i++ { + n := bytes.IndexByte(bytesArea[p:], 0) + if n < 0 { + return "", false + } + p += n + 1 + } + if p+2+4 > len(bytesArea) { + return "", false + } + p += 2 + 4 // ReceiveBufferLength + ServerType + if p >= len(bytesArea) { + return "", false + } + n := bytes.IndexByte(bytesArea[p:], 0) + if n < 0 { + return "", false + } + domain := string(bytesArea[p : p+n]) + if domain == "" { + return "", false + } + return domain, true +} + +// smbServerList returns the server entries for a NetServerEnum2 response: +// ClassicStack itself plus any servers observed via browser announcements. +func (s *Service) smbServerList() []netServerInfo1 { + self := normalizeBrowserName(s.opts.ServerName) + if self == "" { + self = "CLASSICSTACK" + } + entries := []netServerInfo1{{ + Name: self, + Type: browserServerTypeWorkstationMask, + }} + s.mu.Lock() + for name, rec := range s.browserServers { + if name == self { + continue + } + entries = append(entries, netServerInfo1{Name: name, Type: rec.ServerType}) + } + s.mu.Unlock() + return entries +} + +// netServerEnum2Entries returns the entries and a RAP status code (0 = success). +// +// Per MS-BRWS §3.3.5.6: +// - Potential browsers MUST return ERROR_REQ_NOT_ACCEP (71). +// - SV_TYPE_DOMAIN_ENUM with any other type bit MUST return ERROR_INVALID_FUNCTION (1). +// - SV_TYPE_DOMAIN_ENUM alone → return all observed machine groups. +func (s *Service) netServerEnum2Entries(serverType uint32, workgroup, requestedDomain string) ([]netServerInfo1, uint16) { + s.mu.Lock() + role := s.browserRole + s.mu.Unlock() + + if role == browserRolePotential { + return nil, rapStatusErrReqNotAccepted + } + + if serverType&browserServerTypeDomainEnumMask != 0 { + if serverType != browserServerTypeDomainEnumMask { + // DOMAIN_ENUM mixed with other type bits is invalid. + return nil, rapStatusErrInvalidFunction + } + // Return our own workgroup plus any domains observed via DomainAnnouncement. + ownDomain := normalizeBrowserName(workgroup) + if ownDomain == "" { + ownDomain = "WORKGROUP" + } + groups := []netServerInfo1{{Name: ownDomain, Type: browserServerTypeDomainEnumMask}} + s.mu.Lock() + for group, rec := range s.machineGroups { + if group == ownDomain { + continue + } + groups = append(groups, netServerInfo1{ + Name: group, + Type: browserServerTypeDomainEnumMask, + Comment: rec.MasterBrowser, + }) + } + s.mu.Unlock() + return groups, 0 + } + + // Server-list request: if the client specifies a domain, only return + // results when it matches our own workgroup. + if requestedDomain != "" { + ownDomain := normalizeBrowserName(workgroup) + if ownDomain == "" { + ownDomain = "WORKGROUP" + } + if !strings.EqualFold(requestedDomain, ownDomain) { + return nil, 0 // empty success — we don't serve that domain + } + } + + return s.smbServerList(), 0 +} + +// buildNetServerEnum2RAPErrorResponse wraps a non-zero RAP status code in a +// minimal SMB_COM_TRANSACTION success frame (SMB status is SUCCESS; the error +// is conveyed in the 2-byte RAP Status field of the parameter block). +func buildNetServerEnum2RAPErrorResponse(req []byte, rapStatus uint16) []byte { + if len(req) < smbHeaderLen { + return nil + } + const paramLen = 8 // Status(2)+Converter(2)+EntriesReturned(2)+EntriesAvailable(2) + paramOffset := smbHeaderLen + 1 + 20 + 2 // = 55 + totalLen := paramOffset + paramLen + + out := make([]byte, totalLen) + copy(out[:smbHeaderLen], req[:smbHeaderLen]) + binary.LittleEndian.PutUint32(out[smbOffStatus:smbOffStatus+4], smbStatusSuccess) + out[smbOffFlags] |= 0x80 + + out[smbHeaderLen] = 10 // WCT + w := out[smbHeaderLen+1:] + binary.LittleEndian.PutUint16(w[0:2], uint16(paramLen)) // TotalParameterCount + binary.LittleEndian.PutUint16(w[6:8], uint16(paramLen)) // ParameterCount + binary.LittleEndian.PutUint16(w[8:10], uint16(paramOffset)) + binary.LittleEndian.PutUint16(w[20:22], uint16(paramLen)) // ByteCount + + p := out[paramOffset:] + binary.LittleEndian.PutUint16(p[0:2], rapStatus) + return out +} + +// buildNetServerEnum2Response constructs an SMB_COM_TRANSACTION response +// carrying a RAP NetServerEnum2 reply with the supplied server entries. +// Converter is set to zero; CommentOffset fields are offsets from the +// start of the Transaction data block. +func buildNetServerEnum2Response(req []byte, entries []netServerInfo1) []byte { + if len(req) < smbHeaderLen { + return nil + } + const entrySize = 26 // SERVER_INFO_1: Name(16)+VMaj(1)+VMin(1)+Type(4)+CommentOff(4) + + commentBase := len(entries) * entrySize + + commentOff := commentBase + commentData := make([]byte, 0, len(entries)) + commentOffsets := make([]int, len(entries)) + for i, e := range entries { + commentOffsets[i] = commentOff + commentData = append(commentData, []byte(e.Comment)...) + commentData = append(commentData, 0) + commentOff += len(e.Comment) + 1 + } + + paramLen := 8 // Status(2)+Converter(2)+EntriesReturned(2)+EntriesAvailable(2) + dataLen := len(entries)*entrySize + len(commentData) + + // Layout: header(32) + WCT(1) + 10 words(20) + ByteCount(2) + params + data. + paramOffset := smbHeaderLen + 1 + 20 + 2 // = 55 + dataOffset := paramOffset + paramLen // = 63 + totalLen := dataOffset + dataLen + + out := make([]byte, totalLen) + copy(out[:smbHeaderLen], req[:smbHeaderLen]) + binary.LittleEndian.PutUint32(out[smbOffStatus:smbOffStatus+4], smbStatusSuccess) + out[smbOffFlags] |= 0x80 + + out[smbHeaderLen] = 10 // WCT + w := out[smbHeaderLen+1:] + binary.LittleEndian.PutUint16(w[0:2], uint16(paramLen)) // TotalParameterCount + binary.LittleEndian.PutUint16(w[2:4], uint16(dataLen)) // TotalDataCount + binary.LittleEndian.PutUint16(w[6:8], uint16(paramLen)) // ParameterCount + binary.LittleEndian.PutUint16(w[8:10], uint16(paramOffset)) // ParameterOffset + binary.LittleEndian.PutUint16(w[12:14], uint16(dataLen)) // DataCount + binary.LittleEndian.PutUint16(w[14:16], uint16(dataOffset)) // DataOffset + binary.LittleEndian.PutUint16(w[20:22], uint16(paramLen+dataLen)) // ByteCount + + p := out[paramOffset:] + // p[0:2] Status = 0, p[2:4] Converter = 0 (already zero from make). + binary.LittleEndian.PutUint16(p[4:6], uint16(len(entries))) // EntriesReturned + binary.LittleEndian.PutUint16(p[6:8], uint16(len(entries))) // EntriesAvailable + + d := out[dataOffset:] + for i, e := range entries { + base := i * entrySize + name := normalizeBrowserName(e.Name) + if len(name) > 15 { + name = name[:15] + } + copy(d[base:base+16], []byte(name)) // remaining bytes stay NUL + d[base+16] = 4 // sv1_version_major + // d[base+17] = 0 sv1_version_minor (already zero) + binary.LittleEndian.PutUint32(d[base+18:base+22], e.Type) + binary.LittleEndian.PutUint32(d[base+22:base+26], uint32(commentOffsets[i])) + } + copy(d[commentBase:], commentData) + + return out +} + +// shareInfo1Entry holds the data for one SHARE_INFO_1 record. +type shareInfo1Entry struct { + Name string + Type uint16 + Comment string +} + +// netShareEnumEntries returns all configured disk shares plus the IPC$ share. +func (s *Service) netShareEnumEntries() []shareInfo1Entry { + const stypeDisktree = uint16(0x0000) + const stypeIPC = uint16(0x0003) + entries := make([]shareInfo1Entry, 0, len(s.shares)+1) + for _, sc := range s.shares { + name := sc.Name + if len(name) > 12 { + name = name[:12] + } + entries = append(entries, shareInfo1Entry{Name: name, Type: stypeDisktree}) + } + entries = append(entries, shareInfo1Entry{Name: ipcShareName, Type: stypeIPC}) + return entries +} + +// buildNetShareEnumResponse builds an SMB_COM_TRANSACTION response containing +// a RAP NetShareEnum reply (info level 1). Each entry is a SHARE_INFO_1 +// record: Name(13)+Pad(1)+Type(2)+RemarkOff(4) = 20 bytes. +func buildNetShareEnumResponse(req []byte, entries []shareInfo1Entry) []byte { + if len(req) < smbHeaderLen { + return nil + } + const entrySize = 20 // Name(13)+Pad(1)+Type(2)+RemarkOff(4) + + // Build remark-offset table; each name is stored as a NUL-terminated + // string in the "heap" area that follows the fixed-size records. + remarkBase := len(entries) * entrySize + remarkOff := remarkBase + remarkData := make([]byte, 0) + remarkOffsets := make([]int, len(entries)) + for i, e := range entries { + remarkOffsets[i] = remarkOff + remarkData = append(remarkData, []byte(e.Comment)...) + remarkData = append(remarkData, 0) + remarkOff += len(e.Comment) + 1 + } + + paramLen := 8 // Status(2)+Converter(2)+EntriesReturned(2)+EntriesAvailable(2) + dataLen := len(entries)*entrySize + len(remarkData) + + paramOffset := smbHeaderLen + 1 + 20 + 2 // = 55 + dataOffset := paramOffset + paramLen // = 63 + totalLen := dataOffset + dataLen + + out := make([]byte, totalLen) + copy(out[:smbHeaderLen], req[:smbHeaderLen]) + binary.LittleEndian.PutUint32(out[smbOffStatus:smbOffStatus+4], smbStatusSuccess) + out[smbOffFlags] |= 0x80 + + out[smbHeaderLen] = 10 // WCT + w := out[smbHeaderLen+1:] + binary.LittleEndian.PutUint16(w[0:2], uint16(paramLen)) + binary.LittleEndian.PutUint16(w[2:4], uint16(dataLen)) + binary.LittleEndian.PutUint16(w[6:8], uint16(paramLen)) // ParameterCount + binary.LittleEndian.PutUint16(w[8:10], uint16(paramOffset)) // ParameterOffset + binary.LittleEndian.PutUint16(w[12:14], uint16(dataLen)) // DataCount + binary.LittleEndian.PutUint16(w[14:16], uint16(dataOffset)) // DataOffset + binary.LittleEndian.PutUint16(w[20:22], uint16(paramLen+dataLen)) // ByteCount + + p := out[paramOffset:] + // p[0:2] Status=0, p[2:4] Converter=0 (already zero) + binary.LittleEndian.PutUint16(p[4:6], uint16(len(entries))) + binary.LittleEndian.PutUint16(p[6:8], uint16(len(entries))) + + d := out[dataOffset:] + for i, e := range entries { + base := i * entrySize + name := e.Name + if len(name) > 12 { + name = name[:12] + } + copy(d[base:base+12], []byte(name)) // shi1_netname (12 chars + NUL) + // d[base+12] = NUL already zero + // d[base+13] = pad already zero + binary.LittleEndian.PutUint16(d[base+14:base+16], e.Type) + binary.LittleEndian.PutUint32(d[base+16:base+20], uint32(remarkOffsets[i])) + } + copy(d[remarkBase:], remarkData) + + return out +} + +func buildSMBTransactionEmptySuccess(req []byte) []byte { + if len(req) < smbHeaderLen || string(req[0:4]) != "\xffSMB" { + return nil + } + out := make([]byte, smbHeaderLen+1+20+2) + copy(out[:smbHeaderLen], req[:smbHeaderLen]) + binary.LittleEndian.PutUint32(out[5:9], smbStatusSuccess) + out[9] = req[9] | 0x80 + out[32] = 10 // TRANSACTION response word count + // 20-byte parameter block left as zero (no params/data) + binary.LittleEndian.PutUint16(out[smbHeaderLen+1+20:smbHeaderLen+1+22], 0) + return out +} + +// HandleDatagram implements netbios.CommandHandler. diff --git a/service/smb/command_trans2.go b/service/smb/command_trans2.go new file mode 100644 index 0000000..d8f811c --- /dev/null +++ b/service/smb/command_trans2.go @@ -0,0 +1,924 @@ +package smb + +import ( + "bytes" + "encoding/binary" + "io/fs" + "path/filepath" + "strings" + "time" + "unicode" +) + +const ( + trans2SubcommandFindFirst2 = 0x0001 + trans2SubcommandFindNext2 = 0x0002 + trans2SubcommandQueryPathInfo = 0x0005 + trans2SubcommandQueryFileInfo = 0x0007 + findInfoLevelFileBothDir = 0x0104 + findBothFixedBytes = 94 + findFlagCloseAfterRequest = 0x0001 + findFlagCloseAtEOS = 0x0002 + findFlagContinueFromLast = 0x0008 + + // Information levels for QUERY_PATH_INFO / QUERY_FILE_INFO. Numbered + // per [MS-CIFS] 2.2.6.6 / 2.2.6.8 and [MS-CIFS] 2.2.8.3. + infoLevelStandard = 0x0001 // SMB_INFO_STANDARD + infoLevelQueryEaSize = 0x0002 // SMB_INFO_QUERY_EA_SIZE + infoLevelQueryFileBasic = 0x0101 // SMB_QUERY_FILE_BASIC_INFO + infoLevelQueryFileStandard = 0x0102 // SMB_QUERY_FILE_STANDARD_INFO + infoLevelQueryFileEaInfo = 0x0103 // SMB_QUERY_FILE_EA_INFO + infoLevelQueryFileNameInfo = 0x0104 // SMB_QUERY_FILE_NAME_INFO (also FILE_BOTH_DIR for FindFirst2) + infoLevelQueryFileAllInfo = 0x0107 // SMB_QUERY_FILE_ALL_INFO +) + +type fsReadDirStat interface { + ReadDir(path string) ([]fs.DirEntry, error) + Stat(path string) (fs.FileInfo, error) + ShortName(path string) (string, error) +} + +type findFirst2Row struct { + name string + shortName string + info fs.FileInfo +} + +func (s *Service) handleQueryInformation(req []byte, conn *connState) []byte { + if len(req) < smbHeaderLen+3 { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + + _, slot, fsys, ok := s.resolveRequestTree(req, conn) + if !ok { + return buildSMBErrorResponse(req, smbStatusBadTID) + } + rootPath := "" + s.mu.Lock() + if slot.shareIdx >= 0 && slot.shareIdx < len(s.shares) { + rootPath = strings.TrimSpace(s.shares[slot.shareIdx].Path) + } + s.mu.Unlock() + + path, ok := parseSMBPathAllowEmpty(req) + if !ok { + return buildSMBErrorResponse(req, smbStatusNameNotFound) + } + + resolved, err := resolveExistingPath(fsys, rootPath, path) + if err != nil { + return buildSMBErrorResponse(req, smbStatusNameNotFound) + } + + info, err := fsys.Stat(resolved) + if err != nil { + return buildSMBErrorResponse(req, smbStatusNameNotFound) + } + + return buildQueryInformationResponse(req, info) +} + +func buildQueryInformationResponse(req []byte, info fs.FileInfo) []byte { + if len(req) < smbHeaderLen || string(req[0:4]) != "\xffSMB" { + return nil + } + + out := make([]byte, smbHeaderLen+1+20+2) + copy(out[:smbHeaderLen], req[:smbHeaderLen]) + binary.LittleEndian.PutUint32(out[smbOffStatus:smbOffStatus+4], smbStatusSuccess) + out[smbOffFlags] |= 0x80 + out[smbHeaderLen] = 10 // WCT + + attrs := uint16(0) + if info.IsDir() { + attrs |= FileAttributeDirectory + } else { + attrs |= FileAttributeArchive + } + + w := out[smbHeaderLen+1:] + binary.LittleEndian.PutUint16(w[0:2], attrs) + binary.LittleEndian.PutUint32(w[2:6], 0) // DOS LastWriteTime placeholder + if !info.IsDir() { + binary.LittleEndian.PutUint32(w[6:10], uint32(info.Size())) + } + binary.LittleEndian.PutUint16(w[20:22], 0) + return out +} + +func (s *Service) handleTransaction2(req []byte, conn *connState) []byte { + _, slot, fsys, ok := s.resolveRequestTree(req, conn) + if !ok { + return buildSMBErrorResponse(req, smbStatusBadTID) + } + + subcommand, params, ok := parseTransaction2Request(req) + if !ok { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + + switch subcommand { + case trans2SubcommandFindFirst2: + rootPath := "" + s.mu.Lock() + if slot.shareIdx >= 0 && slot.shareIdx < len(s.shares) { + rootPath = strings.TrimSpace(s.shares[slot.shareIdx].Path) + } + s.mu.Unlock() + return s.handleTransaction2FindFirst2(req, conn, fsys, rootPath, params) + case trans2SubcommandFindNext2: + return s.handleTransaction2FindNext2(req, conn, params) + case trans2SubcommandQueryFileInfo: + return s.handleTransaction2QueryFileInfo(req, conn, fsys, params) + case trans2SubcommandQueryPathInfo: + rootPath := "" + s.mu.Lock() + if slot.shareIdx >= 0 && slot.shareIdx < len(s.shares) { + rootPath = strings.TrimSpace(s.shares[slot.shareIdx].Path) + } + s.mu.Unlock() + return s.handleTransaction2QueryPathInfo(req, fsys, rootPath, params) + default: + return buildSMBErrorResponse(req, smbStatusNotSupported) + } +} + +// handleTransaction2QueryFileInfo serves TRANS2_QUERY_FILE_INFORMATION +// (subcommand 0x0007). Per [MS-CIFS] 2.2.6.8.1 the params block is: +// +// FID(2) InformationLevel(2) +// +// We resolve the FID to its open file, fetch fs.FileInfo, and serialize +// according to the requested level. Win9x typically asks for 0x0101 +// (SMB_QUERY_FILE_BASIC_INFO) right after OpenAndX as a sanity check. +func (s *Service) handleTransaction2QueryFileInfo(req []byte, conn *connState, fsys fsReadDirStat, params []byte) []byte { + if len(params) < 4 { + return buildSMBErrorResponse(req, smbStatusErrSrvError) + } + fid := binary.LittleEndian.Uint16(params[0:2]) + infoLevel := binary.LittleEndian.Uint16(params[2:4]) + + conn.mu.Lock() + handle, ok := conn.fids[fid] + conn.mu.Unlock() + if !ok || handle == nil || handle.file == nil { + return buildSMBErrorResponse(req, smbStatusInvalidHandle) + } + + info, err := fsys.Stat(handle.path) + if err != nil { + return buildSMBErrorResponse(req, smbStatusNameNotFound) + } + + data, ok := buildQueryInfoData(infoLevel, info) + if !ok { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + return buildTransaction2QueryInfoResponse(req, data) +} + +// handleTransaction2QueryPathInfo serves TRANS2_QUERY_PATH_INFORMATION +// (subcommand 0x0005). Per [MS-CIFS] 2.2.6.6.1 the params block is: +// +// InformationLevel(2) Reserved(4) FileName(SMB_STRING) +// +// The body is the same set of info levels as QueryFileInfo; we share +// the serialization helper. +func (s *Service) handleTransaction2QueryPathInfo(req []byte, fsys fsReadDirStat, rootPath string, params []byte) []byte { + if len(params) < 6 { + return buildSMBErrorResponse(req, smbStatusErrSrvError) + } + infoLevel := binary.LittleEndian.Uint16(params[0:2]) + // Skip params[2:6] Reserved. + rawName := params[6:] + if i := bytes.IndexByte(rawName, 0); i >= 0 { + rawName = rawName[:i] + } + path := strings.TrimLeft(strings.TrimSpace(string(rawName)), "\\") + + resolved, err := resolveExistingPath(fsys, rootPath, path) + if err != nil { + return buildSMBErrorResponse(req, smbStatusNameNotFound) + } + info, err := fsys.Stat(resolved) + if err != nil { + return buildSMBErrorResponse(req, smbStatusNameNotFound) + } + + data, ok := buildQueryInfoData(infoLevel, info) + if !ok { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + return buildTransaction2QueryInfoResponse(req, data) +} + +// buildQueryInfoData serializes fs.FileInfo into the requested info-level +// payload. Returns false if the level is unsupported. +// +// Layouts per [MS-CIFS] 2.2.8.3: +// - 0x0101 SMB_QUERY_FILE_BASIC_INFO — 40 bytes (4 FILETIMEs + attrs + reserved) +// - 0x0102 SMB_QUERY_FILE_STANDARD_INFO — 24 bytes (alloc, eof, links, delete, dir, pad) +// - 0x0103 SMB_QUERY_FILE_EA_INFO — 4 bytes (EaSize) +// - 0x0107 SMB_QUERY_FILE_ALL_INFO — concatenation of the above +func buildQueryInfoData(level uint16, info fs.FileInfo) ([]byte, bool) { + switch level { + case infoLevelQueryFileBasic: + buf := make([]byte, 40) + ft := fileTimeFromModTime(info.ModTime()) + binary.LittleEndian.PutUint64(buf[0:8], ft) // CreationTime + binary.LittleEndian.PutUint64(buf[8:16], ft) // LastAccessTime + binary.LittleEndian.PutUint64(buf[16:24], ft) // LastWriteTime + binary.LittleEndian.PutUint64(buf[24:32], ft) // ChangeTime + binary.LittleEndian.PutUint32(buf[32:36], uint32(extFileAttrs(info))) + // buf[36:40] Reserved = 0 + return buf, true + case infoLevelQueryFileStandard: + buf := make([]byte, 24) + size := uint64(0) + if !info.IsDir() { + size = uint64(info.Size()) + } + binary.LittleEndian.PutUint64(buf[0:8], allocSizeFor(size, info.IsDir())) + binary.LittleEndian.PutUint64(buf[8:16], size) + binary.LittleEndian.PutUint32(buf[16:20], 1) // NumberOfLinks + buf[20] = 0 // DeletePending + if info.IsDir() { + buf[21] = 1 + } + // buf[22:24] padding + return buf, true + case infoLevelQueryFileEaInfo: + buf := make([]byte, 4) // EaSize = 0 + return buf, true + case infoLevelQueryFileAllInfo: + basic, _ := buildQueryInfoData(infoLevelQueryFileBasic, info) + std, _ := buildQueryInfoData(infoLevelQueryFileStandard, info) + ea, _ := buildQueryInfoData(infoLevelQueryFileEaInfo, info) + buf := make([]byte, 0, len(basic)+len(std)+len(ea)) + buf = append(buf, basic...) + buf = append(buf, std...) + buf = append(buf, ea...) + return buf, true + default: + return nil, false + } +} + +// buildTransaction2QueryInfoResponse builds a TRANS2 reply carrying a +// 2-byte EaErrorOffset param and the supplied info-level data block. +// Layout matches the existing FindFirst2 response builder; only the +// param contents differ. +func buildTransaction2QueryInfoResponse(req []byte, data []byte) []byte { + if len(req) < smbHeaderLen || string(req[0:4]) != "\xffSMB" { + return nil + } + + const paramLen = 2 // EaErrorOffset only + dataLen := len(data) + paramOffset := smbHeaderLen + 1 + 20 + 2 + dataOffset := paramOffset + paramLen + totalLen := dataOffset + dataLen + + out := make([]byte, totalLen) + copy(out[:smbHeaderLen], req[:smbHeaderLen]) + binary.LittleEndian.PutUint32(out[smbOffStatus:smbOffStatus+4], smbStatusSuccess) + out[smbOffFlags] |= 0x80 + + out[smbHeaderLen] = 10 + w := out[smbHeaderLen+1:] + binary.LittleEndian.PutUint16(w[0:2], paramLen) // TotalParamCount + binary.LittleEndian.PutUint16(w[2:4], uint16(dataLen)) // TotalDataCount + binary.LittleEndian.PutUint16(w[6:8], paramLen) // ParamCount + binary.LittleEndian.PutUint16(w[8:10], uint16(paramOffset)) + binary.LittleEndian.PutUint16(w[12:14], uint16(dataLen)) // DataCount + if dataLen > 0 { + binary.LittleEndian.PutUint16(w[14:16], uint16(dataOffset)) + } + binary.LittleEndian.PutUint16(w[20:22], uint16(paramLen+dataLen)) // ByteCount + + // EaErrorOffset = 0 + binary.LittleEndian.PutUint16(out[paramOffset:paramOffset+2], 0) + if dataLen > 0 { + copy(out[dataOffset:], data) + } + return out +} + +func (s *Service) handleFindClose2(req []byte, conn *connState) []byte { + if len(req) < smbHeaderLen+5 { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + wct := int(req[smbHeaderLen]) + if wct < 1 || conn == nil { + return buildSimpleSuccessResponse(req) + } + w := req[smbHeaderLen+1:] + sid := binary.LittleEndian.Uint16(w[0:2]) + conn.mu.Lock() + delete(conn.searches, sid) + conn.mu.Unlock() + return buildSimpleSuccessResponse(req) +} + +func parseTransaction2Request(req []byte) (subcommand uint16, params []byte, ok bool) { + if len(req) < smbHeaderLen+1+28 || string(req[0:4]) != "\xffSMB" || req[4] != CommandTransaction2 { + return 0, nil, false + } + + wct := int(req[smbHeaderLen]) + if wct < 14 { + return 0, nil, false + } + + wStart := smbHeaderLen + 1 + wLen := wct * 2 + if wStart+wLen > len(req) { + return 0, nil, false + } + w := req[wStart : wStart+wLen] + + paramCount := int(binary.LittleEndian.Uint16(w[18:20])) + paramOffset := int(binary.LittleEndian.Uint16(w[20:22])) + setupCount := int(w[26]) + if setupCount < 1 || 28+setupCount*2 > len(w) { + return 0, nil, false + } + subcommand = binary.LittleEndian.Uint16(w[28:30]) + + if paramCount < 0 || paramOffset < smbHeaderLen || paramOffset+paramCount > len(req) { + return 0, nil, false + } + params = req[paramOffset : paramOffset+paramCount] + return subcommand, params, true +} + +func (s *Service) handleTransaction2FindFirst2(req []byte, conn *connState, fsys fsReadDirStat, rootPath string, params []byte) []byte { + if len(params) < 12 { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + + searchAttrs := binary.LittleEndian.Uint16(params[0:2]) + searchCount := int(binary.LittleEndian.Uint16(params[2:4])) + if searchCount <= 0 { + searchCount = 1 + } + if searchCount > 256 { + searchCount = 256 + } + infoLevel := binary.LittleEndian.Uint16(params[6:8]) + if infoLevel != findInfoLevelFileBothDir { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + + pattern := trans2PathFromParams(params) + if pattern == "" { + pattern = "*" + } + dirPath, filePattern := splitSearchPattern(pattern) + resolvedDir, err := resolveExistingPath(fsys, rootPath, dirPath) + if err != nil { + return buildSMBErrorResponse(req, smbStatusNameNotFound) + } + queryDir := resolvedDir + + entries, err := fsys.ReadDir(queryDir) + if err != nil { + return buildSMBErrorResponse(req, smbStatusNameNotFound) + } + + matches := make([]findFirst2Row, 0, len(entries)) + for _, entry := range entries { + name := entry.Name() + if !nameMatchesClientPattern(name, filePattern) { + continue + } + info, err := entry.Info() + if err != nil { + continue + } + shortName := name + if s, err := fsys.ShortName(filepath.Join(rootPath, dirPath, name)); err == nil && s != "" { + shortName = s + } + matches = append(matches, findFirst2Row{name: name, shortName: shortName, info: info}) + } + + if len(matches) == 0 { + if !strings.ContainsAny(filePattern, "*?") { + return buildSMBErrorResponse(req, smbStatusNameNotFound) + } + sid := allocSearchSID(conn) + storeSearchHandle(conn, sid, nil, 0, pattern, searchAttrs) + return buildTransaction2FindFirst2Response(req, sid, 0, true, nil, 0) + } + + if searchCount > len(matches) { + searchCount = len(matches) + } + data, returned, lastNameOffset := buildFindFirst2BothDirData(matches, searchCount) + endOfSearch := returned >= len(matches) + + sid := allocSearchSID(conn) + if endOfSearch { + storeSearchHandle(conn, sid, nil, returned, pattern, searchAttrs) + } else { + rows := make([]findFirst2Row, 0, len(matches)-returned) + for _, row := range matches[returned:] { + rows = append(rows, row) + } + storeSearchHandle(conn, sid, rows, 0, pattern, searchAttrs) + } + + return buildTransaction2FindFirst2Response(req, sid, returned, endOfSearch, data, lastNameOffset) +} + +func (s *Service) handleTransaction2FindNext2(req []byte, conn *connState, params []byte) []byte { + if len(params) < 12 { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + + sid := binary.LittleEndian.Uint16(params[0:2]) + searchCount := int(binary.LittleEndian.Uint16(params[2:4])) + if searchCount <= 0 { + searchCount = 1 + } + if searchCount > 256 { + searchCount = 256 + } + infoLevel := binary.LittleEndian.Uint16(params[4:6]) + if infoLevel != findInfoLevelFileBothDir { + return buildSMBErrorResponse(req, smbStatusNotSupported) + } + flags := binary.LittleEndian.Uint16(params[10:12]) + resumeName := trans2ResumeNameFromFindNext2(params) + + if conn == nil { + return buildTransaction2FindNext2Response(req, 0, true, nil, 0) + } + + conn.mu.Lock() + h, ok := conn.searches[sid] + if !ok || h == nil { + conn.mu.Unlock() + return buildSMBErrorResponse(req, smbStatusNoMoreFiles) + } + start := h.idx + if flags&findFlagContinueFromLast == 0 && resumeName != "" { + for i := 0; i < len(h.entries); i++ { + if strings.EqualFold(h.entries[i].name, resumeName) { + start = i + 1 + break + } + } + } + entries := h.entries + conn.mu.Unlock() + + if start >= len(entries) { + if flags&findFlagCloseAfterRequest != 0 || flags&findFlagCloseAtEOS != 0 { + conn.mu.Lock() + delete(conn.searches, sid) + conn.mu.Unlock() + } + return buildSMBErrorResponse(req, smbStatusNoMoreFiles) + } + + rows := make([]findFirst2Row, 0, searchCount) + idx := start + for idx < len(entries) && len(rows) < searchCount { + rows = append(rows, entries[idx]) + idx++ + } + + data, returned, lastNameOffset := buildFindFirst2BothDirData(rows, len(rows)) + endOfSearch := idx >= len(entries) + + conn.mu.Lock() + if flags&findFlagCloseAfterRequest != 0 || (flags&findFlagCloseAtEOS != 0 && endOfSearch) { + delete(conn.searches, sid) + } else if hs, ok := conn.searches[sid]; ok && hs != nil { + hs.idx = idx + } + conn.mu.Unlock() + + return buildTransaction2FindNext2Response(req, returned, endOfSearch, data, lastNameOffset) +} + +func trans2ResumeNameFromFindNext2(params []byte) string { + if len(params) <= 12 { + return "" + } + raw := params[12:] + if i := bytes.IndexByte(raw, 0); i >= 0 { + raw = raw[:i] + } + return strings.TrimSpace(string(raw)) +} + +func parseSMBPathAllowEmpty(req []byte) (string, bool) { + bytesArea, ok := smbBytesArea(req) + if !ok || len(bytesArea) == 0 { + return "", false + } + + rest := bytesArea + if len(rest) > 0 && rest[0] == 0x04 { + rest = rest[1:] + } + if nulIdx := bytes.IndexByte(rest, 0); nulIdx >= 0 { + path := strings.TrimSpace(string(rest[:nulIdx])) + path = strings.TrimLeft(path, "\\") + return path, true + } + return "", false +} + +// resolveSMBLeaf resolves the parent of an SMB path strictly and reports +// whether the requested leaf already exists in that parent (matched +// case-insensitively). Returns the host path of the parent directory, the +// matched leaf entry (zero value if no match), and an error only if the +// parent path itself cannot be resolved. +// +// Callers performing existence-or-create operations (mkdir, create file, +// rename target) should prefer this over resolveExistingPath: it never +// silently substitutes a sibling whose name happens to share a prefix. +func resolveSMBLeaf(fsys fsReadDirStat, rootPath, smbPath string) (parentHost, matchedName string, info fs.FileInfo, err error) { + parentSMB, leaf := splitSMBParent(smbPath) + if leaf == "" { + return "", "", nil, fs.ErrInvalid + } + + parentHost = smbJoinPath(rootPath, parentSMB) + if parentSMB != "" { + if resolved, rerr := resolveExistingPath(fsys, rootPath, parentSMB); rerr == nil { + parentHost = resolved + } + } + + entries, derr := fsys.ReadDir(parentHost) + if derr != nil { + return parentHost, "", nil, derr + } + for _, e := range entries { + if !strings.EqualFold(e.Name(), leaf) { + continue + } + ei, ierr := e.Info() + if ierr != nil { + return parentHost, e.Name(), nil, ierr + } + return parentHost, e.Name(), ei, nil + } + return parentHost, "", nil, nil +} + +func resolveExistingPath(fsys fsReadDirStat, rootPath, smbPath string) (string, error) { + clean := strings.TrimLeft(strings.TrimSpace(smbPath), "\\") + if clean == "" { + if rootPath != "" { + return rootPath, nil + } + return ".", nil + } + + direct := smbJoinPath(rootPath, clean) + if _, err := fsys.Stat(direct); err == nil { + return direct, nil + } + + parts := strings.Split(clean, "\\") + curr := smbJoinPath(rootPath, "") + if curr == "" { + curr = "." + } + + for _, part := range parts { + if part == "" { + continue + } + entries, err := fsys.ReadDir(curr) + if err != nil { + return "", err + } + // Use DOS-name-aware matching so legacy clients can resolve + // mangled forms like "VOLUME68K" to the real "Volume 68k". + // Callers that must reject prefix-style false positives (mkdir, + // create) should use resolveSMBLeaf instead, which only matches + // the final component case-insensitively-exactly. + match := findDOSLikeComponentMatch(part, entries) + if match == "" { + return "", fs.ErrNotExist + } + curr = filepath.Join(curr, match) + } + return curr, nil +} + +// findBestComponentMatch returns the name of the entry matching component +// case-insensitively, or "" if no entry matches. Matching is strict — +// callers that need to resolve DOS-mangled names (e.g. "VOLUME68K" → +// "Volume 68k") should use findDOSLikeComponentMatch instead. Strict +// matching is required for create/collision checks because prefix +// matching lets siblings like "SETUP.cab" masquerade as "setup". +func findBestComponentMatch(component string, entries []fs.DirEntry) string { + for _, e := range entries { + if strings.EqualFold(e.Name(), component) { + return e.Name() + } + } + return "" +} + +// findDOSLikeComponentMatch extends findBestComponentMatch with the +// fallback heuristics needed to resolve a DOS-mangled name (uppercase, +// spaces and punctuation stripped, possibly truncated) to its real +// host-filesystem name. Returns the matched entry name or "". +// +// The fallback only fires when no strict match exists. If multiple +// entries normalize-or-prefix-match the request, the result is "" — +// ambiguity must not silently pick a sibling. +func findDOSLikeComponentMatch(component string, entries []fs.DirEntry) string { + if name := findBestComponentMatch(component, entries); name != "" { + return name + } + normTarget := normalizePathToken(component) + if normTarget == "" { + return "" + } + candidates := make([]string, 0, 4) + for _, e := range entries { + n := normalizePathToken(e.Name()) + if n == normTarget { + return e.Name() + } + if strings.HasPrefix(n, normTarget) { + candidates = append(candidates, e.Name()) + } + } + if len(candidates) == 1 { + return candidates[0] + } + return "" +} + +func normalizePathToken(s string) string { + var b strings.Builder + for _, r := range strings.ToUpper(strings.TrimSpace(s)) { + if unicode.IsLetter(r) || unicode.IsDigit(r) { + b.WriteRune(r) + } + } + return b.String() +} + +func nameMatchesClientPattern(name, pattern string) bool { + if strings.ContainsAny(pattern, "*?") { + return matchesPattern(name, pattern) + } + return strings.EqualFold(name, pattern) +} + +func trans2PathFromParams(params []byte) string { + raw := params[12:] + if i := bytes.IndexByte(raw, 0); i >= 0 { + raw = raw[:i] + } + path := strings.TrimSpace(string(raw)) + path = strings.TrimLeft(path, "\\") + return path +} + +func splitSearchPattern(pattern string) (dirPath, filePattern string) { + last := strings.LastIndex(pattern, "\\") + if last < 0 { + return "", pattern + } + return pattern[:last], pattern[last+1:] +} + +func smbJoinPath(root, rel string) string { + root = strings.TrimSpace(root) + rel = strings.TrimSpace(strings.TrimLeft(rel, "\\")) + if root == "" { + return rel + } + if rel == "" { + return root + } + return filepath.Join(root, strings.ReplaceAll(rel, "\\", string(filepath.Separator))) +} + +func allocSearchSID(conn *connState) uint16 { + if conn == nil { + return 1 + } + conn.mu.Lock() + defer conn.mu.Unlock() + conn.nextSID++ + if conn.nextSID == 0 { + conn.nextSID++ + } + return conn.nextSID +} + + + +func storeSearchHandle(conn *connState, sid uint16, entries []findFirst2Row, idx int, pattern string, attrs uint16) { + if conn == nil { + return + } + conn.mu.Lock() + if conn.searches == nil { + conn.searches = map[uint16]*searchHandle{} + } + conn.searches[sid] = &searchHandle{entries: entries, idx: idx, pattern: pattern, attrs: attrs} + conn.mu.Unlock() +} + +func buildFindFirst2BothDirData(matches []findFirst2Row, maxEntries int) ([]byte, int, uint16) { + if maxEntries <= 0 || len(matches) == 0 { + return nil, 0, 0 + } + var data bytes.Buffer + lastNameOffset := uint16(0) + returned := 0 + + for i := 0; i < len(matches) && returned < maxEntries; i++ { + row := matches[i] + nameBytes := encodeOEM(row.name) + shortNameBytes := encodeOEM(row.shortName) + if len(shortNameBytes) > 24 { + shortNameBytes = shortNameBytes[:24] + } + + recordLen := findBothFixedBytes + len(nameBytes) + pad := (4 - (recordLen % 4)) % 4 + nextOffset := uint32(recordLen + pad) + if returned == maxEntries-1 || i == len(matches)-1 { + nextOffset = 0 + } + + recStart := data.Len() + fileNameOffset := recStart + findBothFixedBytes + if fileNameOffset > 0xFFFF { + break + } + lastNameOffset = uint16(fileNameOffset) + + rec := make([]byte, recordLen+pad) + binary.LittleEndian.PutUint32(rec[0:4], nextOffset) + + ft := fileTimeFromModTime(row.info.ModTime()) + binary.LittleEndian.PutUint64(rec[8:16], ft) + binary.LittleEndian.PutUint64(rec[16:24], ft) + binary.LittleEndian.PutUint64(rec[24:32], ft) + binary.LittleEndian.PutUint64(rec[32:40], ft) + + size := uint64(0) + if !row.info.IsDir() { + size = uint64(row.info.Size()) + } + binary.LittleEndian.PutUint64(rec[40:48], size) + binary.LittleEndian.PutUint64(rec[48:56], allocSizeFor(size, row.info.IsDir())) + binary.LittleEndian.PutUint32(rec[56:60], uint32(extFileAttrs(row.info))) + binary.LittleEndian.PutUint32(rec[60:64], uint32(len(nameBytes))) + + rec[68] = byte(len(shortNameBytes)) + if len(shortNameBytes) > 24 { + copy(rec[70:94], shortNameBytes[:24]) + } else { + copy(rec[70:94], shortNameBytes) + } + + copy(rec[94:94+len(nameBytes)], nameBytes) + + data.Write(rec) + returned++ + } + + return data.Bytes(), returned, lastNameOffset +} + +func allocSizeFor(size uint64, isDir bool) uint64 { + if isDir || size == 0 { + return 0 + } + const cluster = 4096 + return ((size + cluster - 1) / cluster) * cluster +} + +func extFileAttrs(info fs.FileInfo) uint16 { + attrs := uint16(0) + if info.IsDir() { + attrs |= FileAttributeDirectory + } else { + attrs |= FileAttributeArchive + } + if info.Mode().Perm()&0o222 == 0 { + attrs |= FileAttributeReadOnly + } + return attrs +} + +func fileTimeFromModTime(t time.Time) uint64 { + if t.IsZero() { + return windowsFiletimeOffset + } + ns := t.UTC().UnixNano() + if ns < 0 { + return windowsFiletimeOffset + } + return uint64(ns/100) + windowsFiletimeOffset +} + +// encodeOEM encodes s as the single-byte OEM/ASCII form used on the wire when +// SMB_FLAGS2_UNICODE is not negotiated. Non-ASCII runes are replaced with '?'. +// Legacy clients (Win9x, classic Mac SMB) cannot decode UTF-16, so FIND_FIRST2 +// records must use this even though the fixed-area layout is unchanged. +func encodeOEM(s string) []byte { + out := make([]byte, 0, len(s)) + for _, r := range s { + if r < 0x80 { + out = append(out, byte(r)) + } else { + out = append(out, '?') + } + } + return out +} + +func buildTransaction2FindFirst2Response(req []byte, sid uint16, searchCount int, endOfSearch bool, data []byte, lastNameOffset uint16) []byte { + return buildTransaction2FindResponse(req, true, sid, searchCount, endOfSearch, data, lastNameOffset) +} + +func buildTransaction2FindNext2Response(req []byte, searchCount int, endOfSearch bool, data []byte, lastNameOffset uint16) []byte { + return buildTransaction2FindResponse(req, false, 0, searchCount, endOfSearch, data, lastNameOffset) +} + +// buildTransaction2FindResponse encodes a FIND_FIRST2 or FIND_NEXT2 reply. +// The two share the data layout but differ in the response param block: +// FIND_FIRST2 prepends a 2-byte SID (10-byte block); FIND_NEXT2 omits it +// (8-byte block). Mixing them up makes legacy clients parse SearchCount +// as SID and silently drop every record after the first. +func buildTransaction2FindResponse(req []byte, includeSID bool, sid uint16, searchCount int, endOfSearch bool, data []byte, lastNameOffset uint16) []byte { + if len(req) < smbHeaderLen || string(req[0:4]) != "\xffSMB" { + return nil + } + + paramLen := 8 + if includeSID { + paramLen = 10 + } + dataLen := len(data) + paramOffset := smbHeaderLen + 1 + 20 + 2 + dataOffset := paramOffset + paramLen + totalLen := dataOffset + dataLen + + out := make([]byte, totalLen) + copy(out[:smbHeaderLen], req[:smbHeaderLen]) + binary.LittleEndian.PutUint32(out[smbOffStatus:smbOffStatus+4], smbStatusSuccess) + out[smbOffFlags] |= 0x80 + + out[smbHeaderLen] = 10 + w := out[smbHeaderLen+1:] + binary.LittleEndian.PutUint16(w[0:2], uint16(paramLen)) + binary.LittleEndian.PutUint16(w[2:4], uint16(dataLen)) + binary.LittleEndian.PutUint16(w[6:8], uint16(paramLen)) + binary.LittleEndian.PutUint16(w[8:10], uint16(paramOffset)) + binary.LittleEndian.PutUint16(w[12:14], uint16(dataLen)) + if dataLen > 0 { + binary.LittleEndian.PutUint16(w[14:16], uint16(dataOffset)) + } + binary.LittleEndian.PutUint16(w[20:22], uint16(paramLen+dataLen)) + + p := out[paramOffset:] + off := 0 + if includeSID { + binary.LittleEndian.PutUint16(p[off:off+2], sid) + off += 2 + } + binary.LittleEndian.PutUint16(p[off:off+2], uint16(searchCount)) + off += 2 + if endOfSearch { + binary.LittleEndian.PutUint16(p[off:off+2], 1) + } + off += 2 + binary.LittleEndian.PutUint16(p[off:off+2], 0) + off += 2 + binary.LittleEndian.PutUint16(p[off:off+2], lastNameOffset) + + if dataLen > 0 { + copy(out[dataOffset:], data) + } + return out +} + +type dirEntryFromFileInfo struct { + name string + info fs.FileInfo +} + +func (d dirEntryFromFileInfo) Name() string { return d.name } +func (d dirEntryFromFileInfo) IsDir() bool { return d.info.IsDir() } +func (d dirEntryFromFileInfo) Type() fs.FileMode { return d.info.Mode().Type() } +func (d dirEntryFromFileInfo) Info() (fs.FileInfo, error) { return d.info, nil } diff --git a/service/smb/constants.go b/service/smb/constants.go new file mode 100644 index 0000000..90693a5 --- /dev/null +++ b/service/smb/constants.go @@ -0,0 +1,59 @@ +package smb + +const ( + CommandCreateDirectory = 0x00 + CommandDeleteDirectory = 0x01 + CommandOpen = 0x02 + CommandCreate = 0x03 + CommandClose = 0x04 + CommandFlush = 0x05 + CommandDelete = 0x06 + CommandRename = 0x07 + CommandQueryInformation = 0x08 + CommandSetInformation = 0x09 + CommandRead = 0x0A + CommandWrite = 0x0B + CommandSeek = 0x12 + CommandReadMPX = 0x1B + CommandCheckDirectory = 0x10 + CommandWriteRaw = 0x1D + CommandWriteMPX = 0x1E + CommandWriteComplete = 0x20 + CommandSetInformation2 = 0x22 + CommandLockingAndX = 0x24 + CommandTransaction = 0x25 + CommandTransactionSecondary = 0x26 + CommandEcho = 0x2B + CommandOpenAndX = 0x2D + CommandReadAndX = 0x2E + CommandWriteAndX = 0x2F + CommandTransaction2 = 0x32 + CommandTransaction2Secondary = 0x33 + CommandFindClose2 = 0x34 + CommandTreeDisconnect = 0x71 + CommandNegotiate = 0x72 + CommandSessionSetupAndX = 0x73 + CommandLogoffAndX = 0x74 + CommandTreeConnectAndX = 0x75 + CommandQueryInformationDisk = 0x80 + CommandSearch = 0x81 + CommandNtTransact = 0xA0 + CommandNtTransactSecondary = 0xA1 + CommandNtCreateAndX = 0xA2 + CommandNtCancel = 0xA4 + CommandNoAndXCommand = 0xFF + + FileAttributeNormal = 0x0000 + FileAttributeReadOnly = 0x0001 + FileAttributeHidden = 0x0002 + FileAttributeSystem = 0x0004 + FileAttributeVolume = 0x0008 + FileAttributeDirectory = 0x0010 + FileAttributeArchive = 0x0020 + + SearchAttributeReadOnly = 0x0100 + SearchAttributeHidden = 0x0200 + SearchAttributeSystem = 0x0400 + SearchAttributeDirectory = 0x1000 + SearchAttributeArchive = 0x2000 +) diff --git a/service/smb/over_ipx_direct/transport.go b/service/smb/over_ipx_direct/transport.go new file mode 100644 index 0000000..868e615 --- /dev/null +++ b/service/smb/over_ipx_direct/transport.go @@ -0,0 +1,189 @@ +package over_ipx_direct + +import ( + "context" + "encoding/binary" + "sync" + + ipxproto "github.com/ObsoleteMadness/ClassicStack/protocol/ipx" + netbiosproto "github.com/ObsoleteMadness/ClassicStack/protocol/netbios" + "github.com/ObsoleteMadness/ClassicStack/router/ipx" + "github.com/ObsoleteMadness/ClassicStack/service/netbios" +) + +var directSMBSocket = [2]byte{0x05, 0x50} + +const ( + smbHeaderLen = 32 + smbCommandOff = 4 + smbStatusOff = 5 + smbWordCountOff = smbHeaderLen + echoCommand = 0x2b + negotiateCmd = 0x72 + + // Over Direct IPX, SMB header SecurityFeatures[8] (bytes 14..21) holds: + // bytes 14..17: Key (ULONG) + // bytes 18..19: CID (USHORT) — Connection ID, server-generated + // bytes 20..21: SequenceNumber (USHORT) — echoed back in responses + // See [MS-CIFS] 2.2.3.1 and 2.2.1.6.4. + smbOffCID = 18 + smbOffSequenceNumber = 20 +) + +type sessionHandler interface { + HandleSessionContext(packet *netbiosproto.SessionPacket, ctx netbios.SessionContext) (*netbiosproto.SessionPacket, error) +} + +type Transport struct { + router ipx.Router + handler sessionHandler + + cidMu sync.Mutex + cids map[[10]byte]uint16 // remote endpoint (network+node) → CID + nextCID uint16 +} + +func New(router ipx.Router, handler sessionHandler) *Transport { + return &Transport{ + router: router, + handler: handler, + cids: make(map[[10]byte]uint16), + nextCID: 1, // 0x0000 and 0xFFFF are reserved per [MS-CIFS] 2.2.1.6.4. + } +} + +// cidFor returns the CID assigned to the given remote endpoint, allocating +// one on the first call. The CID space wraps over 0xFFFE valid values +// (0x0000 and 0xFFFF reserved). Practical client counts are far below that. +func (t *Transport) cidFor(network [4]byte, node [6]byte, allocate bool) uint16 { + var key [10]byte + copy(key[0:4], network[:]) + copy(key[4:10], node[:]) + + t.cidMu.Lock() + defer t.cidMu.Unlock() + if cid, ok := t.cids[key]; ok { + return cid + } + if !allocate { + return 0 + } + cid := t.nextCID + t.nextCID++ + if t.nextCID == 0xFFFF { + t.nextCID = 1 + } + t.cids[key] = cid + return cid +} + +func (t *Transport) Start(_ context.Context) error { + if t == nil || t.router == nil { + return nil + } + return t.router.RegisterSocket(directSMBSocket, t) +} + +func (t *Transport) Stop() error { return nil } + +func (t *Transport) HandleDatagram(d *ipxproto.Datagram) { + if t == nil || d == nil || t.handler == nil { + return + } + if d.Type != netbiosproto.IPXTypePEP { + return + } + if len(d.Payload) < 4 || string(d.Payload[:4]) != "\xffSMB" { + return + } + // Ignore SMB responses on ingress; only requests should be dispatched. + if len(d.Payload) > 9 && (d.Payload[9]&0x80) != 0 { + return + } + // Allocate a CID on NEGOTIATE; on later commands, look up the CID + // previously assigned to this remote. Per [MS-CIFS] 2.2.1.6.4 the + // server generates the CID and embeds it in the NEGOTIATE response; + // the client then carries it on every subsequent message and we + // echo it back. 0x0000/0xFFFF are reserved as CID values. + allocate := len(d.Payload) > smbCommandOff && d.Payload[smbCommandOff] == negotiateCmd + cid := t.cidFor(d.SrcNet, d.SrcNode, allocate) + + resp, err := t.handler.HandleSessionContext(&netbiosproto.SessionPacket{ + Type: netbiosproto.SessionMessage, + Payload: append([]byte(nil), d.Payload...), + }, netbios.SessionContext{ + Local: netbios.DatagramEndpoint{Network: d.DstNet, Node: d.DstNode, Socket: d.DstSock}, + Remote: netbios.DatagramEndpoint{Network: d.SrcNet, Node: d.SrcNode, Socket: d.SrcSock}, + }) + if err != nil || resp == nil || len(resp.Payload) == 0 { + return + } + echoCount := echoResponseCount(d.Payload, resp.Payload) + if echoCount <= 1 { + payload := append([]byte(nil), resp.Payload...) + stampConnectionlessHeader(payload, d.Payload, cid) + _ = t.router.Send(&ipxproto.Datagram{ + Type: netbiosproto.IPXTypePEP, + DstNet: d.SrcNet, + DstNode: d.SrcNode, + DstSock: d.SrcSock, + SrcSock: d.DstSock, + Payload: payload, + }) + return + } + + for seq := uint16(1); seq <= echoCount; seq++ { + payload := append([]byte(nil), resp.Payload...) + // ECHO response Words contains only SequenceNumber at SMB+33..34. + binary.LittleEndian.PutUint16(payload[smbHeaderLen+1:smbHeaderLen+3], seq) + stampConnectionlessHeader(payload, d.Payload, cid) + _ = t.router.Send(&ipxproto.Datagram{ + Type: netbiosproto.IPXTypePEP, + DstNet: d.SrcNet, + DstNode: d.SrcNode, + DstSock: d.SrcSock, + SrcSock: d.DstSock, + Payload: payload, + }) + } +} + +// stampConnectionlessHeader writes the CID and SequenceNumber into the +// SMB header SecurityFeatures field, as required for connectionless +// transports per [MS-CIFS] 2.2.3.1. SequenceNumber is mirrored from the +// client's request so the redirector can match request to response; +// the Key field (bytes 14..17) is left zero since we do not negotiate +// connection-level signing over IPX. +func stampConnectionlessHeader(resp, req []byte, cid uint16) { + if len(resp) < smbHeaderLen || len(req) < smbHeaderLen { + return + } + if reqCID := binary.LittleEndian.Uint16(req[smbOffCID : smbOffCID+2]); reqCID != 0 && reqCID != 0xFFFF { + cid = reqCID + } + binary.LittleEndian.PutUint16(resp[smbOffCID:smbOffCID+2], cid) + copy(resp[smbOffSequenceNumber:smbOffSequenceNumber+2], + req[smbOffSequenceNumber:smbOffSequenceNumber+2]) +} + +func echoResponseCount(reqPayload, respPayload []byte) uint16 { + if len(reqPayload) < smbHeaderLen+5 || len(respPayload) < smbHeaderLen+5 { + return 1 + } + if reqPayload[smbCommandOff] != echoCommand || respPayload[smbCommandOff] != echoCommand { + return 1 + } + // Multi-response applies only to successful SMB_COM_ECHO responses. + if binary.LittleEndian.Uint32(respPayload[smbStatusOff:smbStatusOff+4]) != 0 { + return 1 + } + if reqPayload[smbWordCountOff] != 1 || respPayload[smbWordCountOff] != 1 { + return 1 + } + c := binary.LittleEndian.Uint16(reqPayload[smbHeaderLen+1 : smbHeaderLen+3]) + if c == 0 { + return 1 + } + return c +} diff --git a/service/smb/over_ipx_direct/transport_test.go b/service/smb/over_ipx_direct/transport_test.go new file mode 100644 index 0000000..65eccf5 --- /dev/null +++ b/service/smb/over_ipx_direct/transport_test.go @@ -0,0 +1,289 @@ +package over_ipx_direct + +import ( + "context" + "encoding/binary" + "testing" + + "github.com/ObsoleteMadness/ClassicStack/capture" + portipx "github.com/ObsoleteMadness/ClassicStack/port/ipx" + ipxproto "github.com/ObsoleteMadness/ClassicStack/protocol/ipx" + netbiosproto "github.com/ObsoleteMadness/ClassicStack/protocol/netbios" + routeripx "github.com/ObsoleteMadness/ClassicStack/router/ipx" + "github.com/ObsoleteMadness/ClassicStack/service/netbios" +) + +type recordingPort struct { + sent []*ipxproto.Datagram + cb portipx.DeliveryCallback +} + +func (p *recordingPort) Start() error { return nil } +func (p *recordingPort) Stop() error { return nil } +func (p *recordingPort) Send(d *ipxproto.Datagram) error { + cp := *d + p.sent = append(p.sent, &cp) + return nil +} +func (p *recordingPort) SetDeliveryCallback(cb portipx.DeliveryCallback) { p.cb = cb } +func (p *recordingPort) SetCaptureSink(_ capture.Sink) {} + +type fakeHandler struct { + seen int +} + +func (h *fakeHandler) HandleSessionContext(packet *netbiosproto.SessionPacket, _ netbios.SessionContext) (*netbiosproto.SessionPacket, error) { + h.seen++ + if packet == nil || len(packet.Payload) < 4 { + return nil, nil + } + return &netbiosproto.SessionPacket{Type: netbiosproto.SessionMessage, Payload: []byte{0xff, 'S', 'M', 'B', 0x72}}, nil +} + +type echoHandler struct { + seen int +} + +func (h *echoHandler) HandleSessionContext(packet *netbiosproto.SessionPacket, _ netbios.SessionContext) (*netbiosproto.SessionPacket, error) { + h.seen++ + if packet == nil || len(packet.Payload) < 37 { + return nil, nil + } + bc := int(binary.LittleEndian.Uint16(packet.Payload[35:37])) + if 37+bc > len(packet.Payload) { + return nil, nil + } + data := packet.Payload[37 : 37+bc] + out := make([]byte, 37+len(data)) + copy(out[:32], packet.Payload[:32]) + out[4] = 0x2b + binary.LittleEndian.PutUint32(out[5:9], 0) + out[9] |= 0x80 + out[32] = 1 + binary.LittleEndian.PutUint16(out[33:35], 1) + binary.LittleEndian.PutUint16(out[35:37], uint16(len(data))) + copy(out[37:], data) + return &netbiosproto.SessionPacket{Type: netbiosproto.SessionMessage, Payload: out}, nil +} + +func TestDirectIPXTransportHandlesRawSMB(t *testing.T) { + r := routeripx.NewRouter() + r.SetIdentity([4]byte{0, 0, 0, 0}, [6]byte{0x84, 0xa9, 0x38, 0x4a, 0xfa, 0x3b}) + p := &recordingPort{} + r.AddPort(p) + + h := &fakeHandler{} + tr := New(r, h) + if err := tr.Start(context.Background()); err != nil { + t.Fatalf("Start: %v", err) + } + + req := &ipxproto.Datagram{ + Type: netbiosproto.IPXTypePEP, + SrcNet: [4]byte{0, 0, 0, 0}, + SrcNode: [6]byte{0x52, 0x54, 0x00, 0x52, 0x0b, 0x12}, + SrcSock: [2]byte{0x05, 0x52}, + DstNet: [4]byte{0, 0, 0, 0}, + DstNode: [6]byte{0x84, 0xa9, 0x38, 0x4a, 0xfa, 0x3b}, + DstSock: directSMBSocket, + Payload: []byte{0xff, 'S', 'M', 'B', 0x72, 0x00}, + } + tr.HandleDatagram(req) + + if h.seen != 1 { + t.Fatalf("handler calls: got %d want 1", h.seen) + } + if len(p.sent) != 1 { + t.Fatalf("sent count: got %d want 1", len(p.sent)) + } + if p.sent[0].DstSock != [2]byte{0x05, 0x52} { + t.Fatalf("response dst socket: got %x want 0552", p.sent[0].DstSock) + } + if p.sent[0].SrcSock != directSMBSocket { + t.Fatalf("response src socket: got %x want %x", p.sent[0].SrcSock, directSMBSocket) + } +} + +func TestDirectIPXTransportEchoSendsEchoCountResponses(t *testing.T) { + r := routeripx.NewRouter() + r.SetIdentity([4]byte{0, 0, 0, 0}, [6]byte{0x84, 0xa9, 0x38, 0x4a, 0xfa, 0x3b}) + p := &recordingPort{} + r.AddPort(p) + + h := &echoHandler{} + tr := New(r, h) + if err := tr.Start(context.Background()); err != nil { + t.Fatalf("Start: %v", err) + } + + req := buildEchoRequestDatagram(3, []byte("ping")) + tr.HandleDatagram(req) + + if h.seen != 1 { + t.Fatalf("handler calls: got %d want 1", h.seen) + } + if len(p.sent) != 3 { + t.Fatalf("sent count: got %d want 3", len(p.sent)) + } + for i := 0; i < 3; i++ { + seq := binary.LittleEndian.Uint16(p.sent[i].Payload[33:35]) + want := uint16(i + 1) + if seq != want { + t.Fatalf("response[%d] sequence: got %d want %d", i, seq, want) + } + } +} + +func TestDirectIPXTransportEchoErrorSendsSingleResponse(t *testing.T) { + r := routeripx.NewRouter() + r.SetIdentity([4]byte{0, 0, 0, 0}, [6]byte{0x84, 0xa9, 0x38, 0x4a, 0xfa, 0x3b}) + p := &recordingPort{} + r.AddPort(p) + + h := &fakeHandler{seen: 0} + tr := New(r, h) + if err := tr.Start(context.Background()); err != nil { + t.Fatalf("Start: %v", err) + } + + // Handler returns non-ECHO payload, so transport must not multiply responses. + req := buildEchoRequestDatagram(5, []byte("x")) + tr.HandleDatagram(req) + + if len(p.sent) != 1 { + t.Fatalf("sent count: got %d want 1", len(p.sent)) + } +} + +func TestDirectIPXTransportStampsCIDOnNegotiateAndReusesIt(t *testing.T) { + r := routeripx.NewRouter() + r.SetIdentity([4]byte{0, 0, 0, 0}, [6]byte{0x84, 0xa9, 0x38, 0x4a, 0xfa, 0x3b}) + p := &recordingPort{} + r.AddPort(p) + + h := &headerEchoHandler{} + tr := New(r, h) + if err := tr.Start(context.Background()); err != nil { + t.Fatalf("Start: %v", err) + } + + // NEGOTIATE from client A; the request carries SequenceNumber=7 in + // SecurityFeatures so we can verify it is mirrored back. + clientA := [6]byte{0x52, 0x54, 0x00, 0x52, 0x0b, 0x12} + negA := buildSMBRequestDatagram(0x72, clientA, 7) + tr.HandleDatagram(negA) + + if len(p.sent) != 1 { + t.Fatalf("sent count after NEGOTIATE: got %d want 1", len(p.sent)) + } + cidA := binary.LittleEndian.Uint16(p.sent[0].Payload[smbOffCID : smbOffCID+2]) + if cidA == 0 || cidA == 0xFFFF { + t.Fatalf("CID assignment: got %#x; 0x0000 and 0xFFFF are reserved", cidA) + } + if seq := binary.LittleEndian.Uint16(p.sent[0].Payload[smbOffSequenceNumber : smbOffSequenceNumber+2]); seq != 7 { + t.Fatalf("SequenceNumber mirror: got %d want 7", seq) + } + + // A second command from the same client must reuse the CID. + echo := buildSMBRequestDatagram(0x2b, clientA, 9) + tr.HandleDatagram(echo) + if len(p.sent) != 2 { + t.Fatalf("sent count after ECHO: got %d want 2", len(p.sent)) + } + cidA2 := binary.LittleEndian.Uint16(p.sent[1].Payload[smbOffCID : smbOffCID+2]) + if cidA2 != cidA { + t.Fatalf("CID reuse: got %#x want %#x", cidA2, cidA) + } + if seq := binary.LittleEndian.Uint16(p.sent[1].Payload[smbOffSequenceNumber : smbOffSequenceNumber+2]); seq != 9 { + t.Fatalf("SequenceNumber mirror on second response: got %d want 9", seq) + } + + // A different client gets a different CID via NEGOTIATE. + clientB := [6]byte{0x52, 0x54, 0x00, 0x52, 0x0b, 0x99} + negB := buildSMBRequestDatagram(0x72, clientB, 1) + tr.HandleDatagram(negB) + if len(p.sent) != 3 { + t.Fatalf("sent count after second NEGOTIATE: got %d want 3", len(p.sent)) + } + cidB := binary.LittleEndian.Uint16(p.sent[2].Payload[smbOffCID : smbOffCID+2]) + if cidB == cidA { + t.Fatalf("distinct clients share CID: %#x", cidB) + } +} + +func TestDirectIPXTransportMirrorsRequestCIDOnResponse(t *testing.T) { + r := routeripx.NewRouter() + r.SetIdentity([4]byte{0, 0, 0, 0}, [6]byte{0x84, 0xa9, 0x38, 0x4a, 0xfa, 0x3b}) + p := &recordingPort{} + r.AddPort(p) + + h := &headerEchoHandler{} + tr := New(r, h) + if err := tr.Start(context.Background()); err != nil { + t.Fatalf("Start: %v", err) + } + + req := buildSMBRequestDatagram(0x2b, [6]byte{0x52, 0x54, 0x00, 0x52, 0x0b, 0x12}, 4) + binary.LittleEndian.PutUint16(req.Payload[smbOffCID:smbOffCID+2], 0x0042) + tr.HandleDatagram(req) + + if len(p.sent) != 1 { + t.Fatalf("sent count: got %d want 1", len(p.sent)) + } + if got := binary.LittleEndian.Uint16(p.sent[0].Payload[smbOffCID : smbOffCID+2]); got != 0x0042 { + t.Fatalf("CID mirror mismatch: got %#x want %#x", got, uint16(0x0042)) + } +} + +// headerEchoHandler returns a 32-byte SMB header that mirrors the request +// header, simulating a real command response builder (which always copies +// the request header). It lets the test inspect SecurityFeatures stamping. +type headerEchoHandler struct{} + +func (h *headerEchoHandler) HandleSessionContext(packet *netbiosproto.SessionPacket, _ netbios.SessionContext) (*netbiosproto.SessionPacket, error) { + if packet == nil || len(packet.Payload) < 32 { + return nil, nil + } + out := make([]byte, 32) + copy(out, packet.Payload[:32]) + out[9] |= 0x80 + return &netbiosproto.SessionPacket{Type: netbiosproto.SessionMessage, Payload: out}, nil +} + +func buildSMBRequestDatagram(cmd byte, srcNode [6]byte, sequence uint16) *ipxproto.Datagram { + payload := make([]byte, 32) + copy(payload[0:4], []byte{0xff, 'S', 'M', 'B'}) + payload[smbCommandOff] = cmd + binary.LittleEndian.PutUint16(payload[smbOffSequenceNumber:smbOffSequenceNumber+2], sequence) + return &ipxproto.Datagram{ + Type: netbiosproto.IPXTypePEP, + SrcNet: [4]byte{0, 0, 0, 0}, + SrcNode: srcNode, + SrcSock: [2]byte{0x05, 0x52}, + DstNet: [4]byte{0, 0, 0, 0}, + DstNode: [6]byte{0x84, 0xa9, 0x38, 0x4a, 0xfa, 0x3b}, + DstSock: directSMBSocket, + Payload: payload, + } +} + +func buildEchoRequestDatagram(echoCount uint16, data []byte) *ipxproto.Datagram { + payload := make([]byte, 37+len(data)) + copy(payload[0:4], []byte{0xff, 'S', 'M', 'B'}) + payload[4] = 0x2b + payload[32] = 1 + binary.LittleEndian.PutUint16(payload[33:35], echoCount) + binary.LittleEndian.PutUint16(payload[35:37], uint16(len(data))) + copy(payload[37:], data) + + return &ipxproto.Datagram{ + Type: netbiosproto.IPXTypePEP, + SrcNet: [4]byte{0, 0, 0, 0}, + SrcNode: [6]byte{0x52, 0x54, 0x00, 0x52, 0x0b, 0x12}, + SrcSock: [2]byte{0x05, 0x52}, + DstNet: [4]byte{0, 0, 0, 0}, + DstNode: [6]byte{0x84, 0xa9, 0x38, 0x4a, 0xfa, 0x3b}, + DstSock: directSMBSocket, + Payload: payload, + } +} diff --git a/service/smb/server.go b/service/smb/server.go new file mode 100644 index 0000000..a9a1cd1 --- /dev/null +++ b/service/smb/server.go @@ -0,0 +1,841 @@ +// Package smb is the SMB 1.0 file-server stub. It is not an AppleTalk +// service and does not consume DDP datagrams; it rides NetBIOS (today +// NBT only — see service/netbios/over_tcp) and exposes file shares +// backed by the shared pkg/vfs registry. +// +// The package is a stub: NewService produces a Service whose Start +// runs a no-op lifecycle, dispatch returns STATUS_NOT_SUPPORTED for +// every SMB command, and the authenticator is a permissive guest stub. +package smb + +import ( + "context" + "errors" + "fmt" + "strings" + "sync" + "time" + + "github.com/ObsoleteMadness/ClassicStack/netlog" + "github.com/ObsoleteMadness/ClassicStack/pkg/vfs" + netbiosproto "github.com/ObsoleteMadness/ClassicStack/protocol/netbios" + "github.com/ObsoleteMadness/ClassicStack/service/netbios" +) + +// ErrNotImplemented is returned by stub call sites that have not +// been filled in. +var ErrNotImplemented = errors.New("smb: not implemented") + +// originSMB is the publisher tag used on every vfs.Event the SMB +// server emits, so subscribers (including this one) can filter their +// own events out and avoid feedback loops. +const originSMB = "smb" + +const hostAnnouncementPeriod = 2 * time.Minute + +type browserRole uint8 + +const ( + browserRolePotential browserRole = iota + browserRoleBackup + browserRoleLocalMaster +) + +const ( + browserNameTypeMasterBrowser = 0x1D + + browserCommandHostAnnouncement = 0x01 + browserCommandAnnouncementReq = 0x02 + browserCommandRequestElection = 0x08 + browserCommandGetBackupListReq = 0x09 + browserCommandGetBackupListResp = 0x0A + browserCommandDomainAnnouncement = 0x0C + browserCommandLocalMasterAnnounce = 0x0F + browserVersionElection = 0x01 + browserVersionMajor = 0x0F + browserVersionMinor = 0x01 + hostAnnouncementVersionMajor = 0x15 + hostAnnouncementVersionMinor = 0x04 + browserSignature = 0xAA55 + browserServerTypeWorkstationMask = 0x00402003 + browserElectionCriteriaMasterMask = 0x00000004 + browserServerTypeBackupMask = 0x00020000 + browserServerTypeMasterMask = 0x00040000 + browserServerTypeDomainEnumMask = 0x80000000 + + browserMailslotBrowse = "\\MAILSLOT\\BROWSE" + browserMailslotLANMAN = "\\MAILSLOT\\LANMAN" + + smbHeaderLen = 32 + browserTransactionWordCount = 17 + browserTransactionWordsLen = 34 + browserTransactionByteOffset = smbHeaderLen + 1 + browserTransactionWordsLen + browserTransactionDataOffset = 86 + + smbStatusSuccess = 0x00000000 + smbStatusBadTID = 0x00050002 + smbStatusNotSupported = 0xC00000BB + smbStatusBadNetworkName = 0xC00000CC // STATUS_BAD_NETWORK_NAME + smbStatusNoMoreFiles = 0x80000006 // STATUS_NO_MORE_FILES + smbStatusErrBadFunc = 0x00010001 // ERRDOS/ERRbadfunc + smbStatusErrBadFile = 0x00020001 // ERRDOS/ERRbadfile + smbStatusErrBadPath = 0x00030001 // ERRDOS/ERRbadpath + smbStatusErrNoAccess = 0x00050001 // ERRDOS/ERRnoaccess + smbStatusErrNoFiles = 0x00120001 // ERRDOS/ERRnofiles + smbStatusErrInvNetName = 0x00430001 // ERRDOS/ERRinvnetname + smbStatusErrSrvError = 0x00010002 // ERRSRV/ERRerror + smbStatusUseStandard = 0x00FB0002 // ERRSRV/ERRuseSTD — fall back to SMB_COM_READ/WRITE + smbStatusInvalidHandle = 0xC0000008 // STATUS_INVALID_HANDLE + smbStatusErrBadFid = 0x00060001 // ERRDOS/ERRbadfid — invalid FID + + // SMB1 NEGOTIATE capability bits ([MS-CIFS] 2.2.4.52.2). All defined + // flags are listed for documentation; only a curated subset is + // actually OR'd into the advertised Capabilities field below. + capRawMode = uint32(0x00000001) // CAP_RAW_MODE — server supports SMB_COM_READ_RAW / WRITE_RAW + capMpxMode = uint32(0x00000002) // CAP_MPX_MODE — server supports SMB_COM_READ_MPX / WRITE_MPX + capUnicode = uint32(0x00000004) // CAP_UNICODE — server supports Unicode strings + capLargeFiles = uint32(0x00000008) // CAP_LARGE_FILES — server supports 64-bit file offsets + capNTSMBs = uint32(0x00000010) // CAP_NT_SMBS — server supports the NT-mode SMBs + capRpcRemoteApi = uint32(0x00000020) // CAP_RPC_REMOTE_APIS + capStatus32 = uint32(0x00000040) // CAP_STATUS32 — server returns 32-bit NTSTATUS + capLevel2Oplocks = uint32(0x00000080) // CAP_LEVEL_II_OPLOCKS + capLockAndRead = uint32(0x00000100) // CAP_LOCK_AND_READ + capNTFind = uint32(0x00000200) // CAP_NT_FIND + capDFS = uint32(0x00001000) // CAP_DFS + capInfoLevelPassthrough = uint32(0x00002000) // CAP_INFOLEVEL_PASSTHRU + capLargeReadX = uint32(0x00004000) // CAP_LARGE_READX + capLargeWriteX = uint32(0x00008000) // CAP_LARGE_WRITEX + capLwio = uint32(0x00010000) // CAP_LWIO + capUnix = uint32(0x00800000) // CAP_UNIX + capDynamicReauth = uint32(0x20000000) // CAP_DYNAMIC_REAUTH + capExtendedSecurity = uint32(0x80000000) // CAP_EXTENDED_SECURITY + + // negotiateCapabilities is the exact set we advertise. We deliberately + // do NOT advertise CAP_RAW_MODE or CAP_MPX_MODE — both legacy + // transports (read/write raw, read/write mpx) are unimplemented and + // silently corrupt files when half-emulated. Win9x falls back to + // SMB_COM_READ / SMB_COM_WRITE / SMB_COM_WRITE_ANDX when those bits + // are clear. + negotiateCapabilities = capNTSMBs | + capStatus32 | + capNTFind | + capLargeFiles + + // SMB1 NEGOTIATE numeric parameters. These match SMBLibrary defaults + // and are conservative enough to keep Win9x clients happy on a + // connectionless transport (Direct IPX) where larger windows just + // invite retransmission storms. + negotiateMaxMpxCount = uint16(1) // single-request server, no parallel commands + negotiateMaxNumberVcs = uint16(1) // one virtual circuit per session + negotiateMaxBufferSize = uint32(0x4000) // 16 KiB per request + negotiateMaxRawSize = uint32(0) // raw mode disabled (paired with no CAP_RAW_MODE) + + // SecurityMode bits ([MS-CIFS] 2.2.4.52.2). User-level security with + // no challenge: clients send credentials in the clear which we accept + // as a guest session. + negotiateSecurityMode = byte(0x01) // bit 0: SECURITY_MODE_USER_SECURITY + + // windowsFiletimeOffset is the difference in 100-nanosecond intervals + // between the Windows FILETIME epoch (1 Jan 1601) and the Unix epoch + // (1 Jan 1970). + windowsFiletimeOffset = uint64(116444736000000000) + + // ipcShareName is the virtual IPC$ share that is always available. + ipcShareName = "IPC$" + // ipcShareIdx is the sentinel shareIdx stored in treeSlot for IPC$ connections. + // It is never a valid index into the shares slice. + ipcShareIdx = -1 + + // RAP-level (16-bit) error codes returned in the param Status field. + rapStatusErrInvalidFunction = uint16(1) // ERROR_INVALID_FUNCTION + rapStatusErrReqNotAccepted = uint16(71) // ERROR_REQ_NOT_ACCEP + + // SMB1 header field byte offsets (within the 32-byte SMB1 header). + // On a connectionless transport the SecurityFeatures region holds + // Key(4) + CID(2) + SequenceNumber(2) at offsets 14..21 per + // [MS-CIFS] 2.2.3.1; SequenceNumber identifies the final request of + // a multiplexed write sequence (see SMB_COM_WRITE_MPX). + smbOffStatus = 5 + smbOffFlags = 9 + smbOffFlags2 = 10 + smbOffSequenceNumber = 20 + smbOffTID = 24 + smbOffUID = 28 + + smbFlags2KnowsLongNames = 0x0001 + smbFlags2NTStatus = 0x4000 + + // rapNetShareEnum is the RAP function code for NetShareEnum. + rapNetShareEnum = uint16(0x0000) + // rapNetServerEnum2 is the RAP function code for NetServerEnum2. + rapNetServerEnum2 = uint16(0x0068) + + // dialectNTLM is the NT LM 0.12 dialect string. + dialectNTLM = "NT LM 0.12" +) + +type ServerOptions struct { + // NBTBinding is the NetBIOS-over-TCP listen address (typically :139). + NBTBinding string + // DirectBinding is the SMB-direct (port 445) listen address. Empty + // disables direct SMB; SMB 1.0 is conventionally NBT-only. + DirectBinding string + // GuestOk controls whether unauthenticated sessions are accepted. + GuestOk bool + // Workgroup is the announced workgroup/domain name. + Workgroup string + // ServerName is the announced NetBIOS server name. Falls back to + // the NetBIOS service's own name when empty. + ServerName string + // Bus, when non-nil, is the VFS event bus the server publishes + // to and subscribes from. The default is vfs.DefaultBus. + Bus vfs.Bus + // Shortname is the optional 8.3 mapper used when responding to + // legacy DOS/Windows clients. Nil disables shortname mapping. + Shortname vfs.ShortnameMapper +} + +// Authenticator validates SMB credentials. The stub permits everyone. +type Authenticator interface { + Authenticate(user, pass string) error +} + +type guestAuth struct{} + +func (guestAuth) Authenticate(_, _ string) error { return nil } + +// Service is the SMB 1.0 server stub. +type Service struct { + opts ServerOptions + nb netbios.NameService + nbData datagramSender + shares []ShareConfig + auth Authenticator + bus vfs.Bus + + mu sync.Mutex + started bool + cancelEvent func() + announceCancel context.CancelFunc + announceDone chan struct{} + nextUID uint16 + browserRole browserRole + browserStarted time.Time + electionCancel context.CancelFunc + electionGen uint64 + electionDelay func(browserRole) time.Duration + + browserServers map[string]browserServerRecord + machineGroups map[string]machineGroupRecord + + connsMu sync.Mutex + conns map[connKey]*connState + shareFSes map[int]vfs.FileSystem + shareNameToIndex map[string]int +} + +type machineGroupRecord struct { + MasterBrowser string + LastSeen time.Time +} + +type browserServerRecord struct { + ServerType uint32 + LastSeen time.Time +} + +type netServerInfo1 struct { + Name string + Type uint32 + Comment string +} + +type datagramSender interface { + SendDatagram(d *netbiosproto.Datagram) error + SendDirectedDatagram(d *netbiosproto.Datagram, remote netbios.DatagramEndpoint) error +} + +// NewService creates a stubbed SMB service. nb may be nil when SMB is +// configured without NetBIOS (e.g. integration tests that drive the +// dispatch path directly). shares may be empty. +func NewService(opts ServerOptions, nb netbios.NameService, shares []ShareConfig) *Service { + if opts.Bus == nil { + opts.Bus = vfs.DefaultBus + } + return &Service{ + opts: opts, + nb: nb, + shares: shares, + auth: guestAuth{}, + bus: opts.Bus, + nextUID: 1, + browserRole: browserRolePotential, + browserStarted: time.Now(), + electionDelay: func(role browserRole) time.Duration { + switch role { + case browserRoleLocalMaster: + return 200 * time.Millisecond + case browserRoleBackup: + return 400 * time.Millisecond + default: + return 800 * time.Millisecond + } + }, + browserServers: map[string]browserServerRecord{}, + machineGroups: map[string]machineGroupRecord{}, + conns: map[connKey]*connState{}, + shareFSes: map[int]vfs.FileSystem{}, + shareNameToIndex: map[string]int{}, + } +} + +// SetDatagramSender installs the NetBIOS datagram sender used for +// best-effort browser host announcements. +func (s *Service) SetDatagramSender(sender datagramSender) { + s.mu.Lock() + s.nbData = sender + s.mu.Unlock() +} + +// SetAuthenticator overrides the default guest authenticator. +func (s *Service) SetAuthenticator(a Authenticator) { + if a == nil { + a = guestAuth{} + } + s.mu.Lock() + s.auth = a + s.mu.Unlock() +} + +// Shares returns the share configs the service was constructed with. +func (s *Service) Shares() []ShareConfig { + out := make([]ShareConfig, len(s.shares)) + copy(out, s.shares) + return out +} + +// Start brings the SMB service up. It registers a VFS bus subscriber +// so cross-protocol mutations (e.g. an AFP rename inside a shared +// volume) can invalidate SMB-side caches. +func (s *Service) Start(ctx context.Context) error { + s.mu.Lock() + if s.started { + s.mu.Unlock() + return nil + } + if err := s.initShareBackendsLocked(); err != nil { + s.mu.Unlock() + return err + } + s.cancelEvent = s.bus.Subscribe(&shareEventSubscriber{shares: s.shares}) + s.started = true + s.browserStarted = time.Now() + sender := s.nbData + server := s.opts.ServerName + if server == "" { + server = "CLASSICSTACK" + } + workgroup := s.opts.Workgroup + if workgroup == "" { + workgroup = "WORKGROUP" + } + if sender != nil { + announceCtx, cancel := context.WithCancel(ctx) + s.announceCancel = cancel + s.announceDone = make(chan struct{}) + go s.announceLoop(announceCtx, sender, server, workgroup, s.announceDone) + } + s.mu.Unlock() + + if s.nbData != nil { + if err := s.sendHostAnnouncement(sender, server, workgroup); err != nil { + netlog.Warn("[SMB] host announcement send failed: %v", err) + } + } + return nil +} + +func (s *Service) announceLoop(ctx context.Context, sender datagramSender, server, workgroup string, done chan struct{}) { + defer close(done) + for { + select { + case <-ctx.Done(): + return + case <-time.After(hostAnnouncementPeriod): + if err := s.sendHostAnnouncement(sender, server, workgroup); err != nil { + netlog.Warn("[SMB] periodic host announcement send failed: %v", err) + } + } + } +} + +func (s *Service) sendHostAnnouncement(sender datagramSender, server, workgroup string) error { + browser := hostAnnouncementFrame{ + UpdateCount: 0x03, + PeriodicityMS: uint32(hostAnnouncementPeriod / time.Millisecond), + ServerName: server, + OSVersionMajor: 0x04, + OSVersionMinor: 0x00, + ServerType: browserServerTypeWorkstationMask, + BrowserVersionMajor: hostAnnouncementVersionMajor, + BrowserVersionMinor: hostAnnouncementVersionMinor, + Signature: browserSignature, + }.MarshalBinary() + payload := browserMailslotTransaction{ + MailslotName: browserMailslotBrowse, + BrowserPayload: browser, + TimeoutMS: 1000, + Priority: 0, + Class: 2, + }.MarshalBinary() + err := sender.SendDatagram(&netbiosproto.Datagram{ + Destination: netbiosproto.NewName(workgroup, browserNameTypeMasterBrowser), + Source: netbiosproto.NewName(server, netbiosproto.NameTypeFileServer), + Payload: payload, + }) + if err == nil { + netlog.Info("[SMB][Browser] announced host %q to workgroup %q", server, workgroup) + s.noteBrowserServer(server, browserServerTypeWorkstationMask) + } + return err +} + +func (s *Service) sendLocalMasterAnnouncement(sender datagramSender, server, workgroup string) error { + browser := localMasterAnnouncementFrame{ + UpdateCount: 0x00, + PeriodicityMS: uint32(hostAnnouncementPeriod / time.Millisecond), + ServerName: server, + OSVersionMajor: 0x04, + OSVersionMinor: 0x00, + ServerType: browserServerTypeWorkstationMask | browserServerTypeMasterMask, + BrowserConfigVersionMajor: browserVersionMajor, + BrowserConfigVersionMinor: browserVersionMinor, + Signature: browserSignature, + }.MarshalBinary() + payload := browserMailslotTransaction{ + MailslotName: browserMailslotBrowse, + BrowserPayload: browser, + TimeoutMS: 1000, + Priority: 0, + Class: 2, + }.MarshalBinary() + err := sender.SendDatagram(&netbiosproto.Datagram{ + Destination: netbiosproto.NewName(workgroup, netbiosproto.NameTypeGroup), + Source: netbiosproto.NewName(server, netbiosproto.NameTypeFileServer), + Payload: payload, + }) + if err == nil { + netlog.Info("[SMB][Browser] announced local master %q to workgroup %q", server, workgroup) + s.noteBrowserServer(server, browserServerTypeWorkstationMask|browserServerTypeMasterMask) + } + return err +} + +func (s *Service) noteBrowserServer(server string, serverType uint32) { + name := normalizeBrowserName(server) + if name == "" { + return + } + s.mu.Lock() + s.browserServers[name] = browserServerRecord{ServerType: serverType, LastSeen: time.Now()} + s.mu.Unlock() +} + +func (s *Service) noteMachineGroup(machineGroup, masterBrowser string) { + group := normalizeBrowserName(machineGroup) + if group == "" { + return + } + master := normalizeBrowserName(masterBrowser) + s.mu.Lock() + s.machineGroups[group] = machineGroupRecord{MasterBrowser: master, LastSeen: time.Now()} + s.mu.Unlock() +} + +func (s *Service) backupServerList(self string) []string { + selfName := normalizeBrowserName(self) + out := []string{selfName} + s.mu.Lock() + for name, rec := range s.browserServers { + if name == selfName { + continue + } + if rec.ServerType&browserServerTypeBackupMask != 0 { + out = append(out, name) + } + } + s.mu.Unlock() + return out +} + +// Stop tears the service down. +func (s *Service) Stop() error { + s.mu.Lock() + if !s.started { + electionCancel := s.electionCancel + s.electionCancel = nil + s.mu.Unlock() + if electionCancel != nil { + electionCancel() + } + return nil + } + if s.cancelEvent != nil { + s.cancelEvent() + s.cancelEvent = nil + } + s.dropAllConnectionsLocked() + announceCancel := s.announceCancel + announceDone := s.announceDone + electionCancel := s.electionCancel + s.announceCancel = nil + s.announceDone = nil + s.electionCancel = nil + s.started = false + s.mu.Unlock() + if announceCancel != nil { + announceCancel() + } + if electionCancel != nil { + electionCancel() + } + if announceDone != nil { + <-announceDone + } + return nil +} + +func (s *Service) localElectionUptime() uint32 { + s.mu.Lock() + started := s.browserStarted + s.mu.Unlock() + if started.IsZero() { + return 1 + } + secs := uint32(time.Since(started) / time.Second) + if secs == 0 { + return 1 + } + return secs +} + +func (s *Service) localElectionFrame(server string) requestElectionFrame { + return requestElectionFrame{ + Version: browserVersionElection, + Criteria: browserElectionCriteriaMasterMask, + Uptime: s.localElectionUptime(), + Reserved: 0, + ServerName: server, + } +} + +func compareElection(local, remote requestElectionFrame) int { + if local.Criteria > remote.Criteria { + return 1 + } + if local.Criteria < remote.Criteria { + return -1 + } + if local.Uptime > remote.Uptime { + return 1 + } + if local.Uptime < remote.Uptime { + return -1 + } + localName := strings.ToUpper(strings.TrimSpace(local.ServerName)) + remoteName := strings.ToUpper(strings.TrimSpace(remote.ServerName)) + cmp := strings.Compare(localName, remoteName) + if cmp < 0 { + return 1 + } + if cmp > 0 { + return -1 + } + return 0 +} + +func (s *Service) sendElectionFrame(sender datagramSender, server, workgroup string, frame requestElectionFrame) error { + payload := browserMailslotTransaction{ + MailslotName: browserMailslotBrowse, + BrowserPayload: frame.MarshalBinary(), + TimeoutMS: 1000, + Priority: 0, + Class: 2, + }.MarshalBinary() + return sender.SendDatagram(&netbiosproto.Datagram{ + Destination: netbiosproto.NewName(workgroup, netbiosproto.NameTypeGroup), + Source: netbiosproto.NewName(server, netbiosproto.NameTypeFileServer), + Payload: payload, + }) +} + +func (s *Service) startElectionLoop(sender datagramSender, server, workgroup string, originRole browserRole) { + s.mu.Lock() + if s.electionCancel != nil { + s.mu.Unlock() + return + } + delay := s.electionDelay(originRole) + ctx, cancel := context.WithCancel(context.Background()) + s.electionCancel = cancel + s.electionGen++ + gen := s.electionGen + s.mu.Unlock() + + go s.runElectionLoop(ctx, sender, server, workgroup, gen, delay) +} + +func (s *Service) stopElectionLoop() { + s.mu.Lock() + cancel := s.electionCancel + s.electionCancel = nil + s.mu.Unlock() + if cancel != nil { + cancel() + } +} + +func (s *Service) runElectionLoop(ctx context.Context, sender datagramSender, server, workgroup string, gen uint64, delay time.Duration) { + for i := 0; i < 3; i++ { + select { + case <-ctx.Done(): + return + case <-time.After(delay): + } + if err := s.sendElectionFrame(sender, server, workgroup, s.localElectionFrame(server)); err != nil { + netlog.Warn("[SMB][Browser] election resend failed: %v", err) + continue + } + } + + s.mu.Lock() + if s.electionGen != gen { + s.mu.Unlock() + return + } + s.electionCancel = nil + s.browserRole = browserRoleLocalMaster + s.mu.Unlock() + + netlog.Info("[SMB][Browser] election won after 4 request-election transmissions") + if err := s.sendLocalMasterAnnouncement(sender, server, workgroup); err != nil { + netlog.Warn("[SMB][Browser] local master announcement send failed: %v", err) + } +} + +// HandleSession implements netbios.CommandHandler. The stub rejects +// every inbound session-layer SMB request as not implemented. + +func (s *Service) HandleDatagram(d *netbiosproto.Datagram) error { + return s.handleDatagram(d, netbios.DatagramContext{}) +} + +// HandleDatagramContext implements netbios.ContextualDatagramHandler. +func (s *Service) HandleDatagramContext(d *netbiosproto.Datagram, ctx netbios.DatagramContext) error { + return s.handleDatagram(d, ctx) +} + +func (s *Service) handleDatagram(d *netbiosproto.Datagram, ctx netbios.DatagramContext) error { + if d == nil || len(d.Payload) == 0 { + return nil + } + tx, err := unmarshalBrowserMailslotTransaction(d.Payload) + if err != nil || len(tx.BrowserPayload) == 0 { + return nil + } + cmd, framePayload, ok := unwrapBrowserPayload(tx.BrowserPayload) + if !ok { + return nil + } + if cmd != browserCommandGetBackupListReq && cmd != browserCommandRequestElection && cmd != browserCommandAnnouncementReq && cmd != browserCommandHostAnnouncement && cmd != browserCommandLocalMasterAnnounce && cmd != browserCommandDomainAnnouncement { + return nil + } + netlog.Debug("[SMB][Browser] request cmd=0x%02x src=%q dst=%q mailslot=%q bytes=%d", cmd, d.Source.String(), d.Destination.String(), tx.MailslotName, len(framePayload)) + + if cmd == browserCommandHostAnnouncement { + host, err := unmarshalHostAnnouncementFrame(framePayload) + if err != nil { + return nil + } + s.noteBrowserServer(host.ServerName, host.ServerType) + netlog.Debug("[SMB][Browser] observed host announcement server=%q type=0x%08x", host.ServerName, host.ServerType) + return nil + } + + if cmd == browserCommandLocalMasterAnnounce { + master, err := unmarshalLocalMasterAnnouncementFrame(framePayload) + if err != nil { + return nil + } + s.noteBrowserServer(master.ServerName, master.ServerType|browserServerTypeMasterMask) + netlog.Debug("[SMB][Browser] observed local master announcement server=%q type=0x%08x", master.ServerName, master.ServerType) + return nil + } + + if cmd == browserCommandDomainAnnouncement { + da, err := unmarshalDomainAnnouncementFrame(framePayload) + if err != nil { + return nil + } + s.noteMachineGroup(da.MachineGroup, da.LocalMasterBrowserName) + netlog.Debug("[SMB][Browser] observed domain announcement group=%q master=%q", da.MachineGroup, da.LocalMasterBrowserName) + return nil + } + + s.mu.Lock() + sender := s.nbData + server := s.opts.ServerName + if server == "" { + server = "CLASSICSTACK" + } + workgroup := s.opts.Workgroup + if workgroup == "" { + workgroup = "WORKGROUP" + } + s.mu.Unlock() + if sender == nil { + return nil + } + + if cmd == browserCommandAnnouncementReq { + _, err := unmarshalAnnouncementRequestFrame(framePayload) + if err != nil { + return nil + } + announce := hostAnnouncementFrame{ + UpdateCount: 0x03, + PeriodicityMS: uint32(hostAnnouncementPeriod / time.Millisecond), + ServerName: server, + OSVersionMajor: 0x04, + OSVersionMinor: 0x00, + ServerType: browserServerTypeWorkstationMask, + BrowserVersionMajor: hostAnnouncementVersionMajor, + BrowserVersionMinor: hostAnnouncementVersionMinor, + Signature: browserSignature, + }.MarshalBinary() + response := browserMailslotTransaction{ + MailslotName: browserMailslotBrowse, + BrowserPayload: announce, + TimeoutMS: 1000, + Priority: 0, + Class: 2, + }.MarshalBinary() + if ctx.Remote != (netbios.DatagramEndpoint{}) { + netlog.Debug("[SMB][Browser] directed response cmd=0x01 src=%q dst=%q ipx=%x.%x:%02x%02x", + server, d.Source.String(), + ctx.Remote.Network, ctx.Remote.Node, ctx.Remote.Socket[0], ctx.Remote.Socket[1]) + return sender.SendDirectedDatagram(&netbiosproto.Datagram{ + Destination: d.Source, + Source: netbiosproto.NewName(server, netbiosproto.NameTypeFileServer), + Payload: response, + }, ctx.Remote) + } + return sender.SendDatagram(&netbiosproto.Datagram{ + Destination: d.Source, + Source: netbiosproto.NewName(server, netbiosproto.NameTypeFileServer), + Payload: response, + }) + } + + if cmd == browserCommandGetBackupListReq { + s.mu.Lock() + role := s.browserRole + s.mu.Unlock() + if role != browserRoleLocalMaster { + netlog.Debug("[SMB][Browser] ignoring GetBackupListRequest while role=%d", role) + return nil + } + request, err := unmarshalGetBackupListRequestFrame(framePayload) + if err != nil { + return nil + } + sourceName := backupListResponseSource(d.Destination, server, workgroup) + backupServers := s.backupServerList(server) + response := browserMailslotTransaction{ + MailslotName: browserMailslotBrowse, + BrowserPayload: getBackupListResponseFrame{ + Token: request.Token, + BackupServers: backupServers, + }.MarshalBinary(), + TimeoutMS: 1000, + Priority: 0, + Class: 2, + }.MarshalBinary() + if ctx.Remote != (netbios.DatagramEndpoint{}) { + netlog.Debug("[SMB][Browser] backup list entries=%d names=%v", len(backupServers), backupServers) + netlog.Debug("[SMB][Browser] directed response cmd=0x0a src=%q<%02x> dst=%q ipx=%x.%x:%02x%02x token=0x%08x", + sourceName.String(), sourceName.Type(), d.Source.String(), + ctx.Remote.Network, ctx.Remote.Node, ctx.Remote.Socket[0], ctx.Remote.Socket[1], + request.Token) + return sender.SendDirectedDatagram(&netbiosproto.Datagram{ + Destination: d.Source, + Source: sourceName, + Payload: response, + }, ctx.Remote) + } + netlog.Debug("[SMB][Browser] backup list entries=%d names=%s", len(backupServers), fmt.Sprintf("%v", backupServers)) + netlog.Debug("[SMB][Browser] response cmd=0x0a src=%q<%02x> dst=%q token=0x%08x", + sourceName.String(), sourceName.Type(), d.Source.String(), request.Token) + return sender.SendDatagram(&netbiosproto.Datagram{ + Destination: d.Source, + Source: sourceName, + Payload: response, + }) + } + + request, err := unmarshalRequestElectionFrame(framePayload) + if err != nil { + return nil + } + if request.ServerName == "" { + request.ServerName = d.Source.String() + } + local := s.localElectionFrame(server) + cmp := compareElection(local, *request) + netlog.Debug("[SMB][Browser] election request src=%q criteria=0x%08x uptime=%d server=%q localCriteria=0x%08x localUptime=%d cmp=%d", + d.Source.String(), request.Criteria, request.Uptime, request.ServerName, + local.Criteria, local.Uptime, cmp) + + if cmp < 0 { + s.stopElectionLoop() + s.mu.Lock() + s.browserRole = browserRolePotential + s.mu.Unlock() + netlog.Info("[SMB][Browser] election lost to server=%q criteria=0x%08x uptime=%d", request.ServerName, request.Criteria, request.Uptime) + return nil + } + + s.mu.Lock() + originRole := s.browserRole + s.mu.Unlock() + if cmp > 0 { + s.startElectionLoop(sender, server, workgroup, originRole) + } + + netlog.Debug("[SMB][Browser] election transmit #1 src=%q dst=%q criteria=0x%08x uptime=%d", + server, + workgroup, + local.Criteria, + local.Uptime, + ) + if err := s.sendElectionFrame(sender, server, workgroup, local); err != nil { + return err + } + return nil +} + +// shareEventSubscriber is the VFS bus subscriber installed by Start. +// It will (when implemented) match HostPath against share roots and +// invalidate any open handle whose backing path was renamed/deleted. +type shareEventSubscriber struct { + shares []ShareConfig +} + +// OnVFSEvent implements vfs.Subscriber. +func (s *shareEventSubscriber) OnVFSEvent(ev vfs.Event) { + if ev.Origin == originSMB { + return + } + // Stub: real invalidation lands with the open-handle map. + _ = s.shares +} diff --git a/service/smb/server_test.go b/service/smb/server_test.go new file mode 100644 index 0000000..f02dc25 --- /dev/null +++ b/service/smb/server_test.go @@ -0,0 +1,2451 @@ +package smb + +import ( + "bytes" + "context" + "encoding/binary" + "io/fs" + "os" + "path/filepath" + "strings" + "sync" + "testing" + "time" + + + + "github.com/ObsoleteMadness/ClassicStack/pkg/vfs" + netbiosproto "github.com/ObsoleteMadness/ClassicStack/protocol/netbios" + "github.com/ObsoleteMadness/ClassicStack/service/netbios" +) + +type fakeDatagramSender struct { + mu sync.Mutex + datagrams []*netbiosproto.Datagram + directed []directedDatagram +} + +type directedDatagram struct { + remote netbios.DatagramEndpoint + datagram *netbiosproto.Datagram +} + +func (f *fakeDatagramSender) SendDatagram(d *netbiosproto.Datagram) error { + f.mu.Lock() + defer f.mu.Unlock() + f.datagrams = append(f.datagrams, d) + return nil +} + +func (f *fakeDatagramSender) SendDirectedDatagram(d *netbiosproto.Datagram, remote netbios.DatagramEndpoint) error { + f.mu.Lock() + defer f.mu.Unlock() + f.directed = append(f.directed, directedDatagram{remote: remote, datagram: d}) + return nil +} + +func TestServiceLifecycleSubscribesAndUnsubscribes(t *testing.T) { + bus := vfs.NewBus(vfs.BusOptions{}) + + svc := NewService(ServerOptions{Bus: bus}, nil, []ShareConfig{ + {Name: "Public", Path: "/tmp/pub", FSType: "local_fs"}, + }) + + if err := svc.Start(context.Background()); err != nil { + t.Fatalf("Start: %v", err) + } + + // Publishing should not panic and should reach our subscriber. + bus.Publish(vfs.Event{Op: vfs.OpRename, HostPath: "/tmp/pub/a", OldPath: "/tmp/pub/b", Origin: "afp"}) + + if err := svc.Stop(); err != nil { + t.Fatalf("Stop: %v", err) + } + + // Calling Stop again must be idempotent. + if err := svc.Stop(); err != nil { + t.Fatalf("Stop (second): %v", err) + } +} + +func TestServiceShortnameOptional(t *testing.T) { + svc := NewService(ServerOptions{}, nil, nil) + if svc.opts.Shortname != nil { + t.Fatal("Shortname should be nil by default") + } +} + +func TestServiceStartSendsHostAnnouncement(t *testing.T) { + sender := &fakeDatagramSender{} + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, nil) + svc.SetDatagramSender(sender) + + if err := svc.Start(context.Background()); err != nil { + t.Fatalf("Start: %v", err) + } + defer svc.Stop() + + sender.mu.Lock() + defer sender.mu.Unlock() + if len(sender.datagrams) != 1 { + t.Fatalf("datagram count: got %d want 1", len(sender.datagrams)) + } + if len(sender.directed) != 0 { + t.Fatalf("directed datagram count: got %d want 0", len(sender.directed)) + } + var hostFrame *hostAnnouncementFrame + for _, got := range sender.datagrams { + if got.Source.String() != "CLASSICSTACK" { + t.Fatalf("source name: got %q want %q", got.Source.String(), "CLASSICSTACK") + } + if got.Destination.String() != "WORKGROUP" || got.Destination.Type() != browserNameTypeMasterBrowser { + t.Fatalf("destination mismatch: got %q<%#x> want WORKGROUP<%#x>", got.Destination.String(), got.Destination.Type(), browserNameTypeMasterBrowser) + } + tx, err := unmarshalBrowserMailslotTransaction(got.Payload) + if err != nil { + t.Fatalf("unmarshalBrowserMailslotTransaction: %v", err) + } + if tx.MailslotName != browserMailslotBrowse { + t.Fatalf("mailslot: got %q want %q", tx.MailslotName, browserMailslotBrowse) + } + if len(tx.BrowserPayload) == 0 { + continue + } + switch tx.BrowserPayload[0] { + case browserCommandHostAnnouncement: + hostFrame, err = unmarshalHostAnnouncementFrame(tx.BrowserPayload) + if err != nil { + t.Fatalf("unmarshalHostAnnouncementFrame: %v", err) + } + } + } + if hostFrame == nil { + t.Fatalf("missing host announcement frame") + } + frame := hostFrame + if frame.ServerName != "CLASSICSTACK" { + t.Fatalf("host name mismatch: got %q want CLASSICSTACK", frame.ServerName) + } + if frame.UpdateCount != 0x03 { + t.Fatalf("update count: got %#x want 0x03", frame.UpdateCount) + } + if frame.PeriodicityMS != uint32(hostAnnouncementPeriod.Milliseconds()) { + t.Fatalf("periodicity: got %d want %d", frame.PeriodicityMS, hostAnnouncementPeriod.Milliseconds()) + } + if frame.BrowserVersionMajor != hostAnnouncementVersionMajor || frame.BrowserVersionMinor != hostAnnouncementVersionMinor { + t.Fatalf("browser version: got %d.%d want %d.%d", frame.BrowserVersionMajor, frame.BrowserVersionMinor, hostAnnouncementVersionMajor, hostAnnouncementVersionMinor) + } +} + +func TestHandleDatagramObservedBackupIncludedInBackupList(t *testing.T) { + sender := &fakeDatagramSender{} + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, nil) + svc.SetDatagramSender(sender) + svc.browserRole = browserRoleLocalMaster + + host := hostAnnouncementFrame{ + UpdateCount: 0x03, + PeriodicityMS: uint32(hostAnnouncementPeriod / time.Millisecond), + ServerName: "BACKUP1", + OSVersionMajor: 0x04, + OSVersionMinor: 0x00, + ServerType: browserServerTypeWorkstationMask | browserServerTypeBackupMask, + BrowserVersionMajor: hostAnnouncementVersionMajor, + BrowserVersionMinor: hostAnnouncementVersionMinor, + Signature: browserSignature, + }.MarshalBinary() + announce := &netbiosproto.Datagram{ + Destination: netbiosproto.NewName("WORKGROUP", netbiosproto.NameTypeGroup), + Source: netbiosproto.NewName("BACKUP1", netbiosproto.NameTypeFileServer), + Payload: browserMailslotTransaction{ + MailslotName: browserMailslotBrowse, + BrowserPayload: host, + TimeoutMS: 1000, + Priority: 0, + Class: 2, + }.MarshalBinary(), + } + if err := svc.HandleDatagram(announce); err != nil { + t.Fatalf("HandleDatagram host announcement: %v", err) + } + + request := &netbiosproto.Datagram{ + Destination: netbiosproto.NewName("WORKGROUP", netbiosproto.NameTypeGroup), + Source: netbiosproto.NewName("W98CLIENT", netbiosproto.NameTypeWorkstation), + Payload: makeBrowseRequestPayload(0x11223344), + } + if err := svc.HandleDatagram(request); err != nil { + t.Fatalf("HandleDatagram backup list request: %v", err) + } + + sender.mu.Lock() + defer sender.mu.Unlock() + if len(sender.datagrams) != 1 { + t.Fatalf("datagram count: got %d want 1", len(sender.datagrams)) + } + tx, err := unmarshalBrowserMailslotTransaction(sender.datagrams[0].Payload) + if err != nil { + t.Fatalf("unmarshalBrowserMailslotTransaction: %v", err) + } + resp, err := unmarshalGetBackupListResponseFrame(tx.BrowserPayload) + if err != nil { + t.Fatalf("unmarshalGetBackupListResponseFrame: %v", err) + } + if len(resp.BackupServers) != 2 { + t.Fatalf("backup server count: got %d want 2", len(resp.BackupServers)) + } + if resp.BackupServers[0] != "CLASSICSTACK" || resp.BackupServers[1] != "BACKUP1" { + t.Fatalf("backup list mismatch: got %v want [CLASSICSTACK BACKUP1]", resp.BackupServers) + } +} + +func TestHandleDatagramGetBackupListRequestSendsResponse(t *testing.T) { + sender := &fakeDatagramSender{} + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, nil) + svc.SetDatagramSender(sender) + svc.browserRole = browserRoleLocalMaster + + in := &netbiosproto.Datagram{ + Destination: netbiosproto.NewName("WORKGROUP", netbiosproto.NameTypeGroup), + Source: netbiosproto.NewName("W98CLIENT", netbiosproto.NameTypeWorkstation), + Payload: makeBrowseRequestPayload(0x11223344), + } + if err := svc.HandleDatagram(in); err != nil { + t.Fatalf("HandleDatagram: %v", err) + } + + sender.mu.Lock() + defer sender.mu.Unlock() + if len(sender.datagrams) != 1 { + t.Fatalf("datagram count: got %d want 1", len(sender.datagrams)) + } + if len(sender.directed) != 0 { + t.Fatalf("directed datagram count: got %d want 0", len(sender.directed)) + } + got := sender.datagrams[0] + if got.Destination != in.Source { + t.Fatalf("destination mismatch") + } + if got.Source.String() != "CLASSICSTACK" || got.Source.Type() != netbiosproto.NameTypeFileServer { + t.Fatalf("source name/type: got %q<%#x> want CLASSICSTACK<%#x>", got.Source.String(), got.Source.Type(), netbiosproto.NameTypeFileServer) + } + tx, err := unmarshalBrowserMailslotTransaction(got.Payload) + if err != nil { + t.Fatalf("unmarshalBrowserMailslotTransaction: %v", err) + } + frame, err := unmarshalGetBackupListResponseFrame(tx.BrowserPayload) + if err != nil { + t.Fatalf("unmarshalGetBackupListResponseFrame: %v", err) + } + if len(frame.BackupServers) != 1 { + t.Fatalf("backup server count: got %d want 1", len(frame.BackupServers)) + } + if frame.Token != 0x11223344 { + t.Fatalf("token mismatch: got %#x want %#x", frame.Token, uint32(0x11223344)) + } + if frame.BackupServers[0] != "CLASSICSTACK" { + t.Fatalf("backup server mismatch: got %q want CLASSICSTACK", frame.BackupServers[0]) + } +} + +func TestHandleDatagramGetBackupListRequestToMasterBrowserUsesMasterSource(t *testing.T) { + sender := &fakeDatagramSender{} + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, nil) + svc.SetDatagramSender(sender) + svc.browserRole = browserRoleLocalMaster + + in := &netbiosproto.Datagram{ + Destination: netbiosproto.NewName("WORKGROUP", browserNameTypeMasterBrowser), + Source: netbiosproto.NewName("W98CLIENT", netbiosproto.NameTypeWorkstation), + Payload: makeBrowseRequestPayload(0x55667788), + } + if err := svc.HandleDatagram(in); err != nil { + t.Fatalf("HandleDatagram: %v", err) + } + + sender.mu.Lock() + defer sender.mu.Unlock() + if len(sender.datagrams) != 1 { + t.Fatalf("datagram count: got %d want 1", len(sender.datagrams)) + } + got := sender.datagrams[0] + if got.Source.String() != "WORKGROUP" || got.Source.Type() != browserNameTypeMasterBrowser { + t.Fatalf("source name/type: got %q<%#x> want WORKGROUP<%#x>", got.Source.String(), got.Source.Type(), browserNameTypeMasterBrowser) + } + tx, err := unmarshalBrowserMailslotTransaction(got.Payload) + if err != nil { + t.Fatalf("unmarshalBrowserMailslotTransaction: %v", err) + } + frame, err := unmarshalGetBackupListResponseFrame(tx.BrowserPayload) + if err != nil { + t.Fatalf("unmarshalGetBackupListResponseFrame: %v", err) + } + if frame.Token != 0x55667788 { + t.Fatalf("token mismatch: got %#x want %#x", frame.Token, uint32(0x55667788)) + } +} + +func TestHandleDatagramElectionRequestSendsParticipation(t *testing.T) { + sender := &fakeDatagramSender{} + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, nil) + svc.SetDatagramSender(sender) + svc.electionDelay = func(browserRole) time.Duration { return 20 * time.Millisecond } + defer svc.Stop() + + in := &netbiosproto.Datagram{ + Destination: netbiosproto.NewName("WORKGROUP", netbiosproto.NameTypeGroup), + Source: netbiosproto.NewName("W98CLIENT", netbiosproto.NameTypeWorkstation), + Payload: makeElectionRequestPayload(), + } + if err := svc.HandleDatagram(in); err != nil { + t.Fatalf("HandleDatagram: %v", err) + } + + sender.mu.Lock() + defer sender.mu.Unlock() + if len(sender.datagrams) != 1 { + t.Fatalf("datagram count: got %d want 1", len(sender.datagrams)) + } + if len(sender.directed) != 0 { + t.Fatalf("directed datagram count: got %d want 0", len(sender.directed)) + } + got := sender.datagrams[0] + if got.Destination != in.Destination { + t.Fatalf("destination mismatch") + } + if got.Source.String() != "CLASSICSTACK" { + t.Fatalf("source name: got %q want CLASSICSTACK", got.Source.String()) + } + tx, err := unmarshalBrowserMailslotTransaction(got.Payload) + if err != nil { + t.Fatalf("unmarshalBrowserMailslotTransaction: %v", err) + } + frame, err := unmarshalRequestElectionFrame(tx.BrowserPayload) + if err != nil { + t.Fatalf("unmarshalRequestElectionFrame: %v", err) + } + if frame.Version != browserVersionElection { + t.Fatalf("election version: got %d want %d", frame.Version, browserVersionElection) + } + if frame.Criteria != browserElectionCriteriaMasterMask { + t.Fatalf("criteria mismatch: got %#x want %#x", frame.Criteria, uint32(browserElectionCriteriaMasterMask)) + } + if frame.Uptime != 1 { + t.Fatalf("uptime mismatch: got %d want 1", frame.Uptime) + } + if frame.Reserved != 0 { + t.Fatalf("reserved election field: got %#x want 0", frame.Reserved) + } + if frame.ServerName != "CLASSICSTACK" { + t.Fatalf("server name mismatch: got %q want CLASSICSTACK", frame.ServerName) + } +} + +func TestHandleDatagramElectionRequestWinsAfterFourTransmissions(t *testing.T) { + sender := &fakeDatagramSender{} + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, nil) + svc.SetDatagramSender(sender) + svc.electionDelay = func(browserRole) time.Duration { return 2 * time.Millisecond } + defer svc.Stop() + + in := &netbiosproto.Datagram{ + Destination: netbiosproto.NewName("WORKGROUP", netbiosproto.NameTypeGroup), + Source: netbiosproto.NewName("LOWNODE", netbiosproto.NameTypeWorkstation), + Payload: makeElectionRequestPayloadWith(0x00000001, 1, "LOWNODE"), + } + if err := svc.HandleDatagram(in); err != nil { + t.Fatalf("HandleDatagram: %v", err) + } + + deadline := time.Now().Add(300 * time.Millisecond) + for { + sender.mu.Lock() + count := len(sender.datagrams) + sender.mu.Unlock() + if count >= 5 { + break + } + if time.Now().After(deadline) { + t.Fatalf("timed out waiting for election sequence; datagrams=%d", count) + } + time.Sleep(2 * time.Millisecond) + } + + sender.mu.Lock() + defer sender.mu.Unlock() + if len(sender.datagrams) < 5 { + t.Fatalf("datagram count: got %d want at least 5", len(sender.datagrams)) + } + for i := 0; i < 4; i++ { + tx, err := unmarshalBrowserMailslotTransaction(sender.datagrams[i].Payload) + if err != nil { + t.Fatalf("unmarshalBrowserMailslotTransaction[%d]: %v", i, err) + } + frame, err := unmarshalRequestElectionFrame(tx.BrowserPayload) + if err != nil { + t.Fatalf("unmarshalRequestElectionFrame[%d]: %v", i, err) + } + if frame.ServerName != "CLASSICSTACK" { + t.Fatalf("election frame server name[%d]: got %q want CLASSICSTACK", i, frame.ServerName) + } + } + lastTx, err := unmarshalBrowserMailslotTransaction(sender.datagrams[len(sender.datagrams)-1].Payload) + if err != nil { + t.Fatalf("unmarshalBrowserMailslotTransaction[last]: %v", err) + } + if len(lastTx.BrowserPayload) == 0 || lastTx.BrowserPayload[0] != browserCommandLocalMasterAnnounce { + t.Fatalf("last browser frame command: got %#x want %#x", lastTx.BrowserPayload[0], browserCommandLocalMasterAnnounce) + } +} + +func TestHandleDatagramElectionRequestLoseStopsElection(t *testing.T) { + sender := &fakeDatagramSender{} + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, nil) + svc.SetDatagramSender(sender) + svc.electionDelay = func(browserRole) time.Duration { return 40 * time.Millisecond } + defer svc.Stop() + + start := &netbiosproto.Datagram{ + Destination: netbiosproto.NewName("WORKGROUP", netbiosproto.NameTypeGroup), + Source: netbiosproto.NewName("LOWNODE", netbiosproto.NameTypeWorkstation), + Payload: makeElectionRequestPayloadWith(0x00000001, 1, "LOWNODE"), + } + if err := svc.HandleDatagram(start); err != nil { + t.Fatalf("HandleDatagram start: %v", err) + } + + lose := &netbiosproto.Datagram{ + Destination: netbiosproto.NewName("WORKGROUP", netbiosproto.NameTypeGroup), + Source: netbiosproto.NewName("WINNER", netbiosproto.NameTypeWorkstation), + Payload: makeElectionRequestPayloadWith(0x00000008, 2, "WINNER"), + } + if err := svc.HandleDatagram(lose); err != nil { + t.Fatalf("HandleDatagram lose: %v", err) + } + + time.Sleep(120 * time.Millisecond) + + sender.mu.Lock() + defer sender.mu.Unlock() + if len(sender.datagrams) != 1 { + t.Fatalf("datagram count after losing election: got %d want 1", len(sender.datagrams)) + } + tx, err := unmarshalBrowserMailslotTransaction(sender.datagrams[0].Payload) + if err != nil { + t.Fatalf("unmarshalBrowserMailslotTransaction: %v", err) + } + if len(tx.BrowserPayload) == 0 || tx.BrowserPayload[0] != browserCommandRequestElection { + t.Fatalf("first browser frame command: got %#x want %#x", tx.BrowserPayload[0], browserCommandRequestElection) + } +} + +func TestHandleDatagramContextGetBackupListRequestSendsDirectedResponse(t *testing.T) { + sender := &fakeDatagramSender{} + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, nil) + svc.SetDatagramSender(sender) + svc.browserRole = browserRoleLocalMaster + + in := &netbiosproto.Datagram{ + Destination: netbiosproto.NewName("WORKGROUP", netbiosproto.NameTypeGroup), + Source: netbiosproto.NewName("W98CLIENT", netbiosproto.NameTypeWorkstation), + Payload: makeBrowseRequestPayload(0x11223344), + } + ctx := netbios.DatagramContext{ + Remote: netbios.DatagramEndpoint{ + Network: [4]byte{0, 0, 0, 0}, + Node: [6]byte{0x08, 0x00, 0x27, 0x14, 0x74, 0x6D}, + Socket: [2]byte{0x05, 0x53}, + }, + } + if err := svc.HandleDatagramContext(in, ctx); err != nil { + t.Fatalf("HandleDatagramContext: %v", err) + } + + sender.mu.Lock() + defer sender.mu.Unlock() + if len(sender.datagrams) != 0 { + t.Fatalf("broadcast datagram count: got %d want 0", len(sender.datagrams)) + } + if len(sender.directed) != 1 { + t.Fatalf("directed datagram count: got %d want 1", len(sender.directed)) + } + got := sender.directed[0] + if got.remote != ctx.Remote { + t.Fatalf("remote endpoint mismatch") + } + if got.datagram.Source.String() != "CLASSICSTACK" || got.datagram.Source.Type() != netbiosproto.NameTypeFileServer { + t.Fatalf("source name/type: got %q<%#x> want CLASSICSTACK<%#x>", got.datagram.Source.String(), got.datagram.Source.Type(), netbiosproto.NameTypeFileServer) + } + tx, err := unmarshalBrowserMailslotTransaction(got.datagram.Payload) + if err != nil { + t.Fatalf("unmarshalBrowserMailslotTransaction: %v", err) + } + frame, err := unmarshalGetBackupListResponseFrame(tx.BrowserPayload) + if err != nil { + t.Fatalf("unmarshalGetBackupListResponseFrame: %v", err) + } + if len(frame.BackupServers) != 1 || frame.BackupServers[0] != "CLASSICSTACK" { + t.Fatalf("server name mismatch: got %v want [CLASSICSTACK]", frame.BackupServers) + } +} + +func TestHandleDatagramLegacyGetBackupListRequestPreamble(t *testing.T) { + sender := &fakeDatagramSender{} + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, nil) + svc.SetDatagramSender(sender) + svc.browserRole = browserRoleLocalMaster + + legacyPayload := append([]byte{0x01, 0x03}, getBackupListRequestFrame{RequestedCount: 2, Token: 0x11223344}.MarshalBinary()...) + in := &netbiosproto.Datagram{ + Destination: netbiosproto.NewName("WORKGROUP", netbiosproto.NameTypeGroup), + Source: netbiosproto.NewName("W98CLIENT", netbiosproto.NameTypeWorkstation), + Payload: browserMailslotTransaction{ + MailslotName: browserMailslotBrowse, + BrowserPayload: legacyPayload, + Flags: 2, + TimeoutMS: 1000, + Priority: 0, + Class: 2, + }.MarshalBinary(), + } + if err := svc.HandleDatagram(in); err != nil { + t.Fatalf("HandleDatagram: %v", err) + } + + sender.mu.Lock() + defer sender.mu.Unlock() + if len(sender.datagrams) != 1 { + t.Fatalf("datagram count: got %d want 1", len(sender.datagrams)) + } + tx, err := unmarshalBrowserMailslotTransaction(sender.datagrams[0].Payload) + if err != nil { + t.Fatalf("unmarshalBrowserMailslotTransaction: %v", err) + } + frame, err := unmarshalGetBackupListResponseFrame(tx.BrowserPayload) + if err != nil { + t.Fatalf("unmarshalGetBackupListResponseFrame: %v", err) + } + if frame.Token != 0x11223344 { + t.Fatalf("token mismatch: got %#x want %#x", frame.Token, uint32(0x11223344)) + } +} + +func TestHandleDatagramGetBackupListIgnoredWhenNotLocalMaster(t *testing.T) { + sender := &fakeDatagramSender{} + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, nil) + svc.SetDatagramSender(sender) + svc.browserRole = browserRolePotential + + in := &netbiosproto.Datagram{ + Destination: netbiosproto.NewName("WORKGROUP", netbiosproto.NameTypeGroup), + Source: netbiosproto.NewName("W98CLIENT", netbiosproto.NameTypeWorkstation), + Payload: makeBrowseRequestPayload(0x11223344), + } + if err := svc.HandleDatagram(in); err != nil { + t.Fatalf("HandleDatagram: %v", err) + } + + sender.mu.Lock() + defer sender.mu.Unlock() + if len(sender.datagrams) != 0 || len(sender.directed) != 0 { + t.Fatalf("expected no response while not local master; got datagrams=%d directed=%d", len(sender.datagrams), len(sender.directed)) + } +} + +func TestHandleDatagramLegacyGetBackupListRequestPreambleWithPadding(t *testing.T) { + sender := &fakeDatagramSender{} + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, nil) + svc.SetDatagramSender(sender) + svc.browserRole = browserRoleLocalMaster + + padded := append(getBackupListRequestFrame{RequestedCount: 2, Token: 0xA1B2C3D4}.MarshalBinary(), 0x00) + legacyPayload := append([]byte{0x01, 0x03}, padded...) + in := &netbiosproto.Datagram{ + Destination: netbiosproto.NewName("WORKGROUP", netbiosproto.NameTypeGroup), + Source: netbiosproto.NewName("W98CLIENT", netbiosproto.NameTypeWorkstation), + Payload: browserMailslotTransaction{ + MailslotName: browserMailslotBrowse, + BrowserPayload: legacyPayload, + Flags: 2, + TimeoutMS: 1000, + Priority: 0, + Class: 2, + }.MarshalBinary(), + } + if err := svc.HandleDatagram(in); err != nil { + t.Fatalf("HandleDatagram: %v", err) + } + + sender.mu.Lock() + defer sender.mu.Unlock() + if len(sender.datagrams) != 1 { + t.Fatalf("datagram count: got %d want 1", len(sender.datagrams)) + } + tx, err := unmarshalBrowserMailslotTransaction(sender.datagrams[0].Payload) + if err != nil { + t.Fatalf("unmarshalBrowserMailslotTransaction: %v", err) + } + frame, err := unmarshalGetBackupListResponseFrame(tx.BrowserPayload) + if err != nil { + t.Fatalf("unmarshalGetBackupListResponseFrame: %v", err) + } + if frame.Token != 0xA1B2C3D4 { + t.Fatalf("token mismatch: got %#x want %#x", frame.Token, uint32(0xA1B2C3D4)) + } +} + +func TestHandleDatagramAnnouncementRequestSendsHostAnnouncement(t *testing.T) { + sender := &fakeDatagramSender{} + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, nil) + svc.SetDatagramSender(sender) + + request := append([]byte{browserCommandAnnouncementReq, 0x00}, []byte("W98CLIENT\x00")...) + in := &netbiosproto.Datagram{ + Destination: netbiosproto.NewName("WORKGROUP", netbiosproto.NameTypeGroup), + Source: netbiosproto.NewName("W98CLIENT", netbiosproto.NameTypeWorkstation), + Payload: browserMailslotTransaction{ + MailslotName: browserMailslotBrowse, + BrowserPayload: request, + Flags: 2, + TimeoutMS: 1000, + Priority: 0, + Class: 2, + }.MarshalBinary(), + } + if err := svc.HandleDatagram(in); err != nil { + t.Fatalf("HandleDatagram: %v", err) + } + + sender.mu.Lock() + defer sender.mu.Unlock() + if len(sender.datagrams) != 1 { + t.Fatalf("datagram count: got %d want 1", len(sender.datagrams)) + } + tx, err := unmarshalBrowserMailslotTransaction(sender.datagrams[0].Payload) + if err != nil { + t.Fatalf("unmarshalBrowserMailslotTransaction: %v", err) + } + frame, err := unmarshalHostAnnouncementFrame(tx.BrowserPayload) + if err != nil { + t.Fatalf("unmarshalHostAnnouncementFrame: %v", err) + } + if frame.ServerName != "CLASSICSTACK" { + t.Fatalf("server name mismatch: got %q want CLASSICSTACK", frame.ServerName) + } +} + +func TestBrowserFrameRoundTrips(t *testing.T) { + hostWire := hostAnnouncementFrame{ + UpdateCount: 0, + PeriodicityMS: 120000, + ServerName: "ClassicStack", + OSVersionMajor: 4, + OSVersionMinor: 0, + ServerType: browserServerTypeWorkstationMask, + BrowserVersionMajor: browserVersionMajor, + BrowserVersionMinor: browserVersionMinor, + Signature: browserSignature, + }.MarshalBinary() + host, err := unmarshalHostAnnouncementFrame(hostWire) + if err != nil { + t.Fatalf("unmarshalHostAnnouncementFrame: %v", err) + } + if host.ServerName != "CLASSICSTACK" { + t.Fatalf("host round-trip server: got %q want CLASSICSTACK", host.ServerName) + } + + localWire := localMasterAnnouncementFrame{ + UpdateCount: 0, + PeriodicityMS: 120000, + ServerName: "ClassicStack", + OSVersionMajor: 4, + OSVersionMinor: 0, + ServerType: browserServerTypeWorkstationMask | browserServerTypeMasterMask, + BrowserConfigVersionMajor: browserVersionMajor, + BrowserConfigVersionMinor: browserVersionMinor, + Signature: browserSignature, + }.MarshalBinary() + local, err := unmarshalLocalMasterAnnouncementFrame(localWire) + if err != nil { + t.Fatalf("unmarshalLocalMasterAnnouncementFrame: %v", err) + } + if local.ServerName != "CLASSICSTACK" { + t.Fatalf("local master round-trip server: got %q want CLASSICSTACK", local.ServerName) + } + + electionWire := requestElectionFrame{ + Version: browserVersionElection, + Criteria: browserElectionCriteriaMasterMask, + Uptime: 1, + Reserved: 0, + ServerName: "ClassicStack", + }.MarshalBinary() + election, err := unmarshalRequestElectionFrame(electionWire) + if err != nil { + t.Fatalf("unmarshalRequestElectionFrame: %v", err) + } + if election.ServerName != "CLASSICSTACK" { + t.Fatalf("election round-trip server: got %q want CLASSICSTACK", election.ServerName) + } + + responseWire := getBackupListResponseFrame{ + Token: 0x11223344, + BackupServers: []string{"ClassicStack"}, + }.MarshalBinary() + response, err := unmarshalGetBackupListResponseFrame(responseWire) + if err != nil { + t.Fatalf("unmarshalGetBackupListResponseFrame: %v", err) + } + if len(response.BackupServers) != 1 || response.BackupServers[0] != "CLASSICSTACK" { + t.Fatalf("backup response round-trip: got %v want [CLASSICSTACK]", response.BackupServers) + } +} + +func TestBrowserMailslotTransactionRoundTrip(t *testing.T) { + txWire := browserMailslotTransaction{ + MailslotName: browserMailslotBrowse, + BrowserPayload: getBackupListRequestFrame{RequestedCount: 2, Token: 0x11223344}.MarshalBinary(), + Flags: 2, + TimeoutMS: 1000, + Priority: 0, + Class: 2, + }.MarshalBinary() + tx, err := unmarshalBrowserMailslotTransaction(txWire) + if err != nil { + t.Fatalf("unmarshalBrowserMailslotTransaction: %v", err) + } + if tx.MailslotName != browserMailslotBrowse { + t.Fatalf("mailslot mismatch: got %q want %q", tx.MailslotName, browserMailslotBrowse) + } + request, err := unmarshalGetBackupListRequestFrame(tx.BrowserPayload) + if err != nil { + t.Fatalf("unmarshalGetBackupListRequestFrame: %v", err) + } + if request.Token != 0x11223344 || request.RequestedCount != 2 { + t.Fatalf("request mismatch: got count=%d token=%#x", request.RequestedCount, request.Token) + } +} + +func TestHandleSessionContextLANMANTransactionReturnsResponse(t *testing.T) { + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, nil) + packet := &netbiosproto.SessionPacket{ + Type: netbiosproto.SessionMessage, + Payload: makeLANMANTransactionSessionPayload(), + } + resp, err := svc.HandleSessionContext(packet, netbios.SessionContext{}) + if err != nil { + t.Fatalf("HandleSessionContext: %v", err) + } + if resp == nil { + t.Fatalf("expected response packet") + } + if resp.Type != netbiosproto.SessionMessage { + t.Fatalf("response type: got %#x want %#x", resp.Type, netbiosproto.SessionMessage) + } + if len(resp.Payload) < 33 || string(resp.Payload[0:4]) != "\xffSMB" { + t.Fatalf("invalid SMB response payload") + } + if resp.Payload[4] != CommandTransaction { + t.Fatalf("response command: got %#x want %#x", resp.Payload[4], CommandTransaction) + } +} + +func makeBrowseRequestPayload(token uint32) []byte { + return browserMailslotTransaction{ + MailslotName: browserMailslotBrowse, + BrowserPayload: getBackupListRequestFrame{RequestedCount: 2, Token: token}.MarshalBinary(), + Flags: 2, + TimeoutMS: 1000, + Priority: 0, + Class: 2, + }.MarshalBinary() +} + +func makeElectionRequestPayload() []byte { + return browserMailslotTransaction{ + MailslotName: browserMailslotBrowse, + BrowserPayload: requestElectionFrame{ + Version: browserVersionElection, + Criteria: 0, + Uptime: 0, + Reserved: 0, + ServerName: "W98CLIENT", + }.MarshalBinary(), + Flags: 2, + TimeoutMS: 1000, + Priority: 0, + Class: 2, + }.MarshalBinary() +} + +func makeElectionRequestPayloadWith(criteria, uptime uint32, server string) []byte { + return browserMailslotTransaction{ + MailslotName: browserMailslotBrowse, + BrowserPayload: requestElectionFrame{ + Version: browserVersionElection, + Criteria: criteria, + Uptime: uptime, + Reserved: 0, + ServerName: server, + }.MarshalBinary(), + Flags: 2, + TimeoutMS: 1000, + Priority: 0, + Class: 2, + }.MarshalBinary() +} + +func makeLANMANTransactionSessionPayload() []byte { + pipe := []byte("\\PIPE\\LANMAN\x00") + out := make([]byte, 69+len(pipe)) + copy(out[0:4], []byte{0xff, 'S', 'M', 'B'}) + out[4] = CommandTransaction + out[32] = 17 + binary.LittleEndian.PutUint16(out[67:69], uint16(len(pipe))) + copy(out[69:], pipe) + return out +} + +func makeNegotiatePayload() []byte { + dialects := []byte("\x02PC NETWORK PROGRAM 1.0\x00\x02LANMAN1.0\x00\x02NT LM 0.12\x00") + out := make([]byte, smbHeaderLen+1+2+len(dialects)) + copy(out[0:4], []byte{0xff, 'S', 'M', 'B'}) + out[4] = CommandNegotiate + // WCT = 0 + binary.LittleEndian.PutUint16(out[smbHeaderLen+1:smbHeaderLen+3], uint16(len(dialects))) + copy(out[smbHeaderLen+3:], dialects) + return out +} + +func makeSessionSetupPayload() []byte { + out := make([]byte, smbHeaderLen+1+2) + copy(out[0:4], []byte{0xff, 'S', 'M', 'B'}) + out[4] = CommandSessionSetupAndX + return out +} + +func makeTreeConnectPayload() []byte { + return makeTreeConnectSharePayload("\\\\SERVER\\IPC$") +} + +// makeTreeConnectSharePayload builds a minimal SMB_COM_TREE_CONNECT_ANDX +// request whose bytes-area contains the given UNC share path followed by +// the service identifier "?????". +func makeTreeConnectSharePayload(uncPath string) []byte { + path := append([]byte(uncPath), 0) + service := []byte("?????\x00") + byteCount := len(path) + len(service) + // WCT=4: AndXCommand+AndXReserved+AndXOffset+Flags+PasswordLength (8 bytes) + out := make([]byte, smbHeaderLen+1+8+2+byteCount) + copy(out[0:4], []byte{0xff, 'S', 'M', 'B'}) + out[4] = CommandTreeConnectAndX + out[smbHeaderLen] = 4 // WCT + w := out[smbHeaderLen+1:] + w[0] = 0xFF // AndXCommand = no chaining + binary.LittleEndian.PutUint16(w[8:10], uint16(byteCount)) + copy(w[10:], path) + copy(w[10+len(path):], service) + return out +} + +func makeNetServerEnum2Payload() []byte { + // bytes area: \PIPE\LANMAN\0 (13 bytes) + FunctionCode 0x0068 (2 bytes) + bytesArea := append([]byte("\\PIPE\\LANMAN\x00"), 0x68, 0x00) + out := make([]byte, 69+len(bytesArea)) + copy(out[0:4], []byte{0xff, 'S', 'M', 'B'}) + out[4] = CommandTransaction + out[32] = 17 + binary.LittleEndian.PutUint16(out[67:69], uint16(len(bytesArea))) + copy(out[69:], bytesArea) + return out +} + +func makeNetServerEnum2DomainEnumPayload() []byte { + bytesArea := []byte("\\PIPE\\LANMAN\x00") + bytesArea = append(bytesArea, 0x68, 0x00) // FunctionCode + bytesArea = append(bytesArea, []byte("WrLehDz\x00")...) // ParamDesc + bytesArea = append(bytesArea, []byte("B16BBDz\x00")...) // DataDesc + bytesArea = append(bytesArea, 0xff, 0xff) // ReceiveBufferLength + bytesArea = append(bytesArea, 0x00, 0x00, 0x00, 0x80) // ServerType = SV_TYPE_DOMAIN_ENUM + bytesArea = append(bytesArea, []byte("WORKGROUP\x00")...) // Domain + + out := make([]byte, 69+len(bytesArea)) + copy(out[0:4], []byte{0xff, 'S', 'M', 'B'}) + out[4] = CommandTransaction + out[32] = 17 + binary.LittleEndian.PutUint16(out[67:69], uint16(len(bytesArea))) + copy(out[69:], bytesArea) + return out +} + +func TestHandleSessionContextEchoCountZeroReturnsNoResponse(t *testing.T) { + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, nil) + packet := &netbiosproto.SessionPacket{ + Type: netbiosproto.SessionMessage, + Payload: makeEchoPayloadWith(0x0001, 0), + } + resp, err := svc.HandleSessionContext(packet, netbios.SessionContext{}) + if err != nil { + t.Fatalf("HandleSessionContext: %v", err) + } + if resp != nil { + t.Fatalf("expected nil response for EchoCount=0") + } +} + +func TestHandleSessionContextEchoInvalidTIDReturnsBadTID(t *testing.T) { + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, nil) + packet := &netbiosproto.SessionPacket{ + Type: netbiosproto.SessionMessage, + Payload: makeEchoPayloadWith(0x0002, 1), + } + resp, err := svc.HandleSessionContext(packet, netbios.SessionContext{}) + if err != nil { + t.Fatalf("HandleSessionContext: %v", err) + } + if resp == nil || len(resp.Payload) < smbHeaderLen { + t.Fatalf("expected SMB error response") + } + status := binary.LittleEndian.Uint32(resp.Payload[smbOffStatus : smbOffStatus+4]) + if status != smbStatusBadTID { + t.Fatalf("status mismatch: got %#x want %#x", status, uint32(smbStatusBadTID)) + } +} + +func makeEchoPayload(data []byte) []byte { + out := make([]byte, smbHeaderLen+1+2+2+len(data)) + copy(out[0:4], []byte{0xff, 'S', 'M', 'B'}) + out[4] = CommandEcho + binary.LittleEndian.PutUint16(out[smbOffTID:smbOffTID+2], 1) + out[smbHeaderLen] = 1 // WCT + binary.LittleEndian.PutUint16(out[smbHeaderLen+1:smbHeaderLen+3], 1) + binary.LittleEndian.PutUint16(out[smbHeaderLen+3:smbHeaderLen+5], uint16(len(data))) + copy(out[smbHeaderLen+5:], data) + return out +} + +func makeEchoPayloadWith(tid uint16, echoCount uint16) []byte { + data := []byte("echo") + out := make([]byte, smbHeaderLen+1+2+2+len(data)) + copy(out[0:4], []byte{0xff, 'S', 'M', 'B'}) + out[4] = CommandEcho + binary.LittleEndian.PutUint16(out[smbOffTID:smbOffTID+2], tid) + out[smbHeaderLen] = 1 + binary.LittleEndian.PutUint16(out[smbHeaderLen+1:smbHeaderLen+3], echoCount) + binary.LittleEndian.PutUint16(out[smbHeaderLen+3:smbHeaderLen+5], uint16(len(data))) + copy(out[smbHeaderLen+5:], data) + return out +} + +func makeTreeDisconnectPayload() []byte { + out := make([]byte, smbHeaderLen+1+2) + copy(out[0:4], []byte{0xff, 'S', 'M', 'B'}) + out[4] = CommandTreeDisconnect + out[smbHeaderLen] = 0 + binary.LittleEndian.PutUint16(out[smbHeaderLen+1:smbHeaderLen+3], 0) + return out +} + +func TestHandleSessionContextNegotiateReturnsNTLMDialect(t *testing.T) { + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, nil) + packet := &netbiosproto.SessionPacket{ + Type: netbiosproto.SessionMessage, + Payload: makeNegotiatePayload(), + } + resp, err := svc.HandleSessionContext(packet, netbios.SessionContext{}) + if err != nil { + t.Fatalf("HandleSessionContext: %v", err) + } + if resp == nil { + t.Fatal("expected response") + } + if resp.Payload[4] != CommandNegotiate { + t.Fatalf("cmd: got %#x want %#x", resp.Payload[4], CommandNegotiate) + } + if resp.Payload[smbHeaderLen] != 17 { + t.Fatalf("WCT: got %d want 17", resp.Payload[smbHeaderLen]) + } + if binary.LittleEndian.Uint32(resp.Payload[smbOffStatus:smbOffStatus+4]) != smbStatusSuccess { + t.Fatalf("status: not success") + } + // Dialect index 2 = "NT LM 0.12" (third in the list) + dialectIdx := binary.LittleEndian.Uint16(resp.Payload[smbHeaderLen+1 : smbHeaderLen+3]) + if dialectIdx != 2 { + t.Fatalf("dialectIdx: got %d want 2", dialectIdx) + } +} + +func TestHandleSessionContextSessionSetupReturnsGuestLogon(t *testing.T) { + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, nil) + packet := &netbiosproto.SessionPacket{ + Type: netbiosproto.SessionMessage, + Payload: makeSessionSetupPayload(), + } + resp, err := svc.HandleSessionContext(packet, netbios.SessionContext{}) + if err != nil { + t.Fatalf("HandleSessionContext: %v", err) + } + if resp == nil { + t.Fatal("expected response") + } + if resp.Payload[4] != CommandSessionSetupAndX { + t.Fatalf("cmd: got %#x want %#x", resp.Payload[4], CommandSessionSetupAndX) + } + if binary.LittleEndian.Uint32(resp.Payload[smbOffStatus:smbOffStatus+4]) != smbStatusSuccess { + t.Fatalf("status: not success") + } + uid := binary.LittleEndian.Uint16(resp.Payload[smbOffUID : smbOffUID+2]) + if uid == 0 { + t.Fatal("UID should be non-zero for guest session") + } + // Action word: smbHeaderLen+1 (WCT) + 4 bytes (AndXCommand/Rsv/Offset) = smbHeaderLen+5 + action := binary.LittleEndian.Uint16(resp.Payload[smbHeaderLen+5 : smbHeaderLen+7]) + if action&0x0001 == 0 { + t.Fatal("expected guest logon action bit set") + } +} + +func TestHandleSessionContextTreeConnectReturnsIPC(t *testing.T) { + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, nil) + packet := &netbiosproto.SessionPacket{ + Type: netbiosproto.SessionMessage, + Payload: makeTreeConnectPayload(), + } + resp, err := svc.HandleSessionContext(packet, netbios.SessionContext{}) + if err != nil { + t.Fatalf("HandleSessionContext: %v", err) + } + if resp == nil { + t.Fatal("expected response") + } + if resp.Payload[4] != CommandTreeConnectAndX { + t.Fatalf("cmd: got %#x want %#x", resp.Payload[4], CommandTreeConnectAndX) + } + if binary.LittleEndian.Uint32(resp.Payload[smbOffStatus:smbOffStatus+4]) != smbStatusSuccess { + t.Fatalf("status: not success (got %#x)", binary.LittleEndian.Uint32(resp.Payload[smbOffStatus:smbOffStatus+4])) + } + tid := binary.LittleEndian.Uint16(resp.Payload[smbOffTID : smbOffTID+2]) + if tid == 0 { + t.Fatal("TID should be non-zero after tree connect") + } + // Service string should be "IPC" for IPC$ connections. + wct := int(resp.Payload[smbHeaderLen]) + bytesOff := smbHeaderLen + 1 + wct*2 + if bytesOff+2 < len(resp.Payload) { + bc := int(binary.LittleEndian.Uint16(resp.Payload[bytesOff : bytesOff+2])) + if bytesOff+2+bc <= len(resp.Payload) { + service := string(resp.Payload[bytesOff+2 : bytesOff+2+bc]) + if !strings.HasPrefix(service, "IPC") { + t.Fatalf("service: got %q, want prefix \"IPC\"", service) + } + } + } +} + +func TestHandleSessionContextTreeConnectUnknownShareReturnsError(t *testing.T) { + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, nil) + packet := &netbiosproto.SessionPacket{ + Type: netbiosproto.SessionMessage, + Payload: makeTreeConnectSharePayload("\\\\SERVER\\NOEXIST"), + } + resp, err := svc.HandleSessionContext(packet, netbios.SessionContext{}) + if err != nil { + t.Fatalf("HandleSessionContext: %v", err) + } + if resp == nil { + t.Fatal("expected response") + } + if binary.LittleEndian.Uint32(resp.Payload[smbOffStatus:smbOffStatus+4]) != smbStatusErrInvNetName { + t.Fatalf("status: got %#x, want ERRDOS/ERRinvnetname (%#x)", + binary.LittleEndian.Uint32(resp.Payload[smbOffStatus:smbOffStatus+4]), smbStatusErrInvNetName) + } +} + +func TestHandleSessionContextNetServerEnum2ReturnsSelf(t *testing.T) { + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, nil) + svc.browserRole = browserRoleLocalMaster + packet := &netbiosproto.SessionPacket{ + Type: netbiosproto.SessionMessage, + Payload: makeNetServerEnum2Payload(), + } + resp, err := svc.HandleSessionContext(packet, netbios.SessionContext{}) + if err != nil { + t.Fatalf("HandleSessionContext: %v", err) + } + if resp == nil { + t.Fatal("expected response") + } + if resp.Payload[4] != CommandTransaction { + t.Fatalf("cmd: got %#x want %#x", resp.Payload[4], CommandTransaction) + } + if resp.Payload[smbHeaderLen] != 10 { + t.Fatalf("WCT: got %d want 10", resp.Payload[smbHeaderLen]) + } + // Extract ParameterOffset from word block. + paramCount := int(binary.LittleEndian.Uint16(resp.Payload[smbHeaderLen+1+6 : smbHeaderLen+1+8])) + paramOffset := int(binary.LittleEndian.Uint16(resp.Payload[smbHeaderLen+1+8 : smbHeaderLen+1+10])) + if paramOffset+paramCount > len(resp.Payload) { + t.Fatalf("param block out of bounds: count=%d offset=%d len=%d", paramCount, paramOffset, len(resp.Payload)) + } + p := resp.Payload[paramOffset : paramOffset+paramCount] + status := binary.LittleEndian.Uint16(p[0:2]) + if status != 0 { + t.Fatalf("RAP status: got %d want 0", status) + } + entriesReturned := binary.LittleEndian.Uint16(p[4:6]) + if entriesReturned == 0 { + t.Fatal("expected at least one server entry in NetServerEnum2 response") + } +} + +func TestHandleSessionContextEchoReturnsPayload(t *testing.T) { + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, nil) + payload := []byte("ping") + packet := &netbiosproto.SessionPacket{ + Type: netbiosproto.SessionMessage, + Payload: makeEchoPayload(payload), + } + resp, err := svc.HandleSessionContext(packet, netbios.SessionContext{}) + if err != nil { + t.Fatalf("HandleSessionContext: %v", err) + } + if resp == nil { + t.Fatal("expected response") + } + if resp.Payload[4] != CommandEcho { + t.Fatalf("cmd: got %#x want %#x", resp.Payload[4], CommandEcho) + } + if binary.LittleEndian.Uint32(resp.Payload[smbOffStatus:smbOffStatus+4]) != smbStatusSuccess { + t.Fatalf("status: not success") + } + if resp.Payload[smbHeaderLen] != 1 { + t.Fatalf("WCT: got %d want 1", resp.Payload[smbHeaderLen]) + } + seq := binary.LittleEndian.Uint16(resp.Payload[smbHeaderLen+1 : smbHeaderLen+3]) + if seq != 1 { + t.Fatalf("echo sequence: got %d want 1", seq) + } + bc := int(binary.LittleEndian.Uint16(resp.Payload[smbHeaderLen+3 : smbHeaderLen+5])) + if bc != len(payload) { + t.Fatalf("byte count: got %d want %d", bc, len(payload)) + } + if string(resp.Payload[smbHeaderLen+5:smbHeaderLen+5+bc]) != string(payload) { + t.Fatalf("echo payload mismatch") + } +} + +func TestHandleSessionContextNetServerEnum2DomainEnumReturnsWorkgroup(t *testing.T) { + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, nil) + svc.browserRole = browserRoleLocalMaster + packet := &netbiosproto.SessionPacket{ + Type: netbiosproto.SessionMessage, + Payload: makeNetServerEnum2DomainEnumPayload(), + } + resp, err := svc.HandleSessionContext(packet, netbios.SessionContext{}) + if err != nil { + t.Fatalf("HandleSessionContext: %v", err) + } + if resp == nil { + t.Fatal("expected response") + } + if resp.Payload[4] != CommandTransaction { + t.Fatalf("cmd: got %#x want %#x", resp.Payload[4], CommandTransaction) + } + if binary.LittleEndian.Uint32(resp.Payload[smbOffStatus:smbOffStatus+4]) != smbStatusSuccess { + t.Fatalf("status: not success") + } + + paramCount := int(binary.LittleEndian.Uint16(resp.Payload[smbHeaderLen+1+6 : smbHeaderLen+1+8])) + paramOffset := int(binary.LittleEndian.Uint16(resp.Payload[smbHeaderLen+1+8 : smbHeaderLen+1+10])) + dataCount := int(binary.LittleEndian.Uint16(resp.Payload[smbHeaderLen+1+12 : smbHeaderLen+1+14])) + dataOffset := int(binary.LittleEndian.Uint16(resp.Payload[smbHeaderLen+1+14 : smbHeaderLen+1+16])) + if paramOffset+paramCount > len(resp.Payload) || dataOffset+dataCount > len(resp.Payload) { + t.Fatalf("response blocks out of bounds") + } + p := resp.Payload[paramOffset : paramOffset+paramCount] + entriesReturned := binary.LittleEndian.Uint16(p[4:6]) + if entriesReturned != 1 { + t.Fatalf("entries returned: got %d want 1", entriesReturned) + } + d := resp.Payload[dataOffset : dataOffset+dataCount] + if string(d[0:9]) != "WORKGROUP" { + t.Fatalf("domain entry name: got %q want %q", string(d[0:9]), "WORKGROUP") + } + serverType := binary.LittleEndian.Uint32(d[18:22]) + if serverType != browserServerTypeDomainEnumMask { + t.Fatalf("domain entry type: got %#x want %#x", serverType, uint32(browserServerTypeDomainEnumMask)) + } +} + +func TestHandleSessionContextNetServerEnum2PotentialBrowserReturnsReqNotAccepted(t *testing.T) { + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, nil) + // browserRole defaults to browserRolePotential — must refuse. + packet := &netbiosproto.SessionPacket{ + Type: netbiosproto.SessionMessage, + Payload: makeNetServerEnum2Payload(), + } + resp, err := svc.HandleSessionContext(packet, netbios.SessionContext{}) + if err != nil { + t.Fatalf("HandleSessionContext: %v", err) + } + if resp == nil { + t.Fatal("expected response") + } + paramCount := int(binary.LittleEndian.Uint16(resp.Payload[smbHeaderLen+1+6 : smbHeaderLen+1+8])) + paramOffset := int(binary.LittleEndian.Uint16(resp.Payload[smbHeaderLen+1+8 : smbHeaderLen+1+10])) + if paramOffset+paramCount > len(resp.Payload) { + t.Fatalf("param block out of bounds") + } + rapStatus := binary.LittleEndian.Uint16(resp.Payload[paramOffset : paramOffset+2]) + if rapStatus != uint16(rapStatusErrReqNotAccepted) { + t.Fatalf("RAP status: got %d want %d (ERROR_REQ_NOT_ACCEP)", rapStatus, rapStatusErrReqNotAccepted) + } +} + +func TestHandleSessionContextNetServerEnum2DomainEnumPlusOtherBitsReturnsInvalidFunction(t *testing.T) { + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, nil) + svc.browserRole = browserRoleLocalMaster + // SV_TYPE_DOMAIN_ENUM | SV_TYPE_WORKSTATION — invalid combination per spec §3.3.5.6. + mixedType := uint32(browserServerTypeDomainEnumMask | 0x01) + payload := makeNetServerEnum2PayloadWithServerType(mixedType) + packet := &netbiosproto.SessionPacket{Type: netbiosproto.SessionMessage, Payload: payload} + resp, err := svc.HandleSessionContext(packet, netbios.SessionContext{}) + if err != nil { + t.Fatalf("HandleSessionContext: %v", err) + } + if resp == nil { + t.Fatal("expected response") + } + paramCount := int(binary.LittleEndian.Uint16(resp.Payload[smbHeaderLen+1+6 : smbHeaderLen+1+8])) + paramOffset := int(binary.LittleEndian.Uint16(resp.Payload[smbHeaderLen+1+8 : smbHeaderLen+1+10])) + if paramOffset+paramCount > len(resp.Payload) { + t.Fatalf("param block out of bounds") + } + rapStatus := binary.LittleEndian.Uint16(resp.Payload[paramOffset : paramOffset+2]) + if rapStatus != uint16(rapStatusErrInvalidFunction) { + t.Fatalf("RAP status: got %d want %d (ERROR_INVALID_FUNCTION)", rapStatus, rapStatusErrInvalidFunction) + } +} + +func TestHandleSessionContextNetServerEnum2DomainEnumTracksObservedGroups(t *testing.T) { + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, nil) + svc.browserRole = browserRoleLocalMaster + // Simulate having observed a DomainAnnouncement from another workgroup. + svc.noteMachineGroup("OTHERGROUP", "OTHERMASTER") + packet := &netbiosproto.SessionPacket{ + Type: netbiosproto.SessionMessage, + Payload: makeNetServerEnum2DomainEnumPayload(), + } + resp, err := svc.HandleSessionContext(packet, netbios.SessionContext{}) + if err != nil { + t.Fatalf("HandleSessionContext: %v", err) + } + if resp == nil { + t.Fatal("expected response") + } + paramCount := int(binary.LittleEndian.Uint16(resp.Payload[smbHeaderLen+1+6 : smbHeaderLen+1+8])) + paramOffset := int(binary.LittleEndian.Uint16(resp.Payload[smbHeaderLen+1+8 : smbHeaderLen+1+10])) + p := resp.Payload[paramOffset : paramOffset+paramCount] + entriesReturned := int(binary.LittleEndian.Uint16(p[4:6])) + if entriesReturned != 2 { + t.Fatalf("entries returned: got %d want 2 (WORKGROUP + OTHERGROUP)", entriesReturned) + } +} + +func TestHandleSessionContextNetServerEnum2DomainFilterExcludesWrongDomain(t *testing.T) { + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, nil) + svc.browserRole = browserRoleLocalMaster + // Request servers in "OTHERGROUP" — we don't serve that domain, expect empty success. + payload := makeNetServerEnum2PayloadWithDomain(0x00000003, "OTHERGROUP") + packet := &netbiosproto.SessionPacket{Type: netbiosproto.SessionMessage, Payload: payload} + resp, err := svc.HandleSessionContext(packet, netbios.SessionContext{}) + if err != nil { + t.Fatalf("HandleSessionContext: %v", err) + } + if resp == nil { + t.Fatal("expected response") + } + paramCount := int(binary.LittleEndian.Uint16(resp.Payload[smbHeaderLen+1+6 : smbHeaderLen+1+8])) + paramOffset := int(binary.LittleEndian.Uint16(resp.Payload[smbHeaderLen+1+8 : smbHeaderLen+1+10])) + p := resp.Payload[paramOffset : paramOffset+paramCount] + rapStatus := binary.LittleEndian.Uint16(p[0:2]) + if rapStatus != 0 { + t.Fatalf("RAP status: got %d want 0 (empty success)", rapStatus) + } + entriesReturned := binary.LittleEndian.Uint16(p[4:6]) + if entriesReturned != 0 { + t.Fatalf("entries returned: got %d want 0 (filtered out)", entriesReturned) + } +} + +func makeNetServerEnum2PayloadWithServerType(serverType uint32) []byte { + bytesArea := []byte("\\PIPE\\LANMAN\x00") + bytesArea = append(bytesArea, 0x68, 0x00) // FunctionCode 0x0068 + bytesArea = append(bytesArea, []byte("WrLehDz\x00")...) // ParamDesc + bytesArea = append(bytesArea, []byte("B16BBDz\x00")...) // DataDesc + bytesArea = append(bytesArea, 0xff, 0xff) // ReceiveBufferLength + var stBytes [4]byte + binary.LittleEndian.PutUint32(stBytes[:], serverType) + bytesArea = append(bytesArea, stBytes[:]...) + out := make([]byte, 69+len(bytesArea)) + copy(out[0:4], []byte{0xff, 'S', 'M', 'B'}) + out[4] = CommandTransaction + out[32] = 17 + binary.LittleEndian.PutUint16(out[67:69], uint16(len(bytesArea))) + copy(out[69:], bytesArea) + return out +} + +func makeNetServerEnum2PayloadWithDomain(serverType uint32, domain string) []byte { + bytesArea := []byte("\\PIPE\\LANMAN\x00") + bytesArea = append(bytesArea, 0x68, 0x00) // FunctionCode + bytesArea = append(bytesArea, []byte("WrLehDz\x00")...) // ParamDesc + bytesArea = append(bytesArea, []byte("B16BBDz\x00")...) // DataDesc + bytesArea = append(bytesArea, 0xff, 0xff) // ReceiveBufferLength + var stBytes [4]byte + binary.LittleEndian.PutUint32(stBytes[:], serverType) + bytesArea = append(bytesArea, stBytes[:]...) + bytesArea = append(bytesArea, []byte(domain)...) + bytesArea = append(bytesArea, 0x00) + out := make([]byte, 69+len(bytesArea)) + copy(out[0:4], []byte{0xff, 'S', 'M', 'B'}) + out[4] = CommandTransaction + out[32] = 17 + binary.LittleEndian.PutUint16(out[67:69], uint16(len(bytesArea))) + copy(out[69:], bytesArea) + return out +} + +func makeNetShareEnumPayload() []byte { + // bytes area: \PIPE\LANMAN\0 (13 bytes) + FunctionCode 0x0000 (2 bytes) + bytesArea := append([]byte("\\PIPE\\LANMAN\x00"), 0x00, 0x00) + out := make([]byte, 69+len(bytesArea)) + copy(out[0:4], []byte{0xff, 'S', 'M', 'B'}) + out[4] = CommandTransaction + out[32] = 17 + binary.LittleEndian.PutUint16(out[67:69], uint16(len(bytesArea))) + copy(out[69:], bytesArea) + return out +} + +func TestHandleSessionContextNetShareEnumReturnsIPCWhenNoShares(t *testing.T) { + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, nil) + packet := &netbiosproto.SessionPacket{ + Type: netbiosproto.SessionMessage, + Payload: makeNetShareEnumPayload(), + } + resp, err := svc.HandleSessionContext(packet, netbios.SessionContext{}) + if err != nil { + t.Fatalf("HandleSessionContext: %v", err) + } + if resp == nil { + t.Fatal("expected response") + } + if resp.Payload[4] != CommandTransaction { + t.Fatalf("cmd: got %#x want %#x", resp.Payload[4], CommandTransaction) + } + if binary.LittleEndian.Uint32(resp.Payload[smbOffStatus:smbOffStatus+4]) != smbStatusSuccess { + t.Fatalf("status: not success") + } + paramOffset := int(binary.LittleEndian.Uint16(resp.Payload[smbHeaderLen+1+8 : smbHeaderLen+1+10])) + paramCount := int(binary.LittleEndian.Uint16(resp.Payload[smbHeaderLen+1+6 : smbHeaderLen+1+8])) + if paramOffset+paramCount > len(resp.Payload) { + t.Fatalf("param block out of bounds") + } + p := resp.Payload[paramOffset : paramOffset+paramCount] + if status := binary.LittleEndian.Uint16(p[0:2]); status != 0 { + t.Fatalf("RAP status: got %d want 0", status) + } + // IPC$ is always present even without configured shares + entriesReturned := binary.LittleEndian.Uint16(p[4:6]) + if entriesReturned < 1 { + t.Fatalf("expected at least IPC$ entry, got %d entries", entriesReturned) + } +} + +func TestHandleSessionContextNetShareEnumReturnsConfiguredShares(t *testing.T) { + shares := []ShareConfig{ + {Name: "DOCS", Path: "/docs"}, + {Name: "MEDIA", Path: "/media"}, + } + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, shares) + packet := &netbiosproto.SessionPacket{ + Type: netbiosproto.SessionMessage, + Payload: makeNetShareEnumPayload(), + } + resp, err := svc.HandleSessionContext(packet, netbios.SessionContext{}) + if err != nil { + t.Fatalf("HandleSessionContext: %v", err) + } + if resp == nil { + t.Fatal("expected response") + } + paramOffset := int(binary.LittleEndian.Uint16(resp.Payload[smbHeaderLen+1+8 : smbHeaderLen+1+10])) + paramCount := int(binary.LittleEndian.Uint16(resp.Payload[smbHeaderLen+1+6 : smbHeaderLen+1+8])) + if paramOffset+paramCount > len(resp.Payload) { + t.Fatalf("param block out of bounds") + } + p := resp.Payload[paramOffset : paramOffset+paramCount] + // shares + IPC$ + got := int(binary.LittleEndian.Uint16(p[4:6])) + want := len(shares) + 1 // +1 for IPC$ + if got != want { + t.Fatalf("EntriesReturned: got %d want %d", got, want) + } + + // Verify share names in the data block + dataOffset := int(binary.LittleEndian.Uint16(resp.Payload[smbHeaderLen+1+14 : smbHeaderLen+1+16])) + dataCount := int(binary.LittleEndian.Uint16(resp.Payload[smbHeaderLen+1+12 : smbHeaderLen+1+14])) + if dataOffset+dataCount > len(resp.Payload) { + t.Fatalf("data block out of bounds") + } + d := resp.Payload[dataOffset : dataOffset+dataCount] + for i, sc := range shares { + base := i * 20 + name := strings.TrimRight(string(d[base:base+12]), "\x00") + if !strings.EqualFold(name, sc.Name) { + t.Errorf("entry[%d] name: got %q want %q", i, name, sc.Name) + } + } + // Last entry should be IPC$ + ipcBase := len(shares) * 20 + ipcName := strings.TrimRight(string(d[ipcBase:ipcBase+12]), "\x00") + if !strings.EqualFold(ipcName, "IPC$") { + t.Errorf("last entry: got %q want IPC$", ipcName) + } +} + +func TestHandleSessionContextTreeDisconnectReturnsSuccess(t *testing.T) { + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, nil) + packet := &netbiosproto.SessionPacket{ + Type: netbiosproto.SessionMessage, + Payload: makeTreeDisconnectPayload(), + } + resp, err := svc.HandleSessionContext(packet, netbios.SessionContext{}) + if err != nil { + t.Fatalf("HandleSessionContext: %v", err) + } + if resp == nil { + t.Fatal("expected response") + } + if resp.Payload[4] != CommandTreeDisconnect { + t.Fatalf("cmd: got %#x want %#x", resp.Payload[4], CommandTreeDisconnect) + } + if binary.LittleEndian.Uint32(resp.Payload[smbOffStatus:smbOffStatus+4]) != smbStatusSuccess { + t.Fatalf("status: not success") + } + if resp.Payload[smbHeaderLen] != 0 { + t.Fatalf("WCT: got %d want 0", resp.Payload[smbHeaderLen]) + } + if binary.LittleEndian.Uint16(resp.Payload[smbHeaderLen+1:smbHeaderLen+3]) != 0 { + t.Fatalf("ByteCount: expected 0") + } +} + +func TestHandleSessionContextIgnoresSMBResponses(t *testing.T) { + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, nil) + payload := makeNegotiatePayload() + payload[smbOffFlags] |= 0x80 // mark packet as SMB response + + resp, err := svc.HandleSessionContext(&netbiosproto.SessionPacket{ + Type: netbiosproto.SessionMessage, + Payload: payload, + }, netbios.SessionContext{}) + if err != nil { + t.Fatalf("HandleSessionContext: %v", err) + } + if resp != nil { + t.Fatalf("expected no response for inbound SMB response packet") + } +} + +type diskUsagePathProbeFS struct { + diskUsagePath string +} + +func (f *diskUsagePathProbeFS) ReadDir(string) ([]fs.DirEntry, error) { + return nil, fs.ErrNotExist +} + +func (f *diskUsagePathProbeFS) Stat(string) (fs.FileInfo, error) { + return nil, fs.ErrNotExist +} + +func (f *diskUsagePathProbeFS) DiskUsage(path string) (uint64, uint64, error) { + f.diskUsagePath = path + return 1024 * 1024, 512 * 1024, nil +} + +func (f *diskUsagePathProbeFS) CreateDir(string) error { + return fs.ErrPermission +} + +func (f *diskUsagePathProbeFS) CreateFile(string) (vfs.File, error) { + return nil, fs.ErrPermission +} + +func (f *diskUsagePathProbeFS) OpenFile(string, int) (vfs.File, error) { + return nil, fs.ErrPermission +} + +func (f *diskUsagePathProbeFS) Remove(string) error { + return fs.ErrPermission +} + +func (f *diskUsagePathProbeFS) Rename(string, string) error { + return fs.ErrPermission +} + +func (f *diskUsagePathProbeFS) Capabilities() vfs.Capabilities { + return vfs.Capabilities{} +} + +func (f *diskUsagePathProbeFS) ShortName(path string) (string, error) { + return "", fs.ErrNotExist +} + +func TestBuildSMBErrorResponseUsesDOSStatusWithoutNTStatusFlag(t *testing.T) { + req := make([]byte, smbHeaderLen) + copy(req[0:4], []byte{0xff, 'S', 'M', 'B'}) + req[4] = CommandQueryInformationDisk + + resp := buildSMBErrorResponse(req, smbStatusNotSupported) + if resp == nil { + t.Fatal("expected error response") + } + + got := binary.LittleEndian.Uint32(resp[smbOffStatus : smbOffStatus+4]) + if got != smbStatusErrBadFunc { + t.Fatalf("status mismatch: got %#x want %#x", got, uint32(smbStatusErrBadFunc)) + } +} + +func TestBuildSMBErrorResponseKeepsNTStatusWhenRequested(t *testing.T) { + req := make([]byte, smbHeaderLen) + copy(req[0:4], []byte{0xff, 'S', 'M', 'B'}) + req[4] = CommandQueryInformationDisk + binary.LittleEndian.PutUint16(req[smbOffFlags2:smbOffFlags2+2], smbFlags2NTStatus) + + resp := buildSMBErrorResponse(req, smbStatusNotSupported) + if resp == nil { + t.Fatal("expected error response") + } + + got := binary.LittleEndian.Uint32(resp[smbOffStatus : smbOffStatus+4]) + if got != smbStatusNotSupported { + t.Fatalf("status mismatch: got %#x want %#x", got, uint32(smbStatusNotSupported)) + } +} + +func TestHandleQueryInformationDiskUsesShareRootPath(t *testing.T) { + probe := &diskUsagePathProbeFS{} + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, []ShareConfig{{Name: "PUBLIC", Path: `C:\\PUBLIC`}}) + svc.shareFSes = map[int]vfs.FileSystem{0: probe} + + conn := &connState{tids: map[uint16]treeSlot{7: {shareIdx: 0}}} + req := make([]byte, smbHeaderLen) + copy(req[0:4], []byte{0xff, 'S', 'M', 'B'}) + req[4] = CommandQueryInformationDisk + binary.LittleEndian.PutUint16(req[smbOffTID:smbOffTID+2], 7) + + resp := svc.handleQueryInformationDisk(req, conn) + if resp == nil { + t.Fatal("expected response") + } + if got := binary.LittleEndian.Uint32(resp[smbOffStatus : smbOffStatus+4]); got != smbStatusSuccess { + t.Fatalf("status mismatch: got %#x want %#x", got, uint32(smbStatusSuccess)) + } + if probe.diskUsagePath != `C:\\PUBLIC` { + t.Fatalf("DiskUsage path mismatch: got %q want %q", probe.diskUsagePath, `C:\\PUBLIC`) + } +} + +func TestHandleQueryInformationMissingFileReturnsBadFile(t *testing.T) { + probe := &diskUsagePathProbeFS{} + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, []ShareConfig{{Name: "PUBLIC", Path: `C:\\PUBLIC`}}) + svc.shareFSes = map[int]vfs.FileSystem{0: probe} + + conn := &connState{tids: map[uint16]treeSlot{9: {shareIdx: 0}}} + req := makeQueryInformationPayload(9, "\\DESKTOP.INI") + + resp := svc.handleQueryInformation(req, conn) + if resp == nil { + t.Fatal("expected response") + } + if got := binary.LittleEndian.Uint32(resp[smbOffStatus : smbOffStatus+4]); got != smbStatusErrBadFile { + t.Fatalf("status mismatch: got %#x want %#x", got, uint32(smbStatusErrBadFile)) + } +} + +func TestHandleQueryInformationExactLongDirectoryNameSucceeds(t *testing.T) { + tmp := t.TempDir() + if err := os.Mkdir(filepath.Join(tmp, "Volume 68k"), 0o755); err != nil { + t.Fatalf("Mkdir: %v", err) + } + fsys, err := vfs.New(vfs.LocalFSName, vfs.Params{Name: "PUBLIC", Path: tmp}) + if err != nil { + t.Fatalf("vfs.New: %v", err) + } + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, []ShareConfig{{Name: "PUBLIC", Path: tmp}}) + svc.shareFSes = map[int]vfs.FileSystem{0: fsys} + + conn := &connState{tids: map[uint16]treeSlot{15: {shareIdx: 0}}} + req := makeQueryInformationPayload(15, "\\Volume 68k") + resp := svc.handleQueryInformation(req, conn) + if resp == nil { + t.Fatal("expected response") + } + if got := binary.LittleEndian.Uint32(resp[smbOffStatus : smbOffStatus+4]); got != smbStatusSuccess { + t.Fatalf("status mismatch: got %#x want %#x", got, uint32(smbStatusSuccess)) + } +} + +func TestHandleQueryInformationEmptyPathReturnsShareRoot(t *testing.T) { + tmp := t.TempDir() + fsys, err := vfs.New(vfs.LocalFSName, vfs.Params{Name: "PUBLIC", Path: tmp}) + if err != nil { + t.Fatalf("vfs.New: %v", err) + } + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, []ShareConfig{{Name: "PUBLIC", Path: tmp}}) + svc.shareFSes = map[int]vfs.FileSystem{0: fsys} + + conn := &connState{tids: map[uint16]treeSlot{16: {shareIdx: 0}}} + req := makeQueryInformationPayload(16, "") + resp := svc.handleQueryInformation(req, conn) + if resp == nil { + t.Fatal("expected response") + } + if got := binary.LittleEndian.Uint32(resp[smbOffStatus : smbOffStatus+4]); got != smbStatusSuccess { + t.Fatalf("status mismatch: got %#x want %#x", got, uint32(smbStatusSuccess)) + } +} + +func TestHandleQueryInformationFallsBackToDOSLikeName(t *testing.T) { + tmp := t.TempDir() + if err := os.Mkdir(filepath.Join(tmp, "Volume 68k"), 0o755); err != nil { + t.Fatalf("Mkdir: %v", err) + } + fsys, err := vfs.New(vfs.LocalFSName, vfs.Params{Name: "PUBLIC", Path: tmp}) + if err != nil { + t.Fatalf("vfs.New: %v", err) + } + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, []ShareConfig{{Name: "PUBLIC", Path: tmp}}) + svc.shareFSes = map[int]vfs.FileSystem{0: fsys} + + conn := &connState{tids: map[uint16]treeSlot{17: {shareIdx: 0}}} + req := makeQueryInformationPayload(17, "\\VOLUME68K") + resp := svc.handleQueryInformation(req, conn) + if resp == nil { + t.Fatal("expected response") + } + if got := binary.LittleEndian.Uint32(resp[smbOffStatus : smbOffStatus+4]); got != smbStatusSuccess { + t.Fatalf("status mismatch: got %#x want %#x", got, uint32(smbStatusSuccess)) + } +} + +func TestHandleTransaction2FindFirst2WildcardDoesNotReturnBadFunc(t *testing.T) { + tmp := t.TempDir() + if err := os.WriteFile(filepath.Join(tmp, "ONE.TXT"), []byte("x"), 0o644); err != nil { + t.Fatalf("WriteFile: %v", err) + } + fsys, err := vfs.New(vfs.LocalFSName, vfs.Params{Name: "PUBLIC", Path: tmp}) + if err != nil { + t.Fatalf("vfs.New: %v", err) + } + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, []ShareConfig{{Name: "PUBLIC", Path: tmp}}) + svc.shareFSes = map[int]vfs.FileSystem{0: fsys} + + conn := &connState{tids: map[uint16]treeSlot{11: {shareIdx: 0}}} + req := makeTrans2FindFirst2Payload(11, "\\*") + + resp := svc.handleTransaction2(req, conn) + if resp == nil { + t.Fatal("expected response") + } + if got := binary.LittleEndian.Uint32(resp[smbOffStatus : smbOffStatus+4]); got != smbStatusSuccess { + t.Fatalf("status mismatch: got %#x want %#x", got, uint32(smbStatusSuccess)) + } + if resp[4] != CommandTransaction2 { + t.Fatalf("command mismatch: got %#x want %#x", resp[4], CommandTransaction2) + } + // Ensure returned payload includes at least one directory info record. + if len(resp) <= smbHeaderLen+1+20+2+10 { + t.Fatalf("expected transaction2 data payload") + } +} + +func TestHandleTransaction2FindFirst2ExactPatternDoesNotMatchSidecar(t *testing.T) { + tmp := t.TempDir() + if err := os.WriteFile(filepath.Join(tmp, "NICOLE CAMERA.JPG"), []byte("x"), 0o644); err != nil { + t.Fatalf("WriteFile: %v", err) + } + if err := os.WriteFile(filepath.Join(tmp, "._NICOLE CAMERA.JPG"), []byte("y"), 0o644); err != nil { + t.Fatalf("WriteFile: %v", err) + } + + fsys, err := vfs.New(vfs.LocalFSName, vfs.Params{Name: "PUBLIC", Path: tmp}) + if err != nil { + t.Fatalf("vfs.New: %v", err) + } + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, []ShareConfig{{Name: "PUBLIC", Path: tmp}}) + svc.shareFSes = map[int]vfs.FileSystem{0: fsys} + + conn := &connState{tids: map[uint16]treeSlot{19: {shareIdx: 0}}, searches: map[uint16]*searchHandle{}} + resp := svc.handleTransaction2(makeTrans2FindFirst2PayloadWithCount(19, "\\NICOLE CAMERA.JPG", 10), conn) + if resp == nil { + t.Fatal("expected response") + } + if got := binary.LittleEndian.Uint32(resp[smbOffStatus : smbOffStatus+4]); got != smbStatusSuccess { + t.Fatalf("status mismatch: got %#x want %#x", got, uint32(smbStatusSuccess)) + } + param := readTrans2ParamBlock(t, resp) + if got := binary.LittleEndian.Uint16(param[2:4]); got != 1 { + t.Fatalf("returned count mismatch: got %d want 1", got) + } + data := readTrans2DataBlock(t, resp) + expectPrimary := encodeOEM("NICOLE CAMERA.JPG") + expectSidecar := encodeOEM("._NICOLE CAMERA.JPG") + if !bytes.Contains(bytes.ToUpper(data), expectPrimary) { + t.Fatalf("expected primary file in response") + } + if bytes.Contains(bytes.ToUpper(data), expectSidecar) { + t.Fatalf("unexpected sidecar match in exact-pattern response") + } +} + +func TestHandleTransaction2FindNext2ReturnsSecondPage(t *testing.T) { + tmp := t.TempDir() + for i := 0; i < 12; i++ { + name := filepath.Join(tmp, "FILE"+string(rune('A'+i))+".TXT") + if err := os.WriteFile(name, []byte("x"), 0o644); err != nil { + t.Fatalf("WriteFile(%s): %v", name, err) + } + } + + fsys, err := vfs.New(vfs.LocalFSName, vfs.Params{Name: "PUBLIC", Path: tmp}) + if err != nil { + t.Fatalf("vfs.New: %v", err) + } + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, []ShareConfig{{Name: "PUBLIC", Path: tmp}}) + svc.shareFSes = map[int]vfs.FileSystem{0: fsys} + + conn := &connState{tids: map[uint16]treeSlot{12: {shareIdx: 0}}, searches: map[uint16]*searchHandle{}} + firstReq := makeTrans2FindFirst2PayloadWithCount(12, "\\*", 6) + firstResp := svc.handleTransaction2(firstReq, conn) + if firstResp == nil { + t.Fatal("expected first response") + } + if got := binary.LittleEndian.Uint32(firstResp[smbOffStatus : smbOffStatus+4]); got != smbStatusSuccess { + t.Fatalf("first status mismatch: got %#x want %#x", got, uint32(smbStatusSuccess)) + } + firstParam := readTrans2ParamBlock(t, firstResp) + if got := binary.LittleEndian.Uint16(firstParam[2:4]); got == 0 { + t.Fatalf("expected first page entries") + } + sid := binary.LittleEndian.Uint16(firstParam[0:2]) + + nextReq := makeTrans2FindNext2Payload(12, sid, 6) + nextResp := svc.handleTransaction2(nextReq, conn) + if nextResp == nil { + t.Fatal("expected next response") + } + if got := binary.LittleEndian.Uint32(nextResp[smbOffStatus : smbOffStatus+4]); got != smbStatusSuccess { + t.Fatalf("next status mismatch: got %#x want %#x", got, uint32(smbStatusSuccess)) + } + nextParam := readTrans2ParamBlock(t, nextResp) + if got := binary.LittleEndian.Uint16(nextParam[0:2]); got == 0 { + t.Fatalf("expected second page entries") + } +} + +func TestHandleTransaction2FindNext2ResumeNameAdvancesPosition(t *testing.T) { + tmp := t.TempDir() + for _, n := range []string{"A.TXT", "B.TXT", "C.TXT", "D.TXT"} { + if err := os.WriteFile(filepath.Join(tmp, n), []byte("x"), 0o644); err != nil { + t.Fatalf("WriteFile(%s): %v", n, err) + } + } + + fsys, err := vfs.New(vfs.LocalFSName, vfs.Params{Name: "PUBLIC", Path: tmp}) + if err != nil { + t.Fatalf("vfs.New: %v", err) + } + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, []ShareConfig{{Name: "PUBLIC", Path: tmp}}) + svc.shareFSes = map[int]vfs.FileSystem{0: fsys} + + conn := &connState{tids: map[uint16]treeSlot{13: {shareIdx: 0}}, searches: map[uint16]*searchHandle{}} + firstReq := makeTrans2FindFirst2PayloadWithCount(13, "\\*", 2) + firstResp := svc.handleTransaction2(firstReq, conn) + if firstResp == nil { + t.Fatal("expected first response") + } + firstParam := readTrans2ParamBlock(t, firstResp) + sid := binary.LittleEndian.Uint16(firstParam[0:2]) + + nextReq := makeTrans2FindNext2PayloadWithResume(13, sid, 1, "B.TXT", 0) + nextResp := svc.handleTransaction2(nextReq, conn) + if nextResp == nil { + t.Fatal("expected next response") + } + if got := binary.LittleEndian.Uint32(nextResp[smbOffStatus : smbOffStatus+4]); got != smbStatusSuccess { + t.Fatalf("next status mismatch: got %#x want %#x", got, uint32(smbStatusSuccess)) + } + nextParam := readTrans2ParamBlock(t, nextResp) + if got := binary.LittleEndian.Uint16(nextParam[0:2]); got == 0 { + t.Fatalf("expected resumed entry") + } +} + +func TestHandleTransaction2FindNext2ReturnsNoMoreFiles(t *testing.T) { + tmp := t.TempDir() + if err := os.WriteFile(filepath.Join(tmp, "ONLY.TXT"), []byte("x"), 0o644); err != nil { + t.Fatalf("WriteFile: %v", err) + } + + fsys, err := vfs.New(vfs.LocalFSName, vfs.Params{Name: "PUBLIC", Path: tmp}) + if err != nil { + t.Fatalf("vfs.New: %v", err) + } + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, []ShareConfig{{Name: "PUBLIC", Path: tmp}}) + svc.shareFSes = map[int]vfs.FileSystem{0: fsys} + + conn := &connState{tids: map[uint16]treeSlot{14: {shareIdx: 0}}, searches: map[uint16]*searchHandle{}} + firstReq := makeTrans2FindFirst2PayloadWithCount(14, "\\*", 1) + firstResp := svc.handleTransaction2(firstReq, conn) + if firstResp == nil { + t.Fatal("expected first response") + } + firstParam := readTrans2ParamBlock(t, firstResp) + sid := binary.LittleEndian.Uint16(firstParam[0:2]) + + nextReq := makeTrans2FindNext2Payload(14, sid, 1) + nextResp := svc.handleTransaction2(nextReq, conn) + if nextResp == nil { + t.Fatal("expected next response") + } + if got := binary.LittleEndian.Uint32(nextResp[smbOffStatus : smbOffStatus+4]); got != smbStatusErrNoFiles { + t.Fatalf("status mismatch: got %#x want %#x", got, uint32(smbStatusErrNoFiles)) + } +} + +func TestHandleFindClose2ReturnsSuccess(t *testing.T) { + tmp := t.TempDir() + if err := os.WriteFile(filepath.Join(tmp, "ONE.TXT"), []byte("x"), 0o644); err != nil { + t.Fatalf("WriteFile: %v", err) + } + fsys, err := vfs.New(vfs.LocalFSName, vfs.Params{Name: "PUBLIC", Path: tmp}) + if err != nil { + t.Fatalf("vfs.New: %v", err) + } + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, []ShareConfig{{Name: "PUBLIC", Path: tmp}}) + svc.shareFSes = map[int]vfs.FileSystem{0: fsys} + + conn := &connState{tids: map[uint16]treeSlot{18: {shareIdx: 0}}, searches: map[uint16]*searchHandle{}} + firstResp := svc.handleTransaction2(makeTrans2FindFirst2PayloadWithCount(18, "\\*", 1), conn) + if firstResp == nil { + t.Fatal("expected search response") + } + param := readTrans2ParamBlock(t, firstResp) + sid := binary.LittleEndian.Uint16(param[0:2]) + + resp := svc.handleFindClose2(makeFindClose2Payload(18, sid), conn) + if resp == nil { + t.Fatal("expected response") + } + if got := binary.LittleEndian.Uint32(resp[smbOffStatus : smbOffStatus+4]); got != smbStatusSuccess { + t.Fatalf("status mismatch: got %#x want %#x", got, uint32(smbStatusSuccess)) + } + conn.mu.Lock() + _, exists := conn.searches[sid] + conn.mu.Unlock() + if exists { + t.Fatalf("search handle %d was not removed", sid) + } +} + +func TestHandleLockingAndXProcessesChainedSubcommands(t *testing.T) { + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, nil) + conn := &connState{ + fids: map[uint16]*fileHandle{11: {path: "HELLO.TXT"}}, + lockTables: map[string]*lockTable{}, + } + + lockReq := makeLockingAndXPayload(11, nil, []lockRange{{pid: 6245, start: 2147483559, length: 20}}) + lockResp := svc.handleLockingAndX(lockReq, conn) + if lockResp == nil { + t.Fatal("expected initial lock response") + } + if got := binary.LittleEndian.Uint32(lockResp[smbOffStatus : smbOffStatus+4]); got != smbStatusSuccess { + t.Fatalf("initial lock status mismatch: got %#x want %#x", got, uint32(smbStatusSuccess)) + } + + rotateReq := makeChainedLockingAndXPayload( + 11, + []lockRange{{pid: 6245, start: 2147483559, length: 20}}, + nil, + nil, + []lockRange{{pid: 6245, start: 2147483579, length: 20}}, + ) + rotateResp := svc.handleLockingAndX(rotateReq, conn) + if rotateResp == nil { + t.Fatal("expected rotated lock response") + } + if got := binary.LittleEndian.Uint32(rotateResp[smbOffStatus : smbOffStatus+4]); got != smbStatusSuccess { + t.Fatalf("rotated lock status mismatch: got %#x want %#x", got, uint32(smbStatusSuccess)) + } + + unlockReq := makeLockingAndXPayload(11, []lockRange{{pid: 6245, start: 2147483579, length: 20}}, nil) + unlockResp := svc.handleLockingAndX(unlockReq, conn) + if unlockResp == nil { + t.Fatal("expected unlock response") + } + if got := binary.LittleEndian.Uint32(unlockResp[smbOffStatus : smbOffStatus+4]); got != smbStatusSuccess { + t.Fatalf("unlock status mismatch: got %#x want %#x", got, uint32(smbStatusSuccess)) + } +} + +func TestHandleSeekFromEndReturnsFileSize(t *testing.T) { + tmp := t.TempDir() + hostPath := filepath.Join(tmp, "HELLO.TXT") + if err := os.WriteFile(hostPath, []byte("hello"), 0o644); err != nil { + t.Fatalf("WriteFile: %v", err) + } + + file, err := os.Open(hostPath) + if err != nil { + t.Fatalf("Open: %v", err) + } + defer file.Close() + + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, nil) + conn := &connState{fids: map[uint16]*fileHandle{15: {file: file, path: "HELLO.TXT"}}} + + resp := svc.handleSeek(makeSeekPayload(15, 2, 0), conn) + if resp == nil { + t.Fatal("expected response") + } + if got := binary.LittleEndian.Uint32(resp[smbOffStatus : smbOffStatus+4]); got != smbStatusSuccess { + t.Fatalf("status mismatch: got %#x want %#x", got, uint32(smbStatusSuccess)) + } + if resp[smbHeaderLen] != 2 { + t.Fatalf("WCT mismatch: got %d want 2", resp[smbHeaderLen]) + } + if got := binary.LittleEndian.Uint32(resp[smbHeaderLen+1 : smbHeaderLen+5]); got != 5 { + t.Fatalf("offset mismatch: got %d want 5", got) + } + + conn.mu.Lock() + defer conn.mu.Unlock() + if got := conn.fids[15].offset; got != 5 { + t.Fatalf("stored offset mismatch: got %d want 5", got) + } +} + +func TestHandleOpenAndXCreatesFileUnderShareRoot(t *testing.T) { + tmp := t.TempDir() + localName := "SMB_ROOT_PATH_PROBE.TXT" + _ = os.Remove(localName) + t.Cleanup(func() { + _ = os.Remove(localName) + }) + + fsys, err := vfs.New(vfs.LocalFSName, vfs.Params{Name: "PUBLIC", Path: tmp}) + if err != nil { + t.Fatalf("vfs.New: %v", err) + } + + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, []ShareConfig{{Name: "PUBLIC", Path: tmp}}) + svc.shareFSes = map[int]vfs.FileSystem{0: fsys} + + conn := &connState{ + tids: map[uint16]treeSlot{21: {shareIdx: 0}}, + fids: map[uint16]*fileHandle{}, + } + + resp := svc.handleOpenAndX(makeOpenAndXPayload(21, localName, 0), conn) + if resp == nil { + t.Fatal("expected response") + } + if got := binary.LittleEndian.Uint32(resp[smbOffStatus : smbOffStatus+4]); got != smbStatusSuccess { + t.Fatalf("status mismatch: got %#x want %#x", got, uint32(smbStatusSuccess)) + } + conn.mu.Lock() + for _, h := range conn.fids { + if h != nil && h.file != nil { + _ = h.file.Close() + } + } + conn.mu.Unlock() + + if _, err := os.Stat(filepath.Join(tmp, localName)); err != nil { + t.Fatalf("expected file under share root: %v", err) + } +} + +func TestHandleOpenAndXOpenOnlyMissingReturnsNameNotFound(t *testing.T) { + tmp := t.TempDir() + fsys, err := vfs.New(vfs.LocalFSName, vfs.Params{Name: "PUBLIC", Path: tmp}) + if err != nil { + t.Fatalf("vfs.New: %v", err) + } + + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, []ShareConfig{{Name: "PUBLIC", Path: tmp}}) + svc.shareFSes = map[int]vfs.FileSystem{0: fsys} + + conn := &connState{ + tids: map[uint16]treeSlot{22: {shareIdx: 0}}, + fids: map[uint16]*fileHandle{}, + } + + resp := svc.handleOpenAndX(makeOpenAndXPayloadWithAccess(22, "MISSING.TXT", 0x0001, 0x00C2), conn) + if resp == nil { + t.Fatal("expected response") + } + if got := binary.LittleEndian.Uint32(resp[smbOffStatus : smbOffStatus+4]); got != smbStatusErrBadFile { + t.Fatalf("status mismatch: got %#x want %#x", got, uint32(smbStatusErrBadFile)) + } + if _, err := os.Stat(filepath.Join(tmp, "MISSING.TXT")); err == nil { + t.Fatalf("unexpected file creation for open-only request") + } +} + +func TestHandleOpenAndXResponseIncludesGrantedAccess(t *testing.T) { + tmp := t.TempDir() + if err := os.WriteFile(filepath.Join(tmp, "HELLO WORLD.TXT"), []byte("hello world"), 0o644); err != nil { + t.Fatalf("WriteFile: %v", err) + } + fsys, err := vfs.New(vfs.LocalFSName, vfs.Params{Name: "PUBLIC", Path: tmp}) + if err != nil { + t.Fatalf("vfs.New: %v", err) + } + + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, []ShareConfig{{Name: "PUBLIC", Path: tmp}}) + svc.shareFSes = map[int]vfs.FileSystem{0: fsys} + + conn := &connState{ + tids: map[uint16]treeSlot{23: {shareIdx: 0}}, + fids: map[uint16]*fileHandle{}, + } + + resp := svc.handleOpenAndX(makeOpenAndXPayloadWithAccess(23, "hello world.txt", 0x0001, 0x00C2), conn) + if resp == nil { + t.Fatal("expected response") + } + if got := binary.LittleEndian.Uint32(resp[smbOffStatus : smbOffStatus+4]); got != smbStatusSuccess { + t.Fatalf("status mismatch: got %#x want %#x", got, uint32(smbStatusSuccess)) + } + if got := binary.LittleEndian.Uint16(resp[smbHeaderLen+1+16 : smbHeaderLen+1+18]); got != 0x00C2 { + t.Fatalf("granted access mismatch: got %#x want %#x", got, uint16(0x00C2)) + } + if got := binary.LittleEndian.Uint16(resp[smbHeaderLen+1+22 : smbHeaderLen+1+24]); got != 0x0001 { + t.Fatalf("action mismatch: got %#x want %#x", got, uint16(0x0001)) + } + if got := binary.LittleEndian.Uint32(resp[smbHeaderLen+1+12 : smbHeaderLen+1+16]); got == 0 { + t.Fatalf("expected non-zero file size in OpenAndX response") + } + + conn.mu.Lock() + for _, h := range conn.fids { + if h != nil && h.file != nil { + _ = h.file.Close() + } + } + conn.mu.Unlock() +} + +// TestHandleReadMPXReturnsData asserts handleReadMPX honors the command +// per [MS-CIFS] 2.2.4.23: returns the requested file bytes in a single +// response with Count/DataLength set to the bytes delivered. (We used +// to reject with ERRuseSTD, which forced an extra round-trip via +// SMB_COM_READ; the spec-compliant path is to honor MPX directly.) +func TestHandleReadMPXReturnsData(t *testing.T) { + tmp := t.TempDir() + hostPath := filepath.Join(tmp, "MPX.TXT") + if err := os.WriteFile(hostPath, []byte("abcdefghij"), 0o644); err != nil { + t.Fatalf("WriteFile: %v", err) + } + file, err := os.Open(hostPath) + if err != nil { + t.Fatalf("Open: %v", err) + } + defer file.Close() + + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, nil) + conn := &connState{fids: map[uint16]*fileHandle{5: {file: file, path: hostPath}}} + + resp := svc.handleReadMPX(makeReadMPXPayload(5, 2, 4), conn) + if resp == nil { + t.Fatal("expected response") + } + if got := binary.LittleEndian.Uint32(resp[smbOffStatus : smbOffStatus+4]); got != smbStatusSuccess { + t.Fatalf("status mismatch: got %#x want %#x", got, uint32(smbStatusSuccess)) + } + if got := resp[smbHeaderLen]; got != 8 { + t.Fatalf("WCT mismatch: got %d want 8", got) + } + w := resp[smbHeaderLen+1:] + if got := binary.LittleEndian.Uint32(w[0:4]); got != 2 { + t.Fatalf("Offset mismatch: got %d want 2", got) + } + if got := binary.LittleEndian.Uint16(w[4:6]); got != 4 { + t.Fatalf("Count mismatch: got %d want 4", got) + } + if got := binary.LittleEndian.Uint16(w[6:8]); got != 0xFFFF { + t.Fatalf("Remaining mismatch: got %#x want 0xFFFF", got) + } + if got := binary.LittleEndian.Uint16(w[12:14]); got != 4 { + t.Fatalf("DataLength mismatch: got %d want 4", got) + } + dataOffset := binary.LittleEndian.Uint16(w[14:16]) + if got := string(resp[int(dataOffset) : int(dataOffset)+4]); got != "cdef" { + t.Fatalf("Data mismatch: got %q want %q", got, "cdef") + } +} + +// TestHandleReadMPXInvalidFID asserts we return ERRDOS/ERRbadfid when the +// referenced FID is not open. Win9x relies on this status to decide +// whether to retry against a different handle or give up. +func TestHandleReadMPXInvalidFID(t *testing.T) { + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, nil) + conn := &connState{fids: map[uint16]*fileHandle{}} + + resp := svc.handleReadMPX(makeReadMPXPayload(3, 0, 4), conn) + if resp == nil { + t.Fatal("expected response") + } + if got := binary.LittleEndian.Uint32(resp[smbOffStatus : smbOffStatus+4]); got != smbStatusErrBadFid { + t.Fatalf("status mismatch: got %#x want %#x", got, uint32(smbStatusErrBadFid)) + } +} + +func TestHandleReadReturnsData(t *testing.T) { + tmp := t.TempDir() + hostPath := filepath.Join(tmp, "READ.TXT") + if err := os.WriteFile(hostPath, []byte("abcdef"), 0o644); err != nil { + t.Fatalf("WriteFile: %v", err) + } + + file, err := os.Open(hostPath) + if err != nil { + t.Fatalf("Open: %v", err) + } + defer file.Close() + + svc := NewService(ServerOptions{ServerName: "ClassicStack", Workgroup: "WORKGROUP"}, nil, nil) + conn := &connState{fids: map[uint16]*fileHandle{5: {file: file, path: hostPath}}} + + resp := svc.handleRead(makeReadPayload(5, 2, 3), conn) + if resp == nil { + t.Fatal("expected response") + } + if got := binary.LittleEndian.Uint32(resp[smbOffStatus : smbOffStatus+4]); got != smbStatusSuccess { + t.Fatalf("status mismatch: got %#x want %#x", got, uint32(smbStatusSuccess)) + } + if got := resp[4]; got != CommandRead { + t.Fatalf("command mismatch: got %#x want %#x", got, byte(CommandRead)) + } + // WCT must be 5 per [MS-CIFS] 2.2.4.11.2 + if got := resp[smbHeaderLen]; got != 5 { + t.Fatalf("WCT mismatch: got %d want 5", got) + } + // CountOfBytesReturned is Words[0] + count := int(binary.LittleEndian.Uint16(resp[smbHeaderLen+1 : smbHeaderLen+3])) + if count != 3 { + t.Fatalf("CountOfBytesReturned mismatch: got %d want 3", count) + } + // SMB_Data starts after WCT(1) + Words(5*2=10) = offset 11 from smbHeaderLen + // Bytes: BufferFormat(1)=0x01, CountOfBytesRead(2), data + bytesOff := smbHeaderLen + 1 + 10 + 2 // skip WCT, Words, ByteCount + if resp[bytesOff] != 0x01 { + t.Fatalf("BufferFormat mismatch: got %#x want 0x01", resp[bytesOff]) + } + dataLen := int(binary.LittleEndian.Uint16(resp[bytesOff+1 : bytesOff+3])) + if dataLen != 3 { + t.Fatalf("CountOfBytesRead mismatch: got %d want 3", dataLen) + } + if got := string(resp[bytesOff+3 : bytesOff+3+dataLen]); got != "cde" { + t.Fatalf("data mismatch: got %q want %q", got, "cde") + } +} + + +func makeQueryInformationPayload(tid uint16, path string) []byte { + pathBytes := append([]byte(path), 0) + byteCount := 1 + len(pathBytes) + out := make([]byte, smbHeaderLen+1+2+byteCount) + copy(out[0:4], []byte{0xff, 'S', 'M', 'B'}) + out[4] = CommandQueryInformation + binary.LittleEndian.PutUint16(out[smbOffTID:smbOffTID+2], tid) + out[smbHeaderLen] = 0 // WCT + binary.LittleEndian.PutUint16(out[smbHeaderLen+1:smbHeaderLen+3], uint16(byteCount)) + out[smbHeaderLen+3] = 0x04 + copy(out[smbHeaderLen+4:], pathBytes) + return out +} + +func makeFindClose2Payload(tid, sid uint16) []byte { + out := make([]byte, smbHeaderLen+1+2+2) + copy(out[0:4], []byte{0xff, 'S', 'M', 'B'}) + out[4] = CommandFindClose2 + binary.LittleEndian.PutUint16(out[smbOffTID:smbOffTID+2], tid) + out[smbHeaderLen] = 1 + binary.LittleEndian.PutUint16(out[smbHeaderLen+1:smbHeaderLen+3], sid) + binary.LittleEndian.PutUint16(out[smbHeaderLen+3:smbHeaderLen+5], 0) + return out +} + +func makeSeekPayload(fid, mode uint16, offset int32) []byte { + out := make([]byte, smbHeaderLen+1+8+2) + copy(out[0:4], []byte{0xff, 'S', 'M', 'B'}) + out[4] = CommandSeek + out[smbHeaderLen] = 4 + binary.LittleEndian.PutUint16(out[smbHeaderLen+1:smbHeaderLen+3], fid) + binary.LittleEndian.PutUint16(out[smbHeaderLen+3:smbHeaderLen+5], mode) + binary.LittleEndian.PutUint32(out[smbHeaderLen+5:smbHeaderLen+9], uint32(offset)) + binary.LittleEndian.PutUint16(out[smbHeaderLen+9:smbHeaderLen+11], 0) + return out +} + +func makeOpenAndXPayload(tid uint16, path string, openFunction uint16) []byte { + return makeOpenAndXPayloadWithAccess(tid, path, openFunction, 0) +} + +func makeOpenAndXPayloadWithAccess(tid uint16, path string, openFunction uint16, desiredAccess uint16) []byte { + pathBytes := append([]byte(path), 0) + byteCount := 1 + len(pathBytes) + wct := 15 + wordBytes := wct * 2 + bytesOffset := smbHeaderLen + 1 + wordBytes + out := make([]byte, bytesOffset+2+byteCount) + + copy(out[0:4], []byte{0xff, 'S', 'M', 'B'}) + out[4] = CommandOpenAndX + binary.LittleEndian.PutUint16(out[smbOffTID:smbOffTID+2], tid) + out[smbHeaderLen] = byte(wct) + + w := out[smbHeaderLen+1 : smbHeaderLen+1+wordBytes] + w[0] = 0xFF // AndXCommand + w[1] = 0x00 // AndXReserved + binary.LittleEndian.PutUint16(w[2:4], 0) // AndXOffset + binary.LittleEndian.PutUint16(w[4:6], 0) // Flags + binary.LittleEndian.PutUint16(w[6:8], desiredAccess) + binary.LittleEndian.PutUint16(w[8:10], 0) // SearchAttrs + binary.LittleEndian.PutUint16(w[10:12], 0) // FileAttrs + binary.LittleEndian.PutUint32(w[12:16], 0) // CreationTime + binary.LittleEndian.PutUint16(w[16:18], openFunction) + binary.LittleEndian.PutUint32(w[18:22], 0) // AllocationSize + binary.LittleEndian.PutUint32(w[22:26], 0) // Timeout + binary.LittleEndian.PutUint32(w[26:30], 0) // Reserved + + binary.LittleEndian.PutUint16(out[bytesOffset:bytesOffset+2], uint16(byteCount)) + out[bytesOffset+2] = 0x04 + copy(out[bytesOffset+3:], pathBytes) + return out +} + +func makeReadMPXPayload(fid uint16, offset uint32, count uint16) []byte { + out := make([]byte, smbHeaderLen+1+(8*2)+2) + copy(out[0:4], []byte{0xff, 'S', 'M', 'B'}) + out[4] = CommandReadMPX + out[smbHeaderLen] = 8 + w := out[smbHeaderLen+1 : smbHeaderLen+1+(8*2)] + binary.LittleEndian.PutUint16(w[0:2], fid) + binary.LittleEndian.PutUint32(w[2:6], offset) + binary.LittleEndian.PutUint16(w[6:8], count) + binary.LittleEndian.PutUint16(w[8:10], count) + binary.LittleEndian.PutUint32(w[10:14], 0) + binary.LittleEndian.PutUint16(w[14:16], 0) + binary.LittleEndian.PutUint16(out[smbHeaderLen+1+(8*2):smbHeaderLen+1+(8*2)+2], 0) + return out +} + +func makeReadPayload(fid, offset, count uint16) []byte { + out := make([]byte, smbHeaderLen+1+(5*2)+2) + copy(out[0:4], []byte{0xff, 'S', 'M', 'B'}) + out[4] = CommandRead + out[smbHeaderLen] = 5 + w := out[smbHeaderLen+1 : smbHeaderLen+1+(5*2)] + binary.LittleEndian.PutUint16(w[0:2], fid) + binary.LittleEndian.PutUint16(w[2:4], count) + binary.LittleEndian.PutUint32(w[4:8], uint32(offset)) + binary.LittleEndian.PutUint16(w[8:10], 0) + binary.LittleEndian.PutUint16(out[smbHeaderLen+1+(5*2):smbHeaderLen+1+(5*2)+2], 0) + return out +} + +func makeLockingAndXPayload(fid uint16, unlocks, locks []lockRange) []byte { + cmd := marshalLockingAndXCommand(CommandNoAndXCommand, 0, fid, unlocks, locks) + out := make([]byte, smbHeaderLen+len(cmd)) + copy(out[0:4], []byte{0xff, 'S', 'M', 'B'}) + out[4] = CommandLockingAndX + copy(out[smbHeaderLen:], cmd) + return out +} + +func makeChainedLockingAndXPayload(fid uint16, firstUnlocks, firstLocks, secondUnlocks, secondLocks []lockRange) []byte { + first := marshalLockingAndXCommand(CommandLockingAndX, uint16(smbHeaderLen), fid, firstUnlocks, firstLocks) + secondOffset := uint16(smbHeaderLen + len(first)) + first = marshalLockingAndXCommand(CommandLockingAndX, secondOffset, fid, firstUnlocks, firstLocks) + second := marshalLockingAndXCommand(CommandNoAndXCommand, 0, fid, secondUnlocks, secondLocks) + out := make([]byte, smbHeaderLen+len(first)+len(second)) + copy(out[0:4], []byte{0xff, 'S', 'M', 'B'}) + out[4] = CommandLockingAndX + copy(out[smbHeaderLen:], first) + copy(out[smbHeaderLen+len(first):], second) + return out +} + +func marshalLockingAndXCommand(andxCommand byte, andxOffset, fid uint16, unlocks, locks []lockRange) []byte { + byteCount := 10 * (len(unlocks) + len(locks)) + out := make([]byte, 1+16+2+byteCount) + out[0] = 8 + w := out[1:17] + w[0] = andxCommand + w[1] = 0 + binary.LittleEndian.PutUint16(w[2:4], andxOffset) + binary.LittleEndian.PutUint16(w[4:6], fid) + w[6] = 0 + w[7] = 0 + binary.LittleEndian.PutUint32(w[8:12], 0) + binary.LittleEndian.PutUint16(w[12:14], uint16(len(unlocks))) + binary.LittleEndian.PutUint16(w[14:16], uint16(len(locks))) + binary.LittleEndian.PutUint16(out[17:19], uint16(byteCount)) + off := 19 + for _, r := range unlocks { + marshalLockRange(out[off:off+10], r) + off += 10 + } + for _, r := range locks { + marshalLockRange(out[off:off+10], r) + off += 10 + } + return out +} + +func marshalLockRange(dst []byte, r lockRange) { + binary.LittleEndian.PutUint16(dst[0:2], r.pid) + binary.LittleEndian.PutUint32(dst[2:6], uint32(r.start)) + binary.LittleEndian.PutUint32(dst[6:10], uint32(r.length)) +} + +func makeTrans2FindFirst2Payload(tid uint16, pattern string) []byte { + return makeTrans2FindFirst2PayloadWithCount(tid, pattern, 1) +} + +func makeTrans2FindFirst2PayloadWithCount(tid uint16, pattern string, count uint16) []byte { + params := make([]byte, 12) + binary.LittleEndian.PutUint16(params[0:2], 0x0016) // SearchAttributes + binary.LittleEndian.PutUint16(params[2:4], count) // SearchCount + binary.LittleEndian.PutUint16(params[4:6], 0x0000) // Flags + binary.LittleEndian.PutUint16(params[6:8], 0x0104) // SMB_FIND_FILE_BOTH_DIRECTORY_INFO + binary.LittleEndian.PutUint32(params[8:12], 0x00000000) + params = append(params, []byte(pattern)...) + params = append(params, 0x00) + + const setupCount = 1 + const wct = 14 + setupCount + wordBytes := wct * 2 + bytesOffset := smbHeaderLen + 1 + wordBytes + paramOffset := bytesOffset + 2 + byteCount := len(params) + out := make([]byte, paramOffset+byteCount) + + copy(out[0:4], []byte{0xff, 'S', 'M', 'B'}) + out[4] = CommandTransaction2 + binary.LittleEndian.PutUint16(out[smbOffTID:smbOffTID+2], tid) + out[smbHeaderLen] = wct + + w := out[smbHeaderLen+1 : smbHeaderLen+1+wordBytes] + binary.LittleEndian.PutUint16(w[0:2], uint16(len(params))) // TotalParameterCount + binary.LittleEndian.PutUint16(w[2:4], 0) // TotalDataCount + binary.LittleEndian.PutUint16(w[4:6], 10) // MaxParameterCount + binary.LittleEndian.PutUint16(w[6:8], 4096) // MaxDataCount + w[8] = 0 // MaxSetupCount + binary.LittleEndian.PutUint16(w[10:12], 0) // Flags + binary.LittleEndian.PutUint32(w[12:16], 0) // Timeout + binary.LittleEndian.PutUint16(w[18:20], uint16(len(params))) + binary.LittleEndian.PutUint16(w[20:22], uint16(paramOffset)) + binary.LittleEndian.PutUint16(w[22:24], 0) // DataCount + binary.LittleEndian.PutUint16(w[24:26], 0) // DataOffset + w[26] = setupCount + binary.LittleEndian.PutUint16(w[28:30], trans2SubcommandFindFirst2) + + binary.LittleEndian.PutUint16(out[bytesOffset:bytesOffset+2], uint16(byteCount)) + copy(out[paramOffset:], params) + return out +} + +func makeTrans2FindNext2Payload(tid, sid, count uint16) []byte { + return makeTrans2FindNext2PayloadWithResume(tid, sid, count, "", 0) +} + +func makeTrans2FindNext2PayloadWithResume(tid, sid, count uint16, resumeName string, flags uint16) []byte { + params := make([]byte, 12) + binary.LittleEndian.PutUint16(params[0:2], sid) + binary.LittleEndian.PutUint16(params[2:4], count) + binary.LittleEndian.PutUint16(params[4:6], 0x0104) // SMB_FIND_FILE_BOTH_DIRECTORY_INFO + binary.LittleEndian.PutUint32(params[6:10], 0x00000000) + binary.LittleEndian.PutUint16(params[10:12], flags) + if resumeName != "" { + params = append(params, []byte(resumeName)...) + params = append(params, 0) + } + + const setupCount = 1 + const wct = 14 + setupCount + wordBytes := wct * 2 + bytesOffset := smbHeaderLen + 1 + wordBytes + paramOffset := bytesOffset + 2 + byteCount := len(params) + out := make([]byte, paramOffset+byteCount) + + copy(out[0:4], []byte{0xff, 'S', 'M', 'B'}) + out[4] = CommandTransaction2 + binary.LittleEndian.PutUint16(out[smbOffTID:smbOffTID+2], tid) + out[smbHeaderLen] = wct + + w := out[smbHeaderLen+1 : smbHeaderLen+1+wordBytes] + binary.LittleEndian.PutUint16(w[0:2], uint16(len(params))) + binary.LittleEndian.PutUint16(w[2:4], 0) + binary.LittleEndian.PutUint16(w[4:6], 10) + binary.LittleEndian.PutUint16(w[6:8], 4096) + w[8] = 0 + binary.LittleEndian.PutUint16(w[10:12], 0) + binary.LittleEndian.PutUint32(w[12:16], 0) + binary.LittleEndian.PutUint16(w[18:20], uint16(len(params))) + binary.LittleEndian.PutUint16(w[20:22], uint16(paramOffset)) + binary.LittleEndian.PutUint16(w[22:24], 0) + binary.LittleEndian.PutUint16(w[24:26], 0) + w[26] = setupCount + binary.LittleEndian.PutUint16(w[28:30], trans2SubcommandFindNext2) + + binary.LittleEndian.PutUint16(out[bytesOffset:bytesOffset+2], uint16(byteCount)) + copy(out[paramOffset:], params) + return out +} + +func readTrans2ParamBlock(t *testing.T, resp []byte) []byte { + t.Helper() + if len(resp) < smbHeaderLen+1+20 { + t.Fatalf("response too short") + } + paramCount := int(binary.LittleEndian.Uint16(resp[smbHeaderLen+1+6 : smbHeaderLen+1+8])) + paramOffset := int(binary.LittleEndian.Uint16(resp[smbHeaderLen+1+8 : smbHeaderLen+1+10])) + if paramOffset < 0 || paramCount < 0 || paramOffset+paramCount > len(resp) { + t.Fatalf("param block out of bounds") + } + return resp[paramOffset : paramOffset+paramCount] +} + +func readTrans2DataBlock(t *testing.T, resp []byte) []byte { + t.Helper() + if len(resp) < smbHeaderLen+1+20 { + t.Fatalf("response too short") + } + dataCount := int(binary.LittleEndian.Uint16(resp[smbHeaderLen+1+12 : smbHeaderLen+1+14])) + dataOffset := int(binary.LittleEndian.Uint16(resp[smbHeaderLen+1+14 : smbHeaderLen+1+16])) + if dataOffset < 0 || dataCount < 0 || dataOffset+dataCount > len(resp) { + t.Fatalf("data block out of bounds") + } + return resp[dataOffset : dataOffset+dataCount] +} diff --git a/service/smb/session_dispatch.go b/service/smb/session_dispatch.go new file mode 100644 index 0000000..9334607 --- /dev/null +++ b/service/smb/session_dispatch.go @@ -0,0 +1,256 @@ +package smb + +import ( + "encoding/binary" + + "github.com/ObsoleteMadness/ClassicStack/netlog" + netbiosproto "github.com/ObsoleteMadness/ClassicStack/protocol/netbios" + "github.com/ObsoleteMadness/ClassicStack/service/netbios" +) + +func (s *Service) HandleSession(_ *netbiosproto.SessionPacket) error { return ErrNotImplemented } + +// HandleSessionContext implements netbios.ContextualSessionHandler. +// It handles the minimal SMB1 session sequence needed for Network +// Neighbourhood enumeration: NegotiateProtocol (0x72), SessionSetupAndX +// (0x73), TreeConnectAndX (0x75), and LANMAN Transaction requests on +// \PIPE\LANMAN (NetServerEnum2). All other commands return +// STATUS_NOT_SUPPORTED. +func (s *Service) HandleSessionContext(packet *netbiosproto.SessionPacket, ctx netbios.SessionContext) (*netbiosproto.SessionPacket, error) { + if packet == nil || len(packet.Payload) < smbHeaderLen || string(packet.Payload[0:4]) != "\xffSMB" { + return nil, nil + } + // Never treat SMB responses as requests. Some transports can surface + // locally transmitted frames back to the receive path. + if packet.Payload[smbOffFlags]&0x80 != 0 { + return nil, nil + } + + connID := connKeyFromSession(ctx) + conn := s.ensureConn(connID) + + server := s.opts.ServerName + if server == "" { + server = "CLASSICSTACK" + } + workgroup := s.opts.Workgroup + if workgroup == "" { + workgroup = "WORKGROUP" + } + + cmd := packet.Payload[4] + var respPayload []byte + + switch cmd { + case CommandNegotiate: + netlog.Debug("[SMB][Session] negotiate src=%x.%x:%02x%02x", + ctx.Remote.Network, ctx.Remote.Node, ctx.Remote.Socket[0], ctx.Remote.Socket[1]) + respPayload = buildNegotiateResponse(packet.Payload, workgroup) + + case CommandSessionSetupAndX: + netlog.Debug("[SMB][Session] session-setup src=%x.%x:%02x%02x", + ctx.Remote.Network, ctx.Remote.Node, ctx.Remote.Socket[0], ctx.Remote.Socket[1]) + conn.mu.Lock() + if conn.uid == 0 { + conn.uid = s.allocUID() + } + uid := conn.uid + conn.mu.Unlock() + respPayload = buildSessionSetupResponse(packet.Payload, uid) + + case CommandTreeConnectAndX: + netlog.Debug("[SMB][Session] tree-connect src=%x.%x:%02x%02x", + ctx.Remote.Network, ctx.Remote.Node, ctx.Remote.Socket[0], ctx.Remote.Socket[1]) + respPayload = s.handleTreeConnectAndX(packet.Payload, conn) + + case CommandEcho: + netlog.Debug("[SMB][Session] echo src=%x.%x:%02x%02x", + ctx.Remote.Network, ctx.Remote.Node, ctx.Remote.Socket[0], ctx.Remote.Socket[1]) + if !isValidEchoTID(packet.Payload, conn) { + respPayload = buildSMBErrorResponse(packet.Payload, smbStatusBadTID) + break + } + respPayload = buildEchoResponse(packet.Payload) + + case CommandTreeDisconnect: + netlog.Debug("[SMB][Session] tree-disconnect src=%x.%x:%02x%02x", + ctx.Remote.Network, ctx.Remote.Node, ctx.Remote.Socket[0], ctx.Remote.Socket[1]) + conn.mu.Lock() + if len(packet.Payload) >= smbHeaderLen { + tid := binary.LittleEndian.Uint16(packet.Payload[smbOffTID : smbOffTID+2]) + delete(conn.tids, tid) + } + conn.mu.Unlock() + respPayload = buildSimpleSuccessResponse(packet.Payload) + + case CommandLogoffAndX: + netlog.Debug("[SMB][Session] logoff src=%x.%x:%02x%02x", + ctx.Remote.Network, ctx.Remote.Node, ctx.Remote.Socket[0], ctx.Remote.Socket[1]) + s.dropConn(connID) + respPayload = buildSimpleSuccessResponse(packet.Payload) + + case CommandTransaction: + if !isLANMANTransactionRequest(packet.Payload) { + netlog.Debug("[SMB][Session] unsupported transaction src=%x.%x:%02x%02x", + ctx.Remote.Network, ctx.Remote.Node, ctx.Remote.Socket[0], ctx.Remote.Socket[1]) + respPayload = buildSMBErrorResponse(packet.Payload, smbStatusNotSupported) + } else { + fc, ok := parseLANMANFunctionCode(packet.Payload) + if ok && fc == rapNetShareEnum { + netlog.Debug("[SMB][Session] NetShareEnum src=%x.%x:%02x%02x", + ctx.Remote.Network, ctx.Remote.Node, ctx.Remote.Socket[0], ctx.Remote.Socket[1]) + shares := s.netShareEnumEntries() + respPayload = buildNetShareEnumResponse(packet.Payload, shares) + } else if ok && fc == rapNetServerEnum2 { + serverType, _ := parseNetServerEnum2ServerType(packet.Payload) + reqDomain, _ := parseNetServerEnum2Domain(packet.Payload) + netlog.Debug("[SMB][Session] NetServerEnum2 src=%x.%x:%02x%02x serverType=%#x domain=%q", + ctx.Remote.Network, ctx.Remote.Node, ctx.Remote.Socket[0], ctx.Remote.Socket[1], serverType, reqDomain) + entries, rapStatus := s.netServerEnum2Entries(serverType, workgroup, reqDomain) + if rapStatus != 0 { + respPayload = buildNetServerEnum2RAPErrorResponse(packet.Payload, rapStatus) + } else { + respPayload = buildNetServerEnum2Response(packet.Payload, entries) + } + } else { + netlog.Debug("[SMB][Session] LANMAN fc=%#x src=%x.%x:%02x%02x", + fc, ctx.Remote.Network, ctx.Remote.Node, ctx.Remote.Socket[0], ctx.Remote.Socket[1]) + respPayload = buildSMBTransactionEmptySuccess(packet.Payload) + } + } + + case CommandQueryInformationDisk: + netlog.Debug("[SMB][Session] query-information-disk src=%x.%x:%02x%02x", + ctx.Remote.Network, ctx.Remote.Node, ctx.Remote.Socket[0], ctx.Remote.Socket[1]) + respPayload = s.handleQueryInformationDisk(packet.Payload, conn) + + case CommandQueryInformation: + netlog.Debug("[SMB][Session] query-information src=%x.%x:%02x%02x", + ctx.Remote.Network, ctx.Remote.Node, ctx.Remote.Socket[0], ctx.Remote.Socket[1]) + respPayload = s.handleQueryInformation(packet.Payload, conn) + + case CommandRead: + netlog.Debug("[SMB][Session] read src=%x.%x:%02x%02x", + ctx.Remote.Network, ctx.Remote.Node, ctx.Remote.Socket[0], ctx.Remote.Socket[1]) + respPayload = s.handleRead(packet.Payload, conn) + + case CommandSeek: + netlog.Debug("[SMB][Session] seek src=%x.%x:%02x%02x", + ctx.Remote.Network, ctx.Remote.Node, ctx.Remote.Socket[0], ctx.Remote.Socket[1]) + respPayload = s.handleSeek(packet.Payload, conn) + + case CommandTransaction2: + netlog.Debug("[SMB][Session] transaction2 src=%x.%x:%02x%02x", + ctx.Remote.Network, ctx.Remote.Node, ctx.Remote.Socket[0], ctx.Remote.Socket[1]) + respPayload = s.handleTransaction2(packet.Payload, conn) + + case CommandFindClose2: + netlog.Debug("[SMB][Session] find-close2 src=%x.%x:%02x%02x", + ctx.Remote.Network, ctx.Remote.Node, ctx.Remote.Socket[0], ctx.Remote.Socket[1]) + respPayload = s.handleFindClose2(packet.Payload, conn) + + case CommandCheckDirectory: + netlog.Debug("[SMB][Session] check-directory src=%x.%x:%02x%02x", + ctx.Remote.Network, ctx.Remote.Node, ctx.Remote.Socket[0], ctx.Remote.Socket[1]) + respPayload = s.handleCheckDirectory(packet.Payload, conn) + + case CommandSearch: + netlog.Debug("[SMB][Session] search src=%x.%x:%02x%02x", + ctx.Remote.Network, ctx.Remote.Node, ctx.Remote.Socket[0], ctx.Remote.Socket[1]) + respPayload = s.handleSearch(packet.Payload, conn) + + case CommandOpenAndX: + netlog.Debug("[SMB][Session] open-andx src=%x.%x:%02x%02x", + ctx.Remote.Network, ctx.Remote.Node, ctx.Remote.Socket[0], ctx.Remote.Socket[1]) + respPayload = s.handleOpenAndX(packet.Payload, conn) + + case CommandReadAndX: + netlog.Debug("[SMB][Session] read-andx src=%x.%x:%02x%02x", + ctx.Remote.Network, ctx.Remote.Node, ctx.Remote.Socket[0], ctx.Remote.Socket[1]) + respPayload = s.handleReadAndX(packet.Payload, conn) + + case CommandReadMPX: + netlog.Debug("[SMB][Session] read-mpx src=%x.%x:%02x%02x", + ctx.Remote.Network, ctx.Remote.Node, ctx.Remote.Socket[0], ctx.Remote.Socket[1]) + respPayload = s.handleReadMPX(packet.Payload, conn) + + case CommandWriteAndX: + netlog.Debug("[SMB][Session] write-andx src=%x.%x:%02x%02x", + ctx.Remote.Network, ctx.Remote.Node, ctx.Remote.Socket[0], ctx.Remote.Socket[1]) + respPayload = s.handleWriteAndX(packet.Payload, conn) + + case CommandWriteMPX: + netlog.Debug("[SMB][Session] write-mpx (rejected) src=%x.%x:%02x%02x", + ctx.Remote.Network, ctx.Remote.Node, ctx.Remote.Socket[0], ctx.Remote.Socket[1]) + respPayload = s.handleWriteMPX(packet.Payload, conn) + + case CommandWriteRaw: + netlog.Debug("[SMB][Session] write-raw (rejected) src=%x.%x:%02x%02x", + ctx.Remote.Network, ctx.Remote.Node, ctx.Remote.Socket[0], ctx.Remote.Socket[1]) + respPayload = s.handleWriteRaw(packet.Payload, conn) + + case CommandClose: + netlog.Debug("[SMB][Session] close src=%x.%x:%02x%02x", + ctx.Remote.Network, ctx.Remote.Node, ctx.Remote.Socket[0], ctx.Remote.Socket[1]) + respPayload = s.handleClose(packet.Payload, conn) + + case CommandFlush: + netlog.Debug("[SMB][Session] flush src=%x.%x:%02x%02x", + ctx.Remote.Network, ctx.Remote.Node, ctx.Remote.Socket[0], ctx.Remote.Socket[1]) + respPayload = s.handleFlush(packet.Payload, conn) + + case CommandLockingAndX: + netlog.Debug("[SMB][Session] locking-andx src=%x.%x:%02x%02x", + ctx.Remote.Network, ctx.Remote.Node, ctx.Remote.Socket[0], ctx.Remote.Socket[1]) + respPayload = s.handleLockingAndX(packet.Payload, conn) + + case CommandDelete: + netlog.Debug("[SMB][Session] delete src=%x.%x:%02x%02x", + ctx.Remote.Network, ctx.Remote.Node, ctx.Remote.Socket[0], ctx.Remote.Socket[1]) + respPayload = s.handleDelete(packet.Payload, conn) + + case CommandRename: + netlog.Debug("[SMB][Session] rename src=%x.%x:%02x%02x", + ctx.Remote.Network, ctx.Remote.Node, ctx.Remote.Socket[0], ctx.Remote.Socket[1]) + respPayload = s.handleRename(packet.Payload, conn) + + case CommandDeleteDirectory: + netlog.Debug("[SMB][Session] delete-directory src=%x.%x:%02x%02x", + ctx.Remote.Network, ctx.Remote.Node, ctx.Remote.Socket[0], ctx.Remote.Socket[1]) + respPayload = s.handleDeleteDirectory(packet.Payload, conn) + + case CommandCreateDirectory: + netlog.Debug("[SMB][Session] create-directory src=%x.%x:%02x%02x", + ctx.Remote.Network, ctx.Remote.Node, ctx.Remote.Socket[0], ctx.Remote.Socket[1]) + respPayload = s.handleCreateDirectory(packet.Payload, conn) + + case CommandOpen: + netlog.Debug("[SMB][Session] open src=%x.%x:%02x%02x", + ctx.Remote.Network, ctx.Remote.Node, ctx.Remote.Socket[0], ctx.Remote.Socket[1]) + respPayload = s.handleOpen(packet.Payload, conn) + + case CommandCreate: + netlog.Debug("[SMB][Session] create src=%x.%x:%02x%02x", + ctx.Remote.Network, ctx.Remote.Node, ctx.Remote.Socket[0], ctx.Remote.Socket[1]) + respPayload = s.handleCreate(packet.Payload, conn) + + case CommandWrite: + netlog.Debug("[SMB][Session] write src=%x.%x:%02x%02x", + ctx.Remote.Network, ctx.Remote.Node, ctx.Remote.Socket[0], ctx.Remote.Socket[1]) + respPayload = s.handleWrite(packet.Payload, conn) + + default: + netlog.Debug("[SMB][Session] unsupported command=0x%02x src=%x.%x:%02x%02x", + cmd, ctx.Remote.Network, ctx.Remote.Node, ctx.Remote.Socket[0], ctx.Remote.Socket[1]) + respPayload = buildSMBErrorResponse(packet.Payload, smbStatusNotSupported) + } + + if respPayload == nil { + return nil, nil + } + stampSMBResponseHeader(respPayload) + return &netbiosproto.SessionPacket{ + Type: netbiosproto.SessionMessage, + Payload: respPayload, + }, nil +} diff --git a/service/smb/share.go b/service/smb/share.go new file mode 100644 index 0000000..ece0fda --- /dev/null +++ b/service/smb/share.go @@ -0,0 +1,13 @@ +package smb + +// ShareConfig defines a single SMB share. The fs_type field selects a +// pkg/vfs backend (e.g. "local_fs", "macgarden"); when blank, the SMB +// service falls back to "local_fs". The shape mirrors AFP's +// VolumeConfig deliberately so per-volume TOML tables look the same +// across services. +type ShareConfig struct { + Name string `koanf:"name"` + Path string `koanf:"path"` + FSType string `koanf:"fs_type"` + ReadOnly bool `koanf:"read_only"` +} diff --git a/service/smb/state.go b/service/smb/state.go new file mode 100644 index 0000000..da9d075 --- /dev/null +++ b/service/smb/state.go @@ -0,0 +1,191 @@ +package smb + +import ( + "fmt" + "hash/fnv" + "strings" + "sync" + + "github.com/ObsoleteMadness/ClassicStack/pkg/vfs" + "github.com/ObsoleteMadness/ClassicStack/service/netbios" +) + +type connKey uint64 + +type connState struct { + mu sync.Mutex + uid uint16 + tids map[uint16]treeSlot + fids map[uint16]*fileHandle + searches map[uint16]*searchHandle + lockTables map[string]*lockTable + nextTID uint16 + nextFID uint16 + nextSID uint16 + maxBufferSize uint16 +} + +type treeSlot struct { + shareIdx int +} + +type fileHandle struct { + file vfs.File + path string + tid uint16 + writable bool + offset int64 + // mpxAccum is the running OR of RequestMask values from every + // SMB_COM_WRITE_MPX received since the last sequenced (final) + // request. Per [MS-CIFS] 2.2.4.26.2 / 3.3.5.27 the server replies + // only to the sequenced request (SMB header SequenceNumber != 0) + // and returns this accumulated mask as ResponseMask. Replying to + // non-sequenced requests breaks Win9x's window state machine and + // causes it to skip chunks; staying silent until the sequencing + // signal arrives is what the spec mandates and what works. + mpxAccum uint32 +} + +type searchHandle struct { + entries []findFirst2Row + idx int + tid uint16 + pattern string + attrs uint16 +} + +type lockEntry struct { + fid uint16 + pid uint16 + start int64 + length int64 +} + +type lockTable struct { + mu sync.Mutex + locks []lockEntry +} + +func connKeyFromSession(ctx netbios.SessionContext) connKey { + if ctx.SourceConnID != 0 { + return connKey(ctx.SourceConnID) + } + h := fnv.New64a() + _, _ = h.Write(ctx.Remote.Network[:]) + _, _ = h.Write(ctx.Remote.Node[:]) + _, _ = h.Write(ctx.Remote.Socket[:]) + return connKey(h.Sum64()) +} + +func (s *Service) allocUID() uint16 { + s.mu.Lock() + defer s.mu.Unlock() + s.nextUID++ + if s.nextUID == 0 { + s.nextUID++ + } + return s.nextUID +} + +func (s *Service) lookupConn(connID connKey) *connState { + s.connsMu.Lock() + conn := s.conns[connID] + s.connsMu.Unlock() + return conn +} + +func (s *Service) ensureConn(connID connKey) *connState { + s.connsMu.Lock() + defer s.connsMu.Unlock() + if s.conns == nil { + s.conns = map[connKey]*connState{} + } + if conn := s.conns[connID]; conn != nil { + return conn + } + conn := &connState{ + tids: map[uint16]treeSlot{}, + fids: map[uint16]*fileHandle{}, + searches: map[uint16]*searchHandle{}, + lockTables: map[string]*lockTable{}, + } + s.conns[connID] = conn + return conn +} + +func (s *Service) dropConn(connID connKey) { + s.connsMu.Lock() + conn := s.conns[connID] + delete(s.conns, connID) + s.connsMu.Unlock() + if conn != nil { + s.closeConnFiles(conn) + } +} + +func (s *Service) closeConnFiles(conn *connState) { + conn.mu.Lock() + files := make([]*fileHandle, 0, len(conn.fids)) + for _, h := range conn.fids { + if h != nil { + files = append(files, h) + } + } + conn.fids = map[uint16]*fileHandle{} + conn.searches = map[uint16]*searchHandle{} + conn.tids = map[uint16]treeSlot{} + conn.lockTables = map[string]*lockTable{} + conn.mu.Unlock() + for _, h := range files { + _ = h.file.Close() + } +} + +func (s *Service) dropAllConnectionsLocked() { + s.connsMu.Lock() + all := make([]*connState, 0, len(s.conns)) + for _, conn := range s.conns { + all = append(all, conn) + } + s.conns = map[connKey]*connState{} + s.connsMu.Unlock() + for _, conn := range all { + s.closeConnFiles(conn) + } +} + +func (s *Service) initShareBackendsLocked() error { + shareFSes := map[int]vfs.FileSystem{} + shareNameToIndex := map[string]int{} + + for idx, share := range s.shares { + name := normalizeBrowserName(share.Name) + if name == "" { + return fmt.Errorf("smb: share %d has empty name", idx) + } + if _, exists := shareNameToIndex[name]; exists { + return fmt.Errorf("smb: duplicate share name %q", share.Name) + } + + fsType := strings.TrimSpace(share.FSType) + if fsType == "" { + fsType = "local_fs" + } + fsys, err := vfs.New(fsType, vfs.Params{ + Name: share.Name, + Path: share.Path, + ReadOnly: share.ReadOnly, + ShortnameMapper: s.opts.Shortname, + }) + if err != nil { + return fmt.Errorf("smb: init share %q (%s): %w", share.Name, fsType, err) + } + + shareFSes[idx] = fsys + shareNameToIndex[name] = idx + } + + s.shareFSes = shareFSes + s.shareNameToIndex = shareNameToIndex + return nil +} diff --git a/spec/[MS-BRWS]-240916.docx b/spec/[MS-BRWS]-240916.docx new file mode 100644 index 0000000..b80de5b Binary files /dev/null and b/spec/[MS-BRWS]-240916.docx differ diff --git a/spec/[MS-BRWS].pdf b/spec/[MS-BRWS].pdf new file mode 100644 index 0000000..fc427d9 Binary files /dev/null and b/spec/[MS-BRWS].pdf differ diff --git a/spec/[MS-CIFS]-251121.docx b/spec/[MS-CIFS]-251121.docx new file mode 100644 index 0000000..f561038 Binary files /dev/null and b/spec/[MS-CIFS]-251121.docx differ diff --git a/spec/[MS-CIFS].pdf b/spec/[MS-CIFS].pdf new file mode 100644 index 0000000..c6eaa71 Binary files /dev/null and b/spec/[MS-CIFS].pdf differ diff --git a/spec/[MS-SMB]-130808.doc b/spec/[MS-SMB]-130808.doc new file mode 100644 index 0000000..719499f Binary files /dev/null and b/spec/[MS-SMB]-130808.doc differ diff --git a/spec/[MS-SMB]-160714.docx b/spec/[MS-SMB]-160714.docx new file mode 100644 index 0000000..a7c9160 Binary files /dev/null and b/spec/[MS-SMB]-160714.docx differ diff --git a/spec/iee802.md b/spec/iee802.md new file mode 100644 index 0000000..27718b0 --- /dev/null +++ b/spec/iee802.md @@ -0,0 +1,36594 @@ +## Page 1 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Book Cover + +COVER Book Cover +--- +LAN Technical Reference +IEEE 802.2 and NetBIOS +Application Program Interfaces +Document Number SC30-3587-01 +--- +| Copyright IBM Corp. 1986, 1996 +COVER - 1 + +--- + + +## Page 2 + +NOTICES Notices + ++--- Note -----------------------------------------------------------+ +| Before using this information and the products it supports, be | +| sure to read the general information under "Notices" in | +| topic FRONT_1. | ++-------------------------------------------------------------------+ + +
Copyright IBM Corp. 1986, 1996
+
NOTICES - 1
+ +--- + + +## Page 3 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Edition Notice + +EDITION Edition Notice +Second Edition (May 1996) + +Order publications through your IBM representative or the IBM branch office serving your locality. Publications are not stocked at the address given below. + +A form for readers' comments appears at the back of this publication. If the form has been removed, address your comments to: + +Department CGF +Design & Information Development +IBM Corporation +PO Box 12195 +RESEARCH TRIANGLE PARK NC 27709 +USA + +When you send information to IBM, you grant IBM a nonexclusive right to use or distribute the information in any way it believes appropriate without incurring any obligation to you. + +| Copyright International Business Machines Corporation 1986, 1996. +All rights reserved. +Note to U.S. Government Users -- Documentation related to restricted rights -- Use, duplication or disclosure is subject to restrictions set forth in GSA ADP Schedule Contract with IBM Corp. + +
Copyright IBM Corp. 1986, 1996 +EDITION - 1
+ +--- + + +## Page 4 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Table of Contents + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CONTENTSTable of Contents
COVERBook Cover
NOTICESNotices
EDITIONEdition Notice
CONTENTSTable of Contents
FIGURESFigures
TABLESTables
FRONT_1Notices
FRONT_1.1Trademarks
PREFACEPreface
PREFACE.1How This Manual Is Organized
PREFACE.2Related IBM Publications
PREFACE.3Guide to Information about the TCP/IP Interface
PREFACE.3.1General Publications
PREFACE.3.2Programming Publications
PREFACE.4Guide to Information About the Open Data-Link Interface (ODI)
PREFACE.5IBM LAN OEMI
CHANGESHow This Manual Differs from the Previous Edition of the IBM LAN Technical Reference 802.2 and NetBIOS APIs
1.0Chapter 1. LAN Overview and Interfaces
1.1About This Chapter
1.2Drivers and Programs That Provide the APIs
1.2.1NDIS and non-NDIS Adapters
1.2.2IBM Programs to Support LAN Adapters
1.2.3IBM LAN Client
1.3Where to Find Information about IBM Adapter Interfaces
1.4Introduction to the Networks
1.5LANS
1.5.1The IBM Token-Ring Network
1.5.2The IBM PC Network (Broadband)
1.5.3The IBM PC Network (Baseband)
1.5.4Ethernet Support
1.6Related Software
1.7OS/2 Communications Manager (OS/2 EE 1.3)
1.7.1IEEE 802.2 Application Program Interface in OS/2
1.7.2Differences between the Dynamic Link Routine Interface and the Device Driver Interface
1.8Why Use IEEE 802.2 or NetBIOS?
1.9IBM LAN Application Program Interfaces
1.10IEEE 802.2 Interface
1.10.1Direct Interface
1.10.2DLC Interface
1.11APPC/PC Interface
1.12NetBIOS
1.13Token-Ring Network Frame Definition
1.13.1Routing Information Field
1.13.2Routing Control Field
1.13.3Route Designator Fields
1.14Frame Format on the PC Network
1.15Ethernet IEEE 802.3 Frame Format
1.16Ethernet DIX Version 2.0 Frame Format
1.16.1Ethernet Frame Field Descriptions
2.0Chapter 2. Programming Conventions for the IEEE 802.2 Interface
2.1About This Chapter
2.2IBM Program Products for LAN Adapter Support
2.3IEEE 802.2 Programming Conventions with DOS
2.3.1LAN Support Program (CCB1) Calling Conventions
2.3.2LAN Support Program (CCB1) Command Completion
2.3.3LAN Support Program (CCB1) Control Blocks
2.4Programming Conventions with OS/2
2.4.1OS/2 DLR Interface
2.4.2OS/2 DD Interface
2.5Control Blocks for All CCBs
2.5.1CCB Field Explanations
2.6Addressing
2.7Adapter Addresses
2.7.1Stations, SAPs, and IDs
2.7.2SAP Assignments
2.8DLC
2.8.1Types of Service
2.8.2Command Sequences
2.8.3Link Station States
2.8.4Timers
2.8.5Guidelines for Selecting Parameter Values
2.9Transmitting, Receiving, and Buffers
2.9.1Buffer Pools
2.9.2Receive Buffers
2.9.3Transmit Buffers
3.0Chapter 3. The Command Control Blocks
3.1About This Chapter
3.2IBM LAN Client 802.2 Application Program Interface (API)
3.3Command Descriptions
3.3.1BUFFER.FREE
3.3.2BUFFER.GET
3.3.3DIR.CLOSE.ADAPTER
3.3.4DIR.CLOSE.DIRECT
+ +
Copyright IBM Corp. 1986, 1996
+<page_number>CONTENTS - 1</page_number> + +--- + + +## Page 5 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Table of Contents + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
3.3.5DIR.DEFINE.MIF.ENVIRONMENT
3.3.6DIR.INITIALIZE
3.3.7DIR.INTERRUPT
3.3.8DIR.MODIFY.OPEN.PARMS
3.3.9DIR.OPEN.ADAPTER
3.3.10DIR.OPEN.DIRECT
3.3.11DIR.READ.LOG
3.3.12DIR.RESET.MULT.GROUP.ADDRESS
3.3.13DIR.RESTORE.OPEN.PARMS
3.3.14DIR.SET.EXCEPTION.FLAGS
3.3.15DIR.SET.FUNCTIONAL.ADDRESS
3.3.16DIR.SET.GROUP.ADDRESS
3.3.17DIR.SET.MULT.GROUP.ADDRESS
3.3.18DIR.SET.USER.APPENDAGE
3.3.19DIR.STATUS
3.3.20DIR.TIMER.CANCEL
3.3.21DIR.TIMER.CANCEL.GROUP
3.3.22DIR.TIMER.SET
3.3.23DLC.CLOSE.SAP
3.3.24DLC.CLOSE.STATION
3.3.25DLC.CONNECT.STATION
3.3.26DLC.FLOW.CONTROL
3.3.27DLC.MODIFY
3.3.28DLC.OPEN.SAP
3.3.29DLC.OPEN.STATION
3.3.30DLC.REALLOCATE
3.3.31DLC.RESET
3.3.32DLC.SET.THRESHOLD
3.3.33DLC.STATISTICS
3.3.34PDT.TRACE.OFF
3.3.35PDT.TRACE.ON
3.3.36PURGE.RESOURCES
3.3.37READ
3.3.38READ.CANCEL
3.3.39RECEIVE
3.3.40RECEIVE.CANCEL
3.3.41RECEIVE.MODIFY
3.3.42TRANSMIT.DIR.FRAME
3.3.43TRANSMIT.I.FRAME
3.3.44TRANSMIT.TEST.CMD
3.3.45TRANSMIT.UI.FRAME
3.3.46TRANSMIT.XID.CMD
3.3.47TRANSMIT.XID.RESP.FINAL
3.3.48TRANSMIT.XID.RESP.NOT.FINAL
4.0Chapter 4. NetBIOS
4.1About This Chapter
4.2NetBIOS Overview
4.3IBM LAN Client NetBIOS Application Program Interface (API)
4.3.1NCB.RESET
4.3.2NCB.STATUS (Adapter Status)
4.4The Network Control Block
4.4.1NCB Field Explanations
4.5NetBIOS Operational Parameters
4.5.1LAN Support Program Old Parameters
4.5.2LAN Support Program New Parameters
4.5.3NetBIOS 3.0 (OS/2 EE)
4.5.4NetBIOS 4.0
4.5.5NetBIOS DLC Timers
4.5.6NetBIOS Calling Conventions Using the LAN Support Program
4.5.7NetBIOS Calling Conventions Using the Dynamic Link Routine Interface
4.5.8NetBIOS Calling Conventions Using the Device Driver Interface
4.5.9NCB Completion with Wait Type Commands
4.5.10NCB Completion with No-Wait Type Commands
4.6NetBIOS Command Descriptions
4.6.1NCB.ADD.GROUP.NAME
4.6.2NCB.ADD.NAME
4.6.3NCB.CALL
4.6.4NCB.CANCEL
4.6.5NCB.CHAIN.SEND
4.6.6NCB.CHAIN.SEND.NO.ACK
4.6.7NCB.DELETE.NAME
4.6.8NCB.FIND.NAME
4.6.9NCB.HANG.UP
4.6.10NCB.LAN.STATUS.ALERT
4.6.11NCB.LISTEN
4.6.12NCB.RECEIVE
4.6.13NCB.RECEIVE.ANY
4.6.14NCB.RECEIVE.BROADCAST.DATAGRAM
4.6.15NCB.RECEIVE.DATAGRAM
4.6.16NCB.RESET
4.6.17NCB.SEND
4.6.18NCB.SEND.BROADCAST.DATAGRAM
4.6.19NCB.SEND.DATAGRAM
4.6.20NCB.SEND.NO.ACK
+ +
Copyright IBM Corp. 1986, 1996
+
CONTENTS -2
+ +--- + + +## Page 6 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Table of Contents + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
4.6.21NCB.SESSION.STATUS
4.6.22NCB.STATUS
4.6.23NCB.TRACE
4.6.24NCB.UNLINK
5.0Chapter 5. The NetBIOS Frames Protocol
5.1About This Chapter
5.1.1Assumptions
5.1.2Related Documents
5.2NetBIOS Protocol in the IBM LAN Client
5.3Terms and Definitions
5.4NetBIOS Commands
5.5General Information on Remote Name Directory
5.5.1New NCB Commands
5.5.2Header Format Overview
5.5.3NetBIOS Header
5.5.4NetBIOS Frame Summary
5.6NetBIOS Frame Formats and Descriptions
5.6.1ADD_GROUP_NAME_QUERY
5.6.2ADD_NAME_QUERY
5.6.3NAME_IN_CONFLICT
5.6.4STATUS_QUERY
5.6.5TERMINATE_TRACE
5.6.6DATAGRAM
5.6.7DATAGRAM_BROADCAST
5.6.8NAME_QUERY
5.6.9ADD_NAME_RESPONSE
5.6.10NAME_RECOGNIZED
5.6.11STATUS_RESPONSE
5.6.12TERMINATE_TRACE
5.6.13DATA_ACK
5.6.14DATA_FIRST_MIDDLE
5.6.15DATA_ONLY_LAST
5.6.16SESSION_CONFIRM
5.6.17SESSION_END
5.6.18SESSION_INITIALIZE
5.6.19NO_RECEIVE
5.6.20RECEIVE_OUTSTANDING
5.6.21RECEIVE_CONTINUE
5.6.22SESSION_ALIVE
5.7NetBIOS Protocol Examples without RND
5.7.1Name Management Examples
5.7.2Remote Adapter Status Examples
5.7.3Session Establishment Examples
5.7.4Session Data Transfer Examples
5.7.5NetBIOS Protocol Examples with RND
5.7.6Session Establishment RND Examples
5.7.7NetBIOS Protocol SEND.NO.ACK Examples
5.7.8Session Establishment Examples
5.7.9Session Data Transfer Examples
6.0Chapter 6. Support of NDIS Adapters Using IBM OS/2 LAN Adapter and Protocol Support
6.1LAN Adapter and Protocol Support Overview
6.2LAN Adapters Supported
6.3Programming Information--IEEE 802.2 API
6.3.1Dynamic Link Interface
6.3.2Device Driver Interface
6.3.3Memory Restriction
6.4Programming Information--NetBIOS API
6.4.1No Wait Command and Post Routines
6.4.2Dynamic Link Interface
6.4.3Device Driver Interface
6.4.4Memory Restriction
6.4.5Resource Information
6.4.6NCB Reserve Field Change
6.4.7NCB.STATUS Command Extension
6.4.8Piggybacked Acknowledgment Behavior
6.5Differences and Restrictions
6.6Message Logging Facility
6.7Operating System/2 Trace Facility
6.7.1New Tracing Parameters for the NetBIOS and IEEE 802.2 APIs
6.7.2Minor Codes for IEEE 802.2 Traces
6.7.3PROTOCOL.INI TRACE Parameter--IEEE 802.2
6.7.4Minor Codes for NetBIOS Traces
6.7.5PROTOCOL.INI OS2TRACEMASK Parameter--NetBIOS
6.7.6Tracing for OS/2 2.0 Virtual DOS LAN Support
A.0Appendix A. Valid Commands
A.1DLC and Direct Interface Commands
A.2NetBIOS Commands
B.0Appendix B. Return Codes
B.1About This Appendix
B.2CCB Return Codes Listed by Interface
B.2.1CCB Return Codes Listed by Command
B.2.2CCB Return Codes Cause and Action
B.3DLC Status Codes
B.3.1DLC Status Table
+ +
Copyright IBM Corp. 1986, 1996
+
CONTENTS - 3
+ +--- + + +## Page 7 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Table of Contents + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
B.3.2DLC Status Codes
B.3.3Suggested Actions in Response to DLC Status
B.4NCB Return Codes
B.4.1NCB Return Codes Listed by Command
B.4.2NCB Return Codes Cause and Action
B.5Adapter Status Parameter Table
B.6Exception Indications
B.7Adapter Check
B.7.1Adapter Check for CCB1
B.7.2Adapter Check for CCB2
B.7.3Adapter Check for CCB3
B.8Token-Ring Network Adapter Check Reason Codes for All CCBs
B.9PC Network and Ethernet Adapter Check Reason Codes for All CCBs
B.10Network Status
B.10.1Network Status for CCB1
B.10.2Network Status for CCB2
B.10.3Network Status for CCB3
B.10.4Token-Ring Network Status Codes for All CCBs
B.10.5PC Network and Ethernet Status Codes for All CCBs
B.11Bring-Up Errors for All CCBs
B.12Token-Ring Network Adapter Open Errors for All CCBs
B.12.1Open Error Codes for All CCBs
B.12.2Suggested Actions in Response to Open Errors
B.13PC Network and Ethernet Adapter Open Errors for All CCBs
B.14PC System Detected Errors
B.14.1PC System Detected Errors for CCB1
B.14.2PC System Detected Errors for CCB2
B.14.3PC System Detected Errors for CCB3
B.15System Action Exceptions for OS/2 EE 1.3
B.15.1System Action Exceptions for CCB2
B.15.2System Action Exceptions for CCB3
C.0Appendix C. LAN Sample Program Listings Diskette
D.0Appendix D. The LAN Support Program Interrupt Arbitrator
D.1About This Appendix
D.2The LAN Support Program Interrupt Arbitrator (DXMA0MOD.SYS)
D.2.1Registration Process Overview
E.0Appendix E. Operating System/2 Extended Edition Information
E.1About This Appendix
E.2CONFIG.SYS Commands
E.2.1Adapter Parameters
E.2.2DLC Parameters
E.3OS/2 EE NetBIOS Parameters
E.4OS/2 EE Trace Facility
E.5Trace Code Definition
E.5.1Trace Entry Format
E.5.2Trace Code Formats
E.6OS/2 EE NetBIOS Trace Facility
F.0Appendix F. NDIS Overview
F.1About This Appendix
F.2Description of NDIS
ABBREVIATIONList of Abbreviations
GLOSSARYGlossary
INDEXIndex
COMMENTSTell Us What You Think!
+ +
Copyright IBM Corp. 1986, 1996
+
CONTENTS - 4
+ +--- + + +## Page 8 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Figures + +FIGURES Figures +1-1. DOS IEEE 802.2 and NetBIOS Interfaces 1.9 +1-2. OS/2 EE Communications Manager Interfaces 1.9 +1-3. Token-Ring Network Frame Format 1.13 +1-4. Routing Information Field 1.13.1 +1-5. Routing Control Field 1.13.2 +1-6. Route Designator Field 1.13.3 +1-7. PC Network Frame Format 1.14 +1-8. IEEE 802.3 Frame Format 1.15 +1-9. DIX Version 2.0 Frame Format 1.16 +2-1. Universally Administered Adapter Address 2.7 +2-2. Ethernet Universally Administered Adapter Address 2.7 +2-3. Locally Administered Adapter Address 2.7 +2-4. SAPs and Link Stations 2.7.2 +2-5. Receive Buffer Formats 2.9.2.1 +2-6. Transmit Buffers 2.9.3.1 +2-7. MAC Frame 2.9.3.1 +2-8. Non-MAC I-Format LPDU 2.9.3.1 +2-9. Other Non-MAC Frame 2.9.3.1 +3-1. Byte 0: Adapter Number (0/1) and Activation Reason Code 3.3.35.2 +3-2. Timer Entry 3.3.35.2 +3-3. Initialize Entry 3.3.35.2 +3-4. CRB Entry 3.3.35.2 +3-5. ARB Entry 3.3.35.2 +3-6. FCB Entry 3.3.35.2 +3-7. TXCB Entry 3.3.35.2 +5-1. NetBIOS Frame Example 5.5.2 +5-2. General Format 5.5.3 +5-3. NetBIOS Non-Session Frame Header (DLC UI-Frame) 5.5.3.1 +5-4. NetBIOS Session Frame Header (DLC I-Format LPDU) 5.5.3.2 +5-5. Add a Name to the Network Command Sequence 5.7.1.1 +5-6. Name Already on Network Command Sequence 5.7.1.2 +5-7. Receive Multiple Responses Command Sequence 5.7.1.3 +5-8. Remote Adapter Status for a Name That Is Not on the Network Command Sequence 5.7.2.1 +5-9. Remote Adapter Status for a Name that Is on the Network Command Sequence 5.7.2.2 +5-10. Remote Adapter Status Data: Segmentation Command Sequence 5.7.2.3 +5-11. Call a Name: Name Not on Network Command Sequence 5.7.3.1 +5-12. Call a Name: Name on Network but No Listen Command Sequence 5.7.3.2 +5-13. Call a Name: Name Found--Start Session Command Sequence 5.7.3.3 +5-14. Send Session Data: One Send and One Receive Command Sequence 5.7.4.1 +5-15. Send Session Data: One Send and Multiple Receives Command Sequence 5.7.4.2 +5-16. Send Session Data: Segmentation and One Receive Command Sequence 5.7.4.3 +5-17. Send Session Data: Segmentation and Multiple Receives Command Sequence 5.7.4.4 +5-18. Remote Adapter Status for a Name Not on Network or RND Command Sequence 5.7.5.1 +5-19. Remote Adapter Status for a Name Not in RND but on the Network Command Sequence 5.7.5.2 +5-20. Remote Adapter Status for a Remote Name That Is in RND Command Sequence 5.7.5.3 +5-21. Call a Name: Name Not on Network or RND Command Sequence 5.7.6.1 +5-22. Call a Name: Name Not in RND but Is on Network--Start Session Command Sequence 5.7.6.2 +5-23. Call a Name: Name Found--Start Session Command Sequence 5.7.8.1 +5-24. Send Session Data: One SEND.NO.ACK and No RECEIVE Command Sequence 5.7.9.1 +5-25. Send Session Data: One SEND.NO.ACK and One RECEIVE Command Sequence 5.7.9.2 +5-26. Send Session Data: One SEND.NO.ACK and Multiple RECEIVES Command Sequence 5.7.9.3 +6-1. LAN Adapter and Protocol Support Diagram 6.1 +6-2. Sample LANTRAN.LOG 6.6 +E-1. CCB Trace Entry E.5.2.1 +E-2. CCB Completion Trace Entry E.5.2.2 +E-3. Receive Completion Trace Entry E.5.2.3 +E-4. Status Exception Completion Trace Entry E.5.2.4 +E-5. Interrupt Received Trace Entry E.5.2.5 +E-6. Interrupt Error Trace Entry E.5.2.6 +F-1. Major Components in the NDIS Environment F.2 + +
Copyright IBM Corp. 1986, 1996
+<page_number>FIGURES - 1</page_number> + +--- + + +## Page 9 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LAN Technical Reference: 802.2 and NetBIOS APIs
Tables
TABLES Tables
2-1.CCB1 Command Control Block2.3.3
2-2.CCB2 Command Control Block2.4.1.6
2-3.CCB3 Command Control Block2.4.2.5
2-4.Command Completion Appendage Information Table 2.5.1
2-5.Start Command Sequence for CCB1 and CCB32.8.2
2-6.Start Command Sequence for CCB22.8.2
2-7.End Command Sequence2.8.2
2-8.DLC Parameters2.8.5
2-9.Maximum I-field Length for Network Adapters 2.8.5
2-10.Buffer 1: Option = Not Contiguous MAC/DATA2.9.2.1
2-11.Buffer 1: Option = Contiguous MAC/DATA2.9.2.1
2-12.Buffer 2 and Subsequent Buffers2.9.2.2
2-13.Transmit Buffers (XMIT_QUEUE_ONE and XMIT_QUEUE_TWO)2.9.3.1
2-14.Transmit Buffer Size in Bytes2.9.3.1
3-1.CCB Parameter Table for BUFFER.FREE3.3.1
3-2.CCB Parameter Table for BUFFER.GET3.3.2
3-3.Appendage Instruction Sequence3.3.5
3-4.CCB Parameter Table for DIR.DEFINE.MIF.ENVIRONMENT3.3.5
3-5.CCB Parameter Table for DIR.INITIALIZE3.3.6
3-6.CCB Parameter Table for DIR.MODIFY.OPEN.PARMS3.3.8
3-7.CCB Parameter Table for DIR.OPEN.ADAPTER3.3.9
3-8.Adapter Parms Open Parameters3.3.9
3-9.IBM Token-Ring Network Adapter OPEN_OPTIONS3.3.9
3-10.Product ID Field3.3.9
3-11.Direct Parms Open Parameters for CCB1 3.3.9
3-12.DLC Parms Open Parameters for All CCBs3.3.9
3-13.CCB Parameter Table for DIR.OPEN.DIRECT3.3.10
3-14.CCB Parameter Table for DIR.READ.LOG3.3.11
3-15.Log Formats for the Adapter Log3.3.11.1
3-16.Log Formats for the Direct Interface Log. 3.3.11.1
3-17.DIR.RESET.MULT.GROUP.ADDRESS Parameter Table for CCB1 3.3.12
3-18.CCB Parameter Table for DIR.SET.EXCEPTION.FLAGS3.3.14
3-19.DIR.SET.MULT.GROUP.ADDRESS Parameter Table for CCB1 3.3.17
3-20.CCB Parameter Table for DIR.SET.USER.APPENDAGE3.3.18
3-21.CCB Parameter Table for DIR.STATUS3.3.19
3-22.MICROCODE_LEVEL Fields3.3.19
3-23.Extended Status Table3.3.19
3-24.GROUP_ADDRESS_LIST3.3.19
3-25.CCB Parameter Table for DLC.CONNECT.STATION 3.3.25
3-26.CCB Parameter Table for DLC.MODIFY3.3.27
3-27.CCB Parameter Table for DLC.OPEN.SAP3.3.28
3-28.CCB Parameter Table for DLC.OPEN.STATION3.3.29
3-29.CCB Parameter Table for DLC.REALLOCATE3.3.30
3-30.CCB Parameter Table for DLC.SET.THRESHOLD Command and Paramaters are for CCB2 only 3.3.32
3-31.CCB Parameter Table for DLC.STATISTICS3.3.33
3-32.Log Formats for the SAP Log3.3.33.1
3-33.Log Formats for the Link Station Log3.3.33.1
3-34.CCB Parameter Table for PDT.TRACE.ON3.3.35
3-35.CCB Trace Entry3.3.35.1
3-36.Byte 1: Flags3.3.35.1
3-37.Adapter Interrupt Trace Entry (Except Timer) 3.3.35.1
3-38.Byte 0: Interrupt Status Register Processor (ISRP) Even3.3.35.1
3-39.Byte 1: Interrupt Status Register Processor (ISRP) Odd3.3.35.1
3-40.Adapter Timer Interrupt Trace Entry3.3.35.1
3-41.NCB Trace Entry3.3.35.1
3-42.CCB Trace Entry3.3.35.2
3-43.Byte 1: Flags3.3.35.2
3-44.Interrupt Trace Entry3.3.35.2
3-45.NCB Trace Entry3.3.35.2
3-46.CCB Parameter Table for READ3.3.37
3-47.Posted CCB Fields for Each Event3.3.37
3-48.CCB Parameter Table for RECEIVE3.3.39
3-49.CCB Parameter Table for RECEIVE.MODIFY3.3.41
3-50.CCB Parameter Table for TRANSMIT Commands 3.3.48.1
4-1.Network Control Block (NCB)4.4.1
4-2.NCB_RESERVE for the LAN Support Program4.4.1
4-3.NCB_RESERVE for OS/2 EE4.4.1
4-4.LAN Support Program Old Parameters4.5.1
4-5.Data Areas Returned for the NCB.FIND.NAME Command 4.6.8
4-6.Data Areas Returned for the NCB.SESSION.STATUS Command 4.6.21
4-7.Data Areas Returned for the NCB.STATUS Command 4.6.22
4-8.Adapter Types4.6.22
4-9.Trace Entry Format Example4.6.23
4-10.The Trace Table Header Format4.6.23
4-11.Trace Entry Format (Bytes 0 through 5)4.6.23
4-12.Trace Entry Format (Bytes 6 through 31)4.6.23
5-1.NetBIOS Frames Listed Alphabetically5.5.4
5-2.NetBIOS Frames Listed Numerically5.5.4
5-3.NetBIOS Name Management Frames5.5.4.1
5-4.NetBIOS Session Establishment and Termination Frames5.5.4.1
5-5.NetBIOS Data Transfer Frames5.5.4.1
5-6.Additional NetBIOS Frames5.5.4.1
+ +
Copyright IBM Corp. 1986, 1996
+<page_number>TABLES - 1</page_number> + +--- + + +## Page 10 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Tables + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
5-7.NetBIOS UI Frames to Functional Address, Single-Route Broadcast5.5.4.2
5-8.NetBIOS UI Frames to Specific Address, No Broadcast5.5.4.2
5-9.NetBIOS UI Frames to Specific Address, General Broadcast5.5.4.2
5-10.NetBIOS I-Format LPDU to Specific Address, No Broadcast5.5.4.2
5-11.ADD_GROUP_NAME_QUERY Frame Format5.6.1
5-12.ADD_NAME_QUERY Frame Format5.6.2
5-13.NAME_IN_CONFLICT Frame Format5.6.3
5-14.STATUS_QUERY Frame Format5.6.4
5-15.TERMINATE_TRACE Frame Format5.6.5
5-16.DATAGRAM Frame Format5.6.6
5-17.DATAGRAM_BROADCAST Frame Format5.6.7
5-18.NAME_QUERY Frame Format5.6.8
5-19.ADD_NAME_RESPONSE Frame Format5.6.9
5-20.NAME_RECOGNIZED Frame Format5.6.10
5-21.STATUS_RESPONSE Frame Format5.6.11
5-22.TERMINATE_TRACE Frame Format5.6.12
5-23.DATA_ACK Frame Format5.6.13
5-24.DATA_FIRST_MIDDLE Frame Format5.6.14
5-25.DATA_ONLY_LAST Frame Format5.6.15
5-26.SESSION_CONFIRM Frame Format5.6.16
5-27.SESSION_END Frame Format5.6.17
5-28.SESSION_INITIALIZE Frame Format5.6.18
5-29.NO_RECEIVE Frame Format5.6.19
5-30.RECEIVE_OUTSTANDING Frame Format5.6.20
5-31.RECEIVE_CONTINUE Frame Format5.6.21
5-32.SESSION_ALIVE Frame Format5.6.22
6-1.DLC Status Event Trace Entry6.7.2
6-2.Exception Event Trace Entry6.7.2
6-3.IEEE 802.2 TRACE Bit Definition6.7.3
6-4.DLC Status Event Trace Entry6.7.4
6-5.NetBIOS OS2TRACEMASK Bit Definition6.7.5
A-1.DLC and Direct Interface CommandsA.1
A-2.NetBIOS CommandsA.2
B-1.CCB Return Codes Listed by InterfaceB.2
B-2.DLC Status TableB.3.1
B-3.DLC Status CodesB.3.2
B-4.NCB Return CodesB.4
B-5.Token-Ring Network Adapter Status Parameter TableB.5
B-6.PC Network and Ethernet Adapter Status Parameter TableB.5
B-7.Adapter Check for CCB1B.7.1
B-8.Adapter Check for CCB2B.7.2
B-9.Adapter Check for CCB3B.7.3
B-10.IBM Token-Ring Network Adapter Check Reason Codes for All CCBsB.8
B-11.IBM PC Network Adapter Check Reason Codes for All CCBsB.9
B-12.Network Status for CCB2B.10.2
B-13.Network Status for CCB3B.10.3
B-14.Token-Ring Network Status Codes for All CCBsB.10.4
B-15.PC Network and Ethernet Status Codes for All CCBsB.10.5
B-16.Bring-up Error Codes for All CCBs (Token-Ring Network Adapters)B.11
B-17.PhasesB.12.1.1
B-18.ErrorsB.12.1.2
B-19.Recommended Actions TableB.12.2.1
B-20.PC Network and Ethernet Adapter Open Errors for All CCBsB.13
B-21.PC System Detected Errors for CCB2B.14.2
B-22.PC System Detected Errors for CCB3B.14.3
B-23.System Action Exceptions for CCB2B.15.1
B-24.System Action Exceptions for CCB3B.15.2
D-1.Interrupt Arbitrator Return CodesD.2.1.1
D-2.Interface Registration CCB Parameter TableD.2.1.2
D-3.NCB Registration Parameter TableD.2.1.3
D-4.CCB Parameter Table StructureD.2.1.3
E-1.Token Release TableE.2.1
E-2.NetBIOS 3.0 System Default ValuesE.3
E-3.NetBIOS Trace TableE.6
+ +
Copyright IBM Corp. 1986, 1996
+
TABLES - 2
+ +--- + + +## Page 11 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Notices + +FRONT_1 Notices +References in this publication to IBM products, programs, or services do not imply that IBM intends to make these available in all countries in which IBM operates. Any reference to an IBM product, program, or service is not intended to state or imply that only IBM's product, program, or service may be used. Any functionally equivalent product, program, or service that does not infringe any of IBM's intellectual property rights may be used instead of the IBM product, program, or service. Evaluation and verification of operation in conjunction with other products, except those expressly designated by IBM, are the user's responsibility. + +IBM may have patents or pending patent applications covering subject matter in this document. The furnishing of this document does not give you any license to these patents. You can send license inquiries, in writing, to the IBM Director of Licensing, IBM Corporation, 500 Columbus Avenue, THORNWOOD NY 10594 USA. + +Subtopics +FRONT_1.1 Trademarks + +
Copyright IBM Corp. 1986, 1996 +FRONT_1 - 1
+ +--- + + +## Page 12 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Trademarks + +FRONT_1.1 Trademarks + +The following terms are trademarks of the IBM Corporation in the United States or other countries or both: + + + + + + + + + + + + + + + + + + + + + + +
Extended EditionMicro ChannelPC XT
Extended Services for OS/2Operating System/2Personal System/2
IBMOS/2Presentation Manager
LANStreamerPC ATPS/2
+ +Microsoft and Windows are trademarks or registered trademarks of Microsoft Corporation. + +Other company, product, and service names may be trademarks or service marks of others. + +
Copyright IBM Corp. 1986, 1996 +FRONT_1.1 - 1
+ +--- + + +## Page 13 + +PREFACE Preface +This manual describes the IEEE 802.2 and the NetBIOS application program interfaces (APIs) provided by IBM program products for LAN adapters on PC Networks, Token-Ring Networks, and Ethernet networks. These APIs support LAN adapters in IBM Personal Computers (PCs) and IBM Personal System/2 (PS/2) computers. + +The chapters of the fourth edition of the IBM LAN Technical Reference that describe the application program interface are republished and updated in this reference manual. You might need to use this manual if you prepare programs that communicate on a LAN from an IBM PC or PS/2 computer. The LAN adapters that attach the workstation to the LAN must be supported by IBM software. + +**Note:** If you need information about the adapter interfaces for IBM adapters, refer to the IBM LAN Technical Reference: Adapter Interfaces, which is described in "Related IBM Publications" in topic PREFACE.2. + +Subtopics +PREFACE.1 How This Manual Is Organized +PREFACE.2 Related IBM Publications +PREFACE.3 Guide to Information about the TCP/IP Interface +PREFACE.4 Guide to Information About the Open Data-Link Interface (ODI) +PREFACE.5 IBM LAN OEMI + +
Copyright IBM Corp. 1986, 1996 +PREFACE - 1
+ +--- + + +## Page 14 + +LAN Technical Reference: 802.2 and NetBIOS APIs +How This Manual Is Organized + +PREFACE.1 How This Manual Is Organized + +This reference manual is divided into the following chapters and appendixes: + +☐ Chapter 1, "LAN Overview and Interfaces" provides an overview of the IEEE 802.2 and NetBIOS interfaces provided by IBM, and describes the frame formats of the LANs that are supported. + +☐ Chapter 2, "Programming Conventions for the IEEE 802.2 Interface" describes methods of writing programs to the IEEE 802.2 and NetBIOS interfaces. + +☐ Chapter 3, "The Command Control Blocks" describes the Command Control Blocks that can be issued to IBM adapter support software. + +☐ Chapter 4, "NetBIOS" describes the NetBIOS interface. + +☐ Chapter 5, "The NetBIOS Frames Protocol" describes the NetBIOS protocol. + +☐ Chapter 6, "Support of NDIS Adapters Using IBM OS/2 LAN Adapter and Protocol Support" describes the support of NDIS adapters using the IBM OS/2 LAN Adapter and Protocol Support. + +☐ Appendix A, "Valid Commands" contains a directory of all valid commands and the related interfaces for each, as well as topic references for all commands. + +☐ Appendix B, "Return Codes" provides return codes and exception condition tables used in programming. + +☐ Appendix C, "LAN Sample Program Listings Diskette" describes the program listings on the sample diskette. + +☐ Appendix D, "The LAN Support Program Interrupt Arbitrator" provides information specific to the LAN Support Program. + +☐ Appendix E, "Operating System/2 Extended Edition Information" provides information specific to the Communications Manager of IBM Operating System/2 (OS/2) Extended Edition. + +☐ Appendix F, "NDIS Overview" provides an overview of the NDIS interface. + +☐ Following the Appendixes are a list of abbreviations, a glossary list that defines the terms used in this manual, and an index. + +
Copyright IBM Corp. 1986, 1996 +PREFACE.1 - 1
+ +--- + + +## Page 15 + +PREFACE.2 Related IBM Publications + +The following IBM publications offer additional, general information: + +☐ IBM LAN Technical Reference: Adapter Interfaces, SBOF-6221. This Bill of Forms is a group of IBM publications that can be ordered under one publication number or as separate manuals. Each is available as a single document when ordered under its own publication number. At present, this Bill of Forms is composed of the following individual technical references: + +- IBM LAN Technical Reference: Token-Ring Network Adapter Interface, SC30-3588 +- IBM LAN Technical Reference: Ethernet Adapter Interface, SC30-3661 +- IBM LAN Technical Reference: Token-Ring Network 16/4 Busmaster Server Adapter/A Interface, SC30-3663 + +☐ The appropriate LAN adapter documentation (provided with the adapter) +☐ IBM Token-Ring Network Architecture Reference, SC30-3374* +☐ A Building Planning Guide for Communication Wiring, G320-8059* +☐ IBM Cabling System Planning and Installation Guide, GA27-3361* +☐ Using the IBM Cabling System with Communication Products, GA27-3620* +☐ IBM Token-Ring Network Introduction and Planning Guide, GA27-3677* +☐ IBM PC Network Adapters Technical Reference, SC30-3520 +☐ OS/2 LAN Server Network Administrator Reference Volume 2: Performance Tuning, S10H-9681 +☐ IBM NTS/2 LAN Adapter and Protocol Support Configuration Guide, S96F-8489 +☐ IBM Token-Ring Network Problem Determination Guide, SX27-3710* +☐ IBM Token-Ring Network Administrator's Guide, GA27-3748* + +For assistance in obtaining IBM publications, see your place of purchase. For items marked with an asterisk (*), see your IBM representative or IBM branch office. + +--- + + +## Page 16 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Guide to Information about the TCP/IP Interface + +PREFACE.3 Guide to Information about the TCP/IP Interface + +This is an abbreviated list of sources that are helpful in understanding the TCP/IP interface. This list is not intended as an endorsement or a promotion of these particular sources. A fuller version of this TCP/IP bibliography is available in the *IBM Transmission Control Protocol/Internet Protocol Version 2.1 for DOS: Programmer's Reference*. + +Subtopics +PREFACE.3.1 General Publications +PREFACE.3.2 Programming Publications + +
Copyright IBM Corp. 1986, 1996 +PREFACE.3 - 1
+ +--- + + +## Page 17 + +LAN Technical Reference: 802.2 and NetBIOS APIs +General Publications + +PREFACE.3.1 General Publications + +☐ *Internetworking With TCP/IP Volume I: Principles, Protocols, and Architecture*, Douglas E. Comer, Prentice Hall, Englewood Cliffs, New Jersey, 1991 + +☐ *Internetworking With TCP/IP Volume II: Implementation and Internals*, Douglas E. Comer, Prentice Hall, Englewood Cliffs, New Jersey, 1991 + +
Copyright IBM Corp. 1986, 1996 +PREFACE.3.1 - 1
+ +--- + + +## Page 18 + +PREFACE.3.2 Programming Publications + +☐ IBM Transmission Control Protocol/Internet Protocol Version 2.1 for DOS: Programmer's Reference, SC31-7046 +☐ IBM Transmission Control Protocol/Internet Protocol Version 1.2.1 for OS/2: Programmer's Reference, SC31-6077 +☐ IBM AIX Communication Concepts and Procedures for RISC SYSTEM/6000, GC23-2203 +☐ UNIX Network Programming, W. Richard Stevens, Prentice Hall, Englewood Cliffs, New Jersey, 1990, ISBN 0-13-949876-1 + +--- + + +## Page 19 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Guide to Information About the Open Data-Link Interface (ODI) + +PREFACE.4 Guide to Information About the Open Data-Link Interface (ODI) + +Specifications and other Novell development documentation can be acquired through the Internet, NetWire, or NetWare Express. However, for the complete procedures and documentation required, call 1-800-NETWARE. + +
Copyright IBM Corp. 1986, 1996 +PREFACE.4 - 1
+ +--- + + +## Page 20 + +PREFACE.5 IBM LAN OEMI + +The following publications make up the IBM Token-Ring Network Other Equipment Manufacture Interface (OEMI): +☐ IBM Cabling System Technical Interface Information +☐ IBM LAN Technical Reference: IEEE 802.2 and NetBIOS Application Program Interfaces, SC30-3587 (this book) +☐ IBM Token-Ring Network Architecture Reference, SC30-3374 +☐ Carrier Sense Multiple Access with Collision Detection, IEEE Std 802.3-1985 +☐ Token-Ring Access Method and Physical Layer Specification, IEEE Std 802.5-1985 + +The following publications make up the IBM PC Network OEMI: +☐ IBM NetBIOS Application Development Guide, S68X-2270 +☐ IBM PC Network Adapter Technical Reference +☐ IBM PC Network Adapter II Technical Reference +☐ IBM PC Network Adapter II - Frequency 2 Technical Reference +☐ IBM PC Network Adapter II/A - Frequency 2 Technical Reference +☐ IBM PC Network Adapter II - Frequency 3 Technical Reference +☐ IBM PC Network Adapter II/A - Frequency 3 Technical Reference +☐ IBM PC Network Baseband Adapter Technical Reference +☐ IBM PC Network Baseband Adapter/A Technical Reference +☐ IBM PC Network Baseband Extender Technical Reference +☐ IBM PC Network Translator Unit and Technical Reference + +For assistance in obtaining IBM publications, see your place of purchase. + +
Copyright IBM Corp. 1986, 1996 +PREFACE.5 - 1
+ +--- + + +## Page 21 + +LAN Technical Reference: 802.2 and NetBIOS APIs +How This Manual Differs from the Previous Edition of the IBM LAN Technical + +CHANGES How This Manual Differs from the Previous Edition of the IBM LAN Technical +Reference 802.2 and NetBIOS Application Program Interfaces +There are many minor corrections and additions to the material published in the previous edition of the IBM LAN Technical Reference +802.2 and NetBIOS Application Program Interfaces. + +New sections were added to describe the IBM LAN Client support for 802.2 and NetBIOS interfaces in DOS. + +
Copyright IBM Corp. 1986, 1996 +CHANGES - 1
+ +--- + + +## Page 22 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Chapter 1. LAN Overview and Interfaces + +1.0 Chapter 1. LAN Overview and Interfaces + +Subtopics +1.1 About This Chapter +1.2 Drivers and Programs That Provide the APIs +1.3 Where to Find Information about IBM Adapter Interfaces +1.4 Introduction to the Networks +1.5 LANS +1.6 Related Software +1.7 OS/2 Communications Manager (OS/2 EE 1.3) +1.8 Why Use IEEE 802.2 or NetBIOS? +1.9 IBM LAN Application Program Interfaces +1.10 IEEE 802.2 Interface +1.11 APPC/PC Interface +1.12 NetBIOS +1.13 Token-Ring Network Frame Definition +1.14 Frame Format on the PC Network +1.15 Ethernet IEEE 802.3 Frame Format +1.16 Ethernet DIX Version 2.0 Frame Format + +
Copyright IBM Corp. 1986, 1996
+<page_number>1.0 - 1</page_number> + +--- + + +## Page 23 + +LAN Technical Reference: 802.2 and NetBIOS APIs +About This Chapter + +1.1 About This Chapter + +This chapter introduces the software that provides the IEEE 802.2 and NetBIOS application program interfaces (APIs) and then describes interfaces to the following LANs: the IBM Token-Ring Network, the IBM PC Network, IBM Ethernet, and non-IBM Ethernet. Ethernet support includes the IEEE 802.3 networks and Digital Intel Xerox (DIX) Version 2.0. The frame formats used by these networks are also discussed. + +
Copyright IBM Corp. 1986, 1996
+<page_number>1.1 - 1</page_number> + +--- + + +## Page 24 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Drivers and Programs That Provide the APIs + +1.2 Drivers and Programs That Provide the APIs +The two APIs provided by IBM LAN support software are IEEE 802.2 and NetBIOS. The IBM LAN support software is composed of protocol drivers that provide communication between the API and the adapter. These protocol drivers provide the IEEE 802.2 and NetBIOS interfaces in one of two ways: + +☐ By interfacing with the network adapter hardware and microcode + +☐ By interfacing with an adapter driver that provides the Network Driver Interface Specificiation (NDIS) interface and is known as the NDIS MAC driver or the network adapter driver. (1) + +(1) Appendix F, "NDIS Overview" provides an overview of NDIS. + +Subtopics +1.2.1 NDIS and non-NDIS Adapters +1.2.2 IBM Programs to Support LAN Adapters +1.2.3 IBM LAN Client + +
Copyright IBM Corp. 1986, 1996
+<page_number>1.2 - 1</page_number> + +--- + + +## Page 25 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NDIS and non-NDIS Adapters + +1.2.1 NDIS and non-NDIS Adapters + +The NDIS MAC driver interfaces with the protocol driver at the NDIS layer and interfaces with the adapter at the MAC layer. The protocol drivers that are supported by NDIS MAC drivers are called NDIS protocol drivers. NDIS configuration requires the NDIS MAC driver and an NDIS protocol driver (along with some other required files, such as a protocol manager) to provide the IEEE 802.2 and NetBIOS interfaces. + +When an adapter is supported by an NDIS MAC driver, it is referred to in this manual as an NDIS adapter. When it is supported directly by protocol drivers, it is referred to as a non-NDIS adapter. + +The designation as a non-NDIS adapter depends not on the adapter design, but on the type of protocol drivers used to provide the IEEE 802.2 or NetBIOS interfaces. For example, the IBM Token-Ring Network adapters with shared RAM can be either non-NDIS or NDIS. They are non-NDIS when they are supported by protocol drivers that interface with the adapter and NDIS when they are supported by protocol drivers that interface with the NDIS MAC driver. + +
Copyright IBM Corp. 1986, 1996
+<page_number>1.2.1 - 1</page_number> + +--- + + +## Page 26 + +LAN Technical Reference: 802.2 and NetBIOS APIs +IBM Programs to Support LAN Adapters + +1.2.2 IBM Programs to Support LAN Adapters + +Examples of programs that provide protocol drivers to allow application programs to address IEEE 802.2 or NetBIOS interfaces are IBM LAN Client, the IBM LAN Support Program (LSP) in DOS, and several program products in OS/2, including IBM Extended Services for OS/2 Version 1.0 (ES), IBM OS/2 LAN Server Versions 2.0 and 3.0, Network Transport Services/2 (NTS/2), and the Communications Manager delivered with IBM OS/2 Extended Edition (EE) Version 1.3. + +These programs, which are loaded in the host computer in which the LAN adapter is installed, are included in the following list: + +☐ IBM LAN Client. + +☐ The LAN Support Program. Several versions of this program are available, depending upon your adapter environment. + +☐ The Communications Manager provided with OS/2 EE 1.3. + +Note: The LAN protocol support delivered with EE 1.3 cannot operate under OS/2 2.0. Therefore, the new LAN Adapter Protocol Support (LAPS) is required for OS/2 2.0 or higher. The new LAPS will also run in the OS/2 1.3 environment. + +☐ LAPS provided with ES 1.0, NTS/2, or LAN Server 2.0 or 3.0. + +Note: NDIS MAC drivers are shipped with the NDIS adapters, and might not be included in the support program. + +
Copyright IBM Corp. 1986, 1996 +1.2.2 - 1
+ +--- + + +## Page 27 + +LAN Technical Reference: 802.2 and NetBIOS APIs +IBM LAN Client + +1.2.3 IBM LAN Client + +IBM LAN Client provides support for DOS/Windows programs written to the IEEE 802.2 or NetBIOS application programming interfaces using selected IBM Token-Ring and Ethernet adapters. For more information, see the LNCLIENT.TXT and README.1ST files on the IBM LAN Client diskettes. + +IBM LAN Client builds on Novell's NetWare Client-32 for DOS/Windows. In this 32-bit protect-mode environment, all of the components are implemented as NetWare Loadable Modules (NLMs). This is the same 32-bit flat memory model format that is implemented in the NetWare Server. IBM LAN Client provides 32-bit 802.2 and NetBIOS NLMs. IBM LAN Client also provides NLMs that present the 16-bit APIs that are defined in this document. Therefore, applications that worked with IBM LAN Support Program should be compatible with IBM LAN Client. The differences are documented in "IBM LAN Client 802.2 Application Program Interface (API)" in topic 3.2 and "IBM LAN Client NetBIOS Application Program Interface (API)" in topic 4.3. + +
Copyright IBM Corp. 1986, 1996
+<page_number>1.2.3 - 1</page_number> + +--- + + +## Page 28 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Where to Find Information about IBM Adapter Interfaces + +1.3 Where to Find Information about IBM Adapter Interfaces + +The IBM LAN Technical Reference has been divided into this manual and a group of manuals that describe the adapter interfaces. See "Related IBM Publications" in topic PREFACE.2 for the titles of the manuals that describe the adapter interfaces. + +
Copyright IBM Corp. 1986, 1996
+<page_number>1.3 - 1</page_number> + +--- + + +## Page 29 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Introduction to the Networks + +1.4 Introduction to the Networks + +The following lans use the interfaces described in this book: + +☐ IBM Token-Ring Network +☐ IBM PC Network +☐ IBM PC Network (Baseband) +☐ Ethernet + +IBM Personal Computers (PCs) and Personal System/2 (PS/2) computers, often referred to as workstations, can be connected on these networks. The appropriate LAN adapters must be installed in the workstations; these adapters are supported by the IBM program products listed in "IBM Programs to Support LAN Adapters" in topic 1.2.2. + +
Copyright IBM Corp. 1986, 1996
+<page_number>1.4 - 1</page_number> + +--- + + +## Page 30 + +LAN Technical Reference: 802.2 and NetBIOS APIs +LANS + +1.5 LANS + +Following is a brief description of the applicable LANs. + +Subtopics +1.5.1 The IBM Token-Ring Network +1.5.2 The IBM PC Network (Broadband) +1.5.3 The IBM PC Network (Baseband) +1.5.4 Ethernet Support + +
Copyright IBM Corp. 1986, 1996 +1.5 - 1
+ +--- + + +## Page 31 + +LAN Technical Reference: 802.2 and NetBIOS APIs +The IBM Token-Ring Network + +1.5.1 The IBM Token-Ring Network + +The Token-Ring Network, a token-ring, star-wired LAN, can accommodate on one ring up to 260 attaching devices (printers, processors, controllers). Bridges can connect multiple rings together to form a network of more than 260 devices. These attaching devices connect to one another by a series of cables, access units, and special adapters installed in the attaching devices. + +Application programs running in each workstation (such as a PC or PS/2 computer) can direct the adapter to become a part of the ring. This book describes the commands used by programs to control the Token-Ring Network adapter's activity on the network. Refer to the IBM Token-Ring Network Introduction and Planning Guide for more information about the network. + +
Copyright IBM Corp. 1986, 1996 +1.5.1 - 1
+ +--- + + +## Page 32 + +LAN Technical Reference: 802.2 and NetBIOS APIs +The IBM PC Network (Broadband) + +1.5.2 The IBM PC Network (Broadband) + +The PC Network (Broadband) is a bus-attached, broadband LAN that can accommodate up to 72 attaching devices with IBM components. + +
Copyright IBM Corp. 1986, 1996
+<page_number>1.5.2 - 1</page_number> + +--- + + +## Page 33 + +LAN Technical Reference: 802.2 and NetBIOS APIs +The IBM PC Network (Baseband) + +1.5.3 The IBM PC Network (Baseband) + +The PC Network (Baseband) is a bus-attached, baseband, LAN that can accommodate up to 80 attaching devices with IBM components. + +
Copyright IBM Corp. 1986, 1996
+<page_number>1.5.3 - 1</page_number> + +--- + + +## Page 34 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Ethernet Support + +1.5.4 Ethernet Support + +Ethernet networks are bus-attached LANs. IBM supports Ethernet with the Operating System/2 Extended Edition Version 1 Release 3 (OS/2 EE 1.3), LAN Adapter and Protocol Support in OS/2, and the LAN Support Program Version 1.2 or higher support in DOS for IEEE 802.3 and DIX Version 2.0. Refer to the IBM Operating System/2 Extended Edition Version 1.3 System Administrator's Guide for Communications, the documents for Extended Services (ES) and Network Transport Services/2 (NTS/2) listed in "Related IBM Publications" in topic PREFACE.2, and the LAN Support Program User's Guide for additional information about the Ethernet adapters supported. + +
Copyright IBM Corp. 1986, 1996
+<page_number>1.5.4 - 1</page_number> + +--- + + +## Page 35 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Related Software + +1.6 Related Software + +The software listed below provides the interface to allow communication on the networks using LAN adapters. + +☐ For use with IBM Disk Operating System (DOS) +- The protocol drivers provided with the Token-Ring Network PC Adapter and Token-Ring Network PC Adapter II +- The LAN Support Program +- Advanced Program-to-Program Communications for the IBM PC (APPC/PC) + +☐ For use with OS/2 +- The Communications Manager provided with OS/2 EE 1.3 +- The LAPS provided with ES 1.0, NTS/2, and LAN Server. + +**Note:** The protocol support in Communications Manager provided with OS/2 EE 1.3 for Ethernet is NDIS-based. Beginning with LAPS for OS/2 2.0, all adapter support is NDIS-based. See Chapter 6, "Support of NDIS Adapters Using IBM OS/2 LAN Adapter and Protocol Support" for a discussion of OS/2 NDIS support. + +Application programs use these interfaces to communicate on a LAN. + +
Copyright IBM Corp. 1986, 1996
+<page_number>1.6 - 1</page_number> + +--- + + +## Page 36 + +LAN Technical Reference: 802.2 and NetBIOS APIs +OS/2 Communications Manager (OS/2 EE 1.3) + +1.7 OS/2 Communications Manager (OS/2 EE 1.3) + +Communications Manager is a component of OS/2 EE 1.3. It provides comprehensive communication capabilities for a variety of interconnections. Functions that were previously available only in various communications programs for DOS are now combined with the functions of multitasking and expanded memory support. Communications Manager enables users to connect to a range of computers, including IBM and non-IBM host systems and other personal computers. In addition, multiple connections can be active concurrently, giving users access to information wherever it is located. + +Communications Manager supports a wide range of communication capabilities that include: + +☐ 3270 terminal emulation +☐ 5250 terminal emulation +☐ ASCII terminal emulation +☐ IBM Server-Requester Programming Interface (SRPI) +☐ IBM Systems Network Architecture (SNA) Advanced Program-to-Program Communication (APPC) +☐ IBM Asynchronous Communications Device Interface (ACDI) +☐ IEEE 802.2 Application Program Interface (API) +☐ IBM NetBIOS API +☐ Emulator High-Level Language Application Program Interface (EHLLAPI) + +Because OS/2 provides multitasking capability, the various communications options can usually run concurrently. In many cases, this eliminates the need to load and unload programs to communicate with different systems. + +Subtopics +1.7.1 IEEE 802.2 Application Program Interface in OS/2 +1.7.2 Differences between the Dynamic Link Routine Interface and the Device Driver Interface + +
Copyright IBM Corp. 1986, 1996
+<page_number>1.7 - 1</page_number> + +--- + + +## Page 37 + +LAN Technical Reference: 802.2 and NetBIOS APIs +IEEE 802.2 Application Program Interface in OS/2 + +1.7.1 IEEE 802.2 Application Program Interface in OS/2 + +The IEEE 802.2 API provided by the Communications Manager and LAPS supports both the direct and data link control (DLC) interfaces described in this manual. Application programs can use the direct interface only or can use both the direct and DLC interfaces. + +Two methods are available to access the IEEE 802.2 API: the dynamic link routine (DLR) interface, and the device driver (DD) interface. Using the device driver interface, the protocol drivers interface directly with the LAN device drivers provided by Communications Manager or LAPS. + +Application programs communicate across the IEEE 802.2 API using command control blocks (CCBs). For this communication, the DLR interface uses CCB2, and the DD interface uses CCB3. Chapter 2, "Programming Conventions for the IEEE 802.2 Interface," provides more information about CCBs. + +A DLR accesses the NetBIOS API provided by Communications Manager. Application programs communicate across the NetBIOS API with network control blocks (NCBs). For more information on NetBIOS and the NCB commands, see Chapter 4, "NetBIOS." + +To use the IEEE 802.2 API or the NetBIOS API with OS/2, Communications Manager must be installed and configured. Refer to IBM Operating System/2 Extended Edition Getting Started for information on installing Communications Manager and the LAN device drivers. Refer to IBM Operating System/2 Extended Edition System Administrator's Guide for Communications for information on configuring Communications Manager. + +
Copyright IBM Corp. 1986, 1996
+<page_number>1.7.1 - 1</page_number> + +--- + + +## Page 38 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Differences between the Dynamic Link Routine Interface and the Device Driver Interface + +1.7.2 Differences between the Dynamic Link Routine Interface and the Device Driver Interface + +Two levels of OS/2 interfaces exist: the Dynamic Link Routine Interface and the Device Driver Interface. An application program can use either interface but cannot use both interfaces at the same time and still be considered a single application program. Resources provided to and resources obtained from one of the OS/2 interfaces cannot be used at the other OS/2 interface. + +An application program can easily use one of the DLR interfaces by making the appropriate external references to an OS/2 DLR interface. In order for an application program to use one of the DD interfaces, the application program itself must be a device driver or have a device driver as one of its components. The application program device driver must be set up to support communication between device drivers so that the application program device driver can be called by the protocol drivers for posting of events. + +Several factors can be involved in determining the best OS/2 interface for your programming needs. Consider these factors when choosing your OS/2 interface: + +- The programming language used to develop your application programs + - Device driver components of application programs must be written in Assembler because registers must be accessed and processed. In addition, flags must be tested for error conditions. + +- Performance + - The DLR interfaces use semaphores and create threads for application programs in order to post events; therefore, task switches are involved when using the interface. When events occur that affect the application program (for example, command completions and network status changes), the application program can respond to the event after one of its threads is dispatched by a semaphore being cleared. + - The DD interface calls the application program's device driver to post events. When an event occurs that affects the application program, the application program is notified without delay and can respond immediately to the event without a task switch. + +- Complexity + - The DLR interface manages asynchronous events and allows the application program to process event information at its convenience. + - Although the DD interface does provide better performance to the application program, it also requires the application program to share in some of the responsibilities associated with processing asynchronous events. When events occur, the protocol drivers call the application program to post the event. No event information is queued for later notification or retrieval by the application program. In addition, the application program device driver is responsible for ensuring that data structures and buffers passed to the protocol drivers are located in valid memory segments and are locked to prevent moving or swapping by OS/2. + +
Copyright IBM Corp. 1986, 1996
+<page_number>1.7.2 - 1</page_number> + +--- + + +## Page 39 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Why Use IEEE 802.2 or NetBIOS? + +1.8 Why Use IEEE 802.2 or NetBIOS? + +The IEEE 802.2 and NetBIOS APIs consist of the following interfaces: + +☐ IEEE 802.2 API +- Direct interface +- DLC interface + +☐ NetBIOS API +- NetBIOS interface. + +When choosing which interface to use, you should take into account these criteria: + +☐ Usability of the interface +The NetBIOS interface provides a simple interface for the application program and does not require the application program to understand DLC. + +☐ The performance required by your application program +The IEEE 802.2 interfaces provide better performance but require the application programs to be significantly more complex. Performance advantages can be up to two times that of NetBIOS based on the amount of data transferred between the application programs. + +☐ The interfaces used by other application programs with which your application program may interact + +
Copyright IBM Corp. 1986, 1996
+<page_number>1.8 - 1</page_number> + +--- + + +## Page 40 + +LAN Technical Reference: 802.2 and NetBIOS APIs +IBM LAN Application Program Interfaces + +1.9 IBM LAN Application Program Interfaces + +The LAN Support Program with DOS, Communications Manager with OS/2 EE 1.3, and LAPS provide both IEEE 802.2 and NetBIOS interfaces. Within the IEEE 802.2 interface, the direct interface and the DLC interface are supported. + +The application program can issue CCBs to the protocol drivers to interface with the adapter. By using CCBs, the application program is freed from the burden of interacting directly with the adapter. For information on CCBs and communicating with the protocol drivers, see Chapter 2, "Programming Conventions for the IEEE 802.2 Interface," and Chapter 3, "The Command Control Blocks." For information about interacting directly with the adapters, see the adapter interface books listed in "Related IBM Publications" in topic PREFACE.2. Figure 1-1 shows the relationship of application programs, the protocol drivers, and the network adapter when using DOS. Figure 1-2 shows the relationship of application programs, the protocol drivers, and different adapters when using OS/2 EE 1.3. + + +graph TD + subgraph DOS IEEE 802.2 and NetBIOS Interfaces + A[Application Program for the NetBIOS interface] --> B[NetBIOS Interface] + B --> C[IBM LAN Support Program] + C --> D[LAN Adapter's I/O] + + E[Application Program for the IEEE 802.2 Interface] --> F[IEEE 802.2 Interface] + F --> G[DLC Interface] + F --> H[Direct Interface] + G --> C + H --> C + C --> I[NDIS Interface] + I --> J[NDIS MAC Driver] + J --> K[LAN Adapter's I/O] + end + + +Figure 1-1. DOS IEEE 802.2 and NetBIOS Interfaces + +
Copyright IBM Corp. 1986, 1996
+<page_number>1.9 - 1</page_number> + +--- + + +## Page 41 + +LAN Technical Reference: 802.2 and NetBIOS APIs +IBM LAN Application Program Interfaces + +<img>Diagram showing the architecture of IBM LAN Application Program Interfaces. The diagram is a layered block diagram. The top layer is "Network Application Programs" containing "APPC (LU 6.2)", "SRPI", and "3270 EMUL.". Below this is a layer containing "NetBIOS", "ACDI", "IEEE 802.2", and "Common Service (Service Verbs)". The next layer is "Operating System/2 Kernel" containing "ASYNC", "PCN", "TRN", "ETHERNET", "SDLC", and "DFT". The bottom layer is "Communications Adapter's I/O". Arrows point from the "Communications Adapter's I/O" layer up to the "Operating System/2 Kernel" layer, indicating communication flow.</img> + +Figure 1-2. OS/2 EE Communications Manager Interfaces + +A network application program assembles a control block containing a command and related information for the adapter. Control passes to the protocol drivers, and the application program awaits the results. + +Appendix A, "Valid Commands," contains a directory of all commands, their related interfaces, and a topic reference to a description of each. The functions of the DLC interfaces of the adapter and the protocol drivers are compatible with the service specifications of the IEEE 802.2 Logical Link Control (LLC). Detailed information on these interfaces is contained in the IBM LAN Technical Reference: Adapter Interfaces. + +Each of the following interfaces provides a means of communicating with the adapter. Depending on which you choose, the code you provide shares the responsibility for control of the adapter with the protocol drivers found in the IBM support program you are using. + +Copyright IBM Corp. 1986, 1996 +<page_number>1.9 - 2</page_number> + +--- + + +## Page 42 + +LAN Technical Reference: 802.2 and NetBIOS APIs +IEEE 802.2 Interface + +1.10 IEEE 802.2 Interface +This interface is implemented using CCBs and consists of two types of interface: direct interface and DLC interface. + +Subtopics +1.10.1 Direct Interface +1.10.2 DLC Interface + +
Copyright IBM Corp. 1986, 1996 +1.10 - 1
+ +--- + + +## Page 43 + +1.10.1 Direct Interface + +The direct interface allows control of the adapter using control blocks. + +This interface provides the ability to open and close an adapter, obtain error status, and set addresses. It also permits transmission and reception of MAC (Token-Ring adapter cards only) and non-MAC frames directly without LLC protocol assistance. + +Chapter 2, "Programming Conventions for the IEEE 802.2 Interface," describes the use of this interface in detail. + +--- + + +## Page 44 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DLC Interface + +1.10.2 DLC Interface + +The DLC interface, together with the direct interface, provides an interface to application programs using the LLC sublayer of data link control protocol. The DLC protocol consists of the LLC sublayer and the MAC layer protocol. The interface can be used in two ways: + +☐ For IEEE Type 1 communication, which is connectionless communication between devices providing no guarantee of delivery (through the DLC service access point [SAP] interface) + +☐ For IEEE Type 2 communication, which is connection-oriented services (through the DLC station interface), providing point-to-point connectivity with guaranteed delivery and retry + +The adapter and the protocol drivers provide much of the communication overhead function, which permits less complex application programming. + +Chapter 2, "Programming Conventions for the IEEE 802.2 Interface," describes the use of this interface in detail. The IBM Token-Ring Network Architecture Reference explains communication using DLC in more detail. + +
Copyright IBM Corp. 1986, 1996
+<page_number>1.10.2 - 1</page_number> + +--- + + +## Page 45 + +LAN Technical Reference: 802.2 and NetBIOS APIs +APPC/PC Interface + +1.11 APPC/PC Interface + +The APPC/PC program is a product that uses the protocol drivers provided with the LAN Support Program. Refer to the Advanced Program-to-Program Communications for IBM Personal Computer Installation and Configuration Guide. Also, Advanced Program-to-Program Communications for the IBM Personal Computer Programming Guide explains how to design and write APPC/PC transaction programs. + +Note: The Communications Manager provides the APPC/PC support for OS/2. + +
Copyright IBM Corp. 1986, 1996 +1.11 - 1
+ +--- + + +## Page 46 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NetBIOS + +1.12 NetBIOS +The IBM NetBIOS API provides a program interface to the LAN so that an application program can have LAN communication without programming to the 802.2 API. NetBIOS provides the necessary DLC communications for the application program. NetBIOS names identify nodes on the LAN, and NetBIOS supports two types of data transfer. Session support provides guaranteed delivery of the data, whereas datagram support does not guarantee delivery. + +NetBIOS application programs require that protocol drivers that provide NetBIOS support be used. These drivers are part of the LAN Support Program or the OS/2 programs. (2) See Chapter 4, "NetBIOS" for information about NetBIOS and its use. + +(2) When the original PC Network Adapter or the PC Network Protocol Driver is used, the protocol drivers provided by the LAN Support Program or the OS/2 support programs are not required. + +
Copyright IBM Corp. 1986, 1996 +1.12 - 1
+ +--- + + +## Page 47 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Token-Ring Network Frame Definition + +1.13 Token-Ring Network Frame Definition + +A Token-Ring Network frame contains the following elements: +☐ Start delimiter (SD)-1 byte +☐ Access control (AC)-1 byte with the frame bit on +☐ Frame control (FC)-1 byte +☐ Destination address-6 bytes +☐ Source address-6 bytes +☐ Optional routing field-up to 18 bytes +☐ Optional DLC header field-3 to 4 bytes +☐ Optional information (data) bytes +☐ Frame check sequence (FCS)-4 bytes +☐ End delimiter (ED)-1 byte +☐ Frame status (FS)-1 byte. + +Figure 1-3 shows the Token-Ring Network frame format. + +<img>Figure 1-3. Token-Ring Network Frame Format. Bits are transmitted in bytes, most significant bit (bit 7) first.</img> + +The physical, or LAN, header consists of the AC byte, the 1-byte FC field, 6 bytes of destination address, 6 bytes of source address, and from 0 to 18 bytes of routing information. This is followed by the information field. Finally, the physical trailer (PT) is included, consisting of 4 bytes of the FCS field, the ED byte, and the FS byte. + +The frame can be one of two types: +☐ MAC frame +☐ Non-MAC frame + +MAC frames contain information about the status of an adapter or the ring. + +Certain MAC frames can be received by the adapter and provided to the application program at the direct interface. Some MAC frames can be sent to the adapter for transmission on the ring using the direct interface of IEEE 802.2. + +Some non-MAC frames contain data and messages that users transmit to one another. + +Copyright IBM Corp. 1986, 1996 +<page_number>1.13 - 1</page_number> + +--- + + +## Page 48 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Token-Ring Network Frame Definition + +Some non-MAC frames contain LLC protocol-only information transmitted by the adapter. These frames are used for Type 2 protocol support. + +The 2 most significant bits of the FC byte define the frame type. The types are: + +B'00' MAC frame +B'01' LLC frame (non-MAC) +B'10' Reserved +B'11' Reserved + +Subtopics +1.13.1 Routing Information Field +1.13.2 Routing Control Field +1.13.3 Route Designator Fields + +
Copyright IBM Corp. 1986, 1996
+<page_number>1.13 - 2</page_number> + +--- + + +## Page 49 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Routing Information Field + +1.13.1 Routing Information Field + +Bridges use the routing field to forward frames to their destination. This field is required if the frame is forwarded by bridges to other rings. + +Bit sequences described in the routing field can differ from IBM PC format in that the most significant bit of a byte is designated 7 for the IBM workstation and can be called 0 elsewhere. Only the representation differs; the byte's content is not altered. + +This field, when present, consists of a 2-byte routing control field and up to eight 2-byte route designators, as shown below: + + + + + + + + +
Routing Control
2 bytes
Segment Number
2 bytes
Segment Number
2 bytes
Segment Number
2 bytes
+ +Figure 1-4. Routing Information Field + +
Copyright IBM Corp. 1986, 1996
+<page_number>1.13.1 - 1</page_number> + +--- + + +## Page 50 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Routing Control Field + +1.13.2 Routing Control Field + +The format for the routing control field is shown below: + +<img>Diagram showing the structure of the Routing Control Field, which consists of two bytes. Byte 0 contains bits B, B, B, L, L, L, L, L. Byte 1 contains bits D, F, F, F, r, r, r, r. Below the diagram, a legend explains the meaning of each bit: B = Broadcast Indicators, L = Length Bits, D = Direction Bit, F = Largest Frame Bits, r = Reserved Bits.</img> + +Figure 1-5. Routing Control Field + +Subtopics +1.13.2.1 Broadcast Indicators +1.13.2.2 Length Bits +1.13.2.3 Direction Bit +1.13.2.4 Largest Frame Bits +1.13.2.5 Reserved Bits + +--- + + +## Page 51 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Broadcast Indicators + +1.13.2.1 Broadcast Indicators + +The broadcast indicators indicate whether the frame is to be sent along a specified path, to all the segments in a network (potentially resulting in multiple copies on a given segment), or to all the segments so that only one copy of the frame appears on each segment in the network. + +☐ B'0XX' = Non-broadcast: This indicates that the route designator field contains a specific route for the frame to travel through the network. + +☐ B'10X' = All-routes broadcast: This indicates that the frame will be transmitted along every route in the network to the destination station. Frames transmitted as all-routes broadcast will result in as many copies at the destination station as there are different routes to the destination station. + +Note: An all-routes broadcast is independent of an all-stations broadcast, which is indicated by all 1s in the DA field. An all-stations broadcast implies that every station on the segment will copy the frame, whereas an all-routes broadcast implies that every bridge in a network will copy and forward the frame to its adjoining segment (unless the next route designator already appears in the routing information field). + +☐ B'11X' = Single-route broadcast: This indicates that only certain designated bridges will relay the frame from one segment to another with the result that the frame will appear exactly once on every segment in the network. + +Note: X" means the bit can be either a 0 or a 1. Its value does not affect the meaning of the indicator. + +
Copyright IBM Corp. 1986, 1996 +1.13.2.1 - 1
+ +--- + + +## Page 52 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Length Bits + +1.13.2.2 Length Bits + +The 5 length bits indicate the length in bytes of the routing information field. Ring stations use the length to parse the rest of the frame correctly. (A ring station parses a frame by separating it into its individual fields. When a station parses a frame, it also checks for errors in the formatting of the frame.) + +For all-routes or single-route broadcast frames, the originating ring station initializes the length field to X'2', to represent the 2 routing control bytes. Bridges alter the routing information field in broadcast frames by adding route designators. + +For non-broadcast frames, which are already carrying routing information, the length field indicates the length of the routing information field, and remains unchanged as the frame traverses the network. + +Each bridge checks the length bits. If the length is an odd number of bytes, or if it is less than 2 bytes or greater than 18 bytes, the bridge does not forward the frame. + +For all-routes broadcast frames, the length field indicates to a bridge where to append the route designator. The first bridge to forward the frame adds X'4' to the length value (2 bytes for the first route designator and 2 bytes for the next ring's route designator). After that, every bridge that forwards the frame adds X'2' to the length field (2 bytes for the next ring's route designator). + +At any given time after crossing the first bridge, the formula {[(Length - 2)/2] - 1} indicates the number of bridges crossed. + +
Copyright IBM Corp. 1986, 1996 +1.13.2.2 - 1
+ +--- + + +## Page 53 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Direction Bit + +1.13.2.3 Direction Bit + +The direction bit enables the bridge to correctly interpret the route designators when it forwards the frame. + +If the direction bit is set to B'0', the bridge interprets the routing information field from left to right; if it is set to B'1', it interprets the field from right to left. Using this bit allows the list of ring numbers and bridge numbers in the routing information field to appear in the same order for frames traveling in either direction along the route. + +For all-routes broadcast frames, the originating ring station sets the direction bit to B'0'. Bridges do not need the direction bit in broadcast frames, but receivers could uniformly complement the received bit when they obtain routing information from frames with routing information fields. + +For off-ring, non-broadcast frames, the originating ring station sets the direction bit to B'0' in all frames transmitted to the target, whereas the target sets the direction bit to B'1' in all non-broadcast frames to the originating ring station. + +
Copyright IBM Corp. 1986, 1996 +1.13.2.3 - 1
+ +--- + + +## Page 54 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Largest Frame Bits + +1.13.2.4 Largest Frame Bits + +These bits specify the largest-size information field for the frame, excluding headers, that can be transmitted between two communicating stations on a specific route. + +A station that originates a broadcast frame sets the largest frame bits to B'111', the largest possible frame that can travel any path. Bridges that relay a broadcast frame examine the largest frame bits. If the designated size of the largest frame is greater than the capability of that part of the route, the bridge reduces the largest frame encoding to indicate the maximum information field. + +The largest field value returned in the responses to the broadcast indicates the largest possible frame each specified route can handle. + +The largest frame code points have the following values: +* 000--As many as 516 bytes in the information field. 516 represents the smallest maximum frame size that a medium access control must support under ISO 8802/2 LLC and ISO connectionless-mode network service (ISO 8473). +* 001--As many as 1470 bytes in the information field. 1470 represents the largest frame size that ISO 8802/3-standard lans can support. +* 010--As many as 2052 bytes in the information field. 2052 represents a frame size that is useful for transferring a (typical) screen-full of data; that is, this frame size will support the transfer of data for an 80 X 24 screen plus control characters. +* 011--As many as 4399 bytes in the information field. 4399 represents the largest frame size that can be transmitted using the Fiber Distributed Data Interface (FDDI) Draft Proposed American National Standard. It is also the largest frame size possible for ISO 8802/5-standard stations. +* 100--As many as 8130 bytes in the information field. 8130 represents the largest frame size that ISO 8802/4-standard lans can support. +* 101--As many as 11 407 bytes in the information field. +* 110--As many as 17 749 bytes in the information field. 17 749 represents the maximum frame size that a medium access control supports for ISO 8802/5-standard stations. +* 111--Used in all-routes broadcast frames and for values greater than 17 749. + +Note: Source-routing end stations on media with a maximum frame size should not send frames in which the headers, routing information fields, and information fields exceed that maximum frame size. + +Bit definitions for the largest frame bits can be found in the international standard: ISO/IEC 10038:1993 ANSI/IEEE Std 802.1d 1993 edition. + +
Copyright IBM Corp. 1986, 1996 +1.13.2.4 - 1
+ +--- + + +## Page 55 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Reserved Bits + +1.13.2.5 Reserved Bits + +These bits are reserved by IBM for future use. They are transmitted as B'0's; their value is ignored by receiving ring stations. + +
Copyright IBM Corp. 1986, 1996 +1.13.2.5 - 1
+ +--- + + +## Page 56 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Route Designator Fields + +1.13.3 Route Designator Fields + +Each ring in a given multiple-ring network is assigned a unique ring number; each bridge is assigned a bridge number, which may or may not be unique. Together, the ring and bridge number form a route designator. When an all-routes broadcast frame is transmitted, each bridge that forwards the frame to another ring adds its bridge number and that ring's number to the frame's routing information field. + +When a bridge receives a frame to forward to a ring, the bridge compares the route designators already present in the routing information field with its attached ring numbers and bridge number. + +☐ If there is a target ring number match in an all-route or single-route broadcast frame, the bridge discards the frame because it has already circled the target ring. + +☐ If there is not a target ring number match in an all-route or single-route broadcast frame, the bridge adds its route designator to the frame's routing information field and forwards it. + +☐ If there is a ring number, bridge number, and ring number combination match in a non-broadcast frame, the bridge forwards the frame to the indicated ring. + +☐ If there is not a ring number, bridge number, and ring number combination match in a non-broadcast frame, the bridge discards the frame. + +When the frame reaches its destination, the sequence of route designators describes the path from the source ring to the destination ring. + +The 2 bytes of the route designator are divided into the ring number portion (12 bits) and the individual bridge number portion (4 bits), as shown below. The individual bridge portion allows parallel bridges to exist, and to share traffic between the same two rings. + + + + + + + + + + +
RNIB
(12) bits4 bits
+ +RN = Ring Number Portion +IB = Individual Bridge Portion + +Figure 1-6. Route Designator Field + +Subtopics +1.13.3.1 Ring Number Portion +1.13.3.2 Individual Bridge Portion + +
Copyright IBM Corp. 1986, 1996
+<page_number>1.13.3 - 1</page_number> + +--- + + +## Page 57 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Ring Number Portion + +1.13.3.1 Ring Number Portion + +Bridges that are attached to different rings have different values for the ring number portion of the route designator; bridges that are attached to the same ring have the same value. + +
Copyright IBM Corp. 1986, 1996 +1.13.3.1 - 1
+ +--- + + +## Page 58 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Individual Bridge Portion + +1.13.3.2 Individual Bridge Portion + +Bridges that are attached to the same ring can have the same value for the individual bridge portion of the route designator. + +However, parallel bridges (those that are attached to the same two rings) must have different values. + +Because the end of a route is a ring and not a bridge, the individual bridge portion of the last route designator in the routing information field is not defined (that is, it is all B'0's). + +
Copyright IBM Corp. 1986, 1996 +1.13.3.2 - 1
+ +--- + + +## Page 59 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Frame Format on the PC Network + +1.14 Frame Format on the PC Network + +A frame on the PC Network consists of the following fields: +☐ Start delimiter (SD)–1 byte +☐ Destination address–6 bytes +☐ Source address–6 bytes +☐ Zeroes–2 bytes +☐ Optional routing field–up to 18 bytes +☐ Optional DLC header field–3 to 4 bytes +☐ Optional information (data) bytes +☐ The frame check sequence (FCS)–4 bytes +☐ Frame status (FS)–1 byte +☐ Pad characters (flags) if needed to reach the minimum frame length. + +<img> +Figure 1-7. PC Network Frame Format. Bits are transmitted in bytes, most significant bit (bit 7) first. +</img> + +The physical, or LAN, header consists of the destination and source addresses, 2 zero bytes, and from 0 to 18 bytes of routing information. This is followed by the user-provided data. The LAN header on the PC Network is different from that on the Token-Ring Network, but to provide compatibility for application programs, the difference is not reflected at the interface to the application program. In cases where the application program provides the access control and frame control bytes (used for the Token-Ring Network), the protocol drivers simply omit the bytes from the transmitted frame and insert 2 bytes of 0s following the source address. Note, however, that the protocol drivers check to make sure that the frame control byte specifies an LLC, not a MAC, frame. They transmit the address fields with the bit sequence expected on the PC Network, not the bit sequence expected on the Token-Ring Network. + +The formats of the routing information, the DLC header, and the information fields are identical on both networks; these formats are described in detail in the IBM Token-Ring Network Architecture Reference. Bit sequences in that book, and possibly other documentation, may differ from IBM PC format in that the most significant bit of a byte is designated 7 for the IBM workstation and may be called 0 elsewhere. Only the representation differs; the byte's content is not altered. + +
Copyright IBM Corp. 1986, 1996
+<page_number>1.14 - 1</page_number> + +--- + + +## Page 60 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Ethernet IEEE 802.3 Frame Format + +1.15 Ethernet IEEE 802.3 Frame Format + +IBM support for IEEE 802.3 Ethernet uses a frame that consists of the following fields: +☐ Preamble–7 bytes +☐ Start delimiter (SD)–1 byte +☐ Destination address–6 bytes +☐ Source address–6 bytes +☐ LPDU length–2 bytes +☐ LPDU +- Destination SAP address (DSAP)–1 byte +- Source SAP address (SSAP)–1 byte +- Control field–1 or 2 bytes +- Information field – 0-1497 bytes +☐ Pad–0 to 43 bytes +☐ Frame check sequence (FCS) or cyclic redundancy check (CRC)–4 bytes. + +<img>Diagram showing the IEEE 802.3 Frame Format. The top row displays the frame structure from left to right: Preamble (7 Bytes), SD (1 Byte), Dest. Addr. (6 Bytes), Source Addr. (6 Bytes), LPDU Length (2 Bytes), LPDU Y1 Bytes*, Pad, and FCS (4 Bytes). An arrow points from the LPDU Y1 Bytes* box down to a second row containing DSAP Addr. (1 Byte), SSAP Addr. (1 Byte), DLC Control Field (1 or 2 Bytes), and Information Field. The top row is labeled "Maximum Length Y2 Bytes *".</img> + +Figure 1-8. IEEE 802.3 Frame Format. * See Table 2-14 in topic 2.9.3.1 for the values of Y1 and Y2. See "Ethernet Frame Field Descriptions" in topic 1.16.1 for more information about these fields. + +
Copyright IBM Corp. 1986, 1996
+<page_number>1.15 - 1</page_number> + +--- + + +## Page 61 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Ethernet DIX Version 2.0 Frame Format + +1.16 Ethernet DIX Version 2.0 Frame Format + +IBM support for DIX Version 2.0 Ethernet uses a frame that consists of the following fields: +☐ Preamble--8 bytes +☐ Destination address--6 bytes +☐ Source address--6 bytes +☐ Type field--2 bytes +☐ Data +- LPDU length--2 bytes +- Leading pad--1 byte +- LPDU +- Destination SAP address--1 byte +- Source SAP address--1 byte +- Control field--1 or 2 bytes +- Information field--0 to 1494 bytes +☐ Pad--0 to 40 bytes +☐ FCS or cyclic redundancy check (CRC)--4 bytes. + +<img>Diagram showing the structure of an Ethernet DIX Version 2.0 frame. The frame is divided into several fields: Preamble (8 Bytes), Dest. Addr. (6 Bytes), Source Addr. (6 Bytes), Type Field (2 Bytes), Data (Y1 Bytes*), Pad, and FCS (4 Bytes). The Data field is expanded to show LPDU Length (2 Bytes), Leading Pad (1 Byte), and LPDU. The LPDU field is further expanded to show DSAP Addr. (1 Byte), SSAP Addr. (1 Byte), DLC Control Field (1 or 2 Bytes), and Information Field.</img> + +Figure 1-9. DIX Version 2.0 Frame Format. * See "Ethernet Frame Field Descriptions" in topic 1.16.1 for more information about these fields. + +Subtopics +1.16.1 Ethernet Frame Field Descriptions + +<page_number>1.16 - 1</page_number> +
Copyright IBM Corp. 1986, 1996
+ +--- + + +## Page 62 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Ethernet Frame Field Descriptions + +1.16.1 Ethernet Frame Field Descriptions + +The following list gives field descriptions for the Ethernet frames: + +**Preamble** +This field is a synchronization pattern that contains alternating binary 1s and 0s. For DIX Version 2.0, it is a 64-bit field that ends with a frame start delimiter of two consecutive 1s. For IEEE 802.3, it is a 56-bit field and does not end with the frame start delimiter of two consecutive ones. + +**Start Frame Delimiter (IEEE 802.3)** +This 1-byte field contains binary 1s and 0s, and ends with two consecutive 1s. The contents of this field match the eighth byte of the preamble field in DIX Version 2.0 frames. + +**Destination Address** +This 6-byte field specifies the station to which the packet is being transmitted. +☐ The first bit transmitted indicates whether the destination address is an individual address (B'0') or a group address (B'1'). +☐ The second bit transmitted indicates whether the address was universally administered (B'0') or locally administered (B'1'). + +**Source Address** +This 6-byte field contains the unique address of the station transmitting the packet. +☐ The first bit transmitted is always 0. +☐ The second bit transmitted indicates whether the address was universally administered (B'0') or locally administered (B'1'). + +**Type Field (DIX Version 2.0)** +This 2-byte field contains the registered value that identifies the high-level protocol that will interpret the LPDU. The value registered for this frame description is X'80D5' for SNA communications. This same Type Field value (X'80D5') is also used for any other application using the IEEE 802.2 API (direct or DLC), including NetBIOS. Note that the SAP values are different for SNA path control and NetBIOS. Refer to IBM Token-Ring Network Architecture Reference for more information. + +**LPDU Length** +This 2-byte field specifies the byte length of the LPDU, from the destination SAP address to the last byte of the information field, inclusive. + +**LPDU** +This LLC protocol data unit consists of SAP addresses, a 1- or 2-byte DLC control field, and an optional information field. The field is 1497 bytes in a DIX Version 2.0 frame, and 1500 bytes in an IEEE 802.3 frame. + +**Pad (IEEE 802.3)** +This field is used when needed to reach the minimum frame size requirement of 64 bytes. The pad can be up to 43 bytes. The protocol drivers will add the appropriate pad bytes, if required. The minimum frame size ensures that valid frames are distinguishable from collision fragments. + +**Pad (DIX Version 2.0)** +This field is used when needed to reach the minimum frame size requirement of 64 bytes. The trailing pad can contain up to 40 bytes. The protocol drivers will add the appropriate pad bytes, if required. The minimum frame size ensures that valid frames are distinguishable from collision fragments. + +**FCS** +This 4-byte frame check sequence is calculated starting with the destination address. + +
Copyright IBM Corp. 1986, 1996
+<page_number>1.16.1 - 1</page_number> + +--- + + +## Page 63 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Chapter 2. Programming Conventions for the IEEE 802.2 Interface + +2.0 Chapter 2. Programming Conventions for the IEEE 802.2 Interface + +Subtopics +2.1 About This Chapter +2.2 IBM Program Products for LAN Adapter Support +2.3 IEEE 802.2 Programming Conventions with DOS +2.4 Programming Conventions with OS/2 +2.5 Control Blocks for All CCBs +2.6 Addressing +2.7 Adapter Addresses +2.8 DLC +2.9 Transmitting, Receiving, and Buffers + +
Copyright IBM Corp. 1986, 1996
+<page_number>2.0 - 1</page_number> + +--- + + +## Page 64 + +LAN Technical Reference: 802.2 and NetBIOS APIs +About This Chapter + +2.1 About This Chapter + +This chapter includes a discussion of the programming conventions for application programs that run on LANs and use the IEEE 802.2 application program interface. Also included are a description of the command control blocks (CCBs) and the fields of those CCBs, a description of the command sequence for DLC communication, and a discussion of transmitting and receiving on the LANs. + +
Copyright IBM Corp. 1986, 1996
+<page_number>2.1 - 1</page_number> + +--- + + +## Page 65 + +LAN Technical Reference: 802.2 and NetBIOS APIs +IBM Program Products for LAN Adapter Support + +2.2 IBM Program Products for LAN Adapter Support + +At this time, OS/2 EE 1.3 with Communications Manager, LAN Adapter and Protocol Support in OS/2, NTS/2, OS/2 LAN Server, and the LAN Support Program in DOS are the IBM program products provided to support adapters on LANs. This chapter discusses the IEEE 802.2 LAN interface provided by these products. The 802.2 interface is implemented by commands that are communicated to the protocol drivers of the support program products using CCBs. Most of the commands used by the DOS and OS/2 program products are the same and the structure of the commands is very similar. Where it is possible to discuss one command that can be used for all products, the term command control block (CCB) is used. Where it is not possible to talk about them as one, each is discussed separately as CCB1, CCB2, and CCB3. This chapter explains the major differences in the CCBs. The different CCB structures are referred to as follows: + +CCB1 The command control block for the IEEE 802.2 interface provided by the LAN Support Program in DOS. +CCB2 The command control block for the DLR interface provided with the Communications Manager of OS/2 EE 1.3 and with LAPS. +CCB3 The command control block for the DD interface provided with the Communications Manager of OS/2 EE 1.3 and with LAPS. +CCB When CCB is used without a qualifier, the information refers to all three interfaces. + +The LAN Support Program, OS/2 EE 1.3, and other OS/2 support software provide software support for the adapter when using any of the supported Token-Ring Network, PC Network, or Ethernet adapters. The LAN Support Program and OS/2 EE 1.3 support up to two adapters in one workstation. The first adapter, numbered 0, is the primary adapter; the second adapter, if used, is numbered 1 and is the alternate adapter. + +Starting with LAPS in OS/2, the OS/2 support software provides support for up to four adapters in one workstation. These adapters can be identified using any numbers in the range 0-15. + +Programs to support the adapter must be loaded into workstation memory. The IEEE 802.2 interface provided by the protocol drivers offers three levels of entry to the LAN: + +☐ The direct interface +☐ The DLC SAP interface +☐ The DLC station interface + +If NetBIOS is also loaded into memory, an interface to NetBIOS commands is provided. See Chapter 4, "NetBIOS," for more information about NetBIOS. + +The support programs that provide the IEEE 802.2 interface allow an application program to use the adapter by providing control blocks. When the application program uses a CCB to issue a command, the support program calls various protocol drivers that convey the information found in the CCB to the adapter. This process frees the application program from the burden of interacting with the adapter. + +
Copyright IBM Corp. 1986, 1996
+<page_number>2.2 - 1</page_number> + +--- + + +## Page 66 + +LAN Technical Reference: 802.2 and NetBIOS APIs +IEEE 802.2 Programming Conventions with DOS + +2.3 IEEE 802.2 Programming Conventions with DOS + +The following sections describe the calling conventions, command completion, and control block structures for the LAN Support Program. + +Subtopics +2.3.1 LAN Support Program (CCB1) Calling Conventions +2.3.2 LAN Support Program (CCB1) Command Completion +2.3.3 LAN Support Program (CCB1) Control Blocks + +
Copyright IBM Corp. 1986, 1996 +2.3 - 1
+ +--- + + +## Page 67 + +LAN Technical Reference: 802.2 and NetBIOS APIs +LAN Support Program (CCB1) Calling Conventions + +2.3.1 LAN Support Program (CCB1) Calling Conventions + +To issue a request to the LAN Support Program, a network application program assembles a control block containing a command and related information for the adapter. The application program then puts the workstation's main memory address of this control block into the extra segment (ES) and base (BX) registers. (1) At this point, the application program issues an X'5C' software interrupt. The appropriate protocol driver responds to the X'5C' interrupt by processing the control block. While processing the CCB, the protocol driver enables interrupts. + +(1) These are registers in the Intel microprocessors of an IBM PC or PS/2. + +
Copyright IBM Corp. 1986, 1996 +2.3.1 - 1
+ +--- + + +## Page 68 + +LAN Technical Reference: 802.2 and NetBIOS APIs +LAN Support Program (CCB1) Command Completion + +2.3.2 LAN Support Program (CCB1) Command Completion + +The CCB_RETCODE is initially set to a value of X'FF'. Once any immediate command processing is accomplished, control is returned to the application program. At that point, the application program can continue with other processing but cannot disturb the CCB or associated data. (The CCB_RETCODE is still X'FF'.) When the command is completed, the protocol driver sets the return code in both the AL register of the computer and the CCB_RETCODE field, and checks the CCB_CMD_CMPL field. The CCB_CMD_CMPL field provides the protocol driver with the address of a command completion appendage of an application program. + +☐ If the CCB_CMD_CMPL field is not 0, the protocol driver transfers control to the application program at the address provided. The application program continues with the command completion appendage and returns control to the protocol driver when completed. + +Upon entry, the command completion appendage can obtain the final return code from either the AL register or the CCB_RETCODE field. + +☐ If the CCB_CMD_CMPL field contains X'00000000', the application program has not supplied a command completion appendage. The protocol driver performs no further action for this CCB and does not interrupt the application program. In this case, the application program must monitor the CCB_RETCODE for a change from X'FF', indicating that the protocol driver has completed the command and updated the return code. + +If the protocol driver immediately determines that the adapter cannot execute the command, it sets the CCB_RETCODE field with the error code. + +Some commands execute entirely in the workstation and do not use the adapter hardware. When this is the case, the following actions happen: + +☐ The completion code is set when the protocol driver returns from the interrupt that initiated the command. + +☐ If the command completion appendage is defined, it is given control before the protocol driver returns from the interrupt. + +This is an exception and is explained with the command descriptions to which it applies. + +Subtopics +2.3.2.1 Appendages + +
Copyright IBM Corp. 1986, 1996
+<page_number>2.3.2 - 1</page_number> + +--- + + +## Page 69 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Appendages + +2.3.2.1 Appendages + +User-supplied appendages provide exit points from the protocol driver. These appendages are short subroutines that might improve the application program's ability to handle information or events. See Chapter 4, "NetBIOS," for routines used with NetBIOS. + +To ensure the integrity of the system, the appendages should have the following characteristics: + +* The amount of code executed should be limited, because this routine is an I/O appendage. The appendage is used because a point has been reached where information should be saved for subsequent use. +* When the appendage is entered, the keyboard and DOS timer are disabled, and no more interrupts can be serviced from this adapter until the appendage is completed. +* When control passes to the appendage, interrupts are disabled, and it appears to the appendage that the appendage was entered through an 8086 INT instruction. The stack is established so that an 8086 IRET instruction properly returns control and restores flags. + +When appendage processing is complete, the appendage code must execute the 8086 IRET as the last instruction. + +The protocol driver saves all registers on the stack before giving control to the appendage. Sixteen bytes of the stack are used by the protocol driver when processing the adapter interrupt. When the appendage is entered, 242 bytes of stack space are available. + +* Execution of the IRET instruction by the appendage returns control to the protocol driver at the point at which it had transferred control to the appendage. The protocol driver restores all registers and returns control to the program that was originally interrupted. + +Upon entry to the appendages the following things happen: + +* The CX register contains the adapter number. +* The CS register points to the appendage code (current segment). +* The SS and SP registers define the current stack. +* Other specific appendage descriptions define other registers. + +The types of user appendages are: + +**Command completion appendage** +A per-command exit that allows asynchronous command completion. The application program can provide several command completion appendages and selectively point to a specific one in each CCB. + +The address in the CCB_CMD_CMPL field of the related CCB (which should not be X'00000000', indicating no appendage) indicates the entry point. + +The address of the CCB that the adapter completed is in registers ES and BX. The return code is in CCB_RETCODE and the AL register (AH=X'00'). + +**Data received appendage** +The RECEIVED_DATA field of the parameter table of the RECEIVE command defines this appendage. The address of the CCB is placed in registers DS and SI. The address of the first receive data buffer is placed in registers ES and BX. + +**Exception or status conditions** +These appendages are a set of exit points that allow the protocol driver to report hardware and software error conditions and certain status information to the user. When any exception state occurs, all pending adapter commands have the CCB_RETCODE field of their CCBs set for the appropriate reason, and are queued and passed to the exception appendage. The command completion appendage is not taken. See the CCB_POINTER field description on topic 2.5.1 for more about queues. + +Following are the exception or status condition appendages. + +**PC-detected error appendage** +This appendage is defined in the PC_ERROR_EXIT field of the CCB for a DIR.INITIALIZE command and a DIR.MODIFY.OPEN.PARMS command, or in the PC_ERROR_EXIT field of the DIRECT_PARMS table of a DIR.OPEN.ADAPTER command. + +The protocol driver passes parameters to the appendage on entry. Register CX contains the adapter number. Register AX contains the error code. See "PC System Detected Errors" in topic B.14 for the code meanings. + +**Network status appendage** +This appendage is defined in the NETW_STATUS_EXIT field of the CCB for a DIR.INITIALIZE command and a DIR.MODIFY.OPEN.PARMS command, or in the NETW_STATUS_EXIT field of the DIRECT_PARMS table of a DIR.OPEN.ADAPTER command. + +The protocol driver passes parameters to the appendage on entry. Register CX contains the adapter number. Register AX contains the network status. See "Network Status" in topic B.10 for the code meanings. + +**Adapter check appendage** +This appendage is defined in the ADAPTER_CHECK_EXIT field of a DIR.INITIALIZE command and a DIR.MODIFY.OPEN.PARMS command, or in the ADAPTER_CHECK_EXIT field of the DIRECT_PARMS table of a DIR.OPEN.ADAPTER command. See topics 3.3.6, 3.3.8, and 3.3.9 for the descriptions of these commands. See "Token-Ring Network Adapter Check Reason Codes for All CCBs" in topic B.8 for the reason code meanings. + +Adapter open errors take the normal command completion appendage. + +**DLC status appendage** +This appendage is defined in the DLC_STATUS_EXIT field of the CCB parameter table for a DLC.OPEN.SAP command. + +The protocol driver passes parameters to the appendage on entry. Register CX contains the adapter number. Register AX + +
Copyright IBM Corp. 1986, 1996
+<page_number>2.3.2.1 - 1</page_number> + +--- + + +## Page 70 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Appendages + +contains the DLC status code. Register SI contains a user-defined value from the USER_STAT_VALUE field in the parameter table of the DLC.OPEN.SAP command. Registers ES and BX point to the DLC status table. See "DLC Status Codes" in topic B.3 for the code meanings and the DLC status table. + +
Copyright IBM Corp. 1986, 1996 +2.3.2.1 - 2
+ +--- + + +## Page 71 + +LAN Technical Reference: 802.2 and NetBIOS APIs +LAN Support Program (CCB1) Control Blocks + +2.3.3 LAN Support Program (CCB1) Control Blocks + +This section describes the format of the CCB1 for DOS. The content of the first field indicates to the protocol driver which type of interface the application program will use. If the first field contains either X'00' or X'01', the block is considered to be a CCB and either the direct interface or the DLC interface is used. In the case where that field is less than X'03', it is considered to be the CCB adapter field. The values X'02' and X'03' cannot be used; they are reserved, and the protocol driver returns an error code if they are used. + +If the first field contains a byte greater than X'0F', the NetBIOS interface is used and the control block is considered to be an NCB. The NCB is described under "NCB Field Explanations" in topic 4.4.1. NetBIOS must be loaded before a NetBIOS command is issued, or the protocol driver returns an X'FB' return code. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 2-1. CCB1 Command Control Block
OffsetField NameByte Length8086 TypeDescription
0CCB_ADAPTER1DBAdapter 0 or 1
1CCB_COMMAND1DBCommand field
2CCB_RETCODE1DBCompletion code
3CCB_WORK1DBAdapter support software work area
4CCB_POINTER4DDQueue pointer and protocol driver work area
8CCB_CMD_CMPL4DDCommand completion user appendage
12CCB_PARM_TAB4--Parameters or pointer to CCB parameter table
+ +Note: Use this control block definition with both the direct interface and the DLC interface. + +Note: CCB2 and CCB3 for OS/2 support more than two adapters. + +For a complete description of the fields, see "CCB Field Explanations" in topic 2.5.1. + +
Copyright IBM Corp. 1986, 1996
+<page_number>2.3.3 - 1</page_number> + +--- + + +## Page 72 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Programming Conventions with OS/2 + +2.4 Programming Conventions with OS/2 + +The following sections describe the OS/2 DLR interface and the OS/2 DD interface provided with OS/2 EE, OS/2 LAN Server, or NTS/2. + +Subtopics +2.4.1 OS/2 DLR Interface +2.4.2 OS/2 DD Interface + +
Copyright IBM Corp. 1986, 1996 +2.4 - 1
+ +--- + + +## Page 73 + +LAN Technical Reference: 802.2 and NetBIOS APIs +OS/2 DLR Interface + +2.4.1 OS/2 DLR Interface + +DLR calling conventions, command completion, and control block structures are described in the topics that follow. + +Subtopics +2.4.1.1 Execution of Multiple Commands with the DLR Interface +2.4.1.2 User's Data Segment Restrictions with the DLR Interface +2.4.1.3 User's Data Segment Guidelines with the DLR Interface +2.4.1.4 DLR Interface (CCB2) Calling Conventions +2.4.1.5 DLR Interface (CCB2) Command Completion +2.4.1.6 DLR Interface (CCB2) Control Blocks + +
Copyright IBM Corp. 1986, 1996 +2.4.1 - 1
+ +--- + + +## Page 74 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Execution of Multiple Commands with the DLR Interface + +2.4.1.1 Execution of Multiple Commands with the DLR Interface + +To enhance the performance of the protocol driver, the application program can request execution of multiple commands with a single invocation of the protocol driver. This is accomplished by allowing application programs to queue CCB requests using the CCB_POINTER field of the CCBs. All queued CCBs are then linked with the CCB_POINTER fields pointing to the next CCB in the queue of CCBs. All commands queued for a single invocation must be for the same adapter. If the chained commands are not for the same adapter, the processing of the queue is terminated with all unprocessed commands returned to the user with the CCB_RETCODE of the first CCB returned set to X'5F'. + +If an error is found while processing the queue of CCB requests, the remaining CCBs in the queue are not processed. The CCB containing the error plus a queue of the commands that have not been processed is returned to the application program using a Bad Command Pointer. The address of this pointer is passed to the DLR interface. See "DLR Interface (CCB2) Calling Conventions" in topic 2.4.1.4 for more information. + +Not all commands should be chained, especially commands that are dependent on the completion of other commands. For example, do not chain together DLC.OPEN.SAP, DLC.OPEN.STATION, and DLC.CONNECT.STATION commands because the later two commands are dependent upon the completion of the first command. However, you can chain together synchronous commands that execute in the workstation and commands that are independent of each other without resulting in time-related errors. Commands such as TRANSMIT, READ, BUFFER.FREE, BUFFER.GET, and commands for different station IDs can be issued successfully in a chain of commands. + +
Copyright IBM Corp. 1986, 1996
+<page_number>2.4.1.1 - 1</page_number> + +--- + + +## Page 75 + +LAN Technical Reference: 802.2 and NetBIOS APIs +User's Data Segment Restrictions with the DLR Interface + +2.4.1.2 User's Data Segment Restrictions with the DLR Interface + +All application program data segments referred to in a call to the protocol driver must be accessible by the OS/2 process that is calling the protocol driver. That is, the CCB and all data areas pointed to by the CCB (for example, SAP buffers and transmit buffers) must be in the current local descriptor table (owned by the current OS/2 process) so the protocol driver has access to these areas in order to lock and update them. + +All control blocks (for example, parameter tables) referenced with an offset must be located in the same segment as the associated CCB. As a performance suggestion, control blocks should be limited to 1 segment (64 KB). + +
Copyright IBM Corp. 1986, 1996 +2.4.1.2 - 1
+ +--- + + +## Page 76 + +LAN Technical Reference: 802.2 and NetBIOS APIs +User's Data Segment Guidelines with the DLR Interface + +2.4.1.3 User's Data Segment Guidelines with the DLR Interface + +Place data to be processed by the protocol driver in separate segments. You can separate segments that are supplied by application programs in requests from data segments that contain static local variables of the application programs. Allocating separate segments for data accessed by the protocol driver is not a requirement. However, using separate segments limits the size of the data area that the protocol driver locks. The protocol driver locks data to ensure that OS/2 does not move data to disk or other segments when the data is not frequently accessed. At interrupt time, the protocol driver must have immediate access to user data associated with CCB requests. By locking the segments containing data, the protocol driver ensures that OS/2 does not disturb the data. However, locking segments consumes RAM area; therefore, locking fewer segments allows more physical RAM to be available. The following data structure types should each be assigned to a separate allocated segment: + +☐ Receive buffers +☐ Transmit buffers +☐ CCBs and associated parameter tables. + +To maximize overall performance, an application program should use a single segment to contain the above data structures. By providing a single segment, all the associated data structures are locked as long as one of the structures remains in the domain of the protocol driver. With the single segment locked, no additional locks are required when requesting the protocol driver's services, unless the CCB of the request references a segment outside of the locked segment. Also, performance is enhanced if all data structures start on an even-byte boundary. + +
Copyright IBM Corp. 1986, 1996 +2.4.1.3 - 1
+ +--- + + +## Page 77 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DLR Interface (CCB2) Calling Conventions + +2.4.1.4 DLR Interface (CCB2) Calling Conventions + +To request the DLR interface, you must place two parameters onto the stack. These parameters are: + +☐ CCB2 Pointer: Pointer to CCB to be processed +☐ Address of Bad Command Pointer: Address of a returned pointer value + +This parameter is the address of a DD (Double Word) pointer or Bad Command Pointer. If an error is found with a command that is included in a chain of CCBs passed to OS/2 EE or other OS/2 support software on a single invocation, the address of the CCB containing the error with all unprocessed CCBs still chained to it is returned. The Bad Command Pointer points to these commands upon return from the OS/2 EE invocation. The Bad Command Pointer is valid only when the immediate return code in AX is set to X'0003'. If an immediate return code is set, the semaphores specified in the CCB are not cleared. + +The application program must have access to the segments referenced by all pointers (for example, the CCB and all associated data structures). + +When a list of commands are passed to OS/2 EE on a single invocation, all chained commands must be for the same adapter. + +For a given application program to make a request to OS/2 EE, it must: + +☐ Push the selector of a CCB2 onto the stack. +☐ Push the offset of a CCB2 onto the stack. +☐ Push the selector of address for Bad Command Pointer onto the stack. +☐ Push the offset of address for Bad Command Pointer onto the stack. +☐ Invoke the OS/2 EE DLR interface (ACSLAN module name within the ACSLAN dynamic link library) using the Call Far/Return Far interface. ACSLAN removes the push parameters from the stack before returning to the caller. + +Upon return, the AX register contains one of the following immediate return codes: + +X'0000' Command accepted or command was completed successfully +X'0001' Invalid CCB pointer +X'0002' CCB in error +X'0003' CCB in error; check Bad Command Pointer +X'0004' Unexpected operating system return code; adapter closed +X'0005' Unexpected operating system return code +X'0006' Invalid command pointer. + +If, on return, the AX register is set to X'03', check the Bad Command Pointer. If the Bad Command Pointer is non-0, it points to a queue of commands that were not processed, excluding the first CCB in this queue. The first of these commands had an error and has the CCB_RETCODE field set. All other commands that are queued to the first CCB have not been processed; therefore, no return code is provided. + +If, on return, the AX register is set to X'04', the adapter will be closed. If a READ command is outstanding, application program resource information is returned to the READ command's parameter table. See the READ command description on topic 3.3.37 for more information. + +If, on return, the AX register is set to X'05', check the CCB_WORK field for an OS/2 EE function and the word at offset 24 of the CCB for the OS/2 EE return code of the failing request. + +
Copyright IBM Corp. 1986, 1996
+<page_number>2.4.1.4 - 1</page_number> + +--- + + +## Page 78 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DLR Interface (CCB2) Command Completion + +2.4.1.5 DLR Interface (CCB2) Command Completion + +User notification flags, semaphores, and return codes are used to post events to the application programs. The choice of how each event is posted is left up to the application program. Some events can be posted differently. + +User notification flags are used to post events as follows: + +1. To request that information relating to an event be placed onto a completion list managed by the protocol driver. By placing an event onto the completion list, you can retrieve information relating to the event at a later time. + +2. To enable notification of critical exceptions that result in the adapter closing. By enabling critical exception notification, you can be alerted of the event if a READ command is pending before the event occurs. + +All flags are 4 bytes long and are preserved across invocations. The flags are set whenever non-0 values are used. If needed, these flags can contain user-specific information. However, if the flags are equal to X'00000000', the flags are considered not set. Nothing is placed onto the completion list, and no notification is given for critical exceptions. + +If an event is placed onto the completion list, the application program must issue a READ command to remove the event from the completion list. See the READ command description on topic 3.3.37. + +Semaphores can be provided with all commands. Upon completion of a command, the protocol driver clears the semaphore to alert the application program of the command completion. + +The application program can also poll the completion return code for each command to determine when the command has completed its function. + +**User Notification Flags:** Set the following user flags to place event information onto the completion list. + +**Command completion flag (CCB_CMPL_FLAG)** +For each command issued to the adapter support software, a CCB_CMPL_FLAG is included in the CCB. If this flag is set to a non-0 number, the address of the CCB is queued onto a completion list upon completion of the command. + +**Receive data flag (RECEIVE_FLAG)** +For each RECEIVE command issued to the protocol driver, a RECEIVE_FLAG is included in the CCB's parameter table. If this flag is set to a non-0 number, the first receive buffer address is queued onto a completion list upon reception of data. + +**DLC status change flag (DLC_STATUS_FLAG)** +For each DLC.OPEN.SAP command issued to the protocol driver, a DLC_STATUS_FLAG is included in the CCB's parameter table. If this flag is set to a non-0 number, detection of a DLC status change results in a copy of the current DLC status table being queued onto a completion list. See "DLC Status Codes" in topic B.3 for a list of DLC status codes. + +**User exception flags (for non-critical exceptions)** +Use the DIR.SET.EXCEPTION.FLAGS command to set the user exception flags. If these flags are set to a non-0 number, the appropriate information is queued onto a completion list upon detection of an exception condition. See the DIR.SET.EXCEPTION.FLAGS command description on topic 3.3.14. The following is a list of the user exception flags that enable information to be placed onto the completion list for non-critical exceptions: + +☐ NETWORK_STATUS_FLAG +☐ SYSTEM_ACTION_FLAG. + +Set the following user flags with the DIR.SET.EXCEPTION.FLAGS command to enable notification of critical exceptions: + +☐ ADAPTER_CHECK_FLAG +☐ NETWORK_STATUS_FLAG +☐ PC_ERROR_FLAG +☐ SYSTEM_ACTION_FLAG. + +If these flags are set to a non-0 number and a READ command that requests notification of critical exceptions is pending, then, when a critical exception condition is detected, the appropriate information is copied to the pending READ command's parameter table. The READ command is then posted as defined by the READ command's CCB. + +**Note:** For more information on the exception information, see "Adapter Check for CCB3" in topic B.7.3, "Network Status for CCB3" in topic B.10.3, "PC System Detected Errors for CCB3" in topic B.14.3, and "System Action Exceptions for CCB3" in topic B.15.2. + +**Posting of Events:** All commands issued to the protocol driver can be posted using any combination of the three post mechanisms: setting the user flag along with issuing a READ command, waiting on a semaphore, or polling the return code set in the CCB. However, posting exceptions and DLC status changes must be implemented with setting the user flags and issuing a READ command. + +If the associated user flag is not set, the event is not queued to the completion list and the user must use one of the other mechanisms to post the event. + +For each command, a semaphore can be passed to the protocol driver within the CCB. Upon completion of the command, the protocol driver clears the semaphore. Thus, if an application program has a thread waiting on the semaphore, the thread is dispatched. If neither the user flag nor the semaphore is used, the application program must poll the return code of the CCB to determine when the command has completed. + +
Copyright IBM Corp. 1986, 1996
+<page_number>2.4.1.5 - 1</page_number> + +--- + + +## Page 79 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DLR Interface (CCB2) Command Completion + +If both the user flag and a semaphore are used, the semaphore is cleared when the command routine is completed, and the CCB of the command is also placed onto the completion list. By clearing the semaphore, the application program is notified of the command completion. However, the application program must still issue a READ command (if one is not already pending for the given event) to remove the CCB from the completion list. + +There are two special cases where events are chained together to lessen the number of READ commands that must be issued to retrieve information from the completion list. Both RECEIVE and TRANSMIT commands can be issued specifying that event information relative to each command be linked together. If the user chooses to have receive data frames chained together and the completed TRANSMIT commands' CCBs chained together, the following conditions apply: + +* If a RECEIVE command is issued with the CMD_CMPL_FLAG and the RECEIVE_FLAG set, all receive data is placed onto the completion list. If the RECEIVE command is issued requesting that received frames be chained and a READ command is issued with one or more frames being received that meet the READ command's requirements, the frames are chained together using the first receive buffer of each frame. +* If multiple TRANSMIT commands containing the CMD_CMPL_FLAG set have been executed and have requested chaining upon completion, then whenever a READ command is issued and more than one TRANSMIT CCB is executed that matches the READ command's requirements, the TRANSMIT CCBS are chained together using the CCB_POINTER of the TRANSMIT CCB and are returned to the application program. + +
Copyright IBM Corp. 1986, 1996 +2.4.1.5 - 2
+ +--- + + +## Page 80 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DLR Interface (CCB2) Control Blocks + +2.4.1.6 DLR Interface (CCB2) Control Blocks + +Table 2-2 describes the fields of the CCB2 for OS/2 EE 1.3 and LAPS using the DLR interface. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 2-2. CCB2 Command Control Block
OffsetField NameByte Length8086 TypeDescription
0CCB_ADAPTER1DBAdapter number
1CCB_COMMAND1DBCommand field
2CCB_RETCODE1DBCompletion code
3CCB_WORK1DBAdapter support software work area
4CCB_POINTER4DDQueue pointer and protocol driver work area
8CCB_CMPL_FLAG4DDCommand completion flag
12CCB_PARM_OFFSET2DWOffset to CCB2 parameter table
14CCB_PARAMETER_12DWParameter or reserved for an application program
16CCB_SEMAPHORE4DDCommand post semaphore
20CCB_APPL_ID1DBApplication program ID
21CCB_READ_FLAG1DBREAD chained to CCB flag
22CCB_APPL_KEY2DWApplication program key code
24CCB_PARAMETER_22DWParameter for System Key or reserved
+ +Note: Use the control block definition above with both the direct interface and the DLC interface. + +For a complete description of the fields, see "CCB Field Explanations" in topic 2.5.1. + +
Copyright IBM Corp. 1986, 1996
+<page_number>2.4.1.6 - 1</page_number> + +--- + + +## Page 81 + +LAN Technical Reference: 802.2 and NetBIOS APIs +OS/2 DD Interface + +2.4.2 OS/2 DD Interface + +DD calling conventions, command completion, and control block structures are described in the topics that follow. + +Subtopics +2.4.2.1 User's Data Segment Restrictions with the DD Interface +2.4.2.2 User's Data Segment Guidelines with the DD Interface +2.4.2.3 DD Interface (CCB3) Calling Conventions +2.4.2.4 DD Interface (CCB3) Command Completion +2.4.2.5 DD Interface (CCB3) Control Blocks + +
Copyright IBM Corp. 1986, 1996 +2.4.2 - 1
+ +--- + + +## Page 82 + +LAN Technical Reference: 802.2 and NetBIOS APIs +User's Data Segment Restrictions with the DD Interface + +2.4.2.1 User's Data Segment Restrictions with the DD Interface + +All application program data segments referred to in a call to the protocol driver must be accessible by the OS/2 process that is calling the adapter. + +Make all segment references with either global descriptor table (GDT) selectors or 32-bit physical addresses (CCB addresses, SAP buffer addresses, transmit buffer addresses) and lock all segments using the OS/2 Device Help routine. See "RECEIVE.MODIFY" in topic 3.3.41 and descriptions of the TRANSMIT commands on topic 3.3.42 for use of the 32-bit physical addresses. Map all other commands and data areas using the GDT selectors. + +Locate all control blocks referenced with an offset (for example, parameter tables) in the same segment as the associated CCB. + +
Copyright IBM Corp. 1986, 1996 +2.4.2.1 - 1
+ +--- + + +## Page 83 + +LAN Technical Reference: 802.2 and NetBIOS APIs +User's Data Segment Guidelines with the DD Interface + +2.4.2.2 User's Data Segment Guidelines with the DD Interface + +Place data that is processed by the protocol driver in separate segments from data segments that contain static local variables of the application programs. Allocating separate segments for data accessed by the protocol driver is not a requirement. However, using separate segments limits the size of the data area that the protocol driver uses. The protocol driver assumes that data segments are locked before they are called from an application program. Therefore, it is the application program's responsibility to lock the data areas. At interrupt time, the protocol driver must have immediate access to user data associated with CCB requests. By having the application program lock the segments containing data, it is ensured that OS/2 does not disturb the data. Following is a list of data structure types that you should assign to a separate allocated segment: + +☐ Receive buffers (use GDT selectors) +☐ Transmit buffers (use 32-bit physical addresses for better performance) +☐ CCBs and associated parameter tables (use GDT selectors) + +
Copyright IBM Corp. 1986, 1996 +2.4.2.2 - 1
+ +--- + + +## Page 84 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DD Interface (CCB3) Calling Conventions + +2.4.2.3 DD Interface (CCB3) Calling Conventions + +To request the DD interface, the application program device driver must place the address of the CCB3 to be executed by the DD interface into registers ES and BX, and push an invocation code of X'0000' onto the stack. The application program device driver then issues a Call Far instruction to the OS/2 EE DD interface intercommunication entry point. + +**Note:** The application program device driver must do an ATTACH OS/2 Device Help Function call to obtain the interdevice driver communication entry point of the OS/2 DD interface (LANDD$). Refer to the OS/2 command for details of the call. + +Upon return from the DD interface, all registers contain their original values with the exception of the AX register. The AX register contains the immediate return code. + +For a given application program's device driver to make a request to the DD interface, it must: +☐ Set register BX to the address offset of the CCB3 to be executed +☐ Set register ES to the address selector of the CCB3 to be executed +☐ Push an invocation code of zero onto the stack +☐ Call the OS/2 DD interface (LANDD$) interdevice driver communication entry point using the Call Far/Return Far interface + +Upon return, the AX register contains one of the following immediate return codes: + +X'0000' Command accepted or command was completed successfully +X'0001' Invalid CCB pointer +X'0002' CCB in error +X'0004' Unexpected operating system return code; adapter closed +X'0005' Unexpected operating system return code +X'0007' Invalid invocation code + +If, on return, the AX register is set to X'04', the adapter will be closed. If the application program has an appendage for workstation-detected errors, then the function code of the Device Help request and the return code of the request that failed are included in the information returned in the 20-byte information table of the workstation-detected appendage. + +
Copyright IBM Corp. 1986, 1996
+<page_number>2.4.2.3 - 1</page_number> + +--- + + +## Page 85 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DD Interface (CCB3) Command Completion + +2.4.2.4 DD Interface (CCB3) Command Completion + +Use user appendages and return codes to post events to the application programs. The choice of how each event is posted is left up to the application program. + +Events are posted to user appendages by one of the following methods: + +☐ Appendages request that information relating to an event be passed to the application program by an appendage call from the protocol driver when an event has occurred. + +☐ Appendages enable notification of critical exceptions that result in the adapter closing. By enabling critical exception notification, an application program can be alerted of the event by an appendage call from the protocol driver. + +The application program must pass the offsets to the appendages for these different events: + +☐ Completion of commands +☐ Reception of data +☐ DLC status change +☐ The following exceptions +- Adapter Check +- Network Status +- PC Detected Error +- System Action + +The application program can also poll the completion return code for each command to determine when the command has finished processing. + +**Posting of Events:** If event information is to be posted to the application program, the user appendages described in this section must be defined by passing an offset to the protocol driver through the different commands. The protocol driver enters the application program's device driver with a Call Far instruction using the application program's device driver entry point obtained when the DIR.OPEN.ADAPTER command is issued. The application program's device driver must return using a Return Far instruction. + +**Note:** For all appendage calls and the RECEIVE.MODIFY subroutine call, an invocation code of X'0001' is pushed onto the stack. The called device driver must remove the invocation code from the stack. + +**Command Completion** +For each command issued to the protocol driver, a CCB_APPNDG_OFFSET is included in the CCB. The offset is a 2-byte Define Word (DW) field that the protocol driver uses for the address of the appendage that the protocol driver passes to the application program in register DI when the application program device driver is called. + +When the protocol driver calls the application program at the address obtained by the ATTACHDD function, it provides the following information: + +☐ An invocation code of X'0001' was pushed onto the stack. Before returning to the protocol driver, the application program must remove the invocation code from the stack. + +☐ Register DI contains the offset of the command completion appendage. + +☐ Register DS contains the application program's device driver protect mode data segment selector. + +☐ Register CX contains the adapter number. + +☐ Registers ES and BX contain the address of the CCB. + +☐ Registers DX and SI contain the address of a 12-byte information table relating to the command. These registers are set to zero if no information is available to be returned to the application program. See Table 2-4 in topic 2.5.1 for the information table. + +☐ Register AX contains the CCB return code. + +**Receive Data** +When an application program issues a RECEIVE command to the protocol driver, a RCV_DATA_APPNDG is included in the CCB parameter table of the RECEIVE command. The offset is a 2-byte DW field that the protocol driver passes to the application program's device driver when receive data is available and the application program's device driver is called. + +When the protocol driver calls the application program at the address obtained by the ATTACHDD function, it provides the following information: + +☐ An invocation code of X'0001' was pushed onto the stack. Before returning to the protocol driver, the application program must remove the invocation code from the stack. + +☐ Register DI contains the offset of the RECEIVE appendage. + +☐ Register DS contains the application program's device driver protect mode data segment selector. + +☐ Register CX contains the adapter number. + +☐ Registers ES and BX contain the address of the first SAP buffer. + +☐ Registers AX and SI contain the address of the RECEIVE command's CCB for which receive data has been processed. + +
Copyright IBM Corp. 1986, 1996
+<page_number>2.4.2.4 - 1</page_number> + +--- + + +## Page 86 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DD Interface (CCB3) Command Completion + +**DLC Status** +When an application program issues a DLC.OPEN.SAP command to the protocol driver, a DLC_STATUS_OFFSET is included in the CCB parameter table of the DLC.STATUS command. The offset is a 2-byte DW field that the protocol driver passes to the application program's device driver when DLC status data is available and the application program's device driver is called. + +When the protocol driver calls the application program at the address obtained by the ATTACHDD function, it provides the following information: +* An invocation code of X'0001' was pushed onto the stack. Before returning to the protocol driver, the application program must remove the invocation code from the stack. +* Register DI contains the offset of the DLC status appendage as defined by the DLC.OPEN.SAP command. +* Register DS contains the application program's device driver protect mode data segment selector. +* Register CX contains the adapter number. +* Registers ES and BX contain the address of a 20-byte information table. See "DLC Status Codes" in topic B.3 for description of DLC status codes. +* Register AX contains the DLC status code. +* Register SI contains the USER_STAT_VALUE defined with the DLC.OPEN.SAP command. + +**Exception Conditions** +The user appendages associated with exception conditions are set using the DIR.SET.EXCEPTION.FLAGS command. See the DIR.SET.EXCEPTION.FLAGS command description on topic 3.0 + +An appendage offset is included in the DIR.SET.EXCEPTION.FLAGS command for each of the conditions below. The offset is a 2-byte DW field that the protocol driver passes to the application program's device driver when an exception occurs and the application program's device driver is called. + +When the protocol driver calls the application program at the address obtained by the ATTACHDD function, it provides the following information for the different exception conditions: + +**Adapter Check** +See "Adapter Check for CCB3" in topic B.7.3 for more information. +* An invocation code of X'0001' was pushed onto the stack. Before returning to the protocol driver, the application program must remove the invocation code from the stack. +* Register DI contains the offset of the adapter check appendage as defined by the DIR.SET.EXCEPTIONS.FLAG command. +* Register DS contains the application program's device driver protect mode data segment selector. +* Register CX contains the adapter number. +* Registers ES and BX contain the address of a 20-byte information table. +* Register AX contains the reason code. + +**Network Status** +See "Network Status for CCB3" in topic B.10.3 for more information. +* An invocation code of X'0001' was pushed onto the stack. Before returning to the protocol driver, the application program must remove the invocation code from the stack. +* Register DI contains the offset of the network status appendage as defined by the DIR.SET.EXCEPTIONS.FLAG command. +* Register DS contains the application program's device driver protect mode data segment selector. +* Register CX contains the adapter number. +* Registers ES and BX contain the address of a 14-byte information table. +* Register AX contains the network status. + +**PC Detected Error** +See "PC System Detected Errors for CCB3" in topic B.14.3 for more information. +* An invocation code of X'0001' was pushed onto the stack. Before returning to the protocol driver, the application program must remove the invocation code from the stack. +* Register DI contains the offset of the workstation-detected error appendage as defined by the DIR.SET.EXCEPTIONS.FLAG command. +* Register DS contains the application program's device driver protect mode data segment selector. + +
Copyright IBM Corp. 1986, 1996 +2.4.2.4 - 2
+ +--- + + +## Page 87 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DD Interface (CCB3) Command Completion + +☐ Register CX contains the adapter number. +☐ Registers ES and BX contain the address of a 20-byte information table. +☐ Register AX contains the error code. + +**System Action** +See "System Action Exceptions for CCB3" in topic B.15.2 for more information. + +☐ An invocation code of X'0001' was pushed onto the stack. Before returning to the protocol driver, the application program must remove the invocation code from the stack. +☐ Register DI contains the offset of the system action appendage as defined by the DIR.SET.EXCEPTIONS.FLAG command. +☐ Register DS contains the application program's device driver protect mode data segment selector. +☐ Register CX contains the adapter number. +☐ Registers ES and BX contain the address of a 14-byte information table. +☐ Register AL contains the System Action ID. +☐ Register AH contains the SAP value associated with the System Action ID. + +If the associated user appendage is not defined, the event is not posted to the user. + +
Copyright IBM Corp. 1986, 1996 +2.4.2.4 - 3
+ +--- + + +## Page 88 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DD Interface (CCB3) Control Blocks + +2.4.2.5 DD Interface (CCB3) Control Blocks + +This table contains a description of the format of the CCB3 for OS/2 EE and other OS/2 support programs using the DD interface. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 2-3. CCB3 Command Control Block
OffsetField NameByte Length8086 TypeDescription
0CCB_ADAPTER1DBAdapter number
1CCB_COMMAND1DBCommand field
2CCB_RETCODE1DBCompletion code
3CCB_WORK1DBAdapter support software work area
4CCB_POINTER4DDQueue pointer and protocol driver work area
8CCB_APPNDG_OFFSET2DWOffset to CCB3 completion appendage
-reserved-2DWReserved for application program
12CCB_PARM_OFFSET2DWOffset to CCB3 parameter table
14CCB_PARAMETER_12DWParameter or reserved for an application program
16CCB_RESOURCE_ID2DWResource ID of application program process
-reserved-2DWReserved for application program
20CCB_APPL_ID1DBApplication program ID
211DBReserved for application program
22CCB_APPL_KEY2DWApplication program key code
24CCB_PARAMETER_22DWParameter for System Key or reserved
+ +Note: The above control block definition is to be used with both the direct interface and the DLC interface. + +For a complete description of the fields, see "CCB Field Explanations" in topic 2.5.1. + +
Copyright IBM Corp. 1986, 1996
+<page_number>2.4.2.5 - 1</page_number> + +--- + + +## Page 89 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Control Blocks for All CCBs + +2.5 Control Blocks for All CCBs + +The application program must prepare a control block to request an activity from the adapter when using a protocol driver from one of the IBM support programs. When the protocol driver analyzes the control block, it can determine which interface is needed by the content of the first bytes. + +The content of the control blocks is explained in "LAN Support Program (CCB1) Control Blocks" in topic 2.3.3, "DLR Interface (CCB2) Control Blocks" in topic 2.4.1.6, and "DD Interface (CCB3) Control Blocks" in topic 2.4.2.5. + +Subtopics +2.5.1 CCB Field Explanations + +
Copyright IBM Corp. 1986, 1996 +2.5 - 1
+ +--- + + +## Page 90 + +LAN Technical Reference: 802.2 and NetBIOS APIs +CCB Field Explanations + +2.5.1 CCB Field Explanations + +The following CCB field descriptions apply to all three CCBs (CCB1, CCB2, and CCB3) unless otherwise stated. + +--- + +**CCB_ADAPTER** + +**Explanation:** This field defines which adapter is to be used. + +**For CCB1:** The adapter number has the following binary format: + +B'0000ceaa', where + +* **0000** (bits 4-7) are always 0. +* **c** (bit 3) is the common storage bit. If this bit is on, the CCB was issued from common memory. This bit is used when running under the 3270 Workstation Program. See "3270 Workstation Support" in topic D.2.1.4 for more information. +* **e** (bit 2) is the extended CCB bit. If this bit is on, the CCB is extended 2 bytes, with the last 2 bytes indicating bank switching information. This bit is used when running under the 3270 Workstation Program. See "3270 Workstation Support" in topic D.2.1.4 for more information. +* **aa** (bits 0 and 1) are the adapter number, B'00' through B'11' (only B'00' and B'01' are current valid adapter numbers). It must be either X'00' to use the primary adapter or X'01' for the alternate adapter. + +If bank switching in the 3270 Workstation Program is not implemented, the extended bank switch information in the CCB is set to a null value: X'FFFF'. + +Common and extended bits apply to the 3270 Workstation Program only. The following list describes these bits: + +* If the common and extended bits are both 0 (B'00'), the CCB was issued by an application program in one of the memory banks. +* If the common and extended bits are 0 and 1 (B'01'), the CCB is a *pseudo-CCB*. This means that a CCB issued by an application program in one of the memory banks was substituted with an internally generated CCB containing the extended memory bank information. +* If the common and extended bits are 1 and 0 (B'10'), the CCB was issued by code in the common storage area. NetBIOS issues this bit value for all CCBs except transmits of user-defined data. Common storage is accessed by the protocol driver independent of the currently active bank. +* If the common and extended bits are 1 and 1 (B'11'), the CCB was issued by code in the common storage area. The CCB has extended memory bank information. NetBIOS issues this bit value for CCBs that transmit user-defined data. + +If the value is greater than X'0F', the control block is an NCB. Values of X'02' and X'03' are reserved and, if used, a CCB_RETCODE of X'1D' is returned. Values greater than X'03' cause the NetBIOS interface to be used. See Chapter 4, "NetBIOS," for more information about NetBIOS. + +When used with a 3270 PC, the adapter number of a CCB has 2 additional bits defined and has the format described above. + +--- + +**CCB_COMMAND** + +**Explanation:** This field indicates the command to perform. A value of X'FF' is a permanently defined invalid command code. See Appendix A, "Valid Commands" in topic A.0 for a list of commands. + +--- + +**CCB_RETCODE** + +**Explanation:** This field contains the completion code as provided by the protocol driver. For all commands, this field is set to X'FF' by the protocol driver when the CCB is received. While the field is X'FF', the application program must not alter the CCB or any associated data. When the adapter completes the command, the protocol driver sets this field to the appropriate completion code. For all commands, X'00' means successful completion. See "CCB Return Codes Listed by Interface" in topic B.2 for descriptions of all return codes. + +--- + +**CCB_WORK** + +**Explanation:** This field is a work area for the protocol driver to use. + +--- + +**CCB_POINTER** + +**Explanation:** + +**For CCB1:** While the CCB_RETCODE is X'FF', the protocol driver uses this field for command processing. + +The application program uses this field as follows: + +<page_number>2.5.1 - 1</page_number> + +--- + + +## Page 91 + +LAN Technical Reference: 802.2 and NetBIOS APIs +CCB Field Explanations + +* When the adapter is closed, the application program interrogates this field to find the next command (CCB) in a queue of pending commands. +* When a DLC link station is sending I-format LPDUs, multiple transmissions are acknowledged at one time. All acknowledged I-format LPDUs are queued and presented at one time to the application program. That is, the protocol driver issues an interrupt providing a return code in one CCB. The CCB_POINTER field of that CCB contains the address of a queue of CCBs containing an appropriate return code. This continues until a CCB_POINTER field is 0, ending the queue. + +**For CCB2:** While CCB_RETCODE is X'FF', the OS/2 EE DLR interface can use this area for command processing. + +Application programs use this field under the following circumstances: + +* When it is necessary for the application program to request that multiple commands be processed as a result of a single invocation, the CCB_POINTER is used to chain CCB2 requests. +* When it is necessary for the application program to have a READ chained to the CCB2 to be used for its completion, the READ CCB2 address is placed in CCB_POINTER and the CCB_READ_FLAG is set to a non-zero value. +* When the adapter is closed, a chained list of pending commands is presented to the user through the CCB_POINTER of + - A CCB whose address is placed into the READ command's CCB parameter table + - A DIR.CLOSE.ADAPTER command that has been completed successfully. +* If transmissions specify that completed transmission request CCB2s be chained, the CCB2s are linked together upon completion using the CCB_POINTER. For this case the READ command must be used to retrieve the completed command's CCB2. The address of the first CCB is placed into the READ command's CCB2 parameter table. + +**For CCB3:** While CCB_RETCODE is X'FF', the protocol driver can use this area for command processing. + +When the adapter is closed, the application program interrogates this field to find the next command (CCB) in a queue of pending commands. + +--- + +**CCB_CMD_CMPL** + +**Explanation:** This field is the address of a user appendage to which the protocol driver goes upon command completion. The appendage allows the user to obtain control after a command has been completed. See "Appendages" in topic 2.3.2.1 for more information. When the user's appendage receives control at this point, the address of the completed CCB is in registers ES and BX, and the CCB_RETCODE is in register AL. Register AH is X'00'. See "LAN Support Program (CCB1) Command Completion" in topic 2.3.2 for more information. + +--- + +**CCB_CMPL_FLAG** + +**Explanation:** This flag indicates whether or not a completed command should be posted using the READ command. The protocol driver checks this field after command completion. If the flag is not 0, the completion is posted to the application program with a READ command. If a READ command is already pending for command completions, this completed command is posted immediately. If there is no pending READ, the command completion is queued internally to the protocol driver that is waiting for a READ for command completions. If the flag is 0, the completion is not posted to the application program with a READ command. After completion, the return code is set. + +If the CCB_CMPL_FLAG is not set, the application program either uses the CCB_SEMAPHORE or polls the CCB_RETCODE field for notification of the command completion. It is the application program's responsibility to poll the CCB_RETCODE field for a value other than X'FF'. The value X'FF' signifies that the command is in progress, and that the CCB and its associated data should not be altered. + +**Notes:** + +1. See the READ command description on topic 3.3.37 for details on posting command completions. +2. As soon as the protocol driver performs any immediate command processing, the command is queued and control is returned to the application program that is using the protocol driver (CCB_RETCODE is set to X'FF'). At that point, the application program can continue with other processing (not disturbing the CCB or any associated data). When the command is completed, the return code is set and the application program is posted if a READ command is pending. + +--- + +**CCB_APPNDG_OFFSET** + +**Explanation:** This field is the offset of a user appendage within the application program device driver's code segment that handles the command's completion. When the command is completed, the protocol driver calls the application program device driver at its intercommunication entry point, pushing the invocation code of X'0001' onto the stack. The appendage offset is passed in the DI register. The application program device driver must call the appendage located at the address offset specified in the DI register. + +When the protocol driver calls the application program device driver at the intercommunication entry point, the following information is provided: + +<page_number>2.5.1 - 2</page_number> +Copyright IBM Corp. 1986, 1996 + +--- + + +## Page 92 + +LAN Technical Reference: 802.2 and NetBIOS APIs +CCB Field Explanations + +☐ An invocation code of X'0001' has been pushed onto the stack. Before returning to the protocol driver, the application program must remove the invocation code from the stack. + +☐ Register DI contains the appendage offset as defined by each individual command. + +☐ Register DS contains the application program's device driver protect mode data segment selector. + +☐ Register CX contains the adapter number. + +☐ Registers ES and BX contain the address of the completing CCB. + +☐ Registers DX and SI contain the address of a 12-byte information table pertaining to the command which has been executed (see Table 2-4). If no information is available for the command, these registers contain zeroes. + +☐ Register AX contains the CCB3 return code. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 2-4. Command Completion Appendage Information Table
OffsetField NameByte Length8086 TypeDescription
0CCB_COUNT2DWCount of CCBs chained to EVENT_CCB_POINTER
2EVENT_CCB_POINTER4DDPointer to CCB terminated as a result of the CCB addressed with the ES and BX registers
6BUFFER_COUNT2DWCount of buffers chained to FIRST_BUFFER_ADDR
8FIRST_BUFFER_ADDR4DDAddress of first receive buffer for buffer pool
+ +CCB_PARM_TAB + +**Explanation:** This field points to additional parameters that are command-specific. These parameters are explained with the related command descriptions. + +If the parameters require 4 or fewer bytes, they are provided in the CCB_PARM_TAB field instead of in an area pointed to by the field. + +CCB_PARM_OFFSET + +**Explanation:** This field points to additional parameters that are command-specific. These parameters are explained with the related command descriptions. + +If the parameters require 2 or fewer bytes, they are provided in the CCB_PARM_OFFSET field. If the parameters require more than 2 bytes, the field contains the offset within the selector of the parameter table for this command. + +CCB_PARAMETER_1 + +**Explanation:** This field can contain another 2 bytes of parameter data to combine with the CCB_PARM_OFFSET field for a total of 4 bytes, or it can contain user-specific data, for example, the segment or selector. + +CCB_SEMAPHORE + +**Explanation:** A system semaphore can be used to notify an application program of a command completion. When the command has been executed, the protocol driver clears the CCB_SEMAPHORE field to alert the application program that the command has been completed. To specify a system semaphore, the CCB_SEMAPHORE field must contain a handle of a system semaphore that is returned from OS/2 EE when the system semaphore is created or opened. System semaphore handles provided on the DIR.OPEN.ADAPTER command should be used to obtain optimum performance. + +Only the OS/2 EE process that issues the DIR.OPEN.ADAPTER command and provides system semaphore handles can use these handles. All other processes associated with the application program must provide a handle returned from OS/2 EE for the given process when the system semaphore is created or opened. + +If the application program does not use a semaphore, the CCB_SEMAPHORE field should be coded as zero. If the CCB_SEMAPHORE field contains an invalid system semaphore handle (excluding 0s), the process is terminated by OS/2 EE whenever the handle is used in an OS/2 EE call. + +**Notes:** + +1. The system semaphore must be created so that exclusive ownership is not required. + +Copyright IBM Corp. 1986, 1996 +2.5.1 - 3 + +--- + + +## Page 93 + +LAN Technical Reference: 802.2 and NetBIOS APIs +CCB Field Explanations + +2. The protocol driver does not set the CCB_SEMAPHORE; it only clears it. + +--- + +CCB_RESOURCE_ID + +**Explanation:** A resource ID must be used to allow proper cleanup of resources owned by terminating processes of an application program. All control blocks that have been passed to the protocol driver can have a resource ID associated with them. This allows the protocol driver to know which resources are associated with which application programs. This ID is required when an application program consists of more than one OS/2 EE process. When a process terminates, the application program's device driver must clean up the resources associated with the process by issuing the PURGE.RESOURCES command with a PURGE_RESOURCE_ID. All control blocks that have a resource ID matching the PURGE_RESOURCE_ID are freed by the protocol driver. + +Memory passed to LANDD$ in the form of CCBs or buffers can be owned by different processes of an application program or by an application program's device driver. Because the LAN device drivers cannot guarantee that the active process is the owner of memory being passed to it, all control blocks and buffers are associated with the resource ID. The resource ID is passed as a parameter with the CCB and associated with the CCB and all other control blocks (logs, buffers) referenced by the CCB. + +If an application program consists of more than one OS/2 EE process, it is the application program's responsibility to manage the cleanup of each process's resources. For example, if an application program has two OS/2 EE processes (that have both been allocated memory being used in the application program's SAP buffer pool), when one of the processes ends the application program should notify LANDD$ with the PURGE.RESOURCE command. The resource ID is passed as a parameter to specify which control blocks should be removed (cleaned up) from the LAN device driver's internal queues. + +--- + +CCB_APPL_ID + +**Explanation:** This field contains the ID of the application program issuing the command. The CCB_APPL_ID is returned on the DIR.OPEN.ADAPTER request and must be used by the application program for all following commands that the application program issues. Some of the CCBs can be issued with the System Key, such as DIR.SET.GROUP.ADDRESS, DIR.READ.LOG and others, in which case the CCB_APPL_ID field is not needed. Otherwise, all of the CCBs (with the exception of the DIR.STATUS command) are required to use CCB_APPL_ID, which is returned on DIR.OPEN.ADAPTER CCB. + +**Note:** System Key is for system-administrator use only. + +--- + +CCB_READ_FLAG + +**Explanation:** An application program can specify that a READ command is chained to this CCB using the CCB_POINTER field. This READ command is used to process the completion of this CCB only, and not other commands that may have been executed previously. + +--- + +CCB_APPL_KEY + +**Explanation:** This field contains a key code used to provide resource security for application programs. For the given command to succeed, the CCB_APPL_KEY parameter must match the CCB_APPL_KEY code provided by the user on the DIR.OPEN.ADAPTER request. If the user chooses not to use a key code (key code is set to zero) when issuing the DIR.OPEN.ADAPTER command, the CCB_APPL_KEY parameter is not checked by the protocol driver when a request is made. Some commands can be issued with the System Key, such as DIR.SET.GROUP.ADDRESS, DIR.READ.LOG, and others. When this is done the CCB_APPL_KEY field is not checked. If the command is issued without the System Key, the CCB is required to have the same CCB_APPL_KEY as the application program did in the DIR.OPEN.ADAPTER command. + +**Note:** The System Key is for system-administrator use only. + +--- + +CCB_PARAMETER_2 + +**Explanation:** Command parameters (2 bytes of parameter data) are usually used for the System Key parameter. + +**For System Key:** This parameter is used to enable only a system administrator to perform operations that could stop ring communication for application programs. + +This key code is used for the following tasks: +☐ Change functional address +☐ Change group addresses +☐ Reset selected SAPs and stations or all SAPs and all stations +☐ Relinquish ownership of direct stations +☐ Force a physical close for an adapter +☐ Force the adapter to initialize +☐ Read and reset adapter error and direct interface logs + +The System Key is not typically used by application programs, but rather for maintenance and problem determination. + +This command can be issued by a system administrator with the System Key as defined by configuration parameters. If the adapter has not been opened by the system administrator, only polling of the CCB_RETCODE field can be used for posting of this command completion. CCB2 can post the command completion also using an OS/2 system semaphore. If the adapter has been opened and an application program ID has been returned, this command can be posted like any other command. See "System Action Exceptions for OS/2 EE 1.3" in topic B.15 for more information on the System Key. + +If the System Key is not used, this field should be coded as X'0000'. + +
Copyright IBM Corp. 1986, 1996
+<page_number>2.5.1 - 4</page_number> + +--- + + +## Page 94 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Addressing + +2.6 Addressing + +Each adapter using the network has an address called the node address. When frames are sent on the network by adapters, the frame contains two of these addresses: a source address and a destination address. The frame is sent to the destination address adapter by the source address adapter. + +All network addresses, including Ethernet addresses, must be in non-canonical format at the CCB interface. This form of address specification is different from the canonical bit ordering used by Ethernet, where the bits of each byte appear reversed from their representation on the LAN medium. For example, the locally administered group address X'C00000000FBC' (non-canonical) would be represented as X'03000000F03D' using canonical bit ordering. + +Additional address and link information to be used in other transmission layers may be included in the frame following the LAN addresses. Additional addressing is used in the implementation of both the LLC and NetBIOS. The LLC sublayer uses an address known as a service access point (SAP), described in the next section. NetBIOS addressing is described further in Chapter 4, "NetBIOS." + +An adapter is provided with a permanent, universally administered address. Additionally, the application program has the capability to provide a temporary replacement for this address and to provide a group address for the adapter. + +Note: The NODE_ADDRESS field can only be changed by the configuration parameters when CCB2 or CCB3 is used. Group and functional addresses can be set and used as destination addresses; they cannot be used as source addresses. + +Refer to IBM Token-Ring Network Architecture Reference for uses and restrictions for these types of addresses. + +
Copyright IBM Corp. 1986, 1996 +2.6 - 1
+ +--- + + +## Page 95 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Adapter Addresses + +2.7 Adapter Addresses + +Adapters are able to identify the intended recipient of any frame because each adapter has a unique address. There are two types of addresses: universally administered and locally administered. + +All Token-Ring and PC Network adapters manufactured by IBM have universally administered addresses encoded on them. These addresses use the following format: + + + + + + + + + + + + + + + +
00MFIDUniversally Administered
Byte 012345
+ +Figure 2-1. Universally Administered Adapter Address + +The first 2 bits (B'00') indicate that the address is a universally administered address. The MFID field contains the manufacturer's identification. The IEEE ensures that every universally administered address is unique. + +The format of the universally administered address for Ethernet Networks is different. These addresses use the following format: + + + + + + + + + + + + + + +
00Universally Administered
Byte 012345
+ +Figure 2-2. Ethernet Universally Administered Adapter Address + +The first 2 bits (B'00') indicate that the address is a universally administered address. The IEEE ensures that every universally administered address is unique. + +The application program can assign locally administered addresses. A locally administered address overrides the universally administered address encoded on the adapter. These addresses use the following format: + + + + + + + + + + + + + + +
01Locally Administered
Byte 012345
+ +Figure 2-3. Locally Administered Adapter Address + +The first 2 bits (B'01') identify the address as locally administered. Because of restrictions placed on addresses by certain networking protocols, you should assign addresses in the range 0000 0001 to 7999 9999 9999 (decimal). Your network administrator is responsible for preserving the uniqueness of these addresses. + +For additional information about maintaining addresses, refer to the IBM Token-Ring Network Administrator's Guide. + +Subtopics +2.7.1 Stations, SAPs, and IDs +2.7.2 SAP Assignments + +
Copyright IBM Corp. 1986, 1996
+<page_number>2.7 - 1</page_number> + +--- + + +## Page 96 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Stations, SAPs, and IDs + +2.7.1 Stations, SAPs, and IDs + +The direct station, service access points (SAPs), and link stations can be defined to the IEEE 802.2 interface. They are referred to by the STATION_ID field in command descriptions. The direct station, which is automatically assigned when the CCB interface is opened, is referred to by three station IDs. This station is automatically prepared to receive frames from the network when the DIR.OPEN.ADAPTER command (for DOS) or the DIR.OPEN.DIRECT command (for OS/2) is issued; however, the application program must issue a RECEIVE command to make the information available at the direct interface. The three station IDs, which differ only in how they receive frames, are described in the following list: + +**Station ID Description** + +**X'0000'** This station ID of the direct station receives all frames (MAC and non-MAC) not directed to other defined stations. This station can transmit MAC and non-MAC (data) frames. + +**X'0001'** This station ID of the direct station receives MAC frames and transmits either MAC or non-MAC frames. The PC Network and Ethernet Networks do not use MAC frames. + +**X'0002'** This station ID of the direct station receives non-MAC frames and transmits either MAC or non-MAC frames. + +Subtopics +2.7.1.1 SAPs + +
Copyright IBM Corp. 1986, 1996 +2.7.1 - 1
+ +--- + + +## Page 97 + +LAN Technical Reference: 802.2 and NetBIOS APIs +SAPs + +2.7.1.1 SAPs +SAPs can be opened for communications with SAPs in other devices connected to the network. It is possible to design an application program to communicate with any SAP. However, the NetBIOS interface is designed to communicate only with the NetBIOS SAP (X'F0'). + +Both uses of the DLC interface, connectionless and connection operations, use SAPs for communication on the network. An application program can open several SAPs for a workstation and each SAP can have several link stations opened that are associated with it. These link stations can then be directed to connect to link stations in other adapters (or even the same adapter). A SAP can operate in one of two ways: +☐ To have exchange ID (XID) command frames handled by the LLC sublayer +☐ To have XID command frames passed to the application for handling + +When the SAP is opened, an option is set that defines the handling of received XID commands. XID responses are always passed to the application program. See "Transmitting, Receiving, and Buffers" in topic 2.9. + +When an application program opens a SAP, the application program assigns a SAP value (in the SAP_VALUE field) and the protocol driver assigns a station ID. Communication between the application program and the protocol driver refers to a SAP by the 2-byte station ID. For SAPs, the first byte of the STATION_ID field identifies the SAP and the second byte is 0. When a link station is associated with a SAP, a new station ID is assigned. That station ID is 2 bytes: the first byte identifies the associated SAP, and the second byte is the link station number. All link station numbers are unique for a given adapter. Both SAPs and link stations are referenced by using the STATION_ID field. For example, X'0100' represents a SAP and X'0108' represents a link assigned to that SAP. + +When a SAP is used to communicate with another SAP, the application program provides the station ID to identify the local SAP and provides a destination address and SAP value (SAP_VALUE) to identify the remote SAP. The same information is needed to open a link station. When both devices have a SAP and link station opened, a connect command actually initiates the link connection. + +The LLC header part of a frame contains two, 1-byte SAP values: the destination SAP (DSAP), and the source or sending SAP (SSAP). The SAP value actually uses only 7 of the 8 bits. One bit of the SSAP is used to indicate whether the frame is an LLC command or response, and 1 bit of the DSAP is used to identify the target SAP as a group or individual SAP. The bit used is the low-order bit of the SAP value supplied by the user in the various SAP commands. An individual SAP value is always even, and a group SAP value is always odd. + +A group SAP is a set of open individual SAPs. The global SAP is a special case of a group SAP for which the set consists of all currently open individual SAPs. When a frame is sent to a group SAP, a copy of the frame is passed to each individual SAP that is a member of the group. Note that frames cannot be sent from a group SAP because the bit that indicates group or individual has a different meaning in the SSAP. + +A SAP can be opened as an individual SAP, a group SAP, or both. This is done using the option bits and the SAP value provided in the parameter list of the DLC.OPEN.SAP command. If the individual option is chosen, frames containing a DSAP equal to the SAP value with the low order bit off are accepted. If the group option is chosen, frames containing a DSAP equal to the SAP value with the low-order bit set on are accepted. If both options are selected, both odd and even DSAP values are recognized. + +An additional option bit is used to specify group membership. A SAP opened with the individual option can be designated to be a member of one or more group SAPs, provided that the group member option is also selected. The group SAPs to which it will belong can be specified in the DLC.OPEN.SAP and DLC.MODIFY commands. Membership is deleted using the DLC.MODIFY command before closing the SAP. The only restriction is that all members of a particular group must have selected the same XID handling option. + +See Figures 1-3 and 1-7 starting on topic 1.13. For a transmitted frame, the destination address in the LAN header is the remote node address. The source address in the LAN header is the local node address. The DSAP is the destination SAP_VALUE (RSAP_VALUE), and the SSAP is the local SAP value. At the receiving end, the interpreting of local and remote fields is exchanged. For example, the destination address field is the local node address of the receiving adapter. + +The maximum number of user-assigned group and individual SAPs possible is 127. The maximum number of link stations per adapter is 255 (all of which can be assigned to the same SAP). However, RAM and memory constraints limit the number of SAPs and link stations that can be open at one time. + +More information about these SAPs and links is included with related command descriptions. + +
Copyright IBM Corp. 1986, 1996 +2.7.1.1 - 1
+ +--- + + +## Page 98 + +2.7.2 SAP Assignments + +The following SAPs are opened automatically: +☐ Null SAP X'00' +☐ Global SAP X'FF' + +The Null SAP is opened automatically (with a SAP value of X'00'). It represents the LLC as a whole. The Null SAP provides the ability to respond to remote nodes even when no SAP has been activated. This SAP supports only connectionless service and responds only to XID and Test Command frames. The Null SAP is not accessible to the local application program. + +The Global SAP is opened automatically (with a SAP value of X'FF'). It is a group SAP with all open individual SAPs as members. XID, TEST, and UI frames directed to the Global SAP are passed to each open SAP in turn, with the DSAP field in the received frame buffer set equal to the receiving individual SAP value, where they are handled according to frame type. + +Note: In both DOS and OS/2, an NDIS token-ring network adapter with LLC microcode discards frames sent to the global SAP. These frames are not received by the protocol driver. + +SAP X'E4' is opened automatically for the PC Network or Ethernet Networks. This SAP is used for management. + +If NetBIOS is used, it uses SAP X'F0'. SAPs X'F1' to X'FE' are reserved. + +Figure 2-4 shows that you can have more than one SAP on a station and more than one link on a SAP. Type 2, connection-oriented communication is shown by the solid lines. Type 1, connectionless communication is indicated by the dotted line that connects two SAPs rather than two stations. + +
Copyright IBM Corp. 1986, 1996 +2.7.2 - 1
+ +--- + + +## Page 99 + +LAN Technical Reference: 802.2 and NetBIOS APIs +SAP Assignments + +<img>Diagram showing two ring station configurations. The top configuration shows Ring Station "A" with SAPs for Link01, Link02, Link04, Link03, Link06, and Link05. These connect to Ring Station "B" which has SAPs for Link05, Link06, Link07, Link01, Link02, Link03, and Link04. A dashed line separates the two stations. The bottom configuration shows Ring Station "C" with SAPs for Link01, Link02, and Link03. These connect to Ring Station "D" which has SAPs for Link01, Link04, Link05, Link07, Link02, Link03, and Link06.</img> + +Figure 2-4. SAPs and Link Stations + +Copyright IBM Corp. 1986, 1996 +2.7.2 - 2 + +--- + + +## Page 100 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DLC + +2.8 DLC + +The DLC interface provides an interface to application programs using the LLC sublayer of data link control protocol. This interface can be used in two ways: + +* For IEEE Type 1 communication, which is connectionless communication between devices providing no guarantee of delivery +* For IEEE Type 2 communication, which is connection-oriented services + +Much of the communication overhead function is provided by the protocol driver, so that programming is simplified. Refer to *IBM Token-Ring Network Architecture Reference* for more about communication using DLC and LLC. + +Subtopics +2.8.1 Types of Service +2.8.2 Command Sequences +2.8.3 Link Station States +2.8.4 Timers +2.8.5 Guidelines for Selecting Parameter Values + +
Copyright IBM Corp. 1986, 1996
+<page_number>2.8 - 1</page_number> + +--- + + +## Page 101 + +2.8.1 Types of Service + +The IBM Token-Ring Network and IBM PC Network support IEEE 802.2 Type 1 and Type 2 service as described in *IBM Token-Ring Network Architecture Reference*. Type 1 is connectionless service allowing transmission and receipt of UI frames, XID frames, and TEST frames. Type 1 uses unnumbered LPDUs. Frames sent using this type of service are not followed by a transmission from the receiving device verifying correct receipt and sequence of events unless provided by an application program in that device. Recovery and retry actions must be controlled by the application program. Type 2 is connection-oriented service providing guaranteed delivery and using numbered LPDUs. + +
Copyright IBM Corp. 1986, 1996
+<page_number>2.8.1 - 1</page_number> + +--- + + +## Page 102 + +2.8.2 Command Sequences + +When LLC protocols are used, commands must be issued in certain sequences to obtain the desired result. + +In all cases, the adapter must be initialized and opened before the use of any TRANSMIT and RECEIVE commands. + +Possible command sequences are listed in Tables 2-5, 2-6, and 2-7. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 2-5. Start Command Sequence for CCB1 and CCB3
CCB1 and CCB3 CommandComments
DIR.INITIALIZESelect, clear, and test the adapter
DIR.OPEN.ADAPTERMake ready, set parameters, and connect the adapter to the ring
For CCB3:Perform a logical open and return parameters
DIR.SET.EXCEPTION.FLAGSFor CCB3: Enable exception notification
DIR.OPEN.DIRECTFor CCB3: Open the direct station for one application program
RECEIVEPrepare for received data for the direct station
DLC.OPEN.SAPAllocate a SAP
RECEIVEPrepare for received data for this SAP
DLC.OPEN.STATIONPrepare a link station
RECEIVEPrepare for received data for this link station
DLC.CONNECT.STATIONInitiate the communication link with the remote station
+ +For CCB1 only: The DIR.INITIALIZE command should be issued only if the adapter is known to be dedicated to the application program. The return code on the DIR.INTERRUPT command can be used to determine if a DIR.INITIALIZE command is needed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 2-6. Start Command Sequence for CCB2
CCB2 CommandComments
DIR.OPEN.ADAPTERPerform a logical open and return parameters
DIR.STATUSObtain the current status of the network
DIR.SET.EXCEPTION.FLAGSEnable exception notifications
READAllow for posting of exception events
DIR.OPEN.DIRECTOpen the direct station for one application program
RECEIVEReceive for direct stations
READAllow posting for direct stations, receive data
DLC.OPEN.SAPAllocate a SAP
READAllow posting for DLC status change
READAllow posting for SAP station and its link station receive data
DLC.OPEN.STATIONPrepare a link station
DLC.CONNECT.STATIONInitiate the communication link with the remote station
+ +After this sequence has been completed, the application program can transmit and receive data on a link station in the following manner: + +<page_number>2.8.2 - 1</page_number> + +--- + + +## Page 103 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Command Sequences + +**Receiving Data** +Check the RECEIVE command's return code if no appendage was used, or check to see whether the appendage routine has received data. After moving data from the receive buffer, issue a BUFFER.FREE command to return the buffer to the pool. + +**Transmitting Data** +Any buffer can be used or the application program can issue a BUFFER.GET command to obtain enough buffers to contain the transmit data, move the data to the buffers, and issue a TRANSMIT.I.FRAME command. Issue a BUFFER.FREE command when the transmit is completed to return buffers that were originally retrieved from the buffer pool, with the exception of buffers referenced by the XMIT_QUEUE_TWO fields of the TRANSMIT command. + +When preparing to leave the application program, or when network communication is no longer required, the following commands should be issued: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 2-7. End Command Sequence
CommandComments
DLC.CLOSE.STATIONClose the link station
DLC.CLOSE.SAPClose the SAP
DIR.CLOSE.DIRECTFor CCB2 and CCB3: Close the direct station
DIR.CLOSE.ADAPTERRemove from the ring
+ +--- + + +## Page 104 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Link Station States + +2.8.3 Link Station States + +LLC Type 2 protocol maintains primary and secondary states for each link station. Only one of the primary states can be active at a time. If the application program issues a command to a link station that is not valid for the current state, the command is rejected with a return code of X'41'. The DLC.MODIFY and DLC.FLOW.CONTROL commands are accepted in all states. If a link station is not established, there is no control block, and no primary and secondary states exist. Therefore, the link station is non-existent. + +Changes in the DLC status of the link station are reported to the interface. See "DLC Status Codes" in topic B.3 and "Suggested Actions in Response to DLC Status" in topic B.3.3 along with the following state information. + +The link station primary states are: + +**Link Closed** +All received frames are ignored in this state. The state is entered when: +* A DM response to a SABME or DISC has been queued for transmission. The close command that caused the transmission is executed when the transmission is completed. +* A DM or UA response to a DISC has been received. The close command that caused the transmission is executed when the transmission is completed. +* A reset command has been received, but a transmission has already been queued or is in process and must be completed before the link station can be released. + +**Disconnected** +The following two frames are not ignored in the disconnected state: +* DLC frames with the poll bit set and for which a DM is transmitted +* A SABME which is reported to the workstation. + +A DLC.CLOSE.STATION or DLC.CONNECT.STATION command is accepted when this state is active. The state is entered when: +* A DLC.OPEN.STATION command has been accepted. +* A SABME for a previously non-existent station has been accepted. +* A DM response or DISC command from the paired station has been received. +* The retry count has been exhausted because of timeouts. + +**Disconnecting** +This state is normally entered when the initial in-process return code is supplied after receipt of a DLC.CLOSE.STATION command. This state is maintained until one of the following events occur: +* Either a UA or DM response to the transmitted DISC command is received. +* A SABME command is received, and a DM response has been successfully transmitted. +* The retry count expires. + +Exit from this state is normally to link-non-existent or link-closed state. Since the DLC.CLOSE.STATION command remains in process while the link is in disconnecting state, no other commands are accepted. All received frames other than SABME, DISC, UA, and DM are ignored while the link station is in this state. + +This disconnecting state can also be entered upon expiration of the retry count in FRMR received. In this case, exit is to the disconnected state. + +**Link Opening** +Unexpected received frames are ignored in this state. The link station enters this state when a DLC.CONNECT.STATION command is issued by the workstation. Before entering this state, the adapter transmits either a SABME command, or a UA response if a SABME has been received from the remote station. + +If a SABME was transmitted, the adapter expects a UA response. On receipt of the UA response, the adapter transmits an RR command-poll and changes to the link-opened (checkpointing) state. + +If a UA was transmitted, the adapter expects either a supervisory command or an information frame. After reception, the adapter changes its state to a link-opened state (possibly with remote busy). + +If the expected frame is not received and the retry count is exhausted, the link is returned to the disconnected state unless a SABME has been received. + +The DLC.CONNECT.STATION command is completed with a successful return code or with an indication that the remote station failed to respond. + +**Resetting** +All received frames except DISC, DM, FRMR, and SABME are ignored. Only DLC.CLOSE.STATION and DLC.CONNECT.STATION commands are accepted by the adapter when in this state. The state is entered when a SABME command frame is received from the remote station when the link is open and not in disconnected state or link-closed state. + +
Copyright IBM Corp. 1986, 1996
+<page_number>2.8.3 - 1</page_number> + +--- + + +## Page 105 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Link Station States + +**Frame Reject Sent** +All received frames except DISC, DM, FRMR, and SABME are ignored. Only DLC.CLOSE.STATION and DLC.CONNECT.STATION commands are accepted by the adapter when in this state. The state is entered when an illegal frame is received and an FRMR frame has been transmitted. + +**Frame Reject Received** +All received frames except DISC, DM, and SABME are ignored. Only DLC.CLOSE.STATION and DLC.CONNECT.STATION commands are accepted by the adapter when in this state. The state is entered when an FRMR frame has been received. + +**Link Opened** +This is the only state that allows information transfer and accepts TRANSMIT commands. In this state, the adapter handles sequential delivery and acknowledgment of information frames, together with retransmission if required. The state is entered when the adapter passes from the link-opening state after the SABME-UA exchange, which completes the connection protocol. + +The link station secondary states are: + +**Checkpointing** +A poll is pending; I-format LPDU transmission is suspended. + +**Local Busy (user)** +A DLC.FLOW.CONTROL command with a set-local-busy option has been accepted. I-format LPDU reception is suspended until a DLC.FLOW.CONTROL command with a reset-local-busy (user) option has been accepted. + +**Local Busy (buffer)** +An out-of-buffer return code has been set by the workstation in response to a request for data service on a receive. I-format LPDU reception is suspended until a DLC.FLOW.CONTROL command with a reset-local-busy (buffer) option has been accepted. + +**Remote Busy** +An RNR frame has been received from the remote station. I-format LPDU transmission is suspended until a receive ready or reject response, a SABME command, or an in-sequence I-format LPDU response frame with the F bit set to B'1' has been received. + +**Rejection** +An out-of-sequence I-format LPDU has been received from the remote station and an REJ transmitted. I-format LPDUs reception is suspended until an in-sequence I-format LPDUs or a SABME has been received. + +**Clearing** +A poll is pending, and a confirmation of clearing local busy is required after the response is received. + +**Dynamic Window** +The remote station is on a different ring, and there appears to be congestion through the bridge or bridges. + +
Copyright IBM Corp. 1986, 1996 +2.8.3 - 2
+ +--- + + +## Page 106 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Timers + +2.8.4 Timers + +The DLC functions use three timers: + +T1 Response timer +Ti Inactivity timer +T2 Receiver Acknowledgment timer + +Refer to IBM Token-Ring Network Architecture Reference for details about the timers. + +The rate at which each of these timers is stepped and the value at which they time out are selectable by parameters. The rate of stepping is referred to as the tick and is defined as follows: + +For CCB1: Define the tick with fields in the DLC open parameters provided to the adapter with the DIR.OPEN.ADAPTER command. + +For CCB2 and CCB3: Define the tick with the configuration parameters at system initialization time. + +Each timer requires a short timer tick (TICK_ONE) and a long timer tick (TICK_TWO). The period between timer ticks is some number of 40-ms intervals. + +The timer value, or count at which it expires and interrupts the adapter, is selected with parameters provided to the adapter when a DLC.OPEN.SAP, DLC.OPEN.STATION, or DLC.MODIFY command is issued. + +A timer value is selected by using a number between 1 and 10. Each timer is divided into two groups of possible values: + +☐ If the number selected is between 1 and 5, the short timer tick (TICK_ONE) is used and is referred to as group 1. The timer value is equal to the number selected multiplied by the short timer tick value (number_selected x short_tick_value). + +☐ If the number selected is between 6 and 10, the long timer tick (TICK_TWO) is used and is referred to as group 2. The timer value is equal to number selected minus 5 multiplied by the long timer tick value ((number_selected - 5) x long_tick_value) + +Therefore, there are three timers, with two rates selectable for each, which provide a total of six parameters to be selected. + +Each DLC.OPEN.SAP command sets the values for the three timers for that specific SAP using the rates selected for the entire adapter. For example, if the value of the T1 timer in one SAP is 4 and the value for the T1 timer in another SAP is 7, the short rate of stepping is selected for the Response timer on the one SAP, and the long rate of stepping is selected for the Response timer in the other SAP. The group-2 timer values should be used when longer delays are expected, such as when in a multi-ring environment. + +The time of expiration is not exact, but falls into a range starting with the calculated time. + +For example, if a given timer chose the following tick values: + +Group-1 tick: 200 ms +Group-2 tick: 1 second + +then the following timer values would be available: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Group 1Group 2
NumberValueActual RangeNumberValueActual Range
1200200-400611-2
2400400-600722-3
3600600-800833-4
4800800-000944-5
510001000-2001055-6
+ +The next section includes guidelines for selecting timer values. + +
Copyright IBM Corp. 1986, 1996
+<page_number>2.8.4 - 1</page_number> + +--- + + +## Page 107 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Guidelines for Selecting Parameter Values + +2.8.5 Guidelines for Selecting Parameter Values + +Following are some basic guidelines to consider when selecting parameter values for the network adapter. Several basic parameters can affect the performance obtained when you are using the DLC functions of the adapter. In most cases the default values provide efficient operation. See "Timers" in topic 2.8.4 and the parameter fields of the DLC.OPEN.SAP, DLC.MODIFY, and DLC.OPEN.STATION commands. Table 2-8 lists the parameters that are outlined here. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterPseudo Parameter
Response Timer (T1)The TIMER_T1 parameter of a DLC.OPEN.SAP, DLC.MODIFY, or DLC.OPEN.STATION command
Inactivity Timer (Ti)The TIMER_Ti parameter of a DLC.OPEN.SAP, DLC.MODIFY, or DLC.OPEN.STATION command
Receiver Acknowledgment Timer (T2)The TIMER_T2 parameter of a DLC.OPEN.SAP, DLC.MODIFY, or DLC.OPEN.STATION command
Maximum Length I-Field (N1)The MAX_I_FIELD parameter of a DLC.OPEN.SAP, DLC.MODIFY, or DLC.OPEN.STATION command
Maximum Number of Retransmissions (N2)The MAX_RETRY_CNT parameter of a DLC.OPEN.SAP, DLC.MODIFY, or DLC.OPEN.STATION command
Number of I-Format LPDUs Received before Sending Acknowledgment (N3)The MAX_IN parameter of a DLC.OPEN.SAP, DLC.MODIFY, or DLC.OPEN.STATION command
Number of Acknowledgments Needed to Increment Ww (Nw)The MAXOUT_INCR parameter of a DLC.OPEN.SAP, DLC.MODIFY, or DLC.OPEN.STATION command
Maximum Number of Outstanding I-Format LPDUs (TW)The MAXOUT parameter of a DLC.OPEN.SAP, DLC.MODIFY, or DLC.OPEN.STATION command
+ +**Response Timer (T1)** +The Response timer (T1) is maintained by the sending adapter whenever an I-format LPDU or a command LPDU with the poll bit set to B'1' is sent. If this timer expires before a response is received, the sending adapter solicits remote link station status by sending a supervisory command LPDU with the poll bit set to B'1'. The T1 timer value should, therefore, be greater than the total delay time that the frame might encounter within the sending node, the network, and the receiving node. Normal settings for the T1 parameter should be in the range of 1 to 2 seconds. For instance, a setting above 2 seconds can result in noticeable delays to those responses that must be retransmitted (typically less than 3% of the total frames). + +**Inactivity Timer (Ti)** +The Inactivity timer (Ti) runs whenever the Response timer (T1) is not running. If this timer expires, the link may have been lost. The Inactivity timer (Ti) value should be 5 to 10 times greater than the T1 value, and it is recommended that the minimum be 30 seconds. The default is 30 seconds. + +**Receiver Acknowledgment Timer (T2)** +A link station starts T2 when an I-format LPDU is received into workstation memory. T2 is stopped when an acknowledgment is sent either with an outgoing frame or when the number of I-format LPDUs received before the sending acknowledgment (N3) value is reached. If T2 expires, the link station must send an acknowledgment as soon as possible. The value of T2 must be less than that of T1 to ensure that the remote link station receives the delayed acknowledgment before T1 expires. Typical values for T2 are 80 to 256 ms. + +**Maximum Length of I-Field (N1)** +The Maximum Length of I-Field (N1) parameter is used primarily to enable a pair of stations to establish the maximum size frame that can be received by either station. For example, one station may be able to transmit and receive frames up to 2 KB each while the other can only send and receive frames of 1 KB or smaller. Under no circumstance should the N1 value exceed the total amount of receive memory available. + +A key factor in selecting the N1 value is the receive buffer capacity of the destination adapter. Server devices, for example, can support several sessions concurrently, and therefore have a more limited buffer capacity than a workstation. + + + + + + + + + + + + + + + + + + +
Token-Ring Network at 4 MbpsToken-Ring Network at 16 MbpsPC Network AdapterEthernet
4464 bytes17 960 bytes2042 bytes1490 bytes
+ +N1 should never exceed 2042 bytes with the Token-Ring Network PC Adapter or with PC Network adapters, or 1490 bytes with + +Copyright IBM Corp. 1986, 1996 +2.8.5 - 1 + +--- + + +## Page 108 + +Ethernet adapters. N1 values smaller than 512 bytes can result in a perceived decrease in station-to-station response times. + +**Maximum Number of Retransmissions (N2)** +The Maximum Number of Retransmissions (N2), or MAX_RETRY_CNT, defines the maximum number of attempts in which a sending adapter performs the checkpoint procedure following the expiration of the T1 timer. The combination of T1 and N2 values should be great enough to allow for error detection and recovery on the network. This count also prevents continual retransmission of the same I-format LPDU. + +Typical values for N2 are 10 or less. + +**Maximum Number of Outstanding I-Format LPDUs (TW) and Number of I-format ived before Sending Acknowledgment (N3)** +The TW and N3 counts should be considered together since they establish the ratio of acknowledgment frames to I-Format LPDU frames. However, the N3 value should be compared only with the TW value of the remote link station, not the local station. The values of TW and N3 can affect the response perceived by the user in some cases. However, in most instances, the default values provide the best general performance. The following guidelines should be considered: + +* The TW count allows the sender to transmit TW frames before it is forced to halt and wait for an acknowledgment. Therefore, the receiver should be able to absorb that number of frames, either in its SAP buffers or within the buffers in workstation memory. A small value of TW reduces the chances that frames are retransmitted due to buffer congestion at the receiver. The TW-to-N3 ratio thus provides a flow control mechanism to prevent overruns at the receiver. +* The TW value should always be at least twice the N3 value. Network response can be severely degraded if N3 exceeds TW. +* Very little network overhead or adapter processing is required to send or receive an acknowledgment frame. Therefore, every frame can be acknowledged without a perceptible degradation in performance. +* Even though the maximum values allowed for TW and N3 are 127 each, practical values should not exceed 8 for TW or 4 for N3. + +Note: For more information, refer to the IBM Token-Ring Network Architecture Reference. + +**Working Window (Ww), and Window Increment (Nw)** +Two counters are associated with the dynamic window algorithm for flow control. The purpose of the dynamic window algorithm is to allow the sending station to temporarily reduce the transmit window (Tw) whenever network or receive adapter congestion is resulting in lost frames. By temporarily reducing the window size, the flow of frames over that link is reduced, thus permitting the congested node to recover from the temporary overload. + +The DLC interface provides an interface to application programs using the LLC sublayer of DLC protocol. The interface can be used in two ways: + +* For IEEE Type 1 communication, which is connectionless communication between devices providing no guarantee of delivery +* For IEEE Type 2 communication, which is connection-oriented services + +Much of the communication overhead function is provided by the adapter and the protocol driver, both of which permit simple programming. IBM Token-Ring Network Architecture Reference contains more information about communication using DLC and LLC. + +
Copyright IBM Corp. 1986, 1996 +2.8.5 - 2
+ +--- + + +## Page 109 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Transmitting, Receiving, and Buffers + +2.9 Transmitting, Receiving, and Buffers + +Data exchanged between application programs is sent on the network in frames. A frame consists of headers and data. All frames have a LAN header, although the format is slightly different depending on whether the IBM Token-Ring Network, IBM PC Network, or Ethernet Networks are being used. MAC frames, transmitted only on the IBM Token-Ring Network, consist of the LAN header and a data field. In non-MAC frames the LAN header is followed by the DLC header. The data field that follows the LAN header in MAC frames, and the DLC header in non-MAC frames, is the data provided by the application program. (The data field itself can contain further headers, in a format defined by the application programs exchanging the data.) + +The length of the LAN header varies depending on the length of the Routing Information field (if present). The length of the DLC header varies depending on the frame type: the I-format LPDUs used to exchange data in Type 2 protocols have a 4-byte, DLC header; the frames used for Type 1 protocols have a 3-byte header. + +The type of frame being transmitted also affects the amount of information that the application program must provide, and how it is provided. There are three cases: + +**MAC frames** The application program provides the complete LAN header and the data field. The source address in the LAN header is overwritten with the address being used by the adapter. + +**I-format LPDUs** The application program provides only the data when it wants to transmit a frame. The information required to build the headers is provided in the DLC.OPEN.STATION and DLC.CONNECT.STATION commands. + +**Direct frames** The application program provides the LAN header and the data in its own buffers. It provides the information needed to build the DLC header with the TRANSMIT command (the remote SAP value and the command type). The source address field in the LAN header is overwritten with the address in use by the adapter. + +The application program must have the data, and if required, the LAN header, in buffers prepared in a format understood by the protocol driver. These buffers are in workstation memory belonging to the application program. This memory may be entirely controlled by the application program, or may be given to the protocol driver to manage, in which case it is part of the buffer pool discussed in "Buffer Pools" in topic 2.9.1. + +The protocol driver receives frames from the network and moves the frames received from the network to application program buffers, provided that an active RECEIVE command is used to pass the buffers to the application program, and that there is application program buffer space to hold the incoming frame. The application program provides the buffer space in the form of a buffer pool, described in "Buffer Pools." Once the protocol driver has moved the data to workstation memory, it uses the RECEIVE command (and optionally the READ command for CCB2 users) to tell the application program that it has received a frame. See topic 3.3.37 for a description of the RECEIVE command and topic 3.3.39 for a description of the READ command. + +Subtopics +2.9.1 Buffer Pools +2.9.2 Receive Buffers +2.9.3 Transmit Buffers + +
Copyright IBM Corp. 1986, 1996 +2.9 - 1
+ +--- + + +## Page 110 + +2.9.1 Buffer Pools + +A buffer pool is an area of workstation memory provided by the application program to the protocol driver. Each buffer pool is divided into buffers. Received frames are put into buffers from the buffer pool by the protocol driver. These buffers must be returned to the pool (using BUFFER.FREE commands) after the application program has finished with the frame data. When the application program transmits a frame, it can use buffers from a separate area of memory or buffers from the buffer pool (obtained by issuing a BUFFER.GET command). The following commands are associated with generating, defining, and handling buffer pools: + +DIR.OPEN.ADAPTER +Allocates direct interface buffer pool (for CCB1 only). + +DIR.OPEN.DIRECT +Allocates direct interface buffer pool (for CCB2 and CCB3 only). + +DIR.MODIFY.OPEN.PARMS +Changes direct interface buffer pool allocation (for CCB1 only). + +DLC.OPEN.SAP +Allocates DLC interface buffer pool for a specific SAP. + +BUFFER.GET +Gets one or more buffers from a SAP pool and DIRECT pool. + +BUFFER.FREE +Returns one or more buffers to a pool. + +RECEIVE +Receives data into buffers. + +RECEIVE.MODIFY +Receives data into optional buffers. + +TRANSMIT +Sends data from buffers. + +Buffer pools must be allocated for every SAP defined to the adapter and for the direct interface direct station at station IDs X'0000', X'0001', and X'0002'. Station ID X'0001' is not used on the PC Network or Ethernet Networks. Every SAP defined can have one pool of buffers defined for its use. + +Each buffer pool is independent of the others and has the following characteristics: + +☐ The protocol driver uses these buffers to satisfy the RECEIVE command. Their use is optional for TRANSMIT commands. + +☐ All link stations associated with a specific SAP use the same buffer pool. + +☐ Buffer format rules: +- All buffers in a pool have the same length. +- The buffer length defined must be a multiple of 16 bytes. +- The user-defined length includes the 12-byte overhead. +- Every buffer has a 12-byte overhead to contain a forward pointer and length information controlled by the protocol driver. +- The minimum user-defined length is 80 bytes (68 data bytes plus 12 bytes of overhead). + +☐ The application program can allow the protocol driver to prepare the buffer pool, or it can take that responsibility itself. Buffer pools are controlled by the protocol driver and individual buffers are obtained and returned by BUFFER.GET and BUFFER.FREE commands. If the application program prepares the buffers, it must prepare the control fields in the prescribed buffer format. Because the buffers controlled by the protocol driver must be used for receives, either buffers prepared by the protocol driver are used, or the application program provides a prepared buffer to the protocol driver by issuing a BUFFER.FREE command. + +Note: If a SAP has no more available buffers, the reception of data is impacted. See the RECEIVE command description on topic 3.3.39. + +
Copyright IBM Corp. 1986, 1996
+<page_number>2.9.1 - 1</page_number> + +--- + + +## Page 111 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Receive Buffers + +2.9.2 Receive Buffers + +Data is received from the network into adapter buffers. If there is a RECEIVE command pending for the SAP or link station, the protocol driver moves the data to the appropriate buffer pool in workstation memory. The application program then processes the data and issues a BUFFER.FREE command to return the buffer to the pool. An application program can simultaneously return more than one buffer. + +Subtopics +2.9.2.1 Receive Buffer Formats +2.9.2.2 Buffer Fields Explanations + +
Copyright IBM Corp. 1986, 1996 +2.9.2 - 1
+ +--- + + +## Page 112 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Receive Buffer Formats + +2.9.2.1 Receive Buffer Formats + +The USER_OFFSET field (bytes 8 and 9 of each buffer) allows all buffers to be handled similarly regardless of the amount of information in the buffer prior to the actual received data. When more than one buffer from the buffer pool is used to receive a frame, the format for the first buffer (Buffer 1) is different from the format of the other buffers used to contain this frame. Buffer 2 is an example of the format of the subsequent buffers. By interrogating the contents of the USER_OFFSET field, you can determine the format of any buffer. See the RECEIVE and the RECEIVE.MODIFY command descriptions for buffer assignment. + +<img>Receive Buffer Formats Diagram</img> + +Figure 2-5. Receive Buffer Formats + +Table 2-10 and Table 2-11 show the formats of the receive buffers in detail. The NOT CONTIGUOUS MAC/DATA option means that the received data does not include the DLC header, but begins with the portion of the LAN frame that follows the DLC header; the CONTIGUOUS option means that the received data includes the LAN header and the DLC header. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 2-10. Buffer 1: Option = Not Contiguous MAC/DATA
OffsetField NameByte Length8086 TypeDescription
0BUF_POINTER4DDPointer to the next buffer or X'00000000' if no additional buffers.
4RCV_LEN2DWLength of entire receive frame.
6LENGTH_IN_BUFFER2DWLength of data in buffer beginning at byte X (received data).
For CCB1
8USER_OFFSET2DWOffset from the beginning of the buffer to the USER_SPACE field. Use this value with the buffer segment-segment+offset.
For CCB2 and CCB3
8USER_OFFSET2DWOffset from the beginning of the buffer to the USER_SPACE field. Use this value with the buffer selector-selector+offset.
For all CCBs
10USER_LENGTH2DWThe length of the USER_SPACE field defined by the USER_OFFSET parameter.
12STATION_ID2DWReceiving station ID.
14OPTIONS1DBOption byte from RECEIVE parameter table.
15MESSAGE_TYPE1DBType of message received.
16BUFFERS_LEFT2DWThe number of buffers left in the SAP buffer pool.
+ +Copyright IBM Corp. 1986, 1996 +2.9.2.1 - 1 + +--- + + +## Page 113 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Receive Buffer Formats + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
18RCV_FS1DBReceived Frame Status field.
19ADAPTER_NUM1DBAdapter number (0 or 1).
For CCB1
20LAN_HEADER_LENGTH1DBThe length of the LAN header field (bytes 22-53).
21DLC_HEADER_LENGTH1DBThe length of the DLC_HEADER (bytes 54-57). If the value is X'00', this is for the direct interface.
22LAN_HEADER32DBThe LAN header received with the frame. The actual length is defined by LAN_HEADER_LENGTH.
54DLC_HEADER4DBThe DLC header received with the frame, if applicable. The actual length is defined by DLC_HEADER_LENGTH. (Contents undefined if DLC_LENGTH = 0.)
58USER_SPACE---An area in the buffer for use by the application program. The length is defined by USER_LENGTH (bytes 10-11).
XRCVD_DATA-DBThe data received following the DLC header in the frame.
For CCB2
20NEXT_FRAME4DDA pointer to the next receive frame.
For CCB3
204DDReserved for the application program.
For CCB2 and CCB3
24LAN_HEADER_LENGTH1DBThe length of the LAN header field (bytes 26-57).
25DLC_HEADER_LENGTH1DBThe length of the DLC_HEADER (bytes 58-61). If the value is X'00', this is for the direct interface.
26LAN_HEADER32DBThe LAN header received with the frame. The actual length is defined by LAN_HEADER_LENGTH.
58DLC_HEADER4DBThe DLC header received with the frame, if applicable. The actual length is defined by DLC_HEADER_LENGTH. (Contents undefined if DLC_LENGTH = 0.)
62USER_SPACE---An area in the buffer for use by the application program. The length is defined by USER_LENGTH (bytes 10 and 11).
XRCVD_DATA-DBThe data received following the DLC header in the frame.
+ +Copyright IBM Corp. 1986, 1996 +2.9.2.1 - 2 + +--- + + +## Page 114 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Receive Buffer Formats + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 2-11. Buffer 1: Option = Contiguous MAC/DATA
OffsetField NameByte Length8086 TypeDescription
0BUF_POINTER4DDPointer to the next buffer or X'00000000' if no additional buffers.
4RCV_LEN2DWLength of entire receive frame.
6LENGTH_IN_BUFFER2DWLength of data in buffer beginning at byte X (received data).
For CCB1
8USER_OFFSET2DWOffset from the beginning of the buffer to the USER_SPACE field. Use this value with the buffer segment-segment+offset.
For CCB2 and CCB3
8USER_OFFSET2DWOffset from the beginning of the buffer to the USER_SPACE field. Use this value with the buffer selector-selector+offset.
For all CCBs
10USER_LENGTH2DWThe length of the USER_SPACE field defined by the USER_OFFSET parameter.
12STATION_ID2DWReceiving station ID.
14OPTIONS1DBOption byte from RECEIVE parameter table.
15MESSAGE_TYPE1DBType of message received.
16BUFFERS_LEFT2DWThe number of buffers left in the SAP buffer pool.
18RCV_FS1DBReceived Frame Status field.
19ADAPTER_NUM1DBAdapter number (0 or 1).
For CCB1
20USER_SPACE---An area in the buffer for use by the application program. The length is defined by USER_LENGTH (bytes 10 and 11).
XRCVD_DATA-DBThe data received in the frame including the LAN header and the DLC header.
For CCB2
20NEXT_FRAME4DDA pointer to the next receive frame.
For CCB3
204DDReserved for the application program.
For CCB2 and CCB3
24USER_SPACE---An area in the buffer for use by the application program. The length is defined by USER_LENGTH (bytes 10 and 11).
+ +Copyright IBM Corp. 1986, 1996 +2.9.2.1-3 + +--- + + +## Page 115 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Receive Buffer Formats + + + + + + + + + +
XRCVD_DATA-DBThe data received in the frame including the LAN header and the DLC header.
+ +
Copyright IBM Corp. 1986, 1996
+
2.9.2.1 - 4
+ +--- + + +## Page 116 + +2.9.2.2 Buffer Fields Explanations + +--- + +**MESSAGE_TYPE** + +**Explanation:** This field indicates the type of message received (byte 15). + +X'02' MAC frame (Direct Station on the Token-Ring Network only) +X'04' I-format LPDUs (Information frame--application program data--link stations only) +X'06' UI frame +X'08' XID command (poll bit) +X'0A' XID command (not poll bit) +X'0C' XID response (final bit) +X'0E' XID response (not final bit) +X'10' TEST response (final bit) +X'12' TEST response (not final bit) +X'14' Other; used for non-MAC frame (Direct Station only) + +--- + +**RCVD_FS** + +**Explanation:** This field contains the Frame Status (FS) (byte 18). + +**Note:** This field is only valid on the Token-Ring Network. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BITMEANING
7Address recognized indicator (A)
6Frame copied indicator (C)
5Reserved
4Reserved
3Address recognized indicator (A)
2Frame copied indicator (C)
1-0Reserved
+ +--- + +**NEXT_FRAME** + +**Explanation:** This field contains a pointer to the next frame in the chain. + +When the application program specifies that received frames are to be chained, the NEXT_FRAME field of the first buffer of each frame is used to point to the next frame that was received. + +--- + +**USER_SPACE** + +**Explanation:** This space can be loaded by the application program. It is not altered by the protocol driver or by the received frame data. + +--- + +**RCVD_DATA** + +**Explanation:** The value of this field occupies byte x to end of buffer. + +If the option is CONTIGUOUS, this data begins with the LAN header from the received frame. + +If the option is NOT CONTIGUOUS, then: +* If MESSAGE_TYPE is X'02' or X'14', this is the data immediately following the LAN header from the received frame. +* If MESSAGE_TYPE is not X'02' or X'14', this is the data immediately following the DLC header from the received frame. + +Additional data that is not able to fit into this buffer is placed in buffer 2 and subsequent buffers. + +--- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 2-12. Buffer 2 and Subsequent Buffers
OffsetField NameByte Length8086 TypeDescription
0BUF_POINTER4DDPointer to the next buffer or X'00000000' if no additional buffers.
4RCV_LEN2DWLength of entire receive frame.
6LENGTH_IN_BUFFER2DWLength of data in buffer beginning at byte x (received data).
+ +Copyright IBM Corp. 1986, 1996 +2.9.2.2 - 1 + +--- + + +## Page 117 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Buffer Fields Explanations + + + + + + + + + + + + + + + + +
For CCB1
8USER_OFFSET2DWOffset from the beginning of the buffer to the USER_SPACE field. Use this value with the buffer segment-segment+offset.
+ + + + + + + + + + + + + + + + +
For CCB2 and CCB3
8USER_OFFSET2DWOffset from the beginning of the buffer to the USER_SPACE field. Use this value with the buffer selector-selector+offset.
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
For all CCBs
10USER_LENGTH2DWThe length of the USER_SPACE field defined by the USER_OFFSET parameter.
12USER_SPACE---An area in the buffer for use by the application program. The length is defined by USER_LENGTH (bytes 10 and 11).
XRCVD_DATA-DBA continuation of the data received in the frame.
+ +
Copyright IBM Corp. 1986, 1996 +2.9.2.2 - 2
+ +--- + + +## Page 118 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Transmit Buffers + +2.9.3 Transmit Buffers + +The application program issues a BUFFER.GET command, or creates a buffer, moves data into the assigned buffer and adds necessary header information, and issues the TRANSMIT command. The protocol driver moves the contents of the buffer into shared RAM or work space and interrupts the adapter to proceed with the transmission. When the TRANSMIT command is executed, the application program issues a BUFFER.FREE command for all buffers originally obtained from the buffer pool except the XMIT_QUEUE_TWO buffer, which is freed by the protocol driver when the transmission is successful (return code is 0). + +The total amount of data in all buffers of one issued command must fit into one adapter transmit buffer in shared RAM. + +For CCB1: The adapter transmit buffer size is defined by the DIR.OPEN.ADAPTER command DHB_BUFFER_LEN parameter, with the maximum being dependent on the type of adapter being used. + +For CCB2 and CCB3: The adapter transmit buffer size is defined by configuration parameters, with the maximum being dependent on the type of adapter being used. + +For all LAN network types, the data in the buffer is described as follows: + +☐ Six bytes are used as overhead. + +☐ Fourteen bytes are reserved for the LAN header. On the Token-Ring Network these 14 bytes are used for the access control (AC) byte, the frame control (FC) byte, and the LAN header source and destination address fields. For PC networks and Ethernet, the protocol driver verifies that the FC byte specifies a non-MAC frame, examines the source address to determine the presence of routing information, and uses the destination address to build a LAN header appropriate for the network type. + +☐ The remaining length is reduced if routing information is used (up to 18 bytes) and if a DLC header is included (up to 4 bytes). The routing information field is ignored for Ethernet Networks. For more information on buffer space, see Figures 2-7, 2-8, and 2-9 starting on topic 2.9.3.1. + +Note: The LAN and DLC headers are not placed in the transmit buffer for an I-format LPDU transmission as a result of a TRANSMIT.I.FRAME command, making an additional 36 bytes available. + +Subtopics +2.9.3.1 Transmit Buffer Formats + +
Copyright IBM Corp. 1986, 1996 +2.9.3 - 1
+ +--- + + +## Page 119 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Transmit Buffer Formats + +2.9.3.1 Transmit Buffer Formats + +Transmit buffers are different for each supported LAN network protocol (Token-Ring, PC, and Ethernet). However, to provide compatibility for application programs, the difference is not reflected at the interface to the protocol driver in the IBM support program, so that the transmit buffer is the same for all network protocol types. + +For CCB1: For NDIS adapters, the TRANSMIT command is returned with a return code of X'23' if the frame is contained in more buffers than are supported by the NDIS MAC driver. Up to eight buffers are always available. See the maximum number of data blocks defined by the NDIS MAC driver for your adapter to determine how many buffers are supported. + +The transmit buffers must be formatted as defined here. + +Four groups of buffers are definable by TRANSMIT commands. See "Transmit Command Specifics" in topic 3.3.48.1. They are: +☐ XMIT_QUEUE_ONE +☐ XMIT_QUEUE_TWO +☐ BUFFER_ONE +☐ BUFFER_TWO. + +XMIT_QUEUE_ONE and XMIT_QUEUE_TWO can each consist of one or more buffers. + +Most combinations of XMIT_QUEUE_ONE, XMIT_QUEUE_TWO, BUFFER_ONE, and BUFFER_TWO can be selected for use. BUFFER_TWO can be used only if BUFFER_ONE is also being used. However, they are transmitted sequentially beginning with XMIT_QUEUE_ONE and ending with BUFFER_TWO whenever two or more are selected. XMIT_QUEUE_ONE could contain header information that seldom or never needs modifying. XMIT_QUEUE_TWO could contain data or device-specific header information. BUFFER_ONE could contain the actual data to be transmitted. BUFFER_TWO, if used, might contain additional data. Buffers in XMIT_QUEUE_TWO are freed by the protocol driver if the transmission is successful (return code is 0). These buffers are always returned when you are using OS/2, regardless of the return code. + +BUFFER_ONE and BUFFER_TWO are user-defined and can contain any type of information. Any buffer group can be excluded by providing a buffer length of 0 in the TRANSMIT command CCB. + +The buffers defined by XMIT_QUEUE_ONE and XMIT_QUEUE_TWO are described in Table 2-13. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 2-13. Transmit Buffers (XMIT_QUEUE_ONE and XMIT_QUEUE_TWO)
OffsetField NameByte Length8086 TypeDescription
0BUF_POINTER4DDPointer to the next buffer or X'00000000' if there are no additional buffers.
42--Reserved.
6LENGTH_IN_BUFFER2DWLength of data in buffer beginning at byte 12 plus the USER_LENGTH.
8USER_DATA2DWAvailable for user.
10USER_LENGTH2DWLength of the USER_SPACE starting at byte 12.
12USER_SPACE2DWUSER_SPACE followed by data to be transmitted. If there is no user data, the transmit data starts at byte 12.
14--xDBData to be transmitted.
+ +The USER_SPACE can be loaded by the application program. The USER_SPACE information is not transmitted. + +
Copyright IBM Corp. 1986, 1996
+<page_number>2.9.3.1 - 1</page_number> + +--- + + +## Page 120 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Transmit Buffer Formats + + + + + + + + + + + + + + + + + + + + + + + +
04681012
Next Buf PointerReservedLengthUser DataUser LengthUser SpaceData to Be Transmitted
+ +Pointer=X'00000000' if there is no additional data + + + + + + + + + + + + + + + + + + + + + + + +
04681012
Next Buf PointerReservedLengthUser DataUser LengthUser SpaceAdditional Data to Be transmitted
+ +Pointer=X'00000000' if there is no additional data +Next buffer, if Pointer not X'00000000' + +Figure 2-6. Transmit Buffers + +The information in the transmit buffer can be transmitted in one of three frame formats: MAC frame, non-MAC I-Format LPDU, or other non-MAC frame. The frame formats are shown in the following figures: + +<img>Diagram showing the structure of a MAC frame with fields: AC (1 Byte), FC (1 Byte), Dest. Address (6 Bytes), Source Address (6 Bytes), Routing Information (0-18 Bytes), Data Field (0-X1 Bytes), LAN Header (14-32 Bytes), and Maximum Length X2 Bytes.</img> + +* See Table 2-14 in topic 2.9.3.1 for the values of X1 and X2. + +Figure 2-7. MAC Frame + +
Copyright IBM Corp. 1986, 1996
+<page_number>2.9.3.1 - 2</page_number> + +--- + + +## Page 121 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Transmit Buffer Formats + +<img>Figure 2-8. Non-MAC I-Format LPDU</img> + +* See Table 2-14 in topic 2.9.3.1 for the values of Y1 and Y2. + +<img>Figure 2-9. Other Non-MAC Frame</img> + +* See Table 2-14 for the values of Z1 and Z2. +** The adapter places the DLC header values in 3 bytes of the adapter transmit buffer. None of the application program's buffer space is needed for the DLC header. +*** The LAN header space, including the destination address and routing information fields, is provided by the application program in the first buffer. The adapter fills in the source address, AC, and FC field values. Some adapters may require the application program to provide these fields. Refer to the documentation for your specific adapter type for details. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 2-14. Transmit Buffer Size in Bytes
ValueToken-Ring Network PC Adapter, PC Adapter II, and Adapter/AToken-Ring Network 16/4 Adapters at 4 MbpsToken-Ring Network 16/4 Adapters at 16 MbpsPC Network AdaptersEthernet DIX V.2 AdapterEthernet IEEE 802.3 Adapter
X12028444417940N/AN/AN/A
X22060447617986N/AN/AN/A
Y1 (*)2042445817936204215001500
Y2 (*)2078449417972207815261526
Z12025444117937202814941497
Z22060447617972206315321532
+ +Note: (*) For definition of Y1 and Y2 for Ethernet DIX V.2 and Ethernet 802.3 adapters, see "Ethernet DIX Version 2.0 Frame Format" in topic 1.16 and "Ethernet IEEE 802.3 Frame Format" in topic 1.15. + +Copyright IBM Corp. 1986, 1996 +2.9.3.1 - 3 + +--- + + +## Page 122 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Transmit Buffer Formats + +
Copyright IBM Corp. 1986, 1996 +2.9.3.1 - 4
+ +--- + + +## Page 123 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Chapter 3. The Command Control Blocks + +3.0 Chapter 3. The Command Control Blocks + +Subtopics +3.1 About This Chapter +3.2 IBM LAN Client 802.2 Application Program Interface (API) +3.3 Command Descriptions + +
Copyright IBM Corp. 1986, 1996 +3.0 - 1
+ +--- + + +## Page 124 + +LAN Technical Reference: 802.2 and NetBIOS APIs +About This Chapter + +3.1 About This Chapter + +This chapter describes all the commands that you can issue to the IEEE 802.2 application interface, both the direct interface and the DLC interface. The commands are listed alphabetically, so you can easily find a particular command. + +The commands fall into one of three groups based on which version of the IBM program products you are using. + +**CCB1** The command control block for the DOS/Windows IEEE 802.2 protocol drivers. + +**CCB2** The command control block for the Dynamic Link Routine (DLR) interface provided with OS/2 EE 1.3 and LAPS. + +**CCB3** The command control block for the Device Driver (DD) interface provided with OS/2 EE 1.3 and LAPS. + +Throughout this chapter the term CCB is used when information is common to all three groups. You can find detailed information on the types of CCBs used by various program products in "Control Blocks for All CCBs" in topic 2.5. This section also describes the various CCB fields. + +The commands also fall into four functional groups: + +☐ Commands issued to the direct interface + +☐ Commands issued to the DLC (IEEE 802.2) interface—both SAP and station interfaces + +☐ Commands issued for transmitting and receiving frames + +☐ Commands issued for problem determination (CCB1 only). + +The direct interface enables you to perform control functions on the adapter using standard control blocks and parameters. It also enables you to open and close an adapter, obtain error status, and set addresses. + +**Note:** When you are using OS/2 EE, the direct interface commands DIR.OPEN.ADAPTER and DIR.CLOSE.ADAPTER logically open and close an adapter on an application program basis. You must use a System Key to physically close an adapter. + +The direct interface also permits transmission of frames directly with no protocol assistance. When you are using the direct interface, an application program can communicate with another application program without links and link stations. The direct interface supports three direct stations, as discussed in "Stations, SAPs, and IDs" in topic 2.7.1. All received frames not directed to an active SAP or link station default to the direct station. + +The DLC interface provides application programs with an interface to the logical link control (LLC) sublayer of data link control protocol, which offers both connectionless and connection-oriented services. See "DLC" in topic 2.8 for more details. + +You can find information on the use of the TRANSMIT and RECEIVE commands, buffer pools, and buffer formats in "Transmitting, Receiving, and Buffers" in topic 2.9. + +
Copyright IBM Corp. 1986, 1996
+<page_number>3.1 - 1</page_number> + +--- + + +## Page 125 + +LAN Technical Reference: 802.2 and NetBIOS APIs +IBM LAN Client 802.2 Application Program Interface (API) + +3.2 IBM LAN Client 802.2 Application Program Interface (API) + +The IBM LAN Client 802.2 NLM will support the current CCB1 Application Program Interface (API) with the following exceptions: + +☐ Support for the direct interface will not be provided. Therefore, the TRANSMIT.DIR.FRAME command will not be supported. The RECEIVE, RECEIVE.MODIFY, GET.BUFFER, and FREE.BUFFER commands for the direct stations (station IDs X'0000', X'0001', and X'0002') will not be supported. The direct buffer pool specified on the DIR.OPEN.ADAPTER will be ignored. The DIR.MODIFY.OPEN.PARMS command will fail if a direct buffer pool address is specified. The direct interface logs for the DIR.READ.LOG and DLC.STATISTICS commands will be returned as all 0s. + +☐ The adapter log in the DIR.READ.LOG command is not supported. If the adapter log is requested, all 0s will be returned. + +☐ DIR.SET.MULT.GROUP.ADDRESS and DIR.RESET.MULT.GROUP.ADDRESS commands are not supported. A null address will be returned for the GROUP_ADDR_LIST_ADDR field in DIR.STATUS if extended status is requested. + +☐ Group SAP processing has been removed (this also includes the Global SAP X'FF'). Frames sent to the group or global SAP will not be received, but frames may still be transmitted to group and global SAPs. + +☐ Only bit 9 in the OPEN_OPTIONS field in the Adapter Parameters table for the DIR.OPEN.ADAPTER command will be supported. All other bits are ignored. + +☐ The adapter address can not be changed in the DIR.OPEN.ADAPTER command. The locally administered address (LAA) must be specified using a LAN driver configuration parameter. If a LAA is specified on the DIR.OPEN.ADAPTER command, the command will fail unless the address specified matches the current address of the adapter. + +☐ The DLC_MAX_SAP and DLC_MAX_STATIONS parameters in the DLC Parameter Table will be validated, but do not have any meaning to the IBM LAN Client 802.2 NLM. The IBM LAN Client 802.2 NLM can support up to the maximum number of SAPs and stations if there is enough memory to do so. The AVAIL_STATION value that is reported in the DIR.STATUS parameter table will start at X'FF' and will be maintained by decrementing it for a sucessful DLC.CONNECT.STATION and incrementing for a sucessful DLC.CLOSE.STATION. + +☐ The following DLC parameters on DIR.OPEN.ADAPTER will be ignored: + +- DLC_T1_TICK_ONE +- DLC_T2_TICK_ONE +- DLC_Ti_TICK_ONE +- DLC_T1_TICK_TWO +- DLC_T2_TICK_TWO +- DLC_Ti_TICK_TWO + +If these values need to be set, they must be set in the "protocol NLLC8022" section of the NET.CFG file. + +☐ RECEIVE.MODIFY may only be issued for a SAP, not a link station. + +☐ The following token-ring specific information will not be returned on DIR.INITIALIZE: + +- Shared RAM value +- Bring up errors + +☐ DIR.STATUS + +- Shared RAM size +- Ring speed +- Microcode level +- Shared RAM address of adapter parameters +- Shared RAM address of adapter MAC buffer +- Last network status issued +- Ring utilization + +☐ Network Status appendages will not be called. + +☐ Ethernet DIX Version 2.0 frames are not supported. + +☐ The NCB_ENABLE routine address is not returned in the DIR.DEFINE.MIF.ENVIRONMENT command. + +☐ Upon return from a command completion appendage, the carry flag will be ignored. + +☐ The trace entries for PDT.TRACE.ON have been modified. + +Copyright IBM Corp. 1986, 1996 +<page_number>3.2 - 1</page_number> + +--- + + +## Page 126 + +# The Art of Mindful Living + +Mindful living is a practice that involves being fully present in the moment, aware of our thoughts, feelings, and surroundings without judgment. It is a way to cultivate a deeper connection with ourselves and the world around us. This guide will explore the principles and practices of mindful living, offering practical tips and insights to help you integrate mindfulness into your daily life. + +## Understanding Mindfulness + +Mindfulness is the practice of paying full attention to the present moment. It involves observing our thoughts, feelings, and sensations without judgment. This awareness allows us to respond to life's challenges with greater clarity and compassion. + +### The Benefits of Mindfulness + +- **Reduced Stress**: Mindfulness helps to calm the mind and reduce the physiological effects of stress. +- **Improved Focus**: Regular practice enhances concentration and mental clarity. +- **Emotional Regulation**: Mindfulness allows us to observe our emotions without being overwhelmed by them. +- **Enhanced Well-being**: It promotes a sense of peace, contentment, and overall well-being. + +## Practical Mindfulness Techniques + +### 1. Mindful Breathing + +Mindful breathing is a simple yet powerful technique to anchor your attention in the present moment. + +**How to Practice:** +1. Find a quiet place to sit comfortably. +2. Close your eyes and take a few deep breaths. +3. Focus your attention on the sensation of your breath entering and leaving your body. +4. When your mind wanders, gently bring your focus back to your breath. + +### 2. Body Scan Meditation + +The body scan is a practice that involves bringing awareness to different parts of the body. + +**How to Practice:** +1. Lie down in a comfortable position. +2. Close your eyes and take a few deep breaths. +3. Starting from your toes, slowly move your attention up through your body, noticing any sensations, tension, or discomfort. +4. As you move through each part of your body, breathe into it and release any tension. + +### 3. Mindful Eating + +Mindful eating involves paying full attention to the experience of eating and drinking. + +**How to Practice:** +1. Choose a small piece of food, such as a raisin or a piece of fruit. +2. Observe its color, texture, and smell. +3. Take a small bite and chew slowly, savoring the taste and texture. +4. Notice the sensations in your mouth and the feelings of fullness. + +### 4. Walking Meditation + +Walking meditation is a way to practice mindfulness while moving. + +**How to Practice:** +1. Find a quiet place to walk slowly. +2. Focus on the sensation of your feet touching the ground. +3. Pay attention to the movement of your legs and the rhythm of your breath. +4. If your mind wanders, gently bring your focus back to your walking. + +## Integrating Mindfulness into Daily Life + +Mindfulness is not just a practice you do during meditation; it can be integrated into your daily activities. + +### Mindful Routine + +- **Morning**: Start your day with a few minutes of mindful breathing or a short meditation. +- **Work**: Take mindful breaks throughout the day to check in with your body and breath. +- **Evening**: Reflect on your day with gratitude, noting moments of joy and challenges. + +### Mindful Communication + +- **Listen Actively**: Give your full attention to the person speaking without interrupting. +- **Respond Thoughtfully**: Pause before responding to ensure your words are thoughtful and kind. +- **Be Present**: Focus on the conversation and the person you are with, rather than distractions. + +## Overcoming Challenges + +### Common Obstacles + +- **Restlessness**: It's normal for the mind to wander. Gently bring your focus back to the present. +- **Impatience**: Mindfulness is a practice that requires patience and consistency. +- **Judgment**: Observe your thoughts without judgment, allowing them to pass like clouds in the sky. + +### Tips for Success + +- **Start Small**: Begin with just a few minutes of practice each day and gradually increase. +- **Be Consistent**: Regular practice is key to developing mindfulness. +- **Be Kind to Yourself**: Approach your practice with compassion and without judgment. + +## Conclusion + +Mindful living is a journey of self-discovery and growth. By cultivating mindfulness, we can live more fully in the present moment, reduce stress, and enhance our overall well-being. Remember, mindfulness is not about achieving a particular state but about being present with whatever arises. + +--- + +**Additional Resources:** + +- **Books**: "The Power of Now" by Eckhart Tolle, "Wherever You Go, There You Are" by Jon Kabat-Zinn +- **Apps**: Headspace, Calm, Insight Timer +- **Courses**: Mindfulness-Based Stress Reduction (MBSR) programs + +--- + +**Final Thought:** + +"Mindfulness is the key to living in the present moment and finding peace in the midst of chaos." + +--- + + +## Page 127 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Command Descriptions + +3.3 Command Descriptions + +All the commands use a control block, as described in Chapter 2, "Programming Conventions for the IEEE 802.2 Interface." All differing uses of variables in the control block and additional control information, such as parameter tables, are included with these command descriptions. A list of the possible return codes for each command is found in "CCB Return Codes Listed by Command" in topic B.2.1. + +Each command description begins with a box containing the command name. The hexadecimal number at the top of the box is the command code value. Whenever parameter tables are included, descriptions of the parameters follow the table. + +Subtopics +3.3.1 BUFFER.FREE +3.3.2 BUFFER.GET +3.3.3 DIR.CLOSE.ADAPTER +3.3.4 DIR.CLOSE.DIRECT +3.3.5 DIR.DEFINE.MIF.ENVIRONMENT +3.3.6 DIR.INITIALIZE +3.3.7 DIR.INTERRUPT +3.3.8 DIR.MODIFY.OPEN.PARMS +3.3.9 DIR.OPEN.ADAPTER +3.3.10 DIR.OPEN.DIRECT +3.3.11 DIR.READ.LOG +3.3.12 DIR.RESET.MULT.GROUP.ADDRESS +3.3.13 DIR.RESTORE.OPEN.PARMS +3.3.14 DIR.SET.EXCEPTION.FLAGS +3.3.15 DIR.SET.FUNCTIONAL.ADDRESS +3.3.16 DIR.SET.GROUP.ADDRESS +3.3.17 DIR.SET.MULT.GROUP.ADDRESS +3.3.18 DIR.SET.USER.APPENDAGE +3.3.19 DIR.STATUS +3.3.20 DIR.TIMER.CANCEL +3.3.21 DIR.TIMER.CANCEL.GROUP +3.3.22 DIR.TIMER.SET +3.3.23 DLC.CLOSE.SAP +3.3.24 DLC.CLOSE.STATION +3.3.25 DLC.CONNECT.STATION +3.3.26 DLC.FLOW.CONTROL +3.3.27 DLC.MODIFY +3.3.28 DLC.OPEN.SAP +3.3.29 DLC.OPEN.STATION +3.3.30 DLC.REALLOCATE +3.3.31 DLC.RESET +3.3.32 DLC.SET.THRESHOLD +3.3.33 DLC.STATISTICS +3.3.34 PDT.TRACE.OFF +3.3.35 PDT.TRACE.ON +3.3.36 PURGE.RESOURCES +3.3.37 READ +3.3.38 READ.CANCEL +3.3.39 RECEIVE +3.3.40 RECEIVE.CANCEL +3.3.41 RECEIVE.MODIFY +3.3.42 TRANSMIT.DIR.FRAME +3.3.43 TRANSMIT.I.FRAME +3.3.44 TRANSMIT.TEST.CMD +3.3.45 TRANSMIT.UI.FRAME +3.3.46 TRANSMIT.XID.CMD +3.3.47 TRANSMIT.XID.RESP.FINAL +3.3.48 TRANSMIT.XID.RESP.NOT.FINAL + +
Copyright IBM Corp. 1986, 1996
+<page_number>3.3 - 1</page_number> + +--- + + +## Page 128 + +LAN Technical Reference: 802.2 and NetBIOS APIs +BUFFER.FREE + +3.3.1 BUFFER.FREE + ++---- Hex 27 ---------------------------------------------+ +| BUFFER.FREE | ++--------------------------------------------------------+ + +**Command Description:** This command returns one or more buffers to the SAP's buffer pool or to the direct station buffer pool. + +**Command Specifics:** When the buffer is placed back in the buffer pool, bytes 4 and 5 (buffer length) of the buffer are set to 0. This command is executed entirely in the workstation. The return code is available to the application program upon return from the protocol drivers. + +**For CCB1 and CCB3:** The command completion appendage is taken if provided. + +**For CCB2:** Either a semaphore or a READ command can be used for command completion. + +**Valid Return Codes:** See "CCB Return Codes Listed by Command" in topic B.2.1. + ++--------------------------------------------------------+ +| Table 3-1. CCB Parameter Table for BUFFER.FREE | ++--------------------------------------------------------+ +| Offset | Parameter Name | Byte | 8086 | Description | +| | | Length | Type | | ++--------+----------------+------+-------+-------------------+ +| 0 | STATION_ID | 2 | DW | SAP/direct station ID; | +| | | | | defines the buffer pool. | ++--------+----------------+------+-------+-------------------+ +| 2 | BUFFER_LEFT | 2 | DW | Number of buffers left in | +| | | | | the pool. (1) | ++--------+----------------+------+-------+-------------------+ +| 4 | | 4 | DB | Reserved. | ++--------+----------------+------+-------+-------------------+ +| 8 | FIRST_BUFFER | 4 | DD | Address of the first | +| | | | | buffer to be added to the | +| | | | | pool. The value is set to | +| | | | | 0 on return. | ++--------+----------------+------+-------+-------------------+ +| (1) | Indicates a returned value. | ++--------------------------------------------------------+ + +STATION_ID + +**Explanation:** This parameter defines the SAP to which the buffer is currently assigned. The SAP_NUMBER portion of the STATION_ID field must identify a valid opened SAP or X'00' (direct station); the STATION_NUMBER portion is ignored. + +BUFFER_LEFT + +**Explanation:** This parameter defines the number of buffers in the pool after the command is completed. The protocol driver returns the value when the command has been executed. + +FIRST_BUFFER + +**Explanation:** This parameter is the address of the first buffer to be added to the pool. If this value is 0, no buffer is freed, and the command is completed with a CCB_RETCODE of X'00'. + +
Copyright IBM Corp. 1986, 1996
+<page_number>3.3.1 - 1</page_number> + +--- + + +## Page 129 + +LAN Technical Reference: 802.2 and NetBIOS APIs +BUFFER.GET + +3.3.2 BUFFER.GET + ++---- Hex 26 ---------------------------------------------+ +| BUFFER.GET | ++--------------------------------------------------------+ + +**Command Description:** This command gets one or more buffers from the SAP's buffer pool or the direct station buffer pool. + +**Command Specifics:** This command is executed entirely in the workstation. The return code is available to the application program upon return from the protocol driver. + +**For CCB1 and CCB3:** The command completion appendage is taken if provided. + +**For CCB2:** Either a semaphore or a READ command can be used for command completion. + +**Valid Return Codes:** See "CCB Return Codes Listed by Command" in topic B.2.1. + ++--------------------------------------------------------+ +| Table 3-2. CCB Parameter Table for BUFFER.GET | ++--------------------------------------------------------+ +| Offset | Parameter Name | Byte | 8086 | Description | +| | | Length | Type | | ++--------+----------------+------+-------+--------------------+ +| 0 | STATION_ID | 2 | DW | SAP/direct station ID; | +| | | | | defines the buffer pool | ++--------+----------------+------+-------+--------------------+ +| 2 | BUFFER_LEFT | 2 | DW | Number of buffers left in | +| | | | | the pool (2) | ++--------+----------------+------+-------+--------------------+ +| 4 | BUFFER_GET | 1 | DB | Number of buffers to get | ++--------+----------------+------+-------+--------------------+ +| 5 | | 3 | DB | Reserved | ++--------+----------------+------+-------+--------------------+ +| 8 | FIRST_BUFFER | 4 | DD | Address of first buffer | +| | | | | obtained (2) | ++--------+----------------+------+-------+--------------------+ +| (2) | Indicates a returned value. | ++--------------------------------------------------------+ + +STATION_ID + +**Explanation:** This parameter defines the SAP buffer pool from which the buffer is to be taken. The SAP_NUMBER portion of the STATION_ID field must identify a valid opened SAP or X'00' (direct station); the STATION_NUMBER portion is ignored. + +BUFFER_LEFT + +**Explanation:** This parameter defines the number of buffers in the pool after the command is completed. The protocol driver returns the value when the command is completed. + +BUFFER_GET + +**Explanation:** This parameter defines the number of buffers to get from the pool. If there is an inadequate number of buffers in the pool, the command terminates with a CCB_RETCODE of X'19'. If the value is set to 0, the default of 1 is used. + +**Note:** This command could cause a link station to go into a local-busy state if too many buffers are taken. + +FIRST_BUFFER + +**Explanation:** This parameter is the address of the first buffer that was obtained. The adapter returns the value when the command is completed. If no buffers are obtained, this field is set to X'00000000'. + +Copyright IBM Corp. 1986, 1996 +3.3.2 - 1 + +--- + + +## Page 130 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DIR.CLOSE.ADAPTER + +3.3.3 DIR.CLOSE.ADAPTER + ++---- Hex 04 -----------------------------------------------+ +| | +| DIR.CLOSE.ADAPTER | +| | ++------------------------------------------------------------+ + +**Command Description:** This command closes the adapter and terminates all network communications or terminates the open wrap test. + +**Command Specifics:** The command forces an immediate shutdown of network communications, and all pending commands will have the control block field CCB_RETCODE set with X'0B'. + +The CCB_POINTER field will be set with the address of a queue of CCBs that have been terminated by this command. + +**For CCB1:** If the adapter was opened with a lock code, this command must have the same hexadecimal value in the first 2 bytes of the CCB_PARM_TAB field in order to close the adapter. If the key code is not provided or is not correct, the DIR.CLOSE.ADAPTER command will be rejected with a CCB_RETCODE of X'05' (required parameters not provided). + +**For CCB2:** For this interface, the close works on a per application program basis. The adapter does not close physically. + +If the application program has any SAP stations or link stations open, they will be reset (closed) prior to the command completing. + +OS/2 is a multitasking operating system. Therefore, multiple application programs can interface with the protocol drivers. This command can be issued by a system administrator using the System Key as defined by the configuration parameters. A physical close resulting from the DIR.CLOSE.ADAPTER command being issued occurs only if this command is issued by the system administrator with the System Key. + +Application programs affected by a DIR.CLOSE.ADAPTER command issued with the System Key can be notified of the event. See "System Action Exceptions for OS/2 EE 1.3" in topic B.15 for more information. The System Key should be placed in the CCB_PARAMETER_2 field, if defined. + +Whenever a physical close occurs resulting from the use of the System Key, all pending commands for all application programs will be set with the CCB_RETCODE of X'62'. Commands on a per application program basis will be chained to the first command canceled for each application program. + +If the application program has previously set bits of the functional address with the DIR.SET.FUNCTIONAL.ADDRESS command, the protocol driver resets the bits. Bits defined by the configuration parameters, however, are not affected. + +If the CCB_CMPL_FLAG field is non-0, an attempt will be made to update a READ command's parameter table with pointers to outstanding CCBs, freed SAP buffers, and outstanding receive frames. If there is a READ command chained to the DIR.CLOSE.ADAPTER command (if CCB_READ_FLAG is non-0 and CCB_POINTER contains the address of a READ CCB), that READ command will be used to return the outstanding data areas of the application program. If there is no READ command chained to the DIR.CLOSE.ADAPTER command, but there is a pending READ command that specifies notifications of command completions, it will be used to return outstanding data areas of the application program. If there is no READ pending that specifies notifications of command completions, free SAP buffer, and outstanding receive frames will not be posted to the user but the pending CCBs will be chained to the CCB_POINTER field of this command. + +**For CCB3:** For this interface, the close works on a per application program basis. The adapter does not close physically. + +If the application program has any SAP stations or link stations open, they will be reset (closed) before the command has finished executing. + +OS/2 is a multitasking operating system. Therefore, multiple application programs can interface with the protocol drivers. This command can be issued by a system administrator using the System Key as defined by the configuration parameters. A physical close resulting from the DIR.CLOSE.ADAPTER command being issued occurs only if this command is issued by the system administrator with the System Key. + +Application programs affected by a DIR.CLOSE.ADAPTER command issued with the System Key can be notified of the event. See "System Action Exceptions for OS/2 EE 1.3" in topic B.15 for more information. The System Key should be placed in the CCB_PARAMETER_2 field, if defined. + +Whenever a physical close occurs resulting from the use of the System Key, all pending commands for all application programs will be set with the CCB_RETCODE of X'62'. Commands on a per application program basis will be chained to the first command canceled for each application program. + +If the application program has previously set bits of the functional address with the DIR.SET.FUNCTIONAL.ADDRESS command, the protocol driver resets the bits. Bits defined by the configuration parameters, however, are not affected. + +The canceled commands and freed SAP buffers are returned to the application program device driver entry point for the system action event if the SYSTEM_ACTION_APPNDG field is defined. + +An application program using the DD interface must issue the DIR.CLOSE.ADAPTER command when it no longer requires the services provided by the protocol drivers, since the protocol drivers cannot determine when an application program using the DD interface terminates. If the DIR.CLOSE.ADAPTER command is not issued, the internal control blocks used by the protocol drivers to support an application program will not be available for other application programs. + +**Valid Return Codes:** See "CCB Return Codes Listed by Command" in topic B.2.1. + +<page_number>3.3.3 - 1</page_number> + +--- + + +## Page 131 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DIR.CLOSE.DIRECT + +3.3.4 DIR.CLOSE.DIRECT + +``` ++---- Hex 34 --------------------------------------------------------+ +| | +| DIR.CLOSE.DIRECT | +| | ++-------------------------------------------------------------------+ +``` + +**Command Description:** This command is for CCB2 and CCB3 only. It releases ownership of all direct stations. + +**Command Specifics:** This command is executed entirely in the workstation. The return code is available to the application program upon return from the protocol driver. This command can be issued by a system administrator with the System Key as defined by the configuration parameters. The System Key code can be used and is located in the CCB_PARAMETER_2 field. This key code is used to force the availability of the direct stations. If the System Key is used, all pending commands and buffers from the direct buffer pool can be returned to the application program. See "System Action Exceptions for OS/2 EE 1.3" in topic B.15 for more information. This function is not typically used by an application program. + +**For CCB2:** If a READ command is used to post this command, the buffers from the direct buffer pool are returned in the READ command parameter table. If the System Key is used, all pending commands and buffers from the direct buffer pool are returned to the application program affected when a READ command issued by the application program is executed for a system action event. + +**For CCB3:** This command completion can be posted to the completion appendage specified in the CCB of the command. When the completion appendage is defined, all pending commands and the direct buffer pool are returned in the information table when this command is executed. If the System Key is used, all pending commands and the direct buffer pool are returned to the application program if a SYSTEM_ACTION_APPNDG field is defined. + +**Valid Return Codes:** See "CCB Return Codes Listed by Command" in topic B.2.1. + +
Copyright IBM Corp. 1986, 1996
+<page_number>3.3.4 - 1</page_number> + +--- + + +## Page 132 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DIR.DEFINE.MIF.ENVIRONMENT + +3.3.5 DIR.DEFINE.MIF.ENVIRONMENT + ++---- Hex 2B -----------------------------------------------+ +| DIR.DEFINE.MIF.ENVIRONMENT | ++-----------------------------------------------------------+ + +**Command Description:** This command is for CCB1 only. It defines the environment required for a NetBIOS emulation program to operate with the protocol drivers. + +**Command Specifics:** This command informs the protocol drivers of the interactive routines to be provided by the NetBIOS emulation program. The adapter number in the CCB must be a value from X'00' to X'03', but the environment will be defined for all adapters supported by the LAN Support Program, if they are installed in the workstation. This command does not have any effect on the original PC Network Adapter if one is installed and if the LAN Support Program is not being used. The command can be issued when an adapter is either open or closed. The command is executed entirely in the protocol drivers in the workstation. Therefore, the command completion appendage is not required, as the command is complete upon return. However, the command completion appendage will be taken if provided. + +**Note:** A NetBIOS emulation program must at some time post a completion code to the Network Control Block (NCB) that was presented to it by an application program. If no command completion appendage (NCB_POST@) has been provided, the emulation program should end with an IRET instruction to return to the protocol driver, which will return to the application program. + +If an appendage has been defined, the emulation program should end with the following instruction sequence to cause the protocol driver to call the appendage. + ++-----------------------------------------------------------+ +| Table 3-3. Appendage Instruction Sequence | ++-----------------------------------------------------------+ +| CLI | +| LES BX, NCBADDR | +| STC | +| RET FAR 2 | ++-----------------------------------------------------------+ + +This special handling of the flags is the indication to the protocol driver that the appendage (NCB_POST@) is to be called. That appendage should end with an IRET instruction. + +**Valid Return Codes:** See "CCB Return Codes Listed by Command" in topic B.2.1. + +**Parameters:** + ++-----------------------------------------------------------+ +| Table 3-4. CCB Parameter Table for DIR.DEFINE.MIF.ENVIRONMENT | ++-----------------------------------------------------------+ +| Offset | Parameter Name | Byte | 8086 | Description | +| | | Length | Type | | ++-----------------------------------------------------------+ +| For CCB1 only: | ++-----------------------------------------------------------+ +| 0 | NCB_INPUT@ | 4 | DD | The address of the NCB module | ++-----------------------------------------------------------+ +| 4 | NCB_OPEN@ | 4 | DD | The address of the open module | ++-----------------------------------------------------------+ +| 8 | NCB_CLOSE@ | 4 | DD | The address of the close module | ++-----------------------------------------------------------+ +| 12 | NCB_ENABLE@ | 4 | DD | The address of the interrupt module (3) | ++-----------------------------------------------------------+ +| (3) | Indicates a returned value. | ++-----------------------------------------------------------+ + +NCB_INPUT + +**Explanation:** This field must have a value other than 0. It must contain the address of a module or routine that the protocol driver can call when it has determined that the control block is an NCB rather than a CCB. Registers ES and BX will point to the NCB. Register AL contains flags as defined in the PDT.TRACE CCB entry byte 1. See topic 3.3.35.1 for more information. + +The specified module or routine must end with an IRET instruction back to the application program that issued the NCB. It does not return to the protocol driver. + +The module will be entered with the same stack used by the application program that issued the NCB. It is the responsibility of the module to return the stack and registers as they were when the module was entered. Only the return address and flags are on the stack when the module is entered. + +Copyright IBM Corp. 1986, 1996 +3.3.5 - 1 + +--- + + +## Page 133 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DIR.DEFINE.MIF.ENVIRONMENT + +NCB_OPEN + +**Explanation:** This field must have a value other than 0. It must contain the address of a module or routine that the protocol driver can call when it has opened an adapter. It does this to inform the NetBIOS emulator that the adapter is open. Registers ES and BX will point to the CCB used to open the adapter. Register CX contains the adapter number. + +The specified module or routine must end with a Far Return instruction back to the protocol driver, with register AL set to indicate the return code. If the AL register is set to 0, the NetBIOS emulator indicates a good return. If AL is not 0, the DIR.OPEN command is completed with a return code of X'10'. + +NCB_CLOSE + +**Explanation:** This field must have a value other than 0. It must contain the address of a module or routine that the protocol driver can call when it has closed an adapter for any reason. Register CX contains the adapter number. + +The specified module or routine must end with a Far Return instruction back to the protocol driver. + +NCB_ENABLE + +**Explanation:** The protocol driver returns the address of a routine that is to be called when interrupts are to be enabled. + +
Copyright IBM Corp. 1986, 1996 +3.3.5 - 2
+ +--- + + +## Page 134 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DIR.INITIALIZE + +3.3.6 DIR.INITIALIZE + ++---- Hex 20 -----------------------------------------------+ +| DIR.INITIALIZE | ++-----------------------------------------------------------+ + +**Command Description:** This command initializes the IBM support program protocol driver areas in the workstation. + +For purposes of system integrity, the DIR.INITIALIZE command loops with interrupts enabled (except in the hardware interrupt appendage for CCB1 as explained below) until one of the following occurs: + +* The adapter interrupts, indicating completion. +* Time expires (approximately 12 seconds for a Token-Ring Network adapter). + +The 12-second period that may elapse is due to the implementation of a 3-second timeout and retry function. The initialization attempt is not halted until at least four attempts have been made to initialize the adapter and execute diagnostics. + +**Command Specifics:** This command is executed entirely in the workstation. The return code is available to the application program upon return from the protocol driver. + +**For CCB1:** Because the command loops until it is completed, no command completion appendage needs to be defined. The CCB_RETCODE is available upon return. + +The command can be issued at any time. It resets the adapter, and any CCBs in process will not be returned. No attempt is made to recover pending CCBs. + +This command must be issued before any other command can be issued. This command will also preempt any other command queued for the protocol driver. It will execute immediately. + +**For CCB2 and CCB3:** This command can be issued at any time by a system administrator with the System Key as defined by the configuration parameters. The System Key should be placed in the CCB_PARAMETER_2 field, if defined. + +When issued, DIR.INITIALIZE resets the adapter. It also returns pending CCBs and buffer resources to the application program that issued them as system action exception information. That is, the returned command's CCB_RETCODE will be set to X'62'. + +Application programs affected by a DIR.INITIALIZE can be notified of the event. See "System Action Exceptions for OS/2 EE 1.3" in topic B.15 for more information. + +**Valid Return Codes:** See "CCB Return Codes Listed by Command" in topic B.2.1. + +**Parameters:** + ++-----------------------------------------------------------+ +| Table 3-5. CCB Parameter Table for DIR.INITIALIZE | ++-----------------------------------------------------------+ +| Offset | Parameter Name | Byte | 8086 | Description | +| | | Length | Type | | ++-----------------------------------------------------------+ +| 0 | BRING_UPS | 2 | DW | Bring-up error code. * | +| | | | | This parameter is not | +| | | | | set on the PC network | +| | | | | or on Ethernet. | ++-----------------------------------------------------------+ +| **For CCB1:** | ++-----------------------------------------------------------+ +| 2 | SRAM_ADDRESS | 2 | DW | Segment value of adapter | +| | | | | shared RAM. * This | +| | | | | parameter is not | +| | | | | recognized on the PC | +| | | | | Network or on Ethernet.| ++-----------------------------------------------------------+ +| 4 | | 4 | -- | Reserved. | ++-----------------------------------------------------------+ +| 8 | ADPTR_CHK_EXIT | 4 | DD | I/O appendage exit, | +| | | | | adapter check. | ++-----------------------------------------------------------+ +| 12 | NETW_STATUS_EXIT | 4 | DD | I/O appendage exit, | +| | | | | network status change. | ++-----------------------------------------------------------+ +| 16 | PC_ERROR_EXIT | 4 | DD | I/O appendage exit, error | +| | | | | in the workstation. This | +| | | | | parameter is not set on | +| | | | | the PC Network or on | +| | | | | Ethernet. | ++-----------------------------------------------------------+ +| **For CCB2 and CCB3:** | ++-----------------------------------------------------------+ +| 2 | SRAM_ADDRESS | 2 | DW | Configured address of | +| | | | | shared RAM. * This | ++-----------------------------------------------------------+ + +Copyright IBM Corp. 1986, 1996 +3.3.6 - 1 + +--- + + +## Page 135 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DIR.INITIALIZE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
parameter is not recognized on the PC Network or on Ethernet.
41DBReserved. *
515DBReserved.
For CCB2:
20VIRTUAL_SRAM_ADDRESS4DDVirtual address of shared RAM. *
For the PC Network or for Ethernet, this is the address of RAM containing link stations, SAPs, and so on.
24VIRTUAL_MMIO_ADDRESS4DDVirtual address of MMIO. *
This is not set on the PC Network or on Ethernet.
28DATA_SEG_ADDRESS4DDVirtual address of device driver's data segment. *
For CCB3:
20VIRTUAL_SRAM_ADDRESS4DDVirtual address with GDT selector of shared RAM. *
For the PC Network or Ethernet, this is the address of RAM containing link stations, SAPs, and other data structures.
24VIRTUAL_MMIO_ADDRESS4DDVirtual address with GDT selector of MMIO. *
This is not set on the PC Network or on Ethernet.
28DATA_SEG_ADDRESS4DDVirtual address with GDT selector of device driver's data segment. *
* Indicates a returned value.
+ +BRING_UPS + +**Explanation:** Indicates the results of the adapter bring-up testing for IBM Token-Ring Network Adapters. A value is entered only if the adapter fails bring-up. If the adapter passes bring-up, the value of this parameter is X'0000'. If the adapter fails bring-up, the command terminates with a CCB_RETCODE of X'07'. See "Bring-Up Errors for All CCBs" in topic B.11 for a list of bring-up error codes and descriptions. + +This parameter is not set on the PC Network or on Ethernet. + +SRAM_ADDRESS + +**Explanation:** This defines the workstation memory segment where the adapter shared RAM is to be addressed. This field is ignored on the PC Network or Ethernet. + +**For CCB1:** + +* For Token-Ring Network adapters with ISA Bus + +If the application program specifies a non-0 number for shared RAM when loading the protocol drivers, that value is used as the segment address for the shared RAM. + +If 0 is coded here, the defaults (X'D800' for adapter 0, X'D400' for adapter 1) are used. + +The value must be on the same address boundary as the shared RAM size mapped into the workstation (for example, on an 8-KB boundary for 8 KB of shared RAM, on a 16-KB boundary for 16 KB of shared RAM, and so on). + +* For Token-Ring Network adapters with Micro Channel + +Copyright IBM Corp. 1986, 1996 +<page_number>3.3.6 - 2</page_number> + +--- + + +## Page 136 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DIR.INITIALIZE + +The input value is ignored (the shared RAM segment address is set using the Reference Diskette shipped with the workstation). A non-0 value coded here does not update the shared RAM address, and no error code is returned to the application program. + +The value returned will be the segment address used for the shared RAM on both Token-Ring Network adapters with ISA Bus and Token-Ring Network adapters with Micro Channel. + +**For CCB2 and CCB3:** + +* For Token-Ring Network adapters with ISA Bus + The shared RAM segment address is defined using the configuration parameters. See Appendix E, "Operating System/2 Extended Edition Information," for additional information. +* For Token-Ring Network adapters with Micro Channel + The input value is ignored. The shared RAM segment address is set using the Reference Diskette shipped with the workstation. + +The value returned will be the segment address used for the shared RAM on both Token-Ring Network adapters with ISA Bus and Token-Ring Network adapters with Micro Channel. This value cannot be used directly by the system administrator while the workstation is running in protect mode. + +--- + +**ADPTR_CHK_EXIT** + +**Explanation:** The address of a user-provided appendage routine that is taken when an adapter error condition is detected. If the value is 0, no exit is defined. This exit can also be overridden by the DIR.OPEN.ADAPTER, DIR.SET.USER.APPENDAGE, and DIR.MODIFY.OPEN.PARMS commands. See "Exception Indications" in topic B.6 for adapter check error codes. + +--- + +**NETW_STATUS_EXIT** + +**Explanation:** The address of a user-provided appendage routine that is taken when the network status changes. This exit can also be overridden by the DIR.OPEN.ADAPTER, DIR.SET.USER.APPENDAGE, and DIR.MODIFY.OPEN.PARMS commands. See "Exception Indications" in topic B.6 for network status codes. + +--- + +**PC_ERROR_EXIT** + +**Explanation:** The address of a user-provided appendage routine that is taken when the protocol driver detects an error condition in the workstation. This is not used on the PC Network or on Ethernet. This exit can also be overridden by the DIR.OPEN.ADAPTER, DIR.SET.USER.APPENDAGE, and DIR.MODIFY.OPEN.PARMS commands. See "Exception Indications" in topic B.6 for workstation errors. + +--- + +**VIRTUAL_SRAM_ADDRESS** + +**Explanation:** + +**For CCB2:** Virtual address of adapter shared RAM. + +This parameter defines the address (selector:offset) that can be used to access the Token-Ring Network adapter's shared RAM. + +It also can define the address (selector:offset) that can be used to access the workstation RAM that has been allocated to the PC Network or Ethernet adapters. + +An entry for this memory segment is made into the logical descriptor table (LDT) of the OS/2 EE process that issues this command. This command is valid only for the process that issued it. + +**For CCB3:** Virtual address with global descriptor table (GDT) selector of adapter shared RAM. + +This parameter defines the address with GDT selector (selector:offset) that can be used to access the Token-Ring Network adapter's shared RAM. + +It can also define the address with GDT selector (selector:offset) that can be used to access the workstation RAM that has been allocated to the PC Network or Ethernet adapters. + +--- + +**MMIO_ADDRESS** + +**Explanation:** + +**For CCB2:** Virtual address of adapter memory mapped input output (MMIO). + +This parameter defines the address (selector:offset) that can be used to access the adapter MMIO. + +This parameter is not returned when you are using PC Network or Ethernet adapters. + +An entry for this memory segment is made into the LDT of the OS/2 EE process that issues this command. This command is valid only for the process that issued it. + +
Copyright IBM Corp. 1986, 1996
+<page_number>3.3.6 - 3</page_number> + +--- + + +## Page 137 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DIR.INITIALIZE + +For CCB3: Virtual address with GDT selector of adapter MMIO. + +This parameter defines the address with GDT selector (selector:offset) that can be used to access the adapter MMIO. + +This parameter is not returned when you are using PC Network or Ethernet adapters. + +DATA_SEG_ADDRESS + +Explanation: + +For CCB2: Virtual address of the data segment in which the protocol drivers are located. + +This parameter defines the address (selector:offset) that can be used to access the data segment in which the protocol drivers are located. + +This memory segment has been mapped in the GDT of the OS/2 EE process that issues this command. + +An entry for this memory segment is made into the LDT of the OS/2 EE process that issues this command. This command is only valid for the process that issued it. + +For CCB3: Virtual address with GDT selector of the data segment in which the protocol drivers are located. + +This parameter defines the address with GDT selector (selector:offset) that can be used to access data segment in which the protocol drivers are located. + +
Copyright IBM Corp. 1986, 1996 +3.3.6 - 4
+ +--- + + +## Page 138 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DIR.INTERRUPT + +3.3.7 DIR.INTERRUPT + +``` ++--- Hex 00 ----------------------------------------------------------+ +| | +| DIR.INTERRUPT | +| | ++-------------------------------------------------------------------+ +``` + +**Command Description:** This command only forces an adapter interrupt. It performs no operation. + +**For CCB1:** The adapter must have been initialized, but does not have to be opened for this command to be accepted. + +**For CCB2 and CCB3:** The adapter must be opened before this command is issued. + +**Command Specifics:** No parameter table is required. + +**Valid Return Codes:** See "CCB Return Codes Listed by Command" in topic B.2.1. + +
Copyright IBM Corp. 1986, 1996 +3.3.7 - 1
+ +--- + + +## Page 139 + +3.3.8 DIR.MODIFY.OPEN.PARMS + ++--- Hex 01 -----------------------------------------------+ +| DIR.MODIFY.OPEN.PARMS | ++----------------------------------------------------------+ + +**Command Description:** This command is for CCB1 only. It is used to modify certain values set by the DIR.OPEN.ADAPTER command. + +**Command Specifics:** This command is rejected if either a BUFFER.FREE command has been issued, or a RECEIVE command is active at the direct interface, or if a direct interface buffer pool has been defined. + +After this command has been issued successfully, it cannot be issued again until a DIR.RESTORE.OPEN.PARMS command has been issued and successfully completed. + +**Valid Return Codes:** See "CCB Return Codes Listed by Command" in topic B.2.1. + +Table 3-6. CCB Parameter Table for DIR.MODIFY.OPEN.PARMS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OffsetParameter NameByte LengthTypeDescription
For CCB1 only:
0DIR_BUF_SIZE2DWThe size of the new direct interface SAP buffers
2DIR_POOL_BLOCKS2DWThe length in 16-byte blocks, of buffers in the new direct interface buffer pool
4DIR_POOL_ADDRESS4DDThe starting segment of the new direct interface buffer pool
8ADPT_CHK_EXIT4DDNew I/O appendage exit, adapter check
12NETW_STATUS_EXIT4DDNew I/O appendage exit, network status
16PC_ERROR_EXIT4DDNew I/O appendage exit, error in workstation
20OPEN_OPTIONS2DWNew options (wrap option is ignored)
+ +See the parameter descriptions for the DIR.OPEN.ADAPTER command. + +--- + + +## Page 140 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DIR.OPEN.ADAPTER + +3.3.9 DIR.OPEN.ADAPTER + ++---- Hex 03 ---------------------------------------------+ +| DIR.OPEN.ADAPTER | ++---------------------------------------------------------+ + +Command Description: + +For CCB1: This command makes the adapter ready for normal network communication. All buffers and tables will be reinitialized. + +For CCB2 and CCB3: This command makes the protocol drivers ready for normal network communications on all network adapters for a given application program. In addition, this command provides the application program with DLC and direct interface information necessary for network communications. + +The DIR.OPEN.ADAPTER command must be issued and executed successfully before any network communication can start. The only commands that can be issued before opening the adapter are those commands that use the System Key as defined by the configuration parameters or the DIR.STATUS command. + +Since OS/2 EE is a multitasking operating system, where multiple application programs can interface with the protocol drivers, each DIR.OPEN.ADAPTER command results in a logical open. This command is executed entirely in the workstation when a logical open is performed. The return code is available to the application program upon return from the protocol drivers. A physical open occurs only if the adapter has been physically closed due to a system action or an unrecoverable error. When a physical open does occur, all buffers and tables in the adapter are reinitialized. + +Command Specifics: + +For CCB1: This command cannot be issued unless the adapter is in a closed state, such as that following a DIR.INITIALIZE or a DIR.CLOSE.ADAPTER command. The only commands that should be issued before the DIR.OPEN.ADAPTER command are DIR.INITIALIZE, DIR.INTERRUPT, and DIR.STATUS. + +This command also makes the adapter ready for an adapter wrap test on Token-Ring Network adapters. + +If the first DIR.OPEN.ADAPTER is in process when the second DIR.OPEN.ADAPTER is issued, the value for NODE_ADDRESS may be invalid. + +If the OPEN_OPTIONS bit 9 (Pass Parm Table bit) is on when the DIR.OPEN.ADAPTER command is issued, all the ADAPTER_PARMS and DLC_PARMS values in the parameter table that were set to use default values are updated with the default value actually used. If the adapter is open when this command is issued and the open option bit 9 is on, the command will be executed with the X'03' return code and also have its parameter tables updated with the currently active open parameter values. The actual values for the ADAPTER_PARMS and DLC_PARMS fields are returned. The actual values for the OPEN_LOCK and PRODUCT_ID_ADDRESS fields are not returned; a value of 0 is stored in these fields. If the DLC interface is not open, 0s are returned in the DLC_PARMS field. + +The DIR.OPEN.ADAPTER parameter table has four pointers to function-oriented tables. These tables contain open parameters for the adapter itself, the direct interface, the DLC interface, and NetBIOS. See Chapter 4, "NetBIOS," for using NetBIOS. + +For CCB2: This command cannot be issued unless the adapter is in a logically closed state for the application program issuing the command. A logically closed state exists after one of the following occurs: adapter initialization, detection of an unrecoverable error, or the execution of a DIR.CLOSE.ADAPTER command. + +☐ After a DIR.OPEN.ADAPTER command is issued, no commands (other than commands using the System Key or the DIR.STATUS command) are allowed from the application program until the DIR.OPEN.ADAPTER command is executed. + +☐ Posting of the DIR.OPEN.ADAPTER command can be done using a system semaphore or by polling the return code. + +☐ The adapter must be logically closed at the time the DIR.OPEN.ADAPTER command is issued. + +☐ The CCB_SEMAPHORE is the posting semaphore. + +☐ The CCB_APPL_ID is the application program ID. + +A unique ID is returned for each application program. The protocol drivers use this ID to reference application program resources. The application program ID returned must be used for all subsequent commands that the application program issues. + +☐ The CCB_APPL_KEY is a key code. + +The key code is used for the application program's resource security. The key code logically locks the resources of application programs. No resource of an application program can be used, discarded, or modified without this key code. If you do not want to have resources controlled for an application program, specify X'0000'. If a key code is specified, all following commands must also specify a key that matches this CCB_APPL_KEY code. + +The DIR.OPEN.ADAPTER command's parameter table contains 2 pointers to function-oriented tables. The fields of these 2 tables are returned by the protocol driver and contain open parameters for the adapter itself and for the DLC interface. + +The OS/2 EE process that actually issues the DIR.OPEN.ADAPTER command is considered the "application program." When this process is terminated, all application program control blocks used to maintain the logical relationship between the application program and the protocol driver are cleaned up and made available for other application programs. + +After the DIR.OPEN.ADAPTER command has been issued, the application program should ensure that the network is in working order by issuing the DIR.STATUS command to retrieve the current network status. + +Copyright IBM Corp. 1986, 1996 +3.3.9 - 1 + +--- + + +## Page 141 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DIR.OPEN.ADAPTER + +**For CCB3:** This command cannot be issued unless the adapter is in a logically closed state for the application program issuing the command. A logically closed state exists after one of the following occurs: adapter initialization, detection of a unrecoverable error, or the execution of a DIR.CLOSE.ADAPTER command. + +* After a DIR.OPEN.ADAPTER command is issued, no commands (other than commands using the System Key) are allowed from the application program until the DIR.OPEN.ADAPTER command is executed. +* Posting of the DIR.OPEN.ADAPTER command can be done using an appendage or by polling the return code. +* The adapter must be logically closed at the time the DIR.OPEN.ADAPTER command is issued. +* The CCB_APPL_ID is the application program ID. + +A unique ID is returned for each application program. The protocol driver uses this ID to reference application program resources. The application program ID returned must be used for all subsequent commands that the application program issues. + +* The CCB_APPL_KEY is a key code. + +The key code is used for the application program's resource security. The key code logically locks the resources of application programs. No resource of an application program can be used, discarded, or modified without this key code. If you do not want to have resources controlled for an application program, specify X'0000'. If a key code is specified, all subsequent commands must also specify a key that matches this CCB_APPL_KEY code. + +The DIR.OPEN.ADAPTER command's parameter table contains 2 pointers to function-oriented tables. The fields of these 2 tables are returned by the protocol driver and contain open parameters for the adapter itself and for the DLC interface. + +After the DIR.OPEN.ADAPTER command has been issued, the application program should ensure that the network is in working order by issuing the DIR.STATUS command to retrieve the current network status. + +**Valid Return Codes:** See "CCB Return Codes Listed by Command" in topic B.2.1. + +**Parameters:** + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 3-7. CCB Parameter Table for DIR.OPEN.ADAPTER
OffsetParameter NameByte LengthTypeDescription
For CCB1:
0ADAPTER_PARMS4DDPointer to the adapter parameters.
4DIRECT_PARMS4DDPointer to the direct interface parameters.
8DLC_PARMS4DDPointer to the DLC parameters.
12NCB_PARMS4DDPointer to the NetBIOS parameters.
For CCB2 and CCB3:
0ADAPTER_PARMS_OFFSET2DWOffset to the adapter parameters.
22DWReserved for the application program. Can be used for the segment or selector.
44DDReserved.
8DLC_PARMS_OFFSET2DWOffset to the DLC parameters.
102DWReserved for the application program. Can be used for the segment or selector.
124DDReserved.
+ +ADAPTER_PARMS and ADAPTER_PARMS_OFFSET + +Copyright IBM Corp. 1986, 1996 +3.3.9 - 2 + +--- + + +## Page 142 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DIR.OPEN.ADAPTER + +**Explanation:** These parameters point to a parameter table (see Table 3-8). + +**For CCB1:** This parameter is required and points to a parameter table. There must be a non-0 value provided for this parameter. + +**For CCB2 and CCB3:** This parameter is an offset that points to a parameter table. This pointer should be provided so that global adapter parameters can be returned to the application program. + +Most parameters are returned values that have been defined by configuration parameters. + +--- + +**DIRECT_PARMS** + +**Explanation:** This parameter is used by the direct station only and points to a parameter table (see Table 3-11). There must be a non-0 value provided for this parameter. + +--- + +**DLC_PARMS** and **DLC_PARMS_OFFSET** + +**Explanation:** These parameters point to a parameter table (see Table 3-12). + +**For CCB1:** This parameter is required and points to a parameter table. It must be defined (not 0) if any interface other than the direct interface is to be used. If this field value is 0, the DLC interface and NetBIOS are not operational. + +**For CCB2 and CCB3:** This parameter is an offset that points to a parameter table. This pointer should be provided so that global DLC parameters can be returned to the application program. + +Most parameters are returned values that have been defined by configuration parameters. + +--- + +**NCB_PARMS** + +**Explanation:** This field is a pointer to a parameter table. If this field value is 0 when NetBIOS is used, all default values are used. See topic 4.5 for information about the NetBIOS operational parameters. + +**Parameters:** + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 3-8. Adapter Parms Open Parameters
OffsetParameter NameByte Length8086 TypeDescription
0OPEN_ERROR_CODE2DWOpen adapter errors detected. Set by the adapter. **
2OPEN_OPTIONS2DWVarious options. *
4NODE_ADDRESS6DBThis adapter's address. **
10GROUP_ADDRESS4DBSet group address. *
14FUNCTIONAL_ADDR4DBSet functional address. *
18NUMBER_RCV_BUFFERS2DWNumber of receive buffers. *
20RCV_BUFFER_LEN2DWLength of the receive buffers. *
22DHB_BUFFER_LENGTH2DWLength of the transmit data hold buffers. *
24DATA_HOLD_BUFFERS1DBNumber of transmit data hold buffers. *
This parameter is not recognized on the PC Network or on Ethernet. Is used only by the Token-Ring Network.
For CCB1:
251DBReserved.
26OPEN_LOCK2DWA protection code to control closing the adapter.
+ +Copyright IBM Corp. 1986, 1996 +3.3.9 - 3 + +--- + + +## Page 143 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DIR.OPEN.ADAPTER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
28PRODUCT_ID_ADDRESS4DDAddress of the 18-byte product ID.
For CCB2 and CCB3:
253DBReserved.
28PRODUCT_ID_OFFSET2DWOffset of 18-byte product ID.
302DWReserved for the application program. Can be used for the segment or selector.
32BRING_UPS2DWBring up errors. *
34INIT_WARNINGS2DWInitialization warnings. *
For CCB2:
36SEMAPHORE_COUNT2DWCount of system semaphore handles.
38SYS_SEMAPHORE_TABL4DDAddress to system semaphore table.
For CCB3:
362DWReserved for the application program.
384DDReserved for the application program.
42DDNAME8DBDevice driver name.
* Indicates a returned value for CCB2 and CCB3.
** Indicates a returned value for all CCBs.
+ +OPEN_ERROR_CODE + +**Explanation:** Indicates the results of the open adapter testing. If the value is not X'0000', the command terminates with a CCB_RETCODE of X'07'. See "Token-Ring Network Adapter Open Errors for All CCBs" in Appendix B, "Return Codes," for open error codes. + +OPEN_OPTIONS + +**Explanation:** Various options, each defined by a bit. A bit on (1) indicates that the option is to be taken. Bit 15 is the high-order (leftmost) bit. Only bit 9 is recognized on the PC Network or on Ethernet. + +**For CCB2 and CCB3:** These are returned values. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 3-9. IBM Token-Ring Network Adapter OPEN_OPTIONS
BitNameDescription
15Wrap interfaceThe adapter will not attach itself to the network. Instead, it causes all user transmit data to be wrapped as received data.
14Disable Hard ErrorPrevents network status changes involving "Hard Error" and "Transmit Beacon" bits from causing interrupts.
13Disable Soft ErrorsPrevents network status changes involving the "Soft Error" bit from causing interrupts.
12Pass Adapter MAC FramesPasses, as direct interface data to the workstation, all adapter class MAC frames that are received but not supported by the adapter. If this bit is set to off, these frames are ignored.
11Pass Attention MAC FramesPasses, as direct interface data to the workstation, all attention MAC frames that are not the same as the last received
+ +Copyright IBM Corp. 1986, 1996 +3.3.9 - 4 + +--- + + +## Page 144 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DIR.OPEN.ADAPTER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
attention MAC frame. If this option is set to off, these frames are not passed to the application program.
10ReservedShould be 0, but this bit is not checked by the protocol driver.
9For CCB1: Pass Parm TableIf the adapter is already open, the options used when opening the adapter are returned to the user parameter table.
For CCB2 and CCB3: ReservedShould be 0, but this bit is not checked by the protocol driver.
8ContenderWhen the contender bit is set to on, the adapter participates in monitor contention (claim token) if the opportunity occurs. When the contender bit is set to off, and the need is detected by another adapter, this adapter does not participate.
If the need for determining a new active monitor is detected by this adapter, monitor contention (claim token) processing will be initiated by this adapter whether the contender bit is set to on or off.
7Pass Beacon MAC framesPasses, as direct interface data to the workstation, the first beacon MAC frame and all subsequent beacon MAC frames that have a change in the source address or the beacon type.
6ReservedShould be 0, but this bit is not checked by the protocol driver.
5Remote Program LoadThis bit is only implemented in 16/4 adapters. It prevents the adapter from becoming a monitor during the open process. If this bit is set to on, the adapter fails the open process if there is no other adapter on the ring when it attempts to insert on the ring.
4Token ReleaseThis bit is only available for 16/4 adapters when operating at 16 Mbps. If the bit is not set, 16 Mbps adapters use early token release (the default). Setting this bit on selects no early token release for an adapter operating at 16 Mbps.
For CCB1: If Token Release is selected by using the command line parameter, this bit will be set on when the DIR.OPEN.ADAPTER command is executed.
0-3ReservedShould be 0, but these bits are not checked by the protocol driver.
+ +Refer to the IBM Token-Ring Network Architecture Reference for more information about network operation. + +NODE_ADDRESS + +**Explanation:** The 6-byte specific node address of this station on the network. The value must not be all 1s. The 2 high-order (leftmost) bits must be B'01'. For other restrictions and details about addresses, refer to the IBM Token-Ring Network Architecture Reference. + +If an address parameter was provided when the protocol drivers were loaded, that address is used rather than the address provided in this parameter field. The address used is returned in this field by the protocol driver for return to the application program. + +**For CCB1:** If the value is 0, the address currently in use by the MAC driver is the node address by default, and that value is placed in this field by the protocol driver for return to the application program. + +If the OPEN_LOCK field is coded as 0, then: + +☐ If a locally administered address was specified when the protocol drivers were loaded, the locally administered address is used regardless of the contents of this field. + +☐ If a 0 was specified when the protocol drivers were loaded, the address in use by the MAC driver is used regardless of the contents of this field. + +Copyright IBM Corp. 1986, 1996 +<page_number>3.3.9 - 5</page_number> + +--- + + +## Page 145 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DIR.OPEN.ADAPTER + +**For CCB2 and CCB3:** See Appendix E, "Operating System/2 Extended Edition Information." + +--- + +**GROUP_ADDRESS** + +**Explanation:** Sets the group address for which the adapter will receive messages. If the value is 0, no group address is set. + +--- + +**FUNCTIONAL_ADDR** + +**Explanation:** Sets the functional address the adapter will receive messages for. The most significant bit and the least significant bit of this field are ignored by the adapter. If the value is 0, no functional address is set. + +**For CCB1:** If NetBIOS is made operational, it will reissue a DIR.SET.FUNCTIONAL.ADDRESS command using all bits set in the current functional address and adding X'00000080' to the bits being used. + +For Ethernet adapters, if a functional address is specified in the DIR.OPEN.ADAPTER command, the same actions will be taken as described for the DIR.SET.FUNCTIONAL.ADDRESS command. If the number of bits to be set for the functional address exceeds the number of available multicast addresses, the DIR.OPEN.ADAPTER command will not be executed and a return code of X'1E' will be posted in the CCB. + +--- + +**NUMBER_RCV_BUFFERS** + +**Explanation:** The number of receive buffers needed for the adapter to open. The adapter configures all remaining RAM as receive buffers after other memory requirements have been met. If the number available is less than the number requested, the DIR.OPEN.ADAPTER command fails. If the number available is greater than the number requested, no action occurs. If this value is less than 2, the default of 8 is used. + +If you are using DXME0MOD.SYS, you may find you have inadequate work space. The NDIS MAC driver for an NDIS adapter specifies the largest frame size the adapter can process. When the DIR.OPEN.ADAPTER command is issued, the receive buffer length and the number of receive buffers are checked to make sure one maximum size frame can be received in them. (Receive frames can occupy more than one receive buffer.) If the maximum size frame does not fit, the DIR.OPEN.ADAPTER command returns X'30' Inadequate receive buffers for adapter to open. + +To correct this problem, you need to specify a larger work space for the adapter. To do this, increase the value of the work space parameter on the command line of the protocol driver DXME0MOD.SYS. + +To increase the work space for a PC Network Adapter, alter the work space parameter on the DXMGnMOD.SYS protocol driver. (1) Refer to the Local Area Network Support Program User's Guide for more information. + +--- + +**RCV_BUFFER_LENGTH** + +**Explanation:** The length of each of the receive buffers. The value must be a multiple of 8 with 96 as the minimum, and 2048 as the maximum. + +If the value is 0, the default of 112 is used. When DXME0MOD.SYS is used, each buffer holds 14 fewer bytes of data than the specified length; otherwise, each buffer holds 8 fewer bytes of data than the specified length. Therefore, a buffer defined as 112 bytes can hold only 104 bytes of data. If a frame received from the network is longer than one buffer, receive buffers will be chained. + +**For CCB1:** For Ethernet adapters, the minimum and default receive buffer length is 208. If the user specifies a buffer length between 96 and 200, length of the receive buffer is automatically incremented to 208 without flagging an error or notifying the application. + +--- + +**DHB_BUFFER_LENGTH** + +**Explanation:** The length of each of the transmit data hold buffers. (2) + +For the following Token-Ring Network adapters, the maximum DHB length is 2048: + +* Token-Ring Network PC Adapters and PC Adapter IIs +* Token-Ring Network Adapter/As. + +For all new Token-Ring Network adapters operating at 4 Mbps that are supported by IBM support programs, the maximum DHB length is 4464, and for all Token-Ring Network adapters operating at 16 Mbps that are supported by IBM support programs, the maximum DHB length is 17 960. + +**Note:** If a length greater than 2048 is used, it is important to make sure that all adapters receiving these frames can also handle the larger frame length. + +**For CCB1:** For Ethernet adapters, the maximum DHB buffer length is 1496. + +If the value is 0, the default of 600 is used. Each buffer holds 6 fewer bytes of data than the specified length. Therefore, a buffer defined as 600 bytes can hold only 594 bytes. + +--- + +**DATA_HOLD_BUFFERS** + +**Explanation:** Defines the number of transmit data hold buffers in the adapter in which data from the workstation is stored. This parameter is not recognized on the PC Network or on Ethernet. + +
Copyright IBM Corp. 1986, 1996 +3.3.9 - 6
+ +--- + + +## Page 146 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DIR.OPEN.ADAPTER + +The adapter accepts any value between 0 and 255, but the integrity of adapter operation cannot be guaranteed if the value is greater than 2. Requesting 2 buffers may improve adapter performance by allowing a frame to be moved into the second buffer while the adapter is transmitting from the first. However, this reduces the storage available for receive buffers. Transmit buffers are not chained. If the value is 0, the default of 1 is used. + +OPEN_LOCK + +**Explanation:** A code provided to the application program to lock the adapter open. Only a DIR.CLOSE.ADAPTER command that has a matching key code can close the adapter. When using this feature, you must make sure that the adapter is closed when the application program is finished, or all application programs using the adapter must follow consistent rules about opening and closing the adapter. This field permits one application program to supervise adapter closing when more than one application program or operation has access. + +It is recommended that the application program code this field as 0. + +This field is not returned by coding the OPEN_OPTION bit 9. + +PRODUCT_ID_ADDRESS + +**Explanation:** The address in workstation memory where an 18-byte product ID is located. + +The product ID provides indications about the workstation and programs used. The field can point to a location containing all 0s, or point to a product ID field prepared as shown in Table 3-10. + +This field is not returned by coding the OPEN_OPTION bit 9. + +PRODUCT_ID_OFFSET + +**Explanation:** The offset in workstation memory where an 18-byte product ID is located. + +The product ID provides indications about the workstation and programs used. The field must point to a location containing all 0s or point to a product ID field prepared as in Table 3-10. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 3-10. Product ID Field
OffsetDescription
Byte 0X'01' indicates workstation.
Byte 1X'10'.
Bytes 2-5The machine type from the serial number tag at rear of workstation (the last 4 digits). Enter in EBCDIC. For example, for serial number=61382, code the field as (F0 F0 F0 F6 F1 F3 F8 F2).
Bytes 6-170-filled.
+ +BRING_UPS + +**Explanation:** Bring-up error codes. See "Bring-Up Errors for All CCBs" in topic B.11 for a list of all valid codes. This parameter indicates the results of Token-Ring Network Adapter bring-up testing. + +INIT_WARNINGS + +**Explanation:** Processing during initialization may detect errors that do not prevent initialization of the protocol drivers. These errors will result in the use of default values to configure the protocol drivers. This field is used to notify the user that such errors have occurred and were not fixed by the system administrator during system initialization. Below are the values contained in this field. + +X'00' No errors detected during configuration parameters processing. + +X'01' No configuration parameters found for the adapter. + +X'02' Errors found during configuration parameters processing; default values used. + +SEMAPHORE_COUNT + +**Explanation:** Number of system semaphore handles referenced by the SYS_SEMAPHORE_TABLE parameter. If this value is greater than 12, the command terminates with CCB_RETCODE set to X'06'. + +SYS_SEMAPHORE_TABLE + +
Copyright IBM Corp. 1986, 1996
+<page_number>3.3.9 - 7</page_number> + +--- + + +## Page 147 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DIR.OPEN.ADAPTER + +**Explanation:** Address of system semaphore handle table. System semaphore handles that will be used for posting asynchronous events can be registered with the protocol driver prior to using the semaphore handles. Registering system semaphore handles prior to using them allows the protocol driver to obtain in advance new handles that it can use. Obtaining the handles means that the protocol driver uses less overhead when it processes a command that is issued with one of the registered system semaphore handles in the CCB_SEMAPHORE field. + +A table of system semaphore handles can be passed using this parameter. The table can contain up to twelve, 4-byte system semaphore handles that are placed in a control block pointed to by this parameter. The first handle will be located in bytes 0-3 with other handles following (for example, bytes 4-7, bytes 8-11). Values used for system semaphore handles are the values returned from OS/2 when the system semaphore is created or opened. + +Only the OS/2 process that issues the DIR.OPEN.ADAPTER command and provides system semaphore handles can use these handles. All other processes associated with the application program must provide a handle returned from OS/2 for the given process when the system semaphore is created or opened. + +**Note:** The semaphores must not be created as exclusive. + +DDNAME + +**Explanation:** This is the name of the application program's device driver that contains the user exits to be called when events are completed. The protocol driver issues an OS/2 Device Help ATTACHDD function call to obtain the application program device driver's intercommunication entry point. The application program's device driver must have enabled interdevice driver communications by setting the DEVICE_ATTRIBUTE field of the device driver header (this allows support for the protocol driver to use the ATTACHDD function and obtain the application program's device driver entry point). ATTACHDD is an OS/2 Device Help function. When the application program's device driver issues the DIR.OPEN.ADAPTER command, this parameter specifies the application program's device driver name. + +For CCB1: Direct Parms Open Parameters + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 3-11. Direct Parms Open Parameters for CCB1
OffsetParameter NameByte Length8086 TypeDescription
0DIR_BUF_SIZE2DWSize of buffers in the direct buffer pool.
2DIR_POOL_BLOCKS2DWThe length, in 16-byte blocks, of the direct buffer pool.
4DIR_POOL_ADDRESS4DDStarting segment of the direct buffer pool.
8ADPT_CHK_EXIT4DDI/O appendage exit, adapter check.
12NETW_STATUS_EXIT4DDI/O appendage exit, network status change.
16PC_ERROR_EXIT4DDI/O appendage exit, error in the workstation.
20WORK_ADDR4DDAdapter work area, segment value. This parameter is not recognized on the PC Network or on Ethernet.
24WORK_LEN_REQ2DWAdapter work area length, requested. This parameter is not recognized on the PC Network or on Ethernet.
26WORK_LEN_ACT2DWAdapter work area length, actual. * This parameter is not recognized on the PC Network or on Ethernet.
* Indicates a returned value.
+ +DIR_BUF_SIZE + +**Explanation:** The size of the buffers in the direct station buffer pool including adapter overhead space. The minimum length is 80 bytes, and the length must be a multiple of 16. If the value is 0, the default of 160 is used. + +Copyright IBM Corp. 1986, 1996 +3.3.9 - 8 + +--- + + +## Page 148 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DIR.OPEN.ADAPTER + +DIR_POOL_BLOCKS + +**Explanation:** The number of 16-byte blocks assigned as the direct station buffer pool. If the value is 0, the default of 256 (4096 bytes) is used. If DIR_POOL_ADDRESS is 0, this parameter is ignored. This field is set to the size of the application program's buffer area divided by 16. + +DIR_POOL_ADDRESS + +**Explanation:** The segment value of the address in workstation memory where the protocol driver is to build the direct station buffer pool. See "Buffer Pools" in topic 2.9.1. If the value is 0, the application program has the responsibility of managing its own buffer pool. If this is the case, the DIR_BUF_SIZE parameter must indicate the size of each buffer. + +ADPT_CHK_EXIT + +**Explanation:** The address of a user-provided appendage routine that is taken when the adapter detects an error in the adapter. If the value is 0, the default is as defined by the DIR.INITIALIZE command. + +NETW_STATUS_EXIT + +**Explanation:** The address of a user-provided appendage routine that is taken when the network status changes. If the value is 0, the default is as defined by the DIR.INITIALIZE command. + +PC_ERROR_EXIT + +**Explanation:** The address of a user-provided appendage routine that is taken when the protocol driver detects an error in the workstation. If the value is 0, the default is as defined by the DIR.INITIALIZE command. + +WORK_ADDR + +**Explanation:** A segment value in workstation memory where a work area has been allocated for the protocol drivers. This value is ignored if the WORK_LEN_REQ field is 0. This parameter is not recognized on the PC Network or on Ethernet. + +WORK_LEN_REQ + +**Explanation:** The length of the work area in workstation memory, defined by the parameter WORK_ADDR. The length must be enough to contain all protocol driver work areas defined by the DIR.OPEN.ADAPTER parameters DLC_MAX_SAP and DLC_MAX_STATIONS. + +The following formula enables you to calculate the workstation memory space needed when you are using the LAN Support Program Versions 1.22 through 1.27. To use this formula, add the subtotals for SAPs and stations to the 74 bytes for direct interface stations: + +The number of SAPs (DLC_MAX_SAP) * 38 = +The number of stations (DLC_MAX_STATIONS) * 18 = 74 +Total workstation RAM needed (bytes) = _____ + +If this value is 0, the internal work area is used and the WORK_ADDR field will be ignored. This parameter is not recognized on the PC Network or on Ethernet. + +WORK_LEN_ACT + +**Explanation:** The returned value for the length of the work area in workstation memory required by the protocol drivers. If the actual length is greater than the work area (internal or specified), the command terminates with the CCB_RETCODE field containing X'12' (available work area exceeded). This parameter is not recognized on the PC Network or on Ethernet. It is retained for Token-Ring Network compatibility. + +For all CCBs: DLC Parms Open Parameters + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 3-12. DLC Parms Open Parameters for All CCBs
OffsetParameter NameByte Length8086 TypeDescription
0DLC_MAX_SAP1DBMaximum number of SAPs *
1DLC_MAX_STATIONS1DBMaximum number of link stations *
2DLC_MAX_GSAP1DBMaximum number of group SAPs *
3DLC_MAX_GMEM1DBMaximum members per group
+ +Copyright IBM Corp. 1986, 1996 +3.3.9 - 9 + +--- + + +## Page 149 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DIR.OPEN.ADAPTER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SAP *
4DLC_T1_TICK_ONE1DB DLC timer T1 interval, group 1 *
5DLC_T2_TICK_ONE1DB DLC timer T2 interval, group 1 *
6DLC_Ti_TICK_ONE1DB DLC timer Ti interval, group 1 *
7DLC_T1_TICK_TWO1DB DLC timer T1 interval, group 2 *
8DLC_T2_TICK_TWO1DB DLC timer T2 interval, group 2 *
9DLC_Ti_TICK_TWO1DB DLC timer Ti interval, group 2 *
* Indicates a returned value for OS/2 (CCB2 and CCB3).
+ +DLC_MAX_SAP +Explanation: The maximum number of SAPs that can be opened at one time. The maximum value that is allowable may be limited by the amount of available workstation RAM work area allocated for the protocol drivers, or by the amount of adapter shared RAM. If NetBIOS is opened, one of the SAPs is required for the use of the NetBIOS protocol driver and therefore is unavailable for application program use. The maximum value of this parameter is 127 (126 for NetBIOS). If the value is 0, the default of 2 is used. + +DLC_MAX_STATIONS +Explanation: The maximum number of link stations that can be opened at one time. The maximum value that is allowable may be limited by the amount of available workstation RAM work area allocated for the protocol drivers or by the amount of adapter shared RAM. If NetBIOS is opened, some of the link stations will be used by the SAP assigned for NetBIOS protocol driver use. If the value is 0, the default of 6 is used. The maximum value of this parameter is 255 for the Token-Ring Network, the PC Network, or Ethernet. + +DLC_MAX_GSAP +Explanation: The maximum number of group SAPs that can be opened at one time. If the value is 0, no group SAPs are allowed. The maximum value of this parameter is 126 for the Token-Ring Network (125 for the PC Network and Ethernet). + +DLC_MAX_GMEM +Explanation: The maximum number of SAPs that can be assigned to any given group. The maximum value of this parameter is 127 for the Token-Ring Network (126 for the PC Network and Ethernet). + +DLC_T1_TICK_ONE +Explanation: The number of 40-ms intervals between timer "ticks" for the short DLC timer T1 (T1 timer values 1-5). If the value is 0, the default of 5 (200-400 ms) is used. See "Timers" in topic 2.8.4. + +DLC_T2_TICK_ONE +Explanation: The number of 40-ms intervals between timer "ticks" for the short DLC timer T2 (T2 timer values 1-5). If the value is 0, the default of 1 (40-80 ms) is used. See "Timers" in topic 2.8.4. + +DLC_Ti_TICK_ONE +Explanation: The number of 40-ms intervals between timer "ticks" for the short DLC timer Ti (Ti timer values 1-5). If the value is 0, the default of 25 (1-2 seconds) is used. See "Timers" in topic 2.8.4. + +DLC_T1_TICK_TWO +Explanation: The number of 40-ms intervals between timer "ticks" for the long DLC timer T1 (timer values 6-10). If the value is 0, the default of 25 (1-2 seconds) is used. See "Timers" in topic 2.8.4. + +DLC_T2_TICK_TWO +Explanation: The number of 40-ms intervals between timer "ticks" for the long DLC timer T2 (timer values 6-10). If the value is 0, the default of 10 (400-800 ms) is used. See "Timers" in topic 2.8.4. + +DLC_Ti_TICK_TWO +Explanation: The number of 40-ms intervals between timer "ticks" for the long DLC timer Ti (Ti timer values 6-10). If the value is 0, the default of 10 (400-800 ms) is used. See "Timers" in topic 2.8.4. + +Copyright IBM Corp. 1986, 1996 +3.3.9 - 10 + +--- + + +## Page 150 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DIR.OPEN.ADAPTER + +**Explanation:** The number of 40-ms intervals between timer "ticks" for the long DLC timer Ti (timer values 6-10). If the value is 0, the default of 125 (5-10 seconds) is used. See "Timers" in topic 2.8.4. + +See topic 4.5 for the NetBIOS Open Parameters table. + +(1) The letter n stands for the version of DXMGnMOD.SYS, 0, 1, or 2. + +(2) This value must be a multiple of 8. + +
Copyright IBM Corp. 1986, 1996 +3.3.9 - 11
+ +--- + + +## Page 151 + +3.3.10 DIR.OPEN.DIRECT + ++---- Hex 35 -----------------------------------------------+ +| DIR.OPEN.DIRECT | ++----------------------------------------------------------+ + +**Command Description:** This command is for CCB2 and CCB3 only. It provides a single application program with the capability of receiving frames using the direct station. + +**Command Specifics:** An application program is given ownership of the direct station and can receive frames once RECEIVE commands have been issued for the direct station. If the direct station has already been assigned to an application program, this command terminates with a CCB_RETCODE of X'63'. This command is executed entirely in the workstation. The return code is available to the application program upon return from the protocol driver. + +**Valid Return Codes:** See "CCB Return Codes Listed by Command" in topic B.2.1. + +**Parameters:** + +Table 3-13. CCB Parameter Table for DIR.OPEN.DIRECT + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OffsetParameter NameByte Length8086 TypeDescription
For CCB2 and CCB3:
0DIR_BUF_SIZE2DWSize of buffers in the buffer pool
2DIR_POOL_LENGTH2DWLength of buffer pool
4DIR_POOL_ADDRESS4DDStarting address of buffer pool
8OPEN_OPTIONS2DWOpen options
* Indicates a returned value.
+ +**DIR_BUF_SIZE** + +**Explanation:** This is the size of the entire buffer including all overhead. + +The minimum length is 80 bytes, and the length must be a multiple of 16. If this value is 0, the default of 160 is used. The maximum size is dependent on the DIR_POOL_LENGTH parameter. + +**DIR_POOL_LENGTH** + +**Explanation:** This is the length of the direct buffer pool. This is the number of 16-byte blocks in the direct buffer pool. If the value is left as 0, the value is ignored. + +**DIR_POOL_ADDRESS** + +**Explanation:** This is the starting address of the buffer pool. If this value is 0, it is the responsibility of the application program to build its own buffer pool. If this is done, the DIR_BUF_SIZE parameter must reflect the size of these buffers. + +**OPEN_OPTIONS** + +**Explanation:** See the open options described in Appendix E, "Operating System/2 Extended Edition Information." + +**Note:** The "wrap interface" and "token release" options are ignored if specified with this command. These options can only be specified with the configuration parameters. + +Copyright IBM Corp. 1986, 1996 +3.3.10 - 1 + +--- + + +## Page 152 + +3.3.11 DIR.READ.LOG + ++---- Hex 08 -----------------------------------------------+ +| DIR.READ.LOG | ++----------------------------------------------------------+ + +**Command Description:** This command reads and resets the adapter logs. The log data is transferred to the buffer indicated in the parameter table. + +**Command Specifics:** If the LOG_ID is X'0001', this command executes entirely in the workstation. The CCB_RETCODE is available upon return. + +**For CCB2 and CCB3:** This command can be issued by a system administrator using the System Key as defined by the configuration parameters. + +The system administrator or application program that issued the DIR.OPEN.DIRECT command and has been assigned ownership of the direct stations can issue this command without the System Key. + +The System Key code is located in the CCB_PARAMETER_2 field. The System Key code is needed to read the adapter log and the direct interface log if the direct stations have not been assigned to the system administrator. For example, if an application program issued the DIR.OPEN.DIRECT command and has ownership of the direct stations, the System Key code has to match the System Key defined by the configuration parameters in order for a system administrator to read the logs as described above. + +Application programs affected by a DIR.READ.LOG command issued with the System Key can be notified of the event. See "System Action Exceptions for OS/2 EE 1.3" in topic B.15 for more information. + +**Valid Return Codes:** See "CCB Return Codes Listed by Command" in topic B.2.1. + +**Parameters:** + +Table 3-14. CCB Parameter Table for DIR.READ.LOG + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OffsetParameter NameByte LengthTypeDescription
0LOG_ID2DWIdentify the log to read
For CCB1:
2LOG_BUF_LENGTH2DWSize of the buffer at LOG_BUF_ADDR
4LOG_BUF_ADDR4DDAddress to place log data
8LOG_ACT_LENGTH2DWActual length of log *
For CCB2 and CCB3:
2LOG_BUF_LENGTH2DWSize of the buffer at LOG_BUF_OFFSET
4LOG_BUF_OFFSET2DWOffset to place log data
62DWReserved for the application program
8LOG_ACT_LENGTH2DWActual length of log *
* Indicates a returned value.
+ +LOG_ID +Explanation: Identifies the log to read as follows: +X'0000' Adapter error log +X'0001' Direct interface error log +X'0002' Both logs. + +LOG_BUF_LENGTH +Explanation: +For CCB1: The length of the buffer defined by LOG_BUF_ADDR. + +
Copyright IBM Corp. 1986, 1996
+<page_number>3.3.11 - 1</page_number> + +--- + + +## Page 153 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DIR.READ.LOG + +For CCB2 and CCB3: The length of the buffer defined by LOG_BUF_OFFSET. + +LOG_BUF_ADDR +Explanation: The address in workstation memory of the buffer (defined by the application program) where the log data is to be placed. + +LOG_BUF_OFFSET +Explanation: The offset in workstation memory of the buffer (defined by the application program) where the log data is to be placed. + +LOG_ACT_LENGTH +Explanation: The actual length of the log as returned by the adapter or protocol driver. If this value is greater than that defined by the LOG_BUF_LENGTH parameter, the full log was not transferred. The CCB_RETCODE will contain X'15'. + +Note: When data is lost (CCB_RETCODE X'15'), the log is still reset. + +Subtopics +3.3.11.1 Log Formats + +
Copyright IBM Corp. 1986, 1996 +3.3.11 - 2
+ +--- + + +## Page 154 + +3.3.11.1 Log Formats + +There are 2 log formats. + +**Adapter Log** +When one or more log counters reaches 255, the application program network status appendage routine will be taken with network status indicating a counter overflow. These counters are reset after they are read. + +The information read from this log is 14 bytes long and returned to the buffer in the following order: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 3-15. Log Formats for the Adapter Log
Byte8086 TypeToken-Ring NetworkPC Network and Ethernet
0DBLine ErrorCRC Errors **
1DBInternal errorReserved
2DBBurst errorAlignment errors **
3DBA/C errorReserved
4DBAbort delimiterTransmit errors
5DBReservedReserved
6DBLost frameCollision Errors **
7DBReceive congestionReceive congestion errors
8DBFrame copied errorReserved
9DBFrequency errorReserved
10DBToken errorReserved
11DBReservedReserved
12DBReservedReserved
13DBReservedReserved
** This value is not returned by DIX Version 2.0 and IEEE 802.3 network adapters.
+ +**Direct Interface Log** +The direct interface log consists of 18 bytes of counters. They are returned to the buffer in this order: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 3-16. Log Formats for the Direct Interface Log.
Bytes8086 TypeMeaning
0-3DDNumber of frames transmitted
4-7DDNumber of frames received
8-11DDNumber of frames discarded (no receive command)
12-15DDNumber of times data was lost
16-17DWNumber of buffers available in the SAP buffer pool
+ +**Both Adapter and Direct Interface Logs** +Both logs will be placed in the buffer. The adapter log is first, followed by the direct interface log. + +
Copyright IBM Corp. 1986, 1996
+<page_number>3.3.11.1 - 1</page_number> + +--- + + +## Page 155 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DIR.RESET.MULT.GROUP.ADDRESS + +3.3.12 DIR.RESET.MULT.GROUP.ADDRESS + +``` ++---- Hex 42 ---------------------------------------------+ +| | +| DIR.RESET.MULT.GROUP.ADDRESS | +| | ++--------------------------------------------------------+ +``` + +**Command Description:** This command is not available with some of the earlier IBM LAN support software. It resets multiple group addresses for NDIS adapters that can have more than one group address (for example, Ethernet adapters). + +**Command Specifics:** Multiple group addresses are reset one at a time unless the RESET_ALL_FLAG parameter is set. If the RESET_ALL_FLAG parameter is set, all the multiple group addresses are reset at once. + +Table 3-17 describes the parameter table for the DIR.RESET.MULT.GROUP.ADDRESS command. + +**Note:** If the address to be deleted is not currently set, a return code of X'00' Operation was completed successfully is returned. + +``` ++--------------------------------------------------------+ +| Table 3-17. DIR.RESET.MULT.GROUP.ADDRESS Parameter Table for CCB1 | ++--------------------------------------------------------+ +| Offset | Parameter Name | Byte | 8086 | Description | +| | | Length | Type | | ++--------+----------------+------+-------+--------------------+ +| 0 | GROUP_ADDRESS | 6 | DB | Group address | ++--------+----------------+------+-------+--------------------+ +| 6 | Reserved | 2 | DW | Should be set to 0 | ++--------+----------------+------+-------+--------------------+ +| 8 | RESET_ALL_FLAG | 1 | DB | Reset All Flag. If | +| | | | | set to 1, all group | +| | | | | addresses are reset.| ++--------+----------------+------+-------+--------------------+ +``` + +**Note:** The use of the RESET_ALL_FLAG parameter resets all group addresses, even if a group address was set using the DIR.OPEN.ADAPTER command. If the RESET_ALL_FLAG is set, then the group address (if any) specified in the parameter table is ignored. + +**Valid Return Codes:** See "CCB Return Codes Listed by Command" in topic B.2.1. + +For more information about the use of the DIR.RESET.MULT.GROUP.ADDRESS command, see "DIR.SET.MULT.GROUP.ADDRESS" in topic 3.3.17. + +
Copyright IBM Corp. 1986, 1996
+<page_number>3.3.12 - 1</page_number> + +--- + + +## Page 156 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DIR.RESTORE.OPEN.PARMS + +3.3.13 DIR.RESTORE.OPEN.PARMS + +``` ++--- Hex 02 --------------------------------------------------------+ +| | +| DIR.RESTORE.OPEN.PARMS | +| | ++-----------------------------------------------------------------+ +``` + +**Command Description:** This command is for CCB1 only. It is used to restore adapter open parameter values modified by the DIR.MODIFY.OPEN.PARMS command. + +**Command Specifics:** This command is rejected with a X'06' return code if a DIR.MODIFY.OPEN.PARMS has not previously been issued and completed successfully. + +No parameter table is required. The parameter table pointer field is used as adapter work space. + +**Valid Return Codes:** See "CCB Return Codes Listed by Command" in topic B.2.1. + +
Copyright IBM Corp. 1986, 1996 +3.3.13 - 1
+ +--- + + +## Page 157 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DIR.SET.EXCEPTION.FLAGS + +3.3.14 DIR.SET.EXCEPTION.FLAGS + ++---- Hex 2D ----------------------------------------+ +| DIR.SET.EXCEPTION.FLAGS | ++----------------------------------------------------+ + +**Command Description:** This command is for CCB2 and CCB3 only. It defines user notification appendages and flags if an application program wants to be notified of exception conditions. + +**Command Specifics:** This command is executed entirely in the workstation. The return code is available to the application program upon return from the protocol driver. If the appendages or flags are 0, the appendage flag is not defined and the application program will not be notified of the exception condition. + +**Valid Return Codes:** See "CCB Return Codes Listed by Command" in topic B.2.1. + +**Parameters:** + +Table 3-18. CCB Parameter Table for DIR.SET.EXCEPTION.FLAGS. See "Exception Indications" in topic B.6 for more information. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OffsetParameter NameByte Length8086 TypeDescription
For CCB2:
0ADAPTER_CHECK_FLAG4DDUser notification flag for adapter check
4NETWORK_STATUS_FLAG4DDUser notification flag for network status
8PC_ERROR_FLAG4DDUser notification flag for workstation errors
12SYSTEM_ACTION_FLAG4DDUser notification flag for system action
For CCB3:
0ADAPTER_CHECK_APPNDG_OFFSET2DWOffset to the adapter check appendage
22DWReserved for the application program
4NETWORK_STATUS_APPNDG_OFFSET2DWOffset to the network status appendage
62DWReserved for the application program
8PC_ERROR_APPNDG_OFFSET2DWOffset to the workstation error appendage
102DWReserved for the application program
+ +Copyright IBM Corp. 1986, 1996 +3.3.14 - 1 + +--- + + +## Page 158 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DIR.SET.EXCEPTION.FLAGS + + + + + + + + + + + + + + + + +
12SYSTEM_ACTION_APPNDG_OFFSET2DWOffset to the system action appendage
142DWReserved for the application program
+ +**For CCB2:** The flag parameters are used to request that information relating to exception events be passed to the application program. You should issue this command right after issuing the DIR.OPEN.ADAPTER command if the application program is to be notified of any exception conditions. A READ command should then be issued with EVENT_SET bits 4 and 5 on. Whenever a critical exception or non-critical exception occurs, this READ command is executed, and the posting event and event error code will be returned from the protocol driver. + +**For CCB3:** These offsets to application program appendages are used to request that information relating to exception events be passed to the application program. These parameters will consist of a 2-byte offset for the exception appendage that is passed in register DI to the application program when the protocol driver calls the application program. You should issue this command right after issuing DIR.OPEN.ADAPTER if the application program is to be notified of any exception conditions. + +
Copyright IBM Corp. 1986, 1996 +3.3.14 - 2
+ +--- + + +## Page 159 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DIR.SET.FUNCTIONAL.ADDRESS + +3.3.15 DIR.SET.FUNCTIONAL.ADDRESS + +``` ++---- Hex 07 ---------------------------------------------+ +| | +| DIR.SET.FUNCTIONAL.ADDRESS | +| | ++--------------------------------------------------------+ +``` + +**Command Description:** This command sets the functional addresses for the adapter to receive messages. This command can be used to change (reset) the functional address values that were set earlier. + +**Command Specifics:** If the most significant bit of the functional address field is Off (0), the bits in the adapter functional address corresponding to the bits provided in the functional address field of the CCB are set On. If the most significant bit of the field is On (1), the bits in the adapter functional address corresponding to the bits provided in the functional address field are reset. Depending on the LAN adapter, it may or may not be possible to set bit 1. Bits 31 and 0 are not affected by this command but are set by the adapter. + +**For NDIS Adapters, All CCBs:** Although not all NDIS adapters support functional addresses, the DIR.SET.FUNCTIONAL.ADDRESS command is accepted when an NDIS adapter is used. The FUNCTIONAL_ADDR parameter of the DIR.OPEN.ADAPTER command is also accepted. Instead of setting a bit in the functional address, the protocol driver adds one group address for each separate bit set in the functional address. For example, if bits 6 and 7 of byte 5 of the functional address are set, then 2 group addresses are added. One group address has bit 6 of its byte 5 set, and the other group address has bit 7 of its byte 5 set. Each group address represents one of the 2 functional address bits. + +The functional address is visible as the FUNCTIONAL_ADDRESS parameter of DIR.STATUS. For CCB1, the group addresses that are serving as functional addresses are not visible in the GROUP_ADDRESS_LIST table pointed to by the GROUP_ADDRESS_LIST_ADDR parameter of the DIR.STATUS extended status table. Therefore, to calculate the number of group addresses serving to identify functions, count the bits set in the functional address parameter. + +For example, if the functional address parameter of DIR.STATUS shows 2 bits set, 2 of the group addresses available are being used to identify functions. + +The broadcast address X'C000 FFFF FFFF' is set by the IBM NDIS MAC driver so that existing token-ring applications which use this broadcast address will not need to be changed. + +The code keeps track of the number of remaining multiple group addresses, and if the number of bits to be set by the DIR.SET.FUNCTIONAL.ADDRESS command exceeds the number of available multiple group addresses, the command is not executed and a return code of X'1E' is posted in the CCB. + +**For CCB1:** The functional address bits to be changed are placed in the CCB_PARM_TAB field, but are formatted as DB. The least significant bit is ignored and both the least and most significant bit are always set to 0 in the adapter. For example, X'FFFFFFFF' resets all functional address bits, or X'00000060' sets bits 5 and 6. + +**For CCB2 and CCB3:** The functional address bits to be set or reset are placed in the CCB_PARM_OFFSET and CCB_PARAMETER_1 fields but are formatted as DB. For example, X'00000060' sets bits 5 and 6, or X'80000040' resets bit 6. + +This command can be issued by a system administrator using the System Key as defined by the configuration parameters. + +This function is provided to allow an application program to set bits of the functional address. Bits that have been previously set by application programs are the only bits that can be reset without the System Key. The bits set by the configuration parameters cannot be reset without the System Key. The System Key, if used, should be coded in the CCB_PARAMETER_2 field. + +Application programs affected by a DIR.SET.FUNCTIONAL.ADDRESS command issued with the System Key can be notified of the event. See "System Action Exceptions for OS/2 EE 1.3" in topic B.15 for more information. + +For Ethernet adapters, because functional addresses are treated as multicast addresses by Ethernet adapters, only one functional (multicast) address can be enabled at a time. + +**Valid Return Codes:** See "CCB Return Codes Listed by Command" in topic B.2.1. + +
Copyright IBM Corp. 1986, 1996
+<page_number>3.3.15 - 1</page_number> + +--- + + +## Page 160 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DIR.SET.GROUP.ADDRESS + +3.3.16 DIR.SET.GROUP.ADDRESS + +``` ++---- Hex 06 ---------------------------------------------+ +| | +| DIR.SET.GROUP.ADDRESS | +| | ++--------------------------------------------------------+ +``` + +**Command Description:** This command sets the group address for which the adapter will receive messages. This command can be used to change the group address value that was set earlier. + +**Command Specifics:** If no group address is desired, set the value to X'00000000'. + +**For CCB1:** The group address to be set is placed in the CCB_PARM_TAB field but is formatted as DB. + +**For CCB2 and CCB3:** The group address to be set is placed in the CCB_PARM_OFFSET field but is formatted as DB. This command can only be issued by a system administrator using the System Key as defined by the configuration parameters. The System Key should be coded in the CCB_PARAMETER_2 field. + +Application programs affected by a DIR.SET.GROUP.ADDRESS can be notified of the event. See "System Action Exceptions for OS/2 EE 1.3" in topic B.15 for more information. + +**For Ethernet Adapters:** The group address will be set using the NDIS AddMulticastAddress command. If there was a previous group address in use by this adapter, an NDIS Delete Multicast Address command will be issued first. + +**Valid Return Codes:** See "CCB Return Codes Listed by Command" in topic B.2.1. + +
Copyright IBM Corp. 1986, 1996
+<page_number>3.3.16 - 1</page_number> + +--- + + +## Page 161 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DIR.SET.MULT.GROUP.ADDRESS + +3.3.17 DIR.SET.MULT.GROUP.ADDRESS + +``` ++---- Hex 41 -----------------------------------------------+ +| | +| DIR.SET.MULT.GROUP.ADDRESS | +| | ++----------------------------------------------------------+ +``` + +**Command Description:** This command is not available with some of the earlier IBM LAN support software. It supports NDIS adapters that can maintain more than one group address. The LAN Support Program supports up to 64 group addresses per adapter using multiple group address support. + +**Command Specifics:** The DIR.SET.MULT.GROUP.ADDRESS command is used to set multiple group addresses (one at a time). The number of addresses up to 64 that can actually be set depends on the number of group addresses that the adapter supports. For example, if an adapter supports a total of 12 group addresses, one group address is used as a broadcast address, so 11 group addresses are available to the application program. + +The DIR.SET.GROUP.ADDRESS command and either of the commands DIR.SET.MULT.GROUP.ADDRESS or DIR.RESET.MULTIPLE.GROUP.ADDRESS cannot be used together in one session. If an application program issues a DIR.SET.MULT.GROUP.ADDRESS command or a DIR.RESET.MULT.GROUP.ADDRESS command, and it then attempts to issue a DIR.SET.GROUP.ADDRESS command, it receives the return code X'01' Invalid command. The DIR.SET.GROUP.ADDRESS command cannot be used again until a DIR.CLOSE.ADAPTER or DIR.INITIALIZE command is issued. + +On the other hand, once an application program has issued a DIR.SET.GROUP.ADDRESS command, the DIR.SET.MULT.GROUP.ADDRESS and the DIR.RESET.MULT.GROUP.ADDRESS commands are returned with an X'01' Invalid command return code until a DIR.CLOSE.ADAPTER or DIR.INITIALIZE command is issued. + +The group address set by the DIR.OPEN.ADAPTER command is reported in the 4-byte group address field of the DIR.STATUS CCB parameter table and in the GROUP_ADDRESS_LIST of the DIR.STATUS extended status table. This group address is replaced if the application program issues a DIR.SET.GROUP.ADDRESS command, but it is still valid after a DIR.SET.MULT.GROUP.ADDRESS or DIR.RESET.MULT.GROUP.ADDRESS command unless the DIR.RESET.MULT.GROUP.ADDRESS command resets the address or sets the RESET_ALL_FLAG. + +The LAN Support Program filters the setting of the all-stations broadcast address. The value of the all-stations broadcast address is X'FFFF FFFF FFFF' for all adapters and X'C000 FFFF FFFF' to address only adapters that conform to the IEEE 802.5 standard. A return code of X'36' Not a valid group address is returned if the application program attempts to use the DIR.SET.MULT.GROUP.ADDRESS command to set either one of these all-stations broadcast addresses, which are recognized by the adapter hardware and are not considered group addresses. + +The group addresses supplied in the DIR.SET.MULT.GROUP.ADDRESS and DIR.RESET.MULT.GROUP.ADDRESS commands are checked to make sure the Individual/Group (I/G) bit is set (for Group). If it is not set, the command is returned with an X'36' return code. If the I/G bit is set and the group address value is not within the range acceptable for the adapter, the command also returns an X'36' return code. + +If the address to be added has been added previously, a return code of X'00' Operation was completed successfully is returned. + +Table 3-19 describes the parameter table associated with the DIR.SET.MULT.ADDRESS command. + +``` ++----------------------------------------------------------+ +| Table 3-19. DIR.SET.MULT.GROUP.ADDRESS Parameter Table for CCB1 | ++----------------------------------------------------------+ +| Offset | Parameter Name | Byte | 8086 | Description | +| | | Length | Type | | ++--------+----------------+------+-------+-------------+ +| 0 | GROUP_ADDRESS | 6 | DB | Group address | ++--------+----------------+------+-------+-------------+ +| 6 | Reserved | 2 | DW | Should be set to 0 | ++--------+----------------+------+-------+-------------+ +``` + +**Notes:** + +1. The DIR.SET.GROUP.ADDRESS and DIR.OPEN.ADAPTER commands currently implemented by the LAN Support Program Version 1.2 support only a 4-byte group address. The DIR.SET.MULT.GROUP.ADDRESS and DIR.RESET.MULT.GROUP.ADDRESS commands require a 6-byte group address. + +2. If the Functional Address Indicator Bit of the GROUP_ADDRESS parameter is not set when using the DIR.SET.GROUP.ADDRESS and DIR.OPEN.ADAPTER commands, the LAN Support Program automatically sets it. This bit is not automatically set for the DIR.SET.MULT.GROUP.ADDRESS and DIR.RESET.MULT.GROUP.ADDRESS commands. + +**Valid Return Codes:** See "CCB Return Codes Listed by Command" in topic B.2.1. + +
Copyright IBM Corp. 1986, 1996
+<page_number>3.3.17 - 1</page_number> + +--- + + +## Page 162 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DIR.SET.USER.APPENDAGE + +3.3.18 DIR.SET.USER.APPENDAGE + +``` ++---- Hex 2D ---------------------------------------------+ +| | +| DIR.SET.USER.APPENDAGE | +| | ++--------------------------------------------------------+ +``` + +**Command Description:** This command is for CCB1 only. It changes the appendage addresses set by the DIR.OPEN.ADAPTER, DIR.INITIALIZE, and DIR.MODIFY.OPEN.PARMS commands. + +**Command Specifics:** This command sets the appendage addresses as defined in the CCB parameter table if the CCB_PARM_TAB field value is other than 0. If the CCB_PARM_TAB field is set to 0, the appendage addresses are restored to their values before the last DIR.SET.USER.APPENDAGE command was completed successfully. + +This command can be issued only when the adapter is open. If the adapter was opened with an OPEN_LOCK, this command takes no action and is executed with a return code of X'00'. This command is executed entirely by the protocol driver in the workstation. Therefore, the command completion appendage is not required, as the command is complete upon return. However, the command completion appendage is taken if provided. + +**Valid Return Codes:** See "CCB Return Codes Listed by Command" in topic B.2.1. + +**Parameters:** + +``` ++--------------------------------------------------------+ +| Table 3-20. CCB Parameter Table for DIR.SET.USER.APPENDAGE | ++--------------------------------------------------------+ +| Offset | Parameter Name | Byte | 8086 | Description | +| | | Length | Type | | ++--------+----------------+--------+------+-------------------+ +| 0 | ADPT_CHK_EXIT | 4 | DD | I/O appendage, adapter | +| | | | | check | ++--------+----------------+--------+------+-------------------+ +| 4 | NETW_STATUS_EXIT | 4 | DD | I/O appendage, network | +| | | | | status change | ++--------+----------------+--------+------+-------------------+ +| 8 | PC_ERROR_EXIT | 4 | DD | I/O appendage, error in | +| | | | | workstation | ++--------+----------------+--------+------+-------------------+ +``` + +See the parameter descriptions of the DIR.OPEN.ADAPTER command beginning on topic 3.3.9. + +
Copyright IBM Corp. 1986, 1996
+<page_number>3.3.18 - 1</page_number> + +--- + + +## Page 163 + +3.3.19 DIR.STATUS + ++---- Hex 21 -----------------------------------------------+ +| DIR.STATUS | ++----------------------------------------------------------+ + +**Command Description:** This command reads the general status information. + +**Command Specifics:** This command is executed entirely in the workstation. The return code is available to the application program upon return from the protocol driver. + +**Note:** This command can be issued before the DIR.OPEN.ADAPTER command, but after the DIR.INITIALIZE command. The System Key is not required when this command is issued before the DIR.OPEN.ADAPTER command. + +**For CCB1:** The status information is pointed to by the address in the CCB_PARM_TAB field when the command is completed. + +**For CCB2 and CCB3:** The status information is pointed to by the offset in the CCB_PARM_OFFSET field when the command is completed. + +If a valid CCB_APPL_ID is not being used, only polling of the CCB_RETCODE can be used for posting of the command completion. In this case, a successful completion results in a return code of X'0C'. If a valid CCB_APPL_ID is used, this command can be posted like any other command. A successful completion results in a return code of X'00'. + +**Valid Return Codes:** See "CCB Return Codes Listed by Command" in topic B.2.1. + +**Parameters:** + +Table 3-21. CCB Parameter Table for DIR.STATUS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OffsetParameter NameByte Length8086 TypeDescription
0ENCODED_ADDR6DBThe adapter's permanent encoded address *
6NODE_ADDRESS6DBThis adapter's network address *
12GROUP_ADDRESS4DBThis adapter's group address *
16FUNCTIONAL_ADDR4DBThis adapter's functional address *
20MAX_SAP1DBMaximum allowable SAPs *
21OPEN_SAP1DBNumber of SAPs open *
22MAX_STATION1DBMaximum allowable link stations *
23OPEN_STATION1DBNumber of link stations open *
24AVAIL_STATION1DBNumber of link stations available *
25ADAPTER_CONFIG1DBAdapter configuration bits *
26MICROCODE_LEVEL10DBThe adapter's microcode level *
For CCB1:
36ADAPTER_PARMS_ADDR4DDShared RAM address of adapter parms **
40ADAPTER_MAC_ADDR4DDShared RAM address of adapter MAC buffer **
44TICK_CNTR_ADDR4DDAddress of the timer tick counter *
48LAST_NTWK_STATUS2DWMost recent network status issued *
+ +<page_number>3.3.19 - 1</page_number> + +--- + + +## Page 164 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DIR.STATUS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
50EXTENDED_STATUS_ADR4DDAddress of the extended status table
For CCB2:
36ADAPTER_PARMS_ADDR4DDAddress of adapter parms *
40ADAPTER_MAC_ADDR4DDAddress of adapter MAC buffer *
44TICK_CNTR_ADDR4DDAddress of the timer tick counter *
48LAST_NTWK_STATUS2DWMost recent network status issued *
50ADAPTER_TYPE2DWNetwork adapter type *
For CCB3:
36ADAPTER_PARMS_ADDR4DDAddress with GDT selector of adapter parms *
40ADAPTER_MAC_ADDR4DDAddress with GDT selector of adapter MAC buffer *
44TICK_CNTR_ADDR4DDAddress with GDT selector of the timer tick counter *
48LAST_NTWK_STATUS2DWMost recent network status issued *
50ADAPTER_TYPE2DWNetwork adapter type *
* All entries are returned by the protocol driver to the parameter table in workstation memory.
** This parameter is not set on Ethernet.
Note: The ADAPTER_PARMS_ADDR parameter is returned for CCB1 when the supported adapter is a Token-Ring Network adapter and is not returned when the supported adapter is an Ethernet adapter.
+ +ENCODED_ADDR +Explanation: The permanent address encoded on the adapter. + +NODE_ADDRESS +Explanation: +For CCB1: The adapter's network address as set by the DIR.OPEN.ADAPTER command. +For CCB2 and CCB3: The adapter's network address as set by the configuration parameters. + +GROUP_ADDRESS +Explanation: The adapter's group address. + +FUNCTIONAL_ADDR +Explanation: The adapter's functional address. + +MAX_SAP +Explanation: The maximum number of SAPs allowed. + +OPEN_SAP +Explanation: The number of SAPs that have been opened by DLC.OPEN.SAP commands. + +MAX_STATION +Explanation: +For CCB1: The maximum number of link stations allowed as set by the DIR.OPEN.ADAPTER command. + +Copyright IBM Corp. 1986, 1996 +3.3.19 - 2 + +--- + + +## Page 165 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DIR.STATUS + +For CCB2 and CCB3: The maximum number of link stations allowed as set by the configuration parameters. + +OPEN_STATION + +Explanation: The number of link stations that have been opened by DLC.OPEN.STATION commands or the DLC.CONNECT.STATION command as a result of receiving a SABME. + +AVAIL_STATION + +Explanation: The number of link stations that have not been previously reserved by DLC.OPEN.SAP or DLC.REALLOCATE commands. + +ADAPTER_CONFIG + +Explanation: Following are the descriptions of the adapter configuration bits: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BitsDescription
7For CCB1: The Original PC Network Adapter is present.
For CCB2 and CCB3: Reserved.
6Reserved.
5For CCB1: This bit indicates that extended status information is being requested. If this bit is set to 1 when the DIR.STATUS command is issued, the protocol driver will return the address of the extended status table at offset 50 of the CCB parameter table.
Note: If the extended status function is not supported, the value in offset 50 of the CCB parameter table will not be changed. To ensure the pointer is valid, the user should set it to 0 when building the CCB, and check it for a non-0 value on return.
4Token release: This bit is only available for 16/4 adapters when operating at 16 Mbps. If not set, 16-Mbps adapters will get early token release; that is the default. Setting this bit on selects no early token release for an adapter operating at 16 Mbps.
3-2For IBM Token-Ring Network Adapters with shared RAM, bits 3-2 represent the KBs of shared RAM mapped into workstation memory. (B'00'=8 KB, B'01'=16 KB, B'10'=32 KB, and B'11'=64 KB. For example, if bits 3 and 2 are 0 and 1, respectively, then shared RAM size is 16 KB.)
Note: In the case of a 4/16 adapter with RAM paging active, the size of shared RAM mapped into memory is 16 KB, while the bits would indicate 64 KB -- the size of RAM on the card.
1Reserved.
0Adapter data rate (0=4 Mbps and 1=16 Mbps).
+ +MICROCODE_LEVEL + +Explanation: The number representing the engineering level of the adapter microcode. Table 3-22 shows its structure. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 3-22. MICROCODE_LEVEL Fields
OffsetByte LengthDescription
04Microcode engineering level
42Device driver version
62Device driver revision level
820s
+ +ADAPTER_PARMS_ADDR + +Explanation: The address of a workstation read-only region of adapter parameters. + +See "Adapter Status Parameter Table" in topic B.5 for the parameter table layout. + +For CCB2: An entry for this memory segment is made into the LDT of the process that issues this command. Only the process that issues this command will have access to this memory area. + +For CCB3: This memory segment has been mapped in the GDT. + +ADAPTER_MAC_ADDR + +Copyright IBM Corp. 1986, 1996 +3.3.19 - 3 + +--- + + +## Page 166 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DIR.STATUS + +**Explanation:** The address of a workstation read-only region of adapter MAC buffer. + +**For CCB2:** An entry for this memory segment is made into the LDT of the process that issues this command. Only the process that issues this command will have access to this memory area. + +**For CCB3:** This memory segment has been mapped in the GDT. + +--- + +TICK_CNTR_ADDR + +**Explanation:** + +**For CCB1:** The address of a 4-byte field containing the number of 100-ms timer interrupts received from the adapter's timer since the last DIR.INITIALIZE command. The tick counter can be read, but should not be written. + +**For CCB2:** The address of a 4-byte field containing the number of 100-ms timer interrupts received from the adapter's timer since the last physical open by a DIR.OPEN.ADAPTER command. The tick counter can be read, but should not be written. + +An entry for this memory segment is made into the LDT of the process that issues this command. Only the process that issues this command will have access to this memory area. + +**For CCB3:** The address of a 4-byte field containing the number of 100-ms timer interrupts received from the adapter's timer since the last physical open by a DIR.OPEN.ADAPTER command. The tick counter can be read, but should not be written. + +This memory segment has been mapped in the GDT. + +--- + +LAST_NTWK_STATUS + +**Explanation:** The most recent network status change. See "Network Status" in topic B.10 for an explanation of the network status bytes. + +--- + +EXTENDED_STATUS_ADDR + +**Explanation:** + +**For CCB1:** The address of a table containing additional status information. Refer to the following table (Table 3-23) for the table layout. Extended status is not supported on the original PC Network Adapter. + +**Parameters:** Note that all values are returned values. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 3-23. Extended Status Table
OffsetParameter NameByte Length8086 TypeDescription
0EXT_TABLE_LENGTH1DBThe length of the table in bytes.
1RAM_PAGE_FRAME_SIZE1DBThe RAM page frame size in KB.
2ADAPTER_TYPE2DWA hexadecimal value indicating the type of network adapter installed.
4CURRENT_DHB_SIZE2DWThe current data holding buffer (DHB) length in bytes.
6MAXIMUM_DHB_SIZE2DWThe maximum DHB length in bytes.
8RING_UTILIZATION2DWThe ring utilization retrieved from the network.
10GROUP_ADDR_LIST_ADDR4DDAddress of the GROUP_ADDRESS_LIST table.
14LLC_TYPE1DBIn LAN Support Program 1.33 and higher, this byte is X'01' when the protocol is running on an NDIS MAC driver.
+ +
Copyright IBM Corp. 1986, 1996
+<page_number>3.3.19 - 4</page_number> + +--- + + +## Page 167 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DIR.STATUS + +ADAPTER_TYPE + +Explanation: + +For CCB1: This parameter is returned by the DIR.STATUS command only if bit 5 of the ADAPTER_CONFIG byte is set to 1 when the command is issued. It is returned as a parameter in the Extended Status Table. + +For CCB2 and CCB3: This parameter is returned in the CCB Parameter Table. + +The following list defines the values of the parameter. + +X'0001' IBM Token-Ring Network PC Adapter +X'0002' IBM Token-Ring Network PC Adapter II +X'0004' IBM Token-Ring Network Adapter/A +X'0008' IBM Token-Ring Network PC Adapter II +X'0010' Unknown or OEM token-ring adapter +X'0011' IBM Token-Ring Network 16/4 Busmaster Server Adapter/A +X'0012' IBM LANStreamer(*) MC 32 Adapter +X'0020' IBM Token-Ring Network 16/4 Adapter +X'0040' IBM Token-Ring Network 16/4 Adapter/A +X'4000' IBM PC Network Adapter +X'8000' IBM PC Network Adapter/A +X'0100' Ethernet adapters +X'0200' 3174 Peer Communication +X'0300' Reserved +X'0400' FDDI Adapters +X'0401' IBM FDDI Adapters +X'0500' Reserved + +GROUP_ADDRESS_LIST + +Explanation: The GROUP_ADDRESS_LIST is always valid even if the application program is using only the single group address implementation (for example, DIR.SET.GROUP.ADDRESS). + +A group address set by the DIR.OPEN.ADAPTER command is reported in the GROUP_ADDRESS parameter of the DIR.STATUS parameter table as currently defined in the IBM LAN Technical Reference. This group address is also duplicated in the GROUP_ADDRESS_LIST table described in Table 3-24. However, this 4-byte group address field is maintained only if single group addressing is done. This field is not valid (or is not maintained) when implementing multiple group addressing. + +Table 3-24. GROUP_ADDRESS_LIST + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OffsetParameter NameByte Length8086 TypeDescription
0MAX_NUM_GRP_ADDRESSES2DWMaximum number of group addresses
2NUM_SINGLE_GRP_ADDRESSES2DWCurrent number of group addresses defined (N)
4GROUP_ADDRESS 16DBGroup address 1
10GROUP_ADDRESS 26DBGroup address 2
4 + ((N-1) x 6)GROUP_ADDRESS N6DBGroup address N
+ +Copyright IBM Corp. 1986, 1996 +3.3.19 - 5 + +--- + + +## Page 168 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DIR.TIMER.CANCEL + +3.3.20 DIR.TIMER.CANCEL + ++--- Hex 23 ----------------------------------------+ +| | +| DIR.TIMER.CANCEL | +| | ++-------------------------------------------------+ + +**Command Description:** This command cancels a timer that was previously initiated by a DIR.TIMER.SET command. + +**Command Specifics:** This command is executed entirely in the workstation. The return code is available to the application program upon return from the protocol driver. + +When the DIR.TIMER.CANCEL command is completed, the DIR.TIMER.SET command is terminated with a CCB_RETCODE value of X'0A', and the DIR.TIMER.SET command is not posted except for the setting of the return code. The following CCB field points to the address of the DIR.TIMER.SET command that is to be canceled. + +**For CCB1:** The CCB_PARM_TAB field. + +**For CCB2 and CCB3:** The CCB_PARM_OFFSET and CCB_PARAMETER_1 fields are combined to form a 4-byte (8086 declaration type DD) address of the timer to be canceled. + +**Valid Return Codes:** See "CCB Return Codes Listed by Command" in topic B.2.1. + +
Copyright IBM Corp. 1986, 1996 +3.3.20 - 1
+ +--- + + +## Page 169 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DIR.TIMER.CANCEL.GROUP + +3.3.21 DIR.TIMER.CANCEL.GROUP + +``` ++---- Hex 2C --------------------------------------------------------+ +| | +| DIR.TIMER.CANCEL.GROUP | +| | ++-------------------------------------------------------------------+ +``` + +**Command Description:** This command cancels a group of timer commands that were previously initiated by DIR.TIMER.SET commands. + +**Command Specifics:** This command is executed entirely in the workstation. The return code is available to the application program upon return from the protocol driver. + +**For CCB1:** The CCB_PARM_TAB field points to the address of a timer completion appendage. All timers that have that address as a timer completion appendage are terminated with a return code of X'0A'. When the DIR.TIMER.SET command is terminated, the command completion appendage is not taken. All canceled CCBs will be pointed to by the CCB_POINTER field of the DIR.TIMER.CANCEL.GROUP command. This command can be issued while the adapter is closed. + +**For CCB2:** The DIR.TIMER.CANCEL.GROUP command's CCB_PARM_OFFSET and CCB_PARAMETER_1 fields contain a TIMER_CMPL_FLAG. All timer set commands that have been issued with their CCB_CMPL_FLAG equal to the TIMER_CMPL_FLAG will be canceled with a CCB_RETCODE of X'0A'. + +No command completion is done for the DIR.TIMER.SET commands other than setting the CCB_RETCODE to X'0A'. The DIR.TIMER.SET command's CCBs are chained using the CCB_POINTER field of the DIR.TIMER.CANCEL.GROUP command CCB. + +**For CCB3:** The DIR.TIMER.CANCEL.GROUP command's CCB_PARM_OFFSET and CCB_PARAMETER_1 fields contain a TIMER_CMPL_OFFSET. This offset is used to specify the address of the command completion appendage (CCB_APPNDG_OFFSET) of all pending DIR.TIMER.SET commands that are to be canceled. These commands will be canceled with a CCB_RETCODE of X'0A'. + +No command completion is done for the DIR.TIMER.SET commands other than setting the CCB_RETCODE to X'0A'. The DIR.TIMER.SET command's CCBs are chained using the CCB_POINTER field of the DIR.TIMER.CANCEL.GROUP command CCB. + +**Valid Return Codes:** See "CCB Return Codes Listed by Command" in topic B.2.1. + +
Copyright IBM Corp. 1986, 1996
+<page_number>3.3.21 - 1</page_number> + +--- + + +## Page 170 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DIR.TIMER.SET + +3.3.22 DIR.TIMER.SET + ++---- Hex 22 ----------------------------------------------------------+ +| | +| DIR.TIMER.SET | +| | ++---------------------------------------------------------------------+ + +**Command Description:** This command sets a special programmable timer to expire in some multiple of half-second periods. On the PC Network and Ethernet, the value is not actually half-seconds, but 491.5-ms periods: +☐ For the Token-Ring Network: From 0 to 13 107 (109 minutes) +☐ For the PC Network: From 0 to 13 107 (107.3 minutes) +☐ For Ethernets: From 0 to 13 107 (109 minutes, on average). + +The timer expires after the next tick if the value is set to 0. + +**Command Specifics:** + +**For CCB1:** The timer value is coded in the first 2 bytes of the CCB_PARM_TAB field. + +When the specified time expires, the command completes with the CCB_RETCODE set to X'00'. + +This command can be issued any time after the adapter has been initialized while the adapter is either open or closed, but if a command follows that changes the adapter open or closed state, all pending timers will be canceled. The number of timers that can be set is limited only by the number of commands that are pending. + +**For CCB2:** The timer value is coded in the CCB_PARM_OFFSET field. + +When the allotted time expires, the command is executed, as defined by the CCB_CMPL_FLAG and the CCB_SEMAPHORE parameters with the CCB_RETCODE set to X'00'. + +**For CCB3:** The timer value is coded in the CCB_PARM_OFFSET field. + +When the allotted time expires, the command completion appendage is called, if defined. The CCB_RETCODE is set to X'00'. + +**Valid Return Codes:** See "CCB Return Codes Listed by Command" in topic B.2.1. + +
Copyright IBM Corp. 1986, 1996
+<page_number>3.3.22 - 1</page_number> + +--- + + +## Page 171 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DLC.CLOSE.SAP + +3.3.23 DLC.CLOSE.SAP + ++--- Hex 16 ---------------------------------------------+ +| DLC.CLOSE.SAP | ++--------------------------------------------------------+ + +**Command Description:** This command closes (deactivates) a SAP. + +**Command Specifics:** If any station associated with the SAP is open, the command terminates with a CCB_RETCODE of X'47'. The SAP cannot close unless all link stations are closed. + +If an error code X'47' occurs when a DLC.CLOSE.SAP command closely follows a DLC.CLOSE.STATION command for the last open station for that SAP, reissue the DLC.CLOSE.SAP command. + +If a RECEIVE command is pending for the SAP, it terminates with a return code of X'0A', and the RECEIVE command's CCB address is placed in the CCB_POINTER field of the command CCB. + +**For CCB1:** The station ID of the SAP to be closed is placed in the first 2 bytes of the CCB_PARM_TAB field, and the second 2 bytes are reserved. + +If a RECEIVE command is pending, the command completion appendage of the RECEIVE command is not taken, but the CCB of the RECEIVE command is returned to the application program in the CCB_POINTER field of the DLC.CLOSE.SAP command. + +**For CCB2:** The station ID of the SAP to be closed is placed in the CCB_PARM_OFFSET field. If a link station is still open for this SAP, the station ID (of the link station not closed) is returned in the CCB_PARAMETER_1 field. + +If a RECEIVE command is pending for the SAP, it is not put on the completion list. A semaphore is not cleared to post its command completion. If the application program wants to receive pointers to all pending CCBs for this SAP, the CCB_CMPL_FLAG of the DLC.CLOSE.SAP command must be set. When a READ command is issued or if one is pending that requests notification of command completions, it posts the completed DLC.CLOSE.SAP command. The outstanding data area pointers are returned in the parameter table of the READ command. If a READ command is not already pending or if one is not chained to the CCB_POINTER field to post the DLC.CLOSE.SAP when it is completed, the DLC.CLOSE.SAP command completion event is placed on a completion queue. Because the SAP was closed when this command was executed successfully, the only way to retrieve the event is by issuing a READ command with the OPTION_INDICATOR field set to match on all events. This event cannot be retrieved by posting a READ with the OPTION_INDICATOR set to match on the SAP that was closed, since it is no longer valid. + +**For CCB3:** The station ID of the SAP to be closed is placed in the CCB_PARM_OFFSET field. If a link station is still open for this SAP, the station ID (of the link station not closed) is returned in the CCB_PARAMETER_1 field. + +If a RECEIVE command is pending, the command completion appendage of the RECEIVE command is not taken, but the CCB of the RECEIVE command is returned to the application program in the CCB_POINTER field of the DLC.CLOSE.SAP command. In addition to the RECEIVE command, buffers from the SAP buffer pool also return in the information table. + +**Valid Return Codes:** See "CCB Return Codes Listed by Command" in topic B.2.1. + +
Copyright IBM Corp. 1986, 1996
+<page_number>3.3.23 - 1</page_number> + +--- + + +## Page 172 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DLC.CLOSE.STATION + +3.3.24 DLC.CLOSE.STATION + +``` ++---- Hex 1A --------------------------------------------------------+ +| | +| DLC.CLOSE.STATION | +| | ++-------------------------------------------------------------------+ +``` + +**Command Description:** This command closes (deactivates) a link station. + +**Command Specifics:** If this command is issued while the ring is beaconing, it cannot complete until the ring is no longer beaconing. Refer to the IBM Token-Ring Network Architecture Reference for a description of ring beaconing. + +**For CCB1:** The station ID of the link station to be closed is placed in the first 2 bytes of the CCB_PARM_TAB field and the second 2 bytes are reserved. + +If a RECEIVE command is pending for this link station, it terminates with a CCB_RETCODE of X'0A' and its address is placed in the CCB_POINTER of the DLC.CLOSE.STATION command. + +The CCB_CMD_CMPL appendage of the RECEIVE command is not taken. Any pending TRANSMIT commands are aborted immediately. + +**For CCB2:** The station ID of the link station to be closed is placed in the CCB_PARM_OFFSET field. + +If a RECEIVE command is pending for this link station, it terminates with a CCB_RETCODE of X'0A' and its address is placed in the CCB_POINTER of the DLC.CLOSE.STATION command. + +No command completion notification occurs for the RECEIVE command other than setting the return code. If the application program wants to receive pointers to all pending CCBs for this station, the CCB_CMPL_FLAG of the DLC.CLOSE.STATION command must be set. When a READ command is issued or if one is pending that requests notification of command completions, it posts the completed DLC.CLOSE.STATION command. The outstanding data area pointers are returned in the parameter table of the READ command. If a READ command is not already pending or if one is not chained to the CCB_POINTER field to post the DLC.CLOSE.STATION when it is completed, the DLC.CLOSE.STATION command completion event is placed on a completion list. Since the link station was closed when this command was completed successfully, the only way to retrieve the event is by issuing a READ command with the OPTION_INDICATOR field set to match on all events or to match on the SAP that owned the link station. This event cannot be retrieved by posting a READ with the OPTION_INDICATOR set to match on the link station that was closed, since it is no longer valid. + +**For CCB3:** The station ID of the link station to be closed is placed in the CCB_PARM_OFFSET field. + +If a RECEIVE command is pending, the command completion appendage of the RECEIVE command is not taken, but the CCB of the RECEIVE command is returned to the application program in the CCB_POINTER field of the DLC.CLOSE.SAP command. When a DLC.CLOSE.STATION command is issued, the RECEIVE command associated with that station terminates with a CCB_RETCODE of X'0A', and the CCB of the RECEIVE command is returned to the application program in the information table passed to the completion appendage of the DLC.CLOSE.STATION command. + +**Valid Return Codes:** See "CCB Return Codes Listed by Command" in topic B.2.1. + +
Copyright IBM Corp. 1986, 1996
+<page_number>3.3.24 - 1</page_number> + +--- + + +## Page 173 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DLC.CONNECT.STATION + +3.3.25 DLC.CONNECT.STATION + ++---- Hex 1B -----------------------------------------------+ +| DLC.CONNECT.STATION | ++-----------------------------------------------------------+ + +**Command Description:** This command starts or completes a SABME-UA exchange to place both the local and remote link stations in a data transfer state. + +**Command Specifics:** + +**For CCB1:** The CCB_PARM_TAB parameter points to the parameter table. + +**For CCB2 and CCB3:** The CCB_PARM_OFFSET parameter is the offset to the parameter table. + +**Valid Return Codes:** See "CCB Return Codes Listed by Command" in topic B.2.1. + +**Parameters:** + +Table 3-25. CCB Parameter Table for DLC.CONNECT.STATION + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OffsetParameter NameByte Length8086 TypeDescription
0STATION_ID2DWLink station ID to be connected
22DWReserved
For CCB1:
4ROUTING_ADDR4DDAddress in workstation memory of 18 bytes of network routing information
For CCB2 and CCB3:
4ROUTING_OFFSET2DWOffset in workstation memory of 18 bytes of network routing information
62DWReserved for the application program Can be used for the segment or selector.
+ +STATION_ID + +**Explanation:** This parameter is the station ID of the link station. + +ROUTING_ADDR and ROUTING_OFFSET + +**Explanation:** This parameter is the address or offset to a memory location where the routing information is found. If the remote partner for this link station is on a different ring, routing information is necessary for frames to be exchanged. If the link station was established because of a DLC.OPEN.STATION command, the routing information must be provided with this command. If the link station was established because of receipt of a SABME from the remote partner, the adapter obtains the routing information from the received frame and ignores any provided with this command. The DLC.CONNECT.STATION command can also be used to provide new routing information if there is a link failure. The information must be provided in the format in which it will be used in transmitted frames. If this field is set to 0, or if the length field of the routing information field is 0 and no SABME is pending, then the remote partner is assumed to be on the same ring. See the description of bit 10 in "DLC Status Codes" in topic B.3. Refer to the IBM Token-Ring Network Architecture Reference for more about routing information and exchange identification (XID). Also, refer to any documentation related to implementation of bridges in your network. + +Copyright IBM Corp. 1986, 1996 +3.3.25 - 1 + +--- + + +## Page 174 + +3.3.26 DLC.FLOW.CONTROL + +``` ++---- Hex 1D ---------------------------------------------+ +| DLC.FLOW.CONTROL | ++---------------------------------------------------------+ +``` + +**Command Description:** This command controls the flow of data across a specified link station on a SAP, or every link station on a SAP, by setting and resetting a local busy status. See "Link Station States" in topic 2.8.3. + +**Command Specifics:** + +**For CCB1:** The CCB_PARM_TAB field contains the station ID and the FLOW_CONTROL option byte. The station ID is the first 2 bytes, the FLOW_CONTROL (option byte) is the third byte, and the last byte is reserved. + +**For CCB2 and CCB3:** The CCB_PARM_OFFSET field contains the station ID. The CCB_PARAMETER_1 field contains the FLOW_CONTROL (option byte); the FLOW_CONTROL (option byte) is the first byte. The second byte is reserved. + +**Valid Return Codes:** See "CCB Return Codes Listed by Command" in topic B.2.1. + +**Parameters:** + +**STATION_ID** + +**Explanation:** The first 2 bytes of the CCB_PARM_TAB parameter contain either the station ID of a specific link station of a SAP or the station ID of a SAP. If the ID is a SAP ID, all the link stations on the SAP are affected. If the ID is a link station ID, only that specific station is controlled. + +**FLOW_CONTROL** + +**Explanation:** Contains bits that define options. Bit 7 is the high-order bit (leftmost bit position). Following are the complete descriptions of the FLOW_CONTROL bits: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BitsDescription
7Used to set or reset a local-busy state
☐ If this bit is off (0), the link station enters the local-busy state (bit 6 is ignored).
☐ If this bit is on (1), then the local-busy state is reset based on the condition of bit 6.
6Used to indicate the type of local-busy state that is being reset (bit 7=1).
☐ If this bit is off (0), it indicates a "user-set" local-busy state is to be reset.
☐ If this bit is on (1), it indicates a local-busy state caused by either an "out-of-receive-buffers" state, or "no-receive command-outstanding" state. The state will be reset.
0-5Reserved. These bits should be set to 0s, but are not checked by the adapter.
+ +
Copyright IBM Corp. 1986, 1996
+<page_number>3.3.26 - 1</page_number> + +--- + + +## Page 175 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DLC.MODIFY + +3.3.27 DLC.MODIFY + ++---- Hex 1C ---------------------------------------------+ +| DLC.MODIFY | ++--------------------------------------------------------+ + +**Command Description:** This command modifies certain work values of an open link station or the default values of a SAP. + +**Command Specifics:** This command allows you to alter the values without the need to close and reestablish the SAP and links. The values to be modified are contained in the parameter table pointed to by the CCB_PARM_TAB or CCB_PARM_OFFSET field. + +**For CCB1:** The CCB_PARM_TAB field points to the parameter table. + +**For CCB2 and CCB3:** The CCB_PARM_OFFSET field points to the parameter table. + +**Valid Return Codes:** See "CCB Return Codes Listed by Command" in topic B.2.1. + +**Parameters:** + +Table 3-26. CCB Parameter Table for DLC.MODIFY + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OffsetParameter NameByte Length8086 TypeDescription
02DWReserved.
2STATION_ID2DWSAP station or link station ID.
4TIMER_T11DBT1 value (response timer).
5TIMER_T21DBT2 value (acknowledgment timer).
6TIMER_TI1DBTi value (inactivity timer).
7MAXOUT1DBMaximum transmits without a receive acknowledgment.
8MAXIN1DBMaximum receives without a transmit acknowledgment.
9MAXOUT_INCR1DBDynamic window increment value.
10MAX_RETRY_CNT1DBN2 value.
113DBReserved.
14ACCESS_PRIORITY1DBRing access priority. Access priority is not recognized on the PC network or on Ethernet.
154DBReserved.
19GROUP_COUNT1DBLength of data in GROUP_LIST or GROUP_LIST_OFFSET.
For CCB1:
20GROUP_LIST4DDAddress of a list of Group SAP values.
For CCB2 and CCB3:
20GROUP_LIST_OFFSET2DWOffset to a list of group SAP values.
222DWReserved for the application program. Can be used for the segment or selector.
+ +Copyright IBM Corp. 1986, 1996 +3.3.27 - 1 + +--- + + +## Page 176 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DLC.MODIFY + +STATION_ID +Explanation: The link station ID whose working values are to be changed, or the SAP ID whose defaults are to be changed. + +TIMER_T1 +Explanation: Specifies the time period between 1 and 10 used to determine an inoperative condition on a link. The time intervals are based on the tick values specified by the DIR.OPEN.ADAPTER command or by configuration parameters. If the value is 0, the current value remains in effect. See "Timers" in topic 2.8.4 for a complete description of timers. + +TIMER_T2 +Explanation: Specifies the timer value for the T2 timer used to delay transmission of an acknowledgment for a received I-LPDU for a link station being modified in this SAP. The time intervals are based on the tick values specified by the DIR.OPEN.ADAPTER command or by configuration parameters. If the value is 0, the current value remains in effect. If the value is greater than 10, the timer is not used. See "Timers" in topic 2.8.4 for a complete description of timers. + +TIMER_Ti +Explanation: Specifies the time period between 1 and 10 used to determine an inactive condition on a link. The time intervals are defined by the DIR.OPEN.ADAPTER command or by configuration parameters. If the value is 0, the current value remains in effect. + +MAXOUT +Explanation: Specifies the maximum number of sequentially numbered, transmitted I-LPDUs that a link station associated with this SAP can have pending at any one time. The maximum valid value is 127. If the value is 0, the current value remains in effect. + +MAXIN +Explanation: Specifies the maximum number of sequentially numbered, received I-LPDUs that a link station associated with this SAP can receive prior to sending an acknowledgment. The maximum valid value is 127. If the value is 0, the current value remains in effect. + +MAXOUT_INCR +Explanation: This dynamic window increment value is used to reduce bridge congestion. If the 2 end points of the link are on different rings, and the adapter detects an error condition requiring retransmission, the MAXOUT parameter is set to 1. It is then incremented by 1 each time MAXOUT_INCR frames are acknowledged by the remote station, until it reaches the value requested by the application program. For more details, refer to the IBM Token-Ring Network Architecture Reference. If the value is 0, the current value remains in effect. + +MAX_RETRY_CNT +Explanation: Specifies the number of retries for an unacknowledged command LPDU, or in the case of an I-LPDU timeout, the number of times that the non-responding remote link station will be polled with an RR/RNR command LPDU. This count is used in conjunction with the Response timer and should be great enough to ensure time for ring error detection and recovery. This parameter also prevents continual retransmission of the same I-format LPDU. The maximum valid value is 255. If the value is 0, the current value remains in effect. + +ACCESS_PRIORITY +Explanation: The transmit access priority value to be placed in the AC byte of all transmissions from the SAP or link station. The format is B'nnn00000', where nnn is the access priority value. If the access priority is higher than that authorized for the adapter, the command terminates with a CCB_RETCODE of X'08'. Valid values for the access priority are from 0 to 3. Access priority is not recognized on the PC Network or on Ethernet. + +GROUP_COUNT +Explanation: The number, from 0 to 13, of group SAPs as defined by the GROUP_LIST or GROUP_LIST_OFFSET field. + +GROUP_LIST or GROUP_LIST_OFFSET +Explanation: This field can be used either to request membership in additional group SAPs for an individual SAP, or to request that membership be canceled. The GROUP_COUNT parameter indicates the number of valid values in this field. If the low-order bit of a SAP value is 0, membership in the corresponding group is requested. If the low-order bit of a SAP value is 1, membership is canceled. This field is ignored if the GROUP_COUNT parameter is 0. + +cms cms + +
Copyright IBM Corp. 1986, 1996
+<page_number>3.3.27 - 2</page_number> + +--- + + +## Page 177 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DLC.OPEN.SAP + +3.3.28 DLC.OPEN.SAP + ++---- Hex 15 -----------------------------------------------+ +| DLC.OPEN.SAP | ++----------------------------------------------------------+ + +**Command Description:** This command activates a SAP and reserves a number of link stations for the SAP. + +**Command Specifics:** This command can be used to define: +* An individual SAP +* A group SAP +* A SAP as a member of a group + +The application program is responsible for checking that the parameters are reasonable. + +**Valid Return Codes:** See "CCB Return Codes Listed by Command" in topic B.2.1. + +If the return code is X'45' or X'49', the SAP has been opened, but there has been some problem with the GROUP_LIST or GROUP_LIST_OFFSET parameter. + +An open for an individual SAP requesting group SAP membership for a group SAP can cause a return code of X'06' if the membership is requested in group SAPs with different types. See the bits described in the OPTIONS_PRIORITY field. If this happens, the SAP opens with membership into the group SAPs specified until the SAP type of the group SAP listed changes. All subsequent group SAPs listed after a SAP type change has been detected will not be used for membership. + +**Parameters:** + +Table 3-27. CCB Parameter Table for DLC.OPEN.SAP + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OffsetParameter NameByte Length8086 TYPEDescription
0STATION_ID2DWSAP station ID (X'nn00').*
2USER_STAT_VALUE2DWUser value passed back on DLC status.
4TIMER_T11DBT1 value (response timer).
5TIMER_T21DBT2 value (acknowledgment timer).
6TIMER_TI1DBTi value (inactivity timer).
7MAXOUT1DBMaximum transmits without a receive acknowledgment.
8MAXIN1DBMaximum receives without a transmit acknowledgment.
9MAXOUT_INCR1DBDynamic window increment value.
10MAX_RETRY_CNT1DBN2 value.
11MAX_MEMBERS1DBMaximum SAPs for a group SAP.
12MAX_I_FIELD2DWMaximum received information field.
14SAP_VALUE1DBSAP value to be assigned.
15OPTIONS_PRIORITY1DBSAP options and ring access priority. Access priority is not recognized on the PC Network or Ethernet.
16STATION_COUNT1DBNumber of link stations to reserve.
172DWReserved.
19GROUP_COUNT1DBLength of data in GROUP_LIST or
+ +Copyright IBM Corp. 1986, 1996 +3.3.28 - 1 + +--- + + +## Page 178 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DLC.OPEN.SAP + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
GROUP_LIST_OFFSET.
For CCB1:
20GROUP_LIST4DDAddress of a list of group SAP values.
24DLC_STATUS_EXIT4DDI/O appendage exit, DLC status change.
For CCB2 and CCB3:
20GROUP_LIST_OFFSET2DWOffset to a list of group SAP values.
222DWReserved for the application program. Can be used for segment or selector.
For CCB2:
24DLC_STATUS_FLAG4DDUser notification flag for DLC status changes.
For CCB3:
24DLC_STATUS_OFFSET2DWOffset of DLC status appendage.
262DWReserved for the application program. Can be used for segment or selector.
For all CCBs:
28DLC_BUF_SIZE2DWSize of buffers in pool.
30DLC_POOL_LEN2DWLength of pool buffer.
32DLC_POOL_ADDR4DDStarting address of buffer pool.
For CCB2 and CCB3:
36ADAPTER_STNS_AVAIL1DBNumber of link stations available.*
* Indicates a returned value.
+ +STATION_ID +Explanation: The station ID returned by the adapter or the protocol driver. This value is used to identify this SAP in subsequent commands. + +USER_STAT_VALUE +Explanation: +For CCB1: On entry to the DLC status appendage (defined by parameter DLC_STATUS_EXIT), this value is passed back to the user in register SI. +For CCB2: User value, passed back on DLC status change notification using the READ command's CCB parameter table. +For CCB3: User value, passed back in register SI when calling application program device driver entry point for the DLC status change appendage. + +TIMER_T1 +Explanation: Specifies the time period between 1 and 10 used to determine an inoperative condition on a link. If the value is zero, the default of 5 is used. See "Timers" in topic 2.8.4. The time intervals are defined by the DIR.OPEN.ADAPTER command or by configuration parameters. + +TIMER_T2 +Explanation: Specifies the time period between 1 and 10 used to delay transmission of an acknowledgment for a received I-LPDU for a link station in this SAP. If the value is zero, the default of 2 is used. If the value is greater than 10, the timer will not be used. See + +Copyright IBM Corp. 1986, 1996 +3.3.28 -2 + +--- + + +## Page 179 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DLC.OPEN.SAP + +"Timers" in topic 2.8.4. The time intervals are defined by the DIR.OPEN.ADAPTER command or by configuration parameters. + +**TIMER_Ti** + +**Explanation:** Specifies the time period between 1 and 10 used to determine an inactive condition on a link. If the value is zero, the default of 10 is used. See "Timers" in topic 2.8.4. The time intervals are defined by the DIR.OPEN.ADAPTER command or by configuration parameters. + +**MAXOUT** + +**Explanation:** Specifies the maximum number of sequentially numbered, transmitted I-LPDUs that the link stations using this SAP can have pending at any time. The maximum valid value is 127. If the value is zero, the default of 2 is used. + +**MAXIN** + +**Explanation:** Specifies the maximum number of sequentially numbered, received I-LPDUs that the link station using this SAP can have before sending an acknowledgment. The maximum valid value is 127. If the value is zero, the default of 1 is used. + +**MAXOUT_INCR** + +**Explanation:** This dynamic window increment value is used to reduce bridge congestion. If the two end points of the link are on different rings, and the adapter detects an error condition requiring retransmission, the MAXOUT parameter is set to 1. It is then incremented by 1 each time MAXOUT_INCR frames are acknowledged by the remote station, until it reaches the value requested by the application program. For more details, refer to the IBM Token-Ring Network Architecture Reference. If the value is zero, the default of 1 is used. + +**MAX_RETRY_CNT** + +**Explanation:** Specifies the number of retries for an unacknowledged command LPDU, or in the case of an I-LPDU timeout, the number of times that the non-responding remote link station will be polled with an RR/RNR command LPDU. This count is used in conjunction with the Response timer and should be great enough to ensure time for ring error detection and recovery. This parameter also prevents continual retransmission of the same I-format LPDU. The maximum valid value is 255. If the value is zero, the default of 8 is used. + +**MAX_MEMBERS** + +**Explanation:** The maximum number of individual SAPs that can be assigned membership in the group SAP if this SAP is to be a group SAP as well as an individual SAP. Membership in the group SAP is assigned as the member SAPs are opened. This parameter cannot exceed the similar parameter provided with the DIR.OPEN.ADAPTER command or configuration parameters, and defaults to that value if this parameter is zero. + +**MAX_I_FIELD** + +**Explanation:** This parameter is the maximum size for an I-format LPDU that can be received by this SAP's link station. It applies to the information field in received I-format LPDUs for link stations, and is ignored if STATION_COUNT is zero. If the value is zero, the default of 600 is used. + +**SAP_VALUE** + +**Explanation:** This is the value of the SAP to be assigned. The value must not be zero and the low-order bit is ignored. (In this example, "x" is the low order bit: B'nnnnnnnx'.) X'00' is invalid and X'FE' cannot be used as a group SAP. + +This is the SSAP for transmitted messages and the DSAP for received messages. See Figure 1-3 in topic 1.13 or Figure 1-7 in topic 1.14 for information about Token-Ring Network, PC Network, or Ethernet frame formats. + +**OPTIONS_PRIORITY** + +**Explanation:** Various SAP options, each represented by a bit. The bit being on (value of B'1') indicates taking the option. The high-order bit is the leftmost bit, 7. Following are the complete descriptions of the OPTIONS_PRIORITY bits: + + + + + + + + + + + + + + + + + + + + + + +
BitsDescription
7-5Ring access priority. Access priority is not recognized on the PC Network or on Ethernet, and may not be implemented on an NDIS token-ring network adapter. When using an NDIS token-ring network adapter, see your adapter documentation for more information.

The transmit access priority for a token-ring network is placed in the AC byte of all transmissions from the SAP. If the access priority is too high, the command terminates with the CCB_RETCODE set to X'08'. This value is typically B'000'.
4Reserved. It should be zero.
3XID handling option.

☐ If this bit is zero, the XID command frames are handled for this SAP by the DLC function of the adapter.
+ +
Copyright IBM Corp. 1986, 1996
+<page_number>3.3.28 - 3</page_number> + +--- + + +## Page 180 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DLC.OPEN.SAP + +If this bit is 1, the XID command frames for this SAP are passed to the application program. + +2 Individual SAP bit. If this bit is 1, the SAP is an individual SAP. The STATION_COUNT parameter must be zero if bit 2 is not 1. +1 Group SAP bit. If this bit is 1, the SAP is a group SAP. +0 Group SAP membership bit. If this bit is 1, the SAP may be a member of a group SAP. See the GROUP_COUNT and GROUP_LIST parameters. + +At least one of the bits 0, 1, and 2 must be on. Bit 0 can be on only if bit 2 is on. + +STATION_COUNT + +Explanation: The number of link stations to reserve. This parameter is to provide link station resources so that subsequent DLC.OPEN.STATION commands can be issued. + +If the requested number of stations is not available, the command terminates with a CCB_RETCODE of X'46'. + +If the value is zero, no station can be opened for the SAP. + +GROUP_COUNT + +Explanation: The number of group SAPs defined in the GROUP_LIST or GROUP_LIST_OFFSET field. If additional memberships are needed, use the DLC.MODIFY command. Valid values for the Token-Ring Network are from 0 to 8. Valid values for the PC Network and Ethernet are from 0 to 255. + +GROUP_LIST or GROUP_LIST_OFFSET + +Explanation: This field points to a list of group SAP values. The GROUP_COUNT parameter indicates the number of valid values in this field. This field is ignored if the GROUP_COUNT parameter is zero. + +For CCB1: The GROUP_LIST is the address of the list. + +For CCB2 and CCB3: The GROUP_LIST_OFFSET is an offset to the list. + +DLC_STATUS_EXIT + +Explanation: This field points to the beginning of an appendage routine provided by the application program. This routine receives control whenever DLC status changes for this SAP. See "DLC Status Codes" in topic B.3. + +DLC_STATUS_FLAG + +Explanation: This flag must be set to a non-zero value if notification is wanted when any DLC status changes for the specified SAP and associated link stations. See "DLC Status Codes" in topic B.3. + +DLC_STATUS_OFFSET + +Explanation: This offset identifies the DLC status appendage so that the application program can be notified of any changes for the specified SAP and associated link stations. This appendage offset is passed to the application program device driver entry point in register DI when the DD interface calls the application program for notification of any DLC status change. See "DLC Status Codes" in topic B.3. + +DLC_BUF_SIZE + +Explanation: The size of the buffers in the SAP buffer pool. This is the size of the entire buffer including all overhead. The size must be a multiple of 16 with a minimum size of 80. If this value is zero, the default of 160 is used. + +For CCB2 and CCB3: The maximum DLC_BUF_SIZE for OS/2 is 4000. + +DLC_POOL_LEN + +Explanation: The number of 16-byte blocks in the SAP buffer pool, which is the size of the SAP buffer pool divided by 16. + +If this value is zero, the default of 256 (4096 bytes) is used. If the DLC_POOL_ADDR is zero, this parameter is ignored. + +For CCB2 and CCB3: The maximum DLC_POOL_LEN for OS/2 is 4000. + +DLC_POOL_ADDR + +Explanation: The starting address in workstation memory where the adapter is to build the SAP buffer pool. If this value is zero, the application program has the responsibility of building the buffer pool, and the DLC_BUF_SIZE parameter must indicate the size of each buffer. + +
Copyright IBM Corp. 1986, 1996
+<page_number>3.3.28 - 4</page_number> + +--- + + +## Page 181 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DLC.OPEN.SAP + +ADAPTER_STNS_AVAIL + +**Explanation:** If the command terminates with a return code of X'46', this field contains the number of link stations currently available that have not been reserved. This SAP is not opened and no link stations are reserved for this SAP. + +
Copyright IBM Corp. 1986, 1996 +3.3.28 - 5
+ +--- + + +## Page 182 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DLC.OPEN.STATION + +3.3.29 DLC.OPEN.STATION + ++---- Hex 19 -----------------------------------------------+ +| DLC.OPEN.STATION | ++-----------------------------------------------------------+ + +**Command Description:** This command allocates resources for a link station. + +**Command Specifics:** The protocol driver performs functions to set up the link station in the adapter, but no ring communication takes place. A DLC.CONNECT.STATION command must be issued to either the local or remote link station by its application program to initiate connection-oriented communications. Thereafter, a DLC.CONNECT.STATION command must be issued at the other station to complete establishing the link. + +**Valid Return Codes:** See "CCB Return Codes Listed by Command" in topic B.2.1. + +**Parameters:** + +Table 3-28. CCB Parameter Table for DLC.OPEN.STATION + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OffsetParameter NameByte Length8086 TypeDescription
0SAP_STATION_ID2DWSAP station ID.
2LINK_STATION_ID2DWLink station ID (X'nnss'). *
4TIMER_T11DBT1 value (response timer).
5TIMER_T21DBT2 value (acknowledgment timer).
6TIMER_TI1DBTi value (inactivity timer).
7MAXOUT1DBMaximum transmits without a receive acknowledgment.
8MAXIN1DBMaximum receives without a transmit acknowledgment.
9MAXOUT_INCR1DBDynamic window increment value.
10MAX_RETRY_CNT1DBN2 value.
11RSAP_VALUE1DBThe remote SAP value.
12MAX_I_FIELD2DWMaximum received information field.
14ACCESS_PRIORITY1DBRing access priority. Access priority is not recognized on the PC network or on Ethernet.
151DBReserved
For CCB1:
16DESTINATION4DDPointer to remote station address.
For CCB2 and CCB3:
16DESTINATION_OFFSET2DWOffset to remote station address.
182DWReserved for the application program. Can be used for segment or selector.
* Indicates a returned value.
+ +Copyright IBM Corp. 1986, 1996 +3.3.29 - 1 + +--- + + +## Page 183 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DLC.OPEN.STATION + +SAP_STATION_ID +Explanation: The SAP ID value passed to the adapter. + +LINK_STATION_ID +Explanation: The link station ID value assigned by the adapter. + +TIMER_T1 +Explanation: Specifies the time period between 1 and 10 used to determine an inoperative condition on a link. If the value is zero, the default is as defined by the DLC.OPEN.SAP command. See "Timers" in topic 2.8.4. The time intervals are defined by the DIR.OPEN.ADAPTER command or by the configuration parameters. + +TIMER_T2 +Explanation: Specifies the time period between 1 and 10 used to delay transmission of an acknowledgment for a received I-LPDU for this SAP. If the value is zero, the default is as defined by the DLC.OPEN.SAP. If the value is greater than 10, the timer will not be used. See "Timers" in topic 2.8.4. The time intervals are defined by the DIR.OPEN.ADAPTER command or by the configuration parameters. + +TIMER_Ti +Explanation: Specifies the time period between 1 and 10 used to determine an inactive condition on a link. If the value is zero, the default as defined by the DLC.OPEN.SAP command is used. See "Timers" in topic 2.8.4. The time intervals are defined by the DIR.OPEN.ADAPTER command or by the configuration parameters. + +MAXOUT +Explanation: Specifies the maximum number of sequentially numbered, transmitted I-LPDUs that the link station can have pending at any time. The maximum valid value is 127. If the value is zero, the default as defined by the DLC.OPEN.SAP command is used. + +MAXIN +Explanation: Specifies the maximum number of sequentially numbered, received I-LPDUs that the link station can have before sending an acknowledgment. The maximum valid value is 127. If the value is zero, the default as defined by the DLC.OPEN.SAP command is used. + +MAXOUT_INCR +Explanation: This dynamic window increment value is used to reduce bridge congestion. If the two end points of the link are on different rings, and an error condition requiring retransmission is detected, the MAXOUT counter is set to 1. It is then incremented by 1 each time MAXOUT_INCR frames are acknowledged by the remote station, until it reaches the value requested by the application program in the MAXOUT parameter. For more details refer to the IBM Token-Ring Network Architecture Reference. If the value is zero, the default as defined by the DLC.OPEN.SAP command is used. + +MAX_RETRY_CNT +Explanation: Specifies the number of retries for an unacknowledged command LPDU, or in the case of an I-LPDU timeout, the number of times that the non-responding remote link station will be polled with an RR/RNR command LPDU. The maximum valid value is 255. If the value is zero, the default as defined by the DLC.OPEN.SAP command is used. + +RSAP_VALUE +Explanation: This is the value of the remote SAP partner. It must follow the same guidelines as the SAP_VALUE parameter of the DLC.OPEN.SAP command, and it must be an individual SAP. A group SAP cannot have a link station. + +MAX_I_FIELD +Explanation: This parameter applies to the information field in received I frames for this link station. If the value is zero, the default is as defined by the DLC.OPEN.SAP command. + +ACCESS_PRIORITY +Explanation: Specifies the transmit access priority value to be placed in the AC byte of all transmissions from the link station. The format is B'nnn00000', where 'nnn' is the access priority value. If the access priority is higher than that authorized for the adapter, the command terminates with a CCB_RETCODE of X'08'. Valid values for the access priority are from 0 to 3. Access priority is not recognized on the PC network or on Ethernet. + +DESTINATION +Explanation: This field points to a 6-byte destination NODE_ADDRESS parameter of the remote adapter. The high-order bit of the + +Copyright IBM Corp. 1986, 1996 +<page_number>3.3.29 - 2</page_number> + +--- + + +## Page 184 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DLC.OPEN.STATION + +NODE_ADDRESS must be zero. Any routing information required for the frame header is supplied when the DLC.CONNECT.STATION command is issued. + +The value must not be all ones. For other restrictions and details about addresses, refer to the IBM Token-Ring Network Architecture Reference. + +DESTINATION_OFFSET + +Explanation: This field is the offset to the 6-byte destination NODE_ADDRESS of the remote adapter. The high-order bit of the NODE_ADDRESS must be zero. Any routing information required for the frame header is supplied when the DLC.CONNECT.STATION command is issued. + +The value must not be all ones. For other restrictions and details about addresses, refer to the IBM Token-Ring Network Architecture Reference. + +
Copyright IBM Corp. 1986, 1996 +3.3.29 - 3
+ +--- + + +## Page 185 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DLC.REALLOCATE + +3.3.30 DLC.REALLOCATE + ++---- Hex 17 ------------------------------------------+ +| DLC.REALLOCATE | ++-----------------------------------------------------+ + +**Command Description:** This command adjusts (reallocates) the number of link stations allocated to a SAP without closing and reopening the SAP. + +**Command Specifics:** If this command is used to reduce the number of allocated link stations, then these deallocated link stations are returned to the available pool. + +If this command increases the number of allocated link stations, the link stations are assigned from the available pool. + +**Valid Return Codes:** See "CCB Return Codes Listed by Command" in topic B.2.1. + +**Parameters:** + +Table 3-29. CCB Parameter Table for DLC.REALLOCATE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OffsetParameter NameByte Length8086 TypeDescription
0STATION_ID2DWID of affected SAP
2OPTION_BYTE1DBIncrease or decrease indicator
3STATION_COUNT1DBNumber of link stations to be reallocated
4ADAPTER_AVAILABLE_STNS1DBNumber of link stations available for this adapter *
5SAP_AVAILABLE_STNS1DBNumber of link stations available for this SAP *
+ +For CCB2 and CCB3: + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OffsetParameter NameByte Length8086 TypeDescription
6ADAPTER_STATION_COUNT1DBNumber of link stations configured for this adapter *
7SAP_STATION_COUNT1DBNumber of link stations reserved for this SAP *
+ +* Indicates a returned value. + +STATION_ID + +**Explanation:** The SAP station ID affected (X'nn00'). + +OPTION_BYTE + +**Explanation:** The high-order bit (bit 7) indicates whether the command increases or decreases the number of link stations. If bit 7 is 0, it increases the number of link stations. If bit 7 is 1, it decreases the number of link stations. Bits 6 through 0 are reserved. + +STATION_COUNT + +**Explanation:** This parameter is the number of link stations to be reallocated as indicated by the OPTION_BYTE parameter. If this number is greater than the available link stations (either to increase or decrease), those that are available are reallocated, and the command terminates with a return code of X'57'. If this value is zero, the command is executed and returns the indicated values in the parameter table. + +ADAPTER_AVAILABLE_STNS + +**Explanation:** Number of available link stations (not allocated to a SAP) for this adapter (after this command is completed). This value is valid for only the following return codes: X'00', X'40', X'57'. + +Copyright IBM Corp. 1986, 1996 +3.3.30 - 1 + +--- + + +## Page 186 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DLC.REALLOCATE + +SAP_AVAILABLE_STNS + +**Explanation:** Number of available link stations allocated to this SAP that are not currently in use (after this command is completed). This value is valid for only the following return codes: X'00', X'57'. + +ADAPTER_STATION_COUNT + +**Explanation:** Number of link stations configured for this adapter when it was initialized. This value is valid for only the following return codes: X'00', X'40', X'57'. + +SAP_STATION_COUNT + +**Explanation:** Number of stations currently reserved for this SAP (after this command is completed). This value is valid for only the following return codes: X'00', X'57'. + +
Copyright IBM Corp. 1986, 1996 +3.3.30 - 2
+ +--- + + +## Page 187 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DLC.RESET + +3.3.31 DLC.RESET + ++---- Hex 14 -----------------------------------------------+ +| DLC.RESET | ++----------------------------------------------------------+ + +**Command Description:** This command resets the following SAPs and link stations: + +One SAP and all associated link stations +All SAPs and all associated link stations +For CCB2 and CCB3: All SAPs and all associated link stations for one application program. + +**Command Specifics:** This command should be used in situations where some activity on the workstation is being shut down. The affected stations will be closed. The command will not be executed until all affected resources are freed. TRANSMIT commands already queued for transmission will be executed. If this command is issued while the ring is beaconing, it cannot be completed until the ring is no longer beaconing. Refer to the IBM Token-Ring Network Architecture Reference for a description of ring beaconing. + +All pending commands will be terminated for the SAPs and stations. All communication will cease, and the SAPs and stations resources will be released. They must be reopened to be used further. + +**For CCB1:** The CCB_PARM_TAB field contains the STATION_ID value in the 2 high-order bytes. A STATION_ID value of X'0000' defines all SAPs and all link stations. A STATION_ID value of X'nn00' defines SAP 'nn' and all its link stations. The 2 remaining bytes are reserved. + +When this command is completed, all pending commands that were terminated can be located using the CCB_POINTER. + +**For CCB2:** The CCB_PARM_OFFSET field contains the STATION_ID value. A STATION_ID value of X'0000' defines all SAPs and all link stations. A STATION_ID value of X'nn00' defines SAP 'nn' and all its link stations. + +A system administrator can issue this command using the System Key as defined by the configuration parameters. The System Key should be placed in the CCB_PARAMETER_2 field, if defined. + +If it is necessary for an application program to have pointers to the following returned, then the CCB_CMPL_FLAG of the DLC.RESET command must be set: + +☐ Pending commands +☐ List of buffers remaining in the SAP buffer pools +☐ The pending receive frames + +When a READ command is issued requesting command completions that post the completed DLC.RESET command, the pointers are returned in the READ command's parameter table. When this command is completed, all pending commands that were terminated are queued on the CCB_POINTER of the DLC.RESET command. + +When a system administrator uses the System Key with this command, only the SAP buffer pool buffers and pending receive frames for SAPs opened by the system administrator are returned in the READ command's parameter table. In addition, only pending commands issued by the system administrator are returned to the system administrator with the CCB_POINTER of the DLC.RESET command. + +Application programs affected by a DLC.RESET command issued with a System Key must have a READ command pending that requests notification of a system action to be notified of the event. See "System Action Exceptions for OS/2 EE 1.3" in topic B.15 for more information. + +**For CCB3:** The CCB_PARM_OFFSET field contains the STATION_ID value. A STATION_ID value of X'0000' defines all SAPs and all link stations. A STATION_ID value of X'nn00' defines SAP 'nn' and all its link stations. + +A system administrator can issue this command using the System Key as defined by the configuration parameters. The System Key should be placed in the CCB_PARAMETER_2 field, if defined. + +If it is necessary for an application program to have buffers from the SAP buffer pools returned, the CCB_CMPL_APPNDG of the DLC.RESET command must be set. When this command is executed, all pending commands that were terminated are queued on the CCB_POINTER of the DLC.RESET command. + +When a system administrator uses the System Key with this command, only the buffers from buffer pools of SAPs opened by the system administrator are returned when the application program is called for command completion posting. + +Application programs affected by a DLC.RESET issued with the System Key can be notified of the event. See "System Action Exceptions for OS/2 EE 1.3" in topic B.15 for more information. + +**Valid Return Codes:** See "CCB Return Codes Listed by Command" in topic B.2.1. + +
Copyright IBM Corp. 1986, 1996
+<page_number>3.3.31 - 1</page_number> + +--- + + +## Page 188 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DLC.SET.THRESHOLD + +3.3.32 DLC.SET.THRESHOLD + ++---- Hex 33 -----------------------------------------------+ +| DLC.SET.THRESHOLD | ++------------------------------------------------------------+ + +**Command Description:** This command is for CCB2 only. It sets a threshold for the SAP or direct station's buffer pool. Whenever the number of buffers in a SAP buffer pool falls below the specified threshold, the application program is notified. + +**Command Specifics:** This command is executed entirely in the workstation. The return code is available to the application program upon return from the protocol driver. + +**Valid Return Codes:** See "CCB Return Codes Listed by Command" in topic B.2.1. + +**Parameters:** + ++------------------------------------------------------------+ +| Table 3-30. CCB Parameter Table for DLC.SET.THRESHOLD Command | +| Paramaters are for CCB2 only | ++------------------------------------------------------------+ +| Offset | Parameter Name | Byte | 8086 | Type | Description | +| | | | | | | ++--------+----------------+------+------+--------+-------------+ +| For CCB2 only: | ++--------+----------------+------+------+--------+-------------+ +| 0 | STATION_ID | 2 | DW | SAP station ID | ++--------+----------------+------+------+--------+-------------+ +| 2 | BUFFER_THRESHOLD | 2 | DW | SAP buffer pool threshold number | ++--------+----------------+------+------+--------+-------------+ +| 4 | ALERT_SEMAPHORE | 4 | DD | Alert semaphore | ++--------+----------------+------+------+--------+-------------+ + +**STATION_ID** + +**Explanation:** The station ID of the SAP or direct station's buffer pool. + +Use the SAP station ID to identify the buffer pool for which the threshold is being set. + +**BUFFER_THRESHOLD** + +**Explanation:** Number of buffers that define the threshold. If the number of buffers in the SAP buffer pool is less than this threshold, the ALERT_SEMAPHORE parameter is cleared to notify the application program using the buffers. If a buffer is removed from the pool and the pool contains fewer buffers than the threshold, the ALERT_SEMAPHORE parameter is cleared. + +**ALERT_SEMAPHORE** + +**Explanation:** A system semaphore can be used to alert the application program of the threshold exceeded condition. When the condition exists, the protocol driver clears the ALERT_SEMAPHORE parameter to notify the application program. + +To specify a system semaphore, the application program places the semaphore handle into the ALERT_SEMAPHORE field. The semaphore handle is returned from OS/2 EE when the system semaphore is created or opened. + +
Copyright IBM Corp. 1986, 1996
+<page_number>3.3.32 - 1</page_number> + +--- + + +## Page 189 + +3.3.33 DLC.STATISTICS + ++---- Hex 1E ---------------------------------------------+ +| DLC.STATISTICS | ++---------------------------------------------------------+ + +**Command Description:** This command reads and optionally resets the DLC logs specified. The log is transferred to the buffer indicated by the parameter table. + +**Command Specifics:** For information about the adapter and direct interface logs, see the DIR.READ.LOG command. + +If the STATION.ID indicates a SAP and no link station data, this command is executed totally in the workstation. The return code is available to the application program upon return from the protocol driver. + +**Valid Return Codes:** See "CCB Return Codes Listed by Command" in topic B.2.1. + +**Parameters:** + +Table 3-31. CCB Parameter Table for DLC.STATISTICS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OffsetParameter NameByte Length8086 TypeDescription
0STATION_ID2DWIdentify the log to read
2LOG_BUF_LENGTH2DWSize of buffer at LOG_BUFFER_ADDR and LOG_BUFFER_OFFSET
For CCB1:
4LOG_BUFFER_ADDR4DDAddress to place the log data
For CCB2 and CCB3:
4LOG_BUFFER_OFFSET2DWOffset of buffer for log data
62DWReserved. Can be used for segment or selector.
For all CCBs:
8LOG_ACT_LENGTH2DWActual length of log *
10OPTIONS1DBCommand options
* Indicates a returned value.
+ +**STATION_ID** +**Explanation:** The station ID of the SAP and link station that the statistics are read from or optionally reset. + +**LOG_BUF_LENGTH** +**Explanation:** The length of the buffer defined by LOG_BUFFER_ADDR or LOG_BUFFER_OFFSET. + +**LOG_BUFFER_ADDR** +**Explanation:** The address of the buffer where the log data is to be placed. + +**LOG_BUFFER_OFFSET** +**Explanation:** The offset of the buffer where the log data is to be placed. + +**LOG_ACT_LENGTH** +**Explanation:** The returned value of the actual length of the log that was requested. If this value is greater than the value of LOG_BUF_LENGTH, not all of the log has been transferred. CCB_RETCODE will contain X'15'. + +**Note:** On a "lost data" condition, the log is cleared if the options indicate reset. + +Copyright IBM Corp. 1986, 1996 +3.3.33 - 1 + +--- + + +## Page 190 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DLC.STATISTICS + +OPTIONS + +**Explanation:** Command options. Following are the complete descriptions of the OPTIONS bits: + + + + + + + + + + + + + + + + + + +
BitsDescription
7If this bit is on, the counters are reset to zero where appropriate.
0-6These bits are reserved; they should be zero, but are not checked.
+ +Subtopics +3.3.33.1 Log Formats + +
Copyright IBM Corp. 1986, 1996 +3.3.33 - 2
+ +--- + + +## Page 191 + +3.3.33.1 Log Formats + +There are two log formats. + +**SAP log (maintained in workstation memory)** +If the DLC.STATISTICS command request is for a SAP log (X'nn00'), or a direct station log (X'00ss') for CCB1, the format of the data placed in the buffer is shown in Table 3-32. The counters are reset after they are read. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 3-32. Log Formats for the SAP Log
Bytes8086 TypeMeaning
0-3DDNumber of frames transmitted
4-7DDNumber of frames received
8-11DDNumber of frames discarded (no RECEIVE command)
12-15DDNumber of times data was lost. Can be caused by inadequate SAP buffers.
16-17DWNumber of buffers available in the SAP buffer pool
+ +**Link Station log (maintained in the adapter)** +If the DLC.STATISTICS command request is for a link station log (X'nnss'), the format of the data placed in the buffer is shown in Table 3-33. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 3-33. Log Formats for the Link Station Log
Bytes8086 TypeMeaning
0-1DWNumber of I-format LPDUs transmitted
2-3DWNumber of I-format LPDUs received
4DBNumber of I-format LPDU receive errors
5DBNumber of I-format LPDU transmission errors
6-7DWNumber of times T1 expired (other than in data-transfer mode)
8DBLast command/response received
9DBLast command/response sent
10DBLink primary state
11DBLink secondary state
12DBSend state variable
13DBReceive state variable
14DBLast received NR
15DBLength of network header used in station transmissions
16-47DBNetwork header used in station transmissions
+ +**Notes:** + +1. See "Link Station States" in topic 2.8.3 for more about bytes 10 and 11. +2. For the SAP counters that are 4 bytes long, an overflow condition is not reported. An overflow indication is given when the counters reach half their maximum value (X'80' or X'8000') by a DLC status change notification. +3. Some parameters are not counters, and these parameters are not reset when the reset option is selected. + +Copyright IBM Corp. 1986, 1996 +3.3.33.1 - 1 + +--- + + +## Page 192 + +3.3.34 PDT.TRACE.OFF + ++--- Hex 25 -----------------------------------------------+ +| PDT.TRACE.OFF | ++----------------------------------------------------------+ + +**Command Description:** This command is for CCB1 only. It terminates the PDT.TRACE.ON command. + +**Command Specifics:** The results of the PDT.TRACE.OFF command (when successful) are: + +* The PDT.TRACE.ON command's CCB_RETCODE field is set to X'0A'. +* The PDT.TRACE.OFF command's CCB_RETCODE field is set to X'00'. +* The PDT.TRACE.OFF command's CCB_POINTER field contains the address of the PDT.TRACE.ON CCB that was terminated. +* The CCB_CMD_CMPL completion exit of the PDT.TRACE.OFF command, if defined, is taken. +* The CCB_CMD_CMPL completion exit of the PDT.TRACE.ON command is ignored. + +If a PDT.TRACE.ON command is not pending: + +* The PDT.TRACE.OFF command's CCB_RETCODE field is set to X'00'. +* The PDT.TRACE.OFF command's CCB_POINTER field contains 0. +* The CCB_CMD_CMPL completion exit of the PDT.TRACE.OFF command, if defined, is taken. + +This command is executed entirely by the protocol driver in the workstation. Therefore, the command completion appendage is not required, as the command is complete upon return. However, if the command completion appendage is provided, it will be used as defined in this section. + +**Valid Return Codes:** See "CCB Return Codes Listed by Command" in topic B.2.1. + +
Copyright IBM Corp. 1986, 1996
+<page_number>3.3.34 - 1</page_number> + +--- + + +## Page 193 + +3.3.35 PDT.TRACE.ON + ++---- Hex 24 -----------------------------------------------+ +| PDT.TRACE.ON | ++-----------------------------------------------------------+ + +**Command Description:** This command is for CCB1 only. It provides an interrupt trace for all adapter traffic. + +For OS/2 trace information, see Appendix E, "Operating System/2 Extended Edition Information." + +**Command Specifics:** The command provides entries for the following activities: + +* Each CCB when it is issued to the adapter if the initial return code is X'FF'. +* Each CCB completion. +* Each NCB when issued by the application program (return code = X'FF'). +* All adapter interrupts to the workstation. If the interrupt is a timer interrupt only, a trace entry is not made, but the timer interrupts are counted for reporting. Then when a non-timer interrupt occurs, a timer trace entry is made containing the accumulated timer interrupts followed by a trace entry for the non-timer interrupt. + +Only one trace command can be active. The trace includes all activity for either the primary or alternate adapter, or both. The command is terminated by either a PDT.TRACE.OFF command or an exception, when issued. + +This command is executed entirely by the protocol driver in the workstation. Therefore, the command completion appendage is not required, as the command is complete upon return. However, the command completion appendage will be taken, if provided. + +The CCB_ADAPTER field of the CCB can be any value between X'00' and X'03'. The values X'00' or X'02' identify CCB adapter 0; the values X'01' or X'03' identify CCB adapter 1. + +The location of the trace table is pointed to by the value placed in the CCB_PARM_TAB field by the application program. The trace wraps when the buffer fills. + +**Valid Return Codes:** See "CCB Return Codes Listed by Command" in topic B.2.1. + +**Parameters:** + +Table 3-34. CCB Parameter Table for PDT.TRACE.ON + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OffsetParameter NameByte Length8086 TypeDescription
For CCB1 only:
0TABLE_LENGTH2DWLength of the TRACE_TABLE
2CURRENT_OFF2DWOffset of the current trace entry *
4START_TICK_04DDAdapter 0 timer tick count, trace start *
8STOP_TICK_04DDAdapter 0 timer tick count, trace stop *
12START_TICK_14DDAdapter 1 timer tick count, trace start *
16STOP_TICK_14DDAdapter 1 timer tick count, trace stop *
2012--Adapter work area
32----Trace table
+* Indicates a returned value. + +**TABLE_LENGTH** + +**Explanation:** The length of the requested trace table with a minimum value of 256. The entries are 16 bytes long. If the length specified is not a multiple of 16, the last 1 to 15 bytes are unused. + +**CURRENT_OFF** + +Copyright IBM Corp. 1986, 1996 +3.3.35 - 1 + +--- + + +## Page 194 + +LAN Technical Reference: 802.2 and NetBIOS APIs +PDT.TRACE.ON + +**Explanation:** The offset from the TRACE_TABLE value of the most recent table entry. + +The table wraps around when full. If the first entry in the table is the PDT.TRACE.ON command, the table has not wrapped. + +--- + +**START_TICK_0** + +**Explanation:** The value of the adapter 0 timer tick counter, as set by the adapter, when the trace started. + +Adapter ticks occur every 100 ms. + +--- + +**STOP_TICK_0** + +**Explanation:** The value of the adapter 0 timer tick counter, as set by the adapter, when the trace stopped. + +--- + +**START_TICK_1** + +**Explanation:** The value of the adapter 1 timer tick counter, as set by the adapter, when the trace started. + +--- + +**STOP_TICK_1** + +**Explanation:** The value of the adapter 1 timer tick counter, as set by the adapter, when the trace stopped. + +--- + +**TRACE_TABLE** + +**Explanation:** The trace table starts here. The length is defined by the TABLE_LENGTH field. The trace table formats for the non-NDIS Token-Ring Network and the PC Network are explained in the following section. + +Subtopics +3.3.35.1 Trace Table Formats for the Non-NDIS Token-Ring Network Adapters +3.3.35.2 Trace Table Formats for the PC Network and NDIS Adapters + +
Copyright IBM Corp. 1986, 1996 +3.3.35 - 2
+ +--- + + +## Page 195 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Trace Table Formats for the Non-NDIS Token-Ring Network Adapters + +3.3.35.1 Trace Table Formats for the Non-NDIS Token-Ring Network Adapters + +Four trace entry formats are used, and each trace entry is 16 bytes long. + +The SS and SP registers point to 26 bytes of stack space used by the protocol driver when the trace entry is made. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 3-35. CCB Trace Entry
ByteMeaning
0Adapter number (0/1)
1Flags
2CCB command
3Return code
4-7SS:SP registers
8-11Address of the interrupted application program code
12-15ES:BX registers
+ +The command code (byte 2) is zero if not applicable. If this entry is the result of a request for data by the adapter following a TRANSMIT CCB, the specific TRANSMIT command code is inserted. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 3-36. Byte 1: Flags
BitMeaning
7Adapter initialized
6Initialize in process
5Adapter opened
4Open in process
3SRB busy
2Block bit on
1Always 0
0No adapter
+ +The ES and BX registers point to the CCB. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 3-37. Adapter Interrupt Trace Entry (Except Timer)
ByteToken-Ring Network
0ISRP Even
1ISRP Odd
2Command code of the interrupt
3Return code
4-7SS:SP registers
8-11Address of the interrupted application program code
12-15ES:BX registers
+ + + + + + + + + + + + + + + + + + + + + +
Table 3-38. Byte 0: Interrupt Status Register Processor (ISRP) Even
BitMeaning
7CHCK/IRQ steering control (always 1)
6Interrupt enabled (always 1)
+ +Copyright IBM Corp. 1986, 1996 +3.3.35.1 - 1 + +--- + + +## Page 196 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Trace Table Formats for the Non-NDIS Token-Ring Network Adapters + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BitMeaning
5Reserved
4Timer Interrupt (100-ms programmable timer)
3Error Interrupt
2Access Interrupt
1Always on
0Adapter number (0 or 1)
+ +Table 3-39. Byte 1: Interrupt Status Register Processor (ISRP) Odd + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BitMeaning
7Reserved
6Adapter check
5SRB response
4ASB free
3ARB command
2SSB response
1Reserved
0Reserved
+ +The ES and BX registers point to the applicable CCB or buffer if the interrupt is a result of a CCB. Otherwise these bytes will be zero. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ByteMeaning
0ISRP Even, adapter 0=X'D2' and adapter 1=X'D3'
1X'00'
2-32-byte counter: number of timer interrupts, adapter 0 and 1
4-7SS:SP registers
8-11Address of the interrupted application program code
12-15ES:BX registers
+ +When no other interrupts are occurring, timer interrupts are maintained for reporting. The counter is updated for each timer interrupt (either adapter). The accumulated interrupts are placed in a timer interrupt trace entry when a non-timer interrupt occurs, producing another trace entry. The ES and BX registers point to the DIR.TIMER.SET CCB if this timer interrupt causes a DIR.TIMER.SET command to be completed. Otherwise, this field is zero. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ByteMeaning
0X'0F' X'1F' X'2F' (see below)
1Adapter number (0/1)
2-3NCB command and return code
4-7SS:SP registers
8-11Address of the interrupted application program code
12-15ES:BX registers
+ +The ES and BX registers point to the NCB. + +When a post routine is used while trace is active, three entries are made in the trace table. + +Byte 0 contains: + +Copyright IBM Corp. 1986, 1996 +3.3.35.1 - 2 + +--- + + +## Page 197 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Trace Table Formats for the Non-NDIS Token-Ring Network Adapters + +☐ X'0F' for the entry when the NCB is first issued +☐ X'1F' when going to the user-supplied post routine +☐ X'2F' when returning from the post routine. + +
Copyright IBM Corp. 1986, 1996 +3.3.35.1 - 3
+ +--- + + +## Page 198 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Trace Table Formats for the PC Network and NDIS Adapters + +3.3.35.2 Trace Table Formats for the PC Network and NDIS Adapters + +Three trace entry formats are used. Each trace entry is 16 bytes long. + +The SS and SP registers point to 26 bytes of stack space used by the protocol driver when the trace entry is made. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 3-42. CCB Trace Entry
ByteMeaning
0Adapter number (0/1)
1Flags
2CCB command
3Return code
4-7SS:SP registers
8-11Address of the interrupted application program code
12-15ES:BX registers
+ +The command code (byte 2) is zero if not applicable. If this entry is the result of a request for data by the adapter following a TRANSMIT CCB, the specific TRANSMIT command code is inserted. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 3-43. Byte 1: Flags
BitMeaning
7Adapter initialized
6Initialize in process
5Adapter opened
4Open in process
3Command request block busy
2Reserved
1Reserved
0No adapter
+ +The ES and BX registers point to the CCB. + +The interrupt trace entry structure will be described in general followed by each possible entry described separately. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 3-44. Interrupt Trace Entry
BytePC Network
0Adapter number (0/1) and activation reason code
1Command code or X'00'
2Command dependent information
3Command dependent information
4-7SS:SP registers
8-11Address of the interrupted application program code
12-15ES:BX registers
+ +The ES and BX registers point to the applicable CCB or buffer if the interrupt is a result of a CCB. Otherwise these bytes are zero. + +
Copyright IBM Corp. 1986, 1996
+<page_number>3.3.35.2 - 1</page_number> + +--- + + +## Page 199 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Trace Table Formats for the PC Network and NDIS Adapters + +<img> +X'nn' +</img> + +<img> +Adapter Number +8=Adapter 0 +9=Adapter 1 +</img> + +<img> +Activation Reason +0=Timer attention +1=Initialize Attention +2=Adapter Check Attention +8=CRB (Command Request Block) +9=ARB (Asynchronous Request Block) +A=FCB (Final Completion Block) +C=TXCB (Transmit Control Block) +</img> + +Figure 3-1. Byte 0: Adapter Number (0/1) and Activation Reason Code + +Figure 3-2 shows the structure for the Timer Entry, when byte 0 is X'80' or X'90'. + + + + + + + + + + + + + + + + + + + + + + +
012-34-78-1112-15
X'80' & X'90'X'00'Tick counter: Adapter 0 and 1SS:SPAddress of interrupted codeES:BX
+ +Figure 3-2. Timer Entry + +Note: Timer interrupts with no other interrupts occurring are maintained in one trace entry. The counter is updated for each timer interrupt (either adapter) and the other values in the trace represent the latest trace entry. + +Figure 3-3 shows the structure for the Initialize Entry, when byte 0 is X'81' or X'91'. + + + + + + + + + + + + + + + + + + + + + + +
012-34-78-1112-15
X'81' & X'91'X'00'X'0000'SS:SPAddress of interrupted codeES:BX
+ +Figure 3-3. Initialize Entry + +Figure 3-4 shows the structure for the Command Request Block (CRB) Entry, when byte 0 is X'88' or X'98'. + +
Copyright IBM Corp. 1986, 1996 +3.3.35.2 - 2
+ +--- + + +## Page 200 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Trace Table Formats for the PC Network and NDIS Adapters + + + + + + + + + + + + + + + + + + + + + + + + +
01234-78-1112-15
X'88' & X'98'CRB Command CodeReturn CodeCorrelator (00 if RC= X'FF')SS:SPAddress of interrupted codeES:BX
+ +Figure 3-4. CRB Entry + +Figure 3-5 shows the structure for the Asynchronous Request Block (ARB) Entry, when byte 0 is X'89' or X'99'. + + + + + + + + + + + + + + + + + + + + + + + +
01234-78-1112-15
X'89' & X'99'ARB Command Code(see below)SS:SPAddress of interrupted codeES:BX
+ +Receive +X'81' Station ID + +Transmit +X'82' Sta Num Corr + +DLC Status +X'83' DLC Status + +Network Status +X'84' Network Status + +Figure 3-5. ARB Entry + +The contents of the ES:BX registers are as follows: + +☐ For a receive, the ES:BX registers point to the receive CCB if the receive is completing (no RECEIVE.DATA appendage or a bad return code), else it points to the first receive buffer if a RECEIVE.DATA appendage is specified. + +☐ For a transmit, the ES:BX registers point to the transmit CCB. + +☐ For a DLC status, the ES:BX registers point to the DLC status buffer + +☐ For a network status, the ES:BX registers point to a queue of pending CCBs if the adapter has been closed, or it is zero. + +Figure 3-6 shows the structure for the Final Completion Block (FCB) Entry, when byte 0 is X'8A' or X'9A'. + +
Copyright IBM Corp. 1986, 1996 +3.3.35.2 - 3
+ +--- + + +## Page 201 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Trace Table Formats for the PC Network and NDIS Adapters + + + + + + + + + + + + + + + + + + + + + + + + +
01234-78-1112-15
X'8A' & X'9A'FCB Command CodeReturn CodeCorrelatorSS:SPAddress of interrupted codeES:BX
+ +Figure 3-6. FCB Entry + +Figure 3-7 shows the structure for the Transmit Control Block (TXCB) Entry, when byte 0 is X'8C' or X'9C'. + + + + + + + + + + + + + + + + + + + + + + + + +
01234-78-1112-15
X'8C' & X'9C'TXCB Command CodeReturn CodeX'00'SS:SPInterruptedES:BX
+ +Figure 3-7. TXCB Entry + ++-----------------------------+ +| Table 3-45. NCB Trace Entry | ++-----------------------------+ +| Byte | Meaning | ++------+--------------------------+ +| 0 | X'0F' X'1F' X'2F' X'3F' (see below) | ++------+--------------------------+ +| 1 | Adapter number (0/1) | ++------+--------------------------+ +| 2-3 | NCB command and return code | ++------+--------------------------+ +| 4-7 | SS:SP registers | ++------+--------------------------+ +| 8-11 | Address of the interrupted application program code | ++------+--------------------------+ +| 12-15| ES:BX registers | ++------+--------------------------+ + +The ES and BX registers point to the NCB. + +If there is no NCB post routine specified, there will be no X'2F' entry. + +Byte 0 contains: +☐ X'0F' for the entry when the NCB is first issued +☐ X'1F' when posting the NCB +☐ X'2F' when returning from a post routine +☐ X'3F' when NetBIOS indicates finished with NCB. + +
Copyright IBM Corp. 1986, 1996
+
3.3.35.2 - 4
+ +--- + + +## Page 202 + +3.3.36 PURGE.RESOURCES + ++--- Hex 36 -----------------------------------------------+ +| PURGE.RESOURCES | ++----------------------------------------------------------+ + +**Command Description:** This command is for CCB3 only. It allows the application program to purge resources from the protocol driver that are owned by a terminating OS/2 process. This command can also be used to purge resources from the protocol driver that are allocated from memory being returned to the operating system. + +The application program must use this command if all the following are true: + +☐ The application program is using the DD interface. + +☐ Control blocks that were allocated from memory owned by one or more OS/2 processes have been passed to the protocol driver. + +☐ After one of its processes terminates, the application program must continue using the services of the protocol driver. In this case the application program should not issue the DIR.CLOSE.ADAPTER command. + +☐ It is necessary for the application program to free memory to the operating system, but it still has CCBs and buffers pending with the protocol driver. The application program should not issue the DIR.CLOSE.ADAPTER command. + +**Command Specifics:** + +☐ Memory passed to a protocol driver (LANDD) in the form of CCBs or buffers can be owned by different processes of an application program or by an application program's device driver. Since the LAN device drivers cannot guarantee that the active process is the owner of memory being passed to it (command invocations at interrupt time) all control blocks and buffers are associated with a resource ID. The resource ID is passed as a parameter with the CCB and is associated with the CCB and all other control blocks (for example, logs and buffers) referenced by the CCB. + +In order to have CCBs that have been purged returned to the application program, this command must be used specifying a command completion appendage. + +You may want an application program to purge resources when it consists of more than one OS/2 process and each process has resources. For example, an application program has two OS/2 processes that have both been allocated memory (being used in the application program's SAP buffer pool). When one of the processes terminates, the application program should use the PURGE.RESOURCES command to specify to the protocol driver what control blocks should be removed (cleaned up) from the protocol driver's internal queues. + +☐ To identify the resource ID (PURGE_RESOURCE_ID) of the control blocks to be purged, use the CCB_PARAMETER_2 field of the PURGE.RESOURCES CCB. + +All control blocks that have been passed to the protocol driver with a resource ID that matches PURGE_RESOURCE_ID are removed from the protocol driver internal queues and returned to the application program. All pending CCBs that are canceled are chained using the CCB_POINTER fields with the CCB_RETCODE field set to X'67'. When the protocol driver calls the application program's device driver (with the appropriate event appendage offset passed in register DI) and there are no resources associated with the PURGE_RESOURCE_ID, the 12-byte information table referenced by registers DX and DI will contain zeros. + +☐ If the application program does not purge a terminating process' resources immediately from the LAN device driver's internal queues, other application programs can be adversely affected. If the memory owned by the terminating process is reallocated by OS/2 to another process, the memory can be written into by the protocol driver if the terminating process's control blocks are not removed from the protocol driver's internal queues. + +☐ This command does not close stations, SAPs, or application programs. It only cleans up data areas. + +**Valid Return Codes:** See "CCB Return Codes Listed by Command" in topic B.2.1. + +
Copyright IBM Corp. 1986, 1996
+<page_number>3.3.36 - 1</page_number> + +--- + + +## Page 203 + +3.3.37 READ + +``` ++---- Hex 31 --------------------------------------------------------+ +| | +| READ | +| | ++-------------------------------------------------------------------+ +``` + +**Command Description:** This command is for CCB2 only. It performs a read function for the direct and DLC interfaces. The station ID is used to define the interface that the read is being issued for. + +**Command Specifics:** When a READ command is issued, it is queued to wait for the specified read event for the station ID indicated in the command. Multiple READ commands can be pending at one time for each station ID. Each READ command specifies an event or set of events and a system semaphore handle (CCB_SEMAPHORE). If an event has already occurred that matches an event specified with a READ command, or at some later time an event occurs that matches an event specified with a READ command, the following takes place: + +* Data associated with the event is copied into the READ command's CCB parameter table. +* CCB_RETCODE of the READ command CCB is set to X'00'. +* CCB_SEMAPHORE, if provided, is cleared signaling that the READ command has been completed. + +Once the READ command's CCB_RETCODE has been set and CCB_SEMAPHORE cleared, the READ command has been completed and must be issued again to become active. + +In some cases, it may be necessary for an application program to guarantee that a READ command is pending for a particular CCB command completion. For example, when a DIR.CLOSE.ADAPTER is executed, all the application program's pending CCBs, SAP buffers, and receive frames are returned in the parameter table of a pending READ command. If no READ command is pending, the application program's data areas are not returned. To guarantee that a READ command is pending, the application program can chain a READ command's CCB to a CCB by placing the address of the READ command's CCB in the CCB_POINTER field and setting the CCB_READ_FLAG field to a non-zero value. When the CCB is completed, the READ command referenced by the CCB_POINTER field is used to post the completion of the command. In addition to updating the READ command's CCB parameter table, the READ command's CCB_RETCODE is set and CCB_SEMAPHORE is cleared (if it exists). + +**Valid Return Codes:** See "CCB Return Codes Listed by Command" in topic B.2.1. + +**Parameters:** + +``` ++-------------------------------------------------------------------+ +| Table 3-46. CCB Parameter Table for READ | ++-------------------------------------------------------------------+ +| Offset | Parameter Name | Byte | 8086 | Description | +| | | Length | Type | | ++-------------------------------------------------------------------+ +| For CCB2 only: | ++-------------------------------------------------------------------+ +| 0 | STATION_ID | 2 | DW | SAP station ID | ++-------------------------------------------------------------------+ +| 2 | OPTION_INDICATOR | 1 | DB | READ option indicator | ++-------------------------------------------------------------------+ +| 3 | EVENT_SET | 1 | DB | Set of events for notification | ++-------------------------------------------------------------------+ +| 4 | EVENT | 1 | DB | Posting event * | ++-------------------------------------------------------------------+ +| 5 | CRITICAL_SUBSET | 1 | DB | Critical event subset identifier * | ++-------------------------------------------------------------------+ +| 6 | NOTIFICATION_FLAG | 4 | DD | Event user notification flag * | ++-------------------------------------------------------------------+ +| 10 | CCB_COUNT | 2 | DW | Count of CCBs chained to the EVENT_CCB_POINTER * | ++-------------------------------------------------------------------+ +| 12 | EVENT_CCB_POINTER | 4 | DD | Pointer to CCBs * | ++-------------------------------------------------------------------+ +| 16 | BUFFER_COUNT | 2 | DW | Count of buffers chained to FIRST_BUFFER_ADDR * | ++-------------------------------------------------------------------+ +| 18 | FIRST_BUFFER_ADDR | 4 | DD | Address of first receive buffer * | ++-------------------------------------------------------------------+ +| 22 | RCV_FRAME_COUNT | 2 | DW | Count of received frames chained to RCV_FRAME_ADDR * | ++-------------------------------------------------------------------+ +| 24 | RCV_FRAME_ADDR | 4 | DD | Address of received frames * | ++-------------------------------------------------------------------+ +| 28 | EVENT_ERROR_CODE | 2 | DW | Exception code * ** | ++-------------------------------------------------------------------+ + +--- + + +## Page 204 + +LAN Technical Reference: 802.2 and NetBIOS APIs +READ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
30EVENT_ERROR_DATA6DWException parameters ***
For DLC Status Changes: For DLC status change events posting, the fields starting at offset 10 are defined differently. The descriptions of those fields starts here.
10STATION_ID2DWSAP or link station ID *
12DLC_STATUS_CODE2DWDLC status code *
14FRMR_DATA5DBFrame data *
19ACCESS_PRIORITY1DBThe new access priority *
20REMOTE_NODE6DBRemote node address *
26REMOTE_SAP1DBRemote SAP address *
271DBReserved
28USER_STAT_VALUE2DWUser status value *
* Indicates a returned value.
** Indicates that these parameters can also be defined as an 8086 declaration type of DB.
+ +STATION_ID + +Explanation: The station ID to be posted for events. + +OPTION_INDICATOR + +Explanation: Option indicator for matching READ command requests. The option indicator is used to match events with the READ command for posting of events. + +Indicator Meaning + +X'00' Match READ command using station ID, X'nnss', where "nn" is the SAP number and "ss" is the station number. All events on the completion list associated with the station ID number are checked for a READ command match. + +X'01' Match READ command using the SAP number of the station ID, X'nn00', where "nn" is the SAP number. All events on the completion list associated with the SAP number are checked for a READ command match. + +X'02' Match READ command using all events. All events on the application program's completion list are checked for a READ command match. + +If the OPTION_INDICATOR parameter is not X'00' through X'02', the command terminates with CCB_RETCODE set to X'06'. + +EVENT_SET + +Explanation: Set of events for notification. + +Seven different types of asynchronous events can be posted. A single READ command can request to be posted for more than one event. Thus, multiple bits can be set (non-zero). Each event is bit-mapped using the EVENT_SET byte as described below: + + + + + + + + + + + + + + +
BitDescription
7Reserved.
6System Action (non-critical).
+ +If a non-critical system action occurs while using the System Key defined by the configuration parameters, one of the following is true: + +* The DIR.READ.LOG command has been issued to read the adapter or direct interface logs. +* The DIR.SET.FUNCTIONAL.ADDRESS command has been issued to modify the functional address. +* The DIR.SET.GROUP.ADDRESS command has been issued to modify the group address. +* The DLC.RESET command has been issued to reset SAP stations. + +In these cases the adapter is not closed or reinitialized, and service can still be provided to application programs once the following occur: + +Copyright IBM Corp. 1986, 1996 +3.3.37 - 2 + +--- + + +## Page 205 + +LAN Technical Reference: 802.2 and NetBIOS APIs +READ + +☐ The functional or group addresses have been reset. + +This is only applicable if an application program was using one of the addresses and the system action resulted in the address not being suitable for the application program. + +☐ The SAP stations have been reopened. + +This is only applicable if a SAP station used by an application program was reset by the system action. + +All other non-critical system actions do not require the application program to take further action as service has not been disrupted. + +5 Network Status (non-critical). +Notification of a Network Status change. + +4 Critical Exception. +A critical exception occurs when the adapter is abruptly closed or reinitialized. The adapter can be closed either by an unrecoverable failure or by the action of a system administrator issuing the DIR.CLOSE.ADAPTER command with the System Key defined by the configuration parameters. The adapter can also be reinitialized by the action of a system administrator issuing the DIR.INITIALIZE command with the System Key defined by the configuration parameters. + +Individual subevents that result in critical exceptions are: +☐ Network Status (Adapter closed cases only) +☐ Adapter Check +☐ PC Error +☐ System Action (DIR.INITIALIZE and DIR.CLOSE.ADAPTER commands). + +These critical exception events are provided in the CRITICAL_SUBSET field when a critical exception occurs. + +Warning: If a critical exception occurs and an application program does not have a READ command pending, the only action taken by the protocol driver will be to set the return codes for all pending commands to X'07'. In this case, no pointers to buffers from SAP buffer pools or receive frames and no pointer to a list of outstanding CCBs will be provided to the user. + +3 DLC status change. +Notification of a DLC status change. + +2 Receive data. +MAC (Token-Ring Network only) and non-MAC frames are received. + +1 Transmit completion. +A DLC or DIR TRANSMIT command is completed. The transmit completion bit is used to expedite data transfer operations. + +0 Command completion. +A DLC or DIR command is completed. + +If EVENT_SET is set to X'00' (no event bit is set), the command terminates with a CCB_RETCODE of X'05'. + +EVENT +Explanation: The posting event. + +This field contains the event being posted. Bits 0 through 6 are bit-mapped as described above. For each posting event, a single bit is set to indicate the particular event that has occurred. Each type of event that is posted will have different data placed into the CCB of the READ command. Table 3-47 describes the additional CCB fields used for each event: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
EventFields Posted
Command Completion☐ CCB_COUNT
☐ EVENT_CCB_POINTER
☐ BUFFER_COUNT
☐ (DLC.CLOSE.SAP and DLC.RESET commands)
☐ FIRST_BUFFER_ADDR
☐ (DLC.CLOSE.SAP and DLC.RESET commands)
☐ RCV_FRAME_COUNT
☐ (DLC.CLOSE.SAP, DLC.CLOSE.STATION, DLC.RESET, and RECEIVE commands)
☐ RCV_FRAME_ADDR
☐ (DLC.CLOSE.SAP, DLC.CLOSE.STATION, DLC.RESET, and RECEIVE commands)
Transmit Completion☐ CCB_COUNT
+ +Copyright IBM Corp. 1986, 1996 +3.3.37 - 3 + +--- + + +## Page 206 + +LAN Technical Reference: 802.2 and NetBIOS APIs +READ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
0EVENT_CCB_POINTER
Receive Data0RCV_FRAME_COUNT
0RCV_FRAME_ADDR
DLC Status Change0NOTIFICATION_FLAG
Starting at offset 10 in the READ
command's CCB parameter table, the DLC
Status Table is defined below.
0STATION_ID
0DLC_STATUS_CODE
0FRMR_DATA
0ACCESS_PRIORITY
0REMOTE_NODE
0REMOTE_SAP
0USER_STAT_VALUE
Critical Exception0CRITICAL_SUBSET
0NOTIFICATION_FLAG
0CCB_COUNT
0EVENT_CCB_POINTER
0BUFFER_COUNT
0FIRST_BUFFER_ADDR
0RCV_FRAME_COUNT
0RCV_FRAME_ADDR
0EVENT_ERROR_CODE
0EVENT_ERROR_DATA
Network Status
(Non-Critical)
0NOTIFICATION_FLAG
0EVENT_ERROR_CODE
System Action
(Non-Critical)
0NOTIFICATION_FLAG
0CCB_COUNT
0EVENT_CCB_POINTER
0BUFFER_COUNT
0FIRST_BUFFER_ADDR
0RCV_FRAME_COUNT
0RCV_FRAME_ADDR
0EVENT_ERROR_CODE
0EVENT_ERROR_DATA
+ +CRITICAL_SUBSET + +**Explanation:** Exception event causing a critical exception. + +When a critical exception event posts, this field contains the actual event that resulted in the critical exception. The individual events are mapped as follows: + + + + + + + + + + + + + + + + + + + + + + +
EventMeaning
X'01'Network Status
X'02'Adapter Check
X'03'PC System Error
X'04'System Action.
+ +NOTIFICATION_FLAG + +**Explanation:** User notification flag for events. + +For notification of exception conditions, the user exception flag defined with the DIR.SET.EXCEPTION.FLAGS command is returned. + +For notification of a DLC status change, this value will contain the DLC_STATUS_FLAG, as defined with the DLC.OPEN.SAP command, for the link station that has experienced the change. + +These flags are preserved across invocations and may be used by the application program for user-specific data. + +CCB_COUNT + +**Explanation:** The number of CCBs chained to the EVENT_CCB_POINTER field as described below. + +EVENT_CCB_POINTER + +**Explanation:** Points to a CCB when notifying an application program of a single completed command. + +When notifying an application program of the DIR.CLOSE.ADAPTER, DIR.TIMER.CANCEL.GROUP, DLC.CLOSE.SAP, and DLC.RESET commands completing, this field points to the completing command with a list of pending commands chained together using the CCB_POINTER parameter of the commands. + +
Copyright IBM Corp. 1986, 1996
+<page_number>3.3.37 - 4</page_number> + +--- + + +## Page 207 + +LAN Technical Reference: 802.2 and NetBIOS APIs +READ + +If TRANSMIT commands are issued specifying that their CCBs be chained together upon completion, this field points to the first member of a list of completed TRANSMIT command CCBs chained using the CCB_POINTER parameter of the commands. + +If an exception occurs that causes the adapter to close (encounters an unrecoverable error) or causes SAP stations to be reset, all pending commands are chained to the EVENT_CCB_POINTER field using the CCB_POINTER parameter of the commands. The CCB_RETCODE of all commands chained to the EVENT_CCB_POINTER will be set as follows: + +☐ If an Adapter Check, Network Status, or PC System Detected Error occurs, the CCB_RETCODE is X'07'. + +☐ If a System Action occurs, the CCB_RETCODE is X'62'. + +Note: The adapter can be closed either by an unrecoverable failure or by the action of a system administrator issuing commands with the System Key. In addition, the System Key can be used to reset SAP stations. If a command can use the System Key, this is noted in the description of the command. + +BUFFER_COUNT + +Explanation: The number of buffers chained to the FIRST_BUFFER_ADDR field. + +FIRST_BUFFER_ADDR + +Explanation: Address of the first buffer in the buffer pools being returned. + +If the adapter encounters an unrecoverable error, a System Action exception occurs, or the DLC.CLOSE.SAP or DLC.RESET commands have been issued that cause SAP or direct stations to be closed or reset, all buffers contained in associated SAP or direct station buffer pools are chained to this field. This field contains the address of the first buffer of the buffer pool with all other buffers chained. + +Note: The adapter can be closed either by a catastrophic failure or by the action of a system administrator issuing commands with the System Key. In addition, the System Key can be used to reset SAP stations. If a command can use the System Key, this is noted in the description of the command. + +RCV_FRAME_COUNT + +Explanation: The number of frames chained to the RCV_FRAME_ADDR field. + +RCV_FRAME_ADDR + +Explanation: Address of received frames. + +When data is received and posted with the READ command requesting receive data, the RCV_FRAME_ADDR field contains the address of the first buffer of a frame with all other frames chained using the first buffer of each frame. + +If the adapter encounters an unrecoverable error, a System Action exception occurs, or DLC.CLOSE.SAP, DLC.CLOSE.STATION, and DLC.RESET commands have been issued that cause the station ID to be closed or reset, all received frames associated with the station IDs on the completion list are removed and chained to this field. + +Note: The adapter can be closed either by a catastrophic failure or by the action of a system administrator issuing commands with the System Key. In addition, the System Key can be used to reset SAP stations. If a command can use the System Key, this is noted in the description of the command. + +EVENT_ERROR_CODE + +Explanation: Reason, Status, or Error Codes. + +Codes used to identify error conditions and status changes for exceptions are placed into the EVENT_CODE field. See "Exception Indications" in topic B.6 for all exception conditions. + +EVENT_ERROR_DATA + +Explanation: Exception parameters. + +The Adapter Check exception and a PC System Detected Error exception have 3 parameters defined for passing maintenance and RAS data. These parameters are placed into this field. See "Exception Indications" in topic B.6 for all exception conditions. + +Subtopics +3.3.37.1 DLC Status Change Events + +Copyright IBM Corp. 1986, 1996 +3.3.37 - 5 + +--- + + +## Page 208 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DLC Status Change Events + +3.3.37.1 DLC Status Change Events +For DLC status change events posting, the fields starting at offset 10 are defined differently. The descriptions of those fields are as follows: + +STATION_ID +Explanation: The SAP or link station ID for DLC status change. + +DLC_STATUS_CODE +Explanation: The DLC status code. +Note: See Appendix B, "Return Codes" for the DLC status codes. +Multiple bits may be set when a DLC status is posted. + +FRMR_DATA +Explanation: Frame data. +Five bytes of reason code that are applicable when an FRMR is either transmitted or received. Refer to the IBM Token-Ring Network Architecture Reference for a complete description of this information. + +ACCESS_PRIORITY +Explanation: The new access priority that is applicable when status bit 5 is on. The format is B'nnn00000' where "nnn" is the access priority. This byte is ignored and is set to zero when PC Network or Ethernet adapters are used. + +REMOTE_NODE +Explanation: The 6-byte node address of the remote partner for a newly opened link station. Applicable when status bit 10 is on. + +REMOTE_SAP +Explanation: The 1-byte remote SAP address for a newly opened link station. Applicable when status bit 10 is on. + +USER_STAT_VALUE +Explanation: User status value as defined in the DLC.OPEN.SAP command. + +
Copyright IBM Corp. 1986, 1996 +3.3.37.1 - 1
+ +--- + + +## Page 209 + +LAN Technical Reference: 802.2 and NetBIOS APIs +READ.CANCEL + +3.3.38 READ.CANCEL + ++--- Hex 32 -----------------------------------------------+ +| READ.CANCEL | ++--------------------------------------------------------+ + +**Command Description:** This command is for CCB2 only. It cancels a pending READ command for an individual application program. + +**Command Specifics:** This command is executed entirely in the workstation. The return code is available to the application program upon return from the protocol driver. The canceled READ CCB (if one is pending) is terminated with the CCB_RETCODE set to X'0A'. The READ command is not posted using the post semaphore. The post semaphore for the READ.CANCEL command is cleared to signal the completion of the READ.CANCEL and the READ command is not posted except to set the return code. + +The fields CCB_PARM_OFFSET and CCB_PARAMETER_1 are combined to form a 4-byte (8086 declaration type DD) address of the READ CCB to be canceled. + +**Valid Return Codes:** See "CCB Return Codes Listed by Command" in topic B.2.1. + +
Copyright IBM Corp. 1986, 1996 +3.3.38 - 1
+ +--- + + +## Page 210 + +LAN Technical Reference: 802.2 and NetBIOS APIs +RECEIVE + +3.3.39 RECEIVE + ++---- Hex 28 -----------------------------------------------+ +| RECEIVE | ++----------------------------------------------------------+ + +**Command Description:** This command receives data for the station defined in the STATION_ID field of the CCB. + +**Command Specifics:** When a RECEIVE command is issued, it is queued in the workstation, awaiting received data for the specified station. Multiple RECEIVE commands can be active at one time, but there can be only one for each specific station ID. + +**For CCB1:** Once data is received for a pending RECEIVE command and there are adequate receive buffers available in the pool, the following takes place: + +☐ The protocol driver fills receive buffers from the appropriate buffer pool and places the address of the first buffer in the RECEIVE command parameter table. + +☐ If the optional RECEIVED_DATA user appendage is defined and the return code is X'00', the following happens: +- The address of the CCB is placed in registers DS and SI. +- The address of the first receive data buffer is placed in registers ES and BX. +- The RECEIVED_DATA user appendage exit is taken. + +The RECEIVE command remains active to receive any data that follows. Therefore, once a RECEIVE command is issued for a station, it continues to be active until terminated by an exception condition, until a RECEIVE.CANCEL is issued for the RECEIVE, or until the SAP or link station is closed. + +If the optional RECEIVED_DATA user appendage is not defined or the return code is not X'00', the command is completed in the same way as any other command. The CCB_CMD_CMPL user exit is taken with the CCB address in registers ES and BX. + +When a DLC.CLOSE.SAP or DLC.CLOSE.STATION is issued, the RECEIVE command associated with that SAP or station is terminated with a CCB_RETCODE of X'0A', and the address of the RECEIVE command CCB is placed in the CCB_POINTER field of the command causing the SAP or station to close. The RECEIVE command's completion appendage is not taken. + +When the RECEIVE command has been issued with the RECEIVED_DATA user appendage address set, and data has been received successfully, this command never actually completes with a return code of X'00'. However, when data is received successfully, there is an implied return code of X'00'. The actual return code remains X'FF'. A return code is set only when the command is terminated, for example, when a lost data condition occurs or if the RECEIVED_DATA user appendage address was not set when the command was issued. + +**For CCB2:** Once data is received for a pending RECEIVE command and there are adequate receive buffers available in the pool, the following takes place: + +☐ The protocol driver fills receive buffers from the appropriate buffer pool and places the address of the first buffer in the RECEIVE command parameter table. + +☐ If the optional RECEIVED_FLAG is not set or the return code is not X'00', the command is completed in the same way as any other command. The CCB_CMD_FLAG is used to determine how the command completion notification should be handled. + +☐ If the optional RECEIVED_FLAG is set and the return code is X'00', the following happens: +- If a READ command defined for notification of receive data is pending, the addresses are copied into the READ command's parameter table, and the READ semaphore is cleared. +- If no READ command defined for notification of receive data is pending when the receive data event occurs, the address of the first receive buffer is placed onto a completion list. Upon reception of a READ command, the completion list is scanned. If the RCV_READ_OPTION field of the RECEIVE command is set for chaining, all data received for the station ID is chained and posted at once. The first receive buffer is copied into the READ command's parameter table, and the READ semaphore is cleared. + +The RECEIVE command remains active to receive any data that follows. Therefore, once a RECEIVE command is issued for a station, it continues to be active until terminated by an exception condition, until a RECEIVE.CANCEL is issued for the RECEIVE, or until the SAP or link station is closed. + +When a DLC.CLOSE.SAP or DLC.CLOSE.STATION command is issued, the RECEIVE command associated with that SAP or station is terminated with a CCB_RETCODE of X'0A', and the address of the RECEIVE command CCB is placed in the CCB_POINTER field of the command causing the SAP or station to close. Any READ commands that might be pending that request receive data posting or clearing of semaphores defined by the RECEIVE command are not completed. + +When the RECEIVE command has been issued with RECEIVE_FLAG set, and data has been received successfully, this command never actually completes with a return code of X'00'. However, when data is received successfully, there is an implied return code of X'00'. The actual return code remains X'FF' (command in process). A return code is set only when the command is terminated, for example, when a lost data condition occurs or if the RECEIVE_FLAG was not set when the command was issued. + +**For CCB3:** Once data is received for a pending RECEIVE command and there are adequate receive buffers available in the pool, the following takes place: + +
Copyright IBM Corp. 1986, 1996
+<page_number>3.3.39 - 1</page_number> + +--- + + +## Page 211 + +LAN Technical Reference: 802.2 and NetBIOS APIs +RECEIVE + +- The protocol driver fills receive buffers from the appropriate buffer pool and places the address of the first buffer in the RECEIVE command parameter table. +- If the optional RCV_DATA_APPNDG user appendage is defined and the return code is X'00', the protocol driver calls the application program's device driver with the following set: + - Register DI contains the RCV_DATA_APPNDG as defined by the RECEIVE command. + - An invocation code of X'0001' has been pushed onto the stack. Before returning control to the protocol driver, the application program must remove the invocation code from the stack. + - Register DS contains the application program device driver's protect mode data segment selector. + - Register CX contains the adapter number. + - Registers ES and BX contain a virtual address to the first SAP buffer of the receive information. + - Registers AX and SI contain a virtual address of the RECEIVE command's CCB for which receive data has been processed. + +The RECEIVE command remains active to receive any data that follows. Therefore, once a RECEIVE command is issued for a station, it continues to be active until terminated by an exception condition, until a RECEIVE.CANCEL is issued for the RECEIVE, or until the SAP or link station is closed. + +When a DLC.CLOSE.SAP or DLC.CLOSE.STATION command is issued, the RECEIVE command associated with that SAP or station is terminated with a CCB_RETCODE of X'0A', and the address of the RECEIVE command CCB is placed in the CCB_POINTER field of the command causing the SAP or station to close. The RECEIVE command's completion appendage is not taken. + +When the RECEIVE command has been issued with RCV_DATA_APPNDG set, and data has been received successfully, this command never actually completes with a return code of X'00'. However, when data is received successfully, there is an implied return code of X'00'. The actual return code remains X'FF' (command in process). A return code is set only when the command is terminated, for example, when a lost data condition occurs or if the RCV_DATA_APPNDG was not set when the command was issued. + +Valid Return Codes: See "CCB Return Codes Listed by Command" in topic B.2.1. + +Parameters: + +Table 3-48. CCB Parameter Table for RECEIVE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OffsetParameter NameByte Length8086 TypeDescription
0STATION_ID2DWDefines the station receiving data.
2USER_LENGTH2DWLength of user data in buffers.
For CCB1:
4RECEIVED_DATA4DDAddress of the receive data appendage.
For CCB2:
4RECEIVE_FLAG4DDOptional receive user flag.
For CCB3:
4RCV_DATA_APPNDG2DWOffset to receive data appendage.
62DWReserved for the application program. Can be used for segment or selector.
For all CCBs:
8FIRST_BUFFER4DDFirst receive buffer address from the adapter.*
12OPTIONS1DBRECEIVE options.
+ +Copyright IBM Corp. 1986, 1996 +3.3.39 - 2 + +--- + + +## Page 212 + +LAN Technical Reference: 802.2 and NetBIOS APIs +RECEIVE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
For CCB2:
133DBReserved.
16RCV_READ_OPTION1DBRead posting option.
For CCB3:
133DBReserved.
161DBReserved for the application program.
* Indicates a returned value.
+ +STATION_ID + +**Explanation:** Defines the station and the kind of data the station will receive. The station ID is defined in "Stations, SAPs, and IDs" in topic 2.7.1. It identifies the station to receive data as follows: + +X'0000' Direct station, receive both MAC and non-MAC frames. Direct station receives only non-MAC frames on the PC Network or Ethernet. + +X'0001' Direct station, receive MAC frames. Not used on the PC Network or Ethernet. Reserved for the Token-Ring Network. + +X'0002' Direct station, receive non-MAC frames. + +X'nn00' SAP, receive data for SAP 'nn'. + +X'nnss' Link station, receive data for SAP 'nn', station 'ss'. + +Every station that is defined to the adapter can have a RECEIVE command pending, but there can be only one RECEIVE command for any specific station. + +**Note:** If no RECEIVE command is active for link station X'nnss', the frame received by the adapter for the link station is received by SAP X'nn00' if it has a RECEIVE command active. + +USER_LENGTH + +**Explanation:** This field specifies the length of a user space in the buffer for private data. The data placed in the receive buffer starts at an offset specified by the USER_OFFSET field of the receive buffer. The information placed in the user space is not altered by the protocol driver nor is it overwritten by the received frame data. See "Buffer Pools" in topic 2.9.1 for the receive buffer. + +RECEIVED_DATA + +**Explanation:** The address of a user-provided appendage routine that is taken when data is received. By coding this parameter, the application program can receive data and keep the same RECEIVE command active to receive subsequent data. + +RECEIVE_FLAG + +**Explanation:** This is a user flag that specifies whether or not received data should be posted using the READ command specifying notification for receive data. By setting this flag to a non-zero value, the application program can receive data and keep the same RECEIVE command active to receive subsequent data. + +RCV_DATA_APPNDG + +**Explanation:** This is the offset of the receive data appendage where received data is posted to the application program. This address offset is passed to the application program's device driver intercommunication entry point in register DI when the protocol driver calls the application program's device driver. + +FIRST_BUFFER + +**Explanation:** + +For CCB1 and CCB3: A returned value indicating the address of the first buffer. This is the same address value that is placed in registers ES and BX. If the address is X'00000000', there is no receive data. + +For CCB2: A returned value. If no RECEIVE_FLAG is specified, the address of the first receive buffer is placed into this field. This is the same value placed in the READ command's CCB parameter table when a READ command requesting notification of receive data is completed. If the address is X'00000000', there is no receive data. + +OPTIONS + +**Explanation:** Options set by the application program to inform the protocol driver how to present received information to the + +Copyright IBM Corp. 1986, 1996 +3.3.39 - 3 + +--- + + +## Page 213 + +application program. + + + + + + + + + + + + + + + + + + + + + + + + + + +
BitsDescription
7Contiguous MAC. This is not used on PC Network and is applicable only if the received frame is a MAC frame.
☐ If this bit is on, the entire frame is placed into the buffers as a continuous data string after the USER_SPACE. See "Receive Buffers" in topic 2.9.2 for a discussion of contiguous and non-contiguous buffers.
☐ If this bit is off, the 32-byte LAN header is removed from the frame and is placed in a special location in buffer 1. In this case, the data is stored in a non-contiguous buffer.
6Contiguous data and is applicable only if the received frame is a non-MAC frame.
☐ If this bit is on, the entire frame is placed into the buffers as a continuous data string. Buffer 1 contains contiguous data in this case.
☐ If this bit is off, the 32-byte LAN header is placed in buffer 1, followed by the DLC header and all the received data. In this case, the non-contiguous buffer data format is used.
5Break. If this bit is on, the first received data is placed in the second receive buffer. The first buffer contains only the buffer header data.
4-0These bits are reserved and should be zero, but they are not checked.
+ +RCV_READ_OPTION + +**Explanation:** This field is used only when the RECEIVE_FLAG is set to a non-zero value. + +Frames that have been received are destined for SAP stations, link stations, or one of the direct stations. If a RECEIVE command has been issued for a SAP station but not for any of the link stations opened under the SAP, then data received for the link station is received using the SAP's RECEIVE command. In this case, it is possible for the application program to issue a READ command requesting receive data for a link station. If RECEIVE commands have been issued for all link stations opened under a SAP, it is also possible for a READ command to be issued requesting receive data for a SAP and its link stations. To prevent the application program from having to issue a READ command for each frame received, received frames can be chained together. To do this, the application program must specify ahead of time how received frames are to be chained. The RCV_READ_OPTION field should be set as described below to allow these chained frames: + +☐ If the RCV_READ_OPTION field contains a X'00', received frames are not chained. + +This option specifies that received frames for the station are to be placed separately onto the protocol driver's completion list. A READ command will have to be issued to retrieve each frame from the completion list. + +☐ If the RCV_READ_OPTION field contains a X'01', all frames received for a link station are chained. + +This option specifies that received frames for the station are to be chained onto the protocol driver's completion list for the specified station ID. A single READ command can be issued to retrieve all chained frames from the completion list for this station ID. If the RECEIVE command is for a SAP station, this option has the same effect as a RCV_READ_OPTION field containing X'02' for frames received for the SAP station. + +☐ If the RCV_READ_OPTION field contains X'02', all frames received for a SAP are chained. + +This option specifies that received frames for the station ID are to be chained onto the protocol driver's completion list. All frames received for a SAP and its link stations are chained together. A single READ command can be issued to retrieve all chained frames from the completion list for this link station. + +If RECEIVE commands have been issued for link stations, the options specified with the link station's RECEIVE commands are used to determine how receive data is chained. If a link station has a RECEIVE command pending specifying that its received frames should be chained on a link station basis, its frames would not be chained together with the SAP's frames. All link stations that do not have a RECEIVE command pending will have their received frames chained as specified by the SAP's RECEIVE command. For example, if a link station did not have a RECEIVE command pending, but the SAP did have one specifying that no received frames be chained, all frames received for the link station and the SAP would be placed onto the protocol driver's completion list individually. If neither the SAP nor the link station had a RECEIVE command pending, the direct station would be used. See "Stations, SAPs, and IDs" in topic 2.7.1. + +**Notes:** + +1. The RCV_READ_OPTION for the SAP and the link station are independent of each other. The option specified for a link station's RECEIVE command is considered first when determining if received frames are to be chained. A RECEIVE command does not have to be outstanding for a SAP in order to have received frames for link stations chained on a SAP basis. Consequently, this requires that link stations have RECEIVE commands outstanding with RCV_READ_OPTION set to X'02'. + +2. If the value of the RCV_READ_OPTION field is not within the range of X'00' to X'02', the command terminates with CCB_RETCODE of X'06'. + +3. The RCV_READ_OPTION of a SAP's RECEIVE command is used to determine how the SAP's receive data is chained. + +4. The RCV_READ_OPTION of a link station's RECEIVE command is used to determine how the link station's receive data is chained. + +<page_number>3.3.39 - 4</page_number> + +--- + + +## Page 214 + +LAN Technical Reference: 802.2 and NetBIOS APIs +RECEIVE + +5. The RCV_READ_OPTION of a SAP's RECEIVE command is used to determine how link station receive data for the SAP is chained when its link stations do not have RECEIVE commands outstanding. + +6. A single RECEIVE command for a SAP (RCV_READ_OPTION = X'00') can be used to receive all data for a SAP and its link stations with each received frame being placed separately on the completion list. + +7. A single RECEIVE command for a SAP (RCV_READ_OPTION = X'01') can be used to chain all receive data for a SAP and its link stations on individual station ID queues using a separate completion list entry for each station ID. + +8. A single RECEIVE command for a SAP (RCV_READ_OPTION = X'02') can be used to chain all receive data for a SAP and its link station on a single SAP queue using one completion list entry. + +9. READ commands need to match RECEIVE commands' RCV_READ_OPTION settings. + +For information on receive buffers, see "Buffer Pools" in topic 2.9.1. + +
Copyright IBM Corp. 1986, 1996 +3.3.39 - 5
+ +--- + + +## Page 215 + +LAN Technical Reference: 802.2 and NetBIOS APIs +RECEIVE.CANCEL + +3.3.40 RECEIVE.CANCEL + +``` ++---- Hex 29 --------------------------------------------------------+ +| | +| RECEIVE.CANCEL | +| | ++-------------------------------------------------------------------+ +``` + +**Command Description:** This command cancels a RECEIVE command on any specific SAP or link station, including the direct station. + +**Command Specifics:** The station ID specifies the SAP or station of a pending receive that is to be canceled. This command is executed entirely in the workstation. The return code is available to the application program upon return from the protocol driver. + +The canceled RECEIVE CCB, if there is one, is terminated with a CCB_RETCODE value of X'0A' (command canceled by user request) and its address is returned in the CCB_POINTER field of the RECEIVE.CANCEL command. + +**For CCB1 and CCB3:** The RECEIVE command's completion appendage is not taken. However, the RECEIVE.CANCEL command's completion appendage is taken, if provided. + +**For CCB2:** If a READ command is pending that requests notification of receive data, the cancellation of a RECEIVE will not affect the READ. The READ command is not executed, and the READ command is not posted except for the setting of the return code. The RECEIVE.CANCEL commands are posted as defined by the CCB_CMPL_FLAG and CCB_SEMAPHORE parameters. + +**Valid Return Codes:** See "CCB Return Codes Listed by Command" in topic B.2.1. + +**Parameters:** + +**For CCB1:** The station ID is located at the CCB_PARM_TAB field of the control block. + +**For CCB2 and CCB3:** The station ID is located at the CCB_PARM_OFFSET field of the control block. + +
Copyright IBM Corp. 1986, 1996
+<page_number>3.3.40 - 1</page_number> + +--- + + +## Page 216 + +3.3.41 RECEIVE.MODIFY + +``` ++---- Hex 2A --------------------------------------------------------+ +| | +| RECEIVE.MODIFY | +| | ++--------------------------------------------------------------------+ +``` + +**Command Description:** This command is for CCB1 and CCB3 only. It receives data and puts some of the data into a buffer not taken from the SAP buffer pool. + +**Command Specifics:** This command operates in the same way as the RECEIVE command, with the following exceptions: + +☐ There are no receive options in the parameter table. + +☐ Only data (non-MAC) frames can be received. + +☐ Data is received into one SAP buffer and one user buffer. + +☐ The format of received data (that is, the data following the DLC header) is assumed to be: + +``` + llllhh...hhdd...dd +``` + +where: + +- llll is a 2-byte field whose value is its own length (2 bytes) plus the length in bytes of the hh...hh field. The length field (llll) has a format defined as DW. +- hh...hh is a message header. +- dd...dd is message data. + +☐ When data is received, a SAP buffer is obtained by the protocol driver. + +**For CCB1:** + +☐ The first 58 bytes of the SAP buffer are prepared exactly as when executing a RECEIVE command with the option not continuous data. + +☐ At byte 58 (plus user length, if applicable), the received llllhh...hh is placed into the SAP buffer. (If the data [llllhh...hh] exceeds the length of the buffer, the frame is discarded by the protocol driver and no indication is given to the application program.) + +☐ The protocol driver calls a subroutine defined in the SUBROUTINE@ parameter to obtain the length and location of an application program buffer. + +An option is to call the RECEIVE_DATA appendage once data has been placed into the application program's buffer. + +**For CCB3:** + +☐ The first 62 bytes of the SAP buffer are prepared exactly as when executing a RECEIVE command with the option not continuous data. + +☐ At byte 62 (plus user length, if applicable), the received llllhh...hh is placed into the SAP buffer. (If the data [llllhh...hh] exceeds the length of the buffer, the frame is discarded by the protocol driver and no indication is given to the application program.) + +☐ The protocol driver calls the application program's device driver intercommunication entry point, passing the offset of a subroutine address (SUBROUTINE@) in the DI register. This call is made by the protocol driver to obtain the length and location of an application program buffer. + +An option is to call the application program's device driver intercommunication entry point with the RCV_DATA_APPNDG parameter passed in the DI register, once data has been placed into the application program's buffer. + +**Valid Return Codes:** See "CCB Return Codes Listed by Command" in topic B.2.1. + +**Parameters:** + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 3-49. CCB Parameter Table for RECEIVE.MODIFY
OffsetParameter NameByte Length8086 TypeDescription
0STATION_ID2DWDefines the station receiving data
2USER_LENGTH2DWLength of user data in
+ +--- + + +## Page 217 + +LAN Technical Reference: 802.2 and NetBIOS APIs +RECEIVE.MODIFY + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
buffers
For: CCB1:
4RECEIVED_DATA4DDOptional user exit for received data
For: CCB3:
4RCV_DATA_APPNDG2DWReceived data appendage offset
62DWReserved for the application program
For CCB1 and CCB3:
8FIRST_BUFFER4DDFirst receive buffer address *
For CCB1:
12SUBROUTINE@4DDThe address of a subroutine
For CCB3:
12SUBROUTINE@2DWOffset to the subroutine
142DWReserved for the application program
+ +* Indicates a returned value. +@ Indicates an address throughout this book. + +--- + +**STATION_ID** + +**Explanation:** Defines the station and the kind of data the station will receive. The station ID is defined in "Stations, SAPs, and IDs" in topic 2.7.1. It identifies the station to receive data as follows: + +X'0000' Direct station, receive non-MAC frames only +X'0002' Direct station, receive non-MAC frames +X'nn00' SAP, receive data for SAP 'nn' +X'nnss' Link station, receive data for SAP 'nn', station 'ss'. + +Every station that is defined for this adapter can have a RECEIVE or RECEIVE.MODIFY command pending, but there can be only one RECEIVE or RECEIVE.MODIFY command for any specific station. + +--- + +**USER_LENGTH** + +**Explanation:** This field specifies the length of a user space in the buffer for private data. The data placed in the receive buffer starts at an offset specified by the USER_OFFSET field of the receive buffer. The information placed in the user space is not altered by the protocol driver or the received frame data. See "Buffer Pools" in topic 2.9.1 for the receive buffer. + +--- + +**RECEIVED_DATA** + +**Explanation:** This is the address of an appendage routine provided by the application program that is used to receive data. By coding this parameter the application program can receive data and keep the same RECEIVE.MODIFY command active to receive subsequent data. + +When the protocol driver has updated the buffer returned by the application from the call to SUBROUTINE@, the receive appendage is called to post the reception of data. See "RECEIVE" in topic 3.3.39 for register usage when the receive appendage is called to post the reception of data. + +When the application program's receive appendage is called to post the reception of data, bytes 6 and 7 (LENGTH_IN_BUFFER) of the SAP buffer referenced by ES and BX is set to the length of the data moved into the buffer returned by the application from the call to SUBROUTINE@. If the received data is more than what will fit in this buffer, bytes 6 and 7 are set to X'FFFF', and any excess data is lost. + +Upon return, the SAP buffer is returned to the available pool. + +--- + +**RCV_DATA_APPNDG** + +**Explanation:** This is an address offset of the receive data appendage where receive modify data information is posted to the application program. + +When the protocol driver has updated the user buffer obtained from the SUBROUTINE@ call with the received data, the application + +Copyright IBM Corp. 1986, 1996 +<page_number>3.3.41 - 2</page_number> + +--- + + +## Page 218 + +LAN Technical Reference: 802.2 and NetBIOS APIs +RECEIVE.MODIFY + +program's device driver is called with this receive appendage offset passed in register DI. The protocol driver enters the application program device driver's intercommunication entry point with a Call Far instruction, and the application program's device driver must return with a Return Far instruction. This call is made using the application program's device driver entry point obtained when the DIR.OPEN.ADAPTER command is issued. See "RECEIVE" in topic 3.3.39 for register usage when the application program is called to post the reception of data. + +When the application program device driver's receive data appendage is called to post the reception of data, bytes 6 and 7 (LENGTH_IN_BUFFER) of the SAP buffer referenced by ES and BX is set to the length of the data moved into the user's receive buffer starting at offset 34 (SOURCE_ADDRESS). If the received data is more than what will fit in the user's receive buffer, bytes 6 and 7 are set to X'FFFF', and any excess data is lost. + +Upon return, the SAP buffer is returned to the available pool. + +FIRST_BUFFER + +**Explanation:** This is a returned value indicating the address of the first buffer. This is the same address value that is placed in registers ES and BX. If the address is X'00000000', there is no receive data. + +SUBROUTINE@ + +**Explanation:** + +**For CCB1:** The address of a subroutine or appendage that the protocol driver calls to obtain the address and length of an additional user buffer. The protocol driver enters the subroutine with a Call Far instruction, and the subroutine must return with a Return Far instruction. This field must be provided. When the SUBROUTINE@ is entered, the following parameters are set: + +☐ Registers ES and BX point to the SAP buffer. + +☐ Registers ES and DI point to offset 30 of the SAP buffer (the source address of the frame). + +☐ Registers AX and SI point to the adapter's node address. + +☐ Register CX contains the adapter number. + +☐ Register DX contains the number of bytes left in the frame. + +When the appendage subroutine is completed, it must set the AL register and issue a Return Far instruction. + +If the AL register is set to zero, then: + +☐ Registers ES and DI point to a receive buffer. + +☐ Register CX indicates the length of the receive buffer. + +If the AL register is not set to zero, then: + +☐ The protocol driver returns the SAP buffer to the pool. + +☐ The received data is discarded. + +☐ The received data appendage is not taken. + +If the frame is an I-format LPDU, it is treated by the adapter's DLC logic as if it had been successfully received. + +**For CCB3:** This is the address offset of the application program's subroutine that the protocol driver calls to obtain a user's buffer length and address. The protocol driver enters the application program's device driver with a Call Far instruction, and the application program's device driver must return with a Return Far instruction. + +When data is received, the application program's device driver is called to obtain a buffer. This call is made using the application program's device driver entry point obtained when the DIR.OPEN.ADAPTER command is issued. For this call, the following parameters are set: + +☐ Register DI contains the offset of a subroutine within the application program's device driver code segment. + +☐ Register DS contains the called device driver's protect mode data segment selector. + +☐ Registers ES and BX contain a virtual address to a SAP buffer. + +☐ Registers AX and SI contain a virtual address to this adapter's node address. + +☐ Register CX contains the adapter number. + +☐ Register DX contains the number of bytes of the frame that have not been removed from the adapter's receive buffers. + +Before returning from the SUBROUTINE@ call, the application program's device driver must set the AL register to indicate to the protocol driver what action is to be taken. + +If the AL register is set to zero, then: + +☐ Registers DX and BX contain a 32-bit physical address of a user receive buffer, where DX contains the most significant word of the address. + +☐ Register CX contains the length of the user receive buffer. + +Copyright IBM Corp. 1986, 1996 +3.3.41 - 3 + +--- + + +## Page 219 + +LAN Technical Reference: 802.2 and NetBIOS APIs +RECEIVE.MODIFY + +If AL register is not set to zero, then: + +☐ The protocol driver returns the SAP buffer to the available pool. + +☐ The received frame is discarded. If the discarded frame is an I-format LPDU, the frame is treated by the adapter's DLC logic as if it had been successfully received. + +☐ The received data appendage is not taken. + +See "Buffer Pools" in topic 2.9.1 for more information. + +
Copyright IBM Corp. 1986, 1996 +3.3.41 - 4
+ +--- + + +## Page 220 + +LAN Technical Reference: 802.2 and NetBIOS APIs +TRANSMIT.DIR.FRAME + +3.3.42 TRANSMIT.DIR.FRAME + +``` ++---- Hex 0A --------------------------------------------------------+ +| | +| TRANSMIT.DIR.FRAME | +| | ++-------------------------------------------------------------------+ +``` + +**Command Description:** This command transmits data for the *direct station*. + +**Command Specifics:** This command can be used only for the direct stations. It is invalid for all station IDs except direct stations. + +The entire transmission frame must be prepared by the application program, including the LAN header and any required data headers. + +The LAN header in the user's buffer must reserve the space for the adapter to insert the source address. The user's buffer is not altered. The adapter sets the source address into the transmit buffer in shared RAM. However, the protocol driver passes the high-order bit of the source address, used to indicate the presence of routing information as supplied by the application program, to the adapter. The high-order bit is loaded, as it was supplied, into shared RAM. The adapter verifies that the access priority and source class (MAC frames only) are valid. MAC frames do not exist on the PC Network or on Ethernet. See Figures 2-7, 2-8, and 2-9 starting on topic 2.9.3.1 for the configuration of the header. + +See "Transmit Command Specifics" in topic 3.3.48.1 for information common to all TRANSMIT commands. + +
Copyright IBM Corp. 1986, 1996
+<page_number>3.3.42 - 1</page_number> + +--- + + +## Page 221 + +3.3.43 TRANSMIT.I.FRAME + +``` ++--- Hex 0B ---------------------------------------------------------------+ +| | +| TRANSMIT.I.FRAME | +| | ++--------------------------------------------------------------------------+ +``` + +**Command Description:** This command transmits "information" data for a link station. + +**Command Specifics:** This command can be used only for a link station. The only data supplied by the application program is the actual data portion of the message. The LAN and DLC headers are not built by the application program. The DLC code handles all transmission retries. The maximum size of the user data provided with this command is limited to the DHB size minus 6 bytes. + +See "Transmit Command Specifics" in topic 3.3.48.1 for information common to all TRANSMIT commands. + +Subtopics +3.3.43.1 Transmit Completion + +
Copyright IBM Corp. 1986, 1996 +3.3.43 - 1
+ +--- + + +## Page 222 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Transmit Completion + +3.3.43.1 Transmit Completion + +Under normal conditions, this command terminates when verification of its receipt has been received from the receiving link station. Since link stations are controlled by the DLC functions, DLC information is exchanged to verify delivery at the link level in addition to the verification at the physical level. + +For CCB1: + +* If the return code is X'00' and the link station's MAXOUT parameter is not a value of 1, multiple TRANSMIT.I.FRAME commands for a given link station may be completed at the same time. All frames acknowledged by a specific received acknowledgment are completed at the same time for a given link station. The completed TRANSMIT.I.FRAME commands for a given link station are queued in the order in which they were issued, each one pointing to the next by the CCB_POINTER field until the last CCB, which has zeros in the field. The protocol driver takes the appendage exit of the first CCB in the queue. +* In a case where TRANSMIT commands are queued and an abortive condition occurs, all pending TRANSMIT.I.FRAME commands for a given link station are queued and ended with appropriate return codes, as described in the previous step. + +If the return code is X'28', the link station enters the disconnected mode. Once the station is in the disconnected mode, the application program will have to reestablish the connection before continuing transmission. See "Link Station States" in topic 2.8.3. + +For CCB2: + +If the application program has specified that each TRANSMIT.I.FRAME's CCB be placed onto the protocol driver's internal completions list (setting CCB_CMPL_FLAG), the following occurs: + +* If a READ command is pending, or when a READ command is issued requesting notification of completed TRANSMIT commands or command completions, then the READ command is posted. The READ command's CCB parameter table will contain a pointer to a single TRANSMIT.I.FRAME CCB or a chain of TRANSMIT.I.FRAME CCBs (if chaining is specified in the TRANSMIT commands). +* In a case where TRANSMIT commands are chained and an abortive condition occurs (for example, link lost), all pending TRANSMIT.I.FRAME commands are chained and completed, as previously explained. + +If the return code is X'28', the link station enters the disconnected mode. Once the station is in the disconnected mode, the application program will have to reestablish the connection before continuing transmission. See "Link Station States" in topic 2.8.3. + +
Copyright IBM Corp. 1986, 1996 +3.3.43.1 - 1
+ +--- + + +## Page 223 + +LAN Technical Reference: 802.2 and NetBIOS APIs +TRANSMIT.TEST.CMD + +3.3.44 TRANSMIT.TEST.CMD + ++--- Hex 11 -----------------------------------------------------------+ +| | +| TRANSMIT.TEST.CMD | +| | ++--------------------------------------------------------------------+ + +**Command Description:** This command requests the adapter to transmit a test command frame with the poll bit set. This command can be used only for a SAP. + +**Command Specifics:** The adapter provides the DLC header. The application program must provide the LAN header and the optional test information. The first buffer must contain only the LAN header. + +See "Transmit Command Specifics" in topic 3.3.48.1 for information common to all TRANSMIT commands. + +
Copyright IBM Corp. 1986, 1996 +3.3.44 - 1
+ +--- + + +## Page 224 + +LAN Technical Reference: 802.2 and NetBIOS APIs +TRANSMIT.UI.FRAME + +3.3.45 TRANSMIT.UI.FRAME + +``` ++--- Hex 0D -----------------------------------------------------------+ +| | +| TRANSMIT.UI.FRAME | +| | ++--------------------------------------------------------------------+ +``` + +**Command Description:** This command transmits unnumbered information data for a SAP. This command can be used only for a SAP. + +**Command Specifics:** The adapter provides the DLC header information. The application program must provide the LAN header and data portions of the message. The first buffer must contain only the LAN header. + +See "Transmit Command Specifics" in topic 3.3.48.1 for information common to all TRANSMIT commands. + +
Copyright IBM Corp. 1986, 1996 +3.3.45 - 1
+ +--- + + +## Page 225 + +LAN Technical Reference: 802.2 and NetBIOS APIs +TRANSMIT.XID.CMD + +3.3.46 TRANSMIT.XID.CMD + +``` ++--- Hex 0E -----------------------------------------------------------+ +| | +| TRANSMIT.XID.CMD | +| | ++--------------------------------------------------------------------+ +``` + +**Command Description:** This command transmits an XID command with the poll bit set on. + +**Command Specifics:** This command can be used only for a SAP. The user provides the LAN header and data field. The user must also leave room for the DLC header that is provided by the protocol driver. If the SAP option indicates that the adapter handles XID commands, the adapter will provide the data. The first buffer must contain only the LAN header. + +See "Transmit Command Specifics" in topic 3.3.48.1 for information common to all TRANSMIT commands. + +
Copyright IBM Corp. 1986, 1996 +3.3.46 - 1
+ +--- + + +## Page 226 + +LAN Technical Reference: 802.2 and NetBIOS APIs +TRANSMIT.XID.RESP.FINAL + +3.3.47 TRANSMIT.XID.RESP.FINAL + +``` ++--- Hex 0F -----------------------------------------------------------+ +| | +| TRANSMIT.XID.RESP.FINAL | +| | ++--------------------------------------------------------------------+ +``` + +**Command Description:** This command transmits an XID response with the final bit on. + +**Command Specifics:** This command can be used only for a SAP opened with the SAP option specifying that the application program will handle XID commands. The user provides the LAN header and data field. The user must also leave room for the DLC header that is provided by the protocol driver. The first buffer must contain only the LAN header. + +See "Transmit Command Specifics" in topic 3.3.48.1 for information common to all TRANSMIT commands. + +
Copyright IBM Corp. 1986, 1996 +3.3.47 - 1
+ +--- + + +## Page 227 + +LAN Technical Reference: 802.2 and NetBIOS APIs +TRANSMIT.XID.RESP.NOT.FINAL + +3.3.48 TRANSMIT.XID.RESP.NOT.FINAL + ++--- Hex 10 -----------------------------------------------+ +| TRANSMIT.XID.RESP.NOT.FINAL | ++--------------------------------------------------------+ + +**Command Description:** This command transmits an XID response with the final bit off. + +**Command Specifics:** This command can be used only for a SAP opened with the SAP option specifying the application program will handle XID commands. The user provides the LAN header and data field. The user must also leave room for the DLC header that is provided by the protocol driver. The first buffer must contain only the LAN header. + +See "Transmit Command Specifics" in topic 3.3.48.1 for information common to all TRANSMIT commands. + +Subtopics +3.3.48.1 Transmit Command Specifics + +
Copyright IBM Corp. 1986, 1996 +3.3.48 - 1
+ +--- + + +## Page 228 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Transmit Command Specifics + +3.3.48.1 Transmit Command Specifics + +The seven TRANSMIT commands are variations of the same basic TRANSMIT command. The command completion, parameter table and field explanations, and return codes are explained here. All differences are noted with the specific command description. + +Command Completion: The TRANSMIT command terminates when the frame has been transmitted and read back in by the adapter. + +For CCB2: To reduce the number of READ commands that must be issued to receive notification of completed TRANSMIT commands, the application program can specify that completed TRANSMIT CCBS be chained together. Once TRANSMIT CCBs are chained, a single READ command can be issued to retrieve all completed TRANSMIT CCBs at a given time. + +Valid Return Codes: See "CCB Return Codes Listed by Command" in topic B.2.1. + +Parameters: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 3-50. CCB Parameter Table for TRANSMIT Commands
OffsetParameter NameByte Length8086 TypeDescription
0STATION_ID2DWDefines the station sending data
21DBReserved
3RSAP1DBRemote SAP value
4XMIT_QUEUE_ONE4DDAddress of the first transmit queue
8XMIT_QUEUE_TWO4DDAddress of the second transmit queue
12BUFFER_LEN_ONE2DWLength of transmit buffer BUFFER_ONE
14BUFFER_LEN_TWO2DWLength of transmit buffer BUFFER_TWO
16BUFFER_ONE4DDThe address of the first transmit buffer
20BUFFER_TWO4DDThe address of the second transmit buffer
For CCB2:
24XMIT_READ_OPTION1DBRead posting option
For CCB3:
241DBReserved for the application program
* Indicates a returned value.
+ +STATION_ID + +Explanation: Defines what station is sending the data. The station ID is explained in "Stations, SAPs, and IDs" in topic 2.7.1. It identifies the station that is transmitting data as follows: + +X'00nn' Direct station, transmit both MAC and non-MAC frames (TRANSMIT.DIR.FRAME only). MAC frames do not exist on the PC Network or on Ethernet. + +X'nn00' SAP, transmit data for SAP 'nn' (any transmit except TRANSMIT.DIR.FRAME and TRANSMIT.I.FRAME). + +X'nnss' Link station, transmit data for SAP 'nn', station 'ss' (TRANSMIT.I.FRAME only). + +Note: A station can have more than one TRANSMIT command pending at one time. The protocol driver will queue TRANSMIT commands. + +RSAP + +Copyright IBM Corp. 1986, 1996 +3.3.48.1 - 1 + +--- + + +## Page 229 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Transmit Command Specifics + +**Explanation:** The SAP value of the remote SAP that the sending (local) SAP is communicating with. + +This value is ignored if the sending station is a link station or a direct station. + +--- + +**XMIT_QUEUE_ONE** + +**Explanation:** The address of the first (or only) buffer in a queue of buffers to be transmitted. The data in all the buffers is transmitted as one frame. + +The buffers in this queue are not returned to the SAP buffer pool upon command completion. + +This transmit queue of buffers is not used if the value is X'00000000'. + +If the NEXT_BUF_POINTER field of the first buffer is not zero, there are additional buffers in this XMIT_QUEUE_ONE queue. + +See "Transmit Buffers" in topic 2.9.3 for details of transmit queues and buffers. + +--- + +**XMIT_QUEUE_TWO** + +**Explanation:** The address of the second queue of buffers to be transmitted. + +If there are buffers in XMIT_QUEUE_ONE, the data in XMIT_QUEUE_TWO buffers is transmitted following the data in XMIT_QUEUE_ONE buffers as one frame. + +Before taking an appendage exit or posting completion, the buffers in this queue are returned to the SAP buffer pool and this field set to zero upon command completion if the return code equals zero (X'00'). + +This transmit queue of buffers is not used if the value is X'00000000'. + +If the NEXT_BUF_POINTER field of the buffer is not zero, there are additional buffers in this XMIT_QUEUE_TWO queue. + +See "Transmit Buffers" in topic 2.9.3 for details of transmit queues and buffers. + +--- + +**BUFFER_LEN_ONE** + +**Explanation:** The length of the transmit buffer containing the data to be transmitted, located by the contents of the BUFFER_ONE field. + +If this field is 0, all the following fields (BUFFER_LEN_TWO, BUFFER_ONE, BUFFER_TWO, XMIT_READ_OPTION) are ignored. + +--- + +**BUFFER_LEN_TWO** + +**Explanation:** The length of the transmit buffer containing the data to be transmitted, located by the contents of the BUFFER_TWO field. + +If this field is 0, this buffer is not used. + +--- + +**BUFFER_ONE** + +**Explanation:** The address of the buffer containing data to be transmitted. The data is transmitted as one frame following the data in XMIT_QUEUE_ONE and XMIT_QUEUE_TWO. + +The length of the buffer is defined by BUFFER_LEN_ONE. + +The buffer is not used if BUFFER_LEN_ONE is 0. + +See "Transmit Buffers" in topic 2.9.3 for details of transmit queues and buffers. + +**For CCB3:** If this field is used to reference transmit data, it must be a 32-bit physical address, not a virtual address. + +--- + +**BUFFER_TWO** + +**Explanation:** The address of the buffer containing data to be transmitted. + +The length of the buffer is defined by BUFFER_LEN_TWO. The data is transmitted as one frame following the data in XMIT_QUEUE_ONE, XMIT_QUEUE_TWO, and BUFFER_ONE. + +The buffer is not used if BUFFER_LEN_TWO is 0. + +See "Transmit Buffers" in topic 2.9.3 for details of transmit queues and buffers. + +**For CCB3:** If this field is used to reference transmit data, it must be a 32-bit physical address, not a virtual address. + +--- + +**XMIT_READ_OPTION** + +**Explanation:** To eliminate the need to issue an individual READ command to receive notification for each completion of a TRANSMIT command, the application program can specify that completed TRANSMIT commands be chained together using the CCB_POINTER of each CCB. The XMIT_READ_OPTION must be set for each individual TRANSMIT command. Following is a list of the various XMIT_READ_OPTIONS: + +Copyright IBM Corp. 1986, 1996 +3.3.48.1 - 2 + +--- + + +## Page 230 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Transmit Command Specifics + +X'00' Chain this TRANSMIT command on a link station basis when this command is completed. This option is valid only for TRANSMIT.I.FRAME commands. + +X'01' Do not chain this TRANSMIT command when it completes. + +X'02' Chain this TRANSMIT command on a SAP station basis when this command completes. + +
Copyright IBM Corp. 1986, 1996 +3.3.48.1 - 3
+ +--- + + +## Page 231 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Chapter 4. NetBIOS + +4.0 Chapter 4. NetBIOS + +Subtopics +4.1 About This Chapter +4.2 NetBIOS Overview +4.3 IBM LAN Client NetBIOS Application Program Interface (API) +4.4 The Network Control Block +4.5 NetBIOS Operational Parameters +4.6 NetBIOS Command Descriptions + +
Copyright IBM Corp. 1986, 1996 +4.0 - 1
+ +--- + + +## Page 232 + +LAN Technical Reference: 802.2 and NetBIOS APIs +About This Chapter + +4.1 About This Chapter + +This chapter describes how NetBIOS can be used with any supported adapters to extend the adapter support software by permitting NetBIOS application programs to operate on the network. + +
Copyright IBM Corp. 1986, 1996
+<page_number>4.1 - 1</page_number> + +--- + + +## Page 233 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NetBIOS Overview + +4.2 NetBIOS Overview + +NetBIOS provides a communication interface between the application program and the attached medium. All communication functions from the physical layer through the session layer are handled by NetBIOS, the adapter support software, and the adapter card. + +A NetBIOS session is a logical connection between any two names on the network. A session is established by having an NCB.LISTEN issued from one name and an NCB.CALL issued from the other name. Once a session is established, two-way, guaranteed-delivery communication is possible between the two names. + +Two basic types of data transfer are supported. Reliable data transfer is provided by the session layer. If data is lost or errors occur, NetBIOS returns an error code to the application program through the NCB. Data transfer using datagram support goes directly to the link layer. This type of data transfer is "best effort" and receipt of data is not guaranteed. + +The following are needed to use NetBIOS application programs on an IBM network: + +☐ An IBM-supported network adapter + +☐ Adapter support software (provided by IBM LAN Client, LAN Support Program, OS/2 EE 1.3 or LAPS from NTS/2, ES 1.0, or LAN Server) + +☐ NetBIOS (provided by IBM LAN Client, LAN Support Program, OS/2 EE 1.3 or LAPS from NTS/2, ES 1.0, or LAN Server). + +NetBIOS maintains a table of names that the node is known by on the network. These names are provided to NetBIOS by the application program. A name can be a unique name or a group name. NetBIOS checks the network to verify that a unique name is not already in use at another adapter. A group name can be used by several adapters. Names are used as the basis for communication between application programs. If the name is in the NetBIOS name table, a session can be established. NetBIOS can have from 1 to 254 selectable names and one NAME_NUMBER_1. The default is 16 plus 1. All names are 16 characters long. The NAME_NUMBER_1 is always present and consists of 10 bytes of binary zeros followed by the adapter's universally administered address. This NetBIOS name is referred to as NetBIOS_NAME_NUMBER_1. + +For OS/2 EE 1.3: A maximum of 255 application programs (processes) can use NetBIOS 3.0 simultaneously. This number is the sum of application programs using the DLR interface and DD interface. + +OS/2 EE 1.3 supports adapter numbers 0 and 1. Adapter 00 in the NCB_ADPTR_NUM field indicates the primary adapter and 01 indicates the alternate adapter. + +For LAPS from NTS/2, ES 1.0, or LAN Server: LAPS from NTS/2, ES 1.0, or LAN Server supports up to four adapters. These adapters can be numbered with numbers in the range of 00-15. + +For all versions of OS/2 NetBIOS: Application programs cannot share resources across process boundaries. The application program or process that allocates the resource is the sole owner of that resource. + +
Copyright IBM Corp. 1986, 1996
+<page_number>4.2 - 1</page_number> + +--- + + +## Page 234 + +LAN Technical Reference: 802.2 and NetBIOS APIs +IBM LAN Client NetBIOS Application Program Interface (API) + +4.3 IBM LAN Client NetBIOS Application Program Interface (API) + +The IBM LAN Client NetBIOS NLM will support the current DOS NCB API with changes to the following NCBs: + +- The following NCBs are not supported: + - NCB.LAN.STATUS.ALERT + - NCB.CHAIN.SEND.NO.ACK + - NCB.SEND.NO.ACK + - NCB.UNLINK + +- NCB.RESET and NCB.STATUS. + +- NCB.TRACE function. + +Subtopics +4.3.1 NCB.RESET +4.3.2 NCB.STATUS (Adapter Status) + +
Copyright IBM Corp. 1986, 1996 +4.3 - 1
+ +--- + + +## Page 235 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB.RESET + +4.3.1 NCB.RESET + +IBM LAN Client NetBIOS NCB.RESET function differs from that in LAN Support Program as follows: + +☐ It will never cause the adapter to close. + +☐ It will not affect the maximum values for NCB.Commands and NCB.Sessions. + +
Copyright IBM Corp. 1986, 1996 +4.3.1 - 1
+ +--- + + +## Page 236 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB.STATUS (Adapter Status) + +4.3.2 NCB.STATUS (Adapter Status) + +IBM LAN Client NetBIOS returns the following settings in NCB.STATUS: + +☐ NetBIOS release 2.6. + +☐ Parameter type value of 2 (new parameters). + +The IBM LAN Client NetBIOS does support the extended status buffer in DOS memory. However, only the Locally Administered Address field of the extended status will be non-zero. + +
Copyright IBM Corp. 1986, 1996 +4.3.2 - 1
+ +--- + + +## Page 237 + +LAN Technical Reference: 802.2 and NetBIOS APIs +The Network Control Block + +4.4 The Network Control Block + +NetBIOS is operated using a control block called the Network Control Block (NCB). (The Token-Ring Network NCB is the same as the NCB in a PC Network.) + +Subtopics +4.4.1 NCB Field Explanations + +
Copyright IBM Corp. 1986, 1996 +4.4 - 1
+ +--- + + +## Page 238 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB Field Explanations + +4.4.1 NCB Field Explanations + +**Note:** Throughout this manual field names ending with @ indicate an address. + +The following table shows the contents of the NCB. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 4-1. Network Control Block (NCB)
OffsetParameter NameByte Length8086 TypeDescription
0NCB_COMMAND1DBCommand field
1NCB_RETCODE1DBReturn code
2NCB_LSN1DBLocal session number
3NCB_NUM1DBNumber of application program name
4NCB_BUFFER@4DDPointer to message buffer address (segment:offset)
8NCB_LENGTH2DWBuffer length in bytes
10NCB_CALLNAME16DBName on local or remote NetBIOS. This field has a different use for the NCB.CHAIN.SEND and the NCB.RESET commands.
26NCB_NAME16DBName on the local NetBIOS session. This field has a different use for the NCB.RESET command.
42NCB_RTO1DBReceive timeout
43NCB_STO1DBSend timeout
For all NetBIOS except the OS/2 Device Driver interface
44NCB_POST@4DDPointer to post routine (segment:offset) or X'00000000'
For NetBIOS using the OS/2 Device Driver interface
44NCB_POST@2DBA value returned to the post routine in register DI (0 = do not post)
46NCB_DD_ID2DBDevice driver identification
For all NetBIOS
48NCB_ADPTR_NUM1DBAdapter number
49NCB_CMD_CMPL1DBCommand status
50NCB_RESERVE14DBReserved area for all commands except NCB.RESET
+ +NCB_COMMAND + +**Explanation:** The command to be performed by the adapter. The high-order bit defines the wait/no-wait option. If the bit is set, the command uses the no-wait option; if the bit is clear, the command is a wait command. + +When an application program issues a "wait" command to NetBIOS, control is not returned to the application program until the command is complete. When the command has been executed, check either the AL register or the NCB_RETCODE field for the completion code. The memory allocated for the NCB should not be disturbed until the NCB has been completed. + +**For NetBIOS using the OS/2 DD interface:** With the exception of RESET and CANCEL, the NetBIOS DD interface does not have wait commands. + +When an application program issues a "no-wait" command to NetBIOS, control is returned to the application program at the earliest possible time, typically before the command is completed. With the no-wait option, two return codes are returned. An immediate return + +Copyright IBM Corp. 1986, 1996 +4.4.1 - 1 + +--- + + +## Page 239 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB Field Explanations + +code is returned when the command is accepted by NetBIOS and the final return code is returned with the command completion. If the immediate return code in the AL register is not X'00', NetBIOS does not proceed and, therefore, does not provide a final return code. + +When a no-wait command is completed, if the NCB_POST@ is 0, the completion code is set by NetBIOS. It is the responsibility of the application program to determine when NetBIOS is finished by periodically checking the completion code for a change from X'FF'. If NCB_POST@ is not 0, NetBIOS takes the address to be a post routine and after command completion, control is given to the post routine. See the description for the NCB_POST@ field on topic 4.4.1. + +--- + +NCB_RETCODE + +**Explanation:** The completion code as provided by NetBIOS. + +While the value is X'FF', the application program must not change either the control block or any data associated with the command. Below are descriptions of the other return code values: + +* A return code value of X'00' indicates successful completion of the command. +* Return code values of X'01' through X'2F' indicate terminations that are described in "NCB Return Codes" in topic B.4. +* Return code values of X'30' through X'40' indicate user errors that are described in "NCB Return Codes" in topic B.4. These return codes are only returned when you are using OS/2 EE 1.3. +* Return code values of X'41' through X'4F' indicate user errors that are described in "NCB Return Codes" in topic B.4. +* Return code values of X'50' through X'FE' indicate a workstation error or an adapter error and are described in "NCB Return Codes" in topic B.4. + +--- + +NCB_LSN + +**Explanation:** A 1-byte field indicating the local session number. This is the number of the session the application program has with another name on the network. This is valid only after an NCB.CALL or NCB.LISTEN command has been completed successfully. For send and receive commands under session support, this field must be provided. NetBIOS uses a modulo 254 technique to provide numbers from X'01' to X'FE'. + +The RESET command uses this field. This field is not used for datagram support. + +--- + +NCB_NUM + +**Explanation:** A 1-byte number provided by NetBIOS after an NCB.ADD.NAME or NCB.ADD.GROUP.NAME command is executed. This number, not the name, must be used with all datagram support commands and for NCB.RECEIVE.ANY commands. + +The number for NetBIOS_NAME_NUMBER_1 is always X'01'. NetBIOS uses a modulo 253 technique to provide numbers from X'02' to X'FE' for the remaining names. + +The RESET command uses this field. + +--- + +NCB_BUFFER@ + +**Explanation:** A 4-byte field containing the address of the buffer area assigned by the application program. This field is in define double-word (DD) format (segment:offset) and must be a valid address in workstation memory. + +**For NetBIOS using the OS/2 DD interface:** The address specified in the NCB_BUFFER@ field is the physical address. For exceptions see specific commands (such as NCB.RESET). + +--- + +NCB_LENGTH + +**Explanation:** This 2-byte field indicates the length in bytes of the data buffer. For receive commands, the field is updated by NetBIOS to indicate the number of bytes actually received. + +--- + +NCB_CALLNAME + +**Explanation:** This is a 16-byte name of a device that the application program needs to communicate with. The name can either be on your adapter or any other adapter. + +This field is also used by the NCB.RESET command. + +For an NCB.CHAIN.SEND or NCB.CHAIN.SEND.NO.ACK command, the first 6 bytes are used to specify the second buffer. The first 2 bytes are the length of the buffer and the remaining 4 bytes are the address of the buffer in memory. + +**For NetBIOS using the OS/2 DD interface:** The address specified in the NCB_CALLNAME field is a physical address. + +--- + +NCB_NAME + +**Explanation:** A name that the node is known by on the network. The name is 16 bytes long. The NetBIOS_NAME_NUMBER_1 can be used as a name. The NetBIOS_NAME_NUMBER_1 is 10 bytes of zeros followed by the 6 bytes of the NODE_ADDRESS. + +
Copyright IBM Corp. 1986, 1996
+<page_number>4.4.1 - 2</page_number> + +--- + + +## Page 240 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB Field Explanations + +For OS/2 EE 1.3: Also used by NCB.RESET for returned values. + +NCB_RTO + +**Explanation:** A 1-byte field used by the NCB.CALL and NCB.LISTEN commands to specify a timeout period for all receives associated with that session. The timeout value is specified in increments of 500 ms. If X'00' is specified, the default is no timeout. The timeout period can be different for each session, but is fixed when the session is established. The timeout period at the other end of the session can also be different. + +NCB_STO + +**Explanation:** A 1-byte field used by the NCB.CALL and NCB.LISTEN commands to specify a timeout period for all sends associated with that session. The timeout value is specified in increments of 500 ms. If X'00' is specified, the default is no timeout. The timeout period can be different for each session, but is fixed once the session is established. The timeout period at the other end of the session can also be different. Send timeouts should be used with caution because they always end the session if they expire. + +NCB_POST@ + +**Explanation:** If this field is not 0, it is an indication to NetBIOS that the application program has a post routine that gets control when the NCB is completed. + +The post routine should be as short in duration as possible. The register contents upon entry are listed next: +☐ AX = the NCB completion code (AH is always 0) +☐ ES and BX point to the NCB. + +If the post address is all zeros, the post routine is not called by NetBIOS and the application program must check the return code field for a change from X'FF'. + +For NetBIOS used with DOS: NCB_POST@ is a 4-byte address (segment:offset) that gets control. The application program returns control by issuing an "interrupt return" instruction. + +For NetBIOS using the OS/2 DLR interface: NCB_POST@ is a 4-byte address (selector:offset) that gets control. The application program returns control by issuing a "return" instruction (return from a "call"). + +For NetBIOS using the OS/2 DD interface: NCB_POST@ is a 2-byte number. NetBIOS gives control to the post routine by issuing a Call Far instruction with the value X'0002' pushed on the stack and with the value of NCB_POST@ in register DI. Register DS contains the application program's device driver data segment. Note that the Call Far instruction is made to the application program's device driver entry point. Control is returned to NetBIOS by issuing a "Return Far 2" instruction (to account for the X'0002' that was pushed on the stack). + +NCB_DD_ID + +**Explanation:** The identification number of the device driver. + +This field is supplied to the device driver application program by NetBIOS when the first NCB.RESET is completed. The application program must provide this value in all subsequent commands. + +NCB_ADPTR_NUM + +**Explanation:** Defines which adapter is to be used. For the LAN Support Program and OS/2 EE 1.3, use X'00' for the primary adapter and X'01' for the alternate adapter. For LAPS, this field can be set to numbers in the range X'00'-X'0F', but only four adapters are supported. The adapter must have the corresponding (primary/alternate) switch set correctly. Other values are reserved. + +NCB_CMD_CMPL + +**Explanation:** This value is the same as the NCB_RETCODE. + +NCB_RESERVE + +**Explanation:** A 14-byte reserved field. Used as a work area by NetBIOS. Also contains certain system information when an NCB is completed with either a X'4X' or X'FX' return code. + + + + + + + + + + + + + + + + + + + + + + + + +
Table 4-2. NCB_RESERVE for the LAN Support Program
Offset from NCB_RESERVELength in BytesMeaning
02Value of last adapter bring-up code
22Return code of last CCB open issued
+ +Copyright IBM Corp. 1986, 1996 +<page_number>4.4.1 - 3</page_number> + +--- + + +## Page 241 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB Field Explanations + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OffsetLength in BytesMeaning
42Last network status
62Last adapter check status
82Last PC error code
101Last CCB code generated by NetBIOS during NCB.RESET or initialization
111Return code of CCB in offset 10
+ +Table 4-3. NCB_RESERVE for OS/2 EE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Offset from NCB_RESERVELength in BytesMeaning
02Value of last adapter bring-up code
22Return code of last CCB open issued
42Last network status
62Last adapter check status
82OS/2 System Action Exception
102Last PC error code
121Last CCB code generated by NetBIOS during NCB.RESET or initialization
131Return code of CCB in offset 12
+ +
Copyright IBM Corp. 1986, 1996
+<page_number>4.4.1 - 4</page_number> + +--- + + +## Page 242 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NetBIOS Operational Parameters + +4.5 NetBIOS Operational Parameters + +There are three different methods of setting the NetBIOS operational parameters: + +☐ LAN Support Program old parameters + +☐ LAN Support Program parameters (see Appendix D, "The LAN Support Program Interrupt Arbitrator") + +This allows the user to modify the NetBIOS operational parameters at load time by adding the parameters to the device driver command line. + +☐ OS/2 NetBIOS 3.0 parameters (see Appendix E, "Operating System/2 Extended Edition Information"). + +This allows the user to modify the NetBIOS operational parameters by changing the Communications Manager configuration parameters. + +Subtopics +4.5.1 LAN Support Program Old Parameters +4.5.2 LAN Support Program New Parameters +4.5.3 NetBIOS 3.0 (OS/2 EE) +4.5.4 NetBIOS 4.0 +4.5.5 NetBIOS DLC Timers +4.5.6 NetBIOS Calling Conventions Using the LAN Support Program +4.5.7 NetBIOS Calling Conventions Using the Dynamic Link Routine Interface +4.5.8 NetBIOS Calling Conventions Using the Device Driver Interface +4.5.9 NCB Completion with Wait Type Commands +4.5.10 NCB Completion with No-Wait Type Commands + +
Copyright IBM Corp. 1986, 1996
+<page_number>4.5 - 1</page_number> + +--- + + +## Page 243 + +LAN Technical Reference: 802.2 and NetBIOS APIs +LAN Support Program Old Parameters + +4.5.1 LAN Support Program Old Parameters + +This allows the user to modify the NetBIOS operational parameters by using the DIR.OPEN.ADAPTER command. + +The parameters must be provided at open time and for each NCB.RESET command. If any of these parameters causes an error, the command terminates with a CCB_RETCODE or NCB_RETCODE as follows: + +* If it is a DIR.OPEN.ADAPTER command, the CCB_RETCODE is X'10'. This can occur if the NCB_MAX_NAMES or NCB_MAX_SESSIONS values are not less than 255, or if there is insufficient work space available to satisfy the values of NCB_STATIONS, NCB_MAX_NAMES, NCB_MAX, and NCB_MAX_SESSIONS. +* If it is a NetBIOS command, the NCB_RETCODE is X'FC'. This can occur if any of the remaining parameters are found to be invalid when NetBIOS issues its DLC.OPEN.SAP command. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 4-4. LAN Support Program Old Parameters
OffsetParameter NameByte Length8086 TypeDescription
04--Adapter work area
4NCB_TIMER_T11DBT1 value (response timer)
5NCB_TIMER_T21DBT2 value (acknowledgment timer)
6NCB_TIMER_TI1DBTi value (inactivity timer)
7NCB_MAXOUT1DBMaximum transmits without a receive acknowledgment
8NCB_MAXIN1DBMaximum receives without a transmit acknowledgment
9NCB_MAXOUT_INCR1DBDynamic window increment value
10NCB_MAX_RETRY1DBN2 value
111DBAdapter work area
123Reserved
15NCB_ACCESS_PRI1DBRing access priority
16NCB_STATIONS1DBMaximum NetBIOS link stations
1719--Adapter work area
36NCB_MAX_NAMES1DBMaximum names in names table
37NCB_MAX1DBMaximum outstanding NCBs
38NCB_MAX_SESSIONS1DBMaximum sessions
391DBReserved
401DBReserved
41NCB_OPTIONS1DBVarious options
42NCB_POOL_LENGTH2DWLength of area at NCB_POOL_ADDRESS
44NCB_POOL_ADDRESS4DDStarting segment of message work area
48NCB_TRANSMIT_TIMEOUT1DBTime to wait for one query
49NCB_TRANSMIT_COUNT1DBMaximum number of times to transmit queries
+ +NCB_TIMER_T1 + +Copyright IBM Corp. 1986, 1996 +4.5.1 - 1 + +--- + + +## Page 244 + +LAN Technical Reference: 802.2 and NetBIOS APIs +LAN Support Program Old Parameters + +**Explanation:** Specifies the time period between 1 and 10 used to determine an inoperative condition on a link. The time intervals are defined by the DIR.OPEN.ADAPTER command. If the value is 0, the default of 5 is used. See "NetBIOS DLC Timers" in topic 4.5.5. + +**NCB_TIMER_T2** + +**Explanation:** Specifies the time period between 1 and 10 used to delay transmission of an acknowledgment for a received I-LPDU for link stations using this SAP. The time intervals are defined by the DIR.OPEN.ADAPTER command. If the value is 0, the default of 2 is used. If the value is greater than 10, the acknowledgment timer is not implemented and acknowledgments will be sent at the earliest opportunity. See "NetBIOS DLC Timers" in topic 4.5.5. + +**NCB_TIMER_Ti** + +**Explanation:** Specifies the time period between 1 and 10 used to determine an inactive condition on a link. The time intervals are defined by the DIR.OPEN.ADAPTER command. If the value is 0, the default of 3 is used. See "NetBIOS DLC Timers" in topic 4.5.5. + +**NCB_MAXOUT** + +**Explanation:** Specifies the maximum number of sequentially numbered transmitted I-LPDUs that a link station on NetBIOS SAP can have pending at one time. The maximum valid value is 127. If the value is 0, the default of 2 is used. + +**NCB_MAXIN** + +**Explanation:** Specifies the maximum number of sequentially numbered received I-LPDUs that a link station on NetBIOS SAP can receive before sending an acknowledgment. The maximum valid value is 127. If the value is 0, the default of 1 is used. + +**NCB_MAXOUT_INCR** + +**Explanation:** This dynamic window increment value is used to reduce bridge congestion. If the two end points of a session are on different rings, and the adapter detects an error condition requiring retransmission, the MAXOUT counter is set to 1. It is then incremented by 1 each time MAXOUT_INCR frames are acknowledged by the remote station, until it reaches the value of this field. If this field is set to a value of 0, the default of 1 is used. For more details, refer to IBM Token-Ring Network Architecture Reference. + +**NCB_MAX_RETRY** + +**Explanation:** Specifies the number of retries for an unacknowledged command LPDU, or in the case of an I-LPDU timeout, the number of times that the non-responding remote link station will be polled with an RR/RNR command LPDU. The maximum valid value is 255. If the value is 0, the default of 8 is used. + +**NCB_ACCESS_PRI** + +**Explanation:** The transmit access priority value to be placed in the AC byte of all transmissions from the link station and SAP. The format is B'nnn00000', where 'nnn' is the access priority value. No checking is done and the low-order 5 bits are ignored. If the access priority is higher than allowed for the adapter, the error will be detected on the first transmission. + +**NCB_STATIONS** + +**Explanation:** The number of link stations that can be active at one time. This value must not exceed the value of DLC_MAX_STATIONS. During execution of an NCB.RESET command, this value must not exceed the current number of available link stations. If the value is 0, the default of 6 is used. + +**NCB_MAX_NAMES** + +**Explanation:** The maximum number of names that can be in the name table. The adapter itself is entered as a name, using one of the positions. The maximum valid value is 254. If the value is 0, the default of 17 is used. + +**NCB_MAX** + +**Explanation:** The number of NCBs that can be pending at one time. + +**Note:** This value indicates the number of "no-wait" and "wait" commands that can be issued. The maximum valid value is 255. If the value is 0, the default of 12 is used. + +**NCB_MAX_SESSIONS** + +**Explanation:** The maximum number of sessions that can be active at one time. The maximum valid value is 254. If the value is less than the value of NCB_STATIONS, the NCB_STATIONS value is used. + +**NCB_OPTIONS** + +**Explanation:** Various options that are each represented by a bit. If the bit has a value of B'1', the option is active. The high-order bit (bit 7) is the leftmost bit. The bits are described below: + +
Copyright IBM Corp. 1986, 1996
+<page_number>4.5.1 - 2</page_number> + +--- + + +## Page 245 + +LAN Technical Reference: 802.2 and NetBIOS APIs +LAN Support Program Old Parameters + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BitsDescription
Bit 7Auto open.
When received by the adapter system interface, bit 7 causes an NCB.RESET command to close and then open the adapter. If bit 7 is 0, the NCB.RESET command does not perform the close and ignores the fields containing the "number of sessions" and the "number of commands." (They remain as defined in the DIR.OPEN.ADAPTER command.)
Bit 6Reserved.
Bit 5This ring only.
When this bit is set on, NetBIOS assumes that all nodes are on the same ring.
Bits 4-0Reserved.
+ +NCB_POOL_LENGTH + +**Explanation:** The number of bytes of system memory assigned by the application program for the NetBIOS work area pool. If the value is 0, NetBIOS internal work area in system memory as defined at load time is used. + +NCB_POOL_ADDRESS + +**Explanation:** The starting address of the NetBIOS work-area pool for the adapter support software to build tables, buffers, and control blocks. If the NCB_POOL_LENGTH value is 0, this parameter is ignored. + +NCB_TRANSMIT_TIMEOUT + +**Explanation:** A value to define the amount of time that NetBIOS will wait for a response to a private query on the network (such as an "add name query"). The value is in half-second increments. A value of 10 represents a time of 5 seconds. If the value is 0, the default of 1 (1/2 second) is used. If the value is greater than 20, 20 (10 seconds) is used. + +NCB_TRANSMIT_COUNT + +**Explanation:** A value to define the number of times that private network queries, such as an "add name query," will be transmitted for a given command. If a query is transmitted more than one time, the next one is transmitted after the NCB_TRANSMIT_TIMEOUT expires. If the value is 0, the default of 6 is used. If the value is greater than 10, 10 is used. + +**NetBIOS Notes:** The following information is specific to NetBIOS versions lower than NetBIOS 3.0. + +The number of stations determines how many physical nodes the adapter can establish connection with at one time. + +The number of sessions determines how many different NetBIOS sessions can be active at one time. + +There can be multiple sessions on one station. + +NetBIOS provides internal work area in system memory as defined at load time for buffers and work area. The application program can define its own space by properly coding the NCB_POOL_ADDRESS and NCB_POOL_LENGTH parameters. + +To calculate whether additional work space in bytes is needed, use the following formula by adding the subtotals to 1900: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Maximum names (NCB_MAX_NAMES)* 20 =
Maximum stations (NCB_STATIONS)* 40 =
Maximum sessions (NCB_SESSIONS)* 44 =
Maximum commands (NCB_MAX)* 100 =
Number of transmit buffers* 100 =
+ 1900
Total =----------
+ +The remainder of the defined work area is configured as transmit buffers and there must be room for at least 10. + +All tables and buffers, except the receive buffers, must be in the same segment. Therefore, if these tables use more than the defined work area, the area defined by the application program must be large enough to hold all this information. + +The receive buffers are allocated by the adapter from the defined work area and any application program assigned memory after all other memory requirements are complete. + +
Copyright IBM Corp. 1986, 1996
+<page_number>4.5.1 - 3</page_number> + +--- + + +## Page 246 + +LAN Technical Reference: 802.2 and NetBIOS APIs +LAN Support Program New Parameters + +4.5.2 LAN Support Program New Parameters + +The new parameters are added to the NetBIOS driver command line. When the NetBIOS driver is loaded, the NetBIOS parameters become operational. Refer to the LAN Support Program User's Guide for a description of these parameters. + +
Copyright IBM Corp. 1986, 1996
+<page_number>4.5.2 - 1</page_number> + +--- + + +## Page 247 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NetBIOS 3.0 (OS/2 EE) + +4.5.3 NetBIOS 3.0 (OS/2 EE) + +This allows the user to modify the NetBIOS operational parameters with the Communications Manager configuration. See Appendix E, "Operating System/2 Extended Edition Information," for a complete description of these parameters. + +
Copyright IBM Corp. 1986, 1996
+<page_number>4.5.3 - 1</page_number> + +--- + + +## Page 248 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NetBIOS 4.0 + +4.5.4 NetBIOS 4.0 +For complete information about the parameters for NetBIOS 4.0, refer to the NTS/2 LAN Adapter and Protocol Support Configuration Guide. + +
Copyright IBM Corp. 1986, 1996 +4.5.4 - 1
+ +--- + + +## Page 249 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NetBIOS DLC Timers + +4.5.5 NetBIOS DLC Timers + +The LAPS implementation of NetBIOS allows the user to specify timer values directly in milliseconds. Timer values in previous releases must be calculated using tables. The following directory indicates the timer values (in seconds) when the various parameter values are used. + +These values are using the default DLC tick values. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DLC.T1DLC.T2DLC.TI
ParameterSecondsParameterSecondsParameterSeconds
1.20-.401.04-.0811-2
2.40-.602.08-.12*22-3
3.60-.803.12-.1633-4*
4.80-1.04.16-.2044-5
51.0-1.2*5.20-.4055-6
61-26.40-.8065-10
72-37.80-1.2710-15
83-481.2-1.6815-20
94-591.6-2.0920-25
105-6102.0-2.41025-30
11-disabled
+ +* This value is the default. + +
Copyright IBM Corp. 1986, 1996 +4.5.5 - 1
+ +--- + + +## Page 250 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NetBIOS Calling Conventions Using the LAN Support Program + +4.5.6 NetBIOS Calling Conventions Using the LAN Support Program + +An application program using the LAN Support Program should use the following conventions to initiate an NCB: +* Register ES and BX point to the NCB. +* Execute instruction interrupt X'5C'. + +
Copyright IBM Corp. 1986, 1996
+<page_number>4.5.6 - 1</page_number> + +--- + + +## Page 251 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NetBIOS Calling Conventions Using the Dynamic Link Routine Interface + +4.5.7 NetBIOS Calling Conventions Using the Dynamic Link Routine Interface + +An application program using the OS/2 DLR interface should use the following conventions to initiate an NCB: + +* Push the NCB's selector value onto the stack. +* Push the NCB's offset value onto the stack. +* Use the Call Far instruction to call NetBIOS. + +
Copyright IBM Corp. 1986, 1996 +4.5.7 - 1
+ +--- + + +## Page 252 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NetBIOS Calling Conventions Using the Device Driver Interface + +4.5.8 NetBIOS Calling Conventions Using the Device Driver Interface + +An application program using the OS/2 DD interface should use the following conventions to initiate an NCB: + +☐ Registers ES and BX point to the NCB. + +☐ Register DS is the value returned on the ATTACHDD call to the NetBIOS device driver. + +☐ Push the value X'0000' onto the stack. + +☐ Use the Call Far instruction for the address obtained when the application program executed an OS/2 'ATTACHDD' to name NETBIOS$. + +Note: When you are using the OS/2 DD interface NetBIOS, the NCB and any buffers must be locked by the application program. + +
Copyright IBM Corp. 1986, 1996 +4.5.8 - 1
+ +--- + + +## Page 253 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB Completion with Wait Type Commands + +4.5.9 NCB Completion with Wait Type Commands + +If the command issued is a wait type command, control is not returned to the next instruction until the adapter has completed the command. When the command does complete, the return code will be in both the AL register and the NCB_RETCODE field. + +
Copyright IBM Corp. 1986, 1996 +4.5.9 - 1
+ +--- + + +## Page 254 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB Completion with No-Wait Type Commands + +4.5.10 NCB Completion with No-Wait Type Commands + +If the command is a no-wait type, NetBIOS presents two return codes. An immediate return code is posted to the AL register. If the immediate return code in the AL register is X'00', processing is complete. An appendage will be enabled to run if it is present. If the immediate return code is X'FF', processing is continuing; control will be passed to an appendage when processing is complete, if an appendage is present. If the immediate return code is neither X'00' nor X'FF', processing is complete, but an error has occurred. The appendage, if present, will not be activated. + +If the NCB_POST@ field of the NCB is 0, the final return code is placed in the NCB_CMD_CMPL field, which must be checked for change by the application program. If the application is checking the NCB_CMD_CMPL field, a change of value from X'FF' indicates command completion. This value is the final return code. + +If the NCB_POST@ field is not 0, NetBIOS gives control to the post routine after setting the final return code in both the AL register and the NCB_RETCODE field. The application program continues with the instruction located by the contents of the NCB_POST@ field (the command completion appendage). + +
Copyright IBM Corp. 1986, 1996
+
4.5.10 - 1
+ +--- + + +## Page 255 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NetBIOS Command Descriptions + +4.6 NetBIOS Command Descriptions + +Each command description in this section begins with a box containing the command name. The hexadecimal number at the top of the box is the command code value. Both the wait and no-wait values are supplied when applicable. + +Subtopics +4.6.1 NCB.ADD.GROUP.NAME +4.6.2 NCB.ADD.NAME +4.6.3 NCB.CALL +4.6.4 NCB.CANCEL +4.6.5 NCB.CHAIN.SEND +4.6.6 NCB.CHAIN.SEND.NO.ACK +4.6.7 NCB.DELETE.NAME +4.6.8 NCB.FIND.NAME +4.6.9 NCB.HANG.UP +4.6.10 NCB.LAN.STATUS.ALERT +4.6.11 NCB.LISTEN +4.6.12 NCB.RECEIVE +4.6.13 NCB.RECEIVE.ANY +4.6.14 NCB.RECEIVE.BROADCAST.DATAGRAM +4.6.15 NCB.RECEIVE.DATAGRAM +4.6.16 NCB.RESET +4.6.17 NCB.SEND +4.6.18 NCB.SEND.BROADCAST.DATAGRAM +4.6.19 NCB.SEND.DATAGRAM +4.6.20 NCB.SEND.NO.ACK +4.6.21 NCB.SESSION.STATUS +4.6.22 NCB.STATUS +4.6.23 NCB.TRACE +4.6.24 NCB.UNLINK + +
Copyright IBM Corp. 1986, 1996 +4.6 - 1
+ +--- + + +## Page 256 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB.ADD.GROUP.NAME + +4.6.1 NCB.ADD.GROUP.NAME + +``` ++--- Hex 36 Wait B6 No-Wait ----------------------------------------+ +| | +| NCB.ADD.GROUP.NAME | +| | ++-----------------------------------------------------------------+ +``` + +**Command Description:** This command adds a 16-character name to the table of names. The name cannot be used by any other station across the network as a unique name, but can be added by any station as a group name. This is a name by which this station will be known. + +**Command Specifics:** When NetBIOS processes this command, it sends name query requests on the network. If no reply is received, it is assumed that no other node on the network has defined the name as a unique name, and the name is added to that node. The adapter returns the number of the name in the NCB_NUM field. This number is used in datagram support and for NCB.RECEIVE.ANY commands. + +**Supplied Fields:** +* NCB_ADPTR_NUM (adapter number) +* NCB_NAME +* NCB_POST@ (if the no-wait option is used) +* NCB_DD_ID (if using the OS/2 DD interface). + +**Returned Fields:** +* NCB_RETCODE +* NCB_NUM +* NCB_RESERVE (if error X'4X' or X'FX' occurs). + +**Valid Return Codes:** See "NCB Return Codes Listed by Command" in topic B.4.1. + +
Copyright IBM Corp. 1986, 1996 +4.6.1 - 1
+ +--- + + +## Page 257 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB.ADD.NAME + +4.6.2 NCB.ADD.NAME + + + + + + + + + + + + + + +
+--- Hex 30 WaitB0 No-Wait ---------------------------------
NCB.ADD.NAME
++
+ +**Command Description:** This command adds a 16-character name to the table of names. The name must be unique across the network. This is a name that this station will be known by. The first byte of the name parameter, NCB_NAME, cannot be X'00' or '*. + +**Command Specifics:** When NetBIOS processes this command, it sends name query requests on the network. If no reply is received, the name is assumed to be unique and is added to the table of names. The adapter returns the number of the name in the NCB_NUM field. This number is used in datagram support and for NCB.RECEIVE.ANY commands. + +**Supplied Fields:** +NCB_ADPTR_NUM (adapter number) +NCB_NAME +NCB_POST@ (if the no-wait option is used) +NCB_DD_ID (if using the OS/2 DD interface). + +**Returned Fields:** +NCB_RETCODE +NCB_NUM +NCB_RESERVE (if error X'4X' or X'FX' occurs). + +**Valid Return Codes:** See "NCB Return Codes Listed by Command" in topic B.4.1. + +
Copyright IBM Corp. 1986, 1996
+<page_number>4.6.2 - 1</page_number> + +--- + + +## Page 258 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB.CALL + +4.6.3 NCB.CALL + +``` ++--- Hex 10 Wait 90 No-Wait ----------------------------------------+ +| | +| NCB.CALL | +| | ++-----------------------------------------------------------------+ +``` + +**Command Description:** This command opens a session with another name specified by the NCB_CALLNAME field using the local name specified by the supplied NCB_NAME field. + +**Command Specifics:** The destination name station must have an NCB.LISTEN command pending in order for the session to be established. Sessions can be established with either a local or remote name. Multiple sessions can be established with the same pair of names. The timeout intervals are specified in 500-ms units. (A value of 0 means that no timeout will occur.) The system timeout intervals and retry count are constants in NetBIOS. The NCB.CALL command itself aborts if unsuccessful after the system timeout interval (retry count exhausted). When the call is completed, a local session number (LSN) is assigned and is used thereafter to refer to the established session. + +Local session numbers (NCB_LSN) are assigned in a round-robin technique, starting from the next available value within the range of 1 to 254. + +**Supplied Fields:** +NCB_ADPTR_NUM (adapter number) +NCB_NAME +NCB_CALLNAME +NCB_POST@ (if the no-wait option is used) +NCB_DD_ID (if using the OS/2 DD interface) +NCB_RTO (500-ms increments. If the field is set at X'00', no receive timeout will occur.) +NCB_STO (500-ms increments. If the field is set at X'00', no send timeout will occur.). + +**Returned Fields:** +NCB_RETCODE +NCB_LSN +NCB_RESERVE (if error X'4X' or X'FX' occurs). + +**Valid Return Codes:** See "NCB Return Codes Listed by Command" in topic B.4.1. + +
Copyright IBM Corp. 1986, 1996
+<page_number>4.6.3 - 1</page_number> + +--- + + +## Page 259 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB.CANCEL + +4.6.4 NCB.CANCEL + +``` ++--- Hex 35 Wait --------------------------------------------------------+ +| | +| NCB.CANCEL | +| | ++----------------------------------------------------------------------+ +``` + +**Command Description:** The active command has its NCB at the address given by NCB_BUFFER. The NCB.CANCEL command requests that this active command be canceled. NCB.CANCEL can be issued by an application program even though the total number of NCBs allocated to the application program are in use. + +**Command Specifics:** Use caution when canceling session commands. Cancellation always ends the session. + +The following commands can be canceled: + +☐ NCB.CALL +☐ NCB.CHAIN.SEND +☐ NCB.CHAIN.SEND.NO.ACK +☐ NCB.HANG.UP +☐ NCB.LAN.STATUS.ALERT +☐ NCB.LISTEN +☐ NCB.RECEIVE +☐ NCB.RECEIVE.ANY +☐ NCB.RECEIVE.BROADCAST.DATAGRAM +☐ NCB.RECEIVE.DATAGRAM +☐ NCB.SEND +☐ NCB.SEND.NO.ACK +☐ NCB.STATUS. + +**Supplied Fields:** + +NCB_ADPTR_NUM (adapter number) +NCB_BUFFER@ (address of the NCB to be canceled) +NCB_DD_ID (if using the OS/2 DD interface). + +**Returned Fields:** + +NCB_RETCODE +NCB_RESERVE (if error X'4X' or X'5X' occurs). + +**Valid Return Codes:** See "NCB Return Codes Listed by Command" in topic B.4.1. + +
Copyright IBM Corp. 1986, 1996 +4.6.4 - 1
+ +--- + + +## Page 260 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB.CHAIN.SEND + +4.6.5 NCB.CHAIN.SEND + + + + + + + + + + +
Hex 17 Wait97 No-Wait
NCB.CHAIN.SEND
+ +**Command Description:** This command sends data to the session partner as defined by the session number in the NCB_LSN field. The data to send is in the buffers pointed to by the NCB_BUFFER@ field and the NCB_CALLNAME field. + +**Command Specifics:** The data in the second buffer is concatenated to the data in the first buffer and sent as a single message. The NCB.CALLNAME field is used to specify the length and address of the second buffer. The length is specified in the first 2 bytes and the second buffer address in the next 4 bytes. + +When the remote side closes a session, all NCB.CHAIN.SEND commands pending for the closed session are returned with a "session closed" status. If a local NCB.HANG.UP command is issued with any pending NCB.CHAIN.SEND commands, the NCB.CHAIN.SEND commands are completed. + +If a session is aborted, a "session ended abnormally" status is returned. If the NCB.CHAIN.SEND timeout expires, the session is aborted and a "command timed out" status is returned. Timeout values for the NCB.CHAIN.SEND are associated with the session when an NCB.CALL or NCB.LISTEN is issued and cannot be specified with this command. + +Message size must be between 0 and 131,070 bytes long. + +If more than one NCB.SEND or NCB.CHAIN.SEND is pending, the data is transmitted in a first-in, first-out order within a session. + +If the NCB.CHAIN.SEND command cannot be completed for any reason, the session ends abnormally and the session is dropped. This is done to guarantee data integrity. + +**Supplied Fields:** + +NCB_ADPTR_NUM (adapter number) +NCB_LENGTH +NCB_BUFFER@ +NCB_POST@ (if the no-wait option is used) +NCB_DD_ID (if using the OS/2 DD interface) +NCB_LSN +NCB_CALLNAME (specifies the second buffer) +☐ Bytes 0 - 1 = NCB_LENGTH2 +☐ Bytes 2 - 5 = NCB_BUFFER2@. + +**Returned Fields:** + +NCB_RETCODE +NCB_RESERVE (if error X'4X' or X'FX' occurs). + +**Valid Return Codes:** See "NCB Return Codes Listed by Command" in topic B.4.1. + +
Copyright IBM Corp. 1986, 1996
+<page_number>4.6.5 - 1</page_number> + +--- + + +## Page 261 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB.CHAIN.SEND.NO.ACK + +4.6.6 NCB.CHAIN.SEND.NO.ACK + + + + + + + + + + +
Hex 72 WaitF2 No-Wait
NCB.CHAIN.SEND.NO.ACK
+ +**Command Description:** This command has the same benefits as the NCB.SEND.NO.ACK in that it does not require an acknowledgment. + +This command sends data to the session partner as defined by the session number in the NCB_LSN field. The data to send is in the buffer pointed to by the NCB_BUFFER@ field. Two buffers can be chained together with this command. + +The data in the second buffer is concatenated to the data in the first buffer and sent as a single message. The NCB_CALLNAME field specifies the length and address of the second buffer. The length is specified in the first 2 bytes and the second buffer address in the next 4 bytes. + +When the remote side closes a session, all NCB.CHAIN.SEND.NO.ACK commands pending for the closed session are returned with a "session closed" status. If a local NCB.HANG.UP command is issued with any pending NCB.CHAIN.SEND.NO.ACK commands, the NCB.CHAIN.SEND.NO.ACK commands are completed. + +If a session is aborted, a "session ended abnormally" status is returned. + +Message size must be between 0 and 65,535 bytes long. + +If more than one send type of command is pending, the data is transmitted in a first-in, first-out order within a session. + +**Command Specifics:** Lost data (indicated by a X'07' return code), as well as the possible need for retransmission, are both the responsibility of the application program. + +If the remote node cannot process the NCB.CHAIN.SEND.NO.ACK, it is handled as an NCB.CHAIN.SEND; a DATA_ACK must be received before the NCB.CHAIN.SEND.NO.ACK will be executed. + +This command should be used for transactions and not for data transfers. + +**Notes:** + +1. Note the following on a X'07' return code. + * The return code is generated for the node that issued NCB.CHAIN.SEND.NO.ACK. + * The command terminating with the X'07' must be reissued. + * The return code is issued if the receiver either had no NCB.RECEIVE or NCB.RECEIVE.ANY up, or the transmitted data exceeded the length of the receive buffer. + * Unless the user is aware of the number of NCB.CHAIN.SEND.NO.ACKs issued, he has no indication of how many were not completed successfully. + * All other NCB.CHAIN.SEND return codes apply. + +2. For data transmitted with NCB.CHAIN.SEND.NO.ACK, only one receive command will be satisfied. The NCB.CHAIN.SEND.NO.ACK data buffer must be no longer than the remote receive buffer for successful completion. + +**Supplied Fields:** + +NCB_ADPTR_NUM (adapter number) +NCB_LENGTH +NCB_BUFFER@ +NCB_POST@ (if the no-wait option is used) +NCB_DD_ID (if using the OS/2 DD interface) +NCB_LSN +NCB_CALLNAME (specifies the second buffer) +* Bytes 0 - 1 = NCB_LENGTH2 DW format +* Bytes 2 - 5 = NCB_BUFFER2@ DD format. + +**Returned Fields:** + +NCB_RETCODE +NCB_RESERVE (if error X'4X' or X'FX' occurs). + +**Valid Return Codes:** See "NCB Return Codes Listed by Command" in topic B.4.1. + +
Copyright IBM Corp. 1986, 1996
+<page_number>4.6.6 - 1</page_number> + +--- + + +## Page 262 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB.DELETE.NAME + +4.6.7 NCB.DELETE.NAME + +``` ++--- Hex 31 Wait B1 No-Wait ----------------------------------------+ +| | +| NCB.DELETE.NAME | +| | ++-----------------------------------------------------------------+ +``` + +**Command Description:** This command deletes a 16-character name from the table of names. + +**Command Specifics:** If the name has active sessions when the NCB.DELETE.NAME command is issued, the name is flagged as *deregistered* and the "command completed, name has active sessions" status is returned to the user. The delete is delayed until the sessions associated with the name are closed. A deregistered name is not usable by subsequent NCBs. + +If the name has only pending non-active session commands when the NCB.DELETE.NAME command is issued, the name is removed and the "command completed" status is returned to the user. The pending non-active session commands are terminated immediately with the "name was deleted" status. Non-active session commands are: + +☐ NCB.LISTEN +☐ NCB.RECEIVE.ANY +☐ NCB.RECEIVE.DATAGRAM +☐ NCB.RECEIVE.BROADCAST.DATAGRAM. + +**Supplied Fields:** + +NCB_ADPTR_NUM (adapter number) +NCB_NAME +NCB_POST@ (if the no-wait option is used) +NCB_DD_ID (if using the OS/2 DD interface). + +**Returned Fields:** + +NCB_RETCODE +NCB_RESERVE (if error X'4X' or X'FX' occurs). + +**Valid Return Codes:** See "NCB Return Codes Listed by Command" in topic B.4.1. + +
Copyright IBM Corp. 1986, 1996 +4.6.7 - 1
+ +--- + + +## Page 263 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB.FIND.NAME + +4.6.8 NCB.FIND.NAME + + + + + + + + + + +
Hex 78 WaitF8 No-Wait
NCB.FIND.NAME
+ +**Command Description:** This command finds the location on the network of a 16-character name. The name is specified in the NCB_CALLNAME field. + +**Command Specifics:** NetBIOS sends a name query request on the network. If any remote nodes have the requested name registered, they respond with an indication of how they have the name registered (unique/group). + +If no response is received within the system timeout period, NetBIOS returns a CCB_RETCODE of X'05'. If responses are received, NetBIOS returns the number of nodes that responded, followed by every unique LAN header from each responding node. The LAN header contains the adapter address of the remote node where the name is located. The returned data is located at the buffer address specified by the NCB_BUFFER@ field, and the NCB_LENGTH indicates the number of bytes of data stored. There is no guarantee that all nodes will respond within the given timeout period. + +**Supplied Fields:** +NCB_ADPTR_NUM (adapter number) +NCB_LENGTH +NCB_BUFFER@ +NCB_POST@ (if the no-wait option is used) +NCB_DD_ID (if using the OS/2 DD interface) +NCB_CALLNAME. + +**Returned Fields:** +NCB_RETCODE +NCB_RESERVE (if error X'4X' or X'FX' occurs) +NCB_LENGTH. + +**Valid Return Codes:** See "NCB Return Codes Listed by Command" in topic B.4.1. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 4-5. Data Areas Returned for the NCB.FIND.NAME Command
OffsetByte Length8086 TypeDestination
02DWNumber of nodes responding (will be greater than 1 only if used as a group name)
21DBReserved
31DBStatus X'00' unique name X'01' group name
4*DBThe LAN header length and the LAN header from the remote nodes where the name is located (contains the address of the remote node). Each entry includes the header length and the LAN header for a total of 33 bytes for each entry. See the example of a LAN header below.
+ + + + + + + + + + + + + + + + + + +
LengthAccess ControlFrame ControlDest. Addr.Source Addr.Routing Info
012308 9014 15032
+
Refer to Figures 1-3 and 1-7 starting on topic 1.13 for a description of the header data.
+ +Copyright IBM Corp. 1986, 1996 +4.6.8 - 1 + +--- + + +## Page 264 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB.HANG.UP + +4.6.9 NCB.HANG.UP + + + + + + + + + + +
+--- Hex 12 Wait92 No-Wait
NCB.HANG.UP
+ +**Command Description:** This command closes the session specified by the local session number. + +**Command Specifics:** When an NCB.HANG.UP command is issued to the adapter, all pending (local) NCB.RECEIVE commands are terminated and returned to the issuer with "session closed" in the NCB_RETCODE field. The termination is valid whether or not any data had been transferred by the pending command. If a local NCB.SEND command is pending, the NCB.HANG.UP command waits for up to 20 seconds for a pending SEND to completed. This delay is true whether or not the command has begun to transfer data, or is waiting for the remote side to issue an NCB.RECEIVE command. The NCB.HANG.UP is performed when any of the following conditions occur: + +☐ The NCB.SEND is completed. + +☐ The NCB.SEND has ended abnormally. + +☐ The NCB.SEND fails because the session was terminated by the other side with an NCB.HANG.UP. + +☐ The NCB.SEND fails because of the timeout specified when the session was opened. + +If one of the above conditions does not occur within the system timeout period after the NCB.HANG.UP command is issued, the NCB.HANG.UP command is returned with a "command timed out" status and the session is aborted. + +When a session closes, all NCB.SEND and NCB.RECEIVE commands pending on the closed session are returned to the user with a "session closed" status. If an NCB.RECEIVE.ANY command is pending on the local name used by the session, it is returned to the issuer with a "session closed" status. + +Only a single NCB.RECEIVE.ANY command will be returned even though many NCB.RECEIVE.ANY commands are pending. Even though a single NCB.RECEIVE.ANY command is returned, many NCB.SENDs or NCB.RECEIVES can be returned when pending. + +When a session is abnormally terminated, all outstanding commands on that session will be returned to the issuer with a "session ended abnormally" status. When one side of a NetBIOS session issues an NCB.HANG.UP command, the remote partner does not free the session resources until at least one command completes, indicating the session is closed. + +**Supplied Fields:** + +NCB_ADPTR_NUM (adapter number) +NCB_LSN +NCB_POST@ (if the no-wait option is used) +NCB_DD_ID (if using the OS/2 DD interface). + +**Returned Fields:** + +NCB_RETCODE +NCB_RESERVE (if error X'4X' or X'FX' occurs). + +**Valid Return Codes:** See "NCB Return Codes Listed by Command" in topic B.4.1. + +
Copyright IBM Corp. 1986, 1996
+<page_number>4.6.9 - 1</page_number> + +--- + + +## Page 265 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB.LAN.STATUS.ALERT + +4.6.10 NCB.LAN.STATUS.ALERT + ++--- Hex F3 No-Wait -----------------------------------------------+ +| NCB.LAN.STATUS.ALERT | ++------------------------------------------------------------------+ + +**Command Description:** This command is used by application programs that should be notified of temporary ring error conditions that last for more than one minute. + +**Command Specifics:** There are two conditions where this command is completed: + +* There is no temporary ring error or the current ring error has existed for less than one minute. In this case, any NCB.LAN.STATUS.ALERT commands completed will be queued by NetBIOS. +* The current ring error condition has existed for more than one minute. In this case all queued NCB.LAN.STATUS.ALERT commands are completed with a good return code. Any commands issued while this condition exists are completed with a good return code. + +**Note:** The queued NCB.LAN.STATUS.ALERT commands can be canceled with the CANCEL command. + +**Supplied Fields:** +NCB_POST@ (if the no-wait option is used) +NCB_DD_ID (if using the OS/2 DD interface) +NCB_COMMAND +NCB_ADPTR_NUM. + +**Returned Fields:** +NCB_RETCODE. + +**Valid Return Codes:** See "NCB Return Codes Listed by Command" in topic B.4.1. + +
Copyright IBM Corp. 1986, 1996 +4.6.10 - 1
+ +--- + + +## Page 266 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB.LISTEN + +4.6.11 NCB.LISTEN + + + + + + + + + + +
+--- Hex 11 Wait91 No-Wait
NCB.LISTEN
+ +**Command Description:** This command enables a session to be opened with the name specified in the NCB_CALLNAME field, using the name specified by the NCB_NAME field. + +**Command Specifics:** If the NCB_CALLNAME field has an asterisk (*), a session is established with any network node that issues an NCB.CALL to the local name. + +NCB.LISTEN for a specific name has priority over an NCB.LISTEN for any name. Sessions can be established with either a local or remote name. Multiple sessions can be established with the same pair of names. + +The timeout intervals are specified in 500-ms units. (A value of 0 means that no timeout will occur.) An NCB.LISTEN command will not time out, but an NCB.LISTEN occupies a session entry and is considered a pending session in information returned in an NCB.STATUS command. Local session numbers (LSN) are assigned in a round-robin technique starting with the next available value within the range from 1 to 254. Also, if an asterisk (*) is used for the called name, the name that made the call is returned in the NCB_CALLNAME field. + +The error "name conflict detected" is returned if, during the completion for an NCB.LISTEN command, a name exists in more than one table. All nodes with the name registered, except the one where the NCB.LISTEN command has returned successfully, will report the "name conflict detected" error. + +**Supplied Fields:** + +NCB_ADPTR_NUM (adapter number) + +NCB_NAME + +NCB_CALLNAME (This can be specified in the first byte as an asterisk (*). The asterisk is used to listen for a call from any name to the local name. If a name is specified in this field, it takes priority over a name of an asterisk.) + +NCB_POST@ (if the no-wait option is used) + +NCB_DD_ID (if using the OS/2 DD interface) + +NCB_RTO (500-ms increments. If the field is set at X'00', no receive timeout will occur.) + +NCB_STO (500-ms increments. If the field is set at X'00', no send timeout will occur.). + +**Returned Fields:** + +NCB_RETCODE + +NCB_LSN + +NCB_CALLNAME (if NCB.LISTEN for any name is used, specified with an asterisk) + +NCB_RESERVE (if error X'4X' or X'FX' occurs). + +**Valid Return Codes:** See "NCB Return Codes Listed by Command" in topic B.4.1. + +
Copyright IBM Corp. 1986, 1996
+<page_number>4.6.11 - 1</page_number> + +--- + + +## Page 267 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB.RECEIVE + +4.6.12 NCB.RECEIVE + + + + + + + + + + +
+--- Hex 15 Wait95 No-Wait
NCB.RECEIVE
+ +**Command Description:** This command receives data from its session partner that has issued one of the following commands: + +☐ NCB.CHAIN.SEND +☐ NCB.CHAIN.SEND.NO.ACK +☐ NCB.SEND +☐ NCB.SEND.NO.ACK + +**Command Specifics:** If more than one RECEIVE type of command is pending, the NCB.RECEIVE command has priority over the NCB.RECEIVE.ANY command. NCB.RECEIVE commands are processed in a first-in, first-out order. Within each priority, the commands are processed in a first-in, first-out order. Timeout values are specified during an NCB.CALL or NCB.LISTEN and cannot be specified with this command. + +When a session is closed, either by a local session close command or by the remote side closing the session, all pending NCBs for that session are returned with a "session closed" status. + +A return code of X'06' is posted in the NCB_RETCODE field if the receive buffer is not large enough for the message being received. Another receive can be issued to obtain the rest of the information before an NCB.SEND timeout occurs. + +**Supplied Fields:** + +NCB_ADPTR_NUM (adapter number) +NCB_LSN +NCB_BUFFER@ +NCB_POST@ (if the no-wait option is used) +NCB_DD_ID (if using the OS/2 DD interface) +NCB_LENGTH. + +**Returned Fields:** + +NCB_RETCODE +NCB_LENGTH +NCB_RESERVE (if error X'4X' or X'FX' occurs). + +**Valid Return Codes:** See "NCB Return Codes Listed by Command" in topic B.4.1. + +
Copyright IBM Corp. 1986, 1996
+<page_number>4.6.12 - 1</page_number> + +--- + + +## Page 268 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB.RECEIVE.ANY + +4.6.13 NCB.RECEIVE.ANY + + + + + + + + + + +
+--- Hex 16 Wait96 No-Wait
NCB.RECEIVE.ANY
+ +**Command Description:** This command receives data for any session using the name defined in NCB_NUM. The data is sent from one of the following commands: + +☐ NCB.CHAIN.SEND +☐ NCB.CHAIN.SEND.NO.ACK +☐ NCB.SEND +☐ NCB.SEND.NO.ACK. + +You must use the name number instead of the name when issuing this command. + +**Command Specifics:** If more than one RECEIVE type of command is pending, the NCB.RECEIVE command has priority over the NCB.RECEIVE.ANY command. Within each priority, the commands are processed in a first-in, first-out order. + +If the NCB_NUM field is set to X'FF' by the application program, then the receive is for any remote name that you have a session with, for any of your names. NetBIOS sets the NCB_NUM field to the number of the name for which the data was received when the return code is presented. + +When a session is closed by a local session close command, a remote side closing the session, or a session abnormal halt, only one NCB.RECEIVE.ANY or NCB.RECEIVE name will be posted with "session closed" or "session aborted," regardless of the number of session receives that are pending. An NCB.RECEIVE.ANY with no name specified will post only if there is no pending NCB.RECEIVE.ANY name for the session that closed. + +A return code of X'06' is posted in the NCB_RETCODE field if the receive buffer is not large enough for the message being received. Another receive can be issued to obtain the rest of the information before a timeout occurs. + +When using DOS application programs, use "NCB.RECEIVE.ANY to any name" with caution as this command can receive messages for other programs running in the Personal Computer. + +**Supplied Fields:** + +NCB_ADPTR_NUM (adapter number) +NCB_LENGTH +NCB_BUFFER@ +NCB_POST@ (if the no-wait option is used) +NCB_DD_ID (if using the OS/2 DD interface) +NCB_NUM. + +**Returned Fields:** + +NCB_RETCODE +NCB_LSN +NCB_LENGTH +NCB_RESERVE (if error X'4X' or X'FX' occurs) +NCB_NUM (if X'FF' was specified in this field when issued). + +**Valid Return Codes:** See "NCB Return Codes Listed by Command" in topic B.4.1. + +
Copyright IBM Corp. 1986, 1996
+<page_number>4.6.13 - 1</page_number> + +--- + + +## Page 269 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB.RECEIVE.BROADCAST.DATAGRAM + +4.6.14 NCB.RECEIVE.BROADCAST.DATAGRAM + +``` ++--- Hex 23 Wait A3 No-Wait ----------------------------------------+ +| NCB.RECEIVE.BROADCAST.DATAGRAM | ++-----------------------------------------------------------------+ +``` + +**Command Description:** This command receives a datagram message from any name on the network that issues an NCB.SEND.BROADCAST.DATAGRAM command. + +**Command Specifics:** A "message incomplete" status is returned if the receive buffer is not large enough for the data being received. The remaining data is lost at this point. + +When a broadcast datagram is received, all broadcast datagrams are completed. + +**Supplied Fields:** + +NCB_ADPTR_NUM (adapter number) +NCB_LENGTH +NCB_BUFFER@ +NCB_POST@ (if the no-wait option is used) +NCB_DD_ID (if using the OS/2 DD interface) +NCB_NUM. + +**Returned Fields:** + +NCB_RETCODE +NCB_RESERVE (if error X'4X' or X'FX' occurs). +NCB_LENGTH +NCB_CALLNAME. + +**Valid Return Codes:** See "NCB Return Codes Listed by Command" in topic B.4.1. + +
Copyright IBM Corp. 1986, 1996 +4.6.14 - 1
+ +--- + + +## Page 270 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB.RECEIVE.DATAGRAM + +4.6.15 NCB.RECEIVE.DATAGRAM + + + + + + + + + +
+--- Hex 21 WaitA1 No-Wait
NCB.RECEIVE.DATAGRAM
+ +**Command Description:** This command receives a datagram message from any name on the network that issues an NCB.SEND.DATAGRAM command. + +**Command Specifics:** A "message incomplete" status is returned if the receive buffer is not large enough for the data being received. The remaining data is lost at this point. + +This command will not receive a broadcast datagram. + +**Supplied Fields:** + +* NCB_ADPTR_NUM (adapter number) +* NCB_LENGTH +* NCB_BUFFER@ +* NCB_POST@ (if the no-wait option is used) +* NCB_DD_ID (if using the OS/2 DD interface) +* NCB_NUM (if X'FF', then receive a datagram from any name on the network for any name in the local table). + +**Returned Fields:** + +* NCB_RETCODE +* NCB_RESERVE (if error X'4X' or X'FX' occurs) +* NCB_LENGTH +* NCB_CALLNAME +* NCB_NUM. + +**Valid Return Codes:** See "NCB Return Codes Listed by Command" in topic B.4.1. + +
Copyright IBM Corp. 1986, 1996
+<page_number>4.6.15 - 1</page_number> + +--- + + +## Page 271 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB.RESET + +4.6.16 NCB.RESET + +There are four basic environments in NetBIOS: + +☐ LAN Support Program using "old" load NetBIOS parameters +☐ LAN Support Program using "new" load NetBIOS parameters +☐ OS/2 EE application programs using the DLR interface +☐ OS/2 EE application programs using the DD interface. + +The RESET command operates differently in each environment. The following sections describe the RESET operation. + ++--- Hex 32 Wait ----------------------------------------+ +¦ NCB.RESET with the LAN Support Program Using Old NetBIOS Parameters ¦ ++--------------------------------------------------------+ + +**Command Description:** When RESET is issued, the following occurs: + +☐ All current NetBIOS names are deleted, all current sessions are aborted, and all pending NCBs are purged. + +☐ If indicated in the last DIR.OPEN.ADAPTER command, the adapter will be closed. + +☐ If the adapter is closed, it will be reopened. + +**Command Specifics:** If NetBIOS opens the adapter, the adapter will be closed on each RESET. If the application program opens the adapter, it can choose to keep from closing the adapter. See "DIR.OPEN.ADAPTER" in topic 3.3.9. + +**Supplied Fields:** + +NCB_ADPTR_NUM (adapter number) +NCB_LSN (the number of sessions. If 0, the default is 6.) +NCB_NUM (the number of NCBs. If 0, the default is 12.). + +**Returned Fields:** + +NCB_RETCODE +NCB_RESERVE. + +**Valid Return Codes:** See "NCB Return Codes Listed by Command" in topic B.4.1. + +**Note:** It is preferable to use the NCB.HANGUP command rather than the NCB.RESET command when terminating existing NetBIOS sessions. +--- Hex 32 Wait ----------------------------------------+ +¦ NCB.RESET with the LAN Support Program Using New NetBIOS Parameters ¦ ++--------------------------------------------------------+ + +**Command Description:** When RESET is issued, the following occurs: + +☐ All current NetBIOS names are deleted, all current sessions are aborted, and all pending NCBs are purged. + +☐ If the load parameter CLOSE.ON.RESET is coded as YES, the adapter is closed and then re-opened. (The default is NO.) + +**Supplied Fields:** + +NCB_ADPTR_NUM (adapter number) +NCB_LSN (the number of sessions) +☐ The maximum value is as defined by load parameters. +☐ If coded as 0, the default is one of the following +- 6, if the load parameter RESET.VALUES=NO (default) +- As defined by the load parameter SESSIONS, if the load parameter RESET.VALUES=YES. +NCB_NUM (the number of NCBs) +☐ The maximum value is as defined by the load parameters. +☐ If coded as 0, the default is one of the following +- 12, if the load parameter RESET.VALUES=NO (default) +- As defined by the load parameter COMMANDS, if the load parameter RESET.VALUES=YES. + +**Returned Fields:** + +NCB_RETCODE +NCB_RESERVE. + +**Valid Return Codes:** See "NCB Return Codes Listed by Command" in topic B.4.1. + +**Note:** It is preferable to use the NCB.HANGUP command rather than the NCB.RESET command when terminating existing NetBIOS sessions. +--- Hex 32 Wait ----------------------------------------+ +¦ NCB.RESET--OS/2 Dynamic Link Routine Interface ¦ ++--------------------------------------------------------+ + +Copyright IBM Corp. 1986, 1996 +4.6.16 - 1 + +--- + + +## Page 272 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB.RESET + +**Command Description:** NCB.RESET can be issued by an application program even though the total number of NCBs allocated to the application program are in use. An application program executing in this environment must always issue a RESET under the following conditions: + +☐ As the first NCB issued by the application program +☐ To recover from either a X'4X' or X'FX' return code. + +The OS/2 environment differs from the DOS environment in that RESET applies only to the application program and not to the entire workstation. An application program issues RESET to allocate resources for itself from a pool of NetBIOS resources. + +When RESET is issued, only resources applicable to that application program are given back to NetBIOS. For that application program, all current NetBIOS names are deleted, all current sessions are aborted, and all outstanding NCBs are purged. After resources are freed, new resources are acquired for the application program, according to the RESET request. + +**Supplied Fields:** + +NCB_ADPTR_NUM (adapter number) +NCB_COMMAND +NCB_LSN (determines whether the RESET is requesting or freeing resources.) + +☐ If NCB_LSN is X'00', it indicates a request for resources, according to the parameters in NCB_CALLNAME. + +☐ If NCB_LSN is not X'00', it indicates that all resources associated with the environment are to be freed. + +- NCB_CALLNAME is ignored. +- NCB_NAME has the normal return values set (see below). + +NCB_CALLNAME is the resource request field. Any NCB_CALLNAME areas not defined here are reserved and should be 0. + +If this is a request to free resources (NCB_LSN is not X'00'), NCB_CALLNAME is ignored. + +☐ REQ_SESSIONS at NCB_CALLNAME+0 (1-byte field): + +- The number of sessions requested by the application program. +- If 0, the default of 16 is used. + +☐ REQ_COMMANDS at NCB_CALLNAME+1 (1-byte field): + +- The number of commands requested by the application program. +- If 0, the default of 16 is used. + +☐ REQ_NAMES at NCB_CALLNAME+2 (1-byte field): + +- The number of names requested by the application program. This does not include a reservation for NAME_NUMBER_1. +- If 0, the default of 8 is used. + +☐ REQ_NAME_ONE at NCB_CALLNAME+3 (1-byte field): + +- A request to reserve NAME_NUMBER_1 for this application program. +- If 0, NAME_NUMBER_1 is not requested. +- If not 0, NAME_NUMBER_1 is desired to be reserved for this application program. + +**Returned Fields:** NCB_NAME is used to return resource information. Areas of NCB_NAME not defined here are reserved and set to 0. + +The following returned values are resources actually obtained by the application program: + +☐ ACT_SESSIONS at NCB_NAME+0 (1-byte field): + +The number of sessions obtained by the application program. + +☐ ACT_COMMANDS at NCB_NAME+1 (1-byte field): + +The number of commands obtained by the application program. + +☐ ACT_NAMES at NCB_NAME+2 (1-byte field): + +The number of names obtained by the application program does not include NAME_NUMBER_1. + +☐ ACT_NAME_ONE at NCB_NAME+3 (1-byte field): + +- If 0, the application program does not have use of NAME_NUMBER_1. +- If one, the application program has use of NAME_NUMBER_1. + +Returned values are resources defined at NetBIOS load time. These values represent absolute maximums. The sum of all application program requests cannot exceed these values. + +☐ LOAD_SESSIONS at NCB_NAME+8 (1-byte field): + +
Copyright IBM Corp. 1986, 1996 +4.6.16 - 2
+ +--- + + +## Page 273 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB.RESET + +The number of sessions defined at NetBIOS load time. + +☐ LOAD_COMMANDS at NCB_NAME+9 (1-byte field): +The number of commands defined at NetBIOS load time. + +☐ LOAD_NAMES at NCB_NAME+10 (1-byte field): +The number of names defined at NetBIOS load time. This number includes NAME_NUMBER_1. + +☐ LOAD_STATIONS at NCB_NAME+11 (1-byte field): +The actual number of link stations obtained by NetBIOS. +This cannot be the number requested at load time. NetBIOS will obtain as many link stations as possible of the number requested. + +☐ LOAD_REMOTE_NAMES at NCB_NAME+14 (1-byte field): +The number of remote names (RND) defined at NetBIOS load time. + +☐ NCB_NAME+15 (1-byte field) is reserved. + +NCB_RESERVE is used as in the LAN Support Program. + +Valid Return Codes: See "NCB Return Codes Listed by Command" in topic B.4.1. +--- Hex 32 Wait +NCB.RESET--OS/2 Device Driver Interface ++-------------------------------------------------------------+ + +Command Description: NCB.RESET can be issued by an application program even though the total number of NCBS allocated to the application program are in use. An application program executing in this environment must always issue a RESET under the following conditions: + +☐ As the first NCB issued by the application program +☐ To recover from either an X'4X' or X'FX' return code. + +The OS/2 environment differs from the DOS environment in that RESET applies only to the application program and not to the entire workstation. An application program issues RESET to allocate resources for itself from a pool of NetBIOS resources. + +When RESET is issued, only resources applicable to that application program are given back to NetBIOS. For that application program, all current NetBIOS names are deleted, all current sessions are aborted, and all pending NCBs are purged. After resources are freed, new resources are acquired for the application program, according to the RESET request. + +Supplied Fields: + +NCB_ADPTR_NUM (adapter number) + +NCB_COMMAND: Same as OS/2 using the DLR interface. + +NCB_LSN: Same as OS/2 using the DLR interface. + +NCB_BUFFER@: This field must contain the address (selector: offset) of the application device driver name ASCIIZ string if this is the first RESET issued by the application program. + +NCB_CALLNAME: Same as OS/2 using the DLR interface. + +NCB_DD_ID: +☐ If this is the first RESET issued by the application program for this adapter, the value must be X'0000'. +☐ Subsequent NCB.RESET commands issued by an application program must supply this field, as returned on the first NCB.RESET for this adapter. + +Returned Fields: + +NCB_NAME: Same as OS/2 using the DLR interface. + +NCB_DD_ID: +☐ This value must be placed in all subsequent NCBs issued by this application program + +NCB_RESERVE: Same as OS/2 using the DLR interface. + +Valid Return Codes: See "NCB Return Codes Listed by Command" in topic B.4.1. + +
Copyright IBM Corp. 1986, 1996 +4.6.16 - 3
+ +--- + + +## Page 274 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB.SEND + +4.6.17 NCB.SEND + +``` ++---- Hex 14 Wait 94 No-Wait ----------------------------------------+ +| NCB.SEND | ++-----------------------------------------------------------------+ +``` + +**Command Description:** This command sends data to the session partner as defined by the session number in the NCB_LSN field. The data to send is in the buffer pointed to by the NCB_BUFFER@ field. + +**Command Specifics:** If the NCB.SEND timeout expires, the session is aborted and a "command timed out" status is returned. Timeout values for the NCB.SEND are associated with the session when an NCB.CALL or NCB.LISTEN was issued and cannot be specified with this command. + +Message size must be between 0 and 65,535 bytes long. + +If more than one session SEND type of command is pending, the data is transmitted in a first-in, first-out order within a session. + +If the NCB.SEND cannot be completed for any reason, the session ends abnormally and the session is dropped. This guarantees data integrity. + +**Supplied Fields:** +NCB_ADPTR_NUM (adapter number) +NCB_LENGTH +NCB_BUFFER@ +NCB_POST@ (if the no-wait option is used) +NCB_DD_ID (if using the OS/2 DD interface) +NCB_LSN. + +**Returned Fields:** +NCB_RETCODE +NCB_RESERVE (if error X'4X' or X'FX' occurs). + +**Valid Return Codes:** See "NCB Return Codes Listed by Command" in topic B.4.1. + +
Copyright IBM Corp. 1986, 1996 +4.6.17 - 1
+ +--- + + +## Page 275 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB.SEND.BROADCAST.DATAGRAM + +4.6.18 NCB.SEND.BROADCAST.DATAGRAM + + + + + + + + + + + + + + + + + + + + + + +
+---- Hex 22 WaitA2 No-Wait ----------------------------------------+
||
| NCB.SEND.BROADCAST.DATAGRAM|
||
+--------------------------------------------------------++
+ +**Command Description:** This command sends a datagram message to every station that has an NCB.RECEIVE.BROADCAST.DATAGRAM command pending. + +**Command Specifics:** If the remote station does not have an NCB.RECEIVE.BROADCAST.DATAGRAM command pending, it will not get the message. If a station issues an NCB.SEND.BROADCAST.DATAGRAM and has an NCB.RECEIVE.BROADCAST.DATAGRAM pending, the station will receive its own message. If a station has several broadcast messages pending, the next send command issued will satisfy all NCB.RECEIVE.BROADCAST.DATAGRAM commands. + +**Supplied Fields:** +NCB_ADPTR_NUM (adapter number) +NCB_LENGTH +NCB_BUFFER@ +NCB_POST@ (if the no-wait option is used) +NCB_DD_ID (if using the OS/2 DD interface) +NCB_NUM. + +**Returned Fields:** +NCB_RETCODE +NCB_RESERVE (if error X'4X' or X'FX' occurs). + +**Valid Return Codes:** See "NCB Return Codes Listed by Command" in topic B.4.1. + +
Copyright IBM Corp. 1986, 1996
+<page_number>4.6.18 - 1</page_number> + +--- + + +## Page 276 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB.SEND.DATAGRAM + +4.6.19 NCB.SEND.DATAGRAM + +``` ++--- Hex 20 Wait A0 No-Wait ----------------------------------------+ +| | +| NCB.SEND.DATAGRAM | +| | ++-----------------------------------------------------------------+ +``` + +**Command Description:** This command sends a datagram message to any unique name or group name on the network. + +**Supplied Fields:** +* NCB_ADPTR_NUM (adapter number) +* NCB_LENGTH +* NCB_BUFFER@ +* NCB_POST@ (if the no-wait option is used) +* NCB_DD_ID (if using the OS/2 DD interface) +* NCB_NUM +* NCB_CALLNAME. + +**Returned Fields:** +* NCB_RETCODE +* NCB_RESERVE (if error X'4X' or X'FX' occurs). + +**Valid Return Codes:** See "NCB Return Codes Listed by Command" in topic B.4.1. + +
Copyright IBM Corp. 1986, 1996 +4.6.19 - 1
+ +--- + + +## Page 277 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB.SEND.NO.ACK + +4.6.20 NCB.SEND.NO.ACK + ++---- Hex 71 Wait F1 No-Wait ----------------------------------------+ +| NCB.SEND.NO.ACK | ++------------------------------------------------------------------+ + +**Command Description:** The purpose of this command is to provide a send facility that does not require a data acknowledgment at the NetBIOS level. This reduces the completion time required of a send command. + +This command sends data by the session number indicated in the local session number (LSN). The data is taken from the buffer indicated by the NCB_BUFFER@ for the indicated number of bytes. + +When the remote side closes a session, all NCB.SEND.NO.ACK commands pending on the closed session are returned with a session closed status. If a local NCB.HANG.UP command is issued with any pending NCB.SEND.NO.ACK commands, the NCB.HANG.UP is delayed until the NCB.SEND.NO.ACK commands are completed. + +If a session is aborted, a "session ended abnormally" status is returned. If the NCB.SEND.NO.ACK timeout expires, the session is aborted and a "command timed out" status is returned. Timeout values for the NCB.SEND.NO.ACK are associated with the session when an NCB.CALL or NCB.LISTEN was issued and cannot be specified here. + +Message size must be between 0 and 65,535 bytes long. + +If more than one NCB.SEND.NO.ACK or NCB.CHAIN.SEND is pending, the data is transmitted in a first-in, first-out order within a session. + +**Command Specifics:** Lost data, (indicated by a X'07' return code), as well as the possible need for retransmission, are both the responsibility of the application program. + +If the remote node cannot process the NCB.SEND.NO.ACK, it is handled as an NCB.SEND; a DATA_ACK must be received before the NCB.SEND.NO.ACK will be executed. + +This command should be used for transactions and not for data transfers. + +**Notes:** + +1. Note the following on a X'07' return code: + * The return code is generated for the node that issued NCB.SEND.NO.ACK. + * The command terminating with the X'07' must be reissued. + * The return code is issued if the receiver either had no NCB.RECEIVE or NCB.RECEIVE.ANY up, or the transmitted data exceeded the length of the receive buffer. + * Unless the user is aware of the number of NCB.SEND.NO.ACKs issued, he has no indication of how many were not completed successfully. + * All other NCB.SEND return codes apply. + +2. For data transmitted with NCB.SEND.NO.ACK, only one receive command will be satisfied. The NCB.SEND.NO.ACK data buffer must be no longer than the remote receive buffer for successful completion. + +**Supplied Fields:** +NCB_ADPTR_NUM (adapter number) +NCB_LENGTH +NCB_BUFFER@ +NCB_POST@ (if the no-wait option is used) +NCB_DD_ID (if using the OS/2 DD interface) +NCB_LSN. + +**Returned Fields:** +NCB_RETCODE +NCB_RESERVE (if error X'4X' or X'FX' occurs). + +**Valid Return Codes:** See "NCB Return Codes Listed by Command" in topic B.4.1. + +
Copyright IBM Corp. 1986, 1996 +4.6.20 - 1
+ +--- + + +## Page 278 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB.SESSION.STATUS + +4.6.21 NCB.SESSION.STATUS + ++--- Hex 34 Wait B4 No-Wait ----------------------------------------+ +| NCB.SESSION.STATUS | ++-------------------------------------------------------------------+ + +**Command Description:** This command obtains the status of either all sessions for a local name or all sessions for all local names. + +**Command Specifics:** If the NCB_NAME field contains a name, the session status is returned for that name. If the NCB_NAME field contains an asterisk (*) in the first byte, the session status for all names is returned. + +The minimum valid buffer length is 4 bytes. An "illegal buffer length" status is returned if the NCB_LENGTH field is less than 4. + +A "message incomplete" status is returned if the NCB_LENGTH field is less than the status data being generated. To obtain all status data, the buffer length must be at least 36 times the number of sessions being reported plus 4. + +**Supplied Fields:** + +NCB_ADPTR_NUM (adapter number) +NCB_LENGTH +NCB_BUFFER@ +NCB_POST@ (if the no-wait option is used) +NCB_DD_ID (if using the OS/2 DD interface) +NCB_NAME (Specify an asterisk (*) for all names). + +**Returned Fields:** + +NCB_RETCODE +NCB_RESERVE (if error X'4X' or X'FX' occurs) +NCB_LENGTH. + +**Valid Return Codes:** See "NCB Return Codes Listed by Command" in topic B.4.1. + ++-------------------------------------------------------------------+ +| Table 4-6. Data Areas Returned for the NCB.SESSION.STATUS Command | ++-------------------------------------------------------------------+ +| Offset | Byte Length | 8086 Type | Description | ++--------+-------------+-----------+-------------+ +| 0 | 1 | DB | Name number of sessions being reported; if 0, an add name is in process. | ++--------+-------------+-----------+-------------+ +| 1 | 1 | DB | Number of sessions with this name | ++--------+-------------+-----------+-------------+ +| 2 | 1 | DB | Number of NCB.RECEIVE.DATAGRAM and NCB.RECEIVE.BROADCAST.DATAGRAM commands outstanding | ++--------+-------------+-----------+-------------+ +| 3 | 1 | DB | Number of NCB.RECEIVE.ANY commands outstanding | ++--------+-------------+-----------+-------------+ +| 4 | 1 | DB | Local session number | ++--------+-------------+-----------+-------------+ +| 5 | 1 | DB | State of the session. This byte is represented as follows: | +| | | | X'01' LISTEN pending | +| | | | X'02' CALL pending | +| | | | X'03' Session established | +| | | | X'04' HANG UP pending | +| | | | X'05' HANG UP complete | +| | | | X'06' Session aborted | ++--------+-------------+-----------+-------------+ +| 6 | 16 | DB | Local name | ++--------+-------------+-----------+-------------+ +| 22 | 16 | DB | Remote name | ++--------+-------------+-----------+-------------+ +| 38 | 1 | DB | Number of NCB.RECEIVE commands pending | ++--------+-------------+-----------+-------------+ +| 39 | 1 | DB | Number of NCB.SEND and NCB.CHAIN.SEND commands pending | ++--------+-------------+-----------+-------------+ +| The contents of bytes 4 - 39 (36 bytes) are repeated for every session, if adequate buffer space is available. | ++-------------------------------------------------------------------+ + +Copyright IBM Corp. 1986, 1996 +4.6.21 - 1 + +--- + + +## Page 279 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB.STATUS + +4.6.22 NCB.STATUS + ++---- Hex 33 Wait B3 No-Wait ----------------------------------------+ +| NCB.STATUS | ++------------------------------------------------------------------+ + +**Command Description:** This command requests the status of either a local or remote NetBIOS. + +**Command Specifics:** The NCB_CALLNAME field specifies which interface to get the status from. If the first byte of the field contains an asterisk (*), the local NetBIOS status is returned. If the NCB_CALLNAME field does not contain an asterisk, the status is returned from the node with that name. The status information is returned to the buffer defined by the NCB_BUFFER@ field. The minimum number of bytes is 60. The maximum buffer size needed to hold the status information is 18 times the maximum number of names plus 60. + +**Supplied Fields:** +NCB_BUFFER@ +NCB_LENGTH +NCB_CALLNAME (local or remote or an asterisk for local) +NCB_POST@ (if no-wait option used) +NCB_DD_ID (if using the OS/2 DD interface) +NCB_ADPTR_NUM (adapter number). + +**Returned Fields:** +NCB_RETCODE +NCB_LENGTH +NCB_RESERVE (if error X'4X' or X'FX' occurs). + +**Valid Return Codes:** See "NCB Return Codes Listed by Command" in topic B.4.1. + ++------------------------------------------------------------------+ +| Table 4-7. Data Areas Returned for the NCB.STATUS Command | ++------------------------------------------------------------------+ +| Offset | Byte Length | 8086 Type | Description | ++------------------------------------------------------------------+ +| 0 | 6 | DB | Adapter's encoded address. | ++------------------------------------------------------------------+ +| 6 | 1 | DB | Software release level number: X'00' for NetBIOS 1.X, X'02' for NetBIOS 2.X, and X'03' for NetBIOS 3.X. | ++------------------------------------------------------------------+ +| 7 | 1 | DB | Always X'00'. | ++------------------------------------------------------------------+ +| 8 | 2 | DW | If offset 6 indicates NetBIOS 1.X, the first byte is X'FF' and the last byte indicates the software level. | +| | | | | +| | | | If offset 6 indicates NetBIOS 2.X, the first byte indicates the adapter type. | +| | | | | +| | | | For NetBIOS versions 2.0-2.33, the first byte indicates the adapter types as follows: X'FF' for a Token-Ring Network Adapter and X'FE' for a PC Network Adapter. | +| | | | | +| | | | For NetBIOS Version 2.5 or higher, the first byte indicates the adapter types as shown in Table 4-8. | +| | | | | +| | | | For all versions of NetBIOS higher than 2.0, the first character of the second byte indicates the type of parameters used (X'1' represents old parameters and X'2' represents new parameters). The second character of the second byte is the second number of the software level. For example, X'1' is NetBIOS 2.1 and X'2' is NetBIOS 2.2. | ++------------------------------------------------------------------+ +| 10 | 2 | DW | Duration of reporting period (in minutes). | +| | | | | +| | | | The Status Reporting Counter will not be incremented beyond X'FFFF' minutes if the reporting period (since the last NCB.RESET) exceeds 45.5 days. | ++------------------------------------------------------------------+ +| 12 | 2 | DW | Number of FRMR frames received. | ++------------------------------------------------------------------+ + +Copyright IBM Corp. 1986, 1996 +4.6.22 - 1 + +--- + + +## Page 280 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB.STATUS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
142DWNumber of FRMR frames transmitted.
162DWNumber of I-format LPDUs received in error.
182DWNumber of aborted transmissions.
204DDNumber of successfully transmitted packets.
244DDNumber of successfully received packets.
282DWNumber of I-format LPDUs transmitted in error.
302DWIf offset 6 indicates NetBIOS 1.X, this field indicates lost data (out of SAP buffers). The counter does not increment beyond X'FFFF'.
If offset 6 indicates NetBIOS 2.X, this field indicates the number of times that a buffer was not available to service a request from a remote computer.
322DWNumber of times DLC T1 timer expired.
342DWNumber of times DLC Ti timer expired.
364DDAddress of extended status information (local status only; undefined for remote status).
For OS/2 EE NetBIOS, this field is reserved. For the value of this field in LAPS (NetBIOS 4.0), see "NCB.STATUS Command Extension" in topic 6.4.7.
+ +Extended Status Information + +1. This is the workstation system memory location of adapter-specified status. The data is in a fixed location and an NCB.STATUS need not be reissued. The data can be interrogated, but should not be disturbed. + +This data is available only for local status. The pointer is undefined for remote status. + +The format of the data is type DW, 2-byte fields: + +Bytes 0-1 DIR.INITIALIZE bring-up error code +Bytes 2-3 DIR.OPEN.ADAPTER error code +Bytes 4-5 Latest network status +Bytes 6-7 Latest adapter check reason code +Bytes 8-9 Latest PC-detected error (contents of AX register) +Byte 10 Latest operational command code (4X or 5X). See note 2 below. +Byte 11 CCB return code of the latest implicit command. See note 2 below. + +Adapter counters: + +Bytes 12-13 Line errors +Bytes 14-15 Internal errors +Bytes 16-17 Burst errors +Bytes 18-19 ARI/FCI delimiter +Bytes 20-21 Abort delimiter +Bytes 22-23 Reserved +Bytes 24-25 Lost frame +Bytes 26-27 Receive congestion +Bytes 28-29 Frame copied errors +Bytes 30-31 Frequency errors +Bytes 32-33 Token errors +Bytes 34-35 Reserved +Bytes 36-37 DMA bus errors +Bytes 38-39 DMA parity errors + +Locally administered address (for NetBIOS Version 2.5 or higher): + +Bytes 40-45 Locally administered address + +The adapter counters are valid only if no network status appendage is defined. If an appendage is defined, it is the responsibility of the user to maintain these counts. When no appendage is defined, these counters are updated when network status bit 7 (counter overflow) is reported. (The counters wrap from X'FFFF' to X'0000'.) + +Copyright IBM Corp. 1986, 1996 +4.6.22 - 2 + +--- + + +## Page 281 + +These counters are the same as obtained with a DIR.READ.LOG command. Any application program that issues a DIR.READ.LOG command will cause these counters to be incorrect as to the correct total since they are reset by the DIR.READ.LOG command. + +2. When NetBIOS is initiated, DIR.INITIALIZE and DIR.OPEN.ADAPTER are sometimes executed and a DLC.OPEN.SAP is executed. Bytes 10 and 11 are useful for determining the reason for certain X'4X' return codes. Byte 10 provides the last of these CCB commands that was executed, and byte 11 contains the related CCB return code. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
402DWCurrent number of free NCBs.
422DWConfigured maximum NCBs.
442DWIf offset 6 indicates NetBIOS 1.x, this field indicates the maximum number of NCBs (always 255).
If offset 6 indicates NetBIOS 2.x, this field indicates the maximum number of NCBs. With old parameters, the maximum number is 255. With new parameters, the maximum number is defined at load time.
462DWIf offset 6 indicates NetBIOS 1.x, this field indicates the number of times a local station went busy.
If offset 6 indicates NetBIOS 2.x, this field indicates the number of times that a buffer was not available to transmit information.
482DWMaximum datagram packet size.
502DWNumber of pending sessions.
Note: The pending session is either an NCB_CALL pending, NCB_LISTEN pending, session established, session aborted, NCB_HANG_UP pending, or NCB_HANG_UP complete.
522DWConfigured maximum pending sessions.
542DWIf offset 6 indicates NetBIOS 1.x, this field indicates the maximum number of pending sessions (always 254).
If offset 6 indicates NetBIOS 2.x, this field indicates the maximum number of pending sessions. With old parameters, the maximum number is always 254. With new parameters, the maximum number is defined at load time.
562DWMaximum size of session data packet.
582DWNumber of names in the local names table.
60XXXXDBLocal names table. Each name requires 18 bytes.
+ +Note: The first 16 bytes of each entry represent the name and the last 2 bytes represent the name status. The first status byte is equal to the name number (NCB_NUM). The second status byte is the status when it is masked with a X'87'. The mask is used to get the last 3 bits of the byte. The other bits are reserved and can have non-0 values. + +Nrrrr000 - Trying to register a name +Nrrrr100 - A registered name +Nrrrr101 - A deregistered name +Nrrrr110 - A detected duplicate name +Nrrrr111 - A detected duplicate name with deregister pending +Where: r = Reserved bit +Where: N = 0 if the name is a unique name +Where: N = 1 if the name is a group name. + +DEREGISTERED NAME: If the name to be deleted still has an active session when a NCB.DELETE.NAME command is issued, the name is marked as "deregistered" and the name is removed from the local names table as soon as the session is closed. + +
Copyright IBM Corp. 1986, 1996
+<page_number>4.6.22 - 3</page_number> + +--- + + +## Page 282 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB.STATUS + +Note: All counters roll over from X'F...F' to X'0...0' unless stated otherwise. + +Table 4-8 shows the values displayed in the first byte at offset 8 of the data area returned for the NCB.STATUS command (NetBIOS Version 2.5 and higher). + +Table 4-8. Adapter Types + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Adapter TypeFunction Number
Token-RingX'FF'
PC NetworkX'FE'
EthernetX'FD'
IBM FDDIX'FC'
3174 PeerX'FB'
ReservedX'FA'
ReservedX'F9'
+ +Copyright IBM Corp. 1986, 1996 +4.6.22 - 4 + +--- + + +## Page 283 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB.TRACE + +4.6.23 NCB.TRACE + ++--- Hex 79 Wait F9 No-Wait ----------------------------------------+ +| NCB.TRACE | ++-------------------------------------------------------------------+ + +**Command Description:** This command activates and deactivates a trace of all the NCBs issued to NetBIOS and some of the CCBs issued by NetBIOS, including transmits and receives. + +**For OS/2:** The TRACE command is not available with OS/2. It is replaced with the OS/2 system trace. For a description of the OS/2 system trace for OS/2 EE, see Appendix E, "Operating System/2 Extended Edition Information"; for a description of the trace facility in LAPS, see "Operating System/2 Trace Facility" in topic 6.7. + +Receipt of NetBIOS protocol messages "remote trace off" is not supported. + +**Trace Entries:** + +The NetBIOS major trace code is X'A4'. There are two minor trace codes: X'20' indicates an OS/2 DD interface level trace entry and X'21' indicates an OS/2 DLR interface level trace entry. + +**Command Specifics:** Both the immediate and the wait command are completed immediately and no post address is used. + +To initiate the trace, the NCB_NUM field must be set to X'FF', the NCB_LENGTH field must be set to the length of the trace table (1024 or greater), and the NCB_BUFFER@ must be set to the address of the trace table location in workstation memory. The NCB_ADPTR_NUM field must be set to a valid adapter number, but the trace will be active for both adapters. The automatic adapter open function of NetBIOS does not occur when this command is issued. This command can be issued either when an adapter is open or when it is closed. + +To terminate the trace, this command is issued with the NCB_NUM field set to X'00'. In this case the NCB_LENGTH and NCB_BUFFER@ fields are returned values. + +To terminate the trace locally and at remote adapters that have NetBIOS running and a trace active, set the NCB_NUM field to X'01'. This terminates the NCB.TRACE and also issues a PDT.TRACE.OFF command to terminate the adapter support software trace. It also causes a request to be sent to NetBIOS at all remote adapters to issue NCB.TRACE (off) and PDT.TRACE.OFF commands. If the local trace is not active, the command can still be issued to terminate remote traces even though the command will be completed with a return code of X'0D'. + +**Supplied Fields:** + +NCB_BUFFER@ (trace table address) +NCB_LENGTH (trace table length (at least 1024)) +NCB_NUM +X'FF' = trace on, +X'00' = local trace off +X'01' = local and all remote trace off +NCB_ADPTR_NUM (adapter number) + +**Returned Fields:** + +NCB_RETCODE + +NCB_RESERVE (if error X'4X' or X'FX' occurs) + +NCB_BUFFER@ (address of the trace table, returned when the trace off option is requested in the NCB_NUM field) + +NCB_LENGTH (length of the trace table, returned when the trace off option is requested in the NCB_NUM field) + +**Valid Return Codes:** See "NCB Return Codes Listed by Command" in topic B.4.1. + +Each trace entry is 32 bytes long. The initial entry is the table header. The next entry is the first trace entry. When all the trace table entry locations have been used, the table is wrapped back to the first entry overwriting previous entries. The initial, or header, entry is not overwritten. + ++-------------------------------------------------------------------+ +| Table 4-9. Trace | +| Entry Format Example | ++-------------------------------------------------------------------+ +| Trace Table Header | ++-------------------------------------------------------------------+ +| 1st Trace Entry | ++-------------------------------------------------------------------+ +| 2nd Trace Entry | ++-------------------------------------------------------------------+ +| 0 | +| 0 | +| 0 | ++-------------------------------------------------------------------+ +| Nth Trace Entry | ++-------------------------------------------------------------------+ + +Copyright IBM Corp. 1986, 1996 +4.6.23 - 1 + +--- + + +## Page 284 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB.TRACE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 4-10. The Trace Table Header Format
ByteUsage
00-03The address of the trace buffer (its own address)
04-05The length of the trace buffer
06-07The offset of the first trace entry
08-15Code change level
16-19Trace entry counter (low word, high word)
20-21Number of times internal response buffers were exhausted
22-23Number of times internal transmit buffers were exhausted
24-27Reserved
28-29Offset of the end of the trace buffer
30-31Offset of the next trace entry to be used
+ +Bytes 0 through 5 of all the trace entries are the same format. The format of the remainder of the entry is dependent upon the content of bytes 2 (type) and 3 (modifier). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 4-11. Trace Entry Format (Bytes 0 through 5)
ByteUsage
0Adapter
X'AA' = Adapter 0
X'BB' = Adapter 1
X'FF' = See note below.
1X'00' (non-3270 XMA code) or bank ID (if 3270 XMA code executing)
2Type
3Modifier of Type
4-5Number of 100-ms ticks since last entry
Note: If this command is the first use of NetBIOS since it was loaded, the X'FF' entry will appear for the next NCB command issued. That should be the only occurrence of a X'FF' entry.
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 4-12. Trace Entry Format (Bytes 6 through 31)
Byte 2 TypeByte 3 ModifyMeaningBytes 6-31
FF00NCB issuedByte 6 The byte preceding the NCB
Byte 7 The byte following the NCB
Bytes 8-11 NCB post address
Bytes 12-15 Address of data in workstation memory
Bytes 16-31 First 16 bytes of the NCB
01NCB immediate returnByte 6 The byte preceding the NCB
Byte 7 The byte following the NCB
Bytes 8-11 NCB post address
Bytes 12-15 Address of data in workstation memory
Bytes 16-31 First 16 bytes of the NCB
02NCB final return codeByte 6 The byte preceding the NCB
Byte 7 The byte following the NCB
Bytes 8-11 NCB post address
Bytes 12-15 Address of data in workstation memory
Bytes 16-31 First 16 bytes of the NCB
+ +Copyright IBM Corp. 1986, 1996 +4.6.23 - 2 + +--- + + +## Page 285 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB.TRACE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
EE00Network statusBytes 6-7DS
Bytes 8-9SS
Bytes 10-11SP
Bytes 12-15Address of data in workstation memory
Bytes 16-17Network status
01Protocol driver internal errorBytes 6-7DS
Bytes 8-9SS
Bytes 10-11SP
Bytes 12-15Address of data in workstation memory
Bytes 16-17Outstanding CCBs passed by the PC-detected error appendage
02Adapter statusBytes 6-7DS
Bytes 8-9SS
Bytes 10-11SP
Bytes 12-15Address of data in workstation memory
Bytes 16-19Pointer to the first in a queue of commands returned
Bytes 20-21Adapter check reason code
03DLC statusBytes 6-7DS
Bytes 8-9SS
Bytes 10-11SP
Bytes 12-15Address of data in workstation memory
Bytes 16-17Station ID
Bytes 18-19DLC status
Bytes 20-24FRMR data
Byte 25Access priority
Bytes 26-31Remote node address
0BThe CCB return codeTransmit I-format LPDUBytes 6-7DS
Bytes 8-9SS
Bytes 10-11SP
Bytes 12-15Address of data in workstation memory
Bytes 16-31NetBIOS header transmitted *
0DThe CCB return codeTransmit UI frameBytes 6-7DS
Bytes 8-9SS
Bytes 10-11SP
Bytes 12-15Address of data in workstation memory
Bytes 16-31NetBIOS header transmitted
2800Data received and processedBytes 6-7DS
Bytes 8-9SS
Bytes 10-11SP
Bytes 12-15Address of data in workstation memory
Bytes 16-31NetBIOS header received *
FFData received and not processedBytes 6-7DS
Bytes 8-9SS
Bytes 10-11SP
Bytes 12-15Address of data in workstation memory
Bytes 16-31NetBIOS header received *
Any other CCB cmd codeThe CCB return codeAny other CCB commandBytes 6-7DS
Bytes 8-9SS
Bytes 10-11SP
Bytes 12-15Address of data in workstation memory
Bytes 16-31Image of the CCB
+ +Note: *If byte 20 of the trace is either X'15' or X'16', then bytes 30-31 contain the length of the user data transmitted or received. + +
Copyright IBM Corp. 1986, 1996 +4.6.23 - 3
+ +--- + + +## Page 286 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB.UNLINK + +4.6.24 NCB.UNLINK + +``` ++--- Hex 70 Wait -------------------------------------------------+ +| | +| NCB.UNLINK | +| | ++---------------------------------------------------------------+ +``` + +**Command Description:** This command is provided for NetBIOS compatibility. NetBIOS 3.0 treats this as a "no-operation." + +**Supplied Fields:** +NCB_ADPTR_NUM (adapter number). + +**Returned Fields:** +NCB_RETCODE +NCB_RESERVE (if error X'4X' or X'FX' occurs). + +**Valid Return Codes:** See "NCB Return Codes Listed by Command" in topic B.4.1. + +
Copyright IBM Corp. 1986, 1996 +4.6.24 - 1
+ +--- + + +## Page 287 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Chapter 5. The NetBIOS Frames Protocol + +5.0 Chapter 5. The NetBIOS Frames Protocol + +Subtopics +5.1 About This Chapter +5.2 NetBIOS Protocol in the IBM LAN Client +5.3 Terms and Definitions +5.4 NetBIOS Commands +5.5 General Information on Remote Name Directory +5.6 NetBIOS Frame Formats and Descriptions +5.7 NetBIOS Protocol Examples without RND + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.0 - 1</page_number> + +--- + + +## Page 288 + +LAN Technical Reference: 802.2 and NetBIOS APIs +About This Chapter + +5.1 About This Chapter + +This chapter describes the frame formats and protocols used by NetBIOS to communicate across one of the IBM lans. Each NetBIOS command results in a local action in the station and may result in the transmission of NetBIOS frames on the network. + +The NetBIOS interface is a communication interface consisting of commands and their related control block structures. Communication on the network is done by using names to identify each communicating device. Two types of communication services are provided with this interface. One is a session-level service in which NetBIOS makes use of the IEEE 802.2 LLC connection-oriented services (Type 2) and the other is a datagram service in which NetBIOS makes use of the IEEE 802.2 LLC connectionless services (Type 1). + +Subtopics +5.1.1 Assumptions +5.1.2 Related Documents + +
Copyright IBM Corp. 1986, 1996 +5.1 - 1
+ +--- + + +## Page 289 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Assumptions + +5.1.1 Assumptions + +You should be familiar with the information contained in Chapter 4, "NetBIOS." You should also be familiar with general network architecture. + +In all cases, except where explicitly stated otherwise, a function that applies to some specific version also applies to later (higher) versions. + +
Copyright IBM Corp. 1986, 1996 +5.1.1 - 1
+ +--- + + +## Page 290 + +5.1.2 Related Documents + +The following LAN standards may be helpful: + +* ISO 8802-2 Local Area Networks Logical Link Control +* ISO 8802-5 Local Area Networks Token Ring Access Method. + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.1.2 - 1</page_number> + +--- + + +## Page 291 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NetBIOS Protocol in the IBM LAN Client + +5.2 NetBIOS Protocol in the IBM LAN Client + +IBM LAN Client NetBIOS implements the NetBIOS protocol with the following exceptions: + +**NETBIOS_NAME_1** When the encoded address is not available, IBM LAN Client uses the address currently in use by the MAC driver instead of the one in NetBIOS frames. (1) + +**Remote Name Directory** Because IBM LAN Client does not have control over the route field of the LAN header, IBM LAN Client cannot coerce initial query frames to the current ring only. This effects token ring only. + +**Broadcast** One type of NetBIOS frame directed to the NetBIOS functional address is sent all-routes broadcast and then all the rest are sent single-route broadcast. + +The NAME_RECOGNIZED frame is sent directly to the originator of the NAME_QUERY frame, but it is not sent all-routes broadcast. + +**Bridge Count** IBM LAN Client NetBIOS will not use Bridge Count in setting up timers. + +**SEND.NO.ACK** SESSION_INITIALIZE and SESSION_CONFIRM frames indicate that SEND.NO.ACK is not supported. + +**PiggyBacked Acknowledgments** Piggybacked Acknowledgments are not supported. + +(1) NETBIOS_NAME_1 is transmitted in the name field of frames such as STATUS_QUERY, STATUS_RESPONSE, NAME_IN_CONFLICT, NAME_QUERY and NAME_RECOGNIZED for NCB.STATUS command. + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.2 - 1</page_number> + +--- + + +## Page 292 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Terms and Definitions + +5.3 Terms and Definitions + +Refer to the glossary in the back of this manual for a complete terminology list. + +Subtopics +5.3.1 The NetBIOS Service Access Point (SAP) +5.3.2 Addressing +5.3.3 Broadcast +5.3.4 Data Structures +5.3.5 Translation + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.3 - 1</page_number> + +--- + + +## Page 293 + +LAN Technical Reference: 802.2 and NetBIOS APIs +The NetBIOS Service Access Point (SAP) + +5.3.1 The NetBIOS Service Access Point (SAP) + +NetBIOS opens and uses SAP X'F0'. This SAP value is reserved by IBM for use by the NetBIOS function. + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.3.1 - 1</page_number> + +--- + + +## Page 294 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Addressing + +5.3.2 Addressing + +NetBIOS sets the functional address X'00000080' on the adapter. This functional address is used by NetBIOS when broadcasting frames. This functional address bit is reserved by IBM for use by the NetBIOS function. + +
Copyright IBM Corp. 1986, 1996
+
5.3.2 - 1
+ +--- + + +## Page 295 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Broadcast + +5.3.3 Broadcast + +NetBIOS makes use of the broadcast capability of the network. In all cases but one, frames are sent as single-route broadcast: the broadcast bit and the single-route broadcast bit in the routing control field are both set to 1. In one case a frame is sent as a general broadcast: the broadcast bit in the routing control field is set to 1 and the single-route broadcast bit is set to 0 (zero). + +Single-Route Broadcast: Single-route broadcast means that only one frame is to be delivered to each ring. This can be accomplished by designating selected bridges to forward single-route broadcast frames. Frames sent using single-route broadcast will have the broadcast bit and the single-route broadcast bit in the routing control field both set to 1. + +General Broadcast: General broadcast means that all bridges will forward such frames. A frame sent using general broadcast will have the broadcast bit in the routing control field set to 1 and the single-route broadcast bit set to 0 (zero). + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.3.3 - 1</page_number> + +--- + + +## Page 296 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Data Structures + +5.3.4 Data Structures + +The data definition of each NetBIOS frame is shown using the INTEL data types for the various fields. The DB (define byte) type is used to define single byte fields and byte string fields. The DW (define word) type is used primarily to define 2-byte numeric fields. + +Note: Fields defined as DW reside in memory as byte reversed. When a frame is transmitted, these fields are transmitted as they appear in memory-byte reversed. + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.3.4 - 1</page_number> + +--- + + +## Page 297 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Translation + +5.3.5 Translation + +NetBIOS assumes no translation for any character strings used in the NetBIOS frames (for example, names). These strings are viewed simply as binary data. + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.3.5 - 1</page_number> + +--- + + +## Page 298 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NetBIOS Commands + +5.4 NetBIOS Commands + +Below is a list of the NetBIOS commands. Some of these command names are referred to in the description of some of the NetBIOS frames. + +NCB.ADD.GROUP.NAME +NCB.ADD.NAME +NCB.CALL +NCB.CANCEL +NCB.CHAIN.SEND +NCB.CHAIN.SEND.NO.ACK +NCB.DELETE.NAME +NCB.FIND.NAME +NCB.HANGUP +NCB.LAN.STATUS.ALERT +NCB.LISTEN +NCB.RECEIVE +NCB.RECEIVE.ANY +NCB.RECEIVE.BROADCAST.DATAGRAM +NCB.RECEIVE.DATAGRAM +NCB.RESET +NCB.SEND +NCB.SEND.BROADCAST.DATAGRAM +NCB.SEND.DATAGRAM +NCB.SEND.NO.ACK +NCB.SESSION.STATUS +NCB.STATUS +NCB.TRACE +NCB.UNLINK + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.4 - 1</page_number> + +--- + + +## Page 299 + +LAN Technical Reference: 802.2 and NetBIOS APIs +General Information on Remote Name Directory + +5.5 General Information on Remote Name Directory + +Remote Name Directory (RND) functions are implemented in NetBIOS Version 2.1. + +To reduce the unnecessary interrupts to NetBIOS nodes, which are caused by broadcast frames to the NetBIOS functional address, the RND function is used to send the frame to a specific node, whenever possible. + +The local station locates a remote name (on-ring only if RND is used) by: + +1. Issuing a NAME_QUERY on-ring once +2. Issuing a NAME_QUERY off-ring per transmit count +3. Transmitting timeout values that can be defined by configuration parameters + +The range for NCB.TRANSMIT.COUNT is 1 through 10, and the default is 6. +The range for NCB.TRANSMIT.TIMEOUT is 1/2 second to 10 seconds, and the default is 1/2 second. + +When RND is used, after the local station has located a remote name, the remote node address is saved and subsequent messages to that name will be to a specific node rather than a broadcast to all nodes. This is true for CALLS and STATUS QUERIES (and also for SEND DATAGRAMS if REMOTE.DATAGRAM.CONTROL is used). + +**Note:** When the RND function is being used, a duplicate network name will not be detected by a CALL function unless it is the first time that the remote (CALL) name has been used. + +Subtopics +5.5.1 New NCB Commands +5.5.2 Header Format Overview +5.5.3 NetBIOS Header +5.5.4 NetBIOS Frame Summary + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.5 - 1</page_number> + +--- + + +## Page 300 + +LAN Technical Reference: 802.2 and NetBIOS APIs +New NCB Commands + +5.5.1 New NCB Commands + +Two new commands: NCB.SEND.NO.ACK and NCB.CHAIN.SEND.NO.ACK were introduced in NetBIOS Version 2.2. The purpose of the NCB.SEND.NO.ACK and NCB.CHAIN.SEND.NO.ACK commands is to provide a SEND facility that does not require NetBIOS to transmit a data acknowledgment. This is to reduce the completion time of a SEND type of command. There is also a new NCB.LAN.STATUS.ALERT command. This LAN status command allows application programs to be alerted of temporary ring error conditions that last more than one minute. + +
Copyright IBM Corp. 1986, 1996 +5.5.1 - 1
+ +--- + + +## Page 301 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Header Format Overview + +5.5.2 Header Format Overview + +All NetBIOS frames contain a header that immediately follows the data link control (DLC) header: + +<img>Figure 5-1. NetBIOS Frame Example</img> + +Notes: +1. With respect to the DLC frame, the NetBIOS header is data. +2. USER DATA is applicable on certain messages only. + +
Copyright IBM Corp. 1986, 1996 +5.5.2 - 1
+ +--- + + +## Page 302 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NetBIOS Header + +5.5.3 NetBIOS Header + +In this section the various NetBIOS frame headers are described. Refer to IBM Token-Ring Network Architecture Reference for a complete description of the LAN and DLC headers. Following are examples of NetBIOS frames. + + + + + + + + + + + + +
NETBIOS Header LengthX'EFFF'CommandOptional Data1Optional Data2Xmit/Resp CorrelatorDest IDSource ID
+ +Figure 5-2. General Format + +Subtopics +5.5.3.1 NetBIOS Non-Session Frame Header (DLC UI-Frame) +5.5.3.2 NetBIOS Session Frame Header (DLC I-Format LPDU) +5.5.3.3 NetBIOS Frame Header Fields + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.5.3 - 1</page_number> + +--- + + +## Page 303 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NetBIOS Non-Session Frame Header (DLC UI-Frame) + +5.5.3.1 NetBIOS Non-Session Frame Header (DLC UI-Frame) + +These frames are transmitted using DLC connectionless services to either a functional address or a specific address: + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
024568122844
NETBIOS Header LengthX'EFFF'CommandOptional Data1Optional Data2Xmit/Resp CorrelatorDest NameSource Name
+ +Figure 5-3. NetBIOS Non-Session Frame Header (DLC UI-Frame) + +
Copyright IBM Corp. 1986, 1996 +5.5.3.1 - 1
+ +--- + + +## Page 304 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NetBIOS Session Frame Header (DLC I-Format LPDU) + +5.5.3.2 NetBIOS Session Frame Header (DLC I-Format LPDU) + +These frames are transmitted using DLC connection-oriented services to a specific address: + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
024568121314
NETBIOS Header LengthX'EFFF'CommandOptional Data1Optional Data2Xmit/Resp CorrelatorDest NumSource Num
+ +Figure 5-4. NetBIOS Session Frame Header (DLC I-Format LPDU) + +
Copyright IBM Corp. 1986, 1996 +5.5.3.2 - 1
+ +--- + + +## Page 305 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NetBIOS Frame Header Fields + +5.5.3.3 NetBIOS Frame Header Fields + +**BYTES MEANING** + +**0-1** NetBIOS Header Length-The length of NetBIOS header (including the length field) + +**2-3** X'EFFF'-A delimiter that indicates that subsequent data is destined for the NetBIOS function. + +**4** Command-A specific protocol command that indicates the type or function of the frame. The command codes are partitioned as follows: + +X'00' to X'13' UI frames +X'14' to X'1F' I-format LPDUs + +**5** Data1-1 byte of optional data per a specific command + +**6-7** Data2-2 bytes of optional data per a specific command + +**8-11** Correlator-One or two numbers in the range X'0001' to X'FFFF'. Used to associate received responses with transmitted requests. + +* Transmit Correlator: The value returned in a response to a given query (the value was received as the response correlator). +* Response Correlator: The value expected (in the transmit correlator field) when the response to that message is received. + +**Note:** Commands X'00' to X'07' will be discarded by the sending NetBIOS upon return to the station. For example, when an ADD_NAME_QUERY is received by the station that transmitted it, the message is discarded. + +Remaining bytes depend upon message type. + +1. Non-Session frame (DLC UI frame): + + **Bytes Meaning** + + **12-27** Destination Name-A 16-character destination name. + + **28-43** Source Name-A 16-character source name. + +2. Session frame (DLC I-format LPDU): + + **Bytes Meaning** + + **12** Destination Number-A 1-byte destination session number. + + **13** Source Number-A 1-byte source session number. + +
Copyright IBM Corp. 1986, 1996 +5.5.3.3 - 1
+ +--- + + +## Page 306 + +5.5.4 NetBIOS Frame Summary + +Each NetBIOS frame has been given a name that suggests its use in implementing the various NetBIOS commands. The following tables summarize these commands. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 5-1. NetBIOS Frames Listed Alphabetically
Frame NameCodeFunction
ADD_GROUP_NAME_QUERYX'00'Check for duplicate group name on network
ADD_NAME_QUERYX'01'Check for duplicate name on network
ADD_NAME_RESPONSEX'0D'Negative response: add name is duplicate
DATA_ACKX'14'DATA_ONLY_LAST acknowledgment
DATA_FIRST_MIDDLEX'15'Session data message-first or middle frame
DATAGRAMX'08'Application program-generated datagram
DATAGRAM_BROADCASTX'09'Application program-generated broadcast datagram
DATA_ONLY_LASTX'16'Session data message-only or last frame
NAME_IN_CONFLICTX'02'Duplicate names detected
NAME_QUERYX'0A'Request to locate a name on the network
NAME_RECOGNIZEDX'0E'Name Recognized: NAME_QUERY response
NO_RECEIVEX'1A'No receive command to hold received data
RECEIVE_CONTINUEX'1C'Indicates receive pending
RECEIVE_OUTSTANDINGX'1B'Retransmit last data-receive command up
SESSION_ALIVEX'1F'Verify session is still active
SESSION_CONFIRMX'17'SESSION_INITIALIZE acknowledgment
SESSION_ENDX'18'Session termination
SESSION_INITIALIZEX'19'A session has been set up
STATUS_QUERYX'03'Request remote node status
STATUS_RESPONSEX'0F'Remote node status information, STATUS_QUERY response
TERMINATE_TRACEX'07'Terminate traces at remote nodes
TERMINATE_TRACEX'13'Terminate traces at local and remote nodes
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 5-2. NetBIOS Frames Listed Numerically
Frame NameCodeFunction
ADD_GROUP_NAME_QUERYX'00'Check for duplicate group name on network
ADD_NAME_QUERYX'01'Check for duplicate name on network
NAME_IN_CONFLICTX'02'Duplicate names detected
STATUS_QUERYX'03'Request remote node status
TERMINATE_TRACEX'07'Terminate traces at remote nodes
DATAGRAMX'08'Application program-generated datagram
DATAGRAM_BROADCASTX'09'Application program-generated broadcast datagram
+ +Copyright IBM Corp. 1986, 1996 +5.5.4 - 1 + +--- + + +## Page 307 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NetBIOS Frame Summary + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NAME_QUERYX'0A'Request to locate a name on the network
ADD_NAME_RESPONSEX'0D'Negative response: add name is duplicate
NAME_RECOGNIZEDX'0E'Name Recognized: NAME_QUERY response
STATUS_RESPONSEX'0F'Remote node status information, STATUS_QUERY response
TERMINATE_TRACEX'13'Terminate traces at local and remote nodes
DATA_ACKX'14'DATA_ONLY_LAST acknowledgment
DATA_FIRST_MIDDLEX'15'Session data message-first or middle frame
DATA_ONLY_LASTX'16'Session data message-only or last frame
SESSION_CONFIRMX'17'SESSION_INITIALIZE acknowledgment
SESSION_ENDX'18'Session termination
SESSION_INITIALIZEX'19'A session has been set up
NO_RECEIVEX'1A'No receive command to hold received data
RECEIVE_OUTSTANDINGX'1B'Retransmit last data-receive command up
RECEIVE_CONTINUEX'1C'Indicates receive pending
SESSION_ALIVEX'1F'Verify session is still active
+ +Subtopics +5.5.4.1 NetBIOS Frames Listed by Function +5.5.4.2 NetBIOS Frames Listed by Transmission Type + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.5.4 - 2</page_number> + +--- + + +## Page 308 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NetBIOS Frames Listed by Function + +5.5.4.1 NetBIOS Frames Listed by Function + +The NetBIOS frames are grouped below by function. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 5-3. NetBIOS Name Management Frames
Frame NameCodeFunction
ADD_GROUP_NAME_QUERYX'00'Check for duplicate group name on network
ADD_NAME_QUERYX'01'Check for duplicate name on network
ADD_NAME_RESPONSEX'0D'Negative response: add name is duplicate
NAME_IN_CONFLICTX'02'Duplicate names detected
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 5-4. NetBIOS Session Establishment and Termination Frames
Frame NameCodeFunction
NAME_QUERYX'0A'Request to locate a name on the network
NAME_RECOGNIZEDX'0E'Name Recognized: NAME_QUERY response
SESSION_ALIVEX'1F'Verify session is still active
SESSION_CONFIRMX'17'SESSION_INITIALIZE acknowledgment
SESSION_ENDX'18'Session termination
SESSION_INITIALIZEX'19'A session has been set up
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 5-5. NetBIOS Data Transfer Frames
Frame NameCodeFunction
DATA_ACKX'14'DATA_ONLY_LAST acknowledgment
DATA_FIRST_MIDDLEX'15'Session data message-first or middle frame
DATAGRAMX'08'Application program-generated datagram
DATAGRAM_BROADCASTX'09'Application program-generated broadcast datagram
DATA_ONLY_LASTX'16'Session data message-only or last frame
NO_RECEIVEX'1A'No receive command to hold received data
RECEIVE_CONTINUEX'1C'Indicates receive pending
RECEIVE_OUTSTANDINGX'1B'Re-transmit last data-receive command up
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 5-6. Additional NetBIOS Frames
Frame NameCodeFunction
STATUS_QUERYX'03'Request remote node status
STATUS_RESPONSEX'0F'Remote node status information, STATUS_QUERY response
TERMINATE_TRACEX'07'Terminate traces at remote nodes
TERMINATE_TRACEX'13'Terminate traces at local and remote nodes
+ +Copyright IBM Corp. 1986, 1996 +5.5.4.1 - 1 + +--- + + +## Page 309 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NetBIOS Frames Listed by Transmission Type + +5.5.4.2 NetBIOS Frames Listed by Transmission Type + +The NetBIOS frames are grouped below according to the type of transmission used for each frame. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 5-7. NetBIOS UI Frames to Functional Address, Single-Route Broadcast
Frame NameCodeFunction
ADD_GROUP_NAME_QUERYX'00'Check for duplicate group name on network
ADD_NAME_QUERYX'01'Check for duplicate name on network
DATAGRAM *X'08'Application program-generated datagram
DATAGRAM_BROADCASTX'09'Application program-generated broadcast datagram
NAME_IN_CONFLICTX'02'Duplicate names detected
NAME_QUERY *X'0A'Request to locate a name on the network
STATUS_QUERY *X'03'Request remote node status
TERMINATE_TRACEX'07'Terminate traces at remote nodes
TERMINATE_TRACEX'13'Terminate traces at local and remote nodes
+ +* If remote name directory function is used, UI frames are sent to the specific address with no broadcast. + + + + + + + + + + + + + + + + + + + + + + + + +
Table 5-8. NetBIOS UI Frames to Specific Address, No Broadcast
Frame NameCodeFunction
ADD_NAME_RESPONSEX'0D'Negative response: add name is duplicate
STATUS_RESPONSEX'0F'Remote node status information, STATUS_QUERY response
+ + + + + + + + + + + + + + + + + + + +
Table 5-9. NetBIOS UI Frames to Specific Address, General Broadcast
Frame NameCodeFunction
NAME_RECOGNIZEDX'0E'Name Recognized: NAME_QUERY response
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 5-10. NetBIOS I-Format LPDU to Specific Address, No Broadcast
Frame NameCodeFunction
DATA_ACKX'14'DATA_ONLY_LAST acknowledgment
DATA_FIRST_MIDDLEX'15'Session data message-first or middle frame
DATA_ONLY_LASTX'16'Session data message-only or last frame
NO_RECEIVEX'1A'No receive command to hold received data
RECEIVE_OUTSTANDINGX'1B'Retransmit last data-receive command up
SESSION_CONFIRMX'17'SESSION_INITIALIZE acknowledgment
SESSION_ENDX'18'Session termination
SESSION_INITIALIZEX'19'A session has been set up
RECEIVE_CONTINUEX'1C'Indicates receive pending
SESSION_ALIVEX'1F'Verify session is still active
+ +Copyright IBM Corp. 1986, 1996 +5.5.4.2 - 1 + +--- + + +## Page 310 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NetBIOS Frames Listed by Transmission Type + +
Copyright IBM Corp. 1986, 1996 +5.5.4.2 - 2
+ +--- + + +## Page 311 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NetBIOS Frame Formats and Descriptions + +5.6 NetBIOS Frame Formats and Descriptions + +This section describes each NetBIOS frame. The frame descriptions are organized by command value. + +Subtopics +5.6.1 ADD_GROUP_NAME_QUERY +5.6.2 ADD_NAME_QUERY +5.6.3 NAME_IN_CONFLICT +5.6.4 STATUS_QUERY +5.6.5 TERMINATE_TRACE +5.6.6 DATAGRAM +5.6.7 DATAGRAM_BROADCAST +5.6.8 NAME_QUERY +5.6.9 ADD_NAME_RESPONSE +5.6.10 NAME_RECOGNIZED +5.6.11 STATUS_RESPONSE +5.6.12 TERMINATE_TRACE +5.6.13 DATA_ACK +5.6.14 DATA_FIRST_MIDDLE +5.6.15 DATA_ONLY_LAST +5.6.16 SESSION_CONFIRM +5.6.17 SESSION_END +5.6.18 SESSION_INITIALIZE +5.6.19 NO_RECEIVE +5.6.20 RECEIVE_OUTSTANDING +5.6.21 RECEIVE_CONTINUE +5.6.22 SESSION_ALIVE + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.6 - 1</page_number> + +--- + + +## Page 312 + +LAN Technical Reference: 802.2 and NetBIOS APIs +ADD_GROUP_NAME_QUERY + +5.6.1 ADD_GROUP_NAME_QUERY + +``` ++---- Hex 00 ---------------------------------------------+ +| | +| ADD_GROUP_NAME_QUERY | +| | ++--------------------------------------------------------+ +``` + +**Initiation:** This frame is initiated by an ADD.GROUP.NAME command. + +**Function:** To verify that the group name to be added does not already exist as a unique name within the network. + +**Transmission:** This frame is transmitted as a UI frame to the NetBIOS functional address using single-route broadcast. + +**Responses:** If there is no response within the system timeout period, the name is not already in use as a unique name. An ADD_NAME_RESPONSE indicates that the name is already in use as a unique name and cannot be added as a group name. + +**Note:** An ADD_NAME_RESPONSE from more than one remote adapter causes the local adapter to transmit a NAME_IN_CONFLICT to all remote adapters. + +**Retries:** The number of times the frame is transmitted can be defined by the NCB.TRANSMIT.COUNT parameter. The range for this count is 1 to 10 and the default is 6. + +**Note:** The frame will be sent this number of times whether a response is received or not. + +**Timeouts:** The timeout value between retransmissions of this frame can be defined by the NCB.TRANSMIT.TIMEOUT parameter. The range is 1/2 second to 10 seconds, and the default is 1/2 second. + +Table 5-11. ADD_GROUP_NAME_QUERY Frame Format + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OffsetField NameByte LengthTypeDescription
0LENGTH2DWX'002C'
2DELIMITER2DWX'EFFF'
4COMMAND1DBX'00'
5DATA11DBReserved
6DATA22DWReserved
8XMIT CORRELATOR2DWReserved
10RSP CORRELATOR2DWX'nnnn'
12DEST NAME16DBReserved
28SOURCE NAME16DBGroup name to be added
+ +Response Correlator + +**Explanation:** This is a 2-byte correlator generated by the sender and used to correlate any responses to this query. It is returned in any ADD_NAME_RESPONSE in the transmit correlator field. + +Source Name + +**Explanation:** This is a 16-byte field that contains the group name to be added. This is the NCB_NAME field in the ADD.GROUP.NAME command. + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.6.1 - 1</page_number> + +--- + + +## Page 313 + +LAN Technical Reference: 802.2 and NetBIOS APIs +ADD_NAME_QUERY + +5.6.2 ADD_NAME_QUERY + +``` ++--- Hex 01 ---------------------------------------------+ +| | +| ADD_NAME_QUERY | +| | ++-------------------------------------------------------+ +``` + +**Initiation:** This frame is initiated by an ADD.NAME command. + +**Function:** To verify that the name to be added is a unique name within the network. + +**Transmission:** This frame is transmitted as a UI frame to the NetBIOS functional address using single-route broadcast. + +**Responses:** If there is no response within the system timeout period, the name is a unique name. An ADD_NAME_RESPONSE indicates that the name is not unique and cannot be added. + +**Note:** An ADD_NAME_RESPONSE from more than one remote adapter will cause the local adapter to transmit a NAME_IN_CONFLICT to all remote adapters. + +**Retries:** The number of times the frame is transmitted can be defined by the NCB.TRANSMIT.COUNT parameter. The range for this count is 1 to 10 and the default is 6. + +**Note:** The frame will be sent this number of times whether a response is received or not. + +**Timeouts:** The timeout value between transmissions of this frame can be defined by the NCB.TRANSMIT.TIMEOUT parameter. The range is 1/2 second to 10 seconds and the default is 1/2 second. + +``` ++-------------------------------------------------------+ +| Table 5-12. ADD_NAME_QUERY Frame Format | ++-------------------------------------------------------+ +| Offset | Field Name | Byte | 8086 | Description | +| | | Length | Type | | ++--------+----------------+------+-------+-----------------+ +| 0 | LENGTH | 2 | DW | X'002C' | ++--------+----------------+------+-------+-----------------+ +| 2 | DELIMITER | 2 | DW | X'EFFF' | ++--------+----------------+------+-------+-----------------+ +| 4 | COMMAND | 1 | DB | X'01' | ++--------+----------------+------+-------+-----------------+ +| 5 | DATA1 | 1 | DB | Reserved | ++--------+----------------+------+-------+-----------------+ +| 6 | DATA2 | 2 | DW | Reserved | ++--------+----------------+------+-------+-----------------+ +| 8 | XMIT CORRELATOR| 2 | DW | Reserved | ++--------+----------------+------+-------+-----------------+ +| 10 | RSP CORRELATOR | 2 | DW | X'nnnn' | ++--------+----------------+------+-------+-----------------+ +| 12 | DEST NAME | 16 | DB | Reserved | ++--------+----------------+------+-------+-----------------+ +| 28 | SOURCE NAME | 16 | DB | Name to be added | ++--------+----------------+------+-------+-----------------+ +``` + +**Response Correlator** + +**Explanation:** This is a 2-byte correlator generated by the sender and used to correlate any responses to this query. It is returned in any ADD_NAME_RESPONSE in the transmit correlator field. + +**Source Name** + +**Explanation:** This is a 16-byte field that contains the name to be added. This is the NCB_NAME field in the ADD.NAME command. + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.6.2 - 1</page_number> + +--- + + +## Page 314 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NAME_IN_CONFLICT + +5.6.3 NAME_IN_CONFLICT + ++--- Hex 02 -----------------------------------------------+ +| NAME_IN_CONFLICT | ++---------------------------------------------------------+ + +**Initiation:** This frame is sent if one of the following conditions is detected: +☐ More than one adapter has the same unique name registered +☐ A name is registered as both a group name and a unique name in the network. + +For example, this frame is sent if an ADD_NAME_RESPONSE is received from more than one node following transmission of an ADD_NAME_QUERY or ADD_GROUP_NAME_QUERY. This frame is also sent if a NAME_RECOGNIZED is received from more than one adapter following transmission of a NAME_QUERY. + +**Function:** To indicate to all nodes that the specified name has been detected as being registered at more than one node. + +**Transmission:** This frame is transmitted as a UI frame to the NetBIOS functional address using single-route broadcast. + +**Responses:** None + +**Retries:** The number of times the frame is transmitted can be defined by the NCB.TRANSMIT.COUNT parameter. The range for this count is 1 to 10, and the default is 6. + +**Timeouts:** The timeout value between retransmissions of this frame can be defined by the NCB.TRANSMIT.TIMEOUT parameter. The range is 1/2 second to 10 seconds, and the default is 1/2 second. + ++---------------------------------------------------------+ +| Table 5-13. NAME_IN_CONFLICT Frame Format | ++---------------------------------------------------------+ +| Offset | Field Name | Byte Length | Type | Description | ++--------+----------------+-------------+------+-------------+ +| 0 | LENGTH | 2 | DW | X'002C' | ++--------+----------------+-------------+------+-------------+ +| 2 | DELIMITER | 2 | DW | X'EFFF' | ++--------+----------------+-------------+------+-------------+ +| 4 | COMMAND | 1 | DB | X'02' | ++--------+----------------+-------------+------+-------------+ +| 5 | DATA1 | 1 | DB | Reserved | ++--------+----------------+-------------+------+-------------+ +| 6 | DATA2 | 2 | DW | Reserved | ++--------+----------------+-------------+------+-------------+ +| 8 | XMIT CORRELATOR| 2 | DW | Reserved | ++--------+----------------+-------------+------+-------------+ +| 10 | RSP CORRELATOR | 2 | DW | Reserved | ++--------+----------------+-------------+------+-------------+ +| 12 | DEST NAME | 16 | DB | Name in conflict | ++--------+----------------+-------------+------+-------------+ +| 28 | SOURCE NAME | 16 | DB | Sending node NAME_NUMBER_1 | ++--------+----------------+-------------+------+-------------+ + +--------------------------------------------- Destination Name + +**Explanation:** This is a 16-byte field containing the name that was determined to be in conflict. + +--------------------------------------------- Source Name + +**Explanation:** This is a 16-byte field that contains the NAME_NUMBER_1, consisting of 10 bytes of binary zeros followed by the 6-byte permanently encoded address for this adapter. + +Copyright IBM Corp. 1986, 1996 +5.6.3 - 1 + +--- + + +## Page 315 + +LAN Technical Reference: 802.2 and NetBIOS APIs +STATUS_QUERY + +5.6.4 STATUS_QUERY + +``` ++---- Hex 03 -----------------------------------------------+ +| | +| STATUS_QUERY | +| | ++----------------------------------------------------------+ +``` + +Initiation: This frame is sent because of STATUS command. + +Function: To request remote adapter status. + +Transmission: This frame is transmitted as a UI frame to the NetBIOS functional address using single-route broadcast. + +Responses: No response within the system timeout period causes the command to time out. A STATUS_RESPONSE is used to return the remote adapter status. + +If a status request is sent to a NetBIOS 2.1 station from a NetBIOS 2.1 station, and the remote adapter cannot transmit all the status data at once, upon receiving the STATUS_RESPONSE, an additional STATUS_QUERY frame is transmitted as a UI frame to the specific address of the node that sent the STATUS_RESPONSE. This process is repeated until all the data is received or the application program buffer is filled up. + +Retries: The number of times the frame is transmitted can be defined by the NCB.TRANSMIT.COUNT parameter. The range for this count is 1 to 10 and the default is 6. + +Timeouts: The timeout value between transmissions of this frame can be defined by the NCB.TRANSMIT.TIMEOUT parameter. The range is 1/2 second to 10 seconds, and the default is 1/2 second. + +Table 5-14. STATUS_QUERY Frame Format + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OffsetField NameByte LengthTypeDescription
0LENGTH2DWX'002C'
2DELIMITER2DWX'EFFF'
4COMMAND1DBX'03'
5DATA11DBX'nn'
6DATA22DWLength of user's status buffer
8XMIT CORRELATOR2DWreserved
10RSP CORRELATOR2DWX'nnnn'
12DEST NAME16DBName of receiver
28SOURCE NAME16DBSending node NAME_NUMBER_1
+ +Data1 + +Explanation: This is a 1-byte field generated by the sender. + +X'nn' indicates the status request, where: + +X'nn' = 0 Status request 1.x or 2.0 + +X'nn' = 1 Initial status request, NetBIOS 2.1 + +X'nn' > 1 NetBIOS 2.1 request for more names and an indication of the total number of names received so far (names received in the first response and all additional name responses). + +Note: The X'nn' > 1 status request is not transmitted unless the remote station is NetBIOS 2.1. + +Data2 + +Explanation: This is a 2-byte field containing the length of the user's buffer area as defined by the NCB_LENGTH field in the STATUS command. + +Response Correlator + +Copyright IBM Corp. 1986, 1996 +5.6.4 - 1 + +--- + + +## Page 316 + +LAN Technical Reference: 802.2 and NetBIOS APIs +STATUS_QUERY + +**Explanation:** This is a 2-byte correlator generated by the sender and used to correlate any responses to this query. It is returned in any STATUS_RESPONSE in the transmit correlator field. + +--- + +**Destination Name** + +**Explanation:** This is a 16-byte field containing the name on the network for which the status is being requested. This is the name from the NCB_CALLNAME field in the STATUS command. + +--- + +**Source Name** + +**Explanation:** This is a 16-byte field that contains the NAME_NUMBER_1, consisting of 10 bytes of binary zeros followed by the 6-byte permanent adapter address for this adapter. + +
Copyright IBM Corp. 1986, 1996 +5.6.4 - 2
+ +--- + + +## Page 317 + +LAN Technical Reference: 802.2 and NetBIOS APIs +TERMINATE_TRACE + +5.6.5 TERMINATE_TRACE + ++---- Hex 07 ---------------------------------------------+ +| TERMINATE_TRACE | ++----------------------------------------------------------+ + +Initiation: This frame is sent as a result of a TRACE command with the "remote trace off" option set (NCB_NUM = X'01'). +Function: To terminate the trace at any remote nodes that had activated a trace with the TRACE command. +Transmission: This frame is transmitted as a UI frame to the NetBIOS functional address using single-route broadcast. +Responses: None +Retries: None +Timeouts: None + ++----------------------------------------------------------+ +| Table 5-15. TERMINATE_TRACE Frame Format | ++----------------------------------------------------------+ +| Offset | Field Name | Byte | 8086 | Description | +| | | Length | Type | | ++--------+----------------+--------+------+-------------+ +| 0 | LENGTH | 2 | DW | X'002C' | ++--------+----------------+--------+------+-------------+ +| 2 | DELIMITER | 2 | DW | X'EFFF' | ++--------+----------------+--------+------+-------------+ +| 4 | COMMAND | 1 | DB | X'07' | ++--------+----------------+--------+------+-------------+ +| 5 | DATA1 | 1 | DB | Reserved | ++--------+----------------+--------+------+-------------+ +| 6 | DATA2 | 2 | DW | Reserved | ++--------+----------------+--------+------+-------------+ +| 8 | XMIT CORRELATOR| 2 | DW | Reserved | ++--------+----------------+--------+------+-------------+ +| 10 | RSP CORRELATOR | 2 | DW | Reserved | ++--------+----------------+--------+------+-------------+ +| 12 | DEST NAME | 16 | DB | Reserved | ++--------+----------------+--------+------+-------------+ +| 28 | SOURCE NAME | 16 | DB | Reserved | ++--------+----------------+--------+------+-------------+ + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.6.5 - 1</page_number> + +--- + + +## Page 318 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DATAGRAM + +5.6.6 DATAGRAM + +``` ++---- Hex 08 -----------------------------------------------+ +| | +| DATAGRAM | +| | ++-----------------------------------------------------------+ +``` + +Initiation: This frame is sent as a result of a SEND.DATAGRAM command. + +Function: To transmit a user-specified datagram to a name. + +Transmission: This frame is transmitted as a UI frame to the NetBIOS functional address using single-route broadcast. + +Responses: None + +Retries: None + +Timeouts: None + +``` ++-----------------------------------------------------------+ +| Table 5-16. DATAGRAM Frame Format | ++-----------------------------------------------------------+ +| Offset | Field Name | Byte Length | 8086 Type | Description | ++--------+----------------+-------------+-----------+-------------+ +| 0 | LENGTH | 2 | DW | X'002C' | ++--------+----------------+-------------+-----------+-------------+ +| 2 | DELIMITER | 2 | DW | X'EFFF' | ++--------+----------------+-------------+-----------+-------------+ +| 4 | COMMAND | 1 | DB | X'08' | ++--------+----------------+-------------+-----------+-------------+ +| 5 | DATA1 | 1 | DB | Reserved | ++--------+----------------+-------------+-----------+-------------+ +| 6 | DATA2 | 2 | DW | Reserved | ++--------+----------------+-------------+-----------+-------------+ +| 8 | XMIT CORRELATOR| 2 | DW | Reserved | ++--------+----------------+-------------+-----------+-------------+ +| 10 | RSP CORRELATOR | 2 | DW | Reserved | ++--------+----------------+-------------+-----------+-------------+ +| 12 | DEST NAME | 16 | DB | Name of receiver | ++--------+----------------+-------------+-----------+-------------+ +| 28 | SOURCE NAME | 16 | DB | Name of sender | ++--------+----------------+-------------+-----------+-------------+ +| 44 | USER DATA | nn | DB | Datagram | ++--------+----------------+-------------+-----------+-------------+ +``` + +--- + +### Destination Name + +**Explanation:** This is a 16-byte field containing the name on the network to which the datagram is being sent. This is the NCB_CALLNAME field in the SEND.DATAGRAM command. + +--- + +### Source Name + +**Explanation:** This is a 16-byte field that contains the name of the originator of the datagram. This is the name associated with the NCB_NUM field in the SEND.DATAGRAM command. + +--- + +### User Data + +**Explanation:** This is the datagram that the user provided with the SEND.DATAGRAM command. + +**Note:** If the adapter is opened by an application program other than NetBIOS, and the size of the transmit buffer is not sufficient for the size of the datagram, the datagram is truncated with no indication given. + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.6.6 - 1</page_number> + +--- + + +## Page 319 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DATAGRAM_BROADCAST + +5.6.7 DATAGRAM_BROADCAST + ++---- Hex 09 -----------------------------------------------+ +| DATAGRAM_BROADCAST | ++-----------------------------------------------------------+ + +Initiation: This frame is sent as a result of a SEND.BROADCAST.DATAGRAM command. + +Function: To transmit a user-specified datagram to all names on the network. + +Transmission: This frame is transmitted as a UI frame to the NetBIOS functional address using single-route broadcast. + +Responses: None + +Retries: None + +Timeouts: None + ++-----------------------------------------------------------+ +| Table 5-17. DATAGRAM_BROADCAST Frame Format | ++-----------------------------------------------------------+ +| Offset | Field Name | Byte | 8086 | Description | +| | | Length | Type | | ++--------+----------------+------+-------+--------------------+ +| 0 | LENGTH | 2 | DW | X'002C' | ++--------+----------------+------+-------+--------------------+ +| 2 | DELIMITER | 2 | DW | X'EFFF' | ++--------+----------------+------+-------+--------------------+ +| 4 | COMMAND | 1 | DB | X'09' | ++--------+----------------+------+-------+--------------------+ +| 5 | DATA1 | 1 | DB | Reserved | ++--------+----------------+------+-------+--------------------+ +| 6 | DATA2 | 2 | DW | Reserved | ++--------+----------------+------+-------+--------------------+ +| 8 | XMIT CORRELATOR| 2 | DW | Reserved | ++--------+----------------+------+-------+--------------------+ +| 10 | RSP CORRELATOR | 2 | DW | Reserved | ++--------+----------------+------+-------+--------------------+ +| 12 | DEST NAME | 16 | DB | Reserved | ++--------+----------------+------+-------+--------------------+ +| 28 | SOURCE NAME | 16 | DB | Name of sender | ++--------+----------------+------+-------+--------------------+ +| 44 | USER DATA | nn | DB | Datagram | ++--------+----------------+------+-------+--------------------+ + +Source Name + +Explanation: This is a 16-byte field that contains the name of the originator of the datagram. This is the name associated with the NCB_NUM field in the SEND.BROADCAST.DATAGRAM command. + +User Data + +Explanation: This is the datagram that the user provided with the SEND.BROADCAST.DATAGRAM command. + +Note: If the adapter is opened by an application program other than NetBIOS, and the size of the transmit buffer is not sufficient for the size of the datagram, the datagram is truncated with no indication given. + +Copyright IBM Corp. 1986, 1996 +5.6.7 - 1 + +--- + + +## Page 320 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NAME_QUERY + +5.6.8 NAME_QUERY + +``` ++--- Hex 0A -----------------------------------------------+ +| NAME_QUERY | ++---------------------------------------------------------+ +``` + +**Initiation:** This frame is sent as a result of a CALL command or a FIND.NAME command. + +**Function:** To request the remote node to establish a session (CALL) or to locate a name on the network (FIND.NAME). + +**Transmission:** This frame is transmitted as a UI frame to the NetBIOS functional address using single-route broadcast. + +**Responses:** No response within the system timeout period indicates the name is not on the network and the command gets an appropriate return code (X'14' for CALL and X'05' for FIND.NAME). A NAME_RECOGNIZED response indicates if a session can be established in the case of a CALL command or indicates the location of a name in the case of the FIND.NAME command. A NAME_RECOGNIZED response for a CALL command terminates the response timer (with a valid LISTEN on the remote side) and the NAME_QUERY is not retried. + +**Retries:** The number of times the frame can be transmitted can be defined by the NCB.TRANSMIT.COUNT parameter. The range is 1 to 10, and the default is 6. + +**Note:** If a NAME_RECOGNIZED with no LISTEN response is received for a CALL command, after transmitting NAME_QUERY frame NCB.TRANSMIT.COUNT times, NAME_QUERY process is retried one more time. + +**Timeouts:** The timeout value between transmissions of this frame can be defined by the NCB.TRANSMIT.TIMEOUT parameter. The range is 1/2 second to 10 seconds, and the default is 1/2 second. + +The command timeout for the FIND.NAME case is the value of NCB.TRANSMIT.COUNT multiplied by the value of NCB.TRANSMIT.TIMEOUT. The default is 3 seconds. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 5-18. NAME_QUERY Frame Format
OffsetField NameByte Length8086 TypeDescription
0LENGTH2DWX'002C'
2DELIMITER2DWX'EFFF'
4COMMAND1DBX'0A'
5DATA11DBReserved
6DATA22DWX'ttss'
8XMIT CORRELATOR2DWReserved
10RSP CORRELATOR2DWX'nnnn'
12DEST NAME16DBName of receiver
28SOURCE NAME16DBName of sender
+ +**Data2** + +**Explanation:** 'tt' indicates the type of name that is issuing the CALL command, where: + +X'00' A unique name +X'01' A group name. + +'ss' indicates the local session number that is assigned to refer to this session if the CALL is completed. The number is assigned in round-robin fashion (1 to 254). A value of zero is not a valid session number and indicates a FIND.NAME request. + +**Response Correlator** + +**Explanation:** This is a 2-byte field containing a correlator that is generated by the sender and is used to correlate any responses with this query. The value is returned in the NAME_RECOGNIZED response in the transmit correlator field. + +**Destination Name** + +**Explanation:** This is a 16-byte field containing the name on the network that is being called or located. This is the name in the NCB_CALLNAME field of the command. + +Copyright IBM Corp. 1986, 1996 +5.6.8 - 1 + +--- + + +## Page 321 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NAME_QUERY + +**Source Name** + +**Explanation:** This is a 16-byte field containing the local name that is issuing the CALL command. This is the name in the NCB_NAME field of the CALL command. This field is not used if this frame is for a FIND.NAME command ('ss' in DATA2 is zero). + +
Copyright IBM Corp. 1986, 1996 +5.6.8 - 2
+ +--- + + +## Page 322 + +LAN Technical Reference: 802.2 and NetBIOS APIs +ADD_NAME_RESPONSE + +5.6.9 ADD_NAME_RESPONSE + +``` ++---- Hex 0D ---------------------------------------------+ +| ADD_NAME_RESPONSE | ++---------------------------------------------------------+ +``` + +**Initiation:** This frame is sent as a response to an ADD_NAME_QUERY or an ADD_GROUP_NAME_QUERY frame. + +**Function:** To indicate that the identified name in the query frame is already in use. This response is generated to an ADD_NAME_QUERY if the name is already registered as either a group name or a unique name. This response is generated to an ADD_GROUP_NAME_QUERY only if the name is already registered as a unique name. + +**Transmission:** This frame is transmitted as a UI frame to the specific address of the node that sent the query. + +**Responses:** None + +**Retries:** None + +**Timeouts:** None + +Table 5-19. ADD_NAME_RESPONSE Frame Format + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OffsetField NameByte Length8086 TypeDescription
0LENGTH2DWX'002C'
2DELIMITER2DWX'EFFF'
4COMMAND1DBX'0D'
5DATA11DB0 = add name not in process, 1 = add name in process
6DATA22DW0 = unique name, 1 = group name
8XMIT CORRELATOR2DWX'nnnn'
10RSP CORRELATOR2DWReserved
12DEST NAME16DBName to be added
28SOURCE NAME16DBName to be added
+ +**Transmit Correlator** + +**Explanation:** This is a 2-byte field containing the correlator that was in the response correlator field of the ADD_NAME_QUERY or ADD_GROUP_NAME_QUERY. This is used to correlate the response with the original query at the originator. + +**Destination Name** + +**Explanation:** This is a 16-byte field containing the name that the originator wanted to add. + +**Source Name** + +**Explanation:** This is a 16-byte field containing the name that the originator wanted to add. + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.6.9 - 1</page_number> + +--- + + +## Page 323 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NAME_RECOGNIZED + +5.6.10 NAME_RECOGNIZED + +``` ++--- Hex 0E ---------------------------------------------+ +| | +| NAME_RECOGNIZED | +| | ++-------------------------------------------------------+ +``` + +**Initiation:** This frame is sent as a response to a NAME_QUERY frame. + +**Function:** Indicates whether a session can be established with the queried name (CALL) or used to indicate the location of a name (FIND.NAME). + +**Transmission:** This frame is transmitted as a UI frame to the specific address of the node that sent the NAME_QUERY using general broadcast. + +**Responses:** If this NAME_RECOGNIZED frame indicates that no session is to be established, then no response is expected. If this NAME_RECOGNIZED frame indicates that a session is to be established, then a SESSION_INITIALIZE frame is expected. + +**Retries:** If multiple NAME_QUERY frames are received from the same node, then a NAME_RECOGNIZED frame is sent for each NAME_QUERY received. This could happen if the originator of the NAME_QUERY timed out and retried the NAME_QUERY before the NAME_RECOGNIZED was received by the originator. + +**Timeouts:** If the NAME_RECOGNIZED indicates that a session is to be established, then the SESSION_INITIALIZE frame is expected within a timeout period determined by configuration parameters (the value of NCB.TRANSMIT.COUNT multiplied by the value of NCB.TRANSMIT.TIMEOUT). The default is 3 seconds. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 5-20. NAME_RECOGNIZED Frame Format
OffsetField NameByte Length8086 TypeDescription
0LENGTH2DWX'002C'
2DELIMITER2DWX'EFFF'
4COMMAND1DBX'0E'
5DATA11DBReserved
6DATA22DWX'ttss'
8XMIT CORRELATOR2DWX'nnnn'
10RSP CORRELATOR2DWX'nnnn'
12DEST NAME16DBName of receiver
28SOURCE NAME16DBName of sender
+ +Data2 + +**Explanation:** + +The 'tt' in DATA2 indicates the type of name as it is registered locally, where: + +X'00' A unique name +X'01' A group name + +The 'ss' in DATA2 indicates the state of the queried name, where: + +X'00' No LISTEN command is pending for this name or this is a FIND.NAME response +X'FF' A LISTEN command is pending for this name, but there are insufficient resources to establish a session at this time +X'01' - X'FE' A locally assigned session number that will identify this session when the call process is completed. + +Transmit Correlator + +**Explanation:** This is a 2-byte field containing the correlator that was in the response correlator field of the NAME_QUERY frames. This is used to correlate the response with the original query at the originator. + +Response Correlator + +**Explanation:** This is a 2-byte field containing a correlator that is generated by the sender. This is used to correlate the SESSION_INITIALIZE frame with this NAME_RECOGNIZED frame. It is returned in the transmit correlator field of the + +Copyright IBM Corp. 1986, 1996 +5.6.10 - 1 + +--- + + +## Page 324 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NAME_RECOGNIZED + +SESSION_INITIALIZE frame. If this NAME_RECOGNIZED frame indicates that no session is to be established, then this field is unused. + +--- + +**Destination Name** + +**Explanation:** This is a 16-byte field containing the name at the originator that issued the NAME_QUERY. + +--- + +**Source Name** + +**Explanation:** This is a 16-byte field containing the name that was being queried. + +
Copyright IBM Corp. 1986, 1996 +5.6.10 - 2
+ +--- + + +## Page 325 + +LAN Technical Reference: 802.2 and NetBIOS APIs +STATUS_RESPONSE + +5.6.11 STATUS_RESPONSE + +``` ++---- Hex 0F ----------------------------------------+ +| | +| STATUS_RESPONSE | +| | ++---------------------------------------------------+ +``` + +Initiation: This frame is sent as a response to a STATUS_QUERY frame. + +Function: Returns the status information of the adapter. + +Transmission: This frame is transmitted as a UI frame to the specific address of the node that sent the STATUS_QUERY. + +Responses: None + +Retries: None + +Timeouts: None + +Table 5-21. STATUS_RESPONSE Frame Format + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OffsetField NameByte Length8086 TypeDescription
0LENGTH2DWX'002C'
2DELIMITER2DWX'EFFF'
4COMMAND1DBX'0F'
5DATA11DBX'nn'
6DATA22DWX'xybbbbbbbbbbbbbb'
8XMIT CORRELATOR2DWX'nnnn'
10RSP CORRELATOR2DWReserved
12DEST NAME16DBReceiver's NAME_NUMBER_1
28SOURCE NAME16DBName of sender
+ +Data1 + +Explanation: This is a 1-byte field generated by the sender. + +X'nn' indicates the status response, where: + +X'nn' = 0 Status response 1.x or 2.0 + +X'nn' > 0 NetBIOS 2.1 status response and an indication of the total number of names sent so far (names sent in the first response and additional name responses, including this one). + +Data2 + +Explanation: + +'x' 1 indicates the length of the status data exceeds the maximum UI frame size (the data is truncated). +'y' 1 indicates the length of the status data exceeds the size of the user' buffer (sent in the STATUS_QUERY). +'bbb...' indicates the length of the status data sent (interpreted as a 2-byte (DW) field with the 2 high/ order bits set to zero). + +Transmit Correlator + +Explanation: This is a 2-byte field containing the correlator that was in the response correlator field of the STATUS_QUERY frames. This is used to correlate the response with the original query at the originator. + +Destination Name + +Explanation: This is a 16-byte field containing the NAME_NUMBER_1 of the originator of the STATUS_QUERY. This was the source name field of the STATUS_QUERY frame and is 10 bytes of binary zeros followed by the 6-byte permanent adapter address. + +Copyright IBM Corp. 1986, 1996 +5.6.11 - 1 + +--- + + +## Page 326 + +LAN Technical Reference: 802.2 and NetBIOS APIs +STATUS_RESPONSE + +Source Name + +Explanation: This is a 16-byte field containing the name that was being queried. This was the destination name in the STATUS_QUERY. + +
Copyright IBM Corp. 1986, 1996 +5.6.11 - 2
+ +--- + + +## Page 327 + +LAN Technical Reference: 802.2 and NetBIOS APIs +TERMINATE_TRACE + +5.6.12 TERMINATE_TRACE + ++---- Hex 13 ----------------------------------------+ +| | +| TERMINATE_TRACE | +| | ++---------------------------------------------------+ + +Initiation: This frame must be generated by some application program other than NetBIOS. This frame is never sent by NetBIOS, but it will react to the receipt of a X'13'. + +Function: To terminate the traces at any remote nodes that had activated a trace with the TRACE command. + +Transmission: This frame is transmitted as a UI frame to the NetBIOS functional address using single-route broadcast. + +Responses: None + +Retries: None + +Timeouts: None + +Table 5-22. TERMINATE_TRACE Frame Format + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OffsetField NameByte Length8086 TypeDescription
0LENGTH2DWX'002C'
2DELIMITER2DWX'EFFF'
4COMMAND1DBX'13'
5DATA11DBReserved
6DATA22DWReserved
8XMIT CORRELATOR2DWReserved
10RSP CORRELATOR2DWReserved
12DEST NAME16DBReserved
28SOURCE NAME16DBReserved
+ +
Copyright IBM Corp. 1986, 1996
+<page_number>5.6.12 - 1</page_number> + +--- + + +## Page 328 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DATA_ACK + +5.6.13 DATA_ACK + ++---- Hex 14 ---------------------------------------------+ +| DATA_ACK | ++--------------------------------------------------------+ + +Initiation: This frame is a response to a DATA_ONLY_LAST frame. + +Function: Used to indicate a positive acknowledgment to a received DATA_ONLY_LAST frame. + +Transmission: This frame is transmitted as an I-format LPDU to the specific address of the node that sent the DATA_ONLY_LAST frame. + +Responses: None + +Retries: All retries are handled by the IEEE 802.2 LLC layer. + +Timeouts: Retry timeouts are handled by the IEEE 802.2 LLC layer. + ++--------------------------------------------------------+ +| Table 5-23. DATA_ACK Frame Format | ++--------------------------------------------------------+ +| Offset | Field Name | Byte Length | 8086 Type | Description | ++--------+----------------+-------------+-----------+-------------+ +| 0 | LENGTH | 2 | DW | X'000E' | ++--------+----------------+-------------+-----------+-------------+ +| 2 | DELIMITER | 2 | DW | X'EFFF' | ++--------+----------------+-------------+-----------+-------------+ +| 4 | COMMAND | 1 | DB | X'14' | ++--------+----------------+-------------+-----------+-------------+ +| 5 | DATA1 | 1 | DB | Reserved | ++--------+----------------+-------------+-----------+-------------+ +| 6 | DATA2 | 2 | DW | Reserved | ++--------+----------------+-------------+-----------+-------------+ +| 8 | XMIT CORRELATOR| 2 | DW | X'nnnn' | ++--------+----------------+-------------+-----------+-------------+ +| 10 | RSP CORRELATOR | 2 | DW | Reserved | ++--------+----------------+-------------+-----------+-------------+ +| 12 | DEST NUMBER | 1 | DB | Remote session number | ++--------+----------------+-------------+-----------+-------------+ +| 13 | SOURCE NUMBER | 1 | DB | Local session number | ++--------+----------------+-------------+-----------+-------------+ + +Transmit Correlator + +Explanation: This is a 2-byte field containing the correlator that was in the response correlator field of the DATA_ONLY_LAST frame. This is used to correlate this DATA_ACK frame with the data frame at the originator. + +Destination Number + +Explanation: This is a 1-byte field containing the session number that was assigned at the remote node during session initialization to identify this session. This value was in the source number field of the DATA_ONLY_LAST frame. + +Source Number + +Explanation: This is a 1-byte field containing the local session number that was assigned during session initialization to identify this session. + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.6.13 - 1</page_number> + +--- + + +## Page 329 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DATA_FIRST_MIDDLE + +5.6.14 DATA_FIRST_MIDDLE + ++---- Hex 15 ----------------------------------------+ +| DATA_FIRST_MIDDLE | ++----------------------------------------------------+ + +**Initiation:** This frame is transmitted as a result of one of the session SEND commands. + +**Function:** To transfer a user message across a session, where the message has to be segmented because the size of the message exceeds the transmit buffer size or the maximum frame size that was established for this session during session initialization. This is one frame of a message, but not the last one. + +**Transmission:** This frame is transmitted as an I-format LPDU to the specific address of the remote session partner. + +**Responses:** If a RECEIVE_CONTINUE frame is requested (on the first DATA_FIRST_MIDDLE), a RECEIVE_CONTINUE frame is returned if all the data was accepted and only partially filled the RECEIVE buffer. If the data completely fills or exceeds the RECEIVE buffer, then a NO_RECEIVE frame is returned. + +**Note:** In NetBIOS Version 2.X or higher, if the data completely fills or exceeds the RECEIVE buffer, and if another RECEIVE is pending for the same session, instead of returning a NO_RECEIVE/RECEIVE_OUTSTANDING sequence, a RECEIVE_OUTSTANDING frame is returned to acknowledge the last byte received, and also to indicate the RECEIVE is available to receive more data. + +In NetBIOS Version 2.2 or later, a NO_RECEIVE frame is returned, if the NCB.SEND.NO.ACK data or NCB.CHAIN.SEND.NO.ACK data was not received at all or was only partially received by the remote application program. + +Certain NetBIOS application programs (especially those characterized by quick exchanges of short data records) can benefit from the data acknowledgment option that allows the sending of a positive data acknowledgment with the next data transmission. This feature reduces the number of frames to be processed and transmitted. The session partners negotiate the use of this option automatically. It is transparent to the application, and is available in LAN Support Program Version 1.3 or higher and in OS/2 EE and OS/2 LAN Adapter and Protocol Support. The acknowledgment bit in the DATA1 field of the DATA_FIRST_MIDDLE frame is used instead of the DATA_ACK frame if this option is used. + +**Retries:** Since this is an I-format LPDU, all retries are handled by the IEEE 802.2 LLC layer. + +**Timeouts:** Retry timeouts are handled by the IEEE 802.2 LLC layer. At the NetBIOS level, there may be a SEND timeout in effect for the entire message transfer that was specified in the NCB_STO field of the CALL command. + ++----------------------------------------------------+ +| Table 5-24. DATA_FIRST_MIDDLE Frame Format | ++----------------------------------------------------+ +| Offset | Field Name | Byte Length | 8086 Type | Description | ++--------+------------+-------------+-----------+-------------+ +| 0 | LENGTH | 2 | DW | X'000E' | ++--------+------------+-------------+-----------+-------------+ +| 2 | DELIMITER | 2 | DW | X'EFFF' | ++--------+------------+-------------+-----------+-------------+ +| 4 | COMMAND | 1 | DB | X'15' | ++--------+------------+-------------+-----------+-------------+ +| 5 | DATA1 | 1 | DB | B'rrrrxryz' where: x = Acknowledge_included indicator y = NO.ACK indicator (NetBIOS 2.2) z = RECEIVE_CONTINUE request | ++--------+------------+-------------+-----------+-------------+ +| 6 | DATA2 | 2 | DW | Re-synch indicator | ++--------+------------+-------------+-----------+-------------+ +| 8 | XMIT CORRELATOR | 2 | DW | X'nnnn' | ++--------+------------+-------------+-----------+-------------+ +| 10 | RSP CORRELATOR | 2 | DW | X'nnnn' | ++--------+------------+-------------+-----------+-------------+ +| 12 | DEST NUMBER | 1 | DB | Remote session number | ++--------+------------+-------------+-----------+-------------+ +| 13 | SOURCE NUMBER | 1 | DB | Local session number | ++--------+------------+-------------+-----------+-------------+ +| 14 | USER DATA | nn | DB | Message from SEND | ++--------+------------+-------------+-----------+-------------+ + +Data1 + +**Explanation:** + +B'r' Reserved bit, always zero. + +B'x' Acknowledge_included indicator. The acknowledge_included indicator plus a non-zero XMIT CORRELATOR is equivalent to a DATA_ACK. + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.6.14 - 1</page_number> + +--- + + +## Page 330 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DATA_FIRST_MIDDLE + +**B'y'** The NO.ACK indicator (NetBIOS 2.2). The NO.ACK indicator means no acknowledgment is expected. +If y = 0, versions earlier than NetBIOS 2.20 are being used. +If y = 1, the frame was sent via NCB.SEND.NO.ACK or NCB.CHAIN.SEND.NO.ACK (NetBIOS 2.2). + +**B'z'** Indicates a RECEIVE_CONTINUE was requested. +If z = 0, RECEIVE_CONTINUE was not requested. +If z = 1, a RECEIVE_CONTINUE was requested. + +The RECEIVE_CONTINUE is requested on the first DATA_FIRST_MIDDLE frame if this is the first message on this session or if any frames in the previous message encountered a NO_RECEIVE response. If all segments of a message are sent without receiving a NO_RECEIVE frame, then the first segment of the next message will not have this request bit set. The RECEIVE_CONTINUE frame indicates that all of the data in this DATA_FIRST_MIDDLE frame was accepted. When the first DATA_FIRST_MIDDLE is sent (with the request indicator on), subsequent segments are not sent until a response is received (RECEIVE_CONTINUE or RECEIVE_OUTSTANDING). This is to avoid sending all message segments only to have them discarded at the remote node if there is no RECEIVE pending or if the RECEIVE buffer cannot accept the entire message. + +--- + +**Data2** + +**Explanation:** This is a 2-byte field where a value of X'0001' indicates that this is the first DATA_FIRST_MIDDLE following receipt of a RECEIVE_OUTSTANDING from the remote node. A RECEIVE_OUTSTANDING is sent to indicate the ability to receive more data following a NO_RECEIVE. The indicator is set so the remote node can re-synch on the first valid DATA_FIRST_MIDDLE following a NO_RECEIVE/RECEIVE_OUTSTANDING sequence. After the first DATA_FIRST_MIDDLE is responded to, all remaining segments are transmitted in succession. + +--- + +**Transmit Correlator** + +**Explanation:** X'nnnn' is zero when no acknowledgment is sent with the data or X'nnnn' is the previously received response correlator of a DATA_ONLY_LAST frame in which the ACKNOWLEDGE_WITH_DATA_ALLOWED indicator was set on. When an acknowledgment is sent, the ACKNOWLEDGE_INCLUDED bit must be set on. + +--- + +**Response Correlator** + +**Explanation:** This is a 2-byte field containing a correlator that is generated by the sender. This is used to correlate the response frame with this frame. The correlator is returned in the transmit correlator field of the RECEIVE_CONTINUE frame. + +--- + +**Destination Number** + +**Explanation:** This is a 1-byte field containing the session number that was assigned at the remote node during session initialization to identify this session. + +--- + +**Source Number** + +**Explanation:** This is a 1-byte field containing the local session number that was assigned during session initialization to identify this session. + +--- + +**User Data** + +**Explanation:** This is a segmented portion of the message that the user provided. + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.6.14 - 2</page_number> + +--- + + +## Page 331 + +**LAN Technical Reference: 802.2 and NetBIOS APIs** +**DATA_ONLY_LAST** + +### 5.6.15 DATA_ONLY_LAST + +``` +Hex 16 ++-----------------------------------------------------------------------+ +| DATA_ONLY_LAST | ++-----------------------------------------------------------------------+ +``` + +**Initiation:** This frame is transmitted as a result of one of the session send commands. + +**Function:** To transfer a user message across a session. This is either the only frame in this message or this is the last segment of a segmented message. + +**Transmission:** This frame is transmitted as an I-format LPDU to the specific address of the remote session partner. + +**Responses:** One of the following responses will acknowledge receipt of this frame or portion of this frame: + +* DATA_ACK +* NO_RECEIVE (returned if the data exceeds the receive buffer) +* RECEIVE_OUTSTANDING +* DATA_ONLY_LAST or DATA_FIRST_MIDDLE (if the ACKNOWLEDGE_WITH_DATA_ALLOWED indicator was set on and the session partner supports this option). + +Certain NetBIOS application programs (especially those characterized by quick exchanges of short data records) can benefit from the data acknowledgment option that allows the sending of a positive acknowledgment with the next data transmission. This feature reduces the number of frames to be processed and transmitted. The session partners negotiate the use of this option automatically. It is transparent to the application, and is available in LAN Support Program Version 1.3 or higher and in OS/2 EE and OS/2 LAN Adapter and Protocol Support. + +**Note:** In NetBIOS Version 2.2 or higher, if the data exceeds the RECEIVE buffer, and if another RECEIVE is pending for the same session, instead of returning the NO_RECEIVE/RECEIVE_OUTSTANDING sequence, a RECEIVE_OUTSTANDING frame is returned to acknowledge the last byte received and also to indicate that the RECEIVE is available to receive more data. + +In NetBIOS Version 2.2 or higher, a NO_RECEIVE frame is returned if the NCB.SEND.NO.ACK data or NCB.CHAIN.SEND.NO.ACK data was not received at all or was only partially received by the remote application program. + +**Retries:** Since this is an I-format LPDU, all retries are handled by the IEEE 802.2 LLC layer. + +**Timeouts:** Retry timeouts are handled by the IEEE 802.2 LLC layer. At the NetBIOS level there might be a SEND timeout in effect for the entire message transfer that was specified in the NCB_STO field of the CALL command. + +#### Table 5-25. DATA_ONLY_LAST Frame Format + +| Offset | Field Name | Byte Length | 8086 Type | Description | +| :--- | :--- | :--- | :--- | :--- | +| 0 | LENGTH | 2 | DW | X'000E' | +| 2 | DELIMITER | 2 | DW | X'EFFF' | +| 4 | COMMAND | 1 | DB | X'16' | +| 5 | DATA1 | 1 | DB | B'rrrrxyzr' where:
x = ACKNOWLEDGE_INCLUDED indicator
y = ACKNOWLEDGE_WITH_DATA_ALLOWED indicator
z = NO_ACK indicator | +| 6 | DATA2 | 2 | DW | Re-synch indicator | +| 8 | XMIT CORRELATOR | 2 | DW | X'nnnn' | +| 10 | RSP CORRELATOR | 2 | DW | X'nnnn' | +| 12 | DEST NUMBER | 1 | DB | Remote session number | +| 13 | SOURCE NUMBER | 1 | DB | Local session number | +| 14 | USER DATA | nn | DB | Message from SEND | + +**Explanation:** + +Data1 + +Copyright IBM Corp. 1986, 1996 +5.6.15 - 1 + +--- + + +## Page 332 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DATA_ONLY_LAST + +B'r'=0 Reserved bit, always zero. +B'x' ACKNOWLEDGE_INCLUDED indicator. +B'y' ACKNOWLEDGE_WITH_DATA_ALLOWED indicator. +The session partner can acknowledge either with a DATA_ACK frame, or with a frame in which the acknowledge_included indicator is set, and the XMIT CORRELATOR is the same as the RSP CORRELATOR in this DATA_ONLY_LAST frame. +B'z' NO.ACK indicator. + +Data2 +Explanation: This is a 2-byte field where a value of X'0001' indicates that this is the first DATA_ONLY_LAST following receipt of a RECEIVE_OUTSTANDING (otherwise this field is X'0000'). The RECEIVE_OUTSTANDING is sent to indicate the ability to receive more data following a NO_RECEIVE. + +Transmit Correlator +Explanation: X'nnnn' is zero either when no acknowledgment is sent with the data or when X'nnnn' is the previously received RSP CORRELATOR of a DATA_ONLY_LAST frame in which the ACKNOWLEDGE_WITH_DATA_ALLOWED indicator was set on. When an acknowledgment is sent, the ACKNOWLEDGE_INCLUDED bit must be set on. + +Destination Number +Explanation: This is a 1-byte field containing the session number that was assigned at the remote node during session initialization to identify this session. + +Source Number +Explanation: This is a 1-byte field containing the local session number that was assigned during session initialization to identify this session. + +User Data +Explanation: This is the last or only segment of the message that the user provided. + +
Copyright IBM Corp. 1986, 1996 +5.6.15 - 2
+ +--- + + +## Page 333 + +LAN Technical Reference: 802.2 and NetBIOS APIs +SESSION_CONFIRM + +5.6.16 SESSION_CONFIRM + ++---- Hex 17 ----------------------------------------+ +| SESSION_CONFIRM | ++---------------------------------------------------+ + +Initiation: This frame is transmitted in response to a SESSION_INITIALIZE frame. + +Function: To indicate a positive acknowledgment to a SESSION_INITIALIZE to complete the session establishment process. + +Transmission: This frame is transmitted as an I-format LPDU to the specific address of the remote session partner. + +Responses: None + +Retries: Because this is an I-format LPDU, all retries are handled by the IEEE 802.2 LLC layer. + +Timeouts: Retry timeouts are handled by the IEEE 802.2 LLC layer. + ++---------------------------------------------------+ +| Table 5-26. SESSION_CONFIRM Frame Format | ++---------------------------------------------------+ +| Offset | Field Name | Byte | 8086 | Description | +| | | Length | Type | | ++--------+----------------+------+------+ +| 0 | LENGTH | 2 | DW | X'000E' | ++--------+----------------+------+------+ +| 2 | DELIMITER | 2 | DW | X'EFFF' | ++--------+----------------+------+------+ +| 4 | COMMAND | 1 | DB | X'17' | ++--------+----------------+------+------+ +| 5 | DATA1 | 1 | DB | B'yrrrrrrx' | ++--------+----------------+------+------+ +| 6 | DATA2 | 2 | DW | Max data receive size | ++--------+----------------+------+------+ +| 8 | XMIT CORRELATOR| 2 | DW | X'nnnn' | ++--------+----------------+------+------+ +| 10 | RSP CORRELATOR | 2 | DW | X'nnnn' = Session init xmit correlator | ++--------+----------------+------+------+ +| 12 | DEST NUMBER | 1 | DB | Remote session number | ++--------+----------------+------+------+ +| 13 | SOURCE NUMBER | 1 | DB | Local session number | ++--------+----------------+------+------+ + +Data1 + +Explanation: This is a 1-byte field generated by the sender. + +B'rrrrrr' Reserved bits, always zero + +B'x' = 0 NetBIOS 1.xx + +B'y' = 0 Versions earlier than NetBIOS 2.20 + +B'y' = 1 Flag to indicate the ability to handle SEND.NO.ACK or CHAIN.SEND.NO.ACK. + +Data2 + +Explanation: This is a 2-byte field containing the maximum size user data in any frame that this node wants to receive on this session. NetBIOS determines this value based on the size and number of receive buffers available in the adapter such that this value is approximately one-half of the receive buffer space. The remote partner will limit the size of the user data in frames transmitted over this session to this size or the size available in its transmit buffer (DHB), whichever is smaller. This is to avoid having the receipt of one session frame consume all of the available receive buffers in the adapter. NetBIOS takes into account the maximum size message that bridges in the path will forward. It will never send a frame larger than the bridge will forward. + +Transmit Correlator + +Explanation: This is a 2-byte field containing the correlator that was in the response correlator field of the SESSION_INITIALIZE frame. This is used to correlate this response with the SESSION_INITIALIZE frame at the originator. + +Destination Number + +Copyright IBM Corp. 1986, 1996 +5.6.16 - 1 + +--- + + +## Page 334 + +LAN Technical Reference: 802.2 and NetBIOS APIs +SESSION_CONFIRM + +**Explanation:** This is a 1-byte field containing the session number that was assigned at the remote node during session initialization to identify this session. + +--- + +**Source Number** + +**Explanation:** This is a 1-byte field containing the local session number that was assigned during session initialization to identify this session. + +
Copyright IBM Corp. 1986, 1996 +5.6.16 - 2
+ +--- + + +## Page 335 + +5.6.17 SESSION_END + ++---- Hex 18 ---------------------------------------------+ +| SESSION_END | ++--------------------------------------------------------+ + +**Initiation:** This frame is transmitted as a result of a HANG.UP command, a SEND command that timed out, or some abnormal condition. + +**Function:** To indicate the termination of a session to the remote partner. + +**Transmission:** This frame is transmitted as an I-format LPDU to the specific address of the remote session partner. + +**Responses:** None + +**Retries:** Since this is an I-format LPDU, all retries are handled by the IEEE 802.2 LLC layer. + +**Timeouts:** Retry timeouts are handled by the IEEE 802.2 LLC layer. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 5-27. SESSION_END Frame Format
OffsetField NameByte Length8086 TypeDescription
0LENGTH2DWX'000E'
2DELIMITER2DWX'EFFF'
4COMMAND1DBX'18'
5DATA11DBReserved
6DATA22DWTermination indicator
8XMIT CORRELATOR2DWReserved
10RSP CORRELATOR2DWReserved
12DEST NUMBER1DBRemote session number
13SOURCE NUMBER1DBLocal session number
+ +**Data2** + +**Explanation:** This is a 2-byte field used to indicate the type of termination, where X'0000' indicates a normal session end (as a result of a HANG.UP command) and X'0001' indicates an abnormal session end (typically a SEND command has timed out). + +**Destination Number** + +**Explanation:** This is a 1-byte field containing the session number that was assigned at the remote node during session initialization to identify this session. + +**Source Number** + +**Explanation:** This is a 1-byte field containing the local session number that was assigned during session initialization to identify this session. + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.6.17 - 1</page_number> + +--- + + +## Page 336 + +LAN Technical Reference: 802.2 and NetBIOS APIs +SESSION_INITIALIZE + +5.6.18 SESSION_INITIALIZE + ++---- Hex 19 ---------------------------------------------+ +| SESSION_INITIALIZE | ++----------------------------------------------------------+ + +Initiation: This frame is transmitted in response to a NAME_RECOGNIZED frame that indicates that a session is to be established. + +Function: To indicate that a session has been established. + +Transmission: This frame is transmitted as an I-format LPDU to the specific address of the remote session partner. + +Responses: A SESSION_CONFIRM is expected to indicate acknowledgment of the session establishment. + +Retries: Because this is an I-format LPDU, all retries are handled by the IEEE 802.2 LLC layer. + +Timeouts: Retry timeouts are handled by the IEEE 802.2 LLC layer. At the NetBIOS level, the SESSION_CONFIRM is expected within a timeout period equal to the value of NCB.TRANSMIT.COUNT multiplied by the value of NCB.TRANSMIT.TIMEOUT plus 1 second per bridge. The default is 3 seconds. + ++----------------------------------------------------------+ +| Table 5-28. SESSION_INITIALIZE Frame Format | ++----------------------------------------------------------+ +| Offset | Field Name | Byte Length | Type | Description | ++--------+----------------+-------------+------+-------------+ +| 0 | LENGTH | 2 | DW | X'000E' | ++--------+----------------+-------------+------+-------------+ +| 2 | DELIMITER | 2 | DW | X'EFFF' | ++--------+----------------+-------------+------+-------------+ +| 4 | COMMAND | 1 | DB | X'19' | ++--------+----------------+-------------+------+-------------+ +| 5 | DATA1 | 1 | DB | B'zrrrxxxy' | ++--------+----------------+-------------+------+-------------+ +| 6 | DATA2 | 2 | DW | Maximum data receive size | ++--------+----------------+-------------+------+-------------+ +| 8 | XMIT CORRELATOR| 2 | DW | X'nnnn' | ++--------+----------------+-------------+------+-------------+ +| 10 | RSP CORRELATOR | 2 | DW | X'nnnn' | ++--------+----------------+-------------+------+-------------+ +| 12 | DEST NUMBER | 1 | DB | Remote session number | ++--------+----------------+-------------+------+-------------+ +| 13 | SOURCE NUMBER | 1 | DB | Local session number | ++--------+----------------+-------------+------+-------------+ + +Data1 + +Explanation: This is a 1-byte field generated by the sender. + +B'rrrr' Reserved bits, always zero + +B'xxx' Indicates the largest frame value as seen by the MAC layer (LF field in the routing information) + +B'y' = 0 NetBIOS 1.x + +B'y' = 1 NetBIOS Version 2.0 or higher + +B'z' = 0 Versions earlier than NetBIOS 2.20 + +B'z' = 1 Flag to indicate the ability to handle SEND.NO.ACK or CHAIN.SEND.NO.ACK + +Data2 + +Explanation: This is a 2-byte field containing the maximum size user data in any frame that this node wants to receive on this session. NetBIOS determines this value based on the size and number of receive buffers available in the adapter such that this value is approximately one-half of the receive buffer space. The remote partner will limit the size of the user data in frames transmitted over this session to this size or the size available in its transmit buffer (DHB), whichever is smaller. This is to avoid having the receipt of one session frame consume all of the available receive buffers in the adapter. NetBIOS takes into account the maximum size message that bridges in the path will forward. It will never send a frame larger than the bridge will forward. + +Transmit Correlator + +Explanation: This is a 2-byte field containing the correlator that was in the response correlator field of the NAME_RECOGNIZED frame. This is used to correlate this frame with the NAME_RECOGNIZED frame at the remote node. + +Copyright IBM Corp. 1986, 1996 +5.6.18 - 1 + +--- + + +## Page 337 + +LAN Technical Reference: 802.2 and NetBIOS APIs +SESSION_INITIALIZE + +--- + +**Response Correlator** + +**Explanation:** This is a 2-byte field containing a correlator that is generated by the sender. This is used to correlate the SESSION_CONFIRM frame with this SESSION_INITIALIZE frame. It is returned in the transmit correlator field of the SESSION_CONFIRM frame. + +--- + +**Destination Number** + +**Explanation:** This is a 1-byte field containing the session number that was assigned at the remote node during session initialization to identify this session. + +--- + +**Source Number** + +**Explanation:** This is a 1-byte field containing the local session number that was assigned during session initialization to identify this session. + +
Copyright IBM Corp. 1986, 1996 +5.6.18 - 2
+ +--- + + +## Page 338 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NO_RECEIVE + +5.6.19 NO_RECEIVE + ++---- Hex 1A ---------------------------------------------+ +| NO_RECEIVE | ++--------------------------------------------------------+ + +**Initiation:** This frame is transmitted as a result of receiving a DATA_ONLY_LAST or a DATA_FIRST_MIDDLE frame. + +**Function:** To acknowledge receipt of session data, and to indicate how much of the data was accepted. This frame is sent when the RECEIVE buffer is filled. Upon receipt of this frame at the remote node, the remote node discontinues sending session data on this session until the local node transmits a RECEIVE_OUTSTANDING frame. Any session data that continues to arrive at the local node is ignored until a DATA_FIRST_MIDDLE or DATA_ONLY_LAST frame arrives with the re-synch indicator set (which means the local node has sent a RECEIVE_OUTSTANDING frame). + +**Notes:** + +1. When a data frame is received, if no RECEIVE command is pending, nothing is transmitted to the sender. When a RECEIVE command is issued, a RECEIVE_OUTSTANDING frame is transmitted. +2. In NetBIOS Version 2.X or higher, if the data completely fills or exceeds the RECEIVE buffer, and if another RECEIVE is pending for the same session, instead of returning a NO_RECEIVE/RECEIVE_OUTSTANDING sequence, a RECEIVE_OUTSTANDING frame is returned to acknowledge the last byte received and also to indicate the RECEIVE is available to receive more data. + +**Transmission:** This frame is transmitted as an I-format LPDU to the specific address of the remote session partner. + +**Responses:** None + +**Retries:** Because this is an I-format LPDU, all retries are handled by the IEEE 802.2 LLC layer. + +**Timeouts:** Retry timeouts are handled by the IEEE 802.2 LLC layer. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 5-29. NO_RECEIVE Frame Format
OffsetField NameByte Length8086 TypeDescription
0LENGTH2DWX'000E'
2DELIMITER2DWX'EFFF'
4COMMAND1DBX'1A'
5DATA11DBB'rrrrrrxr'
6DATA22DWNumber of data bytes accepted
8XMIT CORRELATOR2DWReserved
10RSP CORRELATOR2DWReserved
12DEST NUMBER1DBRemote session number
13SOURCE NUMBER1DBLocal session number
+ +Data1 + +**Explanation:** + +B'rrrr' Reserved bit, always zero + +B'x' = 0 Versions earlier than NetBIOS 2.20 + +B'x' = 1 Flag to indicate that NCB.SEND.NO.ACK data or NCB.CHAIN.SEND.NO.ACK data was either not received or was only partially received (NetBIOS 2.2). + +Data2 + +**Explanation:** This is a 2-byte field containing the number of bytes of user data that were accepted. When the remote node is instructed to resume transmitting session data (through a RECEIVE_OUTSTANDING frame), it resumes with the next byte following the last acknowledged byte. + +Copyright IBM Corp. 1986, 1996 +5.6.19 - 1 + +--- + + +## Page 339 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NO_RECEIVE + +--- + +**Destination Number** + +**Explanation:** This is a 1-byte field containing the session number that was assigned at the remote node during session initialization to identify this session. + +--- + +**Source Number** + +**Explanation:** This is a 1-byte field containing the local session number that was assigned during session initialization to identify this session. + +
Copyright IBM Corp. 1986, 1996 +5.6.19 - 2
+ +--- + + +## Page 340 + +LAN Technical Reference: 802.2 and NetBIOS APIs +RECEIVE_OUTSTANDING + +5.6.20 RECEIVE_OUTSTANDING + ++---- Hex 1B ---------------------------------------------+ +| RECEIVE_OUTSTANDING | ++---------------------------------------------------------+ + +**Initiation:** This frame is transmitted following transmission of a NO_RECEIVE if a RECEIVE command is or becomes available. + +**Function:** To inform the remote session partner that there is a RECEIVE pending and that the remote partner should resume sending session data. The remote node resumes with the first data byte following the last acknowledged byte indicated in the NO_RECEIVE frame. The remote node indicates the first session data frame following the RECEIVE_OUTSTANDING frame by setting the re-synch indicator. + +**Transmission:** This frame is transmitted as an I-format LPDU to the specific address of the remote session partner. + +**Responses:** After transmitting this frame, the local node is expecting a DATA_ONLY_LAST or DATA_FIRST_MIDDLE frame with the re-synch indicator set. + +**Retries:** Because this is an I-format LPDU, all retries are handled by the IEEE 802.2 LLC layer. + +**Timeouts:** Retry timeouts are handled by the IEEE 802.2 LLC layer. + ++---------------------------------------------------------+ +| Table 5-30. RECEIVE_OUTSTANDING Frame Format | ++---------------------------------------------------------+ +| Offset | Field Name | Byte Length | Type | Description | ++--------+------------+-------------+------+-------------+ +| 0 | LENGTH | 2 | DW | X'000E' | ++--------+------------+-------------+------+-------------+ +| 2 | DELIMITER | 2 | DW | X'EFFF' | ++--------+------------+-------------+------+-------------+ +| 4 | COMMAND | 1 | DB | X'1B' | ++--------+------------+-------------+------+-------------+ +| 5 | DATA1 | 1 | DB | Reserved | ++--------+------------+-------------+------+-------------+ +| 6 | DATA2 | 2 | DW | Number of data bytes accepted | ++--------+------------+-------------+------+-------------+ +| 8 | XMIT CORRELATOR | 2 | DW | Reserved | ++--------+------------+-------------+------+-------------+ +| 10 | RSP CORRELATOR | 2 | DW | Reserved | ++--------+------------+-------------+------+-------------+ +| 12 | DEST NUMBER | 1 | DB | Remote session number | ++--------+------------+-------------+------+-------------+ +| 13 | SOURCE NUMBER | 1 | DB | Local session number | ++--------+------------+-------------+------+-------------+ + +DATA2 + +**Explanation:** This field is defined for NetBIOS 2.1. For earlier versions, this is a reserved field. + +This is a 2-byte field containing the number of bytes of user data that were accepted. When the remote node is instructed to resume transmitting session data (through a RECEIVE_OUTSTANDING frame), it resumes resume with the next byte following the last acknowledged byte. + +Destination Number + +**Explanation:** This is a 1-byte field containing the session number that was assigned at the remote node during session initialization to identify this session. + +Source Number + +**Explanation:** This is a 1-byte field containing the local session number that was assigned during session initialization to identify this session. + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.6.20 - 1</page_number> + +--- + + +## Page 341 + +LAN Technical Reference: 802.2 and NetBIOS APIs +RECEIVE_CONTINUE + +5.6.21 RECEIVE_CONTINUE + +``` ++---- Hex 1C ---------------------------------------------+ +| | +| RECEIVE_CONTINUE | +| | ++--------------------------------------------------------+ +``` + +**Initiation:** This frame is transmitted in response to a DATA_FIRST_MIDDLE that had the RECEIVE_CONTINUE request bit set. + +**Function:** To indicate that there is a RECEIVE command pending on this session. It also acknowledges receipt of all the session data in the DATA_FIRST_MIDDLE (a NO_RECEIVE would be transmitted if the data filled or exceeded the RECEIVE buffer). + +**Note:** In NetBIOS Version 2.X or higher, if the data completely fills or exceeds the RECEIVE buffer, and if another RECEIVE is pending for the same session, instead of returning a NO_RECEIVE/RECEIVE_OUTSTANDING sequence, a RECEIVE_OUTSTANDING frame is returned to acknowledge the last byte received and also to indicate the RECEIVE is available to receive more data. + +**Transmission:** This frame is transmitted as an I-format LPDU to the specific address of the remote session partner. + +**Responses:** None + +**Retries:** Because this is an I-format LPDU, all retries are handled by the IEEE 802.2 LLC layer. + +**Timeouts:** Retry timeouts are handled by the IEEE 802.2 LLC layer. + +``` ++--------------------------------------------------------+ +| Table 5-31. RECEIVE_CONTINUE Frame Format | ++--------------------------------------------------------+ +| Offset | Field Name | Byte Length | Type | Description | ++--------+------------+-------------+------+-------------+ +| 0 | LENGTH | 2 | DW | X'000E' | ++--------+------------+-------------+------+-------------+ +| 2 | DELIMITER | 2 | DW | X'EFFF' | ++--------+------------+-------------+------+-------------+ +| 4 | COMMAND | 1 | DB | X'1C' | ++--------+------------+-------------+------+-------------+ +| 5 | DATA1 | 1 | DB | Reserved | ++--------+------------+-------------+------+-------------+ +| 6 | DATA2 | 2 | DW | Reserved | ++--------+------------+-------------+------+-------------+ +| 8 | XMIT CORRELATOR | 2 | DW | X'nnnn' | ++--------+------------+-------------+------+-------------+ +| 10 | RSP CORRELATOR | 2 | DW | Reserved | ++--------+------------+-------------+------+-------------+ +| 12 | DEST NUMBER | 1 | DB | Remote session number | ++--------+------------+-------------+------+-------------+ +| 13 | SOURCE NUMBER | 1 | DB | Local session number | ++--------+------------+-------------+------+-------------+ +``` + +**Transmit Correlator** + +**Explanation:** This is a 2-byte field containing the correlator that was in the response correlator field of the DATA_FIRST_MIDDLE frame. This is used to correlate this frame with the DATA_FIRST_MIDDLE frame at the originator. + +**Destination Number** + +**Explanation:** This is a 1-byte field containing the session number that was assigned at the remote node during session initialization to identify this session. + +**Source Number** + +**Explanation:** This is a 1-byte field containing the local session number that was assigned during session initialization to identify this session. + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.6.21 - 1</page_number> + +--- + + +## Page 342 + +LAN Technical Reference: 802.2 and NetBIOS APIs +SESSION_ALIVE + +5.6.22 SESSION_ALIVE + ++---- Hex 1F ---------------------------------------------+ +| | +| SESSION_ALIVE | +| | ++----------------------------------------------------------+ + +**Initiation:** This frame is transmitted as a result of the periodic expiration of a link inactivity timer. + +**Function:** To periodically determine, in the absence of session data, if the links to any remote nodes for which sessions are established are still available. This is to prevent keeping resources allocated when a link may have become unavailable without indication. A bad return code on the transmit of this frame will cause the user to be informed of abnormal session termination, and the resources for every session on this link will be released. Receipt of this frame is ignored. + +**Transmission:** This frame is transmitted as an I-format LPDU to the specific address of the remote session partner. + +**Responses:** None + +**Retries:** Because this is an I-format LPDU, all retries are handled by the IEEE 802.2 LLC layer. + +**Timeouts:** Retry timeouts are handled by the IEEE 802.2 LLC layer. At the NetBIOS level, the periodic link inactivity timer is 30 seconds. + ++----------------------------------------------------------+ +| Table 5-32. SESSION_ALIVE Frame Format | ++----------------------------------------------------------+ +| Offset | Field Name | Byte | 8086 | Description | +| | | Length | Type | | ++--------+------------+------+-------+----------------------+ +| 0 | LENGTH | 2 | DW | X'000E' | ++--------+------------+------+-------+----------------------+ +| 2 | DELIMITER | 2 | DW | X'EFFF' | ++--------+------------+------+-------+----------------------+ +| 4 | COMMAND | 1 | DB | X'1F' | ++--------+------------+------+-------+----------------------+ +| 5 | DATA1 | 1 | DB | Reserved | ++--------+------------+------+-------+----------------------+ +| 6 | DATA2 | 2 | DW | Reserved | ++--------+------------+------+-------+----------------------+ +| 8 | XMIT CORRELATOR | 2 | DW | Reserved | ++--------+------------+------+-------+----------------------+ +| 10 | RSP CORRELATOR | 2 | DW | Reserved | ++--------+------------+------+-------+----------------------+ +| 12 | DEST NUMBER | 1 | DB | Reserved | ++--------+------------+------+-------+----------------------+ +| 13 | SOURCE NUMBER | 1 | DB | Reserved | ++--------+------------+------+-------+----------------------+ + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.6.22 - 1</page_number> + +--- + + +## Page 343 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NetBIOS Protocol Examples without RND + +5.7 NetBIOS Protocol Examples without RND + +Following are NetBIOS 2.1 examples of typical protocol scenarios including name management, session establishment, and session data transfer. The direction of a frame on the network is indicated by an arrow. The frame type is above the arrow and the contents of the frame are below the arrow. If a frame is repeated, the data appears only on the first instance of the frame. + +Notes: + +1. The numeric values shown in the various examples indicate the true number; in a trace, the high-order and low-order bytes may be reversed because of 8086 architecture. +2. The use of 'rrrr' within certain fields of the frame indicates a reserved field. + +Subtopics +5.7.1 Name Management Examples +5.7.2 Remote Adapter Status Examples +5.7.3 Session Establishment Examples +5.7.4 Session Data Transfer Examples +5.7.5 NetBIOS Protocol Examples with RND +5.7.6 Session Establishment RND Examples +5.7.7 NetBIOS Protocol SEND.NO.ACK Examples +5.7.8 Session Establishment Examples +5.7.9 Session Data Transfer Examples + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.7 - 1</page_number> + +--- + + +## Page 344 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Name Management Examples + +5.7.1 Name Management Examples + +Following are scenarios that show the adding of a name to the network. + +Subtopics +5.7.1.1 Add a Name to the Network +5.7.1.2 Add a Name: Name Already on Network +5.7.1.3 Add a Name: Receive Multiple Responses + +
Copyright IBM Corp. 1986, 1996 +5.7.1 - 1
+ +--- + + +## Page 345 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Add a Name to the Network + +5.7.1.1 Add a Name to the Network + +The application program attempts to add a unique name to the network. The ADD_NAME_QUERY is sent at 1/2 second intervals for 6 times (by default). If no response is received in that period of time, the name is assumed to be unique and is added to the name table. The application program NCB gets a return code of X'00'. See an example of the command sequence in Figure 5-5. + +
Copyright IBM Corp. 1986, 1996 +5.7.1.1 - 1
+ +--- + + +## Page 346 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Add a Name to the Network + +NETBIOS I/F + +NCB.ADD.NAME +NCB_NAME="N1" + +1/2 sec +ADD_NAME_QUERY +2C00IFFEF|01|00|0000|0000|0100|00...00|"N1" + +1/2 sec +ADD_NAME_QUERY + +1/2 sec +ADD_NAME_QUERY + +1/2 sec +ADD_NAME_QUERY + +1/2 sec +ADD_NAME_QUERY + +add name to local table + +NCB_RETCODE=X'00' + +Figure 5-5. Add a Name to the Network Command Sequence + +<page_number>5.7.1.1 - 2</page_number> + +--- + + +## Page 347 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Add a Name: Name Already on Network + +5.7.1.2 Add a Name: Name Already on Network + +The application program attempts to add a unique name to the network, and the name is already registered at some remote node. The remote node responds to the ADD_NAME_QUERY with an ADD_NAME_RESPONSE. The originating node stops transmitting ADD_NAME_QUERY when a response is received and waits for the total timeout period checking for responses from other nodes. If no other nodes respond, the NCB gets a return code of X'16' (name in use on remote NetBIOS). See an example of the command sequence in Figure 5-6. + + +graph TD + A[NCB.ADD.NAME] --> B[NCB_NAME="N1"] + B --> C[NETBIOS I/F] + C --> D[ADD_NAME_QUERY] + D --> E[2C00|FFEF|01|00|0000|0000|0200|00...00|"N1"] + E --> F[ADD_NAME_RESPONSE] + F --> G[2C00|FFEF|0D|00|0000|0200|0000|"N1"...|"N1"...] + G --> H[NCB_RETCODE=X'16'] + subgraph Time Intervals + I[1/2 sec] + J[2.5 sec] + end + B -- I --> D + D -- J --> F + + +Figure 5-6. Name Already on Network Command Sequence + +
Copyright IBM Corp. 1986, 1996 +5.7.1.2 - 1
+ +--- + + +## Page 348 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Add a Name: Receive Multiple Responses + +5.7.1.3 Add a Name: Receive Multiple Responses + +The application program attempts to add a unique name to the network and the name is registered at more than one remote node (this is an error situation). The originating node stops transmitting ADD_NAME_QUERY when a response is received and waits for the total timeout period, checking for responses from other nodes. When more than one response is received from a different node, the NAME_IN_CONFLICT is detected by the originating node and sends a NAME_IN_CONFLICT to all remote nodes and no longer waits for the timeout period. The NCB gets a return code of X'19' (name conflict detected). See an example of the command sequence in Figure 5-7. + +
Copyright IBM Corp. 1986, 1996 +5.7.1.3 - 1
+ +--- + + +## Page 349 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Add a Name: Receive Multiple Responses + +NETBIOS I/F + +NCB.ADD.NAME +NCB_NAME="N1" + +1/2 sec + +ADD_NAME_QUERY +2C00IFFEFI01|00|0000|0000|0300|00...00|"N1" + +1/2 sec + +ADD_NAME_QUERY +2C00IFFEFI01|00|0000|0000|0300|00...00|"N1" + +ADD_NAME_RESPONSE from node A +2C00IFFEFI0D|00|0000|0300|0000|"N1"...|"N1"... + +ADD_NAME_RESPONSE from node B +2C00IFFEFI0D|00|0000|0300|0000|"N1"...|"N1"... + +NAME_IN_CONFLICT +2C00IFFEFI02|00|0000|0000|0000|"N1"...|bia... + +NCB_RETCODE=X'19' + +Figure 5-7. Receive Multiple Responses Command Sequence + +
Copyright IBM Corp. 1986, 1996 +5.7.1.3 - 2
+ +--- + + +## Page 350 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Remote Adapter Status Examples + +5.7.2 Remote Adapter Status Examples + +Following are examples of remote status requests. + +Subtopics +5.7.2.1 Remote Adapter Status for a Name That Is Not on the Network +5.7.2.2 Remote Adapter Status for a Name That Is on the Network +5.7.2.3 Remote Adapter Status Data: Segmentation + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.7.2 - 1</page_number> + +--- + + +## Page 351 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Remote Adapter Status for a Name That Is Not on the Network + +5.7.2.1 Remote Adapter Status for a Name That Is Not on the Network + +The application program attempts to request the remote status for a name that is not on the network. STATUS_QUERY is sent at 1/2-second intervals 6 times (by default). If a STATUS_RESPONSE is not received the application program NCB gets a return code of X'05' (command timed out). See an example of the command sequence in Figure 5-8. + +
Copyright IBM Corp. 1986, 1996 +5.7.2.1 - 1
+ +--- + + +## Page 352 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Remote Adapter Status for a Name That Is Not on the Network + +NETBIOS I/F + +NCB.STATUS +NCB_CALLNAME="N1" + +1/2 sec +STATUS_QUERY +2C00IFFEF|03|01|F000|0000|0100|"N1"|bia + +1/2 sec +STATUS_QUERY + +1/2 sec +STATUS_QUERY + +1/2 sec +STATUS_QUERY + +1/2 sec +STATUS_QUERY + +1/2 sec +STATUS command timed out + +NCB_RETCODE=X'05' + +Figure 5-8. Remote Adapter Status for a Name That Is Not on the Network Command Sequence + +
Copyright IBM Corp. 1986, 1996 +5.7.2.1 - 2
+ +--- + + +## Page 353 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Remote Adapter Status for a Name That Is on the Network + +5.7.2.2 Remote Adapter Status for a Name That Is on the Network + +The application program attempts to request the remote status for a name that is on the network. STATUS_QUERY is sent at 1/2-second intervals 6 times (by default). If a STATUS_RESPONSE is received the application program NCB gets a return code of X'00'. It is assumed that the application program buffer is big enough to hold the status data. See an example of the command sequence in Figure 5-9. + + +graph TD + subgraph NETBIOS I/F + A[NCB.STATUS] --> B[NCB_NAME="N1"] + B --> C[STATUS_QUERY] + C --> D[2C00|FFEF|03|01|F000|0000|0200|"N1"|bia] + D --> E[STATUS_RESPONSE] + E --> F[2C00|FFEF|0F|01|4E00|0200|0000|bia|"N1"] + F --> G[NCB_RETCODE=X'00'] + end + style A fill:#fff,stroke:#333,stroke-width:2px + style B fill:#fff,stroke:#333,stroke-width:2px + style C fill:#fff,stroke:#333,stroke-width:2px + style D fill:#fff,stroke:#333,stroke-width:2px + style E fill:#fff,stroke:#333,stroke-width:2px + style F fill:#fff,stroke:#333,stroke-width:2px + style G fill:#fff,stroke:#333,stroke-width:2px + linkStyle 0 stroke:#333,stroke-width:2px,fill:none; + linkStyle 1 stroke:#333,stroke-width:2px,fill:none; + linkStyle 2 stroke:#333,stroke-width:2px,fill:none; + linkStyle 3 stroke:#333,stroke-width:2px,fill:none; + linkStyle 4 stroke:#333,stroke-width:2px,fill:none; + linkStyle 5 stroke:#333,stroke-width:2px,fill:none; + linkStyle 6 stroke:#333,stroke-width:2px,fill:none; + + +Figure 5-9. Remote Adapter Status for a Name that Is on the Network Command Sequence + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.7.2.2 - 1</page_number> + +--- + + +## Page 354 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Remote Adapter Status Data: Segmentation + +5.7.2.3 Remote Adapter Status Data: Segmentation + +The application program attempts to request the remote status for a name that is on the network. STATUS_QUERY is sent at 1/2-second intervals 6 times (by default). The example shown in Figure 5-10 describes how the status data are segmented. It is assumed that the remote station has 63 names and the maximum UI frame that the remote station can transmit is 962 bytes. The application program puts up a buffer for 1064 bytes. The application program NCB gets a return code of X'00'. The command sequence is shown in Figure 5-10. + + +graph TD + subgraph NETBIOS I/F + A[NCB.STATUS] --> B[NCB_NAME="N1"] + B --> C[STATUS_QUERY] + C --> D[2C00|FFEF|03|01|2804|0000|0300|"N1"|bia] + D --> E[STATUS_RESPONSE from node A] + E --> F[2C00|FFEF|0F|32|C083|0300|0000|bia|"N1"] + F --> G[STATUS_QUERY to node A] + G --> H[2C00|FFEF|03|32|6800|0000|0400|"N1"|bia] + H --> I[STATUS_RESPONSE from node A] + I --> J[2C00|FFEF|0F|35|3600|0400|0000|bia|"N1"] + J --> K[NCB_RETCODE=X'00'] + end + style A fill:#fff,stroke:#333,stroke-width:2px + style B fill:#fff,stroke:#333,stroke-width:2px + style C fill:#fff,stroke:#333,stroke-width:2px + style D fill:#fff,stroke:#333,stroke-width:2px + style E fill:#fff,stroke:#333,stroke-width:2px + style F fill:#fff,stroke:#333,stroke-width:2px + style G fill:#fff,stroke:#333,stroke-width:2px + style H fill:#fff,stroke:#333,stroke-width:2px + style I fill:#fff,stroke:#333,stroke-width:2px + style J fill:#fff,stroke:#333,stroke-width:2px + style K fill:#fff,stroke:#333,stroke-width:2px + + +Figure 5-10. Remote Adapter Status Data: Segmentation Command Sequence + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.7.2.3 - 1</page_number> + +--- + + +## Page 355 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Session Establishment Examples + +5.7.3 Session Establishment Examples +Following are scenarios that show session establishment. + +Subtopics +5.7.3.1 Call a Name: Name Not on Network +5.7.3.2 Call a Name: Name on Network but No Listen +5.7.3.3 Call a Name: Name Found--Start Session + +
Copyright IBM Corp. 1986, 1996 +5.7.3 - 1
+ +--- + + +## Page 356 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Call a Name: Name Not on Network + +5.7.3.1 Call a Name: Name Not on Network + +The application program attempts to call a name that does not exist on the network. The NAME_QUERY is sent at 1/2-second intervals 6 times (by default). If a NAME_RECOGNIZED is not received, the application program NCB gets a return code of X'14' (cannot find name or no answer). See an example of the command sequence in Figure 5-11. + +
Copyright IBM Corp. 1986, 1996 +5.7.3.1 - 1
+ +--- + + +## Page 357 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Call a Name: Name Not on Network + + +graph TD + subgraph NETBIOS I/F + A[NCB.CALL] --> B[NAME_QUERY] + B --> C[2C00|FFEF|0A|00|0100|0000|0100|"N2"...|"N1"...] + C --> D[NAME_QUERY] + D --> E[NAME_QUERY] + E --> F[NAME_QUERY] + F --> G[NAME_QUERY] + G --> H[NCB_RETCODE=X'14'] + end + subgraph NETBIOS I/F + I[NCB_CALLNAME="N2"] + J[NCB_NAME ="N1"] + end + style A fill:#fff,stroke:#333,stroke-width:2px + style B fill:#fff,stroke:#333,stroke-width:2px + style C fill:#fff,stroke:#333,stroke-width:2px + style D fill:#fff,stroke:#333,stroke-width:2px + style E fill:#fff,stroke:#333,stroke-width:2px + style F fill:#fff,stroke:#333,stroke-width:2px + style G fill:#fff,stroke:#333,stroke-width:2px + style H fill:#fff,stroke:#333,stroke-width:2px + style I fill:#fff,stroke:#333,stroke-width:2px + style J fill:#fff,stroke:#333,stroke-width:2px + A -- 1/2 sec --> B + B -- 1/2 sec --> D + D -- 1/2 sec --> E + E -- 1/2 sec --> F + F -- 1/2 sec --> G + G --> H + + +Figure 5-11. Call a Name: Name Not on Network Command Sequence + +
Copyright IBM Corp. 1986, 1996 +5.7.3.1 - 2
+ +--- + + +## Page 358 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Call a Name: Name on Network but No Listen + +5.7.3.2 Call a Name: Name on Network but No Listen + +The application program attempts to call a name on the network that is registered but there is no LISTEN pending for that name. The NAME_QUERY is sent at 1/2-second intervals 6 times (by default). If a NAME_RECOGNIZED is received that indicates no LISTEN, the query cycle starts over. If a good NAME_RECOGNIZED is still not received, the application program NCB gets a return code of X'12' (session open rejected). See an example of the command sequence in Figure 5-12. + +
Copyright IBM Corp. 1986, 1996 +5.7.3.2 - 1
+ +--- + + +## Page 359 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Call a Name: Name on Network but No Listen + + +graph TD + subgraph NETBIOS I/F + A[NCB.CALL] --> B[NAME_QUERY] + B --> C[2C00IFFEF|0A|00|0200|0000|0200|"N2"...|"N1"...] + C --> D[NAME_RECOGNIZED] + D --> E[2C00IFFEF|0E|00|0000|0200|0000|"N1"...|"N2"...] + E --> F[repeat query] + F --> G[5 times] + G --> H[NAME_QUERY] + H --> I[2C00IFFEF|0A|00|0200|0000|0200|"N2"...|"N1"...] + I --> J[NAME_RECOGNIZED] + J --> K[2C00IFFEF|0E|00|0000|0200|0000|"N1"...|"N2"...] + K --> L[repeat query] + L --> M[5 times] + M --> N[NCB_RETCODE=X'12'] + end + subgraph NETBIOS I/F + O[NCB_CALLNAME="N2"] + P[NCB_NAME ="N1"] + end + A -- 1/2 sec --> B + D -- 2.5 sec --> E + H -- 1/2 sec --> I + J -- 2.5 sec --> K + + +Figure 5-12. Call a Name: Name on Network but No Listen Command Sequence + +
Copyright IBM Corp. 1986, 1996 +5.7.3.2 - 2
+ +--- + + +## Page 360 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Call a Name: Name Found–Start Session + +5.7.3.3 Call a Name: Name Found--Start Session + +The application program uses name N1 and issues a call to name N2 that is registered at a remote node that has a LISTEN pending for that name. The NAME_QUERY and NAME_RECOGNIZED contain the respective session numbers. Receipt of the NAME_RECOGNIZED causes the originating node to send a SESSION_INITIALIZE (as an I-format LPDU) and run a timer waiting for a SESSION_CONFIRM (sent as an I-format LPDU). The SESSION_INITIALIZE and SESSION_CONFIRM each indicate the maximum amount of user data that they are prepared to receive on this session. The remote partner then limits the size of the user data in frames transmitted over this session to this size or the size available in its transmit buffer (DHB), whichever is smaller. Receipt of the SESSION_CONFIRM completes the call and sets the NCB_RETCODE to X'00' and NCB_LSN to the locally assigned session number. See an example of the command sequence in Figure 5-13. + +
Copyright IBM Corp. 1986, 1996 +5.7.3.3 - 1
+ +--- + + +## Page 361 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Call a Name: Name Found--Start Session + + +graph TD + subgraph NETBIOS I/F + A[NCB.CALL
NCB_CALLNAME="N2"
NCB_NAME ="N1"] + B[NAME_QUERY
2C00|FFEF|0A|00|0300|0000|0300|"N2"...|"N1"...] + C[NAME_RECOGNIZED
2C00|FFEF|0E|00|0100|0300|0100|"N1"...|"N2"...] + D[SESSION_INITIALIZE
0E00|FFEF|19|0F|2E06|0100|0400|01|03] + E[SESSION_CONFIRM
0E00|FFEF|17|01|2E06|0400|0100|03|01] + F[NCB_RETCODE=X'00'
NCB_LSN=X'03'] + end + + subgraph NETBIOS I/F + G[NCB.LISTEN
NCB.CALLNAME="N1"
NCB.NAME ="N2"] + H[NCB.RETCODE=X'00'
NCB.LSN=X'01'] + end + + A --> B + B -- 1/2 sec --> C + C --> D + D -- 3 sec plus 1 sec if more than 3 bridges --> E + E --> F + G --> H +
+ +Figure 5-13. Call a Name: Name Found--Start Session Command Sequence. If the call is to a group name, then the first group name to respond with a name recognized will be the station with which the session is established. + +
Copyright IBM Corp. 1986, 1996
+
5.7.3.3 - 2
+ +--- + + +## Page 362 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Session Data Transfer Examples + +5.7.4 Session Data Transfer Examples +The following scenarios show data transfer across a session including segmentation at the sender and multiple receives at the receiver. + +Subtopics +5.7.4.1 Send Session Data: One Send and One Receive +5.7.4.2 Send Session Data: One Send and Multiple Receives +5.7.4.3 Send Session Data: Segmentation and One Receive +5.7.4.4 Send Session Data: Segmentation and Multiple Receives + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.7.4 - 1</page_number> + +--- + + +## Page 363 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Send Session Data: One Send and One Receive + +5.7.4.1 Send Session Data: One Send and One Receive + +The session has been established as above. The local node issues a SEND command for 100 bytes and the remote node has a corresponding 100-byte RECEIVE pending. The local node sends a DATA_ONLY_LAST and the remote node responds with a DATA_ACK. See an example of the command sequence in Figure 5-14. + + +graph TD + subgraph NETBIOS I/F + A[NCB.SEND] --> B[NCB_LSN=X'01'
NCB_LENGTH=100] + B --> C[DATA_ONLY_LAST
0E00|FFEF|16|00|0000|0000|0400|02|01] + C --> D[DATA_ACK
0E00|FFEF|14|00|0000|0400|0000|01|02] + D --> E[NCB_RETCODE=X'00'] + end + + subgraph NETBIOS I/F + F[NCB.RECEIVE] --> G[NCB.LENGTH=100] + G --> H[NCB.RETCODE=X'00'] + end + + B -- NCB_STO timeout --> D +
+ +Figure 5-14. Send Session Data: One Send and One Receive Command Sequence + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.7.4.1 - 1</page_number> + +--- + + +## Page 364 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Send Session Data: One Send and Multiple Receives + +5.7.4.2 Send Session Data: One Send and Multiple Receives + +The local node sends a 200-byte message over the session to the remote node. The remote node has two 100-byte RECEIVES outstanding. The remote node sends a RECEIVE_OUTSTANDING, acknowledging 100 bytes and indicating another RECEIVE is pending. The local node resends until the remote has acknowledged all the data. See an example of the command sequence in Figure 5-15. + + +graph TD + subgraph NETBIOS I/F + A[NCB.SEND
NCB_LSN=X'01'
NCB_LENGTH=200] --> B[0E00|FFEF|16|00|0000|0000|0500|02|01] + B --> C[RECEIVE_OUTSTANDING
0E00|FFEF|1B|00|6400|0000|0000|01|02] + C --> D[DATA_ONLY_LAST(100 bytes)
0E00|FFEF|16|00|0100|0000|0500|02|01] + D --> E[DATA_ACK
0E00|FFEF|14|00|0000|0500|0000|01|02] + E --> F[NCB_RETCODE=X'00'] + end + + subgraph NETBIOS I/F + G[NCB.RECEIVE
NCB.LENGTH=100] --> H[NCB_RETCODE=X'00'] + H --> I[NCB.RECEIVE
NCB.LENGTH=100] + I --> J[NCB_RETCODE=X'00'] + end + + B -- NCB_STO timeout --> C + F --> A +
+ +Figure 5-15. Send Session Data: One Send and Multiple Receives Command Sequence + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.7.4.2 - 1</page_number> + +--- + + +## Page 365 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Send Session Data: Segmentation and One Receive + +5.7.4.3 Send Session Data: Segmentation and One Receive + +The local node sends a 600-byte message over the session to the remote node that has a corresponding 600-byte RECEIVE pending. The local DHB size is such that the message must be segmented into 200-byte segments. The local node sends the first 200-byte segment with a bit requesting a RECEIVE_CONTINUE from the remote node indicating it has a RECEIVE pending. The remote node responds with the RECEIVE_CONTINUE that indicates acceptance of the 200-byte segment and indicates it can receive more data. The local node then sends the remainder. See an example of the command sequence in Figure 5-16. + +
Copyright IBM Corp. 1986, 1996 +5.7.4.3 - 1
+ +--- + + +## Page 366 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Send Session Data: Segmentation and One Receive + + +graph TD + subgraph NETBIOS I/F + A[NCB.SEND
NCB_LSN=X'01'
NCB_LENGTH=600] + B[DATA_FIRST_MIDDLE (200 bytes)
0E00|FFEF|15|01|0000|0000|0204|02|01] + C[RECEIVE_CONTINUE
0E00|FFEF|1C|00|0000|0204|0000|01|02] + D[DATA_FIRST_MIDDLE (200 bytes)
0E00|FFEF|15|00|0000|0000|0000|0201] + E[DATA_ONLY_LAST (200 bytes)
0E00|FFEF|16|00|0000|0204|0000|0201] + F[DATA_ACK
0E00|FFEF|14|00|0000|0204|0000|01|02] + G[NCB RETCODE=X'00'] + end + + subgraph NETBIOS I/F + H[NCB.RECEIVE
NCB.LENGTH=600] + I[NCB.RETCODE=X'00'] + end + + A --> B + B --> H + H --> C + C --> D + D --> E + E --> F + F --> I + I --> G + + style A fill:#fff,stroke:#333,stroke-width:2px + style B fill:#fff,stroke:#333,stroke-width:2px + style C fill:#fff,stroke:#333,stroke-width:2px + style D fill:#fff,stroke:#333,stroke-width:2px + style E fill:#fff,stroke:#333,stroke-width:2px + style F fill:#fff,stroke:#333,stroke-width:2px + style G fill:#fff,stroke:#333,stroke-width:2px + style H fill:#fff,stroke:#333,stroke-width:2px + style I fill:#fff,stroke:#333,stroke-width:2px +
+ +Figure 5-16. Send Session Data: Segmentation and One Receive Command Sequence + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.7.4.3 - 2</page_number> + +--- + + +## Page 367 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Send Session Data: Segmentation and Multiple Receives + +5.7.4.4 Send Session Data: Segmentation and Multiple Receives + +The local node sends a 400-byte message over the session to the remote node. The remote node has four receives of 100 bytes each. The local DHB size is such that the message must be segmented into 200-byte segments. The local node sends the first 200-byte segment with a bit requesting a RECEIVE_CONTINUE from the remote node indicating it has a RECEIVE pending. The remote node can only accept part of the first segment and responds with a RECEIVE_OUTSTANDING, acknowledging 100 bytes and indicating more RECEIVES are pending. This continues until the entire message has been acknowledged. See an example of the command sequence in Figure 5-17. + +
Copyright IBM Corp. 1986, 1996 +5.7.4.4 - 1
+ +--- + + +## Page 368 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Send Session Data: Segmentation and Multiple Receives + + +graph TD + subgraph NETBIOS I/F + A[NCB.SEND] --> B[DATA_FIRST_MIDDLE (bytes 1-200)] + B --> C[RECEIVE_OUTSTANDING (ack 1-100)] + C --> D[DATA_FIRST_MIDDLE (bytes 101-300)] + D --> E[DATA_ONLY_LAST (bytes 301-400)] + E --> F[RECEIVE_OUTSTANDING (ack 101-200)] + F --> G[DATA_ONLY_LAST (bytes 201-400)] + G --> H[RECEIVE_OUTSTANDING (ack 201-300)] + H --> I[DATA_ONLY_LAST (bytes 301-400)] + I --> J[DATA_ACK (ack 301-400)] + J --> K[NCB_RETCODE=X'00'] + end + + subgraph NETBIOS I/F + L[NCB.RECEIVE NCB.LENGTH=100] + M[NCB.RECEIVE NCB.LENGTH=100] + N[NCB.RECEIVE NCB.LENGTH=100] + O[NCB.RECEIVE NCB.LENGTH=100] + P[NCB.RETCODE=X'00'] + Q[NCB.RETCODE=X'00'] + R[NCB.RETCODE=X'00'] + S[NCB.RETCODE=X'00'] + end + + A -- NCB_LSN=X'01' NCB_LENGTH=400 --> B + B -- 0E00|FFEF|15|00|0000|0000|0700|02|01 --> L + C -- 0E00|FFEF|1B|00|6400|0000|0000|01|02 --> M + D -- 0E00|FFEF|15|00|0100|0000|0700|02|01 --> N + E -- 0E00|FFEF|16|00|0000|0000|0007|02|01 --> O + F -- 0E00|FFEF|1B|00|6400|0000|0000|01|02 --> P + G -- 0E00|FFEF|16|00|0100|0000|0700|02|01 --> Q + H -- 0E00|FFEF|1B|00|6400|0000|0000|01|02 --> R + I -- 0E00|FFEF|16|00|0100|0000|0700|02|01 --> S + J -- 0E00|FFEF|14|00|0000|0700|0000|01|02 --> K + + K -- NCB STO timeout --> C + + +Figure 5-17. Send Session Data: Segmentation and Multiple Receives Command Sequence + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.7.4.4 - 2</page_number> + +--- + + +## Page 369 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NetBIOS Protocol Examples with RND + +5.7.5 NetBIOS Protocol Examples with RND + +Following are examples of NetBIOS 2.1 typical protocol scenarios that use the Remote Name Directory (RND) function to communicate with a remote station. + +The local station locates a remote name by: +1. Issuing a NAME_QUERY on-ring once +2. Issuing a NAME_QUERY off-ring per transmit count +3. Transmitting timeout values that can be defined by NCB_TRANSMIT_COUNT and NCB_TRANSMIT_TIMEOUT parameters in the DIR.OPEN.ADAPTER command. + +The range for NCB_TRANSMIT_COUNT is 1 to 10 and the default is 6. The range for NCB_TRANSMIT_TIMEOUT is 1/2 second to 10 seconds, and the default is 1/2 second. + +When RND is used, after the local station has located a remote name, the remote node address is saved and subsequent messages to that name are to a specific node rather than a broadcast to all nodes. + +The direction of a frame on the network is indicated by an arrow. The frame type is above the arrow and the contents of the frame are below the arrow. If a frame is repeated, the data appears only on the first instance of the frame. + +**Note:** The numeric values shown in the various examples indicate the values as they appear on the line when the frame is being transmitted. + +Subtopics +5.7.5.1 Remote Adapter Status for a Name Not on Network or RND +5.7.5.2 Remote Adapter Status for a Name Not in RND but on the Network +5.7.5.3 Remote Adapter Status for a Remote Name That Is in RND + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.7.5 - 1</page_number> + +--- + + +## Page 370 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Remote Adapter Status for a Name Not on Network or RND + +5.7.5.1 Remote Adapter Status for a Name Not on Network or RND + +The application program attempts to request the remote status for a name that is not on the network. NAME_QUERY is sent to locate the name on the network on-ring once and off-ring at 1/2-second intervals 6 times (by default). If a NAME_RECOGNIZED is not received, the application program NCB gets a return code of X'05' (command timed out). + +
Copyright IBM Corp. 1986, 1996
+
5.7.5.1 - 1
+ +--- + + +## Page 371 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Remote Adapter Status for a Name Not on Network or RND + +NETBIOS I/F + +NCB.STATUS +NCB_CALLNAME="N1" + +1/2 sec +NAME_QUERY +2C00|FFEF|0A|00|0000|0000|0100|"N1"|bia + +1/2 sec +NAME_QUERY + +1/2 sec +NAME_QUERY + +1/2 sec +NAME_QUERY + +1/2 sec +NAME_QUERY + +1/2 sec +NAME_QUERY + +1/2 sec +STATUS command timed out + +NCB_RETCODE=X'05' + +Figure 5-18. Remote Adapter Status for a Name Not on Network or RND Command Sequence + +
Copyright IBM Corp. 1986, 1996 +5.7.5.1 - 2
+ +--- + + +## Page 372 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Remote Adapter Status for a Name Not in RND but on the Network +5.7.5.2 Remote Adapter Status for a Name Not in RND but on the Network + +The application program attempts to request the remote status for a name that is on the network. The local RND is checked to see if the remote name exists in the table. If the remote name does not exist in the RND, the NAME_QUERY is sent to locate the name on the network on-ring once and off-ring at 1/2-second intervals 6 times (by default). If a NAME_RECOGNIZED is received, the local NetBIOS station adds the remote name and node address to the RND and sends a STATUS_QUERY to that node. If a STATUS_RESPONSE is received the application program NCB gets a return code of X'00'. It is assumed that the application program buffer is big enough to hold the status data. + + +graph TD + subgraph NETBIOS I/F + A[NCB.STATUS] --> B[NAME_QUERY] + B --> C[2C00|FFEF|0A|00|0000|0000|0200|"N1"|bia] + C --> D[NAME_RECOGNIZED] + D --> E[2C00|FFEF|0E|00|0000|0200|0000|bia|"N1"] + E --> F[STATUS_QUERY] + F --> G[2C00|FFEF|03|01|F000|0000|0300|"N1"|bia] + G --> H[STATUS_RESPONSE] + H --> I[2C00|FFEF|0F|02|6000|0300|0000|bia|"N1"] + end + A -- NCB_NAME="N1" --> B + I --> J[NCB RETCODE=X'00'] + + +Figure 5-19. Remote Adapter Status for a Name Not in RND but on the Network Command Sequence + +Copyright IBM Corp. 1986, 1996 +5.7.5.2 - 1 + +--- + + +## Page 373 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Remote Adapter Status for a Remote Name That Is in RND + +5.7.5.3 Remote Adapter Status for a Remote Name That Is in RND + +The application program attempts to request the remote status for a name that is on the network. The local RND is checked to see if the remote name exists in the table. If the remote name exists in the RND, STATUS_QUERY is sent to the specific node address that is saved in the RND. If a STATUS_RESPONSE is received, the application program NCB gets a return code of X'00'. It is assumed that the application program buffer is big enough to hold the status data. + + +graph TD + A[NCB.STATUS] --> B[NCB_NAME="N1"] + B --> C[NETBIOS I/F] + C --> D[STATUS_QUERY] + D --> E[2C00|FFEF|03|01|F000|0000|0400|"N1"|bia] + E --> F[STATUS_RESPONSE] + F --> G[2C00|FFEF|0F|02|6000|0400|0000|bia|"N1"] + G --> H[NCB RETCODE=X'00'] + style A fill:#fff,stroke:#333,stroke-width:2px + style B fill:#fff,stroke:#333,stroke-width:2px + style C fill:#fff,stroke:#333,stroke-width:2px + style D fill:#fff,stroke:#333,stroke-width:2px + style E fill:#fff,stroke:#333,stroke-width:2px + style F fill:#fff,stroke:#333,stroke-width:2px + style G fill:#fff,stroke:#333,stroke-width:2px + style H fill:#fff,stroke:#333,stroke-width:2px + subgraph 1/2 sec + E + F + end + + +Figure 5-20. Remote Adapter Status for a Remote Name That Is in RND Command Sequence + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.7.5.3 - 1</page_number> + +--- + + +## Page 374 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Session Establishment RND Examples + +5.7.6 Session Establishment RND Examples + +The following scenarios show session establishment. + +Subtopics +5.7.6.1 Call a Name: Name Not on Network or RND +5.7.6.2 Call a Name: Name Not in RND but Is on Network--Start Session + +
Copyright IBM Corp. 1986, 1996 +5.7.6 - 1
+ +--- + + +## Page 375 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Call a Name: Name Not on Network or RND + +5.7.6.1 Call a Name: Name Not on Network or RND + +The application program attempts to locate a name that does not exist on the network. The NAME_QUERY is sent on-ring once and at 1/2-second intervals 6 times (by default). The NAME_QUERY frame is sent to a NetBIOS functional address (single-route broadcast). If a NAME_RECOGNIZED is not received, the application program NCB gets a return code of X'14' (cannot find name or no answer). + +
Copyright IBM Corp. 1986, 1996 +5.7.6.1 - 1
+ +--- + + +## Page 376 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Call a Name: Name Not on Network or RND + + +graph TD + subgraph NETBIOS I/F + A[NCB.CALL] --> B[NCB_CALLNAME="N2" NCB_NAME="N1"] + B --> C[NAME_QUERY] + C --> D[2C001FFEF10A100101001000010100|"N2"...|"N1"...] + D --> E[NAME_QUERY] + E --> F[NAME_QUERY] + F --> G[NAME_QUERY] + G --> H[NAME_QUERY] + H --> I[NAME_QUERY] + I --> J[NAME_QUERY] + J --> K[NCB_RETCODE=X'14'] + end + subgraph NETBIOS I/F + L[1/2 sec] + M[1/2 sec] + N[1/2 sec] + O[1/2 sec] + P[1/2 sec] + Q[1/2 sec] + end + + +Figure 5-21. Call a Name: Name Not on Network or RND Command Sequence + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.7.6.1 - 2</page_number> + +--- + + +## Page 377 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Call a Name: Name Not in RND but Is on Network--Start Session + +5.7.6.2 Call a Name: Name Not in RND but Is on Network--Start Session + +The application program uses name N1 and issues a call to name N2 that is registered at a remote node that has a LISTEN pending for that name. NAME_QUERY and NAME_RECOGNIZED contain the respective session numbers. Receipt of the NAME_RECOGNIZED causes the originating node to add the remote name N2 and the remote node address to the RND. This receipt also causes the originating node to send a SESSION_INITIALIZE (as an I-format LPDU) and run a timer waiting for a SESSION_CONFIRM (sent as an I-format LPDU). The SESSION_INITIALIZE and SESSION_CONFIRM each indicate the maximum amount of user data that they are prepared to receive on this session. The remote partner then limits the size of the user data in frames transmitted over this session to this size or the size available in its transmit buffer (DHB), whichever is smaller. Receipt of the SESSION_CONFIRM completes the call and sets the NCB_RETCODE to X'00' and NCB_LSN to the locally assigned session number. + +Note: If the remote name is already in RND, the NAME_QUERY is sent to a specific node address rather than to a NetBIOS functional address. + +
Copyright IBM Corp. 1986, 1996
+
5.7.6.2 - 1
+ +--- + + +## Page 378 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Call a Name: Name Not in RND but Is on Network--Start Session + + +graph TD + subgraph NETBIOS I/F + A[NCB.CALL
NCB_CALLNAME="N2"
NCB_NAME ="N1"] + B[NAME_QUERY
2C00|FFEF|0A|00|0200|0000|0200|"N2"...|"N1"...] + C[NAME_RECOGNIZED
2C00|FFEF|0E|00|0100|0200|0300|"N1"...|"N2"...] + D[SESSION_INITIALIZE
0E00|FFEF|19|0F|2E06|0300|0400|01|02] + E[SESSION_CONFIRM
0E00|FFEF|17|01|2E06|0400|0300|02|01] + F[NCB_RETCODE=X'00'
NCB_LSN =X'02'] + end + + subgraph NETBIOS I/F + G[NCB.LISTEN
NCB_CALLNAME="N1"
NCB_NAME ="N2"] + H[NCB_RETCODE=X'00'
NCB_LSN =X'01'] + end + + A --> B + B -- 1/2 sec --> C + C --> D + D -- 3 sec plus 1 sec if more than 3 bridges --> E + E --> H + H --> F +
+ +Figure 5-22. Call a Name: Name Not in RND but Is on Network--Start Session Command Sequence + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.7.6.2 - 2</page_number> + +--- + + +## Page 379 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NetBIOS Protocol SEND.NO.ACK Examples + +5.7.7 NetBIOS Protocol SEND.NO.ACK Examples + +The following NetBIOS 2.2 examples of typical protocol scenarios use the SEND.NO.ACK/CHAIN.SEND.NO.ACK function to communicate with a remote station. + +The direction of a frame on the network is indicated by an arrow. The frame type is above the arrow and the contents of the frame are below the arrow. If a frame is repeated, the data appears only on the first instance of the frame. + +**Note:** The numeric values shown in the various examples indicate the values as they appear on the line when the frame is being transmitted. + +
Copyright IBM Corp. 1986, 1996 +5.7.7 - 1
+ +--- + + +## Page 380 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Session Establishment Examples + +5.7.8 Session Establishment Examples + +The following scenarios show session establishment. + +Subtopics +5.7.8.1 Call a Name: Name Found--Start Session + +
Copyright IBM Corp. 1986, 1996 +5.7.8 - 1
+ +--- + + +## Page 381 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Call a Name: Name Found--Start Session + +5.7.8.1 Call a Name: Name Found--Start Session + +The application program uses name N1 and issues a call to name N2 that is registered at a remote node that has a LISTEN pending for that name. NAME_QUERY and NAME_RECOGNIZED contain the respective session numbers. Receipt of the NAME_RECOGNIZED causes the originating node to send a SESSION_INITIALIZE (as an I-format LPDU) and run a timer waiting for a SESSION_CONFIRM (sent as an I-format LPDU). The SESSION_INITIALIZE and SESSION_CONFIRM each indicate the maximum amount of user data that they are prepared to receive on this session. The remote partner then limits the size of the user data in frames transmitted over this session to this size or the size available in its transmit buffer (DHB), whichever is smaller. + +A NO_ACK indicator flag is set in the DATA1 field of SESSION_INITIALIZE and SESSION_CONFIRM frames to indicate that the sending node has the ability to handle SEND.NO.ACK or CHAIN.SEND.NO.ACK commands. Receipt of the SESSION_CONFIRM completes the call and sets the NCB_RETCODE to X'00' and NCB_LSN to the locally assigned session number. + +
Copyright IBM Corp. 1986, 1996 +5.7.8.1 - 1
+ +--- + + +## Page 382 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Call a Name: Name Found--Start Session + + +graph TD + subgraph NETBIOS I/F + A[NCB.CALL
NCB_CALLNAME="N2"
NCB_NAME ="N1"] --> B[NAME_QUERY
2C00|FFEF|0A|00|0100|0000|0200|"N2"...|"N1"...] + B -- 1/2 sec --> C[NAME_RECOGNIZED
2C00|FFEF|0E|00|0100|0200|0200|"N1"...|"N2"...] + C --> D[SESSION_INITIALIZE
0E00|FFEF|19|8F|2E06|0200|0300|01|01] + D -- 3 sec plus 1 sec if more than 3 bridges --> E[SESSION_CONFIRM
0E00|FFEF|17|81|2E06|0300|0200|01|01] + E --> F[NCB_RETCODE=X'00'
NCB_LSN =X'01'] + end + + subgraph NETBIOS I/F + G[NCB.LISTEN
NCB_NAME ="N2"
NCB_CALLNAME="N1"] --> H[NCB_RETCODE=X'00'
NCB_LSN =X'01'] + end +
+ +Figure 5-23. Call a Name: Name Found--Start Session Command Sequence + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.7.8.1 - 2</page_number> + +--- + + +## Page 383 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Session Data Transfer Examples + +5.7.9 Session Data Transfer Examples + +The following scenarios show data transfer across a session. + +Subtopics +5.7.9.1 Send Session Data: One SEND.NO.ACK and No RECEIVE +5.7.9.2 Send Session Data: One SEND.NO.ACK and One RECEIVE +5.7.9.3 Send Session Data: One SEND.NO.ACK and Multiple RECEIVES + +
Copyright IBM Corp. 1986, 1996 +5.7.9 - 1
+ +--- + + +## Page 384 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Send Session Data: One SEND.NO.ACK and No RECEIVE + +5.7.9.1 Send Session Data: One SEND.NO.ACK and No RECEIVE + +The session has been established as above. The local side issues a RECEIVE_ANY no-wait NCB for 10 bytes and a SEND.NO.ACK command for 100 bytes and the remote node has no RECEIVE pending. The local side sends a DATA_ONLY_LAST frame. Soon after the frame is transmitted, the SEND.NO.ACK command is executed with a X'00' return code. + +The remote side recognizes the DATA_ONLY_LAST frame and that the data is of SEND.NO.ACK or CHAIN.SEND.NO.ACK type. Since the remote side does not have any RECEIVE pending for the session, a NO_RECEIVE frame is sent in response to indicate that the SEND.NO.ACK or CHAIN.SEND.NO.ACK data is either not received or only partially received. When this frame is received, the local station terminates a pending session type command (in this example, RECEIVE_ANY) with a X'07' return code. + +Note: If there is no pending RECEIVE command for the session at the receipt of a NO_RECEIVE frame, the next RECEIVE command (or other applicable command) issued will get a X'07' return code. + + +graph TD + subgraph NETBIOS I/F + A[NCB.RECEIVE.ANY
NCB_LSN=X'01'
NCB_LENGTH=10] + B[NCB.RECEIVE.ANY
NCB_RETCODE=X'FF'] + C[NCB.SEND.NO.ACK
NCB_LSN=X'01'
NCB_LENGTH=100] + D[NCB.SEND.NO.ACK
NCB_RETCODE=X'00'] + E[NCB.RECEIVE.ANY
NCB_RETCODE=X'07'] + end + + subgraph NETBIOS I/F + F[DATA_ONLY_LAST
0E00|FFEF|16|02|0000|0000|0400|01|01|6400] + G[NO_RECEIVE
0E00|FFEF|1A|02|0000|0000|0000|01|01] + end + + A --> C + C --> F + F --> B + B --> D + D --> E +
+ +Figure 5-24. Send Session Data: One SEND.NO.ACK and No RECEIVE Command Sequence + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.7.9.1 - 1</page_number> + +--- + + +## Page 385 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Send Session Data: One SEND.NO.ACK and One RECEIVE + +5.7.9.2 Send Session Data: One SEND.NO.ACK and One RECEIVE + +The session has been established as above. The local node issues a SEND.NO.ACK command for 100 bytes and the remote node has a corresponding 100-byte RECEIVE pending. The local node sends a DATA_ONLY_LAST and the SEND.NO.ACK is completed with a X'00' return code. + + +graph LR + subgraph NETBIOS I/F + A[NCB.SEND.NO.ACK
NCB_LSN=X'01'
NCB_LENGTH=100] + B[DATA_ONLY_LAST
0E00|FFEF|16|02|0000|0000|0500|01|01|6400] + C[NCB_RETCODE=X'00'] + end + + subgraph NETBIOS I/F + D[NCB.RECEIVE
NCB_LSN=X'01'
NCB_LENGTH=100] + E[NCB_RETCODE=X'00'] + end + + A --> B + B --> C + D --> E +
+ +Figure 5-25. Send Session Data: One SEND.NO.ACK and One RECEIVE Command Sequence + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.7.9.2 - 1</page_number> + +--- + + +## Page 386 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Send Session Data: One SEND.NO.ACK and Multiple RECEIVES + +5.7.9.3 Send Session Data: One SEND.NO.ACK and Multiple RECEIVES + +The local node sends a 200-byte message over the session to the remote node via the SEND.NO.ACK command. The remote node has two 100-byte RECEIVES outstanding. The remote node accepts a 100-bytes RECEIVE and transmits a NO_RECEIVE frame indicating that only part of the SEND.NO.ACK or CHAIN.SEND.NO.ACK data was received by the remote application program. + +If there is no pending RECEIVE command for the session at the receipt of a NO_RECEIVE frame, the next RECEIVE (or other applicable command) command issued will get a X'07' return code. + +Note: For data transmitted via SEND.NO.ACK or CHAIN.SEND.NO.ACK, only one RECEIVE command will be satisfied. The SEND.NO.ACK or CHAIN.SEND.NO.ACK data buffer must be no longer than the remote receive buffer for successful completion. + + +graph TD + subgraph NETBIOS I/F + A[NCB.SEND.NO.ACK
NCB_LSN=X'01'
NCB_LENGTH=200] + B[DATA_ONLY_LAST (200 bytes)
0E00|FFEF|16|02|0000|0000|0600|01|01|C800] + C[NCB_RETCODE=X'00'] + D[NO_RECEIVE
0E00|FFEF|1A|02|0000|0000|0000|01|01] + end + + subgraph NETBIOS I/F + E[NCB.RECEIVE
NCB_LSN=X'01'
NCB_LENGTH=100] + F[NCB.RECEIVE
NCB_LSN=X'01'
NCB_LENGTH=100] + G[NCB_RETCODE=X'00'] + end + + A --> B + B --> C + C --> D + D --> E + E --> F + F --> G +
+ +Figure 5-26. Send Session Data: One SEND.NO.ACK and Multiple RECEIVES Command Sequence + +
Copyright IBM Corp. 1986, 1996
+<page_number>5.7.9.3 - 1</page_number> + +--- + + +## Page 387 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Chapter 6. Support of NDIS Adapters Using IBM OS/2 LAN Adapter and Protocol Support + +6.0 Chapter 6. Support of NDIS Adapters Using IBM OS/2 LAN Adapter and Protocol Support + +Subtopics +6.1 LAN Adapter and Protocol Support Overview +6.2 LAN Adapters Supported +6.3 Programming Information--IEEE 802.2 API +6.4 Programming Information--NetBIOS API +6.5 Differences and Restrictions +6.6 Message Logging Facility +6.7 Operating System/2 Trace Facility + +
Copyright IBM Corp. 1986, 1996
+<page_number>6.0 - 1</page_number> + +--- + + +## Page 388 + +LAN Technical Reference: 802.2 and NetBIOS APIs +LAN Adapter and Protocol Support Overview + +6.1 LAN Adapter and Protocol Support Overview + +LAN Adapter and Protocol Support, network communication software, is a combination of protocol drivers and network adapter drivers (1) that comply to the Network Driver Interface Specification (NDIS), (2) API support software, and configuration and installation software for these drivers. LAN Adapter and Protocol Support is included in Extended Services for OS/2, IBM OS/2 LAN Server Versions 2.0 and 3.0, and NTS/2. It consists of the network communication software necessary to support the LAN connectivity needed by both IBM Extended Services for OS/2 and IBM OS/2 LAN Server. + +IEEE 802.2 and NetBIOS are the protocol drivers available with LAN Adapter and Protocol Support. A device driver interface API and a dynamic link interface API exist for both protocols. The IEEE 802.2 and NetBIOS APIs and the IEEE 802.2 and NetBIOS protocols are described in detail in Chapters 1 through 5 of this technical reference. + +NDIS allows multiple protocols to bind to the same network adapter driver. Therefore, both the NetBIOS and 802.2 protocol drivers can bind to the same network adapter driver. Figure 6-1 shows the relationship between LAN adapters, network adapter drivers, protocol drivers, and applications. + +```mermaid +graph TD + subgraph NETBIOS Application Programs + A[IBM OS/2 NETBIOS Protocol Driver] + end + subgraph IEEE 802.2 Application Programs + B[IBM IEEE 802.2 Protocol Driver] + end + subgraph Network Adapter Drivers + C[Network Adapter Driver] + D[Network Adapter Driver] + E[Network Adapter Driver] + F[Network Adapter Driver] + end + subgraph Network Adapters + G[Network Adapter] + H[Network Adapter] + I[Network Adapter] + J[Network Adapter] + end + + A --> C + A --> D + B --> E + B --> F + C --> G + D --> H + E --> I + F --> J + A -- NDIS --> B +``` + +Figure 6-1. LAN Adapter and Protocol Support Diagram + +In addition to the OS/2 API support, LAN Adapter and Protocol Support provides OS/2 2.0 Virtual LAN Support. The LAPS provided with ES 1.0 and LAN Server 2.0 offers virtual NetBIOS support. The LAPS provided with LAN Server 3.0 and NTS/2 offers virtual support for both NetBIOS and IEEE 802.2 applications. This virtual LAN support enables existing DOS NetBIOS applications and DOS 802.2 applications running in the OS/2 2.0 Virtual DOS Machine environment to share an adapter with other DOS and OS/2 NetBIOS applications running on the same machine. + +Configuration parameters for LAN Adapter and Protocol Support network adapter drivers and protocol drivers exist in the file PROTOCOL.INI. PROTOCOL.INI also contains the binding information for each driver. Refer to the Extended Services Communications Manager Configuration Guide, the Extended Services LAN Adapter and Protocol Support Configuration Guide, the OS/2 LAN Server Network Administrator Reference Volume 2: Performance Tuning, or the NTS/2 LAN Adapter and Protocol Support Configuration Guide for a detailed explanation of configuration parameters and PROTOCOL.INI. + +(1) A network adapter driver is also known as an NDIS MAC driver. +(2) See Appendix F, "NDIS Overview" for a brief description of NDIS. + +<page_number>6.1 - 1</page_number> + +--- + + +## Page 389 + +LAN Technical Reference: 802.2 and NetBIOS APIs +LAN Adapters Supported + +6.2 LAN Adapters Supported +LAPS supports most IBM adapters and certain NDIS adapters produced by manufacturers other than IBM. IBM has put in place enablement support for development and testing of network interface drivers by network interface adapter vendors. A list of the IBM adapters supported and the certified NDIS adapters produced by other manufacturers is available on CompuServe(**) and is maintained in the ES/LS Questions section of the OS/2 Support Forum. + +
Copyright IBM Corp. 1986, 1996 +6.2 - 1
+ +--- + + +## Page 390 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Programming Information--IEEE 802.2 API + +6.3 Programming Information--IEEE 802.2 API +The IEEE 802.2 protocol stack included in LAN Adapter and Protocol Support is NDIS-based. This section documents the changes to the API as a result of the new release. This section also contains answers to user questions about the OS/2 IEEE 802.2 API. + +Subtopics +6.3.1 Dynamic Link Interface +6.3.2 Device Driver Interface +6.3.3 Memory Restriction + +
Copyright IBM Corp. 1986, 1996
+<page_number>6.3 - 1</page_number> + +--- + + +## Page 391 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Dynamic Link Interface + +6.3.1 Dynamic Link Interface +The ACS.LIB library shipped with IBM OS/2 Extended Services contains the dynamic link definition for the IEEE 802.2 DLL user. ACS.LIB is not included in LAN Server Version 2.0 or 3.0. However, the user can create a .DEF file to create the same definition without linking to ACS.LIB. The .DEF file should contain the following statements: + +IMPORTS +ACSLAN.ACSLAN + +For the dynamic link interface IEEE 802.2 locks the data buffers associated with the CCB. The overhead associated with operating system locks and unlocks may be minimized if the application uses the same segment or segments for all of its data buffers. + +
Copyright IBM Corp. 1986, 1996
+<page_number>6.3.1 - 1</page_number> + +--- + + +## Page 392 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Device Driver Interface + +6.3.2 Device Driver Interface + +In an application program using the IEEE 802.2 OS/2 device driver interface, the register pair ES : BX contains a pointer to the CCB issued. This pointer must be a GDT when using the device driver interface. + +
Copyright IBM Corp. 1986, 1996 +6.3.2 - 1
+ +--- + + +## Page 393 + +6.3.3 Memory Restriction + +OS/2 2.0 introduces a paged memory model. However, the IEEE 802.2 protocol stack is a 16-bit device driver. Any memory passed to the IEEE 802.2 protocol stack in the form of CCBs or buffers must be contiguous in physical memory. The IBM C Set/2 compiler provides the /Gt compiler option, which defines 16-bit versions of the malloc family of functions. Use of this option guarantees that memory allocated and freed will not cross a 64-KB boundary. Refer to the IBM C Set/2 User's Guide for more information on compiler options. OS/2 2.0 ensures that the memory of a 16-bit application program is physically contiguous. + +
Copyright IBM Corp. 1986, 1996
+<page_number>6.3.3 - 1</page_number> + +--- + + +## Page 394 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Programming Information--NetBIOS API + +6.4 Programming Information--NetBIOS API +The release of NetBIOS included in LAN Adapter and Protocol Support is NetBIOS 4.0. NetBIOS 4.0 is NDIS-based. This section documents the changes to the API as a result of the new release. + +Subtopics +6.4.1 No-Wait Command and Post Routines +6.4.2 Dynamic Link Interface +6.4.3 Device Driver Interface +6.4.4 Memory Restriction +6.4.5 Resource Information +6.4.6 NCB Reserve Field Change +6.4.7 NCB.STATUS Command Extension +6.4.8 Piggybacked Acknowledgment Behavior + +
Copyright IBM Corp. 1986, 1996
+<page_number>6.4 - 1</page_number> + +--- + + +## Page 395 + +LAN Technical Reference: 802.2 and NetBIOS APIs +No-Wait Command and Post Routines + +6.4.1 No-Wait Command and Post Routines + +When using a no-wait command at either the dynamic link or device driver interface, the user commonly has a post routine that gets control upon command completion. When the post routine is called, NetBIOS is running on interrupt. Therefore, the post routine should be as short in duration as possible. It is valid to issue NCB commands inside the post routine as long as the command is a no-wait command. + +For the dynamic link interface, the NetBIOS stack used by the thread that calls the user's post routine is 4KB. Before calling the post routine, NetBIOS pushes the NCB pointer ES : BX on the stack. Upon entry to the user's post routine, ES and BX are at the following location in the stack frame. + + + + + + + + + + + + + + + + + + + + + + +
ESstack pointer + 8
BXstack pointer + 6
Undefinedstack pointer + 4
Return addressstack pointer + 2
Return addressstack pointer + 0
+ +Use a C calling convention, not Pascal, to access the NCB pointer on the stack. + +**Note:** The priority of the NetBIOS dynamic link interface thread that calls the user's post routine is set to priority class fixed high and priority delta zero. Some dynamic link interface applications have experienced performance degradation when setting threads to a priority higher than the NetBIOS post routine thread. + +
Copyright IBM Corp. 1986, 1996
+<page_number>6.4.1 - 1</page_number> + +--- + + +## Page 396 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Dynamic Link Interface + +6.4.2 Dynamic Link Interface +The ACS.LIB library shipped with IBM OS/2 Extended Services contains the dynamic link definition for the NetBIOS DLL user. ACS.LIB is not included in IBM OS/2 LAN Server Version 2.0. However, the user can create a .DEF file to create the same definition without linking to ACS.LIB. The .DEF file should contain the following statements: + +IMPORTS +ACSNETB.NetBIOS + +For the dynamic link interface NetBIOS locks the data buffers (NCB_BUFFER) associated with the NCB. The overhead associated with operating system locks and unlocks may be minimized if the application uses the same segment or segments for all of its data buffers. + +
Copyright IBM Corp. 1986, 1996
+<page_number>6.4.2 - 1</page_number> + +--- + + +## Page 397 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Device Driver Interface + +6.4.3 Device Driver Interface + +In an application program using the NetBIOS OS/2 device driver interface, the register pair ES : BX contains a pointer to the NCB issued. This pointer must be a GDT when using the device driver interface. + +
Copyright IBM Corp. 1986, 1996
+<page_number>6.4.3 - 1</page_number> + +--- + + +## Page 398 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Memory Restriction + +6.4.4 Memory Restriction + +OS/2 2.0 introduces a paged memory model. However, NetBIOS 4.0 is a 16-bit device driver. Any memory passed to NetBIOS in the form of NCBs or buffers must be contiguous in physical memory. The IBM C Set/2 compiler provides the /Gt compiler option, which defines 16-bit versions of the malloc family of functions. Use of this option guarantees that memory allocated and freed will not cross a 64KB boundary. Refer to the IBM C Set/2 User's Guide for more information on compiler options. OS/2 2.0 ensures that the memory of a 16-bit application program is physically contiguous. + +
Copyright IBM Corp. 1986, 1996 +6.4.4 - 1
+ +--- + + +## Page 399 + +6.4.5 Resource Information + +NetBIOS uses the message logging facility of LAN Adapter and Protocol Support at IPL time. Following is the NetBIOS information extracted from a log: + +IBM OS/2 NetBIOS 4.0 + +Adapter 0 has 32 NCBs, 32 sessions, and 32 names available to NetBIOS applications. + +NetBIOS 4.0 is loaded and operational. + +NetBIOS will log the sessions, commands, and names available to the NetBIOS API user for each adapter configured. In this example, only adapter 0 is configured. NetBIOS 4.0 will support a maximum of four adapters. A maximum of 251 application programs (processes) can use NetBIOS 4.0 simultaneously. + +
Copyright IBM Corp. 1986, 1996
+<page_number>6.4.5 - 1</page_number> + +--- + + +## Page 400 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB Reserve Field Change + +6.4.6 NCB Reserve Field Change + +The only returned field defined for the NCB_RESERVE area of the NCB is offset 6. It will contain the last Adapter Check reason code. See Appendix B, "Return Codes" for information on Adapter Check reason codes. + +
Copyright IBM Corp. 1986, 1996 +6.4.6 - 1
+ +--- + + +## Page 401 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB.STATUS Command Extension + +6.4.7 NCB.STATUS Command Extension + +The NCB.STATUS command has been extended to return the locally administered address on local status. Offset 36 of the status buffer is now defined for OS/2 for local status only. If the NCB is passed to the dynamic link interface, offset 36 is an LDT; if the NCB is passed to the device driver interface, offset 36 is a GDT. The LDT or GDT is the address of the extended status information. The locally administered address is returned in the extended status information at offset 40 through 45. If a locally administered address is not configured, the encoded address of the adapter is returned. Other areas defined in the extended status information are these: + +☐ Bytes 2 and 3 contain the latest NDIS Open Adapter return code. +☐ Bytes 4 and 5 contain the latest NDIS Ring Status status code. +☐ Bytes 6 and 7 contain the latest NDIS Adapter Check reason code. + +
Copyright IBM Corp. 1986, 1996 +6.4.7 - 1
+ +--- + + +## Page 402 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Piggybacked Acknowledgment Behavior + +6.4.8 Piggybacked Acknowledgment Behavior + +NetBIOS 4.0 will not attempt to piggyback acknowledgments if the data is received on an NCB.RECEIVE; a DATA_ACK will be sent upon receipt of the data. However, if an NCB.RECEIVE.ANY is used to receive data, the protocol will attempt to piggyback the acknowledgment. Piggybacked acknowledgment is only applicable for the NetBIOS device driver interface. Piggybacked acknowledgment is configurable. However, the configuration parameter sets piggybacking for the adapter, not the application. Therefore, use caution when changing this parameter. It will affect the performance of other NetBIOS applications. Refer to the Extended Services Communications Manager Configuration Guide, the Extended Services LAN Adapter and Protocol Support Configuration Guide, the OS/2 LAN Server Network Administrator Reference Volume 2: Performance Tuning, or the NTS/2 LAN Adapter and Protocol Support Configuration Guide for more information about the NetBIOS configuration parameters. + +
Copyright IBM Corp. 1986, 1996
+<page_number>6.4.8 - 1</page_number> + +--- + + +## Page 403 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Differences and Restrictions + +6.5 Differences and Restrictions +The following is a list of differences between the version of LAN Adapter and Protocol Support that is included in IBM Extended Services for OS/2 and IBM OS/2 LAN Server Versions 2.0 and 3.0, and the network communication software that is included in IBM OS/2 LAN Extended Edition 1.3. Many of the changes are a result of moving to NDIS-compliant network adapter drivers and protocol drivers. Some, such as support of four network adapters, are enhancements. The restrictions resulting from these changes are related to NDIS requirements and OS/2 2.0. + +☐ A protocol driver using the NDIS interface now implements all the LLC function. The LLC function is handled in the protocol driver, not on the adapter. For the Token-Ring Network adapters, the LLC function is now handled in the protocol driver. + +☐ The LAN protocol drivers will now bind to a maximum of four network adapter drivers. Therefore, adapter numbers 0 through 3 are valid parameters for the NetBIOS API and the IEEE 802.2 CCB2 and CCB3 APIs. + +☐ The NDIS interface now restricts the number of chained transmit buffers to 8. Therefore, if an attempt is made to transmit a frame that is contained in more than 8 buffers, the CCB2 and CCB3 TRANSMIT command will be returned with a return code of X'23' This return code will also be reported if the internal supply of NDIS frame descriptors is exhausted. + +☐ The NDIS interface now restricts the number of chained receive buffers to 8. Therefore, if an attempt is made to receive a frame that is larger than 8 SAP buffers, the CCB2 and CCB3 RECEIVE command will be returned with a return code of X'18'. + +☐ IBM Token-Ring and PC Network network adapter drivers now implement NDIS 2.02 to allow the protocol stack to access adapter-specific information. For network adapter drivers that do not support NDIS 2.02, the following CCB2 and CCB3 return fields are undefined: + +- DIR.INITIALIZE + - BRING_UPS + - SRAM_ADDRESS + - VIRTUAL_SRAM_ADDRESS + - VIRTUAL_MMIO_ADDRESS + +- DIR.OPEN.ADAPTER + - OPEN_ERROR_CODE + - BRING_UPS + +- DIR.STATUS + - MICROCODE_LEVEL + - ADAPTER_PARMS_ADDR + - ADAPTER_MAC_ADDR + +☐ DIR.OPEN.ADAPTER command for CCB2 and CCB3. The value returned in the parameter DATA_HOLD_BUFFERS, offset 24 of the Adapter Parms Open Parameters, is the value present in the characteristic table for the network adapter driver to which the IEEE 802.2 protocol is bound. The value returned in the parameter DHB_BUFFER_LENGTH, offset 22 of the Adapter Parms Open Parameters, minus 6 is the length of the maximum guaranteed I field. + +☐ The term data hold buffer (DHB) is only applicable when the network adapter driver is Token-Ring. + +☐ DIR.READ.LOG adapter log change. The adapter log data returned by DIR.READ.LOG is the data returned by a Read Error Log request to the network adapter driver. For IBM Token-Ring and PC Network adapters, the format is unchanged from the previous version of the IEEE 802.2 interface. If the network adapter driver does not support the Read Error Log function, the adapter log contents will be undefined. + +☐ DIR.SET.FUNCTIONAL.ADDRESS command for CCB2 and CCB3. The following applies only to network adapter drivers that do not support functional addresses, as indicated by the Service Flags parameter in the MAC Service Specific Characteristics table. For each bit to be set in the functional address, an NDIS Add Multicast Address command is issued to add a multicast address with that bit on. For each bit to be reset in the functional address, an NDIS Delete Multicast Address command is issued to delete the corresponding multicast address. If the number of bits to be in the functional address exceeds the number of available multicast addresses, the DIR.SET.FUNCTIONAL.ADDRESS command is not executed and a return code of X'1E' is posted to the CCB. + +☐ The algorithms for calculating RAM, shared RAM, and work area are new. Refer to the Extended Services Communications Manager Configuration Guide, the Extended Services LAN Adapter and Protocol Support Configuration Guide, the OS/2 LAN Server Network Administrator Reference Volume 2: Performance Tuning, or the NTS/2 LAN Adapter and Protocol Support Configuration Guide for the calculation tables. + +☐ NetBIOS provided in LAN Adapter and Protocol Support is NetBIOS Version 4.0. + +☐ A maximum of 251 application programs (processes) can use NetBIOS 4.0 simultaneously. + +☐ The only returned field defined for the NCB_RESERVE area of the NCB is offset 6. This field will contain the last Adapter Check reason code. + +☐ NCB.STATUS command. This command has been extended to return the locally administered address on local status. Offset 36 of the status buffer is now defined for local status only. If the NCB is passed to the DLL interface, offset 36 is an LDT; if the NCB is passed to the DD interface, offset 36 is a GDT. The LDT or GDT is the address of the extended status information. The locally administered address is returned in the extended status information at offset 40 through 45. If a locally administered address is not configured, the encoded address of the adapter is returned. Other areas defined in the extended status information are these: + +<page_number>6.5 - 1</page_number> + +--- + + +## Page 404 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Differences and Restrictions + +- Bytes 2 and 3 contain the latest NDIS Open Adapter return code. +- Bytes 4 and 5 contain the latest NDIS Ring Status status code. +- Bytes 6 and 7 contain the latest NDIS Adapter Check reason code. + +☐ NetBIOS 4.0 will not attempt to piggyback acknowledgments if the data is received on an NCB.RECEIVE; a DATA_ACK will be sent upon receipt of the data. However, if an NCB.RECEIVE.ANY is used to receive data, the protocol will attempt to piggyback the acknowledgment. Piggybacked acknowledgment is only applicable for the NetBIOS device driver interface. Piggybacked acknowledgment is configurable. However, the configuration parameter sets piggybacking for the adapter, not the application. Therefore, use caution when changing this parameter. It will affect the performance of other NetBIOS applications. Refer to the Extended Services Communications Manager Configuration Guide, the Extended Services LAN Adapter and Protocol Support Configuration Guide, the OS/2 LAN Server Network Administrator Reference Volume 2: Performance Tuning or the NTS/2 LAN Adapter and Protocol Support Configuration Guide for more information on NetBIOS configuration parameters. + +☐ The Adapter Status parameter table returned by the CCB2 and CCB3 DIR.STATUS command may contain all zeroes if the network adapter driver to which IEEE 802.2 is bound is not NDIS Version 2.02. + +☐ OS/2 2.0 Virtual DOS LAN Support operates only on OS/2 2.0 or higher. + +☐ OS/2 2.0 Virtual DOS LAN Support will share the adapter with other OS/2 and DOS NetBIOS or 802.2 applications. Therefore, a DOS-based NetBIOS application can experience problems if it assumes that it is the only user of the adapter. For example, NCB.STATUS will return the names in the name table of the adapter, which includes names in use for all NetBIOS applications using the adapter. The LTSVCFG configuration utility is provided to handle some inconsistencies between the DOS and OS/2 NetBIOS environment. Refer to the OS/2 LAN Server Network Administrator Reference Supplement for OS/2 2.0 or the NTS/2 LAN Adapter and Protocol Support Configuration Guide for more information about OS/2 2.0 Virtual DOS LAN Support configuration. + +☐ The Token-Ring Network 16/4 Busmaster Server Adapter/A is a DMA adapter. Due to a hardware limitation, the adapter does not access memory above a boundary of 16 MB in physical memory. Therefore, any 32-bit device driver written to the IEEE 802.2 device driver interface API or the NetBIOS device driver interface API that wants to successfully run on the Token-Ring Network 16/4 Busmaster Server Adapter/A network adapter must ensure that all memory passed to the API exists below the 16-MB boundary in physical memory. The 16-bit device driver interface applications, 16-bit dynamic link interface applications, and 32-bit dynamic link interface applications are not affected. + +☐ Memory passed to all LAN Adapter and Protocol Support interfaces must be contiguous in physical memory. OS/2 2.0 introduces a paged memory model. However, the IEEE 802.2 protocol stack and the NetBIOS 4.0 protocol stack are both 16-bit device drivers. Any memory passed to either protocol stack in the form of control blocks or buffers must be contiguous in physical memory. OS/2 2.0 ensures that the memory of a 16-bit application program is physically contiguous. See also "Programming Information--NetBIOS API" in topic 6.4, "Programming Information--IEEE 802.2 API" in topic 6.3, and the NTS/2 LAN Adapter and Protocol Support Configuration Guide. + +☐ The 3COM/Microsoft LANManager Network Driver Interface Specification Version 2.01 Final defines syntax guidelines for the PROTOCOL.INI files. The specification states that all PROTOCOL.INI keywords that contain multiple values on the right-hand side of the equals sign may be separated by commas, semicolons, or spaces. However, the LAN Adapter and Protocol Support Configuration utility included with IBM Extended Services for OS/2 and IBM OS/2 LAN Server Version 2.0 supports commas and semicolons as separators but does not support spaces as separators. + +
Copyright IBM Corp. 1986, 1996
+<page_number>6.5 - 2</page_number> + +--- + + +## Page 405 + +**LAN Technical Reference: 802.2 and NetBIOS APIs** +Message Logging Facility + +### 6.6 Message Logging Facility + +LAN Adapter and Protocol Support includes a message logging facility. This facility serializes logging of messages to a common log file, or optionally, to the screen. Service is provided for both ring + +--- + + +## Page 406 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Operating System/2 Trace Facility + +6.7 Operating System/2 Trace Facility + +The Operating System/2 System Trace functions are redefined for the NDIS-based version of the IEEE 802.2 interface. The major code for IEEE 802.2 system traces will remain 164 (0xA4). Minor codes 64 (0x40) through 81 (0x51) will be used by the NDIS-based version of the IEEE 802.2 interface. The format of the trace data for each of the minor codes is explained in "Minor Codes for IEEE 802.2 Traces" in topic 6.7.2. + +The Operating System/2 System Trace functions are redefined for NetBIOS 4.0. The major trace code for NetBIOS 4.0 is still 164 (0xA4). Minor codes defined for NetBIOS 4.0 are 96 (0x60) through 106 (0x6A) and 120 (0x78) through 123 (0x7B). The format of the trace data for each of the minor codes is explained in "Minor Codes for NetBIOS Traces" in topic 6.7.4. + +To enable the OS/2 Trace Facility, the user must specify a trace buffer in CONFIG.SYS. Add the following statement to CONFIG.SYS to specify the trace buffer: + +TRACEBUF=63 + +The information traced is controlled by the OS/2 major code trace selection and the protocol trace bit mask. The major code for LAN Adapter and Protocol Support is 164 (0xA4). Both NetBIOS and IEEE 802.2 have defined trace bit masks to select minor code information traced. + +The IEEE 802.2 tracing is controlled by the TRACE parameter in the LANDD section of the PROTOCOL.INI file. This parameter is a bitmap of flags for enabling or disabling subsets of the available trace points. The TRACE parameter consists of 10 bit flags. To enable a particular subset of traces, the bit controlling those traces is set on in the TRACE parameter. For example, to trace CCBS issued and their parameter tables and status events, set TRACE = 0x000E. The subset of traces controlled by each bit of the TRACE parameter is explained in "PROTOCOL.INI TRACE Parameter--IEEE 802.2" in topic 6.7.3 and summarized in Table 6-1 in topic 6.7.2. + +The OS2TRACEMASK parameter in the NETBEUI section of PROTOCOL.INI controls the tracing of NetBIOS minor code events. The default OS2TRACEMASK is 0x0000, which is OFF. You can use the Configuration/Installation Program to change the value of the OS2TRACEMASK parameter, or you can use an editor with caution to edit the NETBEUI section of PROTOCOL.INI. Add OS2TRACEMASK to the NETBEUI section of PROTOCOL.INI, if it does not already exist. The format is OS2TRACEMASK = 0xnnnn where nnnn is the bitmap. Enabling and disabling tracing of minor codes is controlled by bit selection in OS2TRACEMASK. The bits associated with each minor code are defined in "PROTOCOL.INI OS2TRACEMASK Parameter--NetBIOS" in topic 6.7.5 and summarized in Table 6-5 in topic 6.7.5. + +After making changes to CONFIG.SYS and PROTOCOL.INI for NetBIOS or IEEE 802.2, restart the computer. To begin tracing, type the following at the command prompt: + +TRACE ON 164 + +Subtopics +6.7.1 New Tracing Parameters for the NetBIOS and IEEE 802.2 APIs +6.7.2 Minor Codes for IEEE 802.2 Traces +6.7.3 PROTOCOL.INI TRACE Parameter--IEEE 802.2 +6.7.4 Minor Codes for NetBIOS Traces +6.7.5 PROTOCOL.INI OS2TRACEMASK Parameter--NetBIOS +6.7.6 Tracing for OS/2 2.0 Virtual DOS LAN Support + +
Copyright IBM Corp. 1986, 1996
+<page_number>6.7 - 1</page_number> + +--- + + +## Page 407 + +LAN Technical Reference: 802.2 and NetBIOS APIs +New Tracing Parameters for the NetBIOS and IEEE 802.2 APIs + +6.7.1 New Tracing Parameters for the NetBIOS and IEEE 802.2 APIs + +Two new tracing parameters, in addition to TRACE and OS2TRACEMASK, have been added to LAPS. They are TRACEOFF and TRACENAMES. + +Subtopics +6.7.1.1 TRACEOFF +6.7.1.2 TRACENAMES + +
Copyright IBM Corp. 1986, 1996 +6.7.1 - 1
+ +--- + + +## Page 408 + +LAN Technical Reference: 802.2 and NetBIOS APIs +TRACEOFF + +6.7.1.1 TRACEOFF + +This parameter is used to turn off 164 trace events automatically when a specified return code is received. Up to four return code values may be specified. This parameter eliminates the need to turn off tracing manually to prevent the trace buffer from overflowing. Appropriate trace flags must be activated in OS2TRACEMASK for NetBIOS or TRACE for 802.2. Once the TRACEOFF parameter is added to PROTOCOL.INI, the system must be restarted for the parameter to take effect. If your level of NETBEUI or LANDD.OS2 does not support the TRACEOFF parameter, contact IBM support for an updated version. + +TRACEOFF can be placed either in the NETBEUI_nif or LANDD_nif sections of the PROTOCOL.INI file. The following lines show the format of the parameter: + +TRACEOFF = 0xwwxxyyzz ; where ww, xx, yy, and zz are +; hexadecimal return code values + +The following example shows the placement and format of TRACEOFF for NetBIOS in the PROTOCOL.INI file: + +[NETBEUI_nif] +DriverName = netbeui$ +Bindings = IBMTOK_nif +... +DLCRETRIES = 5 +OS2TRACEMASK = 0x07FF +TRACEOFF = 0x18 + +Other valid formats are: + +TRACEOFF = 0x1805 ; return codes 18 or 05 stop traces +TRACEOFF = 0x0D181911 ; return codes 0D, 18, 19, or 11 stop traces + +The following example shows the placement and format of TRACEOFF for IEEE 802.2 in the PROTOCOL.INI file: + +[LANDD_nif] +DriverName = LANDD$ +... +GDTS = 0030 +TRACE = 0x003F +TRACEOFF = 0x1C + +Other valid formats are shown in the following lines: + +TRACEOFF = 0x1C57 ; return codes 1C or 57 stop traces +TRACEOFF = 0x59212732 ; return codes 59, 21, 27, or 32 stop traces + +
Copyright IBM Corp. 1986, 1996
+<page_number>6.7.1.1 - 1</page_number> + +--- + + +## Page 409 + +LAN Technical Reference: 802.2 and NetBIOS APIs +TRACENAMES + +6.7.1.2 TRACENAMES + +This parameter is used to limit tracing activity to the interaction between the local node and specified remote nodes. Before this parameter became available, tracing at the transport level picked up all frame activity on the line and, as a result, the trace buffer was quickly filled with irrelevant frame records. TRACENAMES prevents the buffer from filling up too quickly. You can use this parameter to help isolate a problem between a server and a requester on a large network, and you can use the parameter either on the server or on the requester. + +TRACENAMES limits tracing by enabling you to select the NetBIOS names of the remote workstations with which you need to trace the activity. You may specify the names either as 16-byte ASCII or 32-byte hex values. Up to four names may be selected in either format. You can use the wild card character * in the ASCII format to simplify the selection of the names or to increase the number of remote names traced if the workstations have similar names. All the names must be placed on the same line as the TRACENAMES parameter. If the length of the entries is incorrect or if the hex values used are not acceptable, an error occurs and NETBEUI will not load. + +TRACENAMES works in conjunction with the OS2TRACEMASK parameter and the TRACEOFF parameter already available for NETBEUI in NTS/2 Version 1.0 and LAN Server Version 3.0. OS2TRACEMASK must be set to the necessary non-zero values to activate any NetBIOS traces. The recommended setting for OS2TRACEMASK when using TRACENAMES is 0x07FF. NDIS frames are not filtered from the trace data if the NDIS trace flags are on. + +The TRACENAMES parameter must be inserted in the PROTOCOL.INI file using an editor because it has not yet been included in the LAPS configuration and installation tool. TRACENAMES must be placed only in the NETBEUI_nif section. The following example shows the general location and format of the parameter: + +PROTOCOL.INI (of workstation server1) + +[NETBEUI_nif] + +DriverName = netbeui$ +Bindings = IBMTOK_nif +... +... +DLCRETRIES = 5 +OS2TRACEMASK = 0x07FF +TRACENAMES= "req1" "req2" "req3" + +Some valid TRACENAMES formats are shown in the following lines: + +TRACENAMES = "72617131202020202020202020202000" "req2" +TRACENAMES = "req************" "726171312020202020202020202020" + +Tracing Specifics for TRACENAMES: Activity relevant to the remote NetBIOS names will be traced. Items traced include NCBs issued with one of the specified remote names and all session activity related to that remote name. All statuses from the lower layers are reported, whether related to the remote station or not. Frame activity between the remote and local workstations is tracked by local session number (LSN) after the session with the remote workstation is established. A maximum of 12 active sessions can be tracked. + +The NCBs found in the following list are not associated with a remote name or LSN and are not traced: + +ADD.NAME +ADD.GROUP.NAME +DELETE.NAME +CANCEL +LAN.STATUS +SESSION.STATUS +RECEIVE.BROADCAST.DATAGRAM +SEND.BROADCAST.DATAGRAM + +NCB.RESET is traced even though it is not related to sessions or to specific names. Datagrams and other UI frames are traced if they contain a remote name specified in TRACENAMES. RECEIVE.ANY commands are traced on completion if they report a session event related to a specified remote workstation. + +
Copyright IBM Corp. 1986, 1996
+<page_number>6.7.1.2 - 1</page_number> + +--- + + +## Page 410 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Minor Codes for IEEE 802.2 Traces + +6.7.2 Minor Codes for IEEE 802.2 Traces +The following minor codes are defined for IEEE 802.2: + +**0x40--CCB RECEIVED ENTRY** + +This trace entry indicates a CCB received at the CCB3 entry point. CCB2s will also be traced since they are converted to CCB3s and then sent to the CCB3 entry point. The trace data is the contents of the CCB3, except for the CCB_POINTER field. Instead of its actual contents, the CCB_POINTER field will contain the address of the CCB3. + +**0x41--CCB RECEIVED EXIT** + +This trace entry indicates the immediate return of a CCB. The trace data is the first 8 bytes of the CCB3, except that the CCB_POINTER field will be set to the address of the CCB3 and the CCB_RETURN_CODE field will be set to 0. + +**0x42, 0x43--CCB FINAL COMPLETION** + +This trace entry indicates the final completion of a CCB3. The trace data is the contents of the CCB3, except for the CCB_POINTER field. Instead of its actual contents, the CCB_POINTER field will contain the address of the CCB3. Minor code 43 is used for CCBs that are returning an information table, and code 42 is used for CCBs that are not. + +**0x44--CCB PARAMETER TABLE** + +This trace entry will follow a trace entry for minor codes 0x40, 0x41, 0x42, 0x43, and 0x50, if the CCB being traced has a parameter table. The trace data is the CCB parameter table. + +**0x45--DLC STATUS EVENT** + +Table 6-1 describes the DLC status event trace entry. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 6-1. DLC Status Event Trace Entry
OffsetByte LengthField
020DLC status table
201Adapter number
211Application ID
222Reserved
+ +This trace entry indicates a DLC status event. The trace data is the DLC status table, followed by 1 byte for the adapter number, 1 byte for the application ID, and 2 bytes of reserved data. + +**0x46--EXCEPTION EVENT** + +Table 6-2 describes the Exception event trace entry: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 6-2. Exception Event Trace Entry
OffsetByte LengthField
020Exception information table
201Adapter number
211Application ID
221Exception event type
231Reserved
+ +This trace entry indicates one of the exception events controlled by the DIR.SET.EXCEPTION.FLAGS CCB. These events are Adapter Check, Network Status, PC Error, and System Action. The trace data is the CCB3 exception event information table (padded with 0 to 20 bytes in the case of Adapter Check and System Action), followed by 1 byte for the adapter number, 1 byte for the application ID, 1 byte for the exception event type, and 1 byte of reserved data. The exception event type values are these: + +0 Adapter Check +2 Network Status +4 PC Error +6 System Action. + +**0x47--CCB INFORMATION TABLE** + +
Copyright IBM Corp. 1986, 1996
+<page_number>6.7.2 - 1</page_number> + +--- + + +## Page 411 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Minor Codes for IEEE 802.2 Traces + +This trace entry will follow a trace entry for minor code 0x43. The trace data is the CCB information table. + +**0x48, 0x49--NDIS DATA, RECEIVE** + +This trace entry indicates data received at the NDIS interface, through either a ReceiveLookahead or a ReceiveChain indication. The trace data is the received frame. The length of the trace is either the first 32 or 128 bytes of the frame, depending on the state of the Data Trace Size flag. If the indication is ReceiveLookahead, then there will be only one trace entry per frame, and it will be minor code 49. If the indication is ReceiveChain, then there will be one trace entry for every buffer in the chain, up to the number of buffers required to reach the 32- or 128-byte trace limit. The last trace entry per frame will be minor code 49 and all others, if any, will be minor code 48. + +**0x4A, 0x4B--NDIS DATA, TRANSMIT** + +This trace entry indicates data transmitted at the NDIS interface through the TransmitChain interface. The trace data is the transmitted frame. The length of the trace is either the first 32 or 128 bytes of the frame, depending on the state of the Data Trace Size flag. There will be one trace entry for every buffer in the chain, up to the number of buffers required to reach the 32- or 128-byte trace limit. The last trace entry per frame will be minor code 4B and all others, if any, will be minor code 4A. + +**0x4C, 0x4D--CCB DATA, RECEIVE** + +This trace entry indicates data received at the CCB interface, either through a Receive or a Receive_Modify CCB. The trace data is the SAP buffer contents, including buffer headers and frame data. The length of the trace is either the first 64 or 128 bytes of the SAP buffer, depending on the state of the Data Trace Size flag. There will be one trace entry for every SAP buffer in the chain, up to the number of buffers required to reach the 64- or 128-byte trace limit. The last trace entry per frame will be minor code 4D and all others, if any, will be minor code 4C. + +**0x4E, 0x4F--CCB DATA, TRANSMIT** + +This trace entry indicates data transmitted at the CCB interface through any of the Transmit CCBs. The trace data is the user-supplied transmit-frame data. The length of the trace is either the first 32 or 128 bytes of the frame, depending on the state of the Data Trace Size flag. There will be one trace entry for every buffer in the frame, up to the number of buffers required to reach the 32- or 128-byte trace limit. The last trace entry per frame will be minor code 4F and all others, if any, will be minor code 4E. + +**0x50--CCB RECEIVED FRAME EVENT** + +This trace entry indicates data received at the CCB interface, either through a Receive or a Receive_Modify CCB. The trace data is the Receive CCB3. This entry is used for only Receive CCBs that are not completed when a frame is received. If the CCB completes when the frame is received, whether due to an error or not, only the CCB completion trace entry will be logged. + +**0x51--DLR CCB RECEIVED ENTRY** + +This trace entry indicates a CCB received at the CCB2 entry point. The trace data is the CCB2. + +
Copyright IBM Corp. 1986, 1996 +6.7.2 - 2
+ +--- + + +## Page 412 + +LAN Technical Reference: 802.2 and NetBIOS APIs +PROTOCOL.INI TRACE Parameter--IEEE 802.2 + +6.7.3 PROTOCOL.INI TRACE Parameter--IEEE 802.2 + +The TRACE parameter in the LANDD section of the PROTOCOL.INI file consists of 10 bit flags. The format of this parameter for each trace event is as follows: + +**Bit 0 (0x0001)--Validation** + +Enables debugging-level CCB validation. When enabled, addressability to all buffers defined by the CCB will be verified. This verification is only considered necessary for programs under development, so it defaults to disabled to improve performance. + +**Bit 1 (0x0002)--CCBs** + +Enables tracing of CCB contents at CCB3 entry, CCB3 immediate return, and CCB3 final completion, plus CCB3 receive frame events where the Receive CCB3 does not complete. CCB2s will also be traced because when they are received they are converted to CCB3s and then sent to the CCB3 entry. + +**Bit 2 (0x0004)--CCB Parameter Tables** + +Enables tracing of the CCB parameter table contents at CCB entry, CCB final completion, and CCB receive frame events where the Receive CCB does not complete. This bit also enables the tracing of the CCB information table at CCB final completion. + +**Bit 3 (0x0008)--Status Events** + +Enables tracing of DLC Status, Adapter Check, Network Status, PC Error, and System Action events. + +**Bit 4 (0x0010)--DLL CCBs** + +Enables tracing of CCB2 contents at CCB entry. + +**Bit 5 (0x0020)--CCB Interface Received Data** + +Enables tracing of the contents of the SAP buffers containing received data. + +**Bit 6 (0x0040)--CCB Interface Transmit Data** + +Enables tracing of the contents of the transmit data supplied with a transmit CCB. + +**Bit 7 (0x0080)--Data Trace Size** + +Enables large size data traces for transmit and receive at both the CCB and NDIS interfaces. For Transmit Data traces at both the CCB and NDIS interface, the first 128 bytes of data of each frame are traced if large size is enabled. If large size is disabled, only the first 32 bytes of each frame are traced. For Receive Data traces at the NDIS interface, the first 128 bytes of data of each frame are traced if large size is enabled. If large size is disabled, only the first 32 bytes of each frame are traced. For Receive Data traces at the CCB interface, the first 128 bytes of SAP buffer contents of each frame are traced if large size is enabled. If large size is disabled, only the first 64 bytes of SAP buffer contents are traced. The SAP buffer contents will include header information in addition to the frame data. The SAP buffer contents are described in Chapter 3, "The Command Control Blocks." + +**Bit 8 (0x0100)--NDIS Interface Received Data** + +Enables tracing of the contents of the data received from the NDIS interface. This will include user-generated frames destined for the CCB interface, as well as LLC control frames such as SABME and DISC. + +**Bit 9 (0x0200)--NDIS Interface Transmit Data** + +Enables tracing of the data sent to the NDIS interface. This will include user-generated frames from the CCB interface, as well as LLC control frames such as SABME and DISC. + +Table 6-3 provides a summary of the IEEE 802.2 trace point minor codes and the TRACE parameter bit flags. + +Table 6-3. IEEE 802.2 TRACE Bit Definition + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Trace Point Minor CodesTRACE Bits
0x40 CCB RECEIVED ENTRY0 1 2 3 4 5 6 7 8 9
0x41 CCB RECEIVED EXITX
0x42 CCB FINAL COMPLETIONX
0x43 CCB FINAL COMPLETIONX
0x44 CCB PARAMETER TABLEX
+ +Copyright IBM Corp. 1986, 1996 +6.7.3 - 1 + +--- + + +## Page 413 + +LAN Technical Reference: 802.2 and NetBIOS APIs +PROTOCOL.INI TRACE Parameter–IEEE 802.2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
0x45DLC STATUS EVENTX
0x46EXCEPTION EVENTX
0x47CCB INFORMATION TABLEX
0x48NDIS DATA, RECEIVE*X
0x49NDIS DATA, RECEIVE LAST*X
0x4ANDIS DATA, TRANSMIT*X
0x4BNDIS DATA, TRANSMIT LAST*X
0x4CCCB DATA, RECEIVEX*
0x4DCCB DATA, RECEIVE LASTX*
0x4ECCB DATA, TRANSMITX*
0x4FCCB DATA, TRANSMIT LASTX*
0x50CCB RECEIVED FRAME EVENTX
0x51DLR CCB RECEIVED ENTRYX
+ +* Bit 7 determines the trace data size for all the indicated trace minor codes. If bit 7 is off, the trace data size is 32 bytes, except for CCB Receive Data, which is 64 bytes. If bit 7 is on, the trace data size is 128 bytes. + +Refer to 3Com/Microsoft LANManager Network Driver Interface Specification Version 2.01 Final for more information on ReceiveLookahead, ReceiveChain, and TransmitChain. + +
Copyright IBM Corp. 1986, 1996
+<page_number>6.7.3 - 2</page_number> + +--- + + +## Page 414 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Minor Codes for NetBIOS Traces + +6.7.4 Minor Codes for NetBIOS Traces +The following minor codes are defined for NetBIOS: + +**0x60--TRANSMIT I FRAME** + +The first 14 bytes of the trace data are the NetBIOS I-format LPDU header. The next 2 bytes contain the return code received from the network adapter driver on the TransmitChain primitive. The last 2 bytes are the adapter number. + +**0x61--TRANSMIT UI FRAME** + +The first 44 bytes of the trace data are the NetBIOS UI-frame header. The next 2 bytes contain the return code received from the network adapter driver on the TransmitChain primitive. The last 2 bytes are the adapter number. + +**0x62--TRANSMIT COMPLETE** + +The first 14 bytes of the trace data are the NetBIOS I-format LPDU header and the last 2 bytes are the adapter number. + +**0x63--RECEIVE I FRAME** + +The first 14 bytes of the trace data are the NetBIOS I-format LPDU header and the last 2 bytes are the adapter number. + +**0x64--RECEIVE UI FRAME** + +The first 44 bytes of the trace data are the NetBIOS UI-frame header and the last 2 bytes are the adapter number. + +**0x65--NETWORK STATUS** + +The first 2 bytes of the trace data are the Ring Status bit mask and the next 2 bytes are the adapter number. + +**0x66--ADAPTER CHECK** + +The first 2 bytes of the trace data are the Adapter Check reason code and the next 2 bytes are the adapter number. + +**0x67--DLC STATUS** + +Table 6-4 describes the contents of the DLC status event trace entry. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 6-4. DLC Status Event Trace Entry
OffsetByte LengthField
02Adapter number
22Reserved
42DLC status
65FRMR data
111Pad
126Reserved
+ +**0x68--NCB RECEIVED** + +This trace entry indicates the NCB was received by the NETBEUI device driver. The first 64 bytes are the NCB contents and the last 4 bytes are the NCB address. + +**0x69--NCB PENDING** + +This trace entry indicates the NCB is pending in the NETBEUI device driver. The first 64 bytes are the NCB contents and the last 4 bytes are the NCB address. + +**0x6A--NCB COMPLETE** + +This trace entry indicates the NCB is completed by the NETBEUI device driver. The first 64 bytes are the NCB contents and the last 4 bytes are the NCB address. + +**0x78, 0x79--NDIS DATA, RECEIVE** + +This trace data is the data received from the NDIS interface. This will also include LLC control frames such as SABME and DISC. The last trace entry per frame will be minor code 0x79 and all others, if any, will be minor code 0x78. + +**0x7A, 0x7B--NDIS DATA, TRANSMIT** + +This trace data is the data sent to the NDIS interface. This will also include LLC control frames such as SABME and DISC. The last trace entry per frame will be minor code 0x7B and all others, if any, will be minor code 0x7A. + +
Copyright IBM Corp. 1986, 1996
+<page_number>6.7.4 - 1</page_number> + +--- + + +## Page 415 + +LAN Technical Reference: 802.2 and NetBIOS APIs +PROTOCOL.INI OS2TRACEMASK Parameter--NetBIOS + +6.7.5 PROTOCOL.INI OS2TRACEMASK Parameter--NetBIOS + +The OS2TRACEMASK parameter in the NETBEUI section of PROTOCOL.INI consists of 16 bit flags. The format of this parameter for each minor code is as follows: + +**Bit 0 (0x0001)--Transmit I-Format LPDU** +Enables tracing of NetBIOS I-format LPDUs transmitted. + +**Bit 1 (0x0002)--Transmit UI Frame** +Enables tracing of NetBIOS UI frames transmitted. + +**Bit 2 (0x0004)--Transmit Complete** +Enables tracing of completion of NetBIOS I frames transmitted. + +**Bit 3 (0x0008)--Receive I Frame** +Enables tracing of NetBIOS I frames received. + +**Bit 4 (0x0010)--Receive UI Frame** +Enables tracing of NetBIOS UI frames received. + +**Bit 5 (0x0020)--Network Status** +Enables tracing of Network Status events. + +**Bit 6 (0x0040)--Adapter Check** +Enables tracing of Adapter Check events. + +**Bit 7 (0x0080)--DLC Status** +Enables tracing of DLC Status events. + +**Bit 8 (0x0100)--NCB Received** +Enables tracing of the NCB contents at entry to the NETBEUI device driver. + +**Bit 9 (0x0200)--NCB Pending** +Enables tracing of the NCB contents at immediate return from the NETBEUI device driver if the NCB return code is X'FF', which indicates a pending state. + +**Bit 10 (0x0400)--NCB Complete** +Enables tracing of the NCB contents at completion of the NCB in the NETBEUI device driver. + +**Bit 11 (0x0800)--NDIS Data** +Enables data traces for transmit and receive at the NDIS interface. This bit enables minor codes X'78' through X'7B'. + +**Bit 12 (0x1000)--NDIS Size** +Enables large size data traces for transmit and receive at the NDIS interface. For Transmit Data traces and for Receive Data traces, the first 128 bytes of data of each frame are traced if large size is enabled. If large size is disabled, only the first 32 bytes of each frame are traced. + +Table 6-5 provides a summary of the NetBIOS trace point minor codes and the OS2TRACEMASK parameter bit flags. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 6-5. NetBIOS OS2TRACEMASK Bit Definition
OS2TRACEMASK Bit Definitions
Trace Point Minor Codes00010203040506070809101112
0x60 TRANSMIT I FRAMEX
0x61 TRANSMIT UI FRAMEX
0x62 TRANSMIT COMPLETEX
0x63 RECEIVE I FRAMEX
+ +Copyright IBM Corp. 1986, 1996 +6.7.5 - 1 + +--- + + +## Page 416 + +LAN Technical Reference: 802.2 and NetBIOS APIs +PROTOCOL.INI OS2TRACEMASK Parameter-NetBIOS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
0x64RECEIVE UI
FRAMEX
0x65NETWORK
STATUSX
0x66ADAPTER
CHECKX
0x67DLC STATUSX
0x68NCB
RECEIVEDX
0x69NCB
PENDINGX
0x6ANCB
COMPLETEX
0x78NDISX*
RECEIVE
0x79NDISX*
RECEIVE LAST
0x7ANDISX*
TRANSMIT
0x7BNDISX*
TRANSMIT LAST
*Bit 12 determines the trace data size for all of the indicated trace minor codes. If bit 12 is off, the trace data size is 32 bytes. If bit 12 is on, the trace data size is 128 bytes.
+ +See other chapters in this manual for documentation about the following topics: + +NCB content +NetBIOS UI-frame header content and format +NetBIOS I-format LPDU header content and format +Network Status code definition +Adapter Check reason code definition +DLC Status code definition + +Refer to the 3Com/Microsoft LANManager Network Driver Interface Specification Version 2.01 Final for return code information on the TransmitChain primitive. + +
Copyright IBM Corp. 1986, 1996 +6.7.5 - 2
+ +--- + + +## Page 417 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Tracing for OS/2 2.0 Virtual DOS LAN Support + +6.7.6 Tracing for OS/2 2.0 Virtual DOS LAN Support +Major code 164 (0xA4) enables tracing for OS/2 2.0 Virtual DOS LAN Support. The minor codes 162 (0xA2), 163 (0xA3), and 164 (0xA4) are defined for OS/2 2.0 Virtual DOS LAN Support. + +Subtopics +6.7.6.1 Minor Codes for OS/2 2.0 Virtual DOS LAN Support + +
Copyright IBM Corp. 1986, 1996
+<page_number>6.7.6 - 1</page_number> + +--- + + +## Page 418 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Minor Codes for OS/2 2.0 Virtual DOS LAN Support + +6.7.6.1 Minor Codes for OS/2 2.0 Virtual DOS LAN Support +The following minor codes are defined for OS/2 2.0 Virtual DOS LAN Support: + +**0xA2--NCB ISSUED** + +This trace entry indicates that the NCB issued by DOS was received by OS/2 2.0 Virtual DOS LAN Support. The first 64 bytes are the contents of the DOS NCB. The last 4 bytes are the linear address of the DOS NCB. + +**0xA3--NCB COMPLETE** + +This trace entry indicates that the DOS NCB was completed by OS/2 2.0 Virtual DOS LAN Support. The first 64 bytes are the contents of the DOS NCB. The last 4 bytes are the linear address of the DOS NCB. + +**0xA4--NCB IMMEDIATE RETURN** + +This trace entry indicates the immediate return from interrupt 5C. The first 64 bytes are the contents of the DOS NCB. The last 4 bytes are the linear address of the DOS NCB. + +
Copyright IBM Corp. 1986, 1996 +6.7.6.1 - 1
+ +--- + + +## Page 419 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Appendix A. Valid Commands + +A.0 Appendix A. Valid Commands +The following tables show the valid commands found in control blocks. An X indicates what interfaces the command can be directed to. Some commands sent to NetBIOS can request that the adapter complete the command before allowing the application program to continue. An additional bit (high order) is included in the hexadecimal command code to request this wait for completion. + +Notes: + +1. Command codes not listed are reserved. + +2. The commands used to operate the adapter directly, without the adapter support software, are not listed here. Refer to the books in the Bill of Forms titled LAN Technical Reference: Adapter Interfaces, SBOF-6221 as shown in "Related IBM Publications" in topic PREFACE.2 for information about the commands used to operate the supported adapters at the adapter interface. + +Subtopics +A.1 DLC and Direct Interface Commands +A.2 NetBIOS Commands + +
Copyright IBM Corp. 1986, 1996 +A.0 - 1
+ +--- + + +## Page 420 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DLC and Direct Interface Commands + +A.1 DLC and Direct Interface Commands + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table A-1. DLC and Direct Interface Commands
Pseudo Command NameTopicHex CodeCCB1CCB2CCB3
BUFFER.FREE3.3.127xxx
BUFFER.GET3.3.226xxx
DIR.CLOSE.ADAPTER3.3.304xxx
DIR.CLOSE.DIRECT3.3.434xx
DIR.DEFINE.MIF.ENVIRONMENT3.3.52Bx
DIR.INITIALIZE3.3.620xxx
DIR.INTERRUPT3.3.700xxx
DIR.MODIFY.OPEN.PARMS3.3.801x
DIR.OPEN.ADAPTER3.3.903xxx
DIR.OPEN.DIRECT3.3.1035xxx
DIR.READ.LOG3.3.1108xxx
DIR.RESET.MULT.GROUP.ADDRESS3.3.1242x
DIR.RESTORE.OPEN.PARMS3.3.1302
DIR.SET.EXCEPTION.FLAGS3.3.142Dxx
DIR.SET.FUNCTIONAL.ADDRESS3.3.1507xxx
DIR.SET.GROUP.ADDRESS3.3.1606xxx
DIR.SET.MULT.GROUP.ADDRESS3.3.1741x
DIR.SET.USER.APPENDAGE3.3.182Dx
DIR.STATUS3.3.1921xxx
DIR.TIMER.CANCEL3.3.2023xxx
DIR.TIMER.CANCEL.GROUP3.3.212Cx
DIR.TIMER.SET3.3.2222xxx
DLC.CLOSE.SAP3.3.2316xxx
DLC.CLOSE.STATION3.3.241Axxx
DLC.CONNECT.STATION3.3.251Bxxx
DLC.FLOW.CONTROL3.3.261Dxxx
DLC.MODIFY3.3.271Cxxx
DLC.OPEN.SAP3.3.2815xxx
DLC.OPEN.STATION3.3.2919xxx
DLC.REALLOCATE3.3.3017xxx
DLC.RESET3.3.3114xxx
DLC.SET.THRESHOLD3.3.3233x
DLC.STATISTICS3.3.331Exxx
PDT.TRACE.OFF3.3.3425x
PDT.TRACE.ON3.3.3524
PURGE.RESOURCES3.3.3636x
READ3.3.3731xx
READ.CANCEL3.3.3832xx
+ +
Copyright IBM Corp. 1986, 1996
+<page_number>A.1 - 1</page_number> + +--- + + +## Page 421 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DLC and Direct Interface Commands + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
RECEIVE3.3.3928xxx
RECEIVE.CANCEL3.3.4029xxx
RECEIVE.MODIFY3.3.412Axx
TRANSMIT.DIR.FRAME3.3.420Axxx
TRANSMIT.I.FRAME3.3.430Bxxx
TRANSMIT.TEST.CMD3.3.4411xxx
TRANSMIT.UI.FRAME3.3.450Dxxx
TRANSMIT.XID.CMD3.3.460Exxx
TRANSMIT.XID.RESP.FINAL3.3.470Fxxx
TRANSMIT.XID.RESP.NOT.FINAL3.3.4810xxx
+ +
Copyright IBM Corp. 1986, 1996 +A.1 - 2
+ +--- + + +## Page 422 + +A.2 NetBIOS Commands + +Table A-2. NetBIOS Commands + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Pseudo Command NameTopicHex Code
No WaitWait
NCB.ADD.GROUP.NAME4.6.1B636
NCB.ADD.NAME4.6.2B030
NCB.CALL4.6.39010
NCB.CANCEL4.6.435
NCB.CHAIN.SEND4.6.59717
NCB.CHAIN.SEND.NO.ACK4.6.6F272
NCB.DELETE.NAME4.6.7B131
NCB.FIND.NAME4.6.8F878
NCB.HANG.UP4.6.99212
NCB.LAN.STATUS.ALERT4.6.10F3
NCB.LISTEN4.6.119111
NCB.RECEIVE4.6.129515
NCB.RECEIVE.ANY4.6.139616
NCB.RECEIVE.BROADCAST.DATAGRAM4.6.14A323
NCB.RECEIVE.DATAGRAM4.6.15A121
NCB.RESET4.6.1632
NCB.SEND4.6.179414
NCB.SEND.BROADCAST.DATAGRAM4.6.18A222
NCB.SEND.DATAGRAM4.6.19A020
NCB.SEND.NO.ACK4.6.20F171
NCB.SESSION.STATUS4.6.21B434
NCB.STATUS4.6.22B333
NCB.TRACE (For DOS only)4.6.23F979
NCB.UNLINK4.6.2470
+ +
Copyright IBM Corp. 1986, 1996
+<page_number>A.2 - 1</page_number> + +--- + + +## Page 423 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Appendix B. Return Codes + +B.0 Appendix B. Return Codes + +Subtopics +B.1 About This Appendix +B.2 CCB Return Codes Listed by Interface +B.3 DLC Status Codes +B.4 NCB Return Codes +B.5 Adapter Status Parameter Table +B.6 Exception Indications +B.7 Adapter Check +B.8 Token-Ring Network Adapter Check Reason Codes for All CCBs +B.9 PC Network and Ethernet Adapter Check Reason Codes for All CCBs +B.10 Network Status +B.11 Bring-Up Errors for All CCBs +B.12 Token-Ring Network Adapter Open Errors for All CCBs +B.13 PC Network and Ethernet Adapter Open Errors for All CCBs +B.14 PC System Detected Errors +B.15 System Action Exceptions for OS/2 EE 1.3 + +
Copyright IBM Corp. 1986, 1996 +B.0 - 1
+ +--- + + +## Page 424 + +LAN Technical Reference: 802.2 and NetBIOS APIs +About This Appendix + +B.1 About This Appendix + +This appendix includes: + +☐ DLC and direct interface return codes +☐ NetBIOS return codes +☐ Other reason and status codes +☐ Exception indications +☐ Formats of special returned tables. + +
Copyright IBM Corp. 1986, 1996
+<page_number>B.1 - 1</page_number> + +--- + + +## Page 425 + +LAN Technical Reference: 802.2 and NetBIOS APIs +CCB Return Codes Listed by Interface + +B.2 CCB Return Codes Listed by Interface + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CodeMeaningCCB1CCB2CCB3
00Operation completed successfullyXXX
01Invalid command codeXXX
02Duplicate command, one already outstandingXXX
03Adapter open, should be closedXXX
04Adapter closed, should be openXX
05Required parameter not providedXXX
06Option invalid or incompatibleXXX
07Command canceled, unrecoverable failureXXX
08Unauthorized access priorityXXX
09Adapter not initialized, should be initializedX
0ACommand canceled by user requestXXX
0BCommand canceled, adapter closed while command in progressXXX
0CCommand completed successfully, adapter not openX
10Adapter open, NetBIOS not operationalX
11DIR.TIMER.SET or DIR.TIMER.CANCEL errorXXX
12Available work area exceededX
13Invalid LOG.IDXXX
14Invalid shared RAM segment or sizeX
15Lost log data, inadequate buffer space, log resetXXX
16Requested buffer size exceeds pool lengthXXX
17Command invalid, NetBIOS operationalX
18Invalid buffer lengthXXX
19Inadequate buffers available for requestXXX
1AUser length too large for buffer lengthXXX
1BThe CCB_PARM_TAB pointer is invalidXXX
1CA pointer in the CCB parm table is invalidXXX
1DInvalid CCB_ADAPTER valueXXX
1EInvalid functional addressX
20Lost data on receive, no buffers availableXXX
21Lost data on receive, inadequate buffer spaceXXX
22Error on frame transmission, check TRANSMIT.FS dataXXX
23Error in frame transmit or strip processXXX
24Unauthorized MAC frameXXX
25Maximum commands exceededXXX
+ +Copyright IBM Corp. 1986, 1996 +B.2 - 1 + +--- + + +## Page 426 + +LAN Technical Reference: 802.2 and NetBIOS APIs +CCB Return Codes Listed by Interface + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
27Link not transmitting I-format LPDUs, state changed from link openedXXX
28Invalid transmit frame lengthXXX
30Inadequate receive buffers for adapter to openXXX
32Invalid NODE_ADDRESSXXX
33Invalid adapter receive buffer length definedXXX
34Invalid adapter transmit buffer length definedXXX
35Unable to set group addressesX
36Invalid group addressX
40Invalid STATION_IDXXX
41Protocol error, link in invalid state for commandXXX
42Parameter exceeded maximum allowedXXX
43Invalid SAP_VALUE or value already in useXXX
44Invalid routing information fieldXXX
45Requested group membership in non-existent group SAPXXX
46Resources not availableXXX
47SAP cannot close unless all link stations are closedXXX
48Group SAP cannot close, individual SAPs not closedXXX
49Group SAP has reached maximum membershipXXX
4ASequence error: incompatible command in progressXXX
4BStation closed without remote acknowledgmentXXX
4CSequence error, cannot close, DLC commands outstandingXXX
4DUnsuccessful link station connection attemptedXXX
4EMember SAP not found in group SAP listXXX
4FInvalid remote address, may not be a group addressXXX
50Invalid pointer in CCB_POINTER fieldX
52Invalid application program IDXXX
53Invalid application program key codeX
54Invalid System Key codeXXX
55Buffer is smaller than buffer size given on DLC.OPEN.SAPXXX
56Adapter's system process is not installedX
57Inadequate stations availableXXX
58Invalid CCB_PARAMETER_1 parameterXXX
59Inadequate queue elements to satisfy requestXXX
5AInitialization failure, cannot open adapterXXX
+ +Copyright IBM Corp. 1986, 1996 +B.2 - 2 + +--- + + +## Page 427 + +LAN Technical Reference: 802.2 and NetBIOS APIs +CCB Return Codes Listed by Interface + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
5BError detected in chained READ commandX
5CDirect stations not assigned to application programXX
5DDD interface not installedX
5ERequested adapter is not installedXX
5FChained CCBs must all be for the same adapterX
60Adapter initializing, command not acceptedXX
61Number of allowed application programs has been exceededXX
62Command canceled by system actionXX
63Direct stations not availableXX
64Invalid DDNAME parameterXX
65Inadequate GDT selectors to satisfy requestXX
67Command cancelled, CCB resources purgedX
68Application program ID not valid for interfaceXX
69Segment associated with request cannot be lockedX
FFCommand in progressXX
+ +Subtopics +B.2.1 CCB Return Codes Listed by Command +B.2.2 CCB Return Codes Cause and Action + +
Copyright IBM Corp. 1986, 1996
+<page_number>B.2 - 3</page_number> + +--- + + +## Page 428 + +LAN Technical Reference: 802.2 and NetBIOS APIs +CCB Return Codes Listed by Command + +B.2.1 CCB Return Codes Listed by Command + +Subtopics +B.2.1.1 Return Codes for CCB1 Commands +B.2.1.2 Return Codes for CCB2 Commands +B.2.1.3 Return Codes for CCB3 Commands + +
Copyright IBM Corp. 1986, 1996
+<page_number>B.2.1 - 1</page_number> + +--- + + +## Page 429 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Return Codes for CCB1 Commands + +B.2.1.1 Return Codes for CCB1 Commands + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BUFFER.FREE
00, 01, 04, 09, 1B, 1C, 1D
40
BUFFER.GET
00, 01, 04, 09, 19, 1B, 1D
40
DIR.CLOSE.ADAPTER
00, 01, 04, 05, 07, 09, 1D
DIR.DEFINE.MIF.ENVIRONMENT
00, 01, 1B, 1C
DIR.INITIALIZE
00, 01, 02, 07, 14, 1B, 1C, 1D
DIR.INTERRUPT
00, 01, 07, 09, 1D
DIR.MODIFY.OPEN.PARMS
00, 01, 02, 04, 07, 09, 16, 18, 1B, 1C, 1D
DIR.OPEN.ADAPTER
00, 01, 02, 03, 05, 07, 09, 10, 12, 16, 18, 1B, 1C, 1D, 1E
30, 32, 33, 34
DIR.READ.LOG
00, 01, 04, 07, 09, 0B, 13, 15, 1B, 1D
DIR.RESET.MULT.GROUP.ADDRESS
00, 01, 04, 07, 09, 0B, 1D
35, 36
DIR.RESTORE.OPEN.PARMS
00, 01, 04, 06, 07, 09, 1D
DIR.SET.FUNCTIONAL.ADDRESS
00, 01, 04, 07, 09, 0B, 1D, 1E
DIR.SET.GROUP.ADDRESS
00, 01, 04, 07, 09, 0B, 1D
DIR.SET.MULT.GROUP.ADDRESS
00, 01, 04, 07, 09, 0B, 1D
35, 36
DIR.SET.USER.APPENDAGE
00, 01, 04, 07, 09, 1B, 1D
DIR.STATUS
+ +Copyright IBM Corp. 1986, 1996 +B.2.1.1 - 1 + +--- + + +## Page 430 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Return Codes for CCB1 Commands + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
00, 01, 09, 0C, 1B, 1D
DIR.TIMER.CANCEL
00, 01, 09, 11, 1D
DIR.TIMER.CANCEL.GROUP
00, 01, 09, 1D
DIR.TIMER.SET
00, 01, 07, 09, 0A, 0B, 11, 1D
DLC.CLOSE.SAP
00, 01, 04, 07, 09, 0B, 1D
40, 47, 48, 4C
DLC.CLOSE.STATION
00, 01, 04, 07, 09, 0B, 1D
40, 47, 4B, 4C
DLC.CONNECT.STATION
00, 01, 02, 04, 07, 09, 0B, 1B, 1C, 1D
40, 41, 44, 4A, 4D
DLC.FLOW.CONTROL
00, 01, 04, 07, 09, 0B, 1D
40
DLC.MODIFY
00, 01, 04, 07, 08, 09, 0B, 1B, 1D
40, 42, 45, 49, 4E
DLC.OPEN.SAP
00, 01, 04, 06, 07, 08, 09, 0B, 16, 18, 1B, 1C, 1D
42, 43, 45, 46, 49
DLC.OPEN.STATION
00, 01, 04, 05, 07, 08, 09, 0B, 1B, 1C, 1D
40, 42, 43, 46, 4F
DLC.REALLOCATE
00, 01, 04, 07, 08, 1D
40
DLC.RESET
00, 01, 04, 07, 09, 0B, 1B, 1D
40
DLC.STATISTICS
00, 01, 04, 07, 09, 0B, 15, 1B, 1D
40
PDT.TRACE.ON
00, 02, 06, 0A, 1B
+ +
Copyright IBM Corp. 1986, 1996
+<page_number>B.2.1.1 - 2</page_number> + +--- + + +## Page 431 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Return Codes for CCB1 Commands + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PDT.TRACE.OFF
00
RECEIVE
00, 01, 02, 04, 07, 09, 0A, 0B, 1A, 1B, 1C, 1D, 20, 21
40
RECEIVE.CANCEL
00, 01, 04, 09, 1D
40
RECEIVE.MODIFY
00, 01, 02, 04, 07, 09, 0A, 0B, 1A, 1B, 1C, 1D, 20, 21
40
TRANSMIT.DIR.FRAME
00, 01, 04, 07, 08, 09, 0A, 0B, 1B, 1D
22, 23, 24, 25, 27, 28, 40, 41, 44, 4A
TRANSMIT.I.FRAME
00, 01, 04, 07, 08, 09, 0A, 0B, 1B, 1D
22, 23, 24, 25, 27, 28, 40, 41, 44, 4A
TRANSMIT.TEST.CMD
00, 01, 04, 07, 08, 09, 0A, 0B, 1B, 1D
22, 23, 24, 25, 27, 28, 40, 41, 44, 4A
TRANSMIT.UI.FRAME
00, 01, 04, 07, 08, 09, 0A, 0B, 1B, 1D
22, 23, 24, 25, 27, 28, 40, 41, 44, 4A
TRANSMIT.XID.CMD
00, 01, 04, 07, 08, 09, 0A, 0B, 1B, 1D
22, 23, 24, 25, 27, 28, 40, 41, 44, 4A
TRANSMIT.XID.RESP.FINAL
00, 01, 04, 07, 08, 09, 0A, 0B, 1B, 1D
22, 23, 24, 25, 27, 28, 40, 41, 44, 4A
TRANSMIT.XID.RESP.NOT.FINAL
00, 01, 04, 07, 08, 09, 0A, 0B, 1B, 1D
22, 23, 24, 25, 27, 28, 40, 41, 44, 4A
+ +
Copyright IBM Corp. 1986, 1996
+<page_number>B.2.1.1 - 3</page_number> + +--- + + +## Page 432 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Return Codes for CCB2 Commands + +B.2.1.2 Return Codes for CCB2 Commands + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BUFFER.FREE
00, 01, 04, 07, 1B, 1C, 1D
40, 50, 52, 53, 55, 56
59, 5B, 5D, 5E, 5F, 65, 68, 69
BUFFER.GET
00, 01, 04, 07, 19, 1B, 1D
40, 50, 52, 53, 56
59, 5B, 5D, 5E, 5F, 65, 68, 69
DIR.CLOSE.ADAPTER
00, 01, 04, 07, 1D
50, 52, 53, 54, 56
59, 5B, 5D, 5E, 5F, 65, 68, 69
DIR.CLOSE.DIRECT
00, 01, 04, 07, 0B, 1D
50, 52, 53, 54, 56
59, 5B, 5C, 5D, 5E, 5F, 62, 65, 68, 69
DIR.INITIALIZE
00, 01, 05, 07, 1B, 1D
50, 54, 56
59, 5D, 5E, 5F, 65, 69
DIR.INTERRUPT
00, 01, 04, 07, 0B, 1D
50, 52, 53, 56
59, 5B, 5D, 5E, 5F, 62, 65, 68, 69
DIR.OPEN.ADAPTER
00, 01, 03, 05, 06, 07, 1B, 1C, 1D
30, 32, 33, 34, 50, 56
59, 5A, 5D, 5E, 5F, 60, 61, 65, 69
DIR.OPEN.DIRECT
00, 01, 04, 05, 06, 07, 08, 0B, 16, 18, 1B, 1C, 1D
42, 50, 52, 53, 56
59, 5B, 5D, 5E, 5F, 62, 63, 65, 68, 69
DIR.READ.LOG
00, 01, 04, 05, 07, 0B, 13, 15, 1B, 1C, 1D
50, 52, 53, 54, 56
59, 5B, 5C, 5D, 5E, 5F, 62, 65, 68, 69
DIR.SET.EXCEPTION.FLAGS
00, 01, 04, 05, 07, 1B, 1D
50, 52, 53, 56
59, 5B, 5D, 5E, 5F, 65, 68, 69
DIR.SET.FUNCTIONAL.ADDRESS
+ +Copyright IBM Corp. 1986, 1996 +B.2.1.2 - 1 + +--- + + +## Page 433 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Return Codes for CCB2 Commands + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
00, 01, 04, 07, 0B, 1D
50, 52, 53, 54, 56
59, 5B, 5D, 5E, 5F, 62, 65, 68, 69
DIR.SET.GROUP.ADDRESS
00, 01, 04, 07, 0B, 1D
50, 52, 53, 54, 56
59, 5B, 5D, 5E, 5F, 62, 65, 68, 69
DIR.STATUS
00, 01, 04, 05, 07, 0C, 1B, 1D
50, 52, 53, 56
59, 5B, 5D, 5E, 5F, 65, 68, 69
DIR.TIMER.CANCEL
00, 01, 04, 07, 11, 1D
50, 52, 53, 56
59, 5B, 5D, 5E, 5F, 65, 68, 69
DIR.TIMER.CANCEL.GROUP
00, 01, 04, 07, 11, 1D
50, 52, 53, 56
59, 5B, 5D, 5E, 5F, 65, 68, 69
DIR.TIMER.SET
00, 01, 04, 07, 0A, 0B, 11, 1D
50, 52, 53, 56
59, 5B, 5D, 5E, 5F, 62, 65, 68, 69
DLC.CLOSE.SAP
00, 01, 04, 07, 0B, 1D
40, 47, 48, 4C, 50, 52, 53, 56
59, 5B, 5D, 5E, 5F, 62, 65, 68, 69
DLC.CLOSE.STATION
00, 01, 02, 04, 07, 0B, 1D
40, 4B, 4C, 50, 52, 53, 56
59, 5B, 5D, 5E, 5F, 62, 65, 68, 69
DLC.CONNECT.STATION
00, 01, 02, 04, 05, 07, 0B, 1B, 1C, 1D
40, 41, 44, 4A, 4D, 50, 52, 53, 56
59, 5B, 5D, 5E, 5F, 62, 65, 68, 69
DLC.FLOW.CONTROL
00, 01, 04, 07, 0B, 1D
40, 50, 52, 53, 56
59, 5B, 5D, 5E, 5F, 62, 65, 68, 69
DLC.MODIFY
00, 01, 04, 05, 07, 08, 0B, 1B, 1C, 1D
40, 42, 45, 49, 4E, 50, 52, 53, 56
+ +Copyright IBM Corp. 1986, 1996 +B.2.1.2 - 2 + +--- + + +## Page 434 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Return Codes for CCB2 Commands + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
59, 5B, 5D, 5E, 5F, 62, 65, 68, 69
DLC.OPEN.SAP
00, 01, 04, 05, 06, 07, 08, 0B, 16, 18, 1B, 1C, 1D
42, 43, 45, 46, 49, 50, 52, 53, 56
59, 5B, 5D, 5E, 5F, 62, 65, 68, 69
DLC.OPEN.STATION
00, 01, 04, 05, 07, 08, 0B, 1B, 1C, 1D
40, 42, 43, 46, 4F, 50, 52, 53, 56
59, 5B, 5D, 5E, 5F, 62, 65, 68, 69
DLC.REALLOCATE
00, 01, 04, 05, 07, 0B, 1B, 1C, 1D
40, 50, 52, 53, 56, 57
59, 5B, 5D, 5E, 5F, 62, 65
DLC.RESET
00, 01, 04, 07, 0B, 1D
40, 50, 52, 53, 54, 56
59, 5B, 5D, 5E, 5F, 62, 65, 68, 69
DLC.SET.THRESHOLD
00, 01, 04, 05, 07, 1B, 1D
40, 50, 52, 53, 56
59, 5B, 5D, 5E, 5F, 65, 68, 69
DLC.STATISTICS
00, 01, 04, 05, 07, 0B, 15, 1B, 1C, 1D
40, 50, 52, 53, 56
59, 5B, 5D, 5E, 5F, 62, 65, 68, 69
READ
00, 01, 04, 05, 06, 07, 0A, 0B, 1B, 1D
40, 50, 52, 53, 56
59, 5D, 5E, 5F, 62, 65, 68, 69
READ.CANCEL
00, 01, 04, 07, 1D
50, 52, 53, 56, 58
59, 5D, 5E, 5F, 65, 68, 69
RECEIVE
00, 01, 02, 04, 05, 06, 07, 0A, 0B, 1A, 1B, 1D, 20, 21
40, 50, 52, 53, 56
59, 5B, 5D, 5E, 5F, 62, 65, 68, 69
RECEIVE.CANCEL
00, 01, 04, 07, 1D
40, 50, 52, 53, 56
59, 5B, 5D, 5E, 5F, 65, 68, 69
TRANSMIT.DIR.FRAME
+ +Copyright IBM Corp. 1986, 1996 +B.2.1.2 - 3 + +--- + + +## Page 435 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Return Codes for CCB2 Commands + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
00, 01, 04, 05, 06, 07, 08, 0B, 1B, 1C, 1D, 22, 23, 24, 25, 27
28, 40, 41, 44, 4A, 50, 52, 53, 55, 56
59, 5B, 5D, 5E, 5F, 62, 65, 68, 69
TRANSMIT.I.FRAME
00, 01, 04, 05, 06, 07, 08, 0B, 1B, 1C, 1D, 22, 23, 24, 25, 27
28, 40, 41, 44, 4A, 50, 52, 53, 55, 56
59, 5B, 5D, 5E, 5F, 62, 65, 68, 69
TRANSMIT.TEST.CMD
00, 01, 04, 05, 06, 07, 08, 0B, 1B, 1C, 1D, 22, 23, 24, 25, 27
28, 40, 41, 44, 4A, 50, 52, 53, 55, 56
59, 5B, 5D, 5E, 5F, 62, 65, 68, 69
TRANSMIT.UI.FRAME
00, 01, 04, 05, 06, 07, 08, 0B, 1B, 1C, 1D, 22, 23, 24, 25, 27
28, 40, 41, 44, 4A, 50, 52, 53, 55, 56
59, 5B, 5D, 5E, 5F, 62, 65, 68, 69
TRANSMIT.XID.CMD
00, 01, 04, 05, 06, 07, 08, 0B, 1B, 1C, 1D, 22, 23, 24, 25, 27
28, 40, 41, 44, 4A, 50, 52, 53, 55, 56
59, 5B, 5D, 5E, 5F, 62, 65, 68, 69
TRANSMIT.XID.RESP.FINAL
00, 01, 04, 05, 06, 07, 08, 0B, 1B, 1C, 1D, 22, 23, 24, 25, 27
28, 40, 41, 44, 4A, 50, 52, 53, 55, 56
59, 5B, 5D, 5E, 5F, 62, 65, 68, 69
TRANSMIT.XID.RESP.NOT.FINAL
00, 01, 04, 05, 06, 07, 08, 0B, 1B, 1C, 1D, 22, 23, 24, 25, 27
28, 40, 41, 44, 4A, 50, 52, 53, 55, 56
59, 5B, 5D, 5E, 5F, 62, 65, 68, 69
+ +
Copyright IBM Corp. 1986, 1996
+<page_number>B.2.1.2 - 4</page_number> + +--- + + +## Page 436 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Return Codes for CCB3 Commands + +B.2.1.3 Return Codes for CCB3 Commands + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BUFFER.FREE
00, 01, 07, 1B, 1C, 1D
40, 52, 53, 55, 59
5E, 68
BUFFER.GET
00, 01, 05, 07, 19, 1B, 1D
40, 52, 53, 59
5E, 68
DIR.CLOSE.ADAPTER
00, 01, 07, 1D
52, 53, 54, 59
5E, 68
DIR.CLOSE.DIRECT
00, 01, 07, 0B, 1D
52, 53, 54, 59, 5C
5E, 62, 67, 68
DIR.INITIALIZE
00, 01, 05, 07, 1B, 1D
54, 59
5E
DIR.INTERRUPT
00, 01, 07, 0B, 1D
52, 53, 59
5E, 62, 67, 68
DIR.OPEN.ADAPTER
00, 01, 05, 06, 07, 1B, 1C, 1D
30, 32, 33, 34, 59, 5A
5E, 60, 61, 64
DIR.OPEN.DIRECT
00, 01, 05, 06, 07, 08, 0B, 16, 18, 1B, 1C, 1D
42, 52, 53, 59
5E, 62, 63, 67, 68
DIR.READ.LOG
00, 01, 05, 07, 0B, 13, 15, 1B, 1C, 1D
52, 53, 54, 59, 5C
5E, 62, 67, 68
DIR.SET.EXCEPTION.FLAGS
00, 01, 05, 07, 1B, 1D
52, 53, 59
5E, 68
DIR.SET.FUNCTIONAL.ADDRESS
+ +Copyright IBM Corp. 1986, 1996 +B.2.1.3 - 1 + +--- + + +## Page 437 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Return Codes for CCB3 Commands + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
00, 01, 07, 0B, 1D
52, 53, 54, 59
5E, 62, 67, 68
DIR.SET.GROUP.ADDRESS
00, 01, 07, 0B, 1D
52, 53, 54, 59
5E, 62, 67, 68
DIR.STATUS
00, 01, 05, 07, 0C, 1B, 1D
52, 53, 59
5E, 68
DIR.TIMER.CANCEL
00, 01, 07, 11, 1D
52, 53, 59
5E, 68
DIR.TIMER.CANCEL.GROUP
00, 01, 07, 11, 1D
52, 53, 59
5E, 68
DIR.TIMER.SET
00, 01, 07, 0A, 0B, 11, 1D
52, 53, 59
5E, 62, 67, 68
DLC.CLOSE.SAP
00, 01, 07, 0B, 1D
40, 47, 48, 4C, 52, 53, 59
5E, 62, 67, 68
DLC.CLOSE.STATION
00, 01, 02, 07, 0B, 1D
40, 4B, 4C, 52, 53, 59
5E, 62, 67, 68
DLC.CONNECT.STATION
00, 01, 02, 05, 07, 0B, 1B, 1C, 1D
40, 41, 44, 4A, 4D, 52, 53, 59
5E, 62, 67, 68
DLC.FLOW.CONTROL
00, 01, 07, 0B, 1D
40, 52, 53, 59
5E, 62, 67, 68
DLC.MODIFY
00, 01, 05, 07, 08, 0B, 1B, 1C, 1D
40, 42, 45, 49, 4E, 52, 53, 59
+ +Copyright IBM Corp. 1986, 1996 +B.2.1.3 - 2 + +--- + + +## Page 438 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Return Codes for CCB3 Commands + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
5E, 62, 67, 68
DLC.OPEN.SAP
00, 01, 05, 06, 07, 08, 0B, 16, 18, 1B, 1C, 1D
42, 43, 45, 46, 49, 52, 53, 59
5E, 62, 67, 68
DLC.OPEN.STATION
00, 01, 05, 07, 08, 0B, 1B, 1C, 1D
40, 42, 43, 46, 4F, 52, 53, 59
5E, 62, 67, 68
DLC.REALLOCATE
00, 01, 05, 07, 0B, 1B, 1C, 1D
40, 52, 53, 57, 59
5E, 62, 67, 68
DLC.RESET
00, 01, 07, 0B, 1D
40, 52, 53, 54, 59
5E, 62, 67, 68
DLC.STATISTICS
00, 01, 05, 07, 0B, 15, 1B, 1C, 1D
40, 52, 53, 59
5E, 62, 67, 68
PURGE.RESOURCES
00, 01, 07, 1D
52, 53, 59
5E, 68
RECEIVE
00, 01, 02, 05, 06, 07, 0A, 0B, 1A, 1B, 1D, 20, 21
40, 52, 53, 59
5E, 62, 67, 68
RECEIVE.CANCEL
00, 01, 07, 1D
40, 52, 53, 59
5E, 68
RECEIVE.MODIFY
00, 01, 02, 05, 07, 0A, 0B, 1A, 1B, 1D, 20, 21
40, 52, 53, 59
5E, 62, 65, 67, 68
TRANSMIT.DIR.FRAME
00, 01, 05, 06, 07, 08, 0B, 1B, 1C, 1D, 22, 23, 24, 25, 27, 28
40, 41, 44, 4A, 52, 53, 55, 59
5E, 62, 67, 68
TRANSMIT.I.FRAME
+ +Copyright IBM Corp. 1986, 1996 +B.2.1.3 - 3 + +--- + + +## Page 439 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Return Codes for CCB3 Commands + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
00, 01, 05, 06, 07, 08, 0B, 1B, 1C, 1D, 22, 23, 24, 25, 27, 28
40, 41, 44, 4A, 52, 53, 55, 59
5E, 62, 67, 68
TRANSMIT.TEST.CMD
00, 01, 05, 06, 07, 08, 0B, 1B, 1C, 1D, 22, 23, 24, 25, 27, 28
40, 41, 44, 4A, 52, 53, 55, 59
5E, 62, 67, 68
TRANSMIT.UI.FRAME
00, 01, 05, 06, 07, 08, 0B, 1B, 1C, 1D, 22, 23, 24, 25, 27, 28
40, 41, 44, 4A, 52, 53, 55, 59
5E, 62, 67, 68
TRANSMIT.XID.CMD
00, 01, 05, 06, 07, 08, 0B, 1B, 1C, 1D, 22, 23, 24, 25, 27, 28
40, 41, 44, 4A, 52, 53, 55, 59
5E, 62, 67, 68
TRANSMIT.XID.RESP.FINAL
00, 01, 05, 06, 07, 08, 0B, 1B, 1C, 1D, 22, 23, 24, 25, 27, 28
40, 41, 44, 4A, 52, 53, 55, 59
5E, 62, 67, 68
TRANSMIT.XID.RESP.NOT.FINAL
00, 01, 05, 06, 07, 08, 0B, 1B, 1C, 1D, 22, 23, 24, 25, 27, 28
40, 41, 44, 4A, 52, 53, 55, 59
5E, 62, 67, 68
+ +
Copyright IBM Corp. 1986, 1996
+<page_number>B.2.1.3 - 4</page_number> + +--- + + +## Page 440 + +LAN Technical Reference: 802.2 and NetBIOS APIs +CCB Return Codes Cause and Action + +B.2.2 CCB Return Codes Cause and Action + +Hex 00 +Explanation: Operation was completed successfully. + +Hex 01 +Explanation: Invalid command code. +Cause: CCB_COMMAND did not contain a recognized command code. +Action: Try again, using a valid command. + +Hex 02 +Explanation: Duplicate command--one is already pending. +Cause: Only one command of this type can be pending at one time. +Action: Wait for the previously issued command to be completed. + +Hex 03 +Explanation: Adapter open--it should be closed. +Cause: This command can be issued only when the adapter is not open. +Action: Close the adapter or issue the correct command. +Note: For an exception to the above, see the DIR.OPEN.ADAPTER command on topic 3.3.9. + +Hex 04 +Explanation: Adapter closed--it should be open. +Cause: This command can be issued only when the adapter is open. +Action: Open the adapter. + +Hex 05 +Explanation: Required parameters not provided. +Cause: At least one required parameter for which no default is available is coded as zero. +Action: Correct the value and try again. + +Hex 06 +Explanation: Options invalid or incompatible. +Cause: The options selected are not a valid combination. For example, this return code can occur if an attempt is made to open a SAP if that SAP has an XID command handling option different from that of the GSAP it is associated with. In that case, the command will have been completed up to the point where the failing item in the GSAP list was encountered. Otherwise, no action will have been taken for the command. +Action: Correct the options and try again, or issue a DLC.MODIFY command for the remaining GSAP list members. + +Hex 07 +Explanation: Command canceled--unrecoverable failure. +Cause: The adapter has been closed because of an error condition. +Action: Analyze the error indications. If the error is not permanent, issue the commands DIR.INITIALIZE (for DOS) and DIR.OPEN.ADAPTER (for DOS and OS/2). + +Hex 08 +Explanation: Unauthorized access priority. +Cause: The requested access priority has not been authorized. +Action: Lower the priority specified with either the OPTIONS_PRIORITY or the ACCESS_PRIORITY value and reissue the command. + +
Copyright IBM Corp. 1986, 1996
+<page_number>B.2.2 - 1</page_number> + +--- + + +## Page 441 + +LAN Technical Reference: 802.2 and NetBIOS APIs +CCB Return Codes Cause and Action + +--- + +**Hex 09** + +**Explanation:** Adapter not initialized--it should be initialized. + +**Cause:** This command can be completed only if the adapter is initialized. + +**Action:** Issue the DIR.INITIALIZE command. + +--- + +**Hex 0A** + +**Explanation:** Command canceled by user request. + +**Cause:** This is the expected response when a command is canceled by an application program command. + +**Action:** None. + +--- + +**Hex 0B** + +**Explanation:** Command canceled--the adapter closed while a command was in progress. + +**Cause:** A DIR.CLOSE.ADAPTER command was issued while this command was in progress. + +**Action:** As appropriate for the application program. + +--- + +**Hex 0C** + +**Explanation:** Command was completed successfully--adapter not open. + +**Cause:** Information only. The command may execute even though the adapter is not open. + +**Action:** None. + +--- + +**Hex 10** + +**Explanation:** Adapter open--NetBIOS not operational. + +**Cause:** One of the following: +* The DIR.OPEN.ADAPTER command was passed NetBIOS parameters and NetBIOS code is not loaded. +* One or more NetBIOS parameters in the DIR.OPEN.ADAPTER command was incorrect. + +**Note:** This can occur if the NCB_MAX_NAMES or NCB_MAX_SESSIONS values are not less than 255, or if there is insufficient work space available to satisfy the values of NCB_STATIONS, NCB_MAX_NAMES, NCB_MAX, and NCB_MAX_SESSIONS. + +**Action:** +* To continue without NetBIOS, do nothing. The adapter is open. +* To use NetBIOS, close the adapter, make appropriate changes, and reissue the DIR.OPEN.ADAPTER command. + +--- + +**Hex 11** + +**Explanation:** DIR.TIMER.SET or DIR.TIMER.CANCEL error. + +**If DIR.TIMER.SET:** + +**Cause:** The TIMER_VALUE is not in the 0 to 13107 range. + +**Action:** Set a valid value and try again. + +**If DIR.TIMER.CANCEL:** + +**Cause:** The DIR.TIMER.SET command to be canceled was not found. + +**Action:** None. + +--- + +**Hex 12** + +**Explanation:** Available work area exceeded. + +**Cause:** Requested parameters exceeded allotted memory. Either the adapter support software work area or the work area provided by the application program is not adequate. + +**Action:** Reduce MAX.STATION or MAX.SAP values or increase memory to the value returned in parameter DLC.WORK.LEN.ACT. + +--- + +Copyright IBM Corp. 1986, 1996 +B.2.2 - 2 + +--- + + +## Page 442 + +LAN Technical Reference: 802.2 and NetBIOS APIs +CCB Return Codes Cause and Action + +**Hex 13** + +**Explanation:** Invalid LOG.ID. + +**Cause:** The requested LOG.ID is not defined. + +**Action:** Adjust the value accordingly. + +--- + +**Hex 14** + +**Explanation:** Invalid shared RAM segment or size. + +**Cause:** The value is not an allowable value. + +**Action:** Adjust the value accordingly. + +--- + +**Hex 15** + +**Explanation:** Lost log data, inadequate buffer space; log reset. + +**Cause:** The buffer pointed to by DIR.READ.LOG or DLC.STATISTICS was too short to continue the entire log contents. The information that could not be placed in the buffer was lost if the command indicated "reset." + +**Action:** The next time the command is issued, increase the size of the buffer. + +--- + +**Hex 16** + +**Explanation:** Requested buffer size exceeds pool length. + +**Cause:** The buffer pool is not large enough to hold one buffer. + +**Action:** Issue the command with either smaller buffers or larger pool. + +--- + +**Hex 17** + +**Explanation:** Command invalid--NetBIOS operational. + +**Cause:** The command being issued would cause a change to NetBIOS parameters that are currently operational. + +**Action:** To issue the command, the adapter must be closed and then re-opened, either without NetBIOS, or with NetBIOS parameters that avoid the conflict. + +--- + +**Hex 18** + +**Explanation:** Invalid SAP buffer length. + +**Cause:** The specified buffer size must be at least 80 bytes and a multiple of 16. + +**Action:** Specify the buffer size accordingly. + +--- + +**Hex 19** + +**Explanation:** Inadequate buffers available for request. + +**Cause:** A request was made for more buffers than were available. + +**Action:** Either issue the command requesting fewer buffers, or wait until more buffers become available and try again. + +--- + +**Hex 1A** + +**Explanation:** USER_LENGTH value too large for buffer length. + +**Cause:** The user requested area is too large. + +**Action:** Reduce the user space specified by the USER_LENGTH field. + +--- + +**Hex 1B** + +**Explanation:** The CCB_PARM_TAB pointer is invalid. + +**Cause:** The CCB_PARM_TAB field value is either pointing into the workstation interrupt vector area or the offset is too near the end of the segment and wrap-around will occur on some of the fields. + +**Action:** Reissue the command with the CCB_PARM_TAB field corrected. + +--- + +Copyright IBM Corp. 1986, 1996 +B.2.2 - 3 + +--- + + +## Page 443 + +LAN Technical Reference: 802.2 and NetBIOS APIs +CCB Return Codes Cause and Action + +**Hex 1C** + +**Explanation:** A pointer in the CCB parameter table is invalid. + +**Cause:** A pointer value in the CCB parameter table is either pointing into the workstation interrupt vector area, or the offset is too near the end of the segment and wrap-around will occur on some of the fields. + +**Action:** Reissue the command with the CCB_PARM_TAB field corrected. + +--- + +**Hex 1D** + +**Explanation:** Invalid CCB_ADAPTER value. + +**Cause:** The value is outside the prescribed range. + +**Action:** Set an acceptable value. + +--- + +**Hex 1E** + +**Explanation:** Invalid functional address. + +**Cause:** The number of bits set for the functional address exceeds the number of available multicast addresses. + +**Action:** Reduce the number of bits that are set on in the functional address. + +--- + +**Hex 20** + +**Explanation:** Lost data on receive; no buffers available. + +**Cause:** There were no available buffers in the SAP's buffer pool. The frame was lost. This return code will not occur if the frame was an I-format LPDU. + +**Action:** Free some buffers via BUFFER.FREE, and reissue the RECEIVE command. + +--- + +**Hex 21** + +**Explanation:** Lost data on receive; inadequate buffer space. + +**Cause:** There was inadequate buffer space in the SAP's buffer pool to contain the entire frame. As much of the frame as possible was placed into receive buffers. The remainder of the message was lost. This return code will not occur if the frame was an I-format LPDU. + +**Action:** Free some buffers with BUFFER.FREE and reissue the receive command. + +--- + +**Hex 22** + +**Explanation:** Error on frame transmission--check TRANSMIT_FS data. + +**Cause:** The frame may or may not have been received by the destination adapter, as indicated by the FS byte. + +**Action:** As appropriate for the application program. + +--- + +**Hex 23** + +**Explanation:** Error in frame transmit or read-back checking. + +**Cause:** An error was detected either during the frame transmission or when the frame was read back and checked. + +For CCB1, when using NDIS adapters, this code is returned if the frame is contained in more buffers than are supported by the NDIS MAC driver. Up to eight buffers are always available. + +**Action:** As appropriate for the application program. For CCB1, when using NDIS adapters, see the maximum number of data blocks defined by the NDIS MAC driver for your adapter to determine how many buffers are supported. + +--- + +**Hex 24** + +**Explanation:** Unauthorized MAC frame. + +**Cause:** Possible causes: +* The adapter is not authorized to send a MAC frame with the specified source class. +* The source class was zero. +* An attempt has been made to transmit a MAC frame via a SAP. +* An attempt has been made to transmit a MAC frame on the PC Network or an Ethernet network. + +
Copyright IBM Corp. 1986, 1996
+<page_number>B.2.2 - 4</page_number> + +--- + + +## Page 444 + +LAN Technical Reference: 802.2 and NetBIOS APIs +CCB Return Codes Cause and Action + +Action: Adjust the value and try again. + +Hex 25 + +Explanation: Maximum number of commands was exceeded. + +Cause: The maximum number of transmit commands that can be pending for a given station at any time (128) has been exceeded. + +Action: Issue the transmit command at some later time. + +Hex 27 + +Explanation: Link not transmitting I-format LPDUs--state changed from link opened. + +Cause: This return code will be set in a transmit CCB whenever the link station leaves link-opened state because of a received frame (for instance, DISC), or because of a timeout. It will not be set if the link leaves link-opened state because of receipt of a CCB (for instance, DLC.CLOSE.STATION). + +Action: The LINK STATION can be closed with the DLC.CLOSE.STATION command, or an attempt can be made to reestablish the connection with the DLC.CONNECT.STATION command. If the remote station is on a different ring, a different route may be required in order to reestablish the link. + +Hex 28 + +Explanation: Invalid transmit frame length. + +Cause: The frame length, as specified, is either too short to contain sufficient header information, or too long for the adapter's transmit buffer. If the transmit was for a link station, it has entered the disconnected state. + +Action: Make sure that the transmit frames are no longer than the maximum transmit length, as defined by DIR.OPEN.ADAPTER. + +Hex 30 + +Explanation: Inadequate receive buffers for adapter to open. + +Cause: The requested DIR.OPEN.ADAPTER parameters have not allowed adequate receive buffer space. + +Action: Reduce the buffer space by reconfiguring with either the configuration aid (OS/2) or the DIR.OPEN.ADAPTER command (DOS). Resources that may be reduced first to free larger amounts of buffer space are data hold buffers (if more than one is specified) and the number of queue elements. In addition, you can reduce the number of receive buffers if doing so does not affect the expected performance level. + +If you are using the DOS NDIS protocol driver DXME0MOD.SYS, from the LAN Support Program, you should increase the work space. + +Hex 32 + +Explanation: Invalid NODE_ADDRESS. + +Cause: The defined node address is invalid. + +Action: Adjust the value accordingly. Refer to IBM Token-Ring Network Architecture Reference for node address restrictions. + +Hex 33 + +Explanation: Invalid adapter receive buffer length defined. + +Cause: The value is either greater than the allowable maximum, less than the allowable minimum, or not a multiple of 8. + +Action: Adjust the value accordingly. + +Hex 34 + +Explanation: Invalid adapter transmit buffer length defined. + +Cause: The value is either greater than the allowable maximum, less than the allowable minimum, or not a multiple of 8. + +Action: Adjust the value accordingly. + +Hex 35 + +Explanation: Unable to set group addresses. + +Cause: Two causes are possible, as follows: + +1. The number of group addresses exceeds the number supported by the LAN Support Program. + +
Copyright IBM Corp. 1986, 1996
+
B.2.2 - 5
+ +--- + + +## Page 445 + +LAN Technical Reference: 802.2 and NetBIOS APIs +CCB Return Codes Cause and Action + +2. The number of group addresses exceeds the number of addresses supported by the adapter. + +**Action:** Adjust the value accordingly. See the DIR.STATUS command for information about obtaining the list of multiple group addresses and the DIR.SET.MULT.GROUP.ADDRESS command for information about the number of group addresses supported by the LAN Support Program. + +--- + +**Hex 36** + +**Explanation:** Invalid group address. + +**Cause:** Three causes are possible, as follows: +1. The I/G bit is not set in the adapter. +2. The adapter finds the address value incorrect. +3. An incorrect attempt was made to set the all-stations broadcast address. + +**Action:** Check the I/G bit to make sure it is set on to specify that this is a group address. Verify the group address to make sure it is correct. See the DIR.STATUS command for information on how to obtain the list of multiple group addresses. + +--- + +**Hex 40** + +**Explanation:** Invalid STATION_ID. + +**Cause:** Either the requested station ID does not exist, or the command code is invalid for the station type. + +**Action:** Make the appropriate changes and reissue the command. + +--- + +**Hex 41** + +**Explanation:** Protocol error; link is in an invalid state for command. + +**Cause:** The requested command cannot be accepted because of the existing primary link state of the link station. A DLC.CONNECT.STATION command will not be accepted if the link is in the disconnected or closed state. A transmit command will not be accepted if the link is in any state other than opened. + +**Action:** According to the situation. + +--- + +**Hex 42** + +**Explanation:** Parameter exceeded maximum allowed. + +**Cause:** One of the parameter values is greater than acceptable. + +**Action:** Use an acceptable value. + +--- + +**Hex 43** + +**Explanation:** Invalid SAP_VALUE or value already in use. + +**Cause:** For a DLC.OPEN.SAP command, this return code indicates that the SAP_VALUE has already been used or the specified SAP is the null or global SAP. + +For a DLC.OPEN.STATION command, this return code indicates that this SAP already has a link to the specified RSAP_VALUE and DESTINATION_ADDR combination, or that the remote SAP specified was the null SAP, global SAP, or a group SAP. + +**Action:** Use an acceptable value. (Do not use X'00'.) + +--- + +**Hex 44** + +**Explanation:** Invalid routing field length. + +**Cause:** The indicated routing field is either too short, greater than 18 bytes long, or is an odd number of bytes long. + +**Action:** Set the length field to a correct value. + +--- + +**Hex 45** + +**Explanation:** Requested group membership in non-existent group SAP. + +**Cause:** Membership has been requested in a group SAP that is not open. + +**Note:** The command has been completed up to the point at which the adapter encountered the error. Other parameters have been + +
Copyright IBM Corp. 1986, 1996
+
B.2.2 - 6
+ +--- + + +## Page 446 + +LAN Technical Reference: 802.2 and NetBIOS APIs +CCB Return Codes Cause and Action + +changed if the command was DLC.MODIFY. However, the SAP has not been added as a member to a group SAP. + +**Action:** Either change the group SAP value to a group SAP that has been opened or open the group SAP before requesting its membership. + +--- + +**Hex 46** + +**Explanation:** Inadequate number of link stations. + +**Cause:** +* DLC.OPEN.SAP: There are inadequate link stations or SAPs available to satisfy the open. +* DLC.OPEN.STATION: All link stations assigned to this SAP are in use. + +**Action:** +* DLC.OPEN.SAP: Close other SAPs, reduce the number of link stations being requested for the SAP, or wait for these resources to be freed. +* DLC.OPEN.STATION: Close other link stations for the SAP, reallocate some link stations using the DLC.REALLOCATE command, close the SAP and reserve additional link stations, or wait for these resources to be freed. + +--- + +**Hex 47** + +**Explanation:** The SAP cannot close unless all link stations are closed. + +**Cause:** At least one link station is open for this SAP. + +**Action:** Close all link stations and try again. + +**Note:** If an error code 47 results when a DLC.CLOSE.SAP command closely follows a DLC.CLOSE.STATION command for the last open station for that SAP, reissue the DLC.CLOSE.SAP command. + +--- + +**Hex 48** + +**Explanation:** Group SAP cannot close--all member SAPs are not closed. + +**Cause:** At least one individual member SAP of this group SAP is open. + +**Action:** Delete all SAPs in the group using the DLC.MODIFY command and try again. + +--- + +**Hex 49** + +**Explanation:** The group SAP has reached maximum membership. + +**Cause:** See Explanation. + +**Note:** The command has completed the operation up to the point at which the adapter encountered the error. Other parameters have been changed if the command was DLC.MODIFY. + +**Action:** According to the application program. + +--- + +**Hex 4A** + +**Explanation:** Sequence error; incompatible command in progress. + +**Cause:** The station is in the process of closing or establishing a connection. + +**Action:** Await completion or issue a DLC.RESET command. + +--- + +**Hex 4B** + +**Explanation:** Station closed without remote acknowledgment. + +**Cause:** The adapter issued a DISC command to the remote station as a result of receiving a DLC.CLOSE.STATION SRB. No acknowledgment has been received from the remote adapter, and the link station has been closed. + +**Action:** According to the application program. + +--- + +**Hex 4C** + +**Explanation:** Sequence error; cannot close while commands are pending. + +
Copyright IBM Corp. 1986, 1996
+<page_number>B.2.2 - 7</page_number> + +--- + + +## Page 447 + +LAN Technical Reference: 802.2 and NetBIOS APIs +CCB Return Codes Cause and Action + +**Cause:** Commands are in process. This prevents closing the SAP or link station. + +**Action:** Wait until all pending commands are complete, or issue a reset. + +--- + +**Hex 4D** + +**Explanation:** Unsuccessful link station connection attempt. + +**Cause:** The DLC.CONNECT.STATION command could not establish a requested connection. + +**Action:** Determine the cause for the failure (for example, verify RSAP values, routing information, MAC address, and connection between the two workstations) and try again when the problem is resolved. + +--- + +**Hex 4E** + +**Explanation:** Member SAP not found in group SAP list. + +**Note:** The command has completed the operation up to the point at which the adapter encountered the error. Other parameters have been changed if the command was DLC.MODIFY. + +**Cause:** A request was issued to delete an individual member SAP from a group SAP. The SAP was not found to be assigned to the group. + +**Action:** Verify the SAP value. + +--- + +**Hex 4F** + +**Explanation:** Invalid remote address; cannot be a group address. + +**Cause:** The remote address parameter has the high bit of the high byte set to 1, which indicates a group address. A group address is not allowed to be specified for this command. + +**Action:** Correct the remote address, and reissue the command. + +--- + +**Hex 50** + +**Explanation:** Invalid pointer in the CCB_POINTER field. + +**Cause:** See Explanation. + +**Action:** Check to ensure that all 4-byte pointers in the CCB's pointer field are accessible to the OS/2 process issuing the command. + +--- + +**Hex 52** + +**Explanation:** Invalid application program ID. + +**Cause:** See Explanation. + +**Action:** Use the CCB_APPL_ID field returned on the DIR.OPEN.ADAPTER command. + +--- + +**Hex 53** + +**Explanation:** Invalid application program key code. + +**Cause:** See Explanation. + +**Action:** Use the CCB_APPL_KEY field provided on the DIR.OPEN.ADAPTER command. + +--- + +**Hex 54** + +**Explanation:** Invalid System Key code. + +**Cause:** See Explanation. + +**Action:** Use the System Key code as defined by the configuration parameters. + +--- + +**Hex 55** + +**Explanation:** Buffer is smaller than buffer size given on the DIR.OPEN.SAP command. + +**Cause:** See Explanation. + +**Action:** Increase the size of the buffer being used to at least that of the buffers in the SAP buffer pool. + +--- + +**Hex 56** + +
Copyright IBM Corp. 1986, 1996
+<page_number>B.2.2 - 8</page_number> + +--- + + +## Page 448 + +LAN Technical Reference: 802.2 and NetBIOS APIs +CCB Return Codes Cause and Action + +**Explanation:** The adapter's system process is not installed. + +**Cause:** See Explanation. + +**Action:** Load the adapter support software's system process. Insert the DETACH command into the STARTUP.BAT file and specify the system process load module name. + +--- + +**Hex 57** + +**Explanation:** Not enough stations are available. + +**Cause:** Command has completed the operation; however, only a portion of the stations requested have been reserved. No more stations are available for reservation. + +**Action:** None. + +--- + +**Hex 58** + +**Explanation:** Invalid CCB_PARAMETER_1. + +**Cause:** See Explanation. + +**Action:** Adjust the parameter defined in the CCB_PARAMETER_1 field, and reissue the command. + +--- + +**Hex 59** + +**Explanation:** Inadequate number of queue elements to satisfy request. + +**Cause:** See Explanation. + +**Action:** On a short-term basis, wait for other requests to complete. Otherwise, increase queue elements using the configuration aid. + +--- + +**Hex 5A** + +**Explanation:** Initialization failure; cannot open the adapter. + +**Cause:** See Explanation. + +**Action:** Check Bring-up error code for details of initialization failure. + +--- + +**Hex 5B** + +**Explanation:** Error detected in chained READ command. + +**Cause:** Bad return code given on a chained READ command. + +**Action:** Correct READ command problem, and reissue the command. + +--- + +**Hex 5C** + +**Explanation:** Direct stations are not assigned to this application program. + +**Cause:** The invoking application program must request ownership of direct stations before issuing any requests involving the direct stations. + +**Action:** Issue a DIR.OPEN.DIRECT command to gain ownership of the direct stations. + +--- + +**Hex 5D** + +**Explanation:** The DD interface is not installed. + +**Cause:** See Explanation. + +**Action:** Insert the DEVICE command into the CONFIG.SYS file and specify the device driver load module name. + +--- + +**Hex 5E** + +**Explanation:** The requested adapter is not installed. + +**Cause:** See Explanation. + +**Action:** Install the adapter into the system. Check that the adapter is configured correctly for the primary or alternate adapter. + +--- + +**Hex 5F** + +
Copyright IBM Corp. 1986, 1996
+<page_number>B.2.2 - 9</page_number> + +--- + + +## Page 449 + +LAN Technical Reference: 802.2 and NetBIOS APIs +CCB Return Codes Cause and Action + +**Explanation:** Chained commands must all be for the same adapter. + +**Cause:** See Explanation. + +**Action:** Only chain multiple command requests that are for the same adapter. Do not mix primary and alternate adapter requests. + +--- + +**Hex 60** + +**Explanation:** Adapter initializing; command not accepted. + +**Cause:** See Explanation. + +**Action:** Reissue the DIR.OPEN.ADAPTER command until the command is completed successfully. + +--- + +**Hex 61** + +**Explanation:** The number of allowed application programs has been exceeded. + +**Cause:** See Explanation. + +**Action:** On a short-term basis, terminate one of the application programs using the adapter support software. Otherwise, adjust the configuration parameter MAX_USERS. + +--- + +**Hex 62** + +**Explanation:** Command canceled; system action. + +**Cause:** The system administrator has issued a command using the System Key. + +**Action:** Re-establish session with the adapter support software if necessary. + +--- + +**Hex 63** + +**Explanation:** Direct stations are not available. + +**Cause:** Direct stations have already been assigned. + +**Action:** The application program owning the direct stations must issue the DIR.OPEN.DIRECT command to relinquish ownership of direct stations in order for the command to be completed successfully. + +--- + +**Hex 64** + +**Explanation:** Invalid DDNAME parameter. + +**Cause:** Either the device driver name given was invalid or the device driver did not provide the proper interdevice driver communication information in its device driver header. + +**Action:** Make sure the device driver is loaded and has a valid header. + +--- + +**Hex 65** + +**Explanation:** Not enough GDT selectors to satisfy request. + +**Cause:** The number of GDT selectors defined during configuration is not adequate to support the number of control blocks and buffers passed to the adapter support software. + +**Action:** Increase the number of GDT selectors when configuring the adapter support software using the configuration aid. + +--- + +**Hex 67** + +**Explanation:** Command canceled; CCB resources purged. + +**Cause:** The command has been canceled as a result of the PURGE.RESOURCES command. + +**Action:** None. + +--- + +**Hex 68** + +**Explanation:** The application program ID is not valid. + +**Cause:** The application program ID provided was not obtained from the interface used for the command request. + +**Action:** The application program ID can only be used at the interface where it was obtained. Use the other interface (for example, DLR interface or DD interface). + +
Copyright IBM Corp. 1986, 1996
+
B.2.2 - 10
+ +--- + + +## Page 450 + +LAN Technical Reference: 802.2 and NetBIOS APIs +CCB Return Codes Cause and Action + +Hex 69 + +**Explanation:** The segment associated with the request cannot be locked. + +**Cause:** Too many processes are running concurrently and the system has run out of resources. The segment cannot be locked. + +**Action:** Reduce the number of OS/2 processes (the overall number of different segments controlled by the adapter support software), or wait until the resources are available. Memory references passed to the application program that contain control blocks accessed when the adapter support software processes an adapter interrupt (for example, CCBs and buffers in the SAP buffer pool) are locked so they are not moved or swapped by OS/2. By canceling processes using the application program or reducing the number of control blocks passed to the application program, more memory will be available for other requests that require their control blocks locked. Adding memory to your system may also alleviate this problem. + +Hex FF + +**Explanation:** Command in process. + +**Cause:** See Explanation. + +**Action:** None. + +
Copyright IBM Corp. 1986, 1996 +B.2.2 - 11
+ +--- + + +## Page 451 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DLC Status Codes + +B.3 DLC Status Codes + +**For CCB1:** Certain conditions detected by the DLC function are reported to a DLC status appendage. DLC status codes are presented to the appendage in the AX register. The CX register contains the adapter number (0 or 1). Register SI contains a user value as defined in the USER_STAT_VALUE parameter of the DLC.OPEN.SAP command. Registers ES and BX point to the DLC status table that contains additional data for certain status codes. See "Appendages" in topic 2.3.2.1 for more information about providing an appendage to use these codes. + +**For CCB2:** Certain conditions that occur in the DLC function are returned in the READ command for DLC status change events. The format of the DLC status table in the READ command's CCB is shown in Table B-2 in topic B.3.1. This table starts at offset 10 in the READ command's parameter table. + +**For CCB3:** Certain conditions that arise in the DLC function of the adapter (for Token-Ring Network) or the DLC function of the adapter support software in the workstation (for PC Network) are reported to a DLC status appendage. DLC status codes are presented to the appendage in the AX register. the CX register contains the adapter number (0 or 1). Register SI contains a user value as defined in the USER_STAT_VALUE parameter of the DLC.OPEN.SAP command. Registers ES and BX point to the DLC status table that contains additional data for certain status codes. See "Appendages" in topic 2.3.2.1 for more information about providing an appendage to use these codes. + +The DI register contains the offset of the DLC appendage. The DS register contains the application program's device driver protect mode data segment. An invocation code of X'0001' has been pushed onto the stack. Before returning to the adapter support software, the application program must remove the invocation code from the stack. + +Subtopics +B.3.1 DLC Status Table +B.3.2 DLC Status Codes +B.3.3 Suggested Actions in Response to DLC Status + +
Copyright IBM Corp. 1986, 1996
+<page_number>B.3 - 1</page_number> + +--- + + +## Page 452 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DLC Status Table + +B.3.1 DLC Status Table + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table B-2. DLC Status Table
OffsetParameter NameByte Length8086 TypeDescription
0STATION_ID2DWStation ID.
2DLC_STATUS_CODE2DWDLC status code.
4FRMR_DATA5DBFive bytes of reason code that are applicable when an FRMR is either transmitted or received.
9ACCESS_PRIORITY1DBThe new access priority that is applicable when status bit 5 is on. The format is B'nnn00000' where "nnn" is the access priority. This byte is not used and is set to zero when used on the PC Network or on Ethernet.
10REMOTE_NODE6DBThe 6-byte remote node value of a newly opened link station. Applicable when status bit 10 is on.
16REMOTE_SAP1DBThe 1-byte remote SAP value of a newly opened link station. Applicable when status bit 10 is on.
For CCB2 and CCB3:
171DBReserved.
18USER_STAT_VALUE2DWUser value as defined in the DLC.OPEN.SAP command.
+ +
Copyright IBM Corp. 1986, 1996
+<page_number>B.3.1 - 1</page_number> + +--- + + +## Page 453 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DLC Status Codes + +B.3.2 DLC Status Codes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BitFunctionAdditional Data
15Link lost
14DM or DISC received, or DISC acknowledged
13FRMR receivedFive bytes of reason code data are contained in the area pointed to by the address in the ES:BX register (FRMR_DATA).
12FRMR sentFive bytes of reason code data are contained in the area pointed to by the address in the ES:BX register (FRMR_DATA).
11SABME received for an open link station
10SABME received, link station openedA new link station has been opened by the adapter. A DLC.OPEN.STATION command should NOT be issued for that link station. A DLC.CONNECT.STATION command must be issued to accept the SABME or a DLC.CLOSE.STATION command to reject it. The local STATION_ID, remote node address (DEST_ADDR), and remote SAP value (RSAP_VALUE) are provided in the status table pointed to by the address in the ES and BX registers.
9Remote station has entered a "local busy" condition
8Remote station has left a "local busy" condition
7Ti has expired
6DLC counter overflowOne or more of the DLC link station's DLC log counters has reached one-half the maximum value. A DLC.STATISTICS command should be issued.
5Access Priority loweredThe new access priority (ACCESS_PRIORITY) is in the area pointed to by the address in the ES:BX register. This bit is not set on the PC network or Ethernet.
4-1Reserved
0Local station has entered a "local busy" conditionThis code is reported only when the state has changed because of a buffer pool (out-of-buffers) condition when the adapter support software cannot accept an I-format LPDU. It is not reported because of a DLC.FLOW.CONTROL command being issued by the network application program. It is the responsibility of the application program to issue a "flow control on" command to reset the "local busy" condition.
+ +Copyright IBM Corp. 1986, 1996 +B.3.2 - 1 + +--- + + +## Page 454 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Suggested Actions in Response to DLC Status + +B.3.3 Suggested Actions in Response to DLC Status + +**Link Lost** +It appears that the connection to the remote partner has been lost, or that the remote station has been closed. A DLC.CLOSE.STATION command can be issued to free the control block, or a DLC.CONNECT.STATION command (possibly with different routing information) can be issued to attempt to reestablish the connection. Any pending transmit commands will be returned with a CCB_RETCODE of X'27'. + +**DM or DISC received** +The remote partner is attempting to terminate the connection. A DLC.CLOSE.STATION command should be issued. Any pending transmit commands will be returned with a CCB_RETCODE of X'27'. + +**FRMR Received** +The remote partner has detected a DLC protocol error in the frame received from this station. Either a DLC.CLOSE.STATION or DLC.CONNECT.STATION command should be issued. Any pending transmit commands will be returned with a CCB_RETCODE of X'27'. + +**FRMR Sent** +The local link station has detected a DLC protocol error in a frame received from the remote partner. However, if a Ti Timer-expired DLC status interrupt is received after receipt of this interrupt, a DLC.CLOSE.STATION or DLC.CONNECT.STATION command should be issued to the local station. Any pending transmit commands will be returned with a CCB_RETCODE of X'27'. + +**SABME Received for an Open Link Station** +The remote station wants to reset an existing connection. A DLC.CONNECT.STATION command can be issued to reestablish the connection, or a DLC.CLOSE.STATION command can be issued to terminate it. Any pending transmit commands will be returned with a CCB_RETCODE of X'27'. + +**SABME Received, Link Station Opened** +A control block has been allocated and a station has been opened, in disconnected state, in response to a SABME received from a remote station. The connection request can be accepted by issuing a DLC.CONNECT.STATION command, or rejected by issuing a DLC.CLOSE.STATION command. + +**Remote Station Has Entered Local Busy** +The remote station has temporarily stopped receiving I-format LPDUs, probably because of buffer congestion. The local station will stop sending I-format LPDUs. The application program can choose to issue transmit commands for the affected station, up to the maximum number accepted by the adapter, but they will be queued until the remote station leaves the local busy state. + +**Remote Station Has Left Local Busy** +The local station will resume I-format LPDU transmission. + +**Ti Timer Expired** +This status is not returned while the link is in link opened state. In other states it is returned to indicate that there is no activity on the link and that the workstation may, therefore, want to close the link to free the control block. + +**DLC Counter Overflow** +One or more of the error counters maintained for the link station has reached half of its maximum value. The counter will wrap back to zero when it reaches its maximum value. The application program should issue a DLC.STATISTICS command to read and reset the counters. + +**Access Priority Reduced** +The access priority requested for this SAP or link station was greater than that authorized for the adapter, and the access priority has been reduced. The new priority is in the Adapter Status Table, or if the adapter is being operated without the adapter support software, in ARB byte 13. No workstation application program action is required, as this is for information only. However, a DLC.MODIFY command can be issued to change the access priority. Access priority is not set on the PC Network or on Ethernet. Token-Ring Network NDIS adapters may not use it either. When using a Token-Ring NDIS adapter, consult the adapter documentation to determine whether the access priority is set. + +
Copyright IBM Corp. 1986, 1996 +B.3.3 - 1
+ +--- + + +## Page 455 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB Return Codes + +B.4 NCB Return Codes + +Table B-4. NCB Return Codes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CodeMeaning
00Good return.
01Illegal buffer length.
03Invalid command.
05Command timed out.
06Message incomplete.
07Data for one or more SEND type NO.ACK commands was not received.
08Illegal local session number.
09No resource available.
0ASession closed.
0BCommand canceled.
0DDuplicate name in local name table.
0EName table full.
0FCommand completed--name has active session and is now deregistered.
11Local session table full.
12Session open rejected.
13Illegal name number.
14Cannot find name called.
15Name not found or cannot specify "*" or null.
16Name in use on remote NetBIOS.
17Name deleted.
18Session ended abnormally.
19Name conflict detected.
21Interface busy.
22Too many commands pending.
23Invalid number in NCB_LANA_NUM field.
24Command completed while cancel occurring.
26Command not valid to cancel.
30Name defined by another environment.
34Environment not defined, RESET must be issued.
35Required operating system resources exhausted, retry later.
36Maximum application programs exceeded.
37No SAPs available for NetBIOS.
38Requested resources not available.
39Invalid NCB address or length does not fit in segment.
3ARESET cannot be issued from a NetBIOS adapter appendage.
3BInvalid NCB_DD_ID value.
3CNetBIOS attempted to lock user storage and the lock failed.
3FNetBIOS Device Driver open error.
+ +Copyright IBM Corp. 1986, 1996 +B.4 - 1 + +--- + + +## Page 456 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB Return Codes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
40OS/2 error detected.
4ENetwork status--one or more of bits 12, 14, 15 on for longer than 60 seconds.
4FNetwork status--one or more of bits 8-11 on.
F6Unexpected error on CCB completion.
F7Error on implicit DIR.INITIALIZE.
F8Error on implicit DIR.OPEN.ADAPTER.
F9Adapter protocol driver internal error.
FAAdapter check.
FBNetBIOS program not loaded in PC.
FCDIR.OPEN.ADAPTER or DLC.OPEN.SAP failed; check parameters.
FDUnexpected adapter close.
FENetBIOS not operational and application program explicitly opened the adapter.
+ +Subtopics +B.4.1 NCB Return Codes Listed by Command +B.4.2 NCB Return Codes Cause and Action + +
Copyright IBM Corp. 1986, 1996
+<page_number>B.4 - 2</page_number> + +--- + + +## Page 457 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB Return Codes Listed by Command + +B.4.1 NCB Return Codes Listed by Command + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NCB.ADD.GROUP.NAME
00, 03, 0D, 0E, 15, 16, 19, 21, 22
23, 34, 35, 39, 3B, 3C, 40, 4x, Fx
NCB.ADD.NAME
00, 03, 0D, 0E, 15, 16, 19, 21, 22
23, 30, 34, 35, 39, 3B, 3C, 40, 4x, Fx
NCB.CALL
00, 03, 05, 09, 0B, 11, 12, 14, 15, 18, 19, 21, 22
23, 30, 34, 35, 39, 3B, 3C, 40, 4x, Fx
NCB.CANCEL
00, 01, 03, 21
23, 24, 26, 34, 35, 39, 3B, 3C, 40, 4x, Fx
NCB.CHAIN.SEND
00, 01, 03, 05, 07, 08, 0A, 0B, 18, 21, 22
23, 30, 34, 35, 39, 3B, 3C, 40, 4x, Fx
NCB.CHAIN.SEND.NO.ACK
00, 01, 03, 07, 08, 0A, 0B, 18, 21, 22
23, 30, 34, 35, 39, 3B, 3C, 40, 4x, Fx
NCB.DELETE.NAME
00, 03, 0F, 15, 21, 22
23, 34, 35, 39, 3B, 3C, 40, 4x, Fx
NCB.FIND.NAME
00, 01, 03, 05, 19, 21, 22
23, 34, 35, 39, 3B, 3C, 40, 4x, Fx
NCB.HANG.UP
00, 03, 05, 08, 0A, 0B, 18, 21, 22
23, 34, 35, 39, 3B, 3C, 40, 4x, Fx
NCB.LAN.STATUS.ALERT
00, 03, 0B, 21, 22
23, 34, 35, 39, 3B, 3C, 40, 4x, Fx
NCB.LISTEN
00, 03, 09, 0B, 11, 15, 17, 18, 19, 21, 22
23, 30, 34, 35, 39, 3B, 3C, 40, 4x, Fx
NCB.RECEIVE
00, 01, 03, 05, 06, 07, 08, 0A, 0B, 18, 21, 22
23, 34, 35, 39, 3B, 3C, 40, 4x, Fx
NCB.RECEIVE.ANY
00, 01, 03, 06, 07, 0A, 0B, 13, 17, 18, 19, 21, 22
23, 34, 35, 39, 3B, 3C, 40, 4x, Fx
NCB.RECEIVE.BROADCAST.DATAGRAM
00, 01, 03, 06, 0B, 13, 17, 19, 21, 22
+ +Copyright IBM Corp. 1986, 1996 +B.4.1 - 1 + +--- + + +## Page 458 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB Return Codes Listed by Command + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
23, 30, 34, 35, 39, 3B, 3C, 40, 4x, Fx
NCB.RECEIVE.DATAGRAM
00, 01, 03, 06, 0B, 13, 17, 18, 19, 21, 22
23, 30, 34, 35, 39, 3B, 3C, 40, 4x, Fx
NCB.RESET
00, 01, 03, 21
23, 36, 38, 3B, 3C, 40, 4x, Fx
NCB.SEND
00, 01, 03, 05, 07, 08, 0A, 0B, 18, 21, 22
23, 34, 35, 39, 3B, 3C, 40, 4x, Fx
NCB.SEND.BROADCAST.DATAGRAM
00, 01, 03, 13, 19, 21, 22
23, 30, 34, 35, 39, 3B, 3C, 40, 4x, Fx
NCB.SEND.DATAGRAM
00, 01, 03, 13, 19, 21, 22
23, 30, 34, 35, 39, 3B, 3C, 40, 4x, Fx
NCB.SEND.NO.ACK
00, 01, 03, 07, 08, 0A, 0B, 18, 21, 22
23, 30, 34, 35, 39, 3B, 3C, 40, 4x, Fx
NCB.SESSION.STATUS
00, 01, 03, 06, 15, 19, 21, 22
23, 30, 34, 35, 39, 3B, 3C, 40, 4x, Fx
NCB.STATUS
00, 01, 03, 05, 06, 0B, 19, 21, 22
23, 30, 34, 35, 39, 3B, 3C, 40, 4x, Fx
NCB.TRACE
00, 01, 03, 0D, 13
23, Fx
NCB.UNLINK
00, 03, 21
23, 3B, 3C, 4x, Fx
+ +Copyright IBM Corp. 1986, 1996 +B.4.1 - 2 + +--- + + +## Page 459 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB Return Codes Cause and Action + +B.4.2 NCB Return Codes Cause and Action + +----------------------------------------------------------------- +Hex 00 +Explanation: Operation was completed successfully. +----------------------------------------------------------------- +Hex 01 +Explanation: Illegal buffer length. +Cause: The requested buffer length (or invalid buffer selector if using NetBIOS 3.0) is illegal. +Action: Specify the correct size for the buffer and retry. +----------------------------------------------------------------- +Hex 03 +Explanation: Invalid command. +Cause: See Explanation. +Action: Issue the correct command. +----------------------------------------------------------------- +Hex 05 +Explanation: Command timed out. +Cause: See Explanation. +Action: Reissue the same command or another command. If a send command timed out, there cannot be a receive pending from the other name. +----------------------------------------------------------------- +Hex 06 +Explanation: Message incomplete. +Cause: The application program received part of a message because the specified buffer length is not large enough to receive the full message. +Action: + * For NCB.RECEIVE and NCB.RECEIVE.ANY: Issue another receive to get the rest of the message before the remote side times out. + * For NCB.STATUS, NCB.SESSION.STATUS, NCB.RECEIVE.DATAGRAM, and NCB.RECEIVE.BROADCAST.DATAGRAM: The remaining data is lost. +Note: If the command was NCB.STATUS, this error code could occur because the remote side could not transmit the entire status update if the data was longer than the maximum length UI frame that can be transmitted. +----------------------------------------------------------------- +Hex 07 +Explanation: Data for one or more SEND type NO.ACK commands was not received. +Cause: Data sent by a previous NCB.SEND.NO.ACK or NCB.CHAIN.SEND.NO.ACK command was either not received at all or only partially received by the remote application program. +Action: The application program will need to initiate any data recovery needed. +----------------------------------------------------------------- +Hex 08 +Explanation: Illegal local session number. +Cause: The session number specified is not one of the active sessions. +Action: Reissue the command with the correct active session number. +----------------------------------------------------------------- +Hex 09 +Explanation: No resource available. +Cause: You are trying to establish a session with a remote application program that has no more room in the session table. +Action: Reissue the command at a later time. +----------------------------------------------------------------- + +Copyright IBM Corp. 1986, 1996 +B.4.2 - 1 + +--- + + +## Page 460 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB Return Codes Cause and Action + +**Hex 0A** +**Explanation:** Session closed. +**Cause:** The name from the transmitting side closed the session. The session has terminated normally. +**Action:** None. + +**Hex 0B** +**Explanation:** Command canceled. +**Cause:** See Explanation. +**Action:** None. + +**Hex 0D** +**Explanation:** Duplicate name in local name table. +**Cause:** You tried to specify a name that is currently in the name table. +**Action:** Reissue the command and specify another name. + +**Hex 0E** +**Explanation:** Name table full. +**Cause:** The number of names defined has exceeded the number defined at initialization (default=17). +**Action:** Wait until a delete name is issued so an entry will become available. + +**Hex 0F** +**Explanation:** Command was completed; name has active session and is now deregistered. +**Cause:** The name to be deleted is active in a session now, but is deregistered. When the name is marked deregistered and has active sessions, it still occupies a slot in the table. The name is unusable for any new sessions. +**Action:** Close all the sessions using this name. + +**Hex 11** +**Explanation:** Local session table full. +**Cause:** There are no available entries on the session table. (The number of sessions is user specified in NCB.RESET.) +**Action:** Wait until a session has closed so an entry will become available. + +**Hex 12** +**Explanation:** Session open rejected. +**Cause:** No LISTEN command is pending on the remote NetBIOS. +**Action:** Wait until a LISTEN is issued on the remote NetBIOS. + +**Hex 13** +**Explanation:** Illegal name number. +**Cause:** The number of the name has been changed or was never specified. +**Action:** Use the most recent number that was assigned to the name. + +**Hex 14** +**Explanation:** Cannot find name called or no answer. +**Cause:** No response to the NCB.CALL command was received. +**Action:** Try again later. + +**Hex 15** + +
Copyright IBM Corp. 1986, 1996
+<page_number>B.4.2 - 2</page_number> + +--- + + +## Page 461 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB Return Codes Cause and Action + +**Explanation:** Name not found or cannot specify "*" or null. + +**Cause:** The name specified is not in the table, or the first character of the name is either an ASCII asterisk or "00." + +**Action:** Try again with another name that has been verified to be correct. + +--- + +**Hex 16** + +**Explanation:** Name in use on remote NetBIOS. + +**Cause:** Name found in another table. Names used in the network are unique and can be used only in one place. The name is already defined on another node. + +**Action:** Either specify another name or have the name changed at the remote end. + +--- + +**Hex 17** + +**Explanation:** Name deleted. + +**Cause:** See Explanation. + +**Action:** Add the name to the table and reissue the command. + +--- + +**Hex 18** + +**Explanation:** Session ended abnormally. + +**Cause:** The most probable cause is that a send-type NCB timed out because no receive command was available in the remote node. + +**Action:** +* If a send timed out, reestablish the session and ensure that the remote node has issued a receive. +* If the session cannot be reestablished, maintenance procedures should be initiated for the node in question. + +--- + +**Hex 19** + +**Explanation:** Name conflict detected. + +**Cause:** Network protocol has detected two or more identical names on the network. + +**Action:** Identical names on the network should be removed. + +--- + +**Hex 21** + +**Explanation:** Interface busy. + +**Cause:** NetBIOS is either busy or out of local resources. + +**Note:** This condition can also be caused by any of the network status bits 12, 14, or 15 being on. + +**Action:** Try again later. + +--- + +**Hex 22** + +**Explanation:** Too many commands pending. + +**Cause:** See Explanation. + +**Action:** Try again later. + +--- + +**Hex 23** + +**Explanation:** Invalid number in NCB_LANA_NUM field. + +**Cause:** You tried to specify a value other than "00" or "01," or the adapter is not present. + +**Action:** Verify that the adapter is present, or correct the value and try the command again. Use "00" for the primary adapter and "01" for the alternate. + +--- + +**Hex 24** + +**Explanation:** Command completed while cancel occurring. + +
Copyright IBM Corp. 1986, 1996
+<page_number>B.4.2 - 3</page_number> + +--- + + +## Page 462 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB Return Codes Cause and Action + +**Cause:** You tried to cancel a command that had already been completed. +**Action:** None. +--- +**Hex 26** +**Explanation:** Command not valid to cancel. +**Cause:** Tried to cancel a command that is invalid to cancel. +**Action:** Verify the correctness of the cancel command. +--- +**Hex 30** +**Explanation:** Name defined by another environment. +**Cause:** Another environment has already defined the name. +**Action:** Choose another name. +--- +**Hex 34** +**Explanation:** Environment not defined; RESET must be issued. +**Cause:** See Explanation. +**Action:** Issue RESET. +--- +**Hex 35** +**Explanation:** Required operating system resources exhausted; retry later. +**Cause:** See Explanation. +**Action:** Retry command later. +--- +**Hex 36** +**Explanation:** Maximum number of application programs was exceeded. +**Cause:** The maximum number of application programs defined at NetBIOS 3.0 load-time are executing. +**Action:** Wait until another application program ends. +--- +**Hex 37** +**Explanation:** No SAPs available for NetBIOS. +**Cause:** The adapter has no SAPs available for NetBIOS. SAPs relinquishes use of a SAP. +**Note:** Return code not currently used by NetBIOS. +--- +**Hex 38** +**Explanation:** Requested resources not available. +**Cause:** See Explanation. +**Action:** Operate with a smaller number of resources or end the operation. +--- +**Hex 39** +**Explanation:** Invalid NCB address or length does not fit in segment. +**Cause:** See Explanation. +**Action:** Application program error. Correct NCB address and selector length. +**Note:** In the case of this return code, since the NCB is in doubt, the value is returned only in register AL. No attempt is made to place the return code into the NCB. +--- +**Hex 3A** +**Explanation:** RESET cannot be issued from a NetBIOS adapter appendage. + +
Copyright IBM Corp. 1986, 1996
+<page_number>B.4.2 - 4</page_number> + +--- + + +## Page 463 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB Return Codes Cause and Action + +**Cause:** The RESET command was issued when the NetBIOS 3.0 adapter was processing a hardware interrupt. + +**Action:** Application program error. Do not issue RESET in this situation. + +**Notes:** +1. Return code applies only to the DD interface. +2. Return code not currently used by NetBIOS. + +--- + +**Hex 3B** + +**Explanation:** Invalid NCB_DD_ID value. + +**Cause:** The value in NCB_DD_ID is not identical to the value returned by NetBIOS 3.0 in the first RESET issued by the device driver application program. Note that NCB_DD_ID must be X'0000' in the first RESET issued for a given device driver application program. + +**Action:** Application program error. Correct NCB_DD_ID value. + +**Note:** Return code applies only to the DD interface. + +--- + +**Hex 3C** + +**Explanation:** NetBIOS attempted to lock user storage and the lock failed. + +**Cause:** See Explanation. + +**Action:** Try the command at a later time. + +--- + +**Hex 3F** + +**Explanation:** NetBIOS device driver open error. + +**Cause:** Either the device driver had an actual problem in its open process, or the NetBIOS device driver was not loaded. + +**Action:** Load the appropriate code before executing NetBIOS application programs. + +**Note:** Return code not currently used by NetBIOS. + +--- + +**Hex 40** + +**Explanation:** OS/2 error detected. + +**Cause:** During processing, an unexpected error was indicated by OS/2. + +--- + +**Hex 4E** + +**Explanation:** Network status; one or more of bits 12, 14, or 15 are on for more than 60 seconds. + +**Cause:** See Explanation. + +**Action:** Check the extended status last network status code. The only NetBIOS command that can be issued is NCB.RESET. + +**Note:** This return code is not reported at all if some status bits (8-11) are also on. This return code is reported to the application program only if the status bits 12, 14, or 15 remain on longer than 60 seconds. + +See "Token-Ring Network Status Codes for All CCBs" in topic B.10.4 for a description of the status bits. + +--- + +**Hex 4F** + +**Explanation:** Network status; one or more of bits 8-11 on. + +**Cause:** See Explanation. + +**Action:** Check the extended status last network status code. The only NetBIOS command that can be issued is NCB.RESET. + +See "Token-Ring Network Status Codes for All CCBs" in topic B.10.4 for a description of the status bits. + +--- + +**Hex F6** + +**Explanation:** Unexpected error on CCB completion. + +**Cause:** This is a NetBIOS 2.X return code that indicates that a CCB has completed with an unexpected bad return code. NetBIOS 1.X returned a X'FA' in these situations. + +
Copyright IBM Corp. 1986, 1996
+<page_number>B.4.2 - 5</page_number> + +--- + + +## Page 464 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB Return Codes Cause and Action + +Action: The only NetBIOS command that can be issued is NCB.RESET. + +Hex F7 + +Explanation: Error on implicit DIR.INITIALIZE. + +Cause: See Explanation. + +Action: Check the extended status bring-up error code. The only NetBIOS command that can be issued is NCB.RESET. + +Note: Return code for DOS NetBIOS only. + +Hex F8 + +Explanation: Error on implicit DIR.OPEN.ADAPTER. + +Cause: See Explanation. + +Action: Check the extended status bring-up error code. The only NetBIOS command that can be issued is NCB.RESET. + +Notes: +1. There is a possibility that a DIR.OPEN.ADAPTER could fail because of a temporary timing condition. Because of this, before reporting this return code, the +2. This error could be caused by an attempt to open on a Token-Ring Network with the adapter set to the wrong data rate. Check the data rate setting. + +Hex F9 + +Explanation: A PC System Detected Error occurred. + +Cause: See Explanation. + +Action: Check the PC System detected error code. The only NetBIOS command that can be issued is NCB.RESET. + +Hex FA + +Explanation: Adapter check. + +Cause: See Explanation. + +Action: Check the adapter check reason code. The only NetBIOS command that can be issued is NCB.RESET. + +Hex FB + +Explanation: NetBIOS code not loaded in the workstation. + +Cause: NetBIOS is not loaded or is loaded and not operational due to an error at load time, greater than X'03' in the first field. + +Action: Load and start NetBIOS, or correct the conditions that cause a load error. Then reissue the command or + +Note: Return code for DOS NetBIOS only. + +Hex FC + +Explanation: DIR.OPEN.ADAPTER or DLC.OPEN.SAP failed; check parameters. + +Cause: See Explanation. + +Action: Correct the parameters in error and execute the DIR.OPEN.ADAPTER command again. Note that the DLC.OPEN.SAP command is executed on initial start and restart of NetBIOS. The parameters used are obtained from the DIR.OPEN.ADAPTER command (executed either explicitly or implicitly). + +Hex FD + +Explanation: Unexpected adapter close. + +Cause: The adapter was closed while NetBIOS was executing. + +Action: Issue a NCB.RESET command. + +Hex FE + +
Copyright IBM Corp. 1986, 1996
+<page_number>B.4.2 - 6</page_number> + +--- + + +## Page 465 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB Return Codes Cause and Action + +**Explanation:** NetBIOS is not operational and the application program explicitly opened the adapter. + +**Cause:** The adapter has been explicitly opened by the application program and NetBIOS is not operational. + +**Action:** Close the adapter and reissue the NetBIOS command. + +See "Token-Ring Network Status Codes for All CCBs" in topic B.10.4 for a description of the status bits. + +**Notes:** + +For the following codes X'F7' to X'FD': + +1. The condition to be reported through NCB_RETCODE is the last to have occurred. + +2. Extended status information, with the exception of adapter counters, is available in the NCB_RESERVE field of the command block. In the case of the NCB.RESET command, it is the status before the NCB.RESET. + +3. Network status information: + * Any network status bits 8-11 set on cause error code X'4F'. + * Any network status bits 12, 14, or 15 set on for longer than 60 seconds cause error code X'4E'. Code X'4F' has priority over code X'4E'. + * Network status bits 6 and 7 do not cause errors. If bit 7 (counter overflow) is on, nothing is reported. If no network status appendage is defined, the local NetBIOS counters will be updated with the DIR.READ.LOG command. Bit 6 (single station) is ignored. + * Return code for DOS NetBIOS only. + +--- + + +## Page 466 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Adapter Status Parameter Table + +B.5 Adapter Status Parameter Table + +This information is placed in workstation memory by the adapter support software in response to a DIR.STATUS command. The adapter support software places a pointer address in the ADAPTER_PARMS_ADDR field of the DIR.STATUS command's parameter table. + +Note: For an NDIS adapter, the Adapter Status Parameter Table is updated when a RING STATUS occurs and at certain intervals based on a timer. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table B-5. Token-Ring Network Adapter Status Parameter Table
OffsetParameter NameByte Length8086 TypeDescription
0PHYS_ADDR4DBAdapter physical address
4UP_NODE_ADDR6DBThe upstream node address
10UP_PHYS_ADDR4DBThe upstream physical address
14POLL_ADDR6DBLast poll address
20AUTH_ENV2DBAuthorized environment
22ACC_PRIORITY2DBTransmit access priority
24SOURCE_CLASS2DBSource class authorization
26ATT_CODE2DBLast attention code
28SOURCE_ADDR6DBLast source address
34BEACON_TYPE2DBLast beacon type
36MAJOR_VECTOR2DBLast major vector
38NETW_STATUS2DBNetwork status
40SOFT_ERROR2DBSoft error timer value
42FE_ERROR2DBFront end error counter
44LOCAL_RING2DBRing number
46MON_ERROR2DBMonitor error code
48BEACON_TRANSMIT2DBBeacon transmit type
50BEACON_RECEIVE2DBBeacon receive type
52FRAME_CORREL2DBFrame correlation save
54BEACON_NAUN *6DBBeaconing station NAUN
604DBReserved
64BEACON_PHYS *4DBBeaconing station physical address
* These fields are valid only when the ring is beaconing.
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table B-6. PC Network and Ethernet Adapter Status Parameter Table
OffsetParameter NameByte Length8086 TypeDescription
028DBReserved
28SOURCE_ADDR6DBLast source address
342DBReserved
36MAJOR_VECTOR2DBLast major vector
38NETWORK_STATUS2DWNetwork status
40REPORT_ERROR2DWError report timer value
42REPORT_ERROR_TICK2DWError report timer tick
+ +Copyright IBM Corp. 1986, 1996 +B.5 - 1 + +--- + + +## Page 467 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Adapter Status Parameter Table + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
counter
44LOCAL_BUS_NUMBER2DBLocal bus number
466DBReserved
52FRAME_CORRELATOR2DBFrame correlation save
546DBReserved
60NETWORK_SAMPLES2DWNumber of network utilization samples
62NETWORK_BUSY2DWNumber of network busy samples
644DBReserved
+ +
Copyright IBM Corp. 1986, 1996
+<page_number>B.5 - 2</page_number> + +--- + + +## Page 468 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Exception Indications + +B.6 Exception Indications +The exception indications include: + +☐ Adapter Check +☐ Network Status +☐ Bring-Up and Open Errors +☐ PC System Detected Errors +☐ System Action Exceptions for OS/2. + +
Copyright IBM Corp. 1986, 1996
+<page_number>B.6 - 1</page_number> + +--- + + +## Page 469 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Adapter Check + +B.7 Adapter Check + +The following sections document adapter checks for CCB1, CCB2, and CCB3. + +Subtopics +B.7.1 Adapter Check for CCB1 +B.7.2 Adapter Check for CCB2 +B.7.3 Adapter Check for CCB3 + +
Copyright IBM Corp. 1986, 1996
+<page_number>B.7 - 1</page_number> + +--- + + +## Page 470 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Adapter Check for CCB1 + +B.7.1 Adapter Check for CCB1 + +When an adapter check occurs, the adapter support software closes the adapter and all ring communication ceases. The adapter support software assumes the adapter has encountered an unrecoverable error. An adapter check appendage (ADAPTER_CHECK_EXIT), if defined by these commands (DIR.INITIALIZE, DIR.OPEN.ADAPTER, DIR.MODIFY.OPEN.PARMS, DIR.SET.USER.APPENDAGE), will be taken. On entry, the CX register will contain the adapter number, the AX will contain the adapter check reason code, and the ES and BX registers will point to Table B-7. While interrogating the information, the application program should either move the data to private memory or keep all interrupts masked off. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table B-7. Adapter Check for CCB1
OffsetParameter NameByte Length8086 TypeDescription
0NOTIFICATION_FLAG4DDA pointer to the first of a queue of commands that were pending when the adapter closed
4REASON_CODE2DWAdapter check reason code. See "Token-Ring Network Adapter Check Reason Codes for All CCBs" in topic B.8.
6PARAMETER_02DWParameter 0: Set per reason code
8PARAMETER_12DWParameter 1: Set per reason code
10PARAMETER_22DWParameter 2: Set per reason code
+ +
Copyright IBM Corp. 1986, 1996
+<page_number>B.7.1 - 1</page_number> + +--- + + +## Page 471 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Adapter Check for CCB2 + +B.7.2 Adapter Check for CCB2 + +In some instances, the adapter hardware or software is in a state in which operation is not possible. If this is the case, the following occurs: + +1. If possible, the adapter closes and all network communications cease. + +2. All adapters assume a closed state. + +3. SAPs and link stations close because the adapter closes, and SAP and direct station buffer pools, pending receive frames, and CCBs can be returned to the application program if the ADAPTER_CHECK_FLAG is set. + +4. If the ADAPTER_CHECK_FLAG is set the application program can be notified of this event. In order for an application program to receive notification of an adapter check, a READ command must be issued before the event occurs requesting notification of Critical Exceptions. When the event occurs, the READ command will be posted using a semaphore. The information listed in Table B-8 will be copied into the READ command's CCB parameter table. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table B-8. Adapter Check for CCB2
OffsetParameter NameByte Length8086 TypeDescription
0NOTIFICATION_FLAG4DDUser exception flag.
4CCB_COUNT2DWCount of CCBs chained to EVENT_CCB_POINTER.
6EVENT_CCB_POINTER4DDPointer to the first of a queue of commands that were pending when the adapter closed.
10BUFFER_COUNT2DWCount of buffers chained to FIRST_BUFFER_ADDR.
12FIRST_BUFFER_ADDR4DDAddress of first buffer in SAP and direct station buffer pools.
16RCV_FRAME_COUNT2DWCount of received frames chained to RCV_FRAME_ADDR.
18RCV_FRAME_ADDR4DDAddress of the first received frame of a possible chain of frames.
22REASON_CODE2DWAdapter check reason code. See "Token-Ring Network Adapter Check Reason Codes for All CCBs" in topic B.8.
Note: The next three fields are event error data.
24PARAMETER_02DWParameter 0: set per reason code.
26PARAMETER_12DWParameter 1: set per reason code.
28PARAMETER_22DWParameter 2: set per reason code.
+ +NOTIFICATION_FLAG +Explanation: This user exception flag is ADAPTER_CHECK_FLAG as defined using the DIR.SET.EXCEPTION.FLAGS command. + +FIRST_BUFFER_ADDR +Explanation: Address of the first buffer in the SAP or direct buffer pool. + +Buffers provided with the DLC.OPEN.SAP or DIR.OPEN.DIRECT commands are returned to the application program when the adapter enters the closed state. + +RCV_FRAME_ADDR + +Copyright IBM Corp. 1986, 1996 +B.7.2 - 1 + +--- + + +## Page 472 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Adapter Check for CCB2 + +**Explanation:** Address of the first received frame. + +All received frames for this application program that were on the completion list at the time of the exception are queued to this field when the adapter enters the closed state. The first buffer of each frame will point to the next frame. + +--- + +**REASON_CODE** + +**Explanation:** Reason code for the adapter check. See "Token-Ring Network Adapter Check Reason Codes for All CCBs" in topic B.8. + +**Note:** Only one reason code will be reported at a time. + +--- + +**PARAMETERS - 0,1,2** + +**Explanation:** PARAMETER_0, PARAMETER_1, and PARAMETER_2 provide additional information on a per reason code basis. The information can be useful for maintenance purposes and is not intended for application program use. + +
Copyright IBM Corp. 1986, 1996 +B.7.2 - 2
+ +--- + + +## Page 473 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Adapter Check for CCB3 + +B.7.3 Adapter Check for CCB3 + +In some instances, the adapter hardware or software is in a state in which operation is not possible. If this is the case, the following will occur: + +1. If possible, the adapter closes and all network communications cease. + +2. All adapters assume a closed state. + +3. If SAPs and link stations close because the adapter closes and the adapter check appendage (ADAPTER_CHECK_APPNDG_OFFSET) is defined, the SAP and direct station buffer pools and CCBs can be returned to the application program in the information table pointed to by registers ES and BX. When the adapter support software calls the application program's device driver, the appropriate event appendage offset is passed in register DI. See the DIR.SET.EXCEPTION.FLAGS command on topic 3.3.14. + +4. If the adapter check appendage offset is specified, the application program can be notified of this event. Once the adapter check occurs, the adapter support software notifies the application program of the event by calling the application program's device driver with the appropriate event appendage offset passed in register DI. The information listed in Table B-9 will be provided in the table pointed to by registers ES and BX when the adapter support software calls the application program's device driver. + +Application Program Calls + +When the adapter support software calls the application program's device driver entry point, the following information is provided to the application program: + +☐ An invocation code of X'0001' has been pushed onto the stack. Before returning to the adapter support software, the application program must remove the invocation code from the stack. + +☐ Register DI contains the offset of the adapter check appendage as defined by the DIR.SET.EXCEPTIONS.FLAG command. + +☐ Register DS contains the application program's device driver protect mode data segment. + +☐ Register CX contains the adapter number. + +☐ Registers ES and BX contain the address of a 14-byte information table. + +☐ Register AX contains the error code. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table B-9. Adapter Check for CCB3
OffsetParameter NameByte Length8086 TypeDescription
0CCB_COUNT2DWCount of CCBs chained to EVENT_CCB_POINTER.
2EVENT_CCB_POINTER4DDPointer to the first of a queue of commands that were pending when the adapter closed.
6BUFFER_COUNT2DWCount of buffers chained to FIRST_BUFFER_ADDR.
8FIRST_BUFFER_ADDR4DDAddress of first buffer in SAP and direct station buffer pools.
12REASON_CODE2DWAdapter check reason code, see "Token-Ring Network Adapter Check Reason Codes for All CCBs" in topic B.8.
Note: The next three fields are event error data.
14PARAMETER_02DWParameter 0: set per reason code.
16PARAMETER_12DWParameter 1: set per reason code.
18PARAMETER_22DWParameter 2: set per reason code.
+ +FIRST_BUFFER_ADDR + +Copyright IBM Corp. 1986, 1996 +B.7.3 - 1 + +--- + + +## Page 474 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Adapter Check for CCB3 + +**Explanation:** Address of the first buffer in the SAP and direct station buffer pool. + +Buffers provided with the DLC.OPEN.SAP or DIR.OPEN.DIRECT commands are returned to the application program when the adapter enters the closed state. + +--- + +**REASON_CODE** + +**Explanation:** Reason code for the adapter check. See "Token-Ring Network Adapter Check Reason Codes for All CCBs" in topic B.8. + +--- + +**PARAMETERS - 0,1,2** + +**Explanation:** PARAMETER_0, PARAMETER_1 and PARAMETER_2 provide additional information on a per reason code basis. The information can be useful for maintenance purposes only and is not intended for application program use. + +
Copyright IBM Corp. 1986, 1996 +B.7.3 - 2
+ +--- + + +## Page 475 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Token-Ring Network Adapter Check Reason Codes for All CCBs + +B.8 Token-Ring Network Adapter Check Reason Codes for All CCBs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ValueFunctionMeanings/Parameters
8000Adapter inoperativeSee note.
4000Reserved
2000Reserved
1000Illegal op codeThe adapter detected an illegal op code (micro failure).
0800Local bus parity errorThe adapter local bus detected a parity error.
0400External parity error
0200Reserved
0100Internal parity error
0080Parity error, ring transmitThe adapter local bus detected a parity error while transmitting on the ring.
0040Parity error, ring receiveThe adapter local bus detected a parity error while receiving from the ring.
0020Transmit underrun
0010Receive overrun
0008Unrecognized interrupt
0004Unrecognized error interrupt
0003Adapter detected no workstation service
0002Unrecognized supervisory request
0001Program detected error
+ +**Adapter inoperative (8000):** When a machine check occurs in the adapter processor, it is reported to the adapter support software via an "adapter check interrupt." The workstation can receive this interrupt before the adapter processor is able to set the adapter check bits. Therefore the adapter support software does the following: + +1. If a reason code is set, that code is passed to the application program. + +2. If a reason code is not set, the adapter support software goes into a tight loop for 250 ms. The adapter support software then checks the reason code set by the adapter processor and does one of the following: + +a. If a code is set, the adapter support software passes that code to the application program. + +b. If no code is set, the adapter support software assumes that the adapter processor's machine check handler was not capable of executing because of the severity of the processor's problem. The adapter support software then sets a value of (8000) in the adapter check reason code and passes that code to the application program. + +Copyright IBM Corp. 1986, 1996 +B.8 - 1 + +--- + + +## Page 476 + +LAN Technical Reference: 802.2 and NetBIOS APIs +PC Network and Ethernet Adapter Check Reason Codes for All CCBs + +B.9 PC Network and Ethernet Adapter Check Reason Codes for All CCBs + +The values shown in Table B-11 for the reason codes are as if the values were contained in the AX register. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table B-11. IBM PC Network Adapter Check Reason Codes for All CCBs
CodeMeaning
X'0100'Program Detected Error
X'0200'Reserved
X'0300'Invalid Supervisor Request Code
X'0400'Invalid Task ID on Supervisor Call
X'0500'Invalid Ready Task Request
X'0600'Invalid Adapter Number on Supervisor Call
X'0700'Invalid ES Value on Supervisor Call
+ +
Copyright IBM Corp. 1986, 1996
+<page_number>B.9 - 1</page_number> + +--- + + +## Page 477 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Network Status + +B.10 Network Status + +The following sections document network status for CCB1, CCB2, and CCB3. + +Subtopics +B.10.1 Network Status for CCB1 +B.10.2 Network Status for CCB2 +B.10.3 Network Status for CCB3 +B.10.4 Token-Ring Network Status Codes for All CCBs +B.10.5 PC Network and Ethernet Status Codes for All CCBs + +
Copyright IBM Corp. 1986, 1996
+<page_number>B.10 - 1</page_number> + +--- + + +## Page 478 + +B.10.1 Network Status for CCB1 + +Whenever network status changes, the application program is notified if the network status appendage has been defined in the NETW_STATUS_EXIT field of a DIR.INITIALIZE command, in the NETW_STATUS_EXIT field of the DIRECT_PARMS table of the DIR.OPEN.ADAPTER command, or in the NETW_STATUS_EXIT field of an active DIR.MODIFY.OPEN.PARMS command. See "Token-Ring Network Status Codes for All CCBs" in topic B.10.4 for the information returned. + +The AX register contains the network status code and the CX register contains the adapter number. Registers ES and BX point to the chain of pending CCBs if the adapter was closed. + +
Copyright IBM Corp. 1986, 1996
+<page_number>B.10.1 - 1</page_number> + +--- + + +## Page 479 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Network Status for CCB2 + +B.10.2 Network Status for CCB2 + +In some instances the network status indicates that the adapter closed due to an unrecoverable error (Critical Network Status). When the adapter is closed, link stations are closed and the SAP and direct station buffer pools, pending receive frames, and CCBs can be returned to the application program if the NETWORK_STATUS_FLAG is set. See the DIR.SET.EXCEPTION.FLAGS command on topic 3.3.14. + +Whenever network status changes, the application program can be notified if the NETWORK_STATUS_FLAG is set. In order for an application program to receive notification of a network status (non-critical), a READ command must be issued. If a READ command is already pending, it will be posted immediately using a semaphore. + +In order for an application program to receive notification of a Critical Network Status (the adapter closes), a READ command must be issued before the event occurs requesting notification of critical exceptions. When the event occurs, the READ command will be posted using a semaphore. + +The information in Table B-12 will be copied into the READ command's parameter table. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table B-12. Network Status for CCB2
Parameter NameByte Length8086 TypeDescription
NOTIFICATION_FLAG4DDUser exception flag
CCB_COUNT2DWCount of CCBs chained to EVENT_CCB_POINTER *
EVENT_CCB_POINTER4DDPointer to the first of a queue of commands that were pending when the adapter closed *
BUFFER_COUNT2DWCount of buffers chained to FIRST_BUFFER_ADDR *
FIRST_BUFFER_ADDR4DDAddress of first buffer in SAP and direct station buffer pools *
RCV_FRAME_COUNT2DWCount of received frames chained to RCV_FRAME_ADDR *
RCV_FRAME_ADDR4DDAddress of the first received frame of a possible chain of frames *
NETWORK_STATUS_CODE2DWNetwork status code
* Indicates that this value is returned only when the adapter is closed as a result of encountering an unrecoverable error state.
+ +NOTIFICATION_FLAG + +Explanation: User notification flag. + +This user exception flag is NETWORK_STATUS_FLAG as defined using the DIR.SET.EXCEPTION.FLAGS command. + +FIRST_BUFFER_ADDR + +Explanation: Address of the first buffer in the SAP and direct station buffer pools. + +Buffers provided with the DLC.OPEN.SAP and DIR.OPEN.DIRECT commands are returned to the application program if the adapter closes. + +RCV_FRAME_ADDR + +Explanation: Address of the first received frame. + +All received frames for this application program that were on the completion list at the time of the exception will be queued to this field if the adapter closes. The first buffer of each frame will point to the next frame. + +NETWORK_STATUS_CODE + +Explanation: Network status code being reported. + +See "Token-Ring Network Status Codes for All CCBs" in topic B.10.4 when using a Token-Ring Network adapter, and "PC Network and Ethernet Status Codes for All CCBs" in topic B.10.5 when using a PC Network or Ethernet adapter. + +Copyright IBM Corp. 1986, 1996 +B.10.2 - 1 + +--- + + +## Page 480 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Network Status for CCB3 + +B.10.3 Network Status for CCB3 + +In some instances the network status indicates that the adapter closed due to an unrecoverable error (Critical Network Status). When the adapter is closed, link stations are closed, and the SAP, direct station buffer pools and CCBs can be returned to the application program if the NETWORK_STATUS_APPNDG_OFFSET is set. See the DIR.SET.EXCEPTION.FLAGS command on topic 3.3.14. + +Whenever the network status changes, the application program is notified by a NETWORK_STATUS_APPNDG_OFFSET defined using the DIR.SET.EXCEPTION.FLAGS command. In order for an application program to receive notification of a network status exception (critical/non-critical), the DIR.SET.EXCEPTION.FLAGS command must have been executed, and the adapter support software must have been supplied with an appendage offset for network status. + +When the event occurs, the adapter support software calls the application program's device driver entry point with the appropriate event appendage offset passed in register DI. The information listed in Table B-13 is supplied to the application program by the registers ES and BX. ES and BX point to the information table when the adapter support software calls to the application program's device driver. + +Application Program Calls: When the adapter support software calls the application program at the address obtained by the ATTACHDD function, the following information is provided to the application program: + +☐ An invocation code of X'0001' has been pushed onto the stack. Before returning to the adapter support software, the application program must remove the invocation code from the stack. + +☐ Register DI contains the offset of the network status appendage as defined by the DIR.SET.EXCEPTIONS.FLAGS command. + +☐ Register DS contains the application program device driver's protect mode data segment. + +☐ Register CX contains the adapter number. + +☐ Registers ES and BX contain the address of the following 14-byte information table. + +☐ Register AX contains the network status code. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table B-13. Network Status for CCB3
Parameter NameByte Length8086 TypeDescription
CCB_COUNT2DWCount of CCBs chained to EVENT_CCB_POINTER *
EVENT_CCB_POINTER4DDPointer to the first of a queue of commands that were pending when the adapter closed *
BUFFER_COUNT2DWCount of buffers chained to FIRST_BUFFER_ADDR *
FIRST_BUFFER_ADDR4DDAddress of first buffer in SAP and direct station buffer pools *
NETWORK_STATUS_CODE2DWNetwork status code
* Indicates that this value is returned only when the adapter is closed as a result of encountering an unrecoverable error.
+ +FIRST_BUFFER_ADDR +Explanation: Address of the first buffer in the SAP and direct station buffer pools. + +Buffers provided with the DLC.OPEN.SAP and DIR.OPEN.DIRECT commands are returned to the application program if the adapter closes. + +NETWORK_STATUS_CODE +Explanation: Network status code being reported. + +See "Token-Ring Network Status Codes for All CCBs" in topic B.10.4 when using a Token-Ring Network adapter, and "PC Network and Ethernet Status Codes for All CCBs" in topic B.10.5 when using a PC Network or Ethernet adapter. + +Copyright IBM Corp. 1986, 1996 +B.10.3 - 1 + +--- + + +## Page 481 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Token-Ring Network Status Codes for All CCBs + +B.10.4 Token-Ring Network Status Codes for All CCBs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BitFunctionMeaning
15Signal lossAbsence of any received signal detected.
14Hard errorBeacon frames are being transmitted or received.
13Soft errorThis adapter has transmitted a soft error report MAC frame.
12Transmit beaconThe adapter is transmitting beacon frames.
11Lobe wire faultAn open or short circuit has been detected in the lobe data path. The adapter will be closed.
10Auto-removal error 1An adapter hardware error has been detected following the beacon auto-removal process. The adapter has been removed from the ring. The adapter will be closed.
9Reserved
8Remove receivedA remove MAC frame has been received. The adapter will be closed.
7Counter overflowOne of the adapter error log counters has been incremented from 254 to 255. The DIR.READ.LOG command should be issued.
6Single stationThe adapter has opened and is the only station on the ring. The bit will be reset when another station is detected.
5Ring RecoveryThe adapter is transmitting or receiving Monitor Contention (claim token) MAC frames. This bit will be reset upon receipt of a Ring Purge MAC frame.
0-4Reserved
+ +Multiple bits can be set when a network status change is posted. + +For a beaconing condition, the following network status events will be reported in the following order: + +☐ For the station that is initially transmitting the beacon frames +- Ring Recovery (bit 5) set +- Then after 1 second: + - Signal Loss (bit 15) set + - Hard Error (bit 14) set + - Transmit Beacon (bit 12) set + +☐ For the station that is initially receiving the beacon frames +- Ring Recovery (bit 5) set +- Then after 1 second, Hard Error (bit 14) set. + +The Ring Recovery bit remains on for the entire time that the ring is beaconing. When using OS/2, if the ring is beaconing when an application program issues the DIR.OPEN.ADAPTER command and then issues the DIR.STATUS command, the Ring Recovery bit will be set. However, bits 15, 14, and 12 can toggle depending on the immediate state of the ring seen by each adapter as a result of adapters doing diagnostic testing. When the ring stops beaconing all bits including the Ring Recovery bit will be zero. + +In existing applications for the Token-Ring, the application assumes that the adapter has closed upon receiving a lobe wire fault, an auto-removal, or a remove-received network status flag. + +Copyright IBM Corp. 1986, 1996 +B.10.4 - 1 + +--- + + +## Page 482 + +LAN Technical Reference: 802.2 and NetBIOS APIs +PC Network and Ethernet Status Codes for All CCBs + +B.10.5 PC Network and Ethernet Status Codes for All CCBs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BitFunctionMeaning
15No CarrierNo carrier on this card during transmit. **
14Reserved
13Reserved
12Continuous CarrierThe adapter has detected Continuous Carrier on the network for more than 30 seconds. **
11Reserved
10Continuous CarrierThis adapter is generating Continuous Carrier. (The adapter will be closed.) **
9Reserved
8Remove ReceivedA network management REMOVE frame has been received. (The adapter will be closed.) **
7Counter OverflowOne of the Error Log Counters has incremented from 254 to 255.
0-6Reserved
**This value is not set on Ethernet.
+ +
Copyright IBM Corp. 1986, 1996
+<page_number>B.10.5 - 1</page_number> + +--- + + +## Page 483 + +B.11 Bring-Up Errors for All CCBs + +**For CCB1:** Bring-up testing is done when the DIR.INITIALIZE command is executed. If these tests are not completed successfully indicating an adapter failure, the bring-up error code will be returned in the BRING_UP field of the DIR.INITIALIZE parameter table. The CCB_RETCODE in the CCB will also contain X'07' (command canceled: unrecoverable failure) when the command is terminated. + +**For CCB2 and CCB3:** Bring-up testing is done during initialization when the adapter support software is loaded and when the DIR.INITIALIZE command is issued with the correct System Key. The results of the bring-up tests are returned to application programs when the DIR.OPEN.ADAPTER and DIR.INITIALIZE commands are executed. + +The bring-up error code is included in the ADAPTER_PARMS table of the DIR.OPEN.ADAPTER command. + +If during system initialization bring-up testing is not successful, error messages are displayed and logged in the ACSLAN.LOG file. + +The values shown for the bring-up codes are as if the values were contained in the AX register. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table B-16. Bring-up Error Codes for All CCBs (Token-Ring Network Adapters)
Code8086 TypeMeaning
X'0020'DWDiagnostics could not execute.
X'0022'DWROM (ROS) diagnostics failed.
X'0024'DWShared RAM diagnostics failed.
X'0026'DWProcessor instruction test failed.
X'0028'DWProcessor interrupt test failed.
X'002A'DWShared RAM interface register diagnostics failed.
X'002C'DWProtocol-handler diagnostics failed.
X'0040'DWAdapter's programmable timer for the workstation failed (set by the workstation code).
X'0042'DWCannot write to shared RAM (set by the workstation code).
X'0044'DWReading from shared RAM read-only area caused an invalid error indication (interrupt) (set by the workstation code).
X'0046'DWWriting into shared RAM read-only area did not cause an error indication (interrupt) (set by the workstation code).
X'0048'DWInitialization timed out.
+ +
Copyright IBM Corp. 1986, 1996
+<page_number>B.11 - 1</page_number> + +--- + + +## Page 484 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Token-Ring Network Adapter Open Errors for All CCBs + +B.12 Token-Ring Network Adapter Open Errors for All CCBs + +**For CCB1:** Adapter open testing is done when the DIR.OPEN.ADAPTER command is executed. If these tests are not completed successfully, indicating either an adapter failure or a ring problem, the open error codes will be returned in the OPEN_ERROR_CODE field of the DIR.OPEN.ADAPTER parameter table. The CCB_RETCODE in the CCB will also contain X'07' (command canceled--unrecoverable failure) when the command is terminated. + +**For CCB2 and CCB3:** Adapter open testing is done at system initialization, or when a physical open is issued as a result of the DIR.OPEN.ADAPTER command being issued. If these tests do not execute successfully, any subsequent DIR.OPEN.ADAPTER commands will be terminated with a return code of X'07'. + +The open error codes are passed back to the user in the DIR.OPEN.ADAPTER parameter table. + +Subtopics +B.12.1 Open Error Codes for All CCBs +B.12.2 Suggested Actions in Response to Open Errors + +
Copyright IBM Corp. 1986, 1996 +B.12 - 1
+ +--- + + +## Page 485 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Open Error Codes for All CCBs + +B.12.1 Open Error Codes for All CCBs + +The open errors are returned in 2 bytes. The high-order byte is always zero and the low-order byte contains the following: + +1. The phase of testing in which the error was encountered is in the high-order nibble (half-byte) of the low-order byte. +2. The error condition is in the low-order nibble of the low-order byte. + +Subtopics +B.12.1.1 Phases +B.12.1.2 Errors + +
Copyright IBM Corp. 1986, 1996
+<page_number>B.12.1 - 1</page_number> + +--- + + +## Page 486 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Phases + +B.12.1.1 Phases + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table B-17. Phases
ValueMeaning
'1n'Lobe media test
'2n'Physical insertion
'3n'Address verification
'4n'Roll call poll (neighbor notification)
'5n'Request parameters
+ +
Copyright IBM Corp. 1986, 1996
+<page_number>B.12.1.1 - 1</page_number> + +--- + + +## Page 487 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Errors + +B.12.1.2 Errors + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ValueMeaning
'n1'Function failure
'n2'Signal loss
'n3'Reserved
'n4'Reserved
'n5'Timeout
'n6'Ring failure
'n7'Ring beaconing
'n8'Duplicate node address
'n9'Parameter request
'nA'Remove received
'nB'Reserved
'nC'Reserved
'nD'No monitor detected
'nE'Monitor contention failed for RPL
+ +
Copyright IBM Corp. 1986, 1996 +B.12.1.2 - 1
+ +--- + + +## Page 488 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Suggested Actions in Response to Open Errors + +B.12.2 Suggested Actions in Response to Open Errors + +When the following Phase - Error combination values are presented, they are the result of certain specific occurrences. Explanation of the occurrences follows with recommended actions listed. Table B-19 in topic B.12.2.1 lists the recommended actions for both the application program and the workstation operator. + +X'11' Lobe Media, Function Failure + +Failure Definition: The testing of the lobe between the adapter and the access unit has been unsuccessful because the lobe has a bit-error rate that is too high, or the adapter cannot receive successfully. + +Recommended Actions: 1, 3, and 5 + +X'26' Physical Insertion, Ring Failure + +Failure Definition: The adapter, acting as an active monitor, was unable to complete the ring purge function successfully. This indicates that an error condition has occurred since the successful completion of monitor contention (claim token), when this adapter became the active monitor. + +Recommended Actions: 1 and 2a + +X'27' Physical Insertion, Ring Beaconing + +Failure Definition: The adapter has detected one of the following conditions. + +☐ The adapter tried to insert on a ring that was operating at a different data rate. + +☐ A monitor contention (claim token) failure occurred. + +☐ The adapter received a beacon MAC frame from the ring. + +Recommended Actions: 1, 2, and 2b + +X'2A' Physical Insertion, Timeout + +Failure Definition: The adapter has received a remove ring station MAC frame indicating that a network management function has directed this adapter to get off the ring. + +Recommended Actions: 2a and 4 + +X'2D' No Monitor Detected + +Failure Definition: RPL station is the first station attempting to insert onto the ring. + +Recommended Actions: 1 and 2a + +X'2E' Monitor Contention Failed for RPL + +Failure Definition: Physical insertion failure of RPL station. + +Recommended Actions: 2 + +X'32' Address Verification, Signal Loss + +Failure Definition: The adapter has detected a 250-ms signal loss (receiver cannot recognize signal) indicating that an error condition has occurred since the adapter successfully completed the ring signal recognition phase of the open operation. + +Recommended Actions: 1 and 2a + +X'35' Address Verification, Timeout + +Failure Definition: The insertion timer has expired before this function completed, indicating that the ring can be congested, experiencing a high bit-error rate, or losing an abnormally high number of tokens or frames, thus preventing successful Address Verification MAC frame transmissions. + +Recommended Actions: 1 and 2a + +X'36' Address Verification, Ring Failure + +Failure Definition: The adapter, acting as an active monitor, was unable to complete the ring purge function successfully. This indicates that an error condition has occurred since the successful completion of monitor contention (claim token), when this adapter became the active monitor. + +Recommended Actions: 1 and 2a + +X'37' Address Verification, Ring Beaconing + +Failure Definition: The adapter has either detected a monitor contention (claim token) failure or received a beacon MAC frame from the ring. + +Recommended Actions: 1 and 2b + +
Copyright IBM Corp. 1986, 1996
+<page_number>B.12.2 - 1</page_number> + +--- + + +## Page 489 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Suggested Actions in Response to Open Errors + +X'38' Address Verification, Duplicate Node Address + +Failure Definition: The adapter has detected that another station on the ring has an adapter address which is the same as the adapter address being tested. + +Recommended Actions: 4 + +X'3A' Address Verification, Remove Received + +Failure Definition: The adapter has received a remove ring station MAC frame indicating that a network management function has directed this specific address to get off the ring. + +Recommended Actions: 2a and 4 + +X'42' Ring Poll, Signal Loss + +Failure Definition: The adapter has detected a 250-ms signal loss (receiver cannot recognize signal) indicating that an error condition has occurred since the adapter successfully completed the ring signal recognition phase of the open operation. + +Recommended Actions: 1 and 2a + +X'45' Ring Poll, Timeout + +Failure Definition: The insertion timer has expired before this function completed, indicating that the ring can be congested, experiencing a high bit-error rate, or losing an abnormally high number of tokens or frames. This prevents the adapter's successful reception of either the ring poll request or response MAC frame, or transmission of the required ring poll response MAC frame. + +Recommended Actions: 1 and 2a + +X'46' Ring Poll, Ring Failure + +Failure Definition: The adapter, acting as an active monitor, was unable to complete the ring purge function successfully. This indicates that an error condition has occurred since the successful completion of monitor contention (claim token), when this adapter became the active monitor. + +Recommended Actions: 1 and 2a + +X'47' Ring Poll, Ring Beaconing + +Failure Definition: The adapter has either detected a monitor contention (claim token) failure or received a beacon MAC frame from the ring. + +Recommended Actions: 1 and 2b + +X'4A' Ring Poll, Remove Received + +Failure Definition: The adapter has received a remove ring station MAC frame, indicating that a network management function has directed this adapter to get off the ring. + +Recommended Actions: 2a and 4 + +X'55' Request Parameters, Timeout + +Failure Definition: The insertion timer has expired before this function completed, indicating that the ring can be congested, experiencing a high bit-error rate, or losing an abnormally high number of tokens or frames. This prevents successful transmission of the request parameter MAC frame or reception of either the set parameters 1 or set parameters 2 MAC frame (required response to the adapter's request). + +Recommended Actions: 1 and 2a + +X'56' Request Parameters, Ring Failure + +Failure Definition: The adapter, acting as an active monitor, was unable to complete the ring purge function successfully. This indicates that an error condition has occurred since the successful completion of monitor contention (when this adapter became the active monitor). + +Recommended Actions: 1 and 2a + +X'57' Request Parameters, Ring Beaconing + +Failure Definition: The adapter has received a beacon MAC frame from the ring. + +Recommended Actions: 1 and 2b + +X'59' Request Parameters, Parameter Request + +Failure Definition: The adapter has detected that the ring parameter server is present on the ring but that the required response (set parameters 1 or set parameter 2 MAC frame) has not been received in the allotted time. This indicates that the ring can be congested, experiencing a high bit-error rate, or losing an abnormally high number of tokens or frames. + +Recommended Actions: 1 and 2a + +X'5A' Request Parameters, Remove Received + +
Copyright IBM Corp. 1986, 1996
+
B.12.2 - 2
+ +--- + + +## Page 490 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Suggested Actions in Response to Open Errors + +**Failure Definition:** The adapter has received a remove ring station MAC frame, indicating that a network management function has directed this adapter to get off the ring. + +**Recommended Actions:** 2a and 4 + +Subtopics +B.12.2.1 Recommended Actions Table + +
Copyright IBM Corp. 1986, 1996 +B.12.2 - 3
+ +--- + + +## Page 491 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Recommended Actions Table + +B.12.2.1 Recommended Actions Table + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
No.Description
1After delaying at least 30 seconds, retry the open two times, inserting the same delay between each retry.
2After delaying at least 30 seconds, check the adapter configuration (especially the adapter data rate) and retry the open.
2aIf this error persists, direct the workstation operator to contact the network administrator for assistance and provide "Open Error" information.
2bIf this error persists, direct the workstation operator to contact the network administrator for assistance and provide information from the "Adapter Status Parameter Table" in topic B.5.
3Direct the workstation operator to contact the network administrator for assistance and provide "Open Error" information.
4Direct the workstation operator to contact the network administrator for assistance and provide "Node Address" information and try attaching to the ring after 6 minutes.
5If this error persists, problem determination of the adapter or lobe is necessary. Contact your network administrator for problem determination assistance.
+ +
Copyright IBM Corp. 1986, 1996
+<page_number>B.12.2.1 - 1</page_number> + +--- + + +## Page 492 + +LAN Technical Reference: 802.2 and NetBIOS APIs +PC Network and Ethernet Adapter Open Errors for All CCBs + +B.13 PC Network and Ethernet Adapter Open Errors for All CCBs + +The open error codes are returned in a DW. The high order byte is always zero. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table B-20. PC Network and Ethernet Adapter Open Errors for All CCBs
ValueMeaning
X'0022'No carrier **
X'0023'Continuous carrier **
X'0033'Unable to transmit
X'0038'Duplicate node address
X'003A'REMOVE frame received **
**This value is not set on Ethernet.
+ +
Copyright IBM Corp. 1986, 1996
+<page_number>B.13 - 1</page_number> + +--- + + +## Page 493 + +LAN Technical Reference: 802.2 and NetBIOS APIs +PC System Detected Errors + +B.14 PC System Detected Errors + +The following sections document PC detected errors for CCB1, CCB2, and CCB3. + +Subtopics +B.14.1 PC System Detected Errors for CCB1 +B.14.2 PC System Detected Errors for CCB2 +B.14.3 PC System Detected Errors for CCB3 + +
Copyright IBM Corp. 1986, 1996 +B.14 - 1
+ +--- + + +## Page 494 + +LAN Technical Reference: 802.2 and NetBIOS APIs +PC System Detected Errors for CCB1 + +B.14.1 PC System Detected Errors for CCB1 + +These types of errors are encountered by the protocol drivers during operation. + +**Note:** The PC System detected error is not intended as a substitute for normal workstation error detection, for example, a divide check. + +If the adapter support software detects an error condition in the workstation, the sequence of events will be determined by the type of error, which is passed to the appendage in register AL. + +This appendage is defined by the DIR.OPEN.ADAPTER, DIR.SET.USER.APPENDAGE, DIR.INITIALIZE, and DIR.MODIFY.OPEN.PARMS commands. + +The following information is passed to the appendage: + +1. Register AL contains the error code. +2. Register AH contains information on a per error code basis. + If register AH is used, it is indicated in the status code explanation. +3. Register CX contains the adapter number. +4. Registers ES and BX: + If both registers are not X'0000', they are pointers to a queue of commands that were pending when the error occurred. + If both registers are X'0000', either the command being executed could not be determined or it is not applicable. + +The error code is passed to the appendage in register AX. + +The PC System detected error codes are: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CodeMeaning
X'0000'Spurious interrupt detected.
X'0001'Access violation. An attempt to write into the read-only portion of shared RAM has occurred.
X'01xx'An ARB command code error, where "xx" is the command code.
X'02xx'An ARB return code error, where "xx" is the return code from the adapter.
X'03xx'An SRB/SSB command code error, where "xx" is the CCB command code.
X'04xx'ARB transmit data request error (the transmit CCB was not found), where "xx" is the command correlator from the adapter.
+ +
Copyright IBM Corp. 1986, 1996
+<page_number>B.14.1 - 1</page_number> + +--- + + +## Page 495 + +LAN Technical Reference: 802.2 and NetBIOS APIs +PC System Detected Errors for CCB2 + +B.14.2 PC System Detected Errors for CCB2 + +These types of errors are encountered by the adapter support software during operation. + +**Note:** The PC System detected error is not intended as a substitute for normal workstation error detection, for example, a divide check. + +If the adapter support software detects an error condition in the workstation or OS/2 generates a return code that is not acceptable for the given situation, an error code is passed to the application program through the READ command. + +In these cases the adapter will be closed, and adapter support software will assume the adapter has encountered an unrecoverable error. + +When the unrecoverable error is entered, link stations are closed and SAP, direct station buffer pools, pending receive frames, and CCBs can be returned to the application program if the PC_ERROR_FLAG is set. See DIR.SET.EXCEPTION.FLAGS on topic 3.3.14. + +Whenever a PC System detected error occurs, the application program can be notified if the PC_ERROR_FLAG is set. In order for an application program to receive notification of a PC System Detected error a READ command must be issued before the event occurs requesting notification of critical exceptions. When the event occurs, the READ command will be posted using a semaphore. + +The information listed in Table B-21 will be copied into the READ command parameter table. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Parameter NameByte Length8086 TypeDescription
NOTIFICATION_FLAG4DDUser exception flag
CCB_COUNT2DWCount of CCBs chained to EVENT_CCB_POINTER
EVENT_CCB_POINTER4DDPointer to the first of a queue of commands that were pending when the adapter closed
BUFFER_COUNT2DWCount of buffers chained to FIRST_BUFFER_ADDR
FIRST_BUFFER_ADDR4DDAddress of first buffer in SAP and direct station buffer pools
RCV_FRAME_COUNT2DWCount of received frames chained to RCV_FRAME_ADDR
RCV_FRAME_ADDR4DDAddress of the first received frame of a possible chain of frames
ERROR_DATA/ERROR_CODE2DWerror data and error code
FUNCTION_CODE1DBOS/2 command code that failed
1DBReserved
2DWReserved
PROCESS_ID2DWProcess ID
+ +NOTIFICATION_FLAG + +**Explanation:** User notification flag. + +This user exception flag is the PC_ERROR_FLAG as defined using the DIR.SET.EXCEPTIONS.FLAG command. + +FIRST_BUFFER_ADDR + +**Explanation:** Address of the first buffer in SAP and direct station buffer pools. + +Buffers provided with the DLC.OPEN.SAP and DIR.OPEN.DIRECT commands are returned to the application program when the adapter closes as a result of an unrecoverable error. + +RCV_FRAME_ADDR + +**Explanation:** Address of the first received frame. + +All received frames for this application program that were on the completion list at the time of the exception will be queued to this field when the adapter encounters an unrecoverable error. The first buffer of each frame will point to the next frame. + +Copyright IBM Corp. 1986, 1996 +B.14.2 - 1 + +--- + + +## Page 496 + +LAN Technical Reference: 802.2 and NetBIOS APIs +PC System Detected Errors for CCB2 + +ERROR_DATA/ERROR_CODE + +**Explanation:** Theses two fields contain the error code and associated data for the PC System detected error. + +The following list indicates both the ERROR_DATA and the ERROR_CODE. The format is X'ddcc' where dd is the error data and cc is the error code. byte. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CodeMeaning
X'0000'A Token-Ring Network adapter interrupt has occurred and the interrupt was unexpected. For example, the adapter is not open.
X'0001'Access violation: an attempt was made to write to the read-only portion of shared RAM.
X'01xx'ARB command code error: an undefined ARB was returned from the adapter. The "xx" indicates the command code.
X'02xx'ASB return code error: there was an unexpected ASB interrupt from the adapter as a result of an ARB command. The "xx" will be set to the return code from the adapter.
X'03xx'SRB/SSB command code error. The "xx" will be set to the CCB command code.
X'04xx'ARB transmit data request error: the transmit CCB was not found. The "xx" is the command correlator from the adapter.
X'05xx'Unacceptable error conditions resulting from OS/2 return code values.
If, while processing on the thread of an application program in the adapter support software device driver, an OS/2 return code is generated that is not acceptable for a given situation, the return code in the AX register will contain X'04'.
X'06xx'An adapter support software internal error. The "xx" will be set to an internal error code.
+ +**Note:** Codes not shown (X'07' through X'7F') are reserved. + +FUNCTION_CODE + +**Explanation:** The OS/2 command code that failed. + +This field is only used for an ERROR_CODE of X'05'. + +This field will contain the function code of a Device Help command that resulted in this PC System detected error. + +PROCESS_ID + +**Explanation:** The OS/2 process ID. + +This field is only used for the error codes X'05' and X'06', and will contain the OS/2 process ID that was dispatched while the error occurred. A process ID of X'0000' is used when an error occurs while processing an interrupt. + +
Copyright IBM Corp. 1986, 1996 +B.14.2 - 2
+ +--- + + +## Page 497 + +LAN Technical Reference: 802.2 and NetBIOS APIs +PC System Detected Errors for CCB3 + +B.14.3 PC System Detected Errors for CCB3 + +These types of errors are encountered by the adapter support software during operation. + +**Note:** The PC System detected error is not intended as a substitute for normal workstation error detection, for example, a divide check. + +If the adapter support software detects an error condition in the workstation, or OS/2 generates a return code that is not acceptable for the given situation, an error code is passed to the application program when the adapter support software calls the application program's device driver with the appropriate event appendage offset passed in register DI. Upon entry into the application program's device driver, the AX register will contain the error code. + +In these cases the adapter will be closed, and the adapter support software will assume that the adapter has encountered an unrecoverable error. + +When the unrecoverable error is entered: +☐ Link stations are closed. +☐ SAP and direct station buffer pools, and CCBs can be returned to the application program if the PC detected error appendage (PCERROR_APPNDG_OFFSET) has been defined using the DIR.SET.EXCEPTION.FLAGS command. + +See DIR.SET.EXCEPTION.FLAGS on topic 3.3.14. If the appendage has been defined, the adapter support software will call the application program's device driver with the PC system detected appendage offset passed in register DI to notify the user of the error. + +Whenever a PC System detected error occurs, the application program can be notified if the PC detected error appendage has been defined using the DIR.SET.EXCEPTION.FLAGS command. + +The information listed in Table B-22 is contained in the table pointed to by registers ES and BX when the adapter support software calls the application program's device driver with the appropriate event appendage offset passed in register DI. + +**Application Program Calls:** When the adapter support software calls the application program at the address obtained by the ATTACHDD function, the following information is provided to the using application program. +☐ An invocation code of X'0001' has been pushed onto the stack. Before returning to the adapter support software, the application program must remove the invocation code from the stack. +☐ Register DI contains the offset of the adapter check appendage as defined by the DIR.SET.EXCEPTIONS.FLAG command. +☐ Register DS contains the application program device driver's protect mode data segment. +☐ Register CX contains the adapter number. +☐ Registers ES and BX contain the address of the following 20-byte information table. +☐ Register AX contains the error code. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table B-22. PC System Detected Errors for CCB3
Parameter NameByte Length8086 TypeDescription
CCB_COUNT2DWCount of CCBs chained to EVENT_CCB_POINTER
EVENT_CCB_POINTER4DDPointer to the first of a queue of commands that were pending when the adapter closed
BUFFER_COUNT2DWCount of buffers chained to FIRST_BUFFER_ADDR
FIRST_BUFFER_ADDR4DDAddress of first buffer in SAP and direct station buffer pools
ERROR_DATA/ERROR_CODE2DWError data and error code
FUNCTION_CODE1DBOS/2 command code that failed
1DBReserved
2DWReserved
2DWReserved
+ +Copyright IBM Corp. 1986, 1996 +B.14.3 - 1 + +--- + + +## Page 498 + +LAN Technical Reference: 802.2 and NetBIOS APIs +PC System Detected Errors for CCB3 +FIRST_BUFFER_ADDR + +**Explanation:** Address of the first buffer in SAP and direct station buffer pools. + +Buffers provided with the DLC.OPEN.SAP and DIR.OPEN.DIRECT commands are returned to the application program when the adapter closes as a result of an unrecoverable error. + +ERROR DATA/ERROR CODE + +**Explanation:** These two fields contain the error code and associated data for the PC System detected error. + +The following list indicates both the ERROR_DATA and the ERROR_CODE. The format is X'ddcc' where dd is the error data and cc is the error code. byte. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CodeMeaning
X'0000'A Token-Ring Network adapter interrupt has occurred and the interrupt was unexpected. For example, the adapter is not open.
X'0001'Access violation: an attempt was made to write to the read-only portion of shared RAM.
X'01xx'ARB command code error: an undefined ARB was returned from the adapter. The "xx" indicates the command code.
X'02xx'ASB return code error: there was an unexpected ASB interrupt from the adapter as a result of an ARB command. The "xx" will be set to the return code from the adapter.
X'03xx'SRB/SSB command code error. The "xx" will be set to the CCB command code.
X'04xx'ARB transmit data request error: the transmit CCB was not found. The "xx" is the command correlator from the adapter.
X'05xx'Unacceptable error conditions resulting from OS/2 return code values.
If, while processing on the thread of an application program in the adapter support software device driver, an OS/2 return code is generated that is not acceptable for a given situation the immediate return code in the AX register will contain X'04'.
X'06xx'An adapter support software internal error. The "xx" will be set to an internal error code.
+ +**Note:** Codes not shown (X'07' through X'7F') are reserved. + +FUNCTION_CODE + +**Explanation:** The OS/2 command code that failed. + +This field is only used for an ERROR_CODE of X'05'. + +This field will contain the Function Code of a Device Help command that resulted in this PC System detected error. + +
Copyright IBM Corp. 1986, 1996 +B.14.3 - 2
+ +--- + + +## Page 499 + +LAN Technical Reference: 802.2 and NetBIOS APIs +System Action Exceptions for OS/2 EE 1.3 + +B.15 System Action Exceptions for OS/2 EE 1.3 + +The following sections document System Action exceptions for CCB2 and CCB3. + +Subtopics +B.15.1 System Action Exceptions for CCB2 +B.15.2 System Action Exceptions for CCB3 + +
Copyright IBM Corp. 1986, 1996
+<page_number>B.15 - 1</page_number> + +--- + + +## Page 500 + +LAN Technical Reference: 802.2 and NetBIOS APIs +System Action Exceptions for CCB2 + +B.15.1 System Action Exceptions for CCB2 + +This exception is the result of a system administrator issuing commands using the System Key defined by the configuration parameters. The following commands when issued with the System Key will result in a system action exception. + +DIR.CLOSE.ADAPTER +DIR.CLOSE.DIRECT +DIR.INITIALIZE +DIR.READ.LOG +DIR.SET.FUNCTIONAL.ADDRESS +DIR.SET.GROUP.ADDRESS +DLC.RESET + +System action exceptions result in an adapter closing, an adapter initializing, reading of either the adapter or direct interface logs, modification of the functional or group addresses, resetting link stations, or forced availability (closing) of the direct stations. When link stations are closed or the direct stations are closed due to a System Action exception, the link and direct station's buffer pools, pending receive frames, and CCBs can be returned to the application program if the SYSTEM_ACTION_FLAG is set. See the DIR.SET.EXCEPTION.FLAGS command on topic 3.3.14. + +Whenever a System Action occurs, the application program is notified if the SYSTEM_ACTION_FLAG is set and the using code has a READ pending. To receive notification of a System Action exception resulting from the DIR.CLOSE.ADAPTER and DIR.INITIALIZE commands, the READ command must be issued before the event occurs. The information listed in Table B-23 is copied into the READ command's parameter table and the READ command's semaphore is cleared to post the application program. + +For the commands and associated application programs that follow, if the SYSTEM_ACTION_FLAG is set, the adapter support software will notify the application program of system action exceptions. + +☐ DIR.CLOSE.ADAPTER for all application programs + +☐ DIR.CLOSE.DIRECT for an application program owning the direct interface (a previously issued DIR.OPEN.DIRECT command was successful) + +☐ DIR.INITIALIZE for all application programs + +☐ DIR.READ.LOG for an application program owning the direct interface (a previously issued DIR.OPEN.DIRECT command was successful) + +☐ DIR.SET.FUNCTIONAL.ADDRESS for all application programs + +☐ DIR.SET.GROUP.ADDRESS for all application programs + +☐ DLC.RESET for application programs owning the affected SAPs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table B-23. System Action Exceptions for CCB2
Parameter NameByte Length8086 TypeDescription
NOTIFICATION_FLAG4DDUser exception flag
CCB_COUNT2DWCount of CCBs chained to EVENT_CCB_POINTER
EVENT_CCB_POINTER4DDPointer to the first of a queue of commands that were pending when the adapter closed or when direct stations are closed
BUFFER_COUNT2DWCount of buffers chained to FIRST_BUFFER_ADDR
FIRST_BUFFER_ADDR4DDAddress of first buffer in SAP or DIRECT buffer pools
RCV_FRAME_COUNT2DWCount of received frames chained to RCV_FRAME_ADDR
RCV_FRAME_ADDR4DDAddress of the first received frame of a possible chain of frames
SYSTEM_ACTION_ID1DBSystem action identifier
SAP_STATION_RESET1DBLink station reset
+ +NOTIFICATION_FLAG + +Explanation: User notification flag. + +Copyright IBM Corp. 1986, 1996 +B.15.1 - 1 + +--- + + +## Page 501 + +LAN Technical Reference: 802.2 and NetBIOS APIs +System Action Exceptions for CCB2 + +This user exception flag is SYSTEM_ACTION_FLAG as defined using the DIR.SET.EXCEPTION.FLAGS command. + +FIRST_BUFFER_ADDR + +**Explanation:** Address of the first buffer in SAP and direct station buffer pools. + +Buffers provided with the DLC.OPEN.SAP and DIR.OPEN.DIRECT commands are returned to the application program if link stations are closed or reset. + +RCV_FRAME_ADDR + +**Explanation:** Address of the first received frame. + +All received frames for the affected link stations that were on the completion list at the time of the exception will be queued to this field. The first buffer of each frame will point to the next frame. + +SYSTEM_ACTION_ID + +**Explanation:** System action identifier code. + +The system action identifier code is passed to the user in the SYSTEM_ACTION_ID field. This code identifies the command issued that generated the system action exception. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CodeMeaning
X'01'DIR.CLOSE.ADAPTER command issued resulting in the adapter closing.
X'02'DIR.INITIALIZE command issued reinitializing the adapter.
X'03'DIR.READ.LOG command issued reading the adapter or direct interface logs.
X'04'DIR.SET.FUNCTIONAL.ADDRESS command issued modifying the functional address.
X'05'DIR.SET.GROUP.ADDRESS command issued modifying the group address.
X'06'DLC.RESET command issued resetting a single SAP.
When a single SAP is reset, the SAP_STATION_RESET field will contain the SAP that was reset.
X'07'DLC.RESET command issued resetting all link stations.
When all link stations are reset, no link station values are returned.
X'08'DIR.CLOSE.DIRECT command issued resulting in the direct stations closing and becoming available.
+ +SAP_STATION_RESET + +**Explanation:** Link station reset. + +If the SYSTEM_ACTION_ID is set to X'06', then this value contains the SAP number that was reset. + +
Copyright IBM Corp. 1986, 1996
+<page_number>B.15.1 - 2</page_number> + +--- + + +## Page 502 + +LAN Technical Reference: 802.2 and NetBIOS APIs +System Action Exceptions for CCB3 + +B.15.2 System Action Exceptions for CCB3 + +This exception is the result of a system administrator issuing commands using the System Key defined by the configuration parameters. The following commands when issued with the System Key will result in a system action exception. + +DIR.CLOSE.ADAPTER +DIR.CLOSE.DIRECT +DIR.INITIALIZE +DIR.READ.LOG +DIR.SET.FUNCTIONAL.ADDRESS +DIR.SET.GROUP.ADDRESS +DLC.RESET + +System action exceptions result in an adapter closing, an adapter initializing, reading of either the adapter or direct interface logs, modification of the functional or group addresses, resetting link stations, or forced availability (closing) of the direct stations. When link stations are closed or the direct stations are closed due to a System Action exception, the link and direct station's buffer pools and CCBs can be returned to the application program if the user has passed the system action appendage (SYSTEM_ACTION_APPNDG_OFFSET) to the adapter support software by issuing the DIR.SET.EXCEPTION.FLAGS command. See the DIR.SET.EXCEPTION.FLAGS command on topic 3.3.14. + +Whenever a System Action occurs, the application program is notified if the SYSTEM_ACTION_APPNDG_OFFSET has been defined to the adapter support software. Once the exception has occurred, the information listed in Table B-24 is copied into the table referenced by the ES and BX registers when the adapter support software calls the application program's device driver with the appropriate event appendage offset passed in register DI. + +For the commands and associated application programs that follow, if the SYSTEM_ACTION_APPNDG_OFFSET is set, the adapter support software will notify the application program of system action exceptions. + +☐ DIR.CLOSE.ADAPTER for all application programs + +☐ DIR.CLOSE.DIRECT for an application program owning the direct interface (a previously issued DIR.OPEN.DIRECT command was successful) + +☐ DIR.INITIALIZE for all application programs + +☐ DIR.READ.LOG for an application program owning the direct interface (a previously issued DIR.OPEN.DIRECT command was successful) + +☐ DIR.SET.FUNCTIONAL.ADDRESS for all application programs + +☐ DIR.SET.GROUP.ADDRESS for all application programs + +☐ DLC.RESET for application programs owning the affected SAPs + +Application Program Calls: When the adapter support software calls the application program device driver entry point, the following information is provided to the using application program. + +☐ An invocation code of X'0001' has been pushed onto the stack. Before returning to the adapter support software, the application program must remove the invocation code from the stack. + +☐ Register DI contains the offset of the adapter check appendage as defined by the DIR.SET.EXCEPTIONS.FLAG command. + +☐ Register DS contains the application program device driver's protect mode data segment. + +☐ Register CX contains the adapter number. + +☐ Registers ES and BX contain the address of the following 14-byte information table. + +☐ Register AL contains the system action ID. + +☐ Register AH contains the SAP value associated with the system action ID. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table B-24. System Action Exceptions for CCB3
Parameter NameByte Length8086 TypeDescription
CCB_COUNT2DWCount of CCBs chained to EVENT_CCB_POINTER
EVENT_CCB_POINTER4DDPointer to the first of a queue of commands that were pending when the adapter closed or when the direct stations are closed
BUFFER_COUNT2DWCount of buffers chained to FIRST_BUFFER_ADDR
FIRST_BUFFER_ADDR4DDAddress of first buffer in SAP
+ +Copyright IBM Corp. 1986, 1996 +B.15.2 - 1 + +--- + + +## Page 503 + +LAN Technical Reference: 802.2 and NetBIOS APIs +System Action Exceptions for CCB3 + + + + + + + + + + + + + + + + + + + + + + + + +
or direct station buffer pools
SYSTEM_ACTION_ID1DBSystem action identifier
SAP_STATION_RESET1DBLink station reset
+ +FIRST_BUFFER_ADDR +Explanation: Address of the first buffer in SAP and direct station buffer pools. + +Buffers provided with the DLC.OPEN.SAP and DIR.OPEN.DIRECT commands are returned to the application program if link stations are closed or reset. + +SYSTEM_ACTION_ID +Explanation: System action identifier code. + +The system action identifier code is passed to the user in the SYSTEM_ACTION_ID field. This code identifies the command issued that generated the system action exception. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CodeMeaning
X'01'DIR.CLOSE.ADAPTER command issued resulting in the adapter closing.
X'02'DIR.INITIALIZE command issued reinitializing the adapter.
X'03'DIR.READ.LOG command issued reading the adapter and/or direct interface logs.
X'04'DIR.SET.FUNCTIONAL.ADDRESS command issued modifying the functional address.
X'05'DIR.SET.GROUP.ADDRESS command issued modifying the group address.
X'06'DLC.RESET command issued resetting a single SAP
When a single SAP is reset, the SAP_STATION_RESET field will contain the SAP that was reset.
X'07'DLC.RESET command issued resetting all link stations.
When all link stations are reset no link station values are returned.
X'08'DIR.CLOSE.DIRECT command issued resulting in the direct stations closing.
+ +SAP_STATION_RESET +Explanation: Link station reset. + +If the SYSTEM_ACTION_ID is set to X'06', then this value contains the SAP number that was reset. + +
Copyright IBM Corp. 1986, 1996 +B.15.2 - 2
+ +--- + + +## Page 504 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Appendix C. LAN Sample Program Listings Diskette + +C.0 Appendix C. LAN Sample Program Listings Diskette + +Sample program listings are included on the diskette provided with this manual. These listings provide examples of NetBIOS use and the IEEE 802.2 interface use for both DOS and OS/2. + +See the DOC files on the diskette for a description of the sample program listings. + +The materials on this diskette could include technical inaccuracies, typographical errors, or incompatibilities with IBM products, and could be modified or excluded from the generally available reference materials. IBM expressly reserves the right, without notice to you, to modify the information contained in this book in a manner that affects the compatibility or usability of the application programs developed by you using the materials on this diskette. + +INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS DISKETTE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + +It is possible that this diskette may contain reference to, or information about IBM products (machines and programs), programming, or services that are not announced in your country. Such references or information must not be construed to mean that IBM intends to announce such IBM products, programming, or services in your country. + +System Administrators may copy and distribute the sample programs on this diskette in any form without payment to IBM, for the purpose of developing, using, marketing, or distributing application programs for use with the IBM Token-Ring Network and IBM PC Network. + +Attach a label that contains the following copyright notice to each copy: + +Version 3.0 (C) Copyright International Business Machines Corp. 1986, 1993 + +
Copyright IBM Corp. 1986, 1996
+<page_number>C.0 - 1</page_number> + +--- + + +## Page 505 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Appendix D. The LAN Support Program Interrupt Arbitrator + +D.0 Appendix D. The LAN Support Program Interrupt Arbitrator + +Subtopics +D.1 About This Appendix +D.2 The LAN Support Program Interrupt Arbitrator (DXMA0MOD.SYS) + +
Copyright IBM Corp. 1986, 1996
+<page_number>D.0 - 1</page_number> + +--- + + +## Page 506 + +LAN Technical Reference: 802.2 and NetBIOS APIs +About This Appendix + +D.1 About This Appendix + +This appendix describes the software interface and the registration process of the LAN Support Program interrupt arbitrator. This module makes the X'5C' interrupt available to the program interfaces that use it. + +**Note:** For all other information about the LAN Support Program, including descriptions of the parameters, refer to the *Local Area Network Support Program User's Guide* for your version of the LAN Support Program. + +
Copyright IBM Corp. 1986, 1996
+<page_number>D.1 - 1</page_number> + +--- + + +## Page 507 + +LAN Technical Reference: 802.2 and NetBIOS APIs +The LAN Support Program Interrupt Arbitrator (DXMA0MOD.SYS) + +D.2 The LAN Support Program Interrupt Arbitrator (DXMA0MOD.SYS) + +This section describes the software interface to and the registration process of the LAN Support Program interrupt arbitrator. The LAN Support Program interrupt arbitrator is a software module provided with the LAN Support Program diskette. The purpose of the LAN Support Program interrupt arbitrator is to remove the majority of the load order dependencies of the interfaces provided by the LAN Support Program. + +**Important:** In this appendix the acronym CCB (command control block) will apply only to the IEEE 802.2 adapter support software supplied with the LAN Support Program. + +Currently there are two software interfaces to IBM's network adapters: + +☐ NetBIOS +☐ The IEEE 802.2 Interface. + +A usability problem arises because both of these interfaces utilize the X'5C' software interrupt in their API. + +Since two network adapters can be installed when using the LAN Support Program, multiple IEEE 802.2 interfaces or NetBIOS may be present in a workstation at one time. This situation currently requires that each interface know whether another interface is also using the X'5C' interrupt, so that it can pass any control blocks that it does not understand (or that are not for its adapter) to the next X'5C' interrupt handler in the chain. + +This need to know whether the other interfaces are using the X'5C' interrupt results in replicated logic at the entry points to the interrupt handlers. In addition, due to migration considerations, the interrupt handlers may have to be loaded in a specific sequence to avoid conflicts. + +The LAN Support Program interrupt arbitrator eliminates these problems by having a single owner of the X'5C' software interrupt. It takes over the X'5C' interrupt vector and then allows the other users of the X'5C' interrupt to register with itself. Registering programs specify which interface they provide (IEEE 802.2 or NetBIOS) and for which network adapter (0 or 1). The LAN Support Program interrupt arbitrator then monitors the flow of control blocks across the X'5C' interrupt and routes the control block to the appropriate interface. + +The use of the LAN Support Program interrupt arbitrator eliminates the two previously stated problems. Since there is a single owner of the X'5C' interrupt, all logic for determining how to route the control blocks is contained there, not replicated in each individual interface. In addition, since each interface registers its needs with the LAN Support Program interrupt arbitrator, the interface modules can be loaded in any sequence. The only requirement is that the LAN Support Program interrupt arbitrator must be loaded first. + +Subtopics +D.2.1 Registration Process Overview + +
Copyright IBM Corp. 1986, 1996
+<page_number>D.2 - 1</page_number> + +--- + + +## Page 508 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Registration Process Overview + +D.2.1 Registration Process Overview + +When a network interface program wants to register with the LAN Support Program interrupt arbitrator, it should perform the following functions during its initialization sequence: + +1. Test that the LAN Support Program Interrupt Arbitrator Present flag (bit 5 at memory location 0040:00A1) is set. If the LAN Support Program Interrupt Arbitrator Present flag is not set, the requesting interface will abort its load and print the appropriate error message (in English) indicating that the required software is not present. + +2. Build a language request CCB (See "Language Request CCB" in topic D.2.1.1 for the definition of this CCB). + +3. Place the address of the language request CCB in registers ES and BX. + +4. Execute an INT X'5C' instruction. + +5. Save the returned language code index. + +6. Test the CCB_RETCODE field. + * If CCB_RETCODE is X'83', abort the load. + * Otherwise continue the load sequence. + +7. Build the appropriate network interrupt registration request CCB (see "Interface Registration CCB" in topic D.2.1.2 and "NCB Handler Registration for NetBIOS using IEEE 802.2" in topic D.2.1.3 for the definitions of these CCBs). + +8. Place the address of the registration request CCB in registers ES and BX. + +9. Execute an INT X'5C' instruction. + +10. Test the return code field; if this field is non-zero, the registration request has failed. + * If the registration request fails, the requesting program should print an error message to the standard output device, and abort the load. The error message displayed depends on the return code. + * If the return code field is zero, the registration request has been accepted and the requesting program can continue its load sequence. + +Subtopics +D.2.1.1 Language Request CCB +D.2.1.2 Interface Registration CCB +D.2.1.3 NCB Handler Registration for NetBIOS using IEEE 802.2 +D.2.1.4 Additional Functions + +
Copyright IBM Corp. 1986, 1996
+<page_number>D.2.1 - 1</page_number> + +--- + + +## Page 509 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Language Request CCB + +D.2.1.1 Language Request CCB + +**LANGUAGE REQUEST** + +**Return Codes (CCB_RETCODE):** + +X'00' Operation was completed successfully. +X'83' LAN Support Program Interrupt arbitrator load failed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table D-1. Interrupt Arbitrator Return Codes
OffsetField NameByte Length8086 TypeDescription
0CCB_ADAPTER1DBAdapter 0 or 1
1CCB_COMMAND1DBX'31': Language Request
2CCB_RETCODE1DBSet by network arbitrator on return
3CCB_LC1DBLanguage code for messages *
42DBReserved
64DDAddress of the DXMA0MOD.SYS software interrupt entry point *
106DBReserved
+ +* Indicates a returned value (for example, a value set by the LAN Support Program interrupt arbitrator). + +The address of the DXMA0MOD.SYS software entry point is returned only by LAN Support Program Versions 1.3 and higher. This address may be called to pass CCBs and NCBs to DXMA0MOD.SYS rather than using an INT X'5C'. When you call this address, you must be sure ES:BX points to the CCB or NCB and that the calling application program simulates an interrupt by doing a PUSHF followed by a CALL FAR. + +This entry point should not be called by any application program loaded after Microsoft Windows has been loaded. + +--- + +**CCB_ADAPTER** + +**Explanation:** This command is adapter-independent. However, the value contained in this field must be less than X'04'. + +--- + +**CCB_LC** + +**Explanation:** The LAN Support Program interrupt arbitrator uses this field to return the DOS country code to the registering interface. The registering interface should use this value to determine the language in which to print any error messages. See the Local Area Network User's Guide or the user's guide for DOS to determine the meaning of the values returned in this field. + +
Copyright IBM Corp. 1986, 1996
+<page_number>D.2.1.1 - 1</page_number> + +--- + + +## Page 510 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Interface Registration CCB + +D.2.1.2 Interface Registration CCB + +**REGISTRATION REQUEST** + +**Return Codes (CCB_RETCODE):** + +X'00' Operation was completed successfully +X'80' CCB interface already registered for requested adapter +X'81' NetBIOS already registered for requested adapter +X'83' LAN Support Program interrupt arbitrator load failed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table D-2. Interface Registration CCB Parameter Table
OffsetField NameByte Length8086 TypeDescription
0CCB_ADAPTER1DBAdapter 0 or 1
1CCB_COMMAND1DBX'32': Network interrupt registration
2CCB_RETCODE1DBReturn code*
3CCB_WORK1DBReserved
45C_ENTRY4DD@ to pass control for any CCB and NCBs
8NCB_FLAGS4DD@ of flags passed to NetBIOS is AL
12CCB_PARM1DBDefines type of registration request
13CCB_CONFIG1DBInterface configuration data
14CCB_TRACE2DWOffset to CCB trace routine
+ +* Indicates a returned value (for example, a value set by the LAN Support Program interrupt arbitrator). +@ Indicates an address throughout this document. + +--- + +**CCB_ADAPTER** + +**Explanation:** This field indicates which adapter the registration request is for. If an interface wants to register for both adapters, it must issue two separate registration requests. + +--- + +**5C_ENTRY** + +**Explanation:** This is the address to which the LAN Support Program interrupt arbitrator passes control when it detects a CCB or NCB for the specified adapter. The LAN Support Program interrupt arbitrator pushes all registers (except for AX) onto the stack and then transfers control to the specified address by a simulated INT instruction. The registers (except for AX) will be restored after the registered interface executes the IRET instruction to return control to the application program that issued the CCB or NCB. + +The registers are pushed in the following order: BX, CX, DX, DI, SI, BP, ES, DS. + +--- + +**NCB_FLAGS** + +**Explanation:** This is the address of the 1-byte flag field that is to be passed to the NetBIOS interface that is registered for the same adapter number when an appropriate NetBIOS is detected. The byte pointed to by this field is loaded into the AL register before control is passed to NetBIOS. This field is only meaningful for a CCB interface registration. The contents of this field are ignored for a NetBIOS interface registration. + +--- + +**CCB_PARM** + +**Explanation:** This is a bit-significant field that is used to determine the type of registration request. The definition of the bits contained in this field are as follows: + + + + + + + + + + + + + + +
BitMeaning
0CCB interface (IEEE 802.2 interface)
+ +This bit indicates that the requesting interface is an IEEE 802.2 CCB interface. + +
Copyright IBM Corp. 1986, 1996
+<page_number>D.2.1.2 - 1</page_number> + +--- + + +## Page 511 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Interface Registration CCB + +1 NetBIOS (NetBIOS not using IEEE 802.2) +This bit indicates that the requesting interface is a NetBIOS interface. + +2-6 Reserved + +7 Override Indicator +This bit indicates that the requesting interface wants to override any currently registered interface on the specified adapter. An example of the use of this bit would be for the LAN Support Program product. Since the LAN Support Program converts the NCB interface on an original PC Network Adapter to an IEEE 802.2 CCB interface, the override bit would be required because the original PC Network Adapter would already be "auto-registered" as an NCB interface. This bit is only meaningful when used in conjunction with bit 1 of this field. + +--- + +CCB_CONFIG + +**Explanation:** This field is used to determine the configuration characteristics of the registering interface. For CCB interfaces, the contents of this field are passed to any registering NCB interfaces in the CCB_WORK field of the DEFINE.MIF command used to register the NCB interface. See "NCB Handler Registration for NetBIOS using IEEE 802.2" in topic D.2.1.3 for the definition of the DEFINE.MIF command. The definition of the bits contained in this field are: + + + + + + + + + + + + + + +
BitMeaning
03270 Workstation Program Supported
+ +This bit indicates that the requesting interface supports the 3270 Workstation Program with the XMA adapter. When this bit is set the LAN Support Program interrupt arbitrator activates logic that provides the required environment data to the registered interface via the interface defined in "3270 Workstation Support" in topic D.2.1.4. + +1-7 Reserved + +--- + +CCB_TRACE + +**Explanation:** This field contains the offset portion of the address to the CCB trace routine. The segment portion of the address is assumed to be the same as the 5C_ENTRY segment. + +This address allows the LAN Support Program interrupt arbitrator to pass trace data to the registered CCB interface's trace routine for: +☐ NCBs passed to NetBIOS that is using the registered CCB interface. +☐ CCBs that are rejected by the LAN Support Program interrupt arbitrator. + +When the trace is active, the LAN Support Program interrupt arbitrator will make a CALL FAR to the specified address with the registers set as follows: + +☐ If the traced control block is an NCB, the register values are: +CH Adapter number +CL X'0F' (Trace ID) +DH Return code +DL Command code +SI Number of bytes pushed on the stack since the INT X'5C' plus 4. (This includes the 4 bytes pushed on the stack during the Call Far.) + +This value is used to determine the location of the interrupt address on the stack. + +☐ If the traced control block is a CCB, the register values are: +CH X'00' +CL Adapter number +DH Return code +DL Command code +SI Number of bytes pushed on the stack since the INT X'5C' plus 4. (This includes the 4 bytes pushed on the stack during the Call Far.) + +This value is used to determine the location of the interrupt address on the stack. + +
Copyright IBM Corp. 1986, 1996 +D.2.1.2 - 2
+ +--- + + +## Page 512 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB Handler Registration for NetBIOS using IEEE 802.2 + +D.2.1.3 NCB Handler Registration for NetBIOS using IEEE 802.2 + +NCB registration is done using a modified DIR.DEFINE.MIF.ENVIRONMENT command. The command is essentially the same as the DIR.DEFINE.MIF.ENVIRONMENT command with one exception: + +The CCB_WORK field has been changed to the CCB_CONFIG field. + +After the LAN Support Program interrupt arbitrator has used the DEFINE.MIF command to register the interface with the LAN Support Program interrupt arbitrator, the CCB is forwarded to the appropriate CCB interfaces for further processing. + +NCB REGISTRATION + +Return Codes (CCB_RETCODE): + +X'00' Operation was completed successfully +X'01' Invalid command code +X'1B' Invalid CCB_PARM_TAB pointer +X'1C' Invalid pointer in the CCB parameter table +X'1D' Invalid adapter number (no CCB interface registered) +X'82' NCB interface already registered for requested adapter +X'84' Duplicate CCB registration, PCNET is primary + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table D-3. NCB Registration Parameter Table
OffsetField NameByte Length8086 TypeDescription
0CCB_ADAPTER1DBAdapter 0 or 1
1CCB_COMMAND1DBX'2B': DIR.DEFINE.MIF.ENVIRONMENT
2CCB_RETCODE1DBCommand return (completion) code
3CCB_CONFIG1DBCCB interface configuration data *
4CCB_POINTER4DDQueue pointer and work area
8CCB_CMD_CMPL4DDCommand completion user appendage
12CCB_PARM_TAB4DDPointer to CCB parameter table
+ +* Indicates a returned value (for example, a value set by the LAN Support Program interrupt arbitrator). + +CCB_CONFIG + +Explanation: The LAN Support Program interrupt arbitrator passes the configuration data from the registered CCB interface to the registering NCB interface in this field. The definition of the bits contained in this field are: + +Bit Meaning +0 3270 Workstation Program supported + +This bit indicates that the requesting interface supports the 3270 Workstation Program with the XMA adapter. When this bit is set, the LAN Support Program interrupt arbitrator activates logic that provides the required environment data to the registered interface via the interface defined in "3270 Workstation Support" in topic D.2.1.4. + +1-7 Reserved + + + + + + + + + + + + + + + + + + + + + + + +
Table D-4. CCB Parameter Table Structure
OffsetField NameByte Length8086 TypeDescription
0NCB.INPUT@4DDAddress of NCB input module
+ +Copyright IBM Corp. 1986, 1996 +D.2.1.3 - 1 + +--- + + +## Page 513 + +LAN Technical Reference: 802.2 and NetBIOS APIs +NCB Handler Registration for NetBIOS using IEEE 802.2 + + + + + + + + + + + + + + + + + + + + + + + +
4NCB.OPEN@4DDAddress of the NCB open module
8NCB.CLOSE@4DDAddress of the NCB Close module
12NCB.ENABLE@4DDAddress of the interrupt enable module *
+ +* Indicates a returned value (for example, a value set by the LAN Support Program interrupt arbitrator). + +NCB_INPUT@ + +**Explanation:** This is the address to which the LAN Support Program interrupt arbitrator passes control when it detects an NCB for the specified adapter. The LAN Support Program interrupt arbitrator pushes all registers (except for AX) onto the stack and then transfers control to the specified address by a simulated INT instruction. The registers (except for AX) will be restored after the registered interface executes the IRET instruction to return control to the application program that issued the NCB. + +The registers are pushed in the following order: BX, CX, DX, DI, SI, BP, ES, DS. + +NCB_ENABLE@ + +**Explanation:** It should be noted that the value returned in this field is from the CCB interface registered for adapter 1 if multiple CCB interfaces are registered with the LAN Support Program interrupt arbitrator. + +
Copyright IBM Corp. 1986, 1996
+<page_number>D.2.1.3 - 2</page_number> + +--- + + +## Page 514 + +D.2.1.4 Additional Functions + +**Monitored Control Blocks:** There are certain CCB_COMMAND values that are adapter independent. These commands are intended for all currently active CCB interfaces. These CCB_COMMAND values include: + +X'2B' DIR.DEFINE.MIF.ENVIRONMENT + +X'24' PDT.TRACE.ON + +X'25' PDT.TRACE.OFF + +The LAN Support Program Interrupt Arbitrator monitors the CCB interface for the occurrence of one of these CCB_COMMANDS. When one of these commands is detected, the LAN Support Program interrupt arbitrator propagates the CCB to all currently registered CCB interfaces. If the CCB_CMD_CMPL field is not zero, then the LAN Support Program interrupt arbitrator gives control to the defined appendage after the CCB has been passed to all of the registered CCB interfaces. + +**3270 Workstation Support:** The LAN Support Program interrupt arbitrator supports the 3270 Workstation Program including bank swapping with the XMA adapter via the following interface. + +When a CCB or NCB interface registers with the 3270 Workstation Program supported bit set (bit 0 in the CCB_IG field), the LAN Support Program interrupt arbitrator will activate the following interfaces: + +For CCB interfaces: +- The AX register will be used to indicate the currently active bank to the registered CCB interface. + - AX = X'FFFF' indicates that the 3270 Workstation Program is not loaded, or bank swapping is not active so all programs are in common memory. + - AX = X'00FF' indicates that the 3270 Workstation Program is loaded and bank swapping is active. However the "CCB in common memory" bit (bit 3 in the CCB_ADAPTER field) is set indicating that the control block is in common memory. + - AX <> X'FFFF' or <> X'00FF' indicates that the 3270 Workstation Program is loaded and bank swapping is active. AX contains the current environment and bank ID. This information is in the same format that would be returned via an interrupt X'7A' function X'9D' request to the 3270 Workstation Program. + +For NetBIOS interfaces: +- The first 2 bytes of the NCB reserved space (offset X'32') will be used to indicate the currently active bank to the registered NetBIOS interface. + - NCB offset X'32' = X'FFFF' indicates that the 3270 Workstation Program is not loaded, or bank swapping is not active so all programs are in common memory. + - NCB offset X'32' <> X'FFFF' indicates that the 3270 Workstation Program is loaded and bank swapping is active. Offset X'32' in the NCB/NCB contains the current environment and bank ID. This information is in the same format that would be returned via an interrupt X'7A' function X'9D' request to the control program. + +
Copyright IBM Corp. 1986, 1996
+<page_number>D.2.1.4 - 1</page_number> + +--- + + +## Page 515 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Appendix E. Operating System/2 Extended Edition Information + +E.0 Appendix E. Operating System/2 Extended Edition Information + +Subtopics +E.1 About This Appendix +E.2 CONFIG.SYS Commands +E.3 OS/2 EE NetBIOS Parameters +E.4 OS/2 EE Trace Facility +E.5 Trace Code Definition +E.6 OS/2 EE NetBIOS Trace Facility + +
Copyright IBM Corp. 1986, 1996
+<page_number>E.0 - 1</page_number> + +--- + + +## Page 516 + +LAN Technical Reference: 802.2 and NetBIOS APIs +About This Appendix + +E.1 About This Appendix + +This appendix contains information specific to OS/2 EE Version 1.3. + +
Copyright IBM Corp. 1986, 1996
+<page_number>E.1 - 1</page_number> + +--- + + +## Page 517 + +E.2 CONFIG.SYS Commands + +The OS/2 System Initialization facility processes the configuration commands in the CONFIG.SYS file, establishing the final operating environment. + +The CONFIG.SYS file contains commands used to configure the workstation. During workstation initialization, OS/2 opens and reads the CONFIG.SYS file and interprets the commands within the file. The adapter support software relies on the DEVICE command to install its device drivers (LANDD.SYS/TRNETDD.SYS/PCNETDD.SYS) and NetBIOS (NETBDD.SYS). + +The DEVICE command is used to specify the path and file names of the adapter support software's device drivers so that they may be installed. + +The keyword "cfg=" is provided on the DEVICE command line which is used to specify the path and file name of a configuration file. The configuration file is created by the configuration aid in OS/2 EE 1.3. If the parameter is not provided or the file is not found, a set of defaults will be used as described in the following section. + +There is also a trace level parameter passed to the adapter support software with the DEVICE command to enable OS/2 workstation tracing for the adapter support software (see "OS/2 EE Trace Facility" in topic E.4 for more information about the OS/2 trace). The keyword t=n (where n can be 2, 3, or 4) is provided on the DEVICE command line. + +These CONFIG.SYS commands might appear as follows in the CONFIG.SYS file: + +DEVICE=LANDD.SYS (Using NetBIOS or adapter support software Device Driver Interface) +DEVICE=TRNETDD.SYS CFG=pathname\filename.CFG t=n (Token-Ring Network) +DEVICE=PCNETDD.SYS CFG=pathname\filename.CFG t=n (PC Network) +DEVICE=ETHERDD.SYS CFG=pathname-filename.CFG t=n (Ethernet) +DEVICE=NETBDD.SYS CFG=pathname\filename.CFG t=n + +Notes: + +1. These command statements are only examples; refer to IBM Operating System/2 Extended Edition Version 1.1 Command Reference for details on how these commands can be used. (Refer to IBM Operating System/2 Extended Edition Version 1.2 Command Reference if you are using Ethernet.) + +2. The DEVICE=LANDD.SYS command must appear first in the CONFIG.SYS file. + +You need to add new commands to CONFIG.SYS for Ethernet support. Refer to IBM Operating System/2 Extended Edition 1.1 System Administrator's Guide for Communications for information about CONFIG.SYS commands. + +3. The PC Network configuration and the Ethernet configuration are mutually exclusive. Only one of these configurations can be used at the same time. + +The following list summarizes the global parameters that define the user's environment for each adapter. + +☐ OPEN_OPTIONS (not used for PC Network and Ethernet support) + +Note: Some of these options can only be set by the application program. + +☐ NODE_ADDRESS + +☐ GROUP_ADDRESS (set only by the application program) + +☐ FUNCTIONAL_ADDRESS (set only by the application program) + +☐ NUMBER_RCV_BUFFERS + +☐ RCV_BUFFER_LENGTH + +☐ DHB_BUFFER_LENGTH + +☐ DATA_HOLD_BUFFERS (not used for PC Network or Ethernet support) + +☐ PRODUCT_ID + +☐ SRAM_ADDRESS (Not used for PC Network or Ethernet support) + +☐ DLC_MAX_SAP + +☐ DLC_MAX_STATIONS + +☐ DLC_MAX_GSAP + +☐ DLC_MAX_GSAP_MEM + +☐ DLC_T1_TICK_ONE + +☐ DLC_T2_TICK_ONE + +☐ DLC_T1_TICK_TWO + +☐ DLC_T2_TICK_TWO + +
Copyright IBM Corp. 1986, 1996
+<page_number>E.2 - 1</page_number> + +--- + + +## Page 518 + +LAN Technical Reference: 802.2 and NetBIOS APIs +CONFIG.SYS Commands + +☐ DLC_TI_TICK_TWO +☐ SYSTEM_KEY +☐ MAX_USERS +☐ ADAPTER_WORK_SIZE (used only for PC Network and Ethernet adapters) +☐ QSIZE +☐ GDTSIZE +☐ NETWORK_FLAGS (Used only for Ethernet adapter) + +None of the parameters are required, because defaults are used if the configuration file does not exist. + +Subtopics +E.2.1 Adapter Parameters +E.2.2 DLC Parameters + +
Copyright IBM Corp. 1986, 1996
+
E.2 - 2
+ +--- + + +## Page 519 + +E.2.1 Adapter Parameters + +**OPEN_OPTIONS (applies to IBM Token-Ring Network Adapters)** +Various options used when the adapter is physically opened. PC Network and Ethernet adapters ignore these parameters. + +☐ Argument specified as a 2-byte character string hexadecimal number, for example X'2000' +☐ Character set supported (0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F) +☐ Optional - Default is X'2000' +☐ Range - See the following option settings. + +Various options, each represented by a bit where the bit set on (1) indicates that the option is to be taken. Bit 15 is the leftmost (high-order) bit: + +**OPEN OPTION - Bit 15: WRAP INTERFACE** +The adapter will not insert into the ring. Instead, it will cause all user transmit data to appear as received data. + +**OPEN OPTION - Bit 14: DISABLE HARD ERROR (*)** +If this option is taken, the Network Status HARD ERROR and TRANSMIT BEACON interrupts will not occur. + +**OPEN OPTION - Bit 13: DISABLE SOFT ERROR (*)** +If this option is taken, the Network Status SOFT ERROR interrupt will not occur. + +**OPEN OPTION - Bit 12: PASS ADAPTER MAC FRAMES (*)** +Pass Adapter Class MAC frames which are received but not supported by the adapter as direct interface data to the workstation. + +If this option is not taken, frames in this class will be rejected. + +**OPEN OPTION - Bit 11: PASS ATTENTION MAC FRAMES (*)** +All Attention MAC frames that are not the same as the last received Attention MAC frame will be passed as direct interface data to the workstation. + +If this option is not taken, these frames will not be passed to the workstation. + +**OPEN OPTION - Bits 9-10: Reserved** +Should be set to 0, but are not checked. + +**OPEN OPTION - Bit 8: CONTENDER** +The adapter will participate in Monitor Contention, if applicable. + +**OPEN OPTION - Bit 7: PASS BEACON FRAMES (*)** +The adapter will pass beacon frames up to the attached processor. + +**OPEN OPTION - Bits 5-6: Reserved** +Should be set to 0, but are not checked. + +**OPEN OPTION - Bit 4: TOKEN RELEASE** +Setting this bit selects the non-default state of Token Release. + + + + + + + + + + + + + + + + + + + +
Table E-1. Token Release Table
Adapter Data RateDefault Token ReleaseNon-Default Token Release
16 MbpsEarly Token ReleaseRegular Token Release
+ +**OPEN OPTION - Bits 0-3: Reserved** +Should be set to 0, but are not checked. + +**NODE_ADDRESS** +The 12-hexadecimal-digit specific node address of this station on the LAN. The 2 high-order bits of this value must be B'01'. If this value is coded as zero, then the permanently encoded address is used. If this value is coded as a non-zero value, then the coded value is used. + +☐ Argument specified as a 6-byte character string hexadecimal number +☐ Optional - Default is permanently encoded address +☐ Recommended Range - X'400000000000' to X'400079999999'. + +**GROUP_ADDRESS (Set only by the application program)** +This is the group address. + +☐ Argument specified as a 4-byte character string hexadecimal number +☐ Optional - Default is X'00000000' +☐ Range - X'00000000' to X'FFFFFFFF'. + +
Copyright IBM Corp. 1986, 1996
+<page_number>E.2.1 - 1</page_number> + +--- + + +## Page 520 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Adapter Parameters + +Group address for which the adapter will receive messages. + +**FUNCTIONAL_ADDRESS (Set only by the application program)** +Functional address for which the adapter will receive messages. + +Note that bits 0 and 31 are ignored. + +☐ Argument specified as a 4-byte character string hexadecimal number +☐ Optional - Default is X'00000000' +☐ Range - X'00000000' to X'7FFFFFFE'. + +**NUMBER_RCV_BUFFERS** +The number of receive buffers required for the adapter support software to initialize. The adapter will configure all RAM remaining after other storage requirements have been met as receive buffers. + +If the number of receive buffers available is less than the number specified, a message is displayed to the user stating that there are inadequate receive buffers available for the adapter to open. Initialization will fail, and all commands will be rejected with CCB_RETCODE set to X'30'. + +If the number of receive buffers available is greater than the number requested, no action is taken. + +☐ Argument specified as a character string decimal number +☐ Optional - Default is 8 if value is less than 2 or not specified +☐ Range - 2 to upper boundary, determined by the amount of memory available in shared RAM. + +**RCV_BUFFER_LENGTH** +The length of the adapter's receive buffers, which reside in the adapter's shared RAM. A receive buffer has 8 bytes of overhead. For example, when a buffer is 112 bytes, it can hold only 104 bytes of received data. + +Receive buffers are allocated from the remaining shared RAM after all other requirements are satisfied. + +☐ Argument specified as a character string decimal number +☐ Optional - Default is 112 if value is 0 or not specified +☐ Range - 96 to 2048 bytes in multiples of 8 bytes. + +**DHB_BUFFER_LENGTH** +The length of the adapter's transmit data hold buffers (DHBs). With Token-Ring Network adapters, the DHBs reside in the adapter's shared RAM. With PC Network or Ethernet adapters, the DHB is located in workstation memory. A transmit buffer has 6 bytes of overhead. For example, when a buffer is 600 bytes, it can hold only 594 bytes of transmit data. + +☐ Argument specified as a character string decimal number +☐ Optional - Default is 600 if value is 0 or not specified +☐ Range - 96 to 17 960 bytes in multiples of 8 bytes. + +Note: It is the responsibility of the sending node to ensure that the size of the transmitted frame does not exceed the receive buffer capacity of the receiving node. + +**DATA_HOLD_BUFFERS (ignored by PC Network and Ethernet adapters)** +This defines the number of adapter hold buffers, which contain transmit data passed from the workstation to the adapter. Although the adapter will accept any value from 1 to 255, the integrity of adapter operation cannot be guaranteed if the value is greater than 2. + +The control information for the first two DATA_HOLD_BUFFERS is located in read-only memory, and is isolated from the application program's write operations. However, when more than 2 buffers are specified, the control information for the remaining buffers is located in read/write memory and is no longer isolated from the application program's write operations. + +Requesting two DHBs may improve adapter performance by allowing a frame to be moved into the second DHB while the adapter is transmitting from the first. However, this reduces the storage available for receive buffers. + +☐ Argument specified as a character string decimal number +☐ Optional - Default is 1 if value is not specified +☐ Range - 1 to 255. + +**PRODUCT_ID** +This is the 18-byte product ID. + +☐ Argument specified as a character string + +If less than 18 characters are specified, the product ID is padded with blanks on the right. This character string is provided for problem determination purposes and should describe the workstation attached to the network. + +☐ Character set supported - All uppercase letters (A-Z) and decimal digits (0-9) +☐ Optional - Default is 18 blanks if a value is not specified. + +**SRAM_ADDRESS (Not used for PC Network or Ethernet support)** +Defines the segment in workstation storage that contains the adapter's shared RAM. This value should be on a boundary that is equal to the size of shared RAM. For example, if shared RAM is 8 KB, the SRAM_ADDRESS should be on an 8-KB boundary, or if shared RAM is 16 KB, the SRAM_ADDRESS should be on a 16-KB boundary. When using 16/4 Token-Ring Network Adapter shared RAM, paging can be used, which would allow the use of a 16-KB boundary. The SRAM_ADDRESS parameter is only used for a PC System with ISA Bus since there is no SETUP facility for these workstations. + +☐ Argument specified as a 2-byte character string hexadecimal number, for example, X'D000' + +
Copyright IBM Corp. 1986, 1996
+<page_number>E.2.1 - 2</page_number> + +--- + + +## Page 521 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Adapter Parameters + +☐ Optional – If value is 0 or not specified, the defaults are +- Adapter 0 (primary) - Segment value X'D800' +- Adapter 1 (secondary) - Segment value X'D400' + +☐ Range – Starting Address Range X'C00' to X'DE00' on the appropriate boundaries. + +(*) These open options are set by the application program, not by the OS/2 configuration. + +
Copyright IBM Corp. 1986, 1996 +E.2.1 - 3
+ +--- + + +## Page 522 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DLC Parameters + +E.2.2 DLC Parameters + +The parameter ranges that represent quantities (ranges for DLC_MAX_SAP, DLC_MAX_STATIONS, DLC_MAX_GSAP and DLC_MAX_GSAP_MEM parameters) are defined to ensure that values specified can be stored in the allotted memory sizes and do not represent the capabilities of the supported network adapters. + +**DLC_MAX_SAP** +Indicates the maximum number of SAP stations that can be opened. + +The maximum value of this parameter is 126. However, the maximum value allowed may be reduced if the amount of the available internal RAM work space or the amount of available adapter shared RAM is less than the value specified. + +☐ Argument specified as a character string decimal number, for example, 6 +☐ Character set supported (0,1,2,3,4,5,6,7,8,9) +☐ Optional – Default is 2 if value is not specified +☐ Range – 0 to 126 (upper limit is 125 for PC Network support). + +**DLC_MAX_STATIONS** +Indicates the maximum number of link stations that can be opened. + +The maximum value allowed may be reduced if the amount of available internal RAM work area or the amount of available Adapter Shared RAM is less than the value specified. + +☐ Argument specified as a character string decimal number, for example, 6 +☐ Character set supported (0,1,2,3,4,5,6,7,8,9) +☐ Optional – Default is 6 if value is not specified +☐ Range – 0 to 255. + +**DLC_MAX_GSAP** +Indicates the maximum number of group SAPs that can be opened at one time. + +If the value is 0, no group SAPs are allowed. + +☐ Argument specified as a character string decimal number, for example, 2 +☐ Character set supported (0,1,2,3,4,5,6,7,8,9) +☐ Optional – Default is 0 if value is not specified +☐ Range – 0 to 125 (upper limit is 124 for PC Network support). + +**DLC_MAX_GSAP_MEM** +Indicates the maximum number of SAPs that can be members in any given Group. + +☐ Argument specified as a character string decimal number, for example, 2 +☐ Character set supported (0,1,2,3,4,5,6,7,8,9) +☐ Optional – Default is 0 if value is not specified +☐ Range – 0 to 126 (upper limit is 125 for PC Network support). + +**DLC_T1_TICK_ONE** +Indicates the number of 40-ms intervals between timer ticks for DLC timer T1, timer values 1-5. + +☐ Argument specified as a character string decimal number, for example, 2 +☐ Character set supported (0,1,2,3,4,5,6,7,8,9) +☐ Optional – Default is 5 (200-400 ms) if value is 0 or not specified +☐ Range – 0 to 255. + +**DLC_T2_TICK_ONE** +Indicates the number of 40-ms intervals between timer ticks for DLC timer T2, timer values 1-5. + +☐ Argument specified as a character string decimal number, for example, 2 +☐ Character set supported (0,1,2,3,4,5,6,7,8,9) +☐ Optional – Default is 1 (40-80 ms) if value is 0 or not specified +☐ Range – 0 to 255. + +
Copyright IBM Corp. 1986, 1996
+<page_number>E.2.2 - 1</page_number> + +--- + + +## Page 523 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DLC Parameters + +**DLC_TI_TICK_ONE** +Indicates the number of 40-ms intervals between timer ticks for DLC timer Ti, timer values 1-5. +☐ Argument specified as a character string decimal number, for example, 20 +☐ Character set supported (0,1,2,3,4,5,6,7,8,9) +☐ Optional – Default is 25 (1-2 seconds) if value is 0 or not specified +☐ Range – 0 to 255. + +**DLC_T1_TICK_TWO** +Indicates the number of 40-ms intervals between timer ticks for DLC timer T1, timer values 6-10. +☐ Argument specified as a character string decimal number, for example, 20 +☐ Character set supported (0,1,2,3,4,5,6,7,8,9) +☐ Optional – Default is 25 (1-2 seconds) if value is 0 or not specified +☐ Range – 0 to 255. + +**DLC_T2_TICK_TWO** +Indicates the number of 40-ms intervals between timer ticks for DLC timer T2, timer values 6-10. +☐ Argument specified as a character string decimal number, for example, 100 +☐ Character set supported (0,1,2,3,4,5,6,7,8,9) +☐ Optional – Default is 10 (400-800 ms) if value is 0 or not specified +☐ Range – 0 to 255. + +**DLC_TI_TICK_TWO** +Indicates the number of 40-ms intervals between timer ticks for DLC timer Ti, timer values 6-10. +☐ Argument specified as a character string decimal number, for example, 100 +☐ Character set supported (0,1,2,3,4,5,6,7,8,9) +☐ Optional – Default is 125 (5-10 seconds) if value is 0 or not specified +☐ Range – 0 to 255. + +**SYSTEM_KEY** +Is the system key code. It is used to enable only a system administrator to perform operations that could stop ring communication for application programs. + +This key code restricts the following operations: +☐ Change functional address +☐ Change group addresses +☐ Reset selected or all SAPs and all stations +☐ Relinquish ownership of direct stations +☐ Force a physical close for an adapter +☐ Force the adapter to initialize +☐ Read and reset adapter error and direct interface logs. + +The SYSTEM_KEY is not typically used by application programs. It is most often used for maintenance and problem determination operations. + +The SYSTEM_KEY should be defined as follows: +☐ Argument specified as a 2-byte character string hexadecimal number +☐ Range - X'0001' to X'FFFF'. + +**MAX_USERS** +Indicates the maximum number of users that can concurrently use the Token-Ring Network adapter. This parameter provides a mechanism that enables the adapter support software to determine the size of memory needed for its work area. If requests issued to adapter support software continue to fail with CCB_RETCODE set to X'59', either the number of MAX_USERS or the QSIZE parameter should be increased and the adapter support software restarted by re-IPLing the system. +☐ Argument specified as a character string decimal number +☐ Optional – Default is 3 if value is 0 or not specified +☐ Range – 0 to 5. + +
Copyright IBM Corp. 1986, 1996
+<page_number>E.2.2 - 2</page_number> + +--- + + +## Page 524 + +LAN Technical Reference: 802.2 and NetBIOS APIs +DLC Parameters + +**ADAPTER_WORK_SIZE (Used only for PC Network and Ethernet adapters)** +Defines the size of memory allocated by the adapter support software during the initialization process. This memory is used to contain Link Station Control Blocks, SAP Control Blocks, Group SAP Control Blocks, and receive buffers. +☐ Argument specified as a character string decimal number. +☐ Optional - Default is X'2000' +☐ Range - X'2000' to X'FFFF'. + +**QSIZE** +Specifies the number of internal queue elements that the adapter support software can allocate for all application programs. If no parameter is provided, the number of queue elements is calculated using the number of users (MAX_USER value). The number of queue elements allocated per user is 200. For example, if 5 users are defined to be the maximum number of users at one time, 1000 queue elements will be allocated. +☐ Argument specified as a character string decimal number +☐ Optional - Default is calculated using MAX_USER +☐ Range - 200 to 1400. The default is 200. + +**GDTSIZE** +Specifies the number of Global Descriptor Table (GDT) selectors that the adapter support software can allocate for all application programs. If no parameter is specified, the number of GDT selectors is calculated using the number of users (MAX_USER), but cannot exceed 30. The number of GDT selectors allocated per user is 10. For example, if 2 users are defined to be the maximum number of users at one time, 20 GDT selectors will be allocated. +☐ Argument specified as a character string decimal number +☐ Optional - Default is calculated using MAX_USER +☐ Range - 10 to 30. The default is 20. + +**NETWORK_FLAGS (Used only for Ethernet adapter)** +Defines the Ethernet protocol used for the adapter on Ethernet. +☐ Argument specified as a 1-byte character string hexadecimal number +☐ Optional - Default is X'00' +☐ The only possible values are X'00' for the DIX Version 2.0 protocol, or X'80' for the IEEE 802.3 protocol. + +
Copyright IBM Corp. 1986, 1996 +E.2.2 - 3
+ +--- + + +## Page 525 + +LAN Technical Reference: 802.2 and NetBIOS APIs +OS/2 EE NetBIOS Parameters + +E.3 OS/2 EE NetBIOS Parameters + +NetBIOS Version 3.0 is the NetBIOS interface provided by OS/2 EE. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table E-2. NetBIOS 3.0 System Default Values
Load ParametersAbbr.Valid ValuesDefault
STATIONSST0 - 25432 **
SESSIONSS0 - 25432 **
COMMANDSC0 - 25532
NAMESN0 - 25417
TRANSMIT.TIMEOUTTT0 - 201
TRANSMIT.COUNTTC0 - 106
DLC.MAXOUTMO0 - 92
DLC.MAXINMI0 - 91
DLC.RETRY.COUNTRC0 - 255*
DLC.T1T10 - 105
DLC.T2T20 - 112
DLC.TITI0 - 103
RING.ACCESSRA0 - 30
DATAGRAM.MAXDGY (yes) / N (no)NO
REMOTE.NAME.DIRECTORYRND0 - 2550
REMOTE.DATAGRAM.CONTROLRDCY (yes) / N (no)NO
ADAP.ADDR.NOT.REVERSEDANRY (yes) / N (no)NO
+ +* The default values are determined by the adapter and the adapter interface code. +** These values vary for OS/2 EE 1.3. + +
Copyright IBM Corp. 1986, 1996
+<page_number>E.3 - 1</page_number> + +--- + + +## Page 526 + +LAN Technical Reference: 802.2 and NetBIOS APIs +OS/2 EE Trace Facility + +E.4 OS/2 EE Trace Facility + +The adapter support software utilizes the OS/2 System Trace facilities. In order for the adapter support software to use the OS/2 System Trace facilities, the application program must provide a keyword "t=" on the "DEVICE=" command line of the CONFIG.SYS file when defining the adapter support software device drivers. The keyword is defined below. + +The trace keyword "t=" must appear on the "DEVICE=" command line of the CONFIG.SYS file when defining the adapter support software's device drivers. + +DEVICE=TRNETDD.SYS CFG=pathname filename.CFG t=n + +The value of n can be 2, 3, or 4. + + + + + + + + + + + + + + + + + + + + + + +
ValueMeaning
t=2A value of 2 indicates the adapter support software will trace the following codes. See "Trace Code Definition" in topic E.5 for a definition of what each trace code means.
X'00'
X'02'
X'08'
X'09'
X'0A'
X'0D'
t=3A value of 3 indicates the adapter support software will trace the following codes. See "Trace Code Definition" in topic E.5 for a definition of what each trace code means.
X'00'
X'02'
X'08'
X'09'
X'0A'
X'0B'
X'0C'
X'0D'
t=4A value of 4 indicates the adapter support software will trace the following codes. See "Trace Code Definition" in topic E.5 for a definition of what each trace code means.
X'00'
X'01'
X'02'
X'03'
X'04'
X'05'
X'06'
X'07'
X'08'
X'09'
X'0A'
X'0B'
X'0C'
X'0D'
+ +
Copyright IBM Corp. 1986, 1996
E.4 - 1
+ +--- + + +## Page 527 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Trace Code Definition + +E.5 Trace Code Definition + +Subtopics +E.5.1 Trace Entry Format +E.5.2 Trace Code Formats + +
Copyright IBM Corp. 1986, 1996
+<page_number>E.5 - 1</page_number> + +--- + + +## Page 528 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Trace Entry Format + +E.5.1 Trace Entry Format + +Each trace entry is 16 bytes in length and each entry varies slightly depending upon the type of trace data (determined by the trace code). + +The trace code in each trace entry identifies the point at which the trace entry was created and the format of the remainder of the trace entry. The trace codes are: + +X'00' CCB command received. + +X'01' CCB command verified, queue element created. + +X'02' CCB command error. + +X'03' CCB command issued to the adapter (SRB) (not used by Token-Ring Network). + +X'04' CCB queue element added to receive queue. + +X'05' CCB queue element added to read queue. + +X'06' CCB queue element added to SRB wait queue. + +X'07' CCB queue element added to SSB wait queue. + +X'08' Completion of a CCB command or transmit command event occurred. + +X'09' Completion of a received frame event occurred. + +X'0A' Completion of a network status, DLC status, workstation action, or exception event occurred. + +X'0B' Adapter interrupt received. + +X'0C' Adapter timer expired. + +X'0D' Adapter interrupt error detected. + +
Copyright IBM Corp. 1986, 1996
+<page_number>E.5.1 - 1</page_number> + +--- + + +## Page 529 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Trace Code Formats + +E.5.2 Trace Code Formats + +Subtopics +E.5.2.1 CCB Trace Entry (Trace Codes X'00' through X'07') +E.5.2.2 CCB Completion Trace Entry (Trace Code X'08') +E.5.2.3 Receive Completion Trace Entry (Trace Code X'09') +E.5.2.4 Status/Exception Completion Trace Entry (Trace Code X'0A') +E.5.2.5 Interrupt Received Trace Entry (Trace Codes X'B' through X'0C') +E.5.2.6 Interrupt Error Trace Entry (Trace Code X'0D') + +
Copyright IBM Corp. 1986, 1996 +E.5.2 - 1
+ +--- + + +## Page 530 + +LAN Technical Reference: 802.2 and NetBIOS APIs +CCB Trace Entry (Trace Codes X'00' through X'07') + +E.5.2.1 CCB Trace Entry (Trace Codes X'00' through X'07') + +Byte: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
012345678-910-1314-15
Trace CodeAdapter Number (0/1)Adapter Work Flag 76543210---Command CodeRC/ CorrelatorElement FlagAppl IDProcess IDCCB Virt AddrTimer Ticks Lo Word
+ +Byte 2: Adapter Work Flags: +Bit 7: Adapter initialized successfully +Bit 6: Adapter initialization in progress +Bit 5: Adapter initialization failure +Bit 4: Adapter opened successfully +Bit 3: Adapter open in progress +Bit 2: Adapter open failure +Bit 1: Adapter reset in progress +Bit 0: Adapter interrupt in progress + +Byte 6: Element Flag: +Bit 7: Chain transmits/receives by SAP +Bit 6: Chain transmits/receives by link station +Bit 5: Purge the link station +Bit 4: Purge the SAP +Bit 3: Purge the application program +Bit 2: Not used +Bit 1: No active CCB corresponding to this CCB queue element +Bit 0: Completion flag set for this completion event + +Bytes 10-13: CCB Virtual Address: +Points to the corresponding application program CCB + +Figure E-1. CCB Trace Entry + +
Copyright IBM Corp. 1986, 1996
+
E.5.2.1 - 1
+ +--- + + +## Page 531 + +LAN Technical Reference: 802.2 and NetBIOS APIs +CCB Completion Trace Entry (Trace Code X'08') + +E.5.2.2 CCB Completion Trace Entry (Trace Code X'08') + +Byte: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
012345678-910-1314-15
Trace CodeAdapter Number (0/1)Adapter Work Flag 76543210Event CodeCommand CodeRC/ CorrelatorElement FlagAppl IDProcess IDCCB Virt AddrTimer Ticks Lo Word
+ +Byte 3: Event Code: +Bit 7: Not used +Bit 6: Workstation action +Bit 5: Network status +Bit 4: Critical exception +Bit 3: DLC status +Bit 2: Receive +Bit 1: Transmit +Bit 0: CCB command complete + +Figure E-2. CCB Completion Trace Entry + +
Copyright IBM Corp. 1986, 1996
+
E.5.2.2 - 1
+ +--- + + +## Page 532 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Receive Completion Trace Entry (Trace Code X'09') + +E.5.2.3 Receive Completion Trace Entry (Trace Code X'09') + +Byte: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
01234-5678-910-1314-15
Trace CodeAdapter Number (0/1)Adapter Work Flag 76543210Event Code---Element FlagAppl IDProcess IDSAP Virt AddrTimer Ticks Lo Word
+ +Bytes 10-14: SAP Virtual Address: +Points to the corresponding received frame's first SAP buffer + +Figure E-3. Receive Completion Trace Entry + +
Copyright IBM Corp. 1986, 1996 +E.5.2.3 - 1
+ +--- + + +## Page 533 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Status/Exception Completion Trace Entry (Trace Code X'0A') + +E.5.2.4 Status/Exception Completion Trace Entry (Trace Code X'0A') + +Byte: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
012345678-910-1314-15
Trace CodeAdapter Number (0/1)Adapter Work Flag 76543210Event CodeEvent SubCode---Element FlagAppl IDStatusStatus DataTimer Ticks Lo Word
+ +Byte 4: Event Subcode: +For workstation action event code: +X'01': DIR.CLOSE.ADAPTER +X'02': DIR.INITIALIZE +X'03': DLC.RESET for a single SAP station +X'04': DLC.RESET for all SAP stations +For critical exception event code: +X'01': Network status +X'02': Adapter check +X'03': PC error +X'04': Workstation action + +Bytes 8-9: Status: +The 2-byte status code corresponding to the type of event +(network status code, DLC status code, adapter check code, workstation error code) + +Bytes 10-13: Status Data: +The first 4 bytes of the data corresponding to the type of event + +Figure E-4. Status Exception Completion Trace Entry + +
Copyright IBM Corp. 1986, 1996
+
E.5.2.4 - 1
+ +--- + + +## Page 534 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Interrupt Received Trace Entry (Trace Codes X'B' through X'0C') + +E.5.2.5 Interrupt Received Trace Entry (Trace Codes X'B' through X'0C') + +Adapter Support Software Trace Entry: + +Byte: + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
0123456-78-1314-15
Trace CodeAdapter Number (0/1)Adapter Work Flag 76543210---ISRP HighISRP LowTimer Count---Timer Ticks Lo Word
+ +Byte 4: ISRP High: +Bit 7: NMI disabled (always on) +Bit 6: Interrupt enable (always on) +Bit 5: Parity error in shared RAM +Bit 4: Timer expired (100-ms programmable timer) +Bit 3: Adapter check +Bit 2: Shared RAM access violation +Bit 1: Always on +Bit 0: Adapter number (0 or 1) + +Byte 5: ISRP Low: +Bit 7: IMPL received +Bit 6: Adapter check +Bit 5: SRB response +Bit 4: ASB free +Bit 3: ARB command +Bit 2: SSB response +Bit 1: Always 0 +Bit 0: Always 0 + +Bytes 6-7: Timer Count: +Number of timer interrupts from adapters 0 and 1 + +Adapter Support Software Trace Entry: + +Byte: + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
0123456-910-1314-15
Trace CodeAdapter Number (0/1)Adapter Work Flag 76543210Activation Record Reason codeCommand CodeReturn CodeCommand specificSS:SPTimer Ticks Lo Word
+ +Figure E-5. Interrupt Received Trace Entry + +
Copyright IBM Corp. 1986, 1996 +E.5.2.5 - 1
+ +--- + + +## Page 535 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Interrupt Error Trace Entry (Trace Code X'0D') + +E.5.2.6 Interrupt Error Trace Entry (Trace Code X'0D') + +Byte: + + + + + + + + + + + + + + + + + + + + +
0123-13*14-15
Trace CodeAdapter Number (0/1)Adapter Work Flag 76543210SRB/SSB/ARB Work AreaTimer Ticks Lo Word
+ +Bytes 3-13: SRB/SSB/ARB Work Area +First 11 bytes of the SRB/SSB/ARB that corresponds to the interrupt +(The format of the 11 bytes depends upon the command, interrupt, ...) + +Figure E-6. Interrupt Error Trace Entry + +
Copyright IBM Corp. 1986, 1996 +E.5.2.6 - 1
+ +--- + + +## Page 536 + +LAN Technical Reference: 802.2 and NetBIOS APIs +OS/2 EE NetBIOS Trace Facility + +E.6 OS/2 EE NetBIOS Trace Facility + +The NetBIOS major trace code is X'A4'. There are two minor trace codes: X'20' indicates an OS/2 DD interface level trace entry and X'21' indicates an OS/2 DLR interface level trace entry. + +Further, receipt of NetBIOS protocol message "remote trace off" is not supported by OS/2 EE NetBIOS (the message is ignored). + +The specific trace data in the system is shown in Table E-3. + +Notes: + +1. The basic information is similar to trace data in previous levels of NetBIOS. See the NCB.TRACE command in Chapter 4, "NetBIOS." + +2. There is a new entry type: **SYSTEM ACTION**. This is indicated in the trace with the entry type and modifier X'EE04'. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table E-3. NetBIOS Trace Table
Byte OffsetUsage
0Adapter number indicator
X'AA' Adapter 0
X'BB' Adapter 1
1X'00' or an environment ID assigned by NetBIOS
2Entry type
3Entry modifier
4-7Reserved
8-11Type-dependent data
12-15Address of data in bytes 16 through 31
16-31Type-dependent data
+ +
Copyright IBM Corp. 1986, 1996
+<page_number>E.6 - 1</page_number> + +--- + + +## Page 537 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Appendix F. NDIS Overview + +F.0 Appendix F. NDIS Overview + +Subtopics +F.1 About This Appendix +F.2 Description of NDIS + +
Copyright IBM Corp. 1986, 1996
+<page_number>F.0 - 1</page_number> + +--- + + +## Page 538 + +LAN Technical Reference: 802.2 and NetBIOS APIs +About This Appendix + +F.1 About This Appendix + +This appendix briefly describes the Network Driver Interface Specification (NDIS). + +
Copyright IBM Corp. 1986, 1996
+<page_number>F.1 - 1</page_number> + +--- + + +## Page 539 + +F.2 Description of NDIS + +NDIS, developed jointly by 3Com and Microsoft Corporation, is a standardized interface for network adapter drivers and protocol drivers. NDIS separates protocol handling from hardware manipulation by defining functions that protocol drivers and network adapter drivers must provide to each other. It defines a configuration and binding process, which is handled by the protocol manager. NDIS has become a pseudo industry standard, providing a common, open interface that enables different manufacturers of network adapters and LAN software to communicate. Figure F-1 illustrates the major software components in the NDIS environment. + +```mermaid +graph TD + subgraph NDIS + A[NETBIOS Protocol Driver] + B[802.2 Protocol Driver] + C[Token-Ring Network Adapter Driver] + D[Ethernet Network Adapter Driver] + end + + E[PROTOCOL.INI Configuration File] + F[Protocol Manager] + G[NETBIND] + + E --> F + F --> B + F --> D + G --> F + style A fill:#fff,stroke:#333,stroke-width:2px + style B fill:#fff,stroke:#333,stroke-width:2px + style C fill:#fff,stroke:#333,stroke-width:2px + style D fill:#fff,stroke:#333,stroke-width:2px + style E fill:#fff,stroke:#333,stroke-width:2px + style F fill:#fff,stroke:#333,stroke-width:2px + style G fill:#fff,stroke:#333,stroke-width:2px +``` + +Figure F-1. Major Components in the NDIS Environment + +A network adapter driver provides the communication between a network adapter and a protocol. The main function of the network adapter driver is to support network packet reception and transmission. A protocol driver provides the communication between an application and a network adapter driver. The main function of the protocol manager is to read configuration information from the configuration file, PROTOCOL.INI, and make it available to the network adapter drivers and protocol drivers. It also coordinates connections between protocol drivers and network adapter drivers. Before the protocol driver and the network adapter driver can communicate, they must be bound together (entry points are exchanged). NETBIND initiates the binding process based on information in PROTOCOL.INI. + +--- + + +## Page 540 + +LAN Technical Reference: 802.2 and NetBIOS APIs +List of Abbreviations + +ABBREVIATIONS List of Abbreviations +A. Address recognized bit in the frame status field of a Token-Ring frame. + +AC. Access control. + +A/C. Address recognized/frame copied. + +ACDI. Asynchronous Communications Device Interface. + +AIP. Adapter identification PROM. + +API. Application program interface. + +APPC/PC. Advanced Program-to-Program Communications/Personal Computers. + +ARB. Adapter request block. + +ASB. Adapter status block. + +ASCII. American National Standard Code for Information Interchange. + +BIOS. Basic Input/Output System. + +CCB. Command Control Block. + +CRC. Cyclic redundancy check. + +CSMA/CD. Carrier sense multiple access with collision detection. + +DB. Define byte. + +DD. (1) Direct device interface. (2) Define doubleword. + +DHB. Data holding buffer. + +DISC. Disconnect character. + +DIX. Digital Intel Xerox. + +DLC. Data link control. + +DLR. Dynamic Link Routine. + +DM. Disconnect mode. + +DMA. Direct memory access. + +DOS. Disk Operating System. + +DMA. Direct memory access. + +DSAP. Destination service access point. + +DW. Define word. + +EBCDIC. Extended binary-coded decimal interchange code. + +ED. Ending delimiter. + +EFS. End frame sequence. + +EHLLAPI. Emulator High-Level Language Application Programming. + +EPROM. Erasable programmable read-only memory. + +ES. Extended services. + +ETR. Early Token Release. + +FC. Frame control. + +FCS. Frame check sequence. + +FDDI. Fiber Distributed Data Interface + +FIFO. First-in first-out. + +FRMR. Frame reject. + +FS. Frame status. + +GDT. Global descriptor table. + +GSAP. Group service access point. + +
Copyright IBM Corp. 1986, 1996 +ABBREVIATIONS - 1
+ +--- + + +## Page 541 + +LAN Technical Reference: 802.2 and NetBIOS APIs +List of Abbreviations + +I. Information (frame). + +**IEEE.** Institute of Electrical and Electronics Engineers. + +**I/O.** Input/output. + +**ISO.** International Organization for Standardization. + +**ISRA.** Interrupt status register, adapter. + +**ISRP.** Interrupt status register, PC. + +**Kb.** Kilobit. + +**KB.** Kilobyte. + +**LAN.** Local area network. + +**LAPS.** Lan Adapter and Protocol Support. + +**LDT.** Local descriptor table. + +**LLC.** Logical link control. + +**LPDU.** Logical link control protocol data unit. + +**LS.** LAN Server. + +**LSAP.** Local service access point. + +**LSN.** Least significant nibble. + +**LSP.** LAN Support Program. + +**LU.** Logical unit. + +**MAC.** Medium access control. + +**MB.** Megabyte. + +**Mbps.** Megabits per second. + +**MBps.** Megabytes per second. + +**MGA.** Multiple group addresses. + +**MMIO.** Memory mapped input/output. + +**ms.** Microsecond. + +**NAUN.** Nearest active upstream neighbor. + +**NCB.** Network Control Block. + +**NDIS.** Network Driver Interface Specification. + +**NetBIOS.** Network Basic Input/Output System. + +**NLM.** NetWare Loadable Module. + +**ns.** Nanosecond. + +**NTS/2.** Network Transport Services/2. + +**ODI.** Open data-link interface. + +**OEM.** (1) Other equipment manufacturer. (2) Original equipment manufacturer. + +**OEMI.** Other equipment manufacturer information. + +**OS/2.** Operating System/2. + +**OS/2 EE.** Operating System/2 Extended Edition. + +**PA.** Preamble field of a Token-Ring frame. + +**PC.** Personal computer. + +**PDU.** Protocol data unit. + +**PIO.** Programmed input/output. + +**POST.** Power-on self-test. + +
Copyright IBM Corp. 1986, 1996 +ABBREVIATIONS - 2
+ +--- + + +## Page 542 + +LAN Technical Reference: 802.2 and NetBIOS APIs +List of Abbreviations + +PROM. Programmable read only memory. +PS/2. Personal System/2. +PT. Physical trailer. +PU. Protocol unit. +RAM. Random access memory. +RI. Routing information field of the Token-Ring frame. +ROM. Read-only memory. +RPL. Remote program load. +RRR. RAM relocation register. +RR/RNR. Receiver ready/receiver not ready. +RSAP. Remote service access point. +SABME. Set asynchronous balanced mode extended. +SAP. Service access point. +SD. Starting delimiter field of a Token-Ring frame. +SDLC. Synchronous data link control. +SFS. Start Frame Sequence. +SNA. Systems Network Architecture. +SRAM. Shared random access memory. +SRB. System request block. +SRPI. Server-Requestor Programming Interface. +SRPR. Shared RAM paging register. +SSAP. Source service access point. +SSB. System status block. +TCP/IP. Transmission control protocol/internet protocol. +TCR. Timer control register. +TVR. Timer value register. +UA. Unnumbered acknowledgment. +UI. Unnumbered information. +UPS. Uninterruptible power supply. +WRBR. Write region base management register. +WWCR. Write window close management register. +WWOR. Write window open management register. +X.25. Packet-switched networks. +XID. Exchange identification. + +
Copyright IBM Corp. 1986, 1996 +ABBREVIATIONS - 3
+ +--- + + +## Page 543 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Glossary + +GLOSSARY Glossary +This Glossary defines local area network terms and abbreviations. It includes terms and definitions from the IBM Dictionary of Computing (Information Processing, Personal Computing, Telecommunications, Office Systems, IBM-Specific Terms), SC20-1699. + +☐ The symbol (A) identifies definitions from the American National Dictionary for Information Processing Systems, copyright 1982 by the Computer and Business Equipment Manufacturers Association (CBEMA). + +☐ The symbol (I) identifies definitions from the ISO Vocabulary-Information Processing and ISO Vocabulary-Office Machines, developed by the International Organization for Standardization, Technical Committee 97, Subcommittee 1. + +☐ The symbol (T) identifies definitions from draft international standards, draft proposals, and working papers in development by the International Organization for Standardization, Technical Committee 97, Subcommittee 1. + +This Glossary uses standard reference words for entries. They are: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ReferenceMeaning
Synonymous withAppears in the commentary of a preferred term and identifies less desirable or less specific terms that have the same meaning.
Synonym forAppears in the commentary of a less desirable or less specific term and identifies the preferred term that has the same meaning. The less desired or less specific term is not defined.
Contrast withRefers to a term that has an opposite or substantially different meaning.
SeeRefers to terms in which this term appears.
See alsoRefers to related terms that have similar (but not synonymous) meanings.
+ +``` ++---+ +| A | ++---+ +``` + +**abort.** To terminate, in a controlled manner, a processing activity in a computer system because it is impossible or undesirable for the activity to proceed. (T) + +**access priority.** The maximum priority that a token can have for the adapter to use it for transmission. + +**access unit.** A unit that allows multiple attaching devices access to a token-ring network at a central point such as a wiring closet or in an open work area. + +**active.** (1) Able to communicate on the network. A token-ring network adapter is active if it is able to transmit and receive on the network. (2) Operational. (3) Pertaining to a node or device that is connected or is available for connection to another node or device. (4) Currently transmitting or receiving. + +**active monitor.** A function in a single adapter on a token-ring network that initiates the transmission of tokens and provides token error recovery facilities. Any active adapter on the ring has the ability to provide the active monitor function if the current active monitor fails. + +**adapter.** In a LAN, within a communicating device, a circuit card that, with its associated software and/or microcode, enables the device to communicate over the network. + +**adapter address.** Twelve hexadecimal digits that identify a LAN adapter. + +**address.** (1) In data communication, the IEEE-assigned unique code or the unique locally administered code assigned to each device or workstation connected to a network. (2) A character, group of characters, or a value that identifies a register, a particular part of storage, a data source, or a data sink. The value is represented by one or more characters. (T) (3) To refer to a device or an item of data by its address. (A) (4) The location in the storage of a computer where data is stored. (5) In word processing, the location, identified by the address code, of a specific section of the recording medium or storage. (T) + +**address segment.** A section of IBM personal computer memory that can be up to 64 KB. + +**alert.** (1) For IBM LAN management products, a notification indicating a possible security violation, a persistent error condition, or an interruption or potential interruption in the flow of data around the network. See also network management vector transport. (2) In SNA, a record sent to a system problem management focal point to communicate the existence of an alert condition. (3) In the NetView program, a high-priority event that warrants immediate attention. This data base record is generated for certain event types that are defined by user-constructed filters. + +**alternate adapter.** In a personal computer that is used on a LAN and that supports installation of two network adapters, the adapter that uses alternate (not standard or default) mapping between adapter-shared RAM, adapter ROM, and designated computer memory segments. The alternate adapter is usually designated as adapter 1 in configuration parameters. Contrast with primary adapter. + +**analog.** Pertaining to data consisting of continuously variable physical quantities. (A) Contrast with digital. + +**appendage.** An application program routine that assists in handling the occurrence of specific events. + +**application program.** (1) A program written for or by a user that applies to the user's work. Some application programs receive support and services from a special kind of application program called a network application program. (2) A program used to connect and communicate with stations in a network, enabling users to perform application-oriented activities. + +| Copyright IBM Corp. 1986, 1996 +GLOSSARY -1 + +--- + + +## Page 544 + +application program interface (API). A functional interface supplied by the operating system or by a separately orderable licensed program that allows an application program written in a high-level language to use specific data or functions of the operating system or the licensed program. + +architecture. A logical structure that encompasses operating principles including services, functions, and protocols. See computer architecture, network architecture, Systems Application Architecture (SAA), Systems Network Architecture (SNA). + +asynchronous. (1) Pertaining to two or more processes that do not depend upon the occurrence of a specific event such as a common timing signal. (T) (2) In Fiber Distributed Data Interface (FDDI) rings, a type of data traffic that does not need bounded access delay to the medium and guaranteed throughput. + +attach. To make a device a part of a network logically. + +attaching device. Any device that is physically connected to a network and can communicate over the network. + +automatic single-route broadcast. A function used by some IBM bridge programs to determine the correct settings for, and set the bridge single-route broadcast configuration parameters dynamically, without operator intervention. As bridges enter and leave the network, the parameter settings may need to change to maintain a single path between any two LAN segments for single-route broadcast messages. See also single-route broadcast. + +auto-removal. The removal of a device from data-passing activity without human intervention. This action is accomplished by the adapter in the device, and can be initiated by a network management program. + +available memory. In a personal computer, the number of bytes of memory that can be used after memory requirements for the operating system, device drivers, and other application programs have been satisfied. + +``` ++---+ +| B | ++---+ +``` + +baseband. (1) A frequency band that uses the complete bandwidth of a transmission medium. Contrast with broadband, carrierband. (2) A method of data transmission that encodes, modulates, and impresses information on the transmission medium without shifting or altering the frequency of the information signal. + +baseband local area network. A local area network in which information is encoded, multiplexed, and transmitted without modulation of a carrier. (T) + +Basic Input/Output System (BIOS). In IBM personal computers with PC I/O channel architecture, microcode that controls basic hardware operations such as interactions with diskette drives, fixed disk drives, and the keyboard. + +beacon. (1) A frame sent by an adapter on a ring network indicating a serious ring problem, such as a broken cable. It contains the addresses of the beaconing station and its nearest active upstream neighbor (NAUN). (2) To send beacon frames continuously. An adapter is beaconing if it is sending such a frame. + +beaconing. An error-indicating function of token-ring adapters that assists in locating a problem causing a hard error on a token-ring network. + +binary. (1) Pertaining to a system of numbers to the base two; the binary digits are 0 and 1. (A) (2) Pertaining to a selection, choice, or condition that has two possible different values or states. (I) (A) + +bit. Either of the binary digits: a 0 or 1. + +bit error rate (BER). The ratio of the number of bits experiencing error on a telecommunications link divided by the number of bits sent over the link. + +bootstrap. (1) A sequence of instructions whose execution causes additional instructions to be loaded and executed until the complete computer program is in storage. (T) (2) A technique or device designed to bring itself into a desired state by means of its own action, for example, a machine routine whose first few instructions are sufficient to bring the rest of itself into the computer from an input device. (A) + +bridge. (1) An attaching device that connects two LAN segments to allow the transfer of information from one LAN segment to the other. A bridge may connect the LAN segments directly by network adapters and software in a single device, or may connect network adapters in two separate devices through software and use of a telecommunications link between the two adapters. (2) A functional unit that connects two LANs that use the same logical link control (LLC) procedures but may use the same or different medium access control (MAC) procedures. (T) Contrast with gateway and router. + +bridge ID. The bridge label combined with the adapter address of the adapter connecting the bridge to the LAN segment with the lowest LAN segment number; it is used by the automatic single-route broadcast function in IBM bridge programs. + +broadband. (1) A frequency band between any two non-zone frequencies. (2) A frequency band divisible into several narrower bands so that different kinds of transmissions such as voice, video, and data transmission can occur at the same time. Synonymous with wideband. Contrast with baseband, carrierband. + +broadband local area network (LAN). A local area network (LAN) in which information is encoded, multiplexed, and transmitted through modulation of a carrier. (T) + +broadcast. Simultaneous transmission of data to more than one destination. + +broadcast frame. A frame that is simultaneously transmitted to more than one destination. A broadcast frame is forwarded by all bridges, unless otherwise restricted. + +buffer. (1) A portion of storage used to hold input or output data temporarily. (2) A routine or storage used to compensate for a difference in data rate or time of occurrence of events, when transferring data from one device to another. (A) + +Copyright IBM Corp. 1986, 1996 +GLOSSARY -2 + +--- + + +## Page 545 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Glossary + +**bus.** (1) In a processor, a physical facility on which data is transferred to all destinations, but from which only addressed destinations may read in accordance with appropriate conventions. (I) (2) A network configuration in which nodes are interconnected through a bidirectional transmission medium. (3) One or more conductors used for transmitting signals or power. (A) + +**byte.** (1) A string that consists of a number of bits, treated as a unit, and representing a character. (T) (2) A binary character operated upon as a unit and usually shorter than a computer word. (A) (3) A string that consists of a particular number of bits, usually 8, that is treated as a unit, and that represents a character. (4) A group of 8 adjacent binary digits that represent one extended binary-coded decimal interchange code (EBCDIC) character. See *n-bit byte*. + +``` ++---+ +| C | ++---+ +``` + +**cable segment.** A section of cable between components or devices on a network. A segment may consist of a single patch cable, multiple patch cables connected together, or a combination of building cable and patch cables connected together. See *LAN segment, ring segment*. + +**carrier.** A wave or pulse train that may be varied by a signal bearing information to be transmitted over a communication system. + +**carrierband.** A frequency band in which the modulated signal is superimposed on a carrier signal (as differentiated from baseband), but only one channel is present on the medium (as differentiated from broadband). Contrast with *baseband, broadband*. + +**carrier sense.** In a local area network, an ongoing activity of a data station to detect whether another station is transmitting. (T) + +**channel.** (1) A functional unit, controlled by a host computer, that handles the transfer of data between processor storage and local peripheral equipment. (2) A path along which signals can be sent. (3) The portion of a storage medium that is accessible to a given reading or writing station. (4) In broadband transmission, a designation of a frequency band 6 MHz wide. + +**circuit.** (1) A logic device. (2) One or more conductors through which an electric current can flow. + +**collision.** (1) An unwanted condition that results from concurrent transmissions on a channel. (T) (2) When a frame from a transmitting adapter encounters any other signal in its path (frame, noise, or another type of signal), the adapter stops transmitting and a collision is registered. + +**collision detection.** In carrier sense multiple access with collision detection (CSMA/CD), a signal indicating that two or more stations are transmitting simultaneously. + +**command.** (1) A request for performance of an operation or execution of a program. (2) A character string from a source external to a system that represents a request for system action. + +**completion code.** The final return code provided by a program or adapter, as a result of an issued command, to indicate that an operation has ended. + +**component.** (1) Any part of a network other than an attaching device, such as an IBM 8228 Multistation Access Unit. (2) Hardware or software that is part of a functional unit. + +**computer architecture.** The organizational structure of a computer system, including hardware and software. (A) + +**configuration.** (1) The arrangement of a computer system or network as defined by the nature, number, and chief characteristics of its functional units. More specifically, the term may refer to a hardware configuration or a software configuration. (I) (A) (2) The devices and programs that make up a system, subsystem, or network. See also *system configuration*. + +**configuration file.** The collective set of definitions that describes a configuration. + +**configuration parameters.** Variables in a configuration definition, the values of which characterize the relationship of a product, such as a bridge, to other products in the same network. + +**connect.** In a LAN, to physically join a cable from a station to an access unit or network connection point. Contrast with *attach*. + +**contention.** In a LAN, a situation in which two or more data stations are allowed by the protocol to start transmitting concurrently and thus risk collision. (T) + +**continuous carrier.** On broadband networks, a condition in which a carrier signal is being constantly broadcast on a given frequency. No further information can be modulated on that frequency. + +**control block.** (1) A storage area used by a computer program to hold control information. (I) (2) In the IBM Token-Ring Network, a specifically formatted block of information provided from the application program to the Adapter Support Interface to request an operation. + +**controller.** A unit that controls input/output operations for one or more devices. + +**converter.** In an IBM Token-Ring Network, a device that converts electronic signals to light pulses or vice versa for use in an optical fiber subsystem. + +**cyclic redundancy check (CRC).** Synonym for *frame check sequence (FCS)*. + +``` ++---+ +| D | ++---+ +``` + +**data.** (1) A representation of facts, concepts, or instructions in a formalized manner suitable for communication, interpretation, or + +| Copyright IBM Corp. 1986, 1996 +GLOSSARY - 3 + +--- + + +## Page 546 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Glossary + +processing by human or automatic means. (I) (A) (2) Any representations such as characters or analog quantities to which meaning is or might be assigned. (A) + +**data frame.** Synonym for packet. + +**datagram.** A particular type of information encapsulation at the network layer of the adapter protocol. No explicit acknowledgment for the information is sent by the receiver. Instead, transmission relies on the *best effort* of the link layer. + +**data integrity.** (1) The condition that exists as long as accidental or intentional destruction, alteration, or loss of data does not occur. (T) (2) Preservation of data for its intended use. + +**data link.** (1) Any physical link, such as a wire or a telephone circuit, that connects one or more remote terminals to a communication control unit, or connects one communication control unit with another. (2) The assembly of parts of two data terminal equipment (DTE) devices that are controlled by a link protocol, and the interconnecting data circuit, that enable data to be transferred from a data source to a data sink. (I) (3) In SNA, see also *link*. +**Note:** A telecommunication line is only the physical medium of transmission. A data link includes the physical medium of transmission, the protocol, and associated devices and programs; it is both physical and logical. + +**data link control (DLC) protocol.** The LAN protocol used to attach a device to and remove a device from the network. The DLC protocol is also used to send information onto and receive information from the network, exchange data, and control information with network higher level protocols and interfaces. + +**data network.** An arrangement of data circuits and switching facilities for establishing connections between data terminal equipment. (I) + +**data packet.** (1) At the interface between data terminal equipment (DTE) and data circuit-terminating equipment (DCE), a data unit used to transmit user data over a virtual circuit. (2) In an Open Systems Interconnection (OSI) network, a data unit passed between transport layer entities. + +**data rate.** See *data transfer rate, line data rate*. + +**data transfer.** (1) The result of the transmission of data signals from any data source to a data receiver. (2) The movement, or copying, of data from one location and the storage of the data at another location. + +**data transfer mode.** The method of data transfer between a host computer and a channel-attached device. Data Channel Interlock (DCI) and data streaming are two data transfer modes. + +**data transfer rate.** The average number of bits, characters, or blocks per unit of time passing between equipment in a data-transmission session. (I) The rate is expressed in bits, characters, or blocks per second, minute, or hour. + +**data transmission.** The conveying of data from one place for reception elsewhere by means of telecommunications. (I) + +**default.** Pertaining to an attribute, value, or option that is assumed when none is explicitly specified. + +**default value.** A value assumed when no value has been specified. + +**delimiter.** (1) A character used to indicate the beginning or end of a character string. (T) (2) A bit pattern that defines the beginning or end of a frame or token on a LAN. + +**destination.** Any point or location, such as a node, station, or particular terminal, to which information is to be sent. + +**destination address.** A field in the medium access control (MAC) frame that identifies the physical location to which information is to be sent. Contrast with *source address*. + +**device.** (1) A mechanical, electrical, or electronic contrivance with a specific purpose. (2) An input/output unit such as a terminal, display, or printer. See also *attaching device*. + +**device driver.** The code needed to attach and use a device on a computer or a network. + +**diagnostics.** Modules or tests used by computer users and service personnel to diagnose hardware problems. + +**digital.** (1) Pertaining to data in the form of digits. (A) Contrast with *analog*. (2) Pertaining to data consisting of numerical values or discrete units. + +**direct memory access (DMA).** The transfer of data between memory and I/O units without processor intervention. + +**disabled.** (1) Pertaining to a state of a processing unit that prevents the occurrence of certain types of interruptions. (2) Pertaining to the state in which a transmission control unit or audio response unit cannot accept incoming calls on a line. + +**disconnected mode.** (1) In synchronous data link control (SDLC), a response from a secondary station indicating that it is disconnected and wants to be online. Synonym for *disconnected phase*. + +**disconnected phase.** A phase entered by data circuit-terminating equipment (DCE) when it detects error conditions, recovers from a temporary internal malfunction, or receives a disconnect (DISC) command from data terminal equipment (DTE). In the disconnected phase, the DCE may initiate link setup but can transmit only disconnected-mode responses to received frames. Synonymous with *disconnected mode* (2). + +**Disk Operating System.** An operating system for computer systems that use disks and diskettes for auxiliary storage of programs and data. + +**downstream.** (1) On an IBM Token-Ring Network, the direction of data flow. (2) In the direction of data flow or toward the destination of transmission. Contrast with *upstream*. + +
Copyright IBM Corp. 1986, 1996 +GLOSSARY -4
+ +--- + + +## Page 547 + ++---+ +| E | ++---+ + +**early token release (ETR).** In token-ring and Fiber Distributed Data Interface (FDDI) networks, a function that allows a transmitting adapter to release a new token as soon as it has completed frame transmission, whether or not the frame header has returned to that adapter. + +**EBCDIC.** Extended binary-coded decimal interchange code. A coded character set consisting of 8-bit coded characters. (A) + +**element.** (1) In a set, an object, entity, or concept having the properties that define a set. (I) (A) (2) A parameter value in a list of parameter values. + +**emulation.** (1) The imitation of all or part of one computer system by another, primarily by hardware, so that the imitating system accepts the same data, executes the same programs, and achieves the same results as the imitated computer system. (I) (A) (2) The use of programming techniques and special machine features to permit a computing system to execute programs written for another system. + +**enabled.** (1) On a LAN, pertaining to an adapter or device that is active, operational, and able to receive frames from the network. (2) Pertaining to a state of a processing unit that allows the occurrence of certain types of interruptions. (3) Pertaining to the state in which a transmission control unit or an audio response unit can accept incoming calls on a line. + +**end delimiter.** The last byte of a token or frame, consisting of a special, recognizable bit pattern. + +**enterprise.** A business or organization that consists of two or more sites separated by a public right-of-way or a geographical distance. Contrast with *establishment*. + +**establishment.** A user's premises that do not extend across public rights of way (for example, a single office building, warehouse, or campus). Contrast with *enterprise*. + +**Ethernet network.** A baseband LAN with a bus topology in which messages are broadcast on a coaxial cable using a carrier sense multiple access/collision detection (CSMA/CD) transmission method. the completion of an asynchronous operation, such as an I/O operation. + +**exception.** An abnormal condition such as an I/O error encountered in processing a data set or a file. See also *overflow exception* and *underflow exception*. + +**execute.** To perform the actions specified by a program or a portion of a program. (T) + +**execution.** The process of carrying out an instruction or instructions of a computer program by a computer. (I) (A) + +**exit.** To execute an instruction or statement within a portion of a program in order to terminate the execution of that portion. (T) Note: Such portions of programs include loops, routines, subroutines, and modules. + +**extended binary-coded decimal interchange code (EBCDIC).** A coded character set consisting of 8-bit coded characters. + ++---+ +| F | ++---+ + +**fault.** An accidental condition that causes a functional unit to fail to perform its required function. (I) (A) + +**feature.** A part of an IBM product that may be ordered separately by the customer. + +**Fiber Distributed Data Interface (FDDI).** A high-performance, general-purpose, multi-station network designed for efficient operation with a peak data transfer rate of 100 Mbps. It uses token-passing protocol, similar in concept to token-ring architecture. It may use optical fiber as the transmission medium over distances of several kilometers, or it may use copper cable as the transmission medium over shorter distances. + +**field.** On a data medium or a storage medium, a specified area used for a particular category of data; for example, a group of character positions used to enter or display wage rates on a panel. (T) + +**file.** A named set of records stored or processed as a unit. (T) + +**file name.** (1) A name assigned or declared for a file. (2) The name used by a program to identify a file. + +**first-in first-out (FIFO).** A queuing technique in which the next item to be retrieved is the item that has been in the queue for the longest time. (A) + +**flag.** A character or indicator that signals the occurrence of some condition, such as the setting of a switch, or the end of a word. (A) + +**frame.** (1) The unit of transmission in some LANs, including the IBM Token-Ring Network and the IBM PC Network. It includes delimiters, control characters, information, and checking characters. On a token-ring network, a frame is created from a token when the token has data appended to it. On a token bus network (IBM PC Network), all frames including the token frame contain a preamble, start delimiter, control address, optional data and checking characters, end delimiter, and are followed by a minimum silence period. (2) A housing for machine elements. (3) In synchronous data link control (SDLC), the vehicle for every command, every response, and all information that is transmitted using SDLC procedures. Each frame begins and ends with a flag. + +**frame check sequence (FCS).** (1) A system of error checking performed at both the sending and receiving station after a block check character has been accumulated. (2) A numeric value derived from the bits in a message that is used to check for any bit errors in transmission. (3) A redundancy check in which the check key is generated by a cyclic algorithm. (T) Synonymous with *cyclic redundancy check (CRC)*. + +Copyright IBM Corp. 1986, 1996 +GLOSSARY - 5 + +--- + + +## Page 548 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Glossary + +**frequency.** The rate of signal oscillation, expressed in hertz (cycles per second). + +**function.** (1) A specific purpose of an entity, or its characteristic action. (A) (2) In data communications, a machine action such as carriage return or line feed. + +**functional address.** In IBM network adapters, a special kind of group address in which the address is bit-significant, each **On** bit representing a function performed by the station (such as **Active Monitor**, **Ring Error Monitor**, **LAN Error Monitor**, or **Configuration Report Server**). + +``` ++---+ +| G | ++---+ +``` + +**gateway.** A device and its associated software that interconnect networks or systems of different architectures. The connection is usually made above the reference model network layer. For example, a gateway allows LANs access to System/370 host computers. Contrast with **bridge** and **router**. + +**group.** (1) A set of related records that have the same value for a particular field in all records. (2) A collection of users who can share access authorities for protected resources. (3) A list of names that are known together by a single name. + +**group address.** In a LAN, a locally administered address assigned to two or more adapters to allow the adapters to copy the same frame. Contrast **locally administered address** with **universally administered address**. + +**group SAP.** A single address assigned to a group of service access points (SAPs). See also **group address**. + +``` ++---+ +| H | ++---+ +``` + +**hard error.** An error condition on a network that requires that the source of the error be removed or that the network be reconfigured before the network can resume reliable operation. See also **beaconing**. Contrast with **soft error**. + +**hardware.** Physical equipment as opposed to programs, procedures, rules, and associated documentation. (I) (A) + +**header.** The portion of a message that contains control information for the message such as one or more destination fields, name of the originating station, input sequence number, character string indicating the type of message, and priority level for the message. + +``` ++---+ +| I | ++---+ +``` + +**IBM Personal Computer Disk Operating System (DOS).** A disk operating system based on MS-DOS. + +**inactive.** (1) Not operational. (2) Pertaining to a node or device not connected or not available for connection to another node or device. (3) Pertaining to a station that is only repeating frames or tokens, or both. + +**individual address.** An address that identifies a particular network adapter on a LAN. See also **locally administered address** and **universally administered address**. + +**initialize.** In a LAN, to prepare the adapter (and adapter support code, if used) for use by an application program. + +**input/output (I/O).** (1) Pertaining to a device whose parts can perform an input process and an output process at the same time. (I) (2) Pertaining to a functional unit or channel involved in an input process, output process, or both, concurrently or not, and to the data involved in such a process. + +**insert.** To make an attaching device an active part of a LAN. + +**interface.** (1) A shared boundary between two functional units, defined by functional characteristics, common physical interconnection characteristics, signal characteristics, and other characteristics as appropriate. (I) (2) A shared boundary. An interface may be a hardware component to link two devices or a portion of storage or registers accessed by two or more computer programs. (A) (3) Hardware, software, or both, that links systems, programs, or devices. + +**interrupt.** (1) A suspension of a process, such as execution of a computer program, caused by an external event and performed in such a way that the process can be resumed. (A) (2) To stop a process in such a way that it can be resumed. (3) In data communication, to take an action at a receiving station that causes the sending station to end a transmission. (4) A means of passing processing control from one software or microcode module or routine to another, or of requesting a particular software, microcode, or hardware function. + +**interrupt level.** The means of identifying the source of an interrupt, the function requested by an interrupt, or the code or feature that provides a function or service. + +``` ++---+ +| J | ++---+ +``` + +**jumper.** A connector between two pins on a network adapter that enables or disables an adapter option, feature, or parameter value. + +``` ++---+ +| L | ++---+ +``` + +Copyright IBM Corp. 1986, 1996 +GLOSSARY -6 + +--- + + +## Page 549 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Glossary + ++---+ +LAN adapter. The circuit card within a communicating device (such as a personal computer) that, together with its associated software, enables the device to be attached to a LAN. + +LAN multicast. The sending of a transmission frame intended to be accepted by a group of selected data stations on the same LAN. + +LAN segment. (1) Any portion of a LAN (for example, a single bus or ring) that can operate independently but is connected to other parts of the establishment network via bridges. (2) An entire ring or bus network without bridges. See cable segment, ring segment. + +latency. The time interval between the instant at which an instruction control unit initiates a call for data and the instant at which the actual transfer of data begins. Synonymous with waiting time. See also ring latency. + +layer. (1) One of the seven levels of the Open Systems Interconnection reference model. (2) In open systems architecture, a collection of related functions that comprise one level of hierarchy of functions. Each layer specifies its own functions and assumes that lower level functions are provided. (3) In SNA, a grouping of related functions that are logically separate from the functions of other layers. Implementation of the functions in one layer can be changed without affecting functions in other layers. + +limited broadcast. Synonym for single-route broadcast. + +line data rate. The rate of data transmission over a telecommunications link. + +link. (1) The logical connection between nodes including the end-to-end link control procedures. (2) The combination of physical media, protocols, and programming that connects devices on a network. (3) In computer programming, the part of a program, in some cases a single instruction or an address, that passes control and parameters between separate portions of the computer program. (I) (A) (4) To interconnect items of data or portions of one or more computer programs. (5) In SNA, the combination of the link connection and link stations joining network nodes. + +link connection. (1) All physical components and protocol machines that lie between the communicating link stations of a link. The link connection may include a switched or leased physical data circuit, a LAN, or an X.25 virtual circuit. In SNA, the physical equipment providing two-way communication and error correction and detection between one link station and one or more other link stations. + +link station. (1) A specific place in a service access point (SAP) that enables an adapter to communicate with another adapter. (2) A protocol machine in a node that manages the elements of procedure required for the exchange of data traffic with another communicating link station. (3) A logical point within a SAP that enables an adapter to establish connection-oriented communication with another adapter. (4) In SNA, the combination of hardware and software that allows a node to attach to and provide control for a link. + +lobe. In the IBM Token-Ring Network, the section of cable (which may consist of several cable segments) that connects an attaching device to an access unit. + +local area network (LAN). A computer network located on a user's premises within a limited geographical area. +Note: Communication within a local area network is not subject to external regulations; however, communication across the LAN boundary may be subject to some form of regulation. (T) + +local busy. A state that may occur on a network for a given link station during which information-frame reception is suspended. This condition may occur because of an application program request, or a lack of buffers in the service access point (SAP) buffer pool. + +locally administered address. An adapter address that the user can assign to override the universally administered address. Contrast with universally administered address. + +local session number. The number assigned to each session established by an adapter. Each session receives a unique number that distinguishes it from any other active sessions. + +logical connection. In a network, devices that can communicate or work with one another because they share the same protocol. See also physical connection. + +logical link control protocol (LLC protocol). In a local area network, the protocol that governs the exchange of frames between data stations independently of how the transmission medium is shared. (T) + +logical unit (LU). In SNA, a port through which an end user accesses the SNA network in order to communicate with another end user and through which the end user accesses the functions provided by system services control points (SSCPs). An LU can support at least two sessions, one with an SSCP and one with another LU, and may be capable of supporting many sessions with other logical units. + +loop. A closed unidirectional signal path connecting input/output devices to a network. + ++---+ +| M | ++---+ + +MAC frame. Frames used to carry information to maintain the ring protocol and for exchange of management information. + +MAC protocol. (1) In a local area network, the protocol that governs communication on the transmission medium without concern for the physical characteristics of the medium, but taking into account the topological aspects of the network, in order to enable the exchange of data between data stations. (T) See also logical link control protocol (LLC protocol). (2) The LAN protocol sublayer of data link control (DLC) protocol that includes functions for adapter address recognition, copying of message units from the physical network, and message unit format recognition, error detection, and routing within the processor. + +macro. An instruction that causes the execution of a predefined sequence of instructions in the same source language. + +medium. A physical carrier of electrical or optical energy. + +Copyright IBM Corp. 1986, 1996 +GLOSSARY -7 + +--- + + +## Page 550 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Glossary + +**medium access control (MAC) protocol.** In a local area network, the part of the protocol that governs communication on the transmission medium without concern for the physical characteristics of the medium, but taking into account the topological aspects of the network, in order to enable the exchange of data between data stations. (T) + +**message.** (1) A logical partition of the user device's data stream to and from the adapter. (2) A group of characters and control bits transferred as an entity. + +**Micro Channel.** The architecture used by IBM Personal System/2 computers, Models 50 and above. This term is used to distinguish these computers from personal computers using a PC I/O channel, such as an IBM PC, XT, or an IBM Personal System/2 computer, Model 25 or 30. + +**microcode.** (1) One or more microinstructions. (2) A code, representing the instructions of an instruction set, that is implemented in a part of storage that is not program-addressable. (3) To design, write, and also test one or more microinstructions. + +**monitor.** (1) A functional unit that observes and records selected activities for analysis within a data processing system. Possible uses are to show significant departures from the norm, or to determine levels of utilization of particular functional units. (I) (A) (2) Software or hardware that observes, supervises, controls, or verifies operations of a system. (A) + +**Multicast address.** See LAN multicast. + +**multitasking.** (1) Pertaining to the concurrent execution of two or more tasks by a computer. (2) Multiprogramming that provides for the concurrent performance, or interleaved execution, of two or more tasks. + +``` ++---+ +| N | ++---+ +``` + +**name.** An alphanumeric term that identifies a data set, statement, program, or cataloged procedure. + +**n-bit byte.** A string that consists of n bits. (T) + +**NDIS adapter.** Any adapter that is supported by an NDIS MAC driver in addition to the LAN Support Program or the LAN Adapter and Protocol Support software. Ethernet adapters are examples. This term refers only to adapters using IBM adapter support software. See also NDIS MAC driver and non-NDIS adapter. + +**NDIS MAC driver.** A device driver designed in accordance with NDIS that provides low-level access to network adapters. + +**network.** (1) A configuration of data processing devices and software connected for information interchange. (2) An arrangement of nodes and connecting branches. Connections are made between data stations. (T) + +**network administrator.** A person who manages the use and maintenance of a network. + +**network application program.** A program used to connect and communicate with adapters on a network, enabling users to perform application-oriented activities and to run other application programs. + +**network architecture.** The logical structure and operating principles of a computer network. (T) See also Systems Network Architecture (SNA) and Open Systems Interconnection (OSI) architecture. +**Note:** The operating principles of a network include those of services, functions, and protocols. + +**Network Basic Input/Output System (NetBIOS).** A message interface used on LANs to provide message, print server, and file server functions. The IBM NetBIOS application program interface (API) provides a programming interface to the LAN so that an application program can have LAN communication without knowledge and responsibility of the data link control (DLC) interface. + +**network management.** The conceptual control element of a station that interfaces with all of the architectural layers of that station and is responsible for the resetting and setting of control parameters, obtaining reports of error conditions, and determining if the station should be connected to or disconnected from the network. + +**network management vector transport.** The portion of an alert transport frame that contains the alert message. + +**network status.** The condition of the network. + +**no carrier.** On broadband networks, a condition in which a carrier signal is not being broadcast on a given frequency. In the absence of such a carrier, no information can be modulated on that frequency. + +**node.** (1) Any device, attached to a network, that transmits and/or receives data. (2) An endpoint of a link, or a junction common to two or more links in a network. (3) In a network, a point where one or more functional units interconnect transmission lines. + +**node address.** The address of an adapter on a LAN. + +**non-NDIS adapter.** An adapter supported by IBM adapter support software only, without support from an NDIS MAC driver. An example is the IBM PC Network Adapter. All non-NDIS adapters are used with the CCB1 interface. See NDIS adapter. + +``` ++---+ +| O | ++---+ +``` + +**office.** See work area. + +**open.** (1) To make an adapter ready for use. (2) A break in an electrical circuit. (3) To make a file ready for use. + +**Open Systems Interconnection (OSI).** (1) The interconnection of open systems in accordance with specific ISO standards. (T) (2) + +Copyright IBM Corp. 1986, 1996 +GLOSSARY - 8 + +--- + + +## Page 551 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Glossary + +The use of standardized procedures to enable the interconnection of data processing systems. +Note: OSI architecture establishes a framework for coordinating the development of current and future standards for the interconnection of computer systems. Network functions are divided into seven layers. Each layer represents a group of related data processing and communication functions that can be carried out in a standard way to support different applications. + +**Open Systems Interconnection (OSI) architecture.** Network architecture that adheres to a particular set of ISO standards that relates to Open Systems Interconnection. (T) + +**Open Systems Interconnection (OSI) reference model.** A model that represents the hierarchical arrangement of the seven layers described by the Open Systems Interconnection architecture. + +**operating system.** Software that controls the execution of programs. An operating system may provide services such as resource allocation, scheduling, input/output control, and data management. (A) Examples are IBM PC DOS and IBM OS/2. + +**Operating System/2 (OS/2).** A set of programs that control the operation of high-speed large-memory IBM personal computers (such as the IBM Personal System/2 computer, Models 50 and above), providing multitasking and the ability to address up to 16 MB of memory. Contrast with Disk Operating System (DOS). + +**operation.** (1) A defined action, namely, the act of obtaining a result from one or more operands in accordance with a rule that completely specifies the result for any permissible combination of operands. (A) (2) A program step undertaken or executed by a computer. (3) An action performed on one or more data items, such as adding, multiplying, comparing, or moving. + +**option.** (1) A specification in a statement, a selection from a menu, or a setting of a switch, that may be used to influence the execution of a program. (2) A hardware or software function that may be selected or enabled as part of a configuration process. (3) A piece of hardware (such as a network adapter) that can be installed in a device to modify or enhance device function. + +**output device.** A device in a data processing system by which data can be received from the system. (I) (A) Synonymous with output unit. + +**output unit.** Synonym for output device. + +**overflow exception.** A condition caused by the result of an arithmetic operation having a magnitude that exceeds the largest possible number. See also underflow exception. + +``` ++----+ +| P | ++----+ +``` + +**packet.** (1) In data communication, a sequence of binary digits, including data and control signals, that is transmitted and switched as a composite whole. (I) Synonymous with data frame. Contrast with frame. + +**page.** (1) The portion of a panel that is shown on a display surface at one time. (2) To move back and forth among the pages of a multiple-page panel. See also scroll. (3) In a virtual storage system, a fixed-length block that has a virtual address and is transferred as a unit between real storage and virtual storage. + +**parameter.** (1) A variable that is given a constant value for a specified application and that may denote the application. (I) (A) (2) An item in a menu or for which the user specifies a value or for which the system provides a value when the menu is interpreted. (3) Data passed between programs or procedures. + +**parity (even).** A condition when the sum of all of the digits in an array of binary digits is even. + +**parity (odd).** A condition when the sum of all of the digits in an array of binary digits is odd. + +**path.** (1) In a network, any route between any two nodes. (T) (2) The route traversed by the information exchanged between two attaching devices in a network. (3) A command in IBM Personal Computer Disk Operating System (PC DOS) and IBM Operating System/2 (OS/2) that specifies directories to be searched for commands or batch files that are not found by a search of the current directory. + +**PC Network.** An IBM broadband or baseband LAN with a bus topology in which messages are broadcast from PC Network adapter to PC Network adapter. + +**personal computer (PC).** A desk-top, free-standing, or portable microcomputer that usually consists of a system unit, a display, a monitor, a keyboard, one or more diskette drives, internal fixed-disk storage, and an optional printer. PCs are designed primarily to give independent computing power to a single user and are inexpensively priced for purchase by individuals or small businesses. Examples include the various models of the IBM Personal Computers, and the IBM Personal System/2 computer. + +**phase.** The relative timing (position) of periodic electrical signals. + +**physical connection.** The ability of two connectors to mate and make electrical contact. In a network, devices that are physically connected can communicate only if they share the same protocol. See also logical connection. + +**physical layer.** In the Open Systems Interconnection reference model, the layer that provides the mechanical, electrical, functional, and procedural means to establish, maintain, and release physical connections over the transmission medium. (T) + +**pointer.** (1) An identifier that indicates the location of an item of data. (A) (2) A data element that indicates the location of another data element. (T) (3) A physical or symbolic identifier of a unique target. + +**port.** (1) An access point for data entry or exit. (2) A connector on a device to which cables for other devices such as display stations and printers are attached. Synonymous with socket. + +**post.** (1) To affix to a usual place. (2) To provide items such as return code at the end of a command or function. (3) To define an appendage routine. (4) To note the occurrence of an event. + +| Copyright IBM Corp. 1986, 1996 +GLOSSARY -9 + +--- + + +## Page 552 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Glossary + +**power-on self-test (POST).** A series of diagnostic tests that are run automatically each time the computer's power is turned on. + +**primary adapter.** In a personal computer that is used on a LAN and that supports installation of two network adapters, the adapter that uses standard (or default) mapping between adapter-shared RAM, adapter ROM, and designated computer memory segments. The primary adapter is usually designated as adapter 0 in configuration parameters. Contrast with *alternate adapter*. + +**PROCEDURE.** A set of instructions that gives a service representative a step-by-step procedure for tracing a symptom to the cause of failure. + +**processor.** In a computer, a functional unit that interprets and executes instructions. (I) (A) + +**protocol.** (1) A set of semantic and syntactic rules that determines the behavior of functional units in achieving communication. (I) (2) In SNA, the meanings of and the sequencing rules for requests and responses used for managing the network, transferring data, and synchronizing the states of network components. (3) A specification for the format and relative timing of information exchanged between communicating parties. + +**protocol driver.** A device driver that provides a higher-level communication interface between an application program and the interface defined by the adapter. For example, an 802.2 protocol driver provides the 802.2 interface at the top and the interface to the NDIS MAC driver at the bottom. See also *NDIS MAC driver*. + +**protocol handler.** Hardware or microcode in an adapter that encodes and decodes the protocol used to format signals sent along a network. + +``` ++---+ +| R | ++---+ +``` + +**RAM Paging.** RAM Paging is a technique that allows the computer software to access all of the RAM on adapters that contain 64 KB of RAM, without having to map the entire shared RAM into the computer's memory map. The shared RAM on the adapter is paged into the computer's memory map one 16-KB page at a time. + +**RAM size.** The amount of RAM that is directly mapped into the computer's memory map. + +**random access memory (RAM).** A computer's or adapter's volatile storage area into which data may be entered and retrieved in a nonsequential manner. + +**read-only memory (ROM).** A computer's or adapter's storage area whose contents cannot be modified by the user except under special circumstances. + +**receive.** To obtain and store information transmitted from a device. + +**Reference Diskette.** A diskette shipped with the IBM Personal System/2 computers with Micro Channel architecture. The diskette contains code and files used for configuration of options and for hardware diagnostic testing. + +**register.** (1) A storage area in a computer's memory where specific data is stored. (2) A storage device having a specified storage capacity such as bit, byte, or computer word, and usually intended for a special purpose. (I) + +**remodulator.** In broadband networks, an active device that demodulates inbound information and remodulates it on the higher frequency outbound channel. A remodulator may or may not provide frame error detection and does not amplify inbound noise distortion. It provides network clocking by broadcasting continuous idle when the inbound channel is not transmitting information. Contrast with *translator*. + +**remote program load.** A function provided by adapter hardware components and software that enables one computer to load programs and operating systems into the memory of another computer, without requiring the use of a diskette or fixed disk at the receiving computer. + +**remove.** (1) To take an attaching device off a network. (2) To stop an adapter from participating in data passing on a network. + +**return code.** (1) A value (usually hexadecimal) provided by an adapter or a program to indicate the result of an action, command, or operation. (2) A code used to influence the execution of succeeding instructions. (A) + +**ring in (RI).** In an IBM Token-Ring Network, the receive or input receptacle on an access unit or repeater. + +**ring latency.** In an IBM Token-Ring Network, the time, measured in bit times at the data transmission rate, required for a signal to propagate once around the ring. Ring latency includes the signal propagation delay through the ring medium, including drop cables, plus the sum of propagation delays through each data station connected to the Token-Ring Network. (T) + +**ring network.** A network configuration in which a series of attaching devices is connected by unidirectional transmission links to form a closed path. A ring of an IBM Token-Ring Network is referred to as a LAN segment or as a Token-Ring Network segment. + +**ring segment.** A ring segment is any section of a ring that can be isolated (by unplugging connectors) from the rest of the ring. A segment can consist of a single lobe, the cable between access units, or a combination of cables, lobes, and/or access units. See *cable segment, LAN segment*. + +**ring station.** A station that supports the functions necessary for connecting to the LAN and for operating with the token-ring protocols. These include token handling, transferring copied frames from the ring to the using node's storage, maintaining error counters, observing medium access control (MAC) sublayer protocols (for address acquisition, error reporting, or other duties), and (in the full-function native mode) directing frames to the correct data link control (DLC) link station. + +**ring status.** The condition of the ring. + +**router.** An attaching device that connects two LAN segments, which use similar or different architectures, at the reference model network layer. Contrast with *bridge* and *gateway*. + +
Copyright IBM Corp. 1986, 1996 +GLOSSARY - 10
+ +--- + + +## Page 553 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Glossary + +**routine.** Part of a program, or a sequence of instructions called by a program, that may have some general or frequent use. + +**routing.** (1) The assignment of the path by which a message will reach its destination. (2) The forwarding of a message unit along a particular path through a network, as determined by the parameters carried in the message unit, such as the destination network address in a transmission header. + +``` ++---+ +| S | ++---+ +``` + +**scroll.** To move all or part of the display image vertically or horizontally to display data that cannot be observed within a single display image. See also page (2). + +**segment.** See cable segment, LAN segment, ring segment. + +**server.** (1) A device, program, or code module on a network dedicated to providing a specific service to a network. (2) On a LAN, a data station that provides facilities to other data stations. Examples are a file server, print server, and mail server. + +**service access point (SAP).** (1) A logical point made available by an adapter where information can be received and transmitted. A single SAP can have many links terminating in it. (2) In Open Systems Interconnection (OSI) architecture, the logical point at which an n + 1-layer entity acquires the services of the n-layer. For LANs, the n-layer is assumed to be data link control (DLC). A single SAP can have many links terminating in it. These link end-points are represented in DLC by link stations. + +**session.** (1) A connection between two application programs that allows them to communicate. (2) In SNA, a logical connection between two network addressable units that can be activated, tailored to provide various protocols, and deactivated as requested. (3) The data transport connection resulting from a call or link between two devices. (4) The period of time during which a user of a node can communicate with an interactive system, usually the elapsed time between log on and log off. (5) In network architecture, an association of facilities necessary for establishing, maintaining, and releasing connections for communication between stations. (T) + +**session layer.** In the Open Systems Interconnection reference model, the layer that provides the means necessary for two end users to organize and synchronize their dialogue and to manage their data exchange. (T) + +**shared RAM.** Random access memory (RAM) on an adapter that is shared by the computer in which the adapter is installed. + +**signal.** (1) A time-dependent value attached to a physical phenomenon for conveying data. (2) A variation of a physical quantity, used to convey data. + +**single-route broadcast.** The forwarding of specially designated broadcast frames only by bridges which have single-route broadcast enabled. If the network is configured correctly, a single-route broadcast frame will have exactly one copy delivered to every LAN segment in the network. Synonymous with limited broadcast. See also automatic single-route broadcast. + +**socket.** Synonym for port (2). + +**soft error.** An intermittent error on a network that causes data to have to be transmitted more than once to be received. A soft error affects the network's performance but does not, by itself, affect the network's overall reliability. If the number of soft errors becomes excessive, reliability is affected. Contrast with hard error. + +**source address.** A field in the medium access control (MAC) frame that identifies the location from which information is sent. Contrast with destination address. + +**start delimiter.** The first byte of a token or frame, consisting of a special, recognizable bit pattern. + +**static RAM.** In the IBM PC Network, random access memory on the adapter that is shared by the computer in which the adapter is installed. + +**station.** (1) A communication device attached to a network. The term used most often in LANs is an attaching device or workstation. (2) An input or output point of a system that uses telecommunication facilities; for example, one or more systems, computers, terminals, devices, and associated programs at a particular location that can send or receive data over a telecommunication line. See also attaching device, workstation. + +**subvector.** A subcomponent of the medium access control (MAC) major vector. + +**switch.** On an adapter, a mechanism used to select a value for, enable, or disable a configurable option or feature. + +**synchronous.** (1) Pertaining to two or more processes that depend on the occurrences of a specific event such as common timing signal. (I) (A) (2) Occurring with a regular or predictable timing relationship. + +**synchronous data link control (SDLC).** A discipline conforming to subsets of the Advanced Data Communication Control Procedures (ADCCP) of the American National Standards Institute (ANSI) and High-level Data Link Control (HDLC) of the International Organization for Standardization, for managing synchronous, code-transparent, serial-by-bit information transfer over a link connection. Transmission exchanges may be duplex or half-duplex over switched or nonswitched links. The configuration of the link connection may be point-to-point, multipoint, or loop. (I) + +**system.** In data processing, a collection of people, machines, and methods organized to accomplish a set of specific functions. (I) (A) + +**system configuration.** A process that specifies the devices and programs that form a particular data processing system. + +**Systems Application Architecture (SAA).** An architecture developed by IBM that consists of a set of selected software interfaces, conventions, and protocols, and that serves as a common framework for application development, portability, and use across different IBM hardware systems. + +**Systems Network Architecture (SNA).** The description of the logical structure, formats, protocols, and operational sequences for + +Copyright IBM Corp. 1986, 1996 +GLOSSARY - 11 + +--- + + +## Page 554 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Glossary + +transmitting information units through, and controlling the configuration and operation of, networks. +**Note:** The layered structure of SNA allows the ultimate origins and destinations of information, that is, the end users, to be independent of and unaffected by the specific SNA network services and facilities used for information exchange. + +**system unit.** (1) A part of a computer that contains the processing unit, and may contain devices such as disk and diskette drives. (2) In an IBM personal computer, the unit that contains the processor circuitry, ROM, RAM, and the I/O channel. It may have one or more disk or diskette drives. + +``` ++---+ +| T | ++---+ +``` + +**terminal.** In data communication, a device, usually equipped with a keyboard and display device, capable of sending and receiving information. + +**threshold.** (1) A level, point, or value above which something is true or will take place and below which it is not true or will not take place. (2) In IBM bridge programs, a value set for the maximum number of frames that are not forwarded across a bridge due to errors, before a *threshold exceeded* occurrence is counted and indicated to network management programs. (3) An initial value from which a counter is decremented to zero, or a value to which a counter is incremented or decremented from an initial value. When the counter reaches zero or the threshold value, a decision is made and/or an event occurs. + +**time-out.** (1) A parameter related to an enforced event designed to occur at the conclusion of a predetermined elapsed time. A time-out condition can be canceled by the receipt of an appropriate time-out cancellation signal. (2) A time interval allotted for certain operations to occur; for example, response to polling or addressing before system operation is interrupted and must be restarted. + +**token.** A sequence of bits passed from one device to another on the token-ring network that signifies permission to transmit over the network. It consists of a starting delimiter, an access control field, and an end delimiter. The access control field contains a bit that indicates to a receiving device that the token is ready to accept information. If a device has data to send along the network, it appends the data to the token. When data is appended, the token then becomes a frame. See *frame*. + +**token ring.** A network with a ring topology that passes tokens from one attaching device (node) to another. A node that is ready to send can capture a token and insert data for transmission. + +**token-ring network.** (1) A ring network that allows unidirectional data transmission between data stations by a token-passing procedure over one transmission medium so that the transmitted data returns to and is removed by the transmitting station. (T) The IBM Token-Ring Network is a baseband LAN with a star-wired ring topology that passes tokens from network adapter to network adapter. (2) A network that uses a ring topology, in which tokens are passed in a sequence from node to node. A node that is ready to send can capture the token and insert data for transmission. (3) A group of interconnected token rings. + +**trace.** (1) A record of the execution of a computer program. It exhibits the sequences in which the instructions were executed. (2) A record of the frames and bytes transmitted on a network. + +**transaction.** In an SNA network, an exchange between two programs that usually involves a specific set of initial input data that causes the execution of a specific task or job. Examples of transactions include the entry of a customer's deposit that results in the updating of the customer's balance, and the transfer of a message to one or more destination points. + +**transceiver.** Any device that can transmit and receive traffic. + +**translator.** In broadband networks, an active device for converting an inbound channel to a higher frequency outbound channel. The conversion is done by removing the inbound carrier, adding the outbound carrier, and amplifying the signal. (A translator amplifies inbound errors and noise distortion.) Contrast with *remodulator*. + +**transmission frame.** See *frame*. + +**transmit.** To send information from one place for reception elsewhere. + +**transmitter.** (1) A circuit used in data communication applications to send information from one place for reception elsewhere. (2) The device in which the transmission circuits are housed. + +``` ++---+ +| U | ++---+ +``` + +**underflow exception.** A condition caused by the result of an arithmetic operation having a magnitude less than the smallest possible nonzero number. + +**universally administered address.** The address permanently encoded in an adapter at the time of manufacture. All universally administered addresses are unique. Contrast with *locally administered address*. + +**unnumbered acknowledgment.** A data link control (DLC) command used in establishing a link and in answering receipt of logical link control (LLC) frames. + +**upstream.** On an IBM Token-Ring Network, the direction opposite that of data flow. Contrast with *downstream*. + +**usability.** The quality of a system, program, or device that enables it to be easily understood and conveniently employed by a user. + +``` ++---+ +| V | ++---+ +``` + +**variable.** (1) In computer programming, a character or group of characters that refers to a value and, in the execution of a computer + +
Copyright IBM Corp. 1986, 1996 +GLOSSARY - 12
+ +--- + + +## Page 555 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Glossary + +program, corresponds to an address. (2) A quantity that can assume any of a given set of values. (A) + +**vector.** One or more related fields of data, in a specified format. A quantity usually characterized by an ordered set of numbers. (I) (A) + +**version.** A separate IBM-licensed program, based on an existing IBM-licensed program, that usually has significant new code or new function. + +``` ++---+ +| W | ++---+ +``` + +**waiting time.** Synonym for *latency*. + +**wideband.** Synonym for *broadband*. + +**wire fault.** An error condition caused by a break in the wires or a short between the wires (or shield) in a segment of cable. + +**work area.** An area in which terminal devices (such as displays, keyboards, and printers) are located. Access units may also be located in work areas. + +**working diskette.** A diskette to which files are copied from an original diskette for use in everyday operation to protect the original diskette from damage. + +**workstation.** (1) An I/O device that allows either transmission of data or the reception of data (or both) from a host system, as needed to perform a job: for example, a display station or printer. (2) A configuration of I/O equipment at which an operator works. (T) (3) A terminal or microcomputer, usually one connected to a mainframe or network, at which a user can perform tasks. + +
Copyright IBM Corp. 1986, 1996 +GLOSSARY - 13
+ +--- + + +## Page 556 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Index + +**Numerics** +3270 support, Workstation Program D.2.1.4 + +**A** +adapter 6.5 +address 2.7 +application program interfaces 1.2 +check +CCB1 B.7.1 +CCB2 B.7.2 +CCB3 B.7.3 +reason codes, IBM Token-Ring Network B.8 +reason codes, PC network and Ethernet network B.9 +log formats 3.3.11.1 +NDIS 1.2.1 +non-NDIS 1.2.1 +open errors +PC and Ethernet B.13 +Token-Ring network B.12.1 +protocol drivers 1.2 +support programs 1.6 +Adapter Check +0x46 EXCEPTION EVENT 6.7.2 +in NCB_RESERVE field 6.4.7 6.5 +minor code for NetBIOS Trace 6.7.4 +on NCB.STATUS command 6.4.7 6.5 +OS2TRACEMASK PARAMETER 6.7.5 +TRACE Parameter 6.7.3 +Adapter Status 6.5 +adapter type identification in NetBIOS 4.6.22 +ADAPTER_WORK_SIZE E.2.2 +adapters supported by LAPS 6.2 +address +adapter node 2.6 +service access point (SAP) 2.7.1 +station ID 2.7.1 +appendages, adapter support software 2.3.2.1 + +**B** +bridge +parallel 1.13.3.2 +setting length bits 1.13.2.2 +BRING_UPS parameter 3.3.6 B.11 +broadcast +broadcast indicators 1.13.2.1 +broadcast address 3.3.17 +broadcast indicators 1.13.2.1 +buffer +pool 2.9.1 +receive +field explanations 2.9.2.2 +formats 2.9.2.1 +transmit +formats 2.9.3.1 +overview 2.9.3 +BUFFER.FREE 3.3.1 +BUFFER.GET 3.3.2 +Busmaster Server Adapter 6.5 + +**C** +calling conventions +DD interface (CCB3) 2.4.2.3 +DLR interface (CCB2) 2.4.1.4 +LAN Support Program (CCB1) 2.3.1 +NetBIOS 4.5.6 +canonical bit ordering 2.6 +CCB (command control block) +CCB1 2.3.3 +CCB2 (DLR) 2.4.1.6 +CCB3 (DD) 2.4.2.5 +command tables +DLC and Direct Interface A.1 +NetBIOS A.2 +commands +See commands, adapter support +field explanations 2.5.1 +return codes +DLC and direct interface B.2 +DLC and direct interface by command B.2.1.1 +DLC and direct interface cause and action B.2.2 +NCB (NetBIOS) B.4 +NetBIOS by command B.4.1 +NetBIOS cause and action B.4.2 +CCB interface +DIR.RESET.MULT.GROUP.ADDRESS 3.3.12 3.3.17 +CCB1 +adapter check B.7.1 + +
Copyright IBM Corp. 1986, 1996
+<page_number>INDEX - 1</page_number> + +--- + + +## Page 557 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Index + +command return codes B.2.1.1 +function not supported 3.2 +network status B.10.1 +PC system detected errors B.14.1 +CCB2 6.7.2 to 6.7.3 +adapter check B.7.2 +command return codes B.2.1.2 +network status B.10.2 +PC system detected errors B.14.2 +system action exceptions B.15.1 +CCB3 6.7.2 to 6.7.3 +adapter check B.7.3 +command return codes B.2.1.3 +network status B.10.3 +PC system detected errors B.14.3 +system action exceptions B.15.2 +command completion +DD interface (CCB3) 2.4.2.4 +DLR interface (CCB2) 2.4.1.5 +LAN Support Program (CCB1) 2.3.2 +command control block (CCB) +CCB1 2.3.3 +CCB2 (DLR) 2.4.1.6 +CCB3 (DD) 2.4.2.5 +command tables +DLC and Direct Interface A.1 +NetBIOS A.2 +commands +See commands, adapter support +field explanations 2.5.1 +return codes +DLC and direct interface B.2 +DLC and direct interface by command B.2.1.1 +DLC and direct interface cause and action B.2.2 +NCB (NetBIOS) B.4 +NetBIOS by command B.4.1 +NetBIOS cause and action B.4.2 +commands, adapter support +BUFFER.FREE 3.3.1 +BUFFER.GET 3.3.2 +DIR.CLOSE.ADAPTER 3.3.3 +DIR.CLOSE.DIRECT 3.3.4 +DIR.DEFINE.MIF.ENVIRONMENT 3.3.5 +DIR.INITIALIZE 3.3.6 +DIR.INTERRUPT 3.3.7 +DIR.MODIFY.OPEN.PARMS 3.3.8 +DIR.OPEN.ADAPTER 3.3.9 +DIR.OPEN.DIRECT 3.3.10 +DIR.READ.LOG 3.3.11 +DIR.RESTORE.OPEN.PARMS 3.3.13 +DIR.SET.EXCEPTION.FLAGS 3.3.14 +DIR.SET.FUNCTIONAL.ADDRESS 3.3.15 +DIR.SET.GROUP.ADDRESS 3.3.16 +DIR.SET.USER.APPENDAGE 3.3.18 +DIR.STATUS 3.3.19 +DIR.TIMER.CANCEL 3.3.20 +DIR.TIMER.CANCEL.GROUP 3.3.21 +DIR.TIMER.SET 3.3.22 +DLC.CLOSE.SAP 3.3.23 +DLC.CLOSE.STATION 3.3.24 +DLC.CONNECT.STATION 3.3.25 +DLC.FLOW.CONTROL 3.3.26 +DLC.MODIFY 3.3.27 +DLC.OPEN.SAP 3.3.28 +DLC.OPEN.STATION 3.3.29 +DLC.REALLOCATE 3.3.30 +DLC.RESET 3.3.31 +DLC.SET.THRESHOLD 3.3.32 +DLC.STATISTICS 3.3.33 +PDT.TRACE.OFF 3.3.34 +PDT.TRACE.ON 3.3.35 +PURGE.RESOURCES 3.3.36 +READ 3.3.37 +READ.CANCEL 3.3.38 +RECEIVE 3.3.39 +RECEIVE.CANCEL 3.3.40 +RECEIVE.MODIFY 3.3.41 +TRANSMIT.DIR.FRAME 3.3.42 +TRANSMIT.I.FRAME 3.3.43 +TRANSMIT.TEST.CMD 3.3.44 +TRANSMIT.UI.FRAME 3.3.45 +TRANSMIT.XID.CMD 3.3.46 +TRANSMIT.XID.RESP.FINAL 3.3.47 +TRANSMIT.XID.RESP.NOT.FINAL 3.3.48 + +
Copyright IBM Corp. 1986, 1996
+<page_number>INDEX - 2</page_number> + +--- + + +## Page 558 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Index + +commands, NetBIOS +NCB.ADD.GROUP.NAME 4.6.1 +NCB.ADD.NAME 4.6.2 +NCB.CALL 4.6.3 +NCB.CANCEL 4.6.4 +NCB.CHAIN.SEND 4.6.5 +NCB.CHAIN.SEND.NO.ACK 4.6.6 +NCB.DELETE.NAME 4.6.7 +NCB.FIND.NAME 4.6.8 +NCB.HANG.UP 4.6.9 +NCB.LAN.STATUS.ALERT 4.6.10 +NCB.LISTEN 4.6.11 +NCB.RECEIVE 4.6.12 +NCB.RECEIVE.ANY 4.6.13 +NCB.RECEIVE.BROADCAST.DATAGRAM 4.6.14 +NCB.RECEIVE.DATAGRAM 4.6.15 +NCB.RESET 4.6.16 +NCB.SEND 4.6.17 +NCB.SEND.BROADCAST.DATAGRAM 4.6.18 +NCB.SEND.DATAGRAM 4.6.19 +NCB.SEND.NO.ACK 4.6.20 +NCB.SESSION.STATUS 4.6.21 +NCB.STATUS 4.6.22 +NCB.TRACE 4.6.23 +NCB.UNLINK 4.6.24 +Communications Manager, O/S 2 +device driver (DD) interface 1.7.1 +dynamic link routine (DLR) interface 1.7.1 +interface comparison 1.7.2 +config.sys 6.7 +CONFIG.SYS commands (OS/2 EE) E.2 +ADAPTER_WORK_SIZE E.2.2 +DATA_HOLD_BUFFERS E.2.1 +DHB_BUFFER_LENGTH E.2.1 +DLC_MAX_GSAP E.2.2 +DLC_MAX_GSAP_MEM E.2.2 +DLC_MAX_SAP E.2.2 +DLC_MAX_STATIONS E.2.2 +DLC_T1_TICK_ONE E.2.2 +DLC_T1_TICK_TWO E.2.2 +DLC_T2_TICK_ONE E.2.2 +DLC_T2_TICK_TWO E.2.2 +DLC_Ti_TICK_ONE E.2.2 +DLC_Ti_TICK_TWO E.2.2 +FUNCTIONAL_ADDRESS E.2.1 +GDTSIZE E.2.2 +GROUP_ADDRESS E.2.1 +MAX_USERS E.2.2 +NETWORK_FLAGS E.2.2 +NODE_ADDRESS E.2.1 +NUMBER_RCV_BUFFERS E.2.1 +OPEN_OPTIONS E.2.1 +PRODUCT_ID E.2.1 +QSIZE E.2.2 +RCV_BUFFER_LENGTH E.2.1 +SRAM_ADDRESS E.2.1 +SYSTEM_KEY E.2.2 +configuration 6.1 F.0 +D +data link control interface +command sequence 2.8.2 +link station states 2.8.3 +network adapter parameters 2.8.5 +status change events 3.3.37.1 +timers 2.8.4 +types of service 2.8.1 +data segment guidelines +DD interface (CCB3) 2.4.2.2 +DLR interface (CCB2) 2.4.1.3 +data segment restrictions +DD interface (CCB3) 2.4.2.1 +DLR interface (CCB2) 2.4.1.2 +data transmission +between application programs 2.9 +Ethernet (DIX Version 2.0) +IBM PC networks +IBM Token-Ring network +IEEE 802.3 networks +DATA_HOLD_BUFFERS E.2.1 +DEF file 6.3.1 6.4.2 +definition of the IEEE 802.2 API for OS/2 6.3 +definition of the NetBIOS API for OS/2 6.4 +device driver (DD) interface 1.7.1 +device driver interface 6.3.2 to 6.3.3 6.4.3 + +
Copyright IBM Corp. 1986, 1996
+<page_number>INDEX - 3</page_number> + +--- + + +## Page 559 + +device drivers +See drivers +DHB_BUFFER_LENGTH E.2.1 +DIR.CLOSE.ADAPTER 3.3.3 +DIR.CLOSE.DIRECT 3.3.4 +DIR.DEFINE.MIF.ENVIRONMENT 3.3.5 +DIR.INITIALIZE 3.3.6 6.5 +DIR.INTERRUPT 3.3.7 +DIR.MODIFY.OPEN.PARMS 3.3.8 +DIR.OPEN.ADAPTER 3.3.9 6.5 +DIR.OPEN.DIRECT 3.3.10 +DIR.READ.LOG 3.3.11 6.5 +DIR.RESET.MULT.GROUP.ADDRESS 3.3.12 +DIR.RESTORE.OPEN.PARMS 3.3.13 +DIR.SET.EXCEPTION.FLAGS 3.3.14 +DIR.SET.FUNCTIONAL.ADDRESS 3.3.15 6.5 +DIR.SET.GROUP.ADDRESS 3.3.16 +DIR.SET.MULT.GROUP.ADDRESS 3.3.17 +DIR.SET.USER.APPENDAGE 3.3.18 +DIR.STATUS 3.3.19 6.5 +DIR.TIMER.CANCEL 3.3.20 +DIR.TIMER.CANCEL.GROUP 3.3.21 +DIR.TIMER.SET 3.3.22 +direct interface log format 3.3.11.1 +direction bit 1.13.2.3 +diskette, sample LAN program listing C.0 +DIX Version 2.0 network +frame field descriptions 1.16.1 +frames 1.16 +DLC interface +command sequence 2.8.2 +link station states 2.8.3 +network adapter parameters 2.8.5 +status change events 3.3.37.1 +timers 2.8.4 +types of service 2.8.1 +DLC status 6.7.2 to 6.7.5 +codes B.3.2 +suggested actions B.3.3 +table B.3.1 +DLC_MAX_GSAP E.2.2 +DLC_MAX_GSAP_MEM E.2.2 +DLC_MAX_SAP E.2.2 +DLC_MAX_STATIONS E.2.2 +DLC_T1_TICK_ONE E.2.2 +DLC_T1_TICK_TWO E.2.2 +DLC_T2_TICK_ONE E.2.2 +DLC_T2_TICK_TWO E.2.2 +DLC_Ti_TICK_ONE E.2.2 +DLC_Ti_TICK_TWO E.2.2 +DLC.CLOSE.SAP 3.3.23 +DLC.CLOSE.STATION 3.3.24 +DLC.CONNECT.STATION 3.3.25 +DLC.FLOW.CONTROL 3.3.26 +DLC.MODIFY 3.3.27 +DLC.OPEN.SAP 3.3.28 +DLC.OPEN.STATION 3.3.29 +DLC.REALLOCATE 3.3.30 +DLC.RESET 3.3.31 +DLC.SET.THRESHOLD 3.3.32 +DLC.STATISTICS 3.3.33 +DOS NetBIOS 6.1 6.5 +drivers, NDIS MAC 1.2 +drivers, protocol 1.2 +dynamic link interface 6.3 to 6.4.2 +dynamic link routine (DLR) interface 1.7.1 +E +errors +adapter open (PC network and Ethernet) B.13 +adapter open (Token-Ring network) +codes B.12.1 +recommended action table B.12.2.1 +suggested action B.12.2 +bring-up (initialize) B.11 +PC system detected +CCB1 B.14.1 +CCB2 B.14.2 +CCB3 B.14.3 +Ethernet +adapter check reason codes B.9 +calculating RAM (DOS) +calculating RAM (OS/2 EE) +status B.10.5 +Ethernet (DIX Version 2.0) + +Copyright IBM Corp. 1986, 1996 +INDEX -4 + +--- + + +## Page 560 + +frame field descriptions 1.16.1 +frames 1.16 +event posting +DD interface 2.4.2.4 +DLC status change 3.3.37.1 +DLR interface 2.4.1.5 +F +frame +routing information field 1.13.1 +frame, Token-Ring network +elements 1.13 +MAC 1.13 +non-MAC 1.13 +frames +Ethernet (DIX Version 2.0) 1.16 +IEEE 802.3 1.15 +PC network 1.14 +FUNCTIONAL_ADDRESS E.2.1 +G +GDTSIZE E.2.2 +GROUP_ADDRESS E.2.1 +I +I-format LPDU 6.7.4 +IBM PC Network +adapter check reason codes B.9 +frames 1.14 +status B.10.5 +trace table formats 3.3.35.2 +IEEE 802.2 6.1 +IEEE 802.3 network +frame field descriptions 1.16.1 +frames 1.15 +individual bridge portion 1.13.3 +interface +IEEE 802.2 1.8 +NetBIOS 1.8 +APPC/PC 1.11 +direct 1.10.1 +DLC 1.10.2 +NetBIOS 1.12 +overview 1.9 +interface registration CCB D.2.1.2 +interrupt arbitrator +description D.2 +interface registration CCB D.2.1.2 +language request CCB D.2.1.1 +NCB handler registration (using IEEE 802.2) D.2.1.3 +registration process D.2.1 +L +LAN Adapter and Protocol Support +See OS/2 LAN Adapter and Protocol Support +LAN networks, introduction to 1.4 +language request CCB D.2.1.1 +LANTRAN.LOG 6.6 +LAPS +See OS/2 LAN Adapter and Protocol Support +largest frame bits 1.13.2.4 +length bits 1.13.2.2 +link station states 2.8.3 +LLC 6.5 +LLC Type 1 protocol 2.8 +LLC Type 2 protocol 2.8 +local area network +Ethernet 1.5.4 +IBM PC Network (Baseband) 1.5.3 +IBM PC Network (Broadband) 1.5.2 +IBM Token-Ring 1.5.1 +NDIS 1.01 1.5.4 +sample program listing diskette C.0 +Local Area Network Support Program +3270 Workstation Program support D.2.1.4 +appendages 2.3.2.1 +CCB1 calling conventions 2.3.1 +CCB1 command completion 2.3.2 +CCB1 control blocks 2.3.3 +interrupt arbitrator D.2 +monitored control blocks D.2.1.4 +NetBIOS operational parameters +new 4.5.2 +old 4.5.1 +OS/2 4.5.3 +log format +adapter 3.3.11.1 +direct interface 3.3.11.1 +Copyright IBM Corp. 1986, 1996 +INDEX -5 + +--- + + +## Page 561 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Index + +M +major code 6.7 6.7.6 +MAX_USERS E.2.2 +memory 6.3.3 6.4.3 6.5 +messages 6.6 +minor code +definitions for IEEE 802.2 6.7.2 +definitions for NetBIOS 6.7.4 +for IEEE 802.2 trace 6.7 6.7.3 +for NetBIOS trace 6.7 6.7.5 +for Virtual DOS LAN Support 6.7.6.1 +multiple group addresses +DIR.SET.MULT.GROUP.ADDRESS 3.3.17 +N +NCB 6.7.4 to 6.7.6.1 +NCB.RESERVE 6.4.6 6.5 +NCB.RECEIVE 6.4.8 6.5 +NCB.RECEIVE.ANY 6.4.8 6.5 +NCB.STATUS 6.4.6 6.5 +return of adapter type by 4.6.22 +NDIS F.0 +NDIS and non-NDIS adapters 1.2.1 +NDIS MAC drivers 1.2 +NETBIND F.0 +NetBIOS 6.1 +3.0 (OS/2 EE) 4.5.3 +calling conventions +using DD interface 4.5.8 +using DLR interface 4.5.7 +using LAN Support Program 4.5.6 +commands A.2 +See also NetBIOS commands +completion +with no-wait type command 4.5.10 +with wait type command 4.5.9 +DLC timers 4.5.5 +frame formats 5.6 to 5.6.22 +frame functions +data transfer 5.5.4.1 +miscellaneous 5.5.4.1 +name management 5.5.4.1 +session establishment and termination 5.5.4.1 +frame header +DLC I-format LPDU 5.5.3.2 +DLC UI frame 5.5.3.1 +fields 5.5.3.3 +format 5.5.2 +frame summary 5.5.4 +frames by transmission type 5.5.4.2 +network control block (NCB) +description 4.4 +field explanations 4.4.1 +operational parameters +new LAN Support Program 4.5.2 +old LAN Support Program 4.5.1 +OS/2 EE trace facility E.6 +overview 4.2 +protocol examples +See NetBIOS protocol examples with RND +Remote Name Directory (RND) 5.5 +NetBIOS 4.0 4.5.4 +NetBIOS API 6.4 +NetBIOS commands +NCB.ADD.GROUP.NAME 4.6.1 +NCB.ADD.NAME 4.6.2 +NCB.CALL 4.6.3 +NCB.CANCEL 4.6.4 +NCB.CHAIN.SEND 4.6.5 +NCB.CHAIN.SEND.NO.ACK 4.6.6 +NCB.DELETE.NAME 4.6.7 +NCB.FIND.NAME 4.6.8 +NCB.HANG.UP 4.6.9 +NCB.LAN.STATUS.ALERT 4.6.10 +NCB.LISTEN 4.6.11 +NCB.RECEIVE 4.6.12 +NCB.RECEIVE.ANY 4.6.13 +NCB.RECEIVE.BROADCAST.DATAGRAM 4.6.14 +NCB.RECEIVE.DATAGRAM 4.6.15 +NCB.RESET 4.6.16 +NCB.SEND 4.6.17 +NCB.SEND.BROADCAST.DATAGRAM 4.6.18 +NCB.SEND.DATAGRAM 4.6.19 +NCB.SEND.NO.ACK 4.6.20 +NCB.SESSION.STATUS 4.6.21 + +Copyright IBM Corp. 1986, 1996 +INDEX -6 + +--- + + +## Page 562 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Index + +NCB.STATUS 4.6.22 +NCB.TRACE 4.6.23 +NCB.UNLINK 4.6.24 +NetBIOS enhancements +returning additional adapter types 4.6.22 +NetBIOS protocol examples +SEND.NO.ACK +data transfer 5.7.9 +session establishment 5.7.8.1 +with RND +remote adapter status 5.7.5.1 +session establishment 5.7.6 +without RND +name management 5.7.1 +remote adapter status 5.7.2 +session data transfer 5.7.4 +session establishment 5.7.3 +network +adapter parameter values, selecting 2.8.5 +IBM Token-Ring +See Token-Ring Network +status +CCB1 B.10.1 +CCB2 B.10.2 +CCB3 B.10.3 +Token-Ring B.10.4 +network adapter 6.1 +network adapter driver 6.1 F.0 +Network Status +0x46 EXCEPTION EVENT 6.7.2 +minor code for NetBIOS Trace 6.7.4 +OS2TRACEMASK PARAMETER 6.7.5 +TRACE Parameter 6.7.3 +NETWORK_FLAGS E.2.2 +networks, introduction to 1.4 +NODE_ADDRESS E.2.1 +notification flags 2.4.1.5 +NUMBER_RCV_BUFFERS E.2.1 +O +O/S 2 Communications Manager +device driver (DD) interface 1.7.1 +dynamic link routine (DLR) interface 1.7.1 +interface comparison 1.7.2 +Open Adapter 6.4.7 6.5 +open error, adapter +PC networks and Ethernet B.13 +Token-ring network B.12 +OPEN_OPTIONS E.2.1 +OS/2 EE +CONFIG.SYS commands +adapter parameters E.2.1 +DLC parameters E.2.2 +NetBIOS parameters E.3 +NetBIOS trace facility E.6 +trace code format +X'00' - '07 E.5.2.1 +X'08 E.5.2.2 +X'09 E.5.2.3 +X'0A E.5.2.4 +X'0B' - '0C E.5.2.5 +X'0D E.5.2.6 +trace entry definition E.5.1 +trace facility E.4 +OS/2 EE programming conventions +DD interface +calling conventions 2.4.2.3 +CCB2 control blocks 2.4.2.5 +command completion 2.4.2.4 +user's data segment guidelines 2.4.2.2 +user's data segment restrictions 2.4.2.1 +DLR interface +calling conventions 2.4.1.4 +CCB2 control blocks 2.4.1.6 +command completion 2.4.1.5 +execute multiple commands 2.4.1.1 +user's data segment guidelines 2.4.1.3 +user's data segment restrictions 2.4.1.2 +OS/2 LAN Adapter and Protocol Support 6.0 +OS2TRACEMASK 6.7 6.7.5 +P +parallel bridges 1.13.3.2 +parameters +TRACENAMES for LANDD.OS2 and NETBEUI.OS2 6.7.1.2 +TRACEOFF for LANDD.OS2 and NETBEUI.OS2 6.7.1.1 + +
Copyright IBM Corp. 1986, 1996
+<page_number>INDEX - 7</page_number> + +--- + + +## Page 563 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Index + +PC Network, IBM +adapter check reason codes B.9 +frames 1.14 +status B.10.5 +trace table formats 3.3.35.2 +PDT.TRACE.OFF 3.3.34 +PDT.TRACE.ON 3.3.35 +piggyback acknowledgment 6.4.8 6.5 +posting events +DD interface 2.4.2.4 +DLC status change 3.3.37.1 +DLR interface 2.4.1.5 +PRODUCT_ID E.2.1 +programming conventions +DOS 2.3 +OS/2 EE 2.4 +protocol 6.1 +protocol driver 6.1 F.0 +protocol drivers 1.2 +protocol examples, NetBIOS +SEND.NO.ACK +data transfer 5.7.9 +session establishment 5.7.8.1 +with RND +remote adapter status 5.7.5.1 +session establishment 5.7.6 +without RND +name management 5.7.1 +remote adapter status 5.7.2 +session data transfer 5.7.4 +session establishment 5.7.3 +protocol manager F.0 +PROTOCOL.INI +configuration and binding information 6.1 +keyword separators 6.5 +OS2TRACEMASK parameter 6.7 6.7.5 +relationship to protocol manager and NETBIND F.0 +TRACE parameter 6.7 6.7.3 +publications, related PREFACE.2 +PURGE.RESOURCES 3.3.36 +Q +QSIZE E.2.2 +R +RCV_BUFFER_LENGTH E.2.1 +READ 3.3.37 +READ.CANCEL 3.3.38 +reason codes, adapter check +IBM Token-Ring network B.8 +PC network and Ethernet B.9 +RECEIVE 3.3.39 +RECEIVE.CANCEL 3.3.40 +RECEIVE.MODIFY 3.3.41 +related publications PREFACE.2 +Remote Name Directory (RND) 5.5 +return codes +DLC and direct interface B.2 +DLC and direct interface by command +CCB1 B.2.1.1 +CCB2 B.2.1.2 +CCB3 B.2.1.3 +DLC and direct interface cause and action B.2.2 +NCB (NetBIOS) B.4 +NetBIOS by command B.4.1 +NetBIOS cause and action B.4.2 +ring number portion 1.13.3 +Ring Status 6.4.7 6.5 +route designator field 1.13.3 +individual bridge portion 1.13.3 +ring number portion 1.13.3 +routing control field 1.13.2 +broadcast indicators 1.13.2.1 +direction bit 1.13.2.3 +largest frame bits 1.13.2.4 +length bits 1.13.2.2 +routing field for bridges 1.13.1 +routing information field 1.13.1 +route designator field 1.13.3 +routing control field 1.13.2 +S +sample LAN program listing diskette C.0 +SAP assignments +global 2.7.2 +null 2.7.2 +software, IBM support + +
Copyright IBM Corp. 1986, 1996
+
INDEX - 8
+ +--- + + +## Page 564 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Index + +Local Area Network Support Program 2.3 +O/S 2 Communications Manager 1.7 2.4 +overview 1.6 +source routing +direction bit 1.13.2.3 +length bits 1.13.2.2 +route designator fields 1.13.3 +routing control field 1.13.2 +SRAM_ADDRESS E.2.1 +station ID 2.7.1 +status, network +CCB1 B.10.1 +CCB2 B.10.2 +CCB3 B.10.3 +PC and Ethernet B.10.5 +Token-Ring network B.10.4 +system action exceptions (OS/2 EE) +CCB2 B.15.1 +CCB3 B.15.2 +system trace 6.7 +SYSTEM_KEY E.2.2 +T +timers, DLC 2.8.4 4.5.5 +Token-Ring Network Adapter +Token-Ring Network, IBM +adapter check reason codes B.8 +adapter communication +data transmission +frame 1.13 +routing field 1.13.1 +status codes B.10.4 +trace table formats 3.3.35.1 +TRACE 6.7 6.7.3 +trace facility (OS/2 EE) +codes +X'00' - '07 E.5.2.1 +X'08 E.5.2.2 +X'09 E.5.2.3 +X'0A E.5.2.4 +X'0B' - '0C E.5.2.5 +X'0D E.5.2.6 +entry format E.5.1 +NetBIOS E.6 +overview E.4 +trace table formats +PC network 3.3.35.2 +Token-Ring network 3.3.35.1 +TRACENAMES parameter 6.7.1.2 +TRACEOFF parameter 6.7.1.1 +transmit buffers 6.5 +TRANSMIT.DIR.FRAME 3.3.42 +TRANSMIT.I.FRAME 3.3.43 +TRANSMIT.TEST.CMD 3.3.44 +TRANSMIT.UI.FRAME 3.3.45 +TRANSMIT.XID.CMD 3.3.46 +TRANSMIT.XID.RESP.FINAL 3.3.47 +TRANSMIT.XID.RESP.NOT.FINAL 3.3.48 +U +UI-frame 6.7.4 +user notification flags 2.4.1.5 +V +Virtual LAN Support 6.1 + +
Copyright IBM Corp. 1986, 1996 +INDEX - 9
+ +--- + + +## Page 565 + +LAN Technical Reference: 802.2 and NetBIOS APIs +Tell Us What You Think! +COMMENTS Tell Us What You Think! +LAN Technical Reference IEEE 802.2 and NetBIOS Application Program Interfaces +Publication No. SC30-3587-01 + +We hope you find this publication useful, readable, and technically accurate, but only you can tell us! Your comments and suggestions will help us improve our technical publications. Please take a few minutes to let us know what you think by completing this form. If you are in the U.S.A., you can mail this form postage free or fax it to us at 1-800-253-3520. Elsewhere, your local IBM branch office or representative will forward your comments or you may mail them directly to us. + + + + + + + + + + + + +
Overall, how satisfied are you with the information in this book?SatisfiedDissatisfied
____
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
How satisfied are you that the information in this book is:SatisfiedDissatisfied
Accurate____
Complete____
Easy to find____
Easy to understand____
Well organized____
Applicable to your task____
+ +Specific comments or problems: +____________ +____________ +____________ + +Please tell us how we can improve this book: +____________ +____________ +____________ + +Thank you for your comments. If you would like a reply, provide the necessary information below. + +Please complete this form and mail it to: + +International Business Machines Corporation +Information Development +Dept. CGF/Bldg. 656 +PO BOX 12195 +RESEARCH TRIANGLE PARK NC 27709-9990 + +or give it to your IBM representative. + +Name ____________ +Company or Organization ____________ +Address ____________ +Phone No. ____________ + +
Copyright IBM Corp. 1986, 1996 +COMMENTS - 1
\ No newline at end of file diff --git a/spec/iee802.pdf b/spec/iee802.pdf new file mode 100644 index 0000000..b2bffed Binary files /dev/null and b/spec/iee802.pdf differ diff --git a/spec/ms-brws.md b/spec/ms-brws.md new file mode 100644 index 0000000..fc3a748 --- /dev/null +++ b/spec/ms-brws.md @@ -0,0 +1,2574 @@ +**\[MS-BRWS\]:** + +**Common Internet File System (CIFS) Browser Protocol** + +Intellectual Property Rights Notice for Open Specifications Documentation + +- **Technical Documentation.** Microsoft publishes Open Specifications documentation ("this documentation") for protocols, file formats, data portability, computer languages, and standards support. Additionally, overview documents cover inter-protocol relationships and interactions. +- **Copyrights**. This documentation is covered by Microsoft copyrights. Regardless of any other terms that are contained in the terms of use for the Microsoft website that hosts this documentation, you can make copies of it in order to develop implementations of the technologies that are described in this documentation and can distribute portions of it in your implementations that use these technologies or in your documentation as necessary to properly document the implementation. You can also distribute in your implementation, with or without modification, any schemas, IDLs, or code samples that are included in the documentation. This permission also applies to any documents that are referenced in the Open Specifications documentation. +- **No Trade Secrets**. Microsoft does not claim any trade secret rights in this documentation. +- **Patents**. Microsoft has patents that might cover your implementations of the technologies described in the Open Specifications documentation. Neither this notice nor Microsoft's delivery of this documentation grants any licenses under those patents or any other Microsoft patents. However, a given Open Specifications document might be covered by the Microsoft [Open Specifications Promise](https://go.microsoft.com/fwlink/?LinkId=214445) or the [Microsoft Community Promise](https://go.microsoft.com/fwlink/?LinkId=214448). If you would prefer a written license, or if the technologies described in this documentation are not covered by the Open Specifications Promise or Community Promise, as applicable, patent licenses are available by contacting [iplg@microsoft.com](mailto:iplg@microsoft.com). +- **License Programs**. To see all of the protocols in scope under a specific license program and the associated patents, visit the [Patent Map](https://aka.ms/AA9ufj8). +- **Trademarks**. The names of companies and products contained in this documentation might be covered by trademarks or similar intellectual property rights. This notice does not grant any licenses under those rights. For a list of Microsoft trademarks, visit [www.microsoft.com/trademarks](https://www.microsoft.com/trademarks). +- **Fictitious Names**. The example companies, organizations, products, domain names, email addresses, logos, people, places, and events that are depicted in this documentation are fictitious. No association with any real company, organization, product, domain name, email address, logo, person, place, or event is intended or should be inferred. + +**Reservation of Rights**. All other rights are reserved, and this notice does not grant any rights other than as specifically described above, whether by implication, estoppel, or otherwise. + +**Tools**. The Open Specifications documentation does not require the use of Microsoft programming tools or programming environments in order for you to develop an implementation. If you have access to Microsoft programming tools and environments, you are free to take advantage of them. Certain Open Specifications documents are intended for use in conjunction with publicly available standards specifications and network programming art and, as such, assume that the reader either is familiar with the aforementioned material or has immediate access to it. + +**Support.** For questions and support, please contact [dochelp@microsoft.com](mailto:dochelp@microsoft.com). + +**Revision Summary** + +| Date | Revision History | Revision Class | Comments | +| ---------- | ---------------- | -------------- | ---------------------------------------------------------------------------- | +| 4/3/2007 | 1.0 | New | Version 1.0 release | +| 7/3/2007 | 2.0 | Major | MLonghorn+90 | +| 7/20/2007 | 2.0.1 | Editorial | Changed language and formatting in the technical content. | +| 8/10/2007 | 3.0 | Major | Updated and revised the technical content. | +| 9/28/2007 | 4.0 | Major | Updated and revised the technical content. | +| 10/23/2007 | 4.0.1 | Editorial | Changed language and formatting in the technical content. | +| 11/30/2007 | 4.1 | Minor | Revised links. | +| 1/25/2008 | 4.1.1 | Editorial | Changed language and formatting in the technical content. | +| 3/14/2008 | 4.2 | Minor | Clarified the meaning of the technical content. | +| 5/16/2008 | 5.0 | Major | Updated and revised the technical content. | +| 6/20/2008 | 6.0 | Major | Updated and revised the technical content. | +| 7/25/2008 | 6.1 | Minor | Clarified the meaning of the technical content. | +| 8/29/2008 | 6.2 | Minor | Clarified the meaning of the technical content. | +| 10/24/2008 | 7.0 | Major | Updated and revised the technical content. | +| 12/5/2008 | 8.0 | Major | Updated and revised the technical content. | +| 1/16/2009 | 9.0 | Major | Updated and revised the technical content. | +| 2/27/2009 | 10.0 | Major | Updated and revised the technical content. | +| 4/10/2009 | 11.0 | Major | Updated and revised the technical content. | +| 5/22/2009 | 11.1 | Minor | Clarified the meaning of the technical content. | +| 7/2/2009 | 11.1.1 | Editorial | Changed language and formatting in the technical content. | +| 8/14/2009 | 11.2 | Minor | Clarified the meaning of the technical content. | +| 9/25/2009 | 12.0 | Major | Updated and revised the technical content. | +| 11/6/2009 | 13.0 | Major | Updated and revised the technical content. | +| 12/18/2009 | 14.0 | Major | Updated and revised the technical content. | +| 1/29/2010 | 15.0 | Major | Updated and revised the technical content. | +| 3/12/2010 | 15.1 | Minor | Clarified the meaning of the technical content. | +| 4/23/2010 | 15.2 | Minor | Clarified the meaning of the technical content. | +| 6/4/2010 | 15.2.1 | Editorial | Changed language and formatting in the technical content. | +| 7/16/2010 | 15.2.1 | None | No changes to the meaning, language, or formatting of the technical content. | +| 8/27/2010 | 15.2.1 | None | No changes to the meaning, language, or formatting of the technical content. | +| 10/8/2010 | 16.0 | Major | Updated and revised the technical content. | +| 11/19/2010 | 17.0 | Major | Updated and revised the technical content. | +| 1/7/2011 | 17.0 | None | No changes to the meaning, language, or formatting of the technical content. | +| 2/11/2011 | 17.0 | None | No changes to the meaning, language, or formatting of the technical content. | +| 3/25/2011 | 17.0 | None | No changes to the meaning, language, or formatting of the technical content. | +| 5/6/2011 | 17.0 | None | No changes to the meaning, language, or formatting of the technical content. | +| 6/17/2011 | 17.1 | Minor | Clarified the meaning of the technical content. | +| 9/23/2011 | 17.1 | None | No changes to the meaning, language, or formatting of the technical content. | +| 12/16/2011 | 18.0 | Major | Updated and revised the technical content. | +| 3/30/2012 | 18.0 | None | No changes to the meaning, language, or formatting of the technical content. | +| 7/12/2012 | 19.0 | Major | Updated and revised the technical content. | +| 10/25/2012 | 20.0 | Major | Updated and revised the technical content. | +| 1/31/2013 | 20.0 | None | No changes to the meaning, language, or formatting of the technical content. | +| 8/8/2013 | 21.0 | Major | Updated and revised the technical content. | +| 11/14/2013 | 21.0 | None | No changes to the meaning, language, or formatting of the technical content. | +| 2/13/2014 | 21.0 | None | No changes to the meaning, language, or formatting of the technical content. | +| 5/15/2014 | 21.0 | None | No changes to the meaning, language, or formatting of the technical content. | +| 6/30/2015 | 22.0 | Major | Significantly changed the technical content. | +| 10/16/2015 | 22.0 | None | No changes to the meaning, language, or formatting of the technical content. | +| 7/14/2016 | 22.0 | None | No changes to the meaning, language, or formatting of the technical content. | +| 6/1/2017 | 22.0 | None | No changes to the meaning, language, or formatting of the technical content. | +| 9/15/2017 | 23.0 | Major | Significantly changed the technical content. | +| 9/12/2018 | 24.0 | Major | Significantly changed the technical content. | +| 4/7/2021 | 25.0 | Major | Significantly changed the technical content. | +| 6/25/2021 | 26.0 | Major | Significantly changed the technical content. | +| 4/23/2024 | 27.0 | Major | Significantly changed the technical content. | +| 9/16/2024 | 27.0 | None | No changes to the meaning, language, or formatting of the technical content. | + +Table of Contents + +[1 Introduction 7](#_Toc178221149) + +[1.1 Glossary 7](#_Toc178221150) + +[1.2 References 9](#_Toc178221151) + +[1.2.1 Normative References 9](#_Toc178221152) + +[1.2.2 Informative References 10](#_Toc178221153) + +[1.3 Overview 10](#_Toc178221154) + +[1.4 Relationship to Other Protocols 11](#_Toc178221155) + +[1.5 Prerequisites/Preconditions 13](#_Toc178221156) + +[1.6 Applicability Statement 14](#_Toc178221157) + +[1.7 Versioning and Capability Negotiation 14](#_Toc178221158) + +[1.8 Vendor-Extensible Fields 14](#_Toc178221159) + +[1.9 Standards Assignments 14](#_Toc178221160) + +[2 Messages 16](#_Toc178221161) + +[2.1 Transport 16](#_Toc178221162) + +[2.1.1 NetBIOS Name Notation 16](#_Toc178221163) + +[2.1.1.1 NetBIOS Suffix Definitions 17](#_Toc178221164) + +[2.1.1.2 Unique Names 17](#_Toc178221165) + +[2.1.1.3 Group Names 18](#_Toc178221166) + +[2.2 Message Syntax 18](#_Toc178221167) + +[2.2.1 HostAnnouncement Browser Frame 20](#_Toc178221168) + +[2.2.2 AnnouncementRequest Browser Frame 21](#_Toc178221169) + +[2.2.3 RequestElection Browser Frame 22](#_Toc178221170) + +[2.2.4 GetBackupListRequest Browser Frame 23](#_Toc178221171) + +[2.2.5 GetBackupListResponse Browser Frame 24](#_Toc178221172) + +[2.2.6 BecomeBackup Browser Frame 24](#_Toc178221173) + +[2.2.7 DomainAnnouncement Browser Frame 25](#_Toc178221174) + +[2.2.8 MasterAnnouncement Browser Frame 26](#_Toc178221175) + +[2.2.9 ResetStateRequest Browser Frame 26](#_Toc178221176) + +[2.2.10 LocalMasterAnnouncement Browser Frame 27](#_Toc178221177) + +[3 Protocol Details 29](#_Toc178221178) + +[3.1 Client Details 29](#_Toc178221179) + +[3.1.1 Abstract Data Model 29](#_Toc178221180) + +[3.1.2 Timers 29](#_Toc178221181) + +[3.1.3 Initialization 29](#_Toc178221182) + +[3.1.4 Higher-Layer Triggered Events 30](#_Toc178221183) + +[3.1.4.1 Application Requests the Enumeration of Servers in a Machine Group 30](#_Toc178221184) + +[3.1.5 Message Processing Events and Sequencing Rules 30](#_Toc178221185) + +[3.1.5.1 Retrieving a List of Backup Browser Servers 30](#_Toc178221186) + +[3.1.5.1.1 Sending a GetBackupListRequest Frame 31](#_Toc178221187) + +[3.1.5.1.2 Receiving a GetBackupListResponse Frame 31](#_Toc178221188) + +[3.1.5.2 Receiving a NetServerEnum2 Response 31](#_Toc178221189) + +[3.1.5.3 Sending a RequestElection Frame 31](#_Toc178221190) + +[3.1.6 Timer Events 32](#_Toc178221191) + +[3.1.7 Other Local Events 32](#_Toc178221192) + +[3.2 Nonbrowser Server Details 32](#_Toc178221193) + +[3.2.1 Abstract Data Model 32](#_Toc178221194) + +[3.2.2 Timers 32](#_Toc178221195) + +[3.2.3 Initialization 33](#_Toc178221196) + +[3.2.4 Higher-Layer Triggered Events 33](#_Toc178221197) + +[3.2.4.1 Server Application Requests Updating Server Configuration 33](#_Toc178221198) + +[3.2.5 Message Processing Events and Sequencing Rules 33](#_Toc178221199) + +[3.2.5.1 Receiving an AnnouncementRequest Frame 33](#_Toc178221200) + +[3.2.5.2 Sending a HostAnnouncement Frame 33](#_Toc178221201) + +[3.2.6 Timer Events 34](#_Toc178221202) + +[3.2.7 Other Local Events 34](#_Toc178221203) + +[3.3 Browser Server Details 34](#_Toc178221204) + +[3.3.1 Abstract Data Model 36](#_Toc178221205) + +[3.3.2 Timers 37](#_Toc178221206) + +[3.3.3 Initialization 38](#_Toc178221207) + +[3.3.4 Higher-Layer Triggered Events 39](#_Toc178221208) + +[3.3.4.1 PromotedToPrimaryDomainController 39](#_Toc178221209) + +[3.3.4.2 LocalRequestForServerList 39](#_Toc178221210) + +[3.3.4.3 ShutdownBrowserServer 39](#_Toc178221211) + +[3.3.5 Message Processing Events and Sequencing Rules 40](#_Toc178221212) + +[3.3.5.1 Receiving a BecomeBackup Frame 40](#_Toc178221213) + +[3.3.5.2 Receiving a LocalMasterAnnouncement Frame 41](#_Toc178221214) + +[3.3.5.3 Receiving a HostAnnouncement Frame 41](#_Toc178221215) + +[3.3.5.4 Receiving a DomainAnnouncement Frame 42](#_Toc178221216) + +[3.3.5.5 Receiving a GetBackupListRequest Frame 43](#_Toc178221217) + +[3.3.5.6 Receiving a NetServerEnum2 or NetServerEnum3 Request 43](#_Toc178221218) + +[3.3.5.7 Sending BecomeBackup Frames 44](#_Toc178221219) + +[3.3.5.8 Receiving a RequestElection Frame 44](#_Toc178221220) + +[3.3.5.9 Sending a GetBackupListResponse Frame 46](#_Toc178221221) + +[3.3.5.10 Sending ResetState Frames 46](#_Toc178221222) + +[3.3.5.11 Sending a RequestElection Frame 47](#_Toc178221223) + +[3.3.6 Timer Events 47](#_Toc178221224) + +[3.3.7 Other Local Events 51](#_Toc178221225) + +[3.4 Domain Master Browser Details 51](#_Toc178221226) + +[3.4.1 Abstract Data Model 51](#_Toc178221227) + +[3.4.2 Timers 52](#_Toc178221228) + +[3.4.3 Initialization 52](#_Toc178221229) + +[3.4.4 Higher-Layer Triggered Events 52](#_Toc178221230) + +[3.4.4.1 DemotedToBackupDomainController 52](#_Toc178221231) + +[3.4.5 Message Processing Events and Sequencing Rule 53](#_Toc178221232) + +[3.4.5.1 Receiving a MasterAnnouncement Frame 53](#_Toc178221233) + +[3.4.6 Timer Events 53](#_Toc178221234) + +[3.4.7 Other Local Events 53](#_Toc178221235) + +[4 Protocol Examples 54](#_Toc178221236) + +[4.1 Mailslot Frame Example 54](#_Toc178221237) + +[4.2 A Browser Server Wins the First Election Round and the Election 54](#_Toc178221238) + +[4.3 A Browser Server Wins the First Round but Loses the Election 55](#_Toc178221239) + +[5 Security 57](#_Toc178221240) + +[5.1 Security Considerations for Implementers 57](#_Toc178221241) + +[5.2 Index of Security Parameters 57](#_Toc178221242) + +[6 Appendix A: Product Behavior 58](#_Toc178221243) + +[7 Change Tracking 64](#_Toc178221244) + +[8 Index 65](#_Toc178221245) + +# Introduction + +This document is a specification of the Common Internet File System (CIFS) Browser Protocol (version 1.10). + +The CIFS Browser Protocol defines the messages that are sent and received by a server that acts as a clearinghouse for services available on the network, servers that are making services such as printing or file sharing available on the network, and clients requesting the details of a particular service. + +Sections 1.5, 1.8, 1.9, 2, and 3 of this specification are normative. All other sections and examples in this specification are informative. + +## Glossary + +This document uses the following terms: + +**Active Directory**: The Windows implementation of a general-purpose directory service, which uses LDAP as its primary access protocol. Active Directory stores information about a variety of objects in the network such as user accounts, computer accounts, groups, and all related credential information used by Kerberos [\[MS-KILE\]](%5bMS-KILE%5d.pdf#Section_2a32282edd484ad9a542609804b02cc9). Active Directory is either deployed as Active Directory Domain Services (AD DS) or Active Directory Lightweight Directory Services (AD LDS), which are both described in [\[MS-ADOD\]](%5bMS-ADOD%5d.pdf#Section_5ff67bf4c14548cb89cd4f5482d94664): Active Directory Protocols Overview. + +**ASCII**: The American Standard Code for Information Interchange (ASCII) is an 8-bit character-encoding scheme based on the English alphabet. ASCII codes represent text in computers, communications equipment, and other devices that work with text. ASCII refers to a single 8-bit ASCII character or an array of 8-bit ASCII characters with the high bit of each character set to zero. + +**backup browser server**: A [**browser server**](#gt_3bd1e44e-100e-4f13-ad44-fc267e627495) that was selected by the [**local master browser server**](#gt_d294211f-7ae9-4faf-8644-f71c1fade2ca) on that subnet to be available to share the processing load that is required to serve [**browser clients**](#gt_8cb9694c-b014-426d-8463-66456517b15c). [**Backup browser servers**](#gt_71f76461-689e-4b50-befc-67f52ec4668b) keep copies of the information that is maintained by the [**local master browser server**](#gt_d294211f-7ae9-4faf-8644-f71c1fade2ca) by periodically querying that server. + +**backup domain controller (BDC)**: A [**domain controller (DC)**](#gt_76a05049-3531-4abd-aec8-30e19954b4bd) that receives a copy of the [**domain**](#gt_b0276eb2-4e65-4cf1-a718-e0920a614aca) directory database from the [**primary domain controller (PDC)**](#gt_663cb13a-8b75-477f-b6e1-bea8f2fba64d). This copy is synchronized periodically and automatically with the [**primary domain controller (PDC)**](#gt_663cb13a-8b75-477f-b6e1-bea8f2fba64d). BDCs also authenticate user logons and can be promoted to function as the [**PDC**](#gt_663cb13a-8b75-477f-b6e1-bea8f2fba64d). There is only one [**PDC**](#gt_663cb13a-8b75-477f-b6e1-bea8f2fba64d) or [**PDC**](#gt_663cb13a-8b75-477f-b6e1-bea8f2fba64d) emulator in a [**domain**](#gt_b0276eb2-4e65-4cf1-a718-e0920a614aca), and the rest are [**backup domain controllers**](#gt_ce1138c6-7ab4-4c37-98b4-95599071c3c3). + +**browser**: See [**browser server**](#gt_3bd1e44e-100e-4f13-ad44-fc267e627495). + +**browser client**: A computer on the network that queries or sends information to a [**browser server**](#gt_3bd1e44e-100e-4f13-ad44-fc267e627495). There are three types of [**browser clients**](#gt_8cb9694c-b014-426d-8463-66456517b15c): workstations, nonbrowser servers, and [**browser servers**](#gt_3bd1e44e-100e-4f13-ad44-fc267e627495). In the context of browsing, nonbrowser servers supply information about themselves to [**browser servers**](#gt_3bd1e44e-100e-4f13-ad44-fc267e627495), and workstations query [**browser servers**](#gt_3bd1e44e-100e-4f13-ad44-fc267e627495) for information. [**Browser servers**](#gt_3bd1e44e-100e-4f13-ad44-fc267e627495) can behave as nonbrowser servers and as workstations. + +**browser server**: An entity that maintains or could be elected to maintain information about other servers and [**domains**](#gt_b0276eb2-4e65-4cf1-a718-e0920a614aca). + +**domain**: A set of users and computers sharing a common namespace and management infrastructure. At least one computer member of the set has to act as a [**domain controller (DC)**](#gt_76a05049-3531-4abd-aec8-30e19954b4bd) and host a member list that identifies all members of the domain, as well as optionally hosting the [**Active Directory**](#gt_e467d927-17bf-49c9-98d1-96ddf61ddd90) service. The domain controller provides authentication of members, creating a unit of trust for its members. Each domain has an identifier that is shared among its members. For more information, see [\[MS-AUTHSOD\]](%5bMS-AUTHSOD%5d.pdf#Section_953d700a57cb4cf7b0c3a64f34581cc9) section 1.1.1.5 and [\[MS-ADTS\]](%5bMS-ADTS%5d.pdf#Section_d243592709994c628c6d13ba31a52e1a). + +**domain controller (DC)**: The service, running on a server, that implements [**Active Directory**](#gt_e467d927-17bf-49c9-98d1-96ddf61ddd90), or the server hosting this service. The service hosts the data store for objects and interoperates with other [**DCs**](#gt_76a05049-3531-4abd-aec8-30e19954b4bd) to ensure that a local change to an object replicates correctly across all [**DCs**](#gt_76a05049-3531-4abd-aec8-30e19954b4bd). When [**Active Directory**](#gt_e467d927-17bf-49c9-98d1-96ddf61ddd90) is operating as Active Directory Domain Services (AD DS), the [**DC**](#gt_76a05049-3531-4abd-aec8-30e19954b4bd) contains full NC replicas of the configuration naming context (config NC), schema naming context (schema NC), and one of the domain NCs in its forest. If the AD DS [**DC**](#gt_76a05049-3531-4abd-aec8-30e19954b4bd) is a global catalog server (GC server), it contains partial NC replicas of the remaining domain NCs in its forest. For more information, see \[MS-AUTHSOD\] section 1.1.1.5.2 and \[MS-ADTS\]. When [**Active Directory**](#gt_e467d927-17bf-49c9-98d1-96ddf61ddd90) is operating as Active Directory Lightweight Directory Services (AD LDS), several AD LDS [**DCs**](#gt_76a05049-3531-4abd-aec8-30e19954b4bd) can run on one server. When [**Active Directory**](#gt_e467d927-17bf-49c9-98d1-96ddf61ddd90) is operating as AD DS, only one AD DS [**DC**](#gt_76a05049-3531-4abd-aec8-30e19954b4bd) can run on one server. However, several AD LDS [**DCs**](#gt_76a05049-3531-4abd-aec8-30e19954b4bd) can coexist with one AD DS [**DC**](#gt_76a05049-3531-4abd-aec8-30e19954b4bd) on one server. The AD LDS [**DC**](#gt_76a05049-3531-4abd-aec8-30e19954b4bd) contains full NC replicas of the config NC and the schema NC in its forest. The domain controller is the server side of Authentication Protocol Domain Support [\[MS-APDS\]](%5bMS-APDS%5d.pdf#Section_dd444344fd7e430eb3137e95ab9c338e). + +**domain master browser**: A server responsible for combining information for an entire domain, across all subnets. + +**domain master browser server**: A [**master browser server**](#gt_542ffc1e-9bbc-47f9-a6ca-284d0a39c680) that is responsible for combining information for an entire domain, across all subnets. A [**domain master browser server**](#gt_ef026994-26e6-4c9d-b34b-dfb7f1f80d6f) is responsible for keeping multiple subnets in synchronization by periodically querying [**local master browser servers**](#gt_d294211f-7ae9-4faf-8644-f71c1fade2ca) for information concerning user accounts, security, and available resources such as printers. + +**election criteria**: The collective information in a [**browser**](#gt_f06aa0c1-29ec-4d3e-a4e2-e38e8f918933) RequestElection packet that is used to determine the winner of an election. + +**frame**: A CIFS Browser Protocol message. + +**group name**: A 16-byte, formatted NetBIOS computer name, which can have multiple IP addresses assigned to it; that is, multiple NetBIOS nodes (processor locations) can use this name to register for services, as specified in [\[RFC1001\]](https://go.microsoft.com/fwlink/?LinkId=90260) and [\[RFC1002\]](https://go.microsoft.com/fwlink/?LinkId=90261). + +**little-endian**: Multiple-byte values that are byte-ordered with the least significant byte stored in the memory location with the lowest address. + +**local master browser**: The browser on a given subnet that was elected to maintain the master copy of information related to a given domain. That is, different domains have different local master browsers on the same subnet. + +**local master browser server**: A server that is elected [**master browser server**](#gt_542ffc1e-9bbc-47f9-a6ca-284d0a39c680) on a particular subnet across a domain. + +**machine group**: A generic reference to a [**domain**](#gt_b0276eb2-4e65-4cf1-a718-e0920a614aca) or a workgroup, of which a specified machine is a member. A computer implementing the CIFS Browser Protocol has to be a member of either a workgroup or a domain. + +**mailslot**: A mechanism for one-way interprocess communications (IPC). For more information, see [\[MSLOT\]](https://go.microsoft.com/fwlink/?LinkId=90218) and [\[MS-MAIL\]](%5bMS-MAIL%5d.pdf#Section_8ea19aa46e5a4aedb6280b5cd75a1ab9). + +**master browser server**: A server that is responsible for maintaining a master list of available resources on a subnet and for making the list available to [**backup browser servers**](#gt_71f76461-689e-4b50-befc-67f52ec4668b). Each subnet requires a [**master browser server**](#gt_542ffc1e-9bbc-47f9-a6ca-284d0a39c680). The [**master browser server**](#gt_542ffc1e-9bbc-47f9-a6ca-284d0a39c680) for a particular domain is called the [**domain master browser server**](#gt_ef026994-26e6-4c9d-b34b-dfb7f1f80d6f). + +**NetBIOS name**: A 16-byte address that is used to identify a NetBIOS resource on the network. For more information, see \[RFC1001\] and \[RFC1002\]. + +**NetBIOS suffix**: The 16th byte of a 16-byte [**NetBIOS name**](#gt_0334e0bd-2755-42f6-aeff-2d4a22bf4abf) that is constructed using the optional naming convention defined in [\[MS-NBTE\]](%5bMS-NBTE%5d.pdf#Section_3461cfa83d284fa38163131bf1046fa3) section 1.8. + +**nonbrowser server**: A server that wants to be enumerated to clients of the CIFS Browser Protocol that does not otherwise implement elements of the CIFS Browser Protocol. + +**potential browser server**: A [**browser server**](#gt_3bd1e44e-100e-4f13-ad44-fc267e627495) that is capable of being a [**backup browser server**](#gt_71f76461-689e-4b50-befc-67f52ec4668b) or a [**master browser server**](#gt_542ffc1e-9bbc-47f9-a6ca-284d0a39c680) but is not currently fulfilling either role. + +**preferred master browser server**: A machine that functions as a typical [**backup browser server**](#gt_71f76461-689e-4b50-befc-67f52ec4668b) except that it forces a [**browser**](#gt_f06aa0c1-29ec-4d3e-a4e2-e38e8f918933) election when it is started. Preferred master browser servers are given an advantage in elections. By configuring one or more machines as preferred master browser servers, a network administrator can actually choose particular machines for this role. + +**primary domain controller (PDC)**: A [**domain controller (DC)**](#gt_76a05049-3531-4abd-aec8-30e19954b4bd) designated to track changes made to the accounts of all computers on a [**domain**](#gt_b0276eb2-4e65-4cf1-a718-e0920a614aca). It is the only computer to receive these changes directly, and is specialized so as to ensure consistency and to eliminate the potential for conflicting entries in the [**Active Directory**](#gt_e467d927-17bf-49c9-98d1-96ddf61ddd90) database. A [**domain**](#gt_b0276eb2-4e65-4cf1-a718-e0920a614aca) has only one [**PDC**](#gt_663cb13a-8b75-477f-b6e1-bea8f2fba64d). + +**subnet**: A logical division of a network. Subnets provide a multilevel hierarchical routing structure for the Internet. On TCP/IP networks, subnets are defined as all devices whose IP addresses have the same prefix. Subnets are useful for both security and performance reasons. In general, broadcast messages are scoped to within a single subnet. For more information about subnets, see [\[RFC1812\]](https://go.microsoft.com/fwlink/?LinkId=90293). + +**unique name**: A 16-byte, formatted NetBIOS computer name that can have only one IP address assigned to it; that is, only a single NetBIOS node (or processing location) can use this name to register for services, as specified in \[RFC1001\] and \[RFC1002\]. + +**Windows Internet Name Service (WINS)**: A name service for the NetBIOS protocol, particularly designed to ease transition to a TCP/IP based network. An implementation of an NBNS server. + +**workgroup**: A collection of computers that share a name. In the absence of a [**domain**](#gt_b0276eb2-4e65-4cf1-a718-e0920a614aca), a workgroup allows a convenient means for [**browser clients**](#gt_8cb9694c-b014-426d-8463-66456517b15c) to limit the scope of a search. + +**MAY, SHOULD, MUST, SHOULD NOT, MUST NOT:** These terms (in all caps) are used as defined in [\[RFC2119\]](https://go.microsoft.com/fwlink/?LinkId=90317). All statements of optional behavior use either MAY, SHOULD, or SHOULD NOT. + +## References + +Links to a document in the Microsoft Open Specifications library point to the correct section in the most recently published version of the referenced document. However, because individual documents in the library are not updated at the same time, the section numbers in the documents may not match. You can confirm the correct section numbering by checking the [Errata](https://go.microsoft.com/fwlink/?linkid=850906). + +### Normative References + +We conduct frequent surveys of the normative references to assure their continued availability. If you have any issue with finding a normative reference, please contact [dochelp@microsoft.com](mailto:dochelp@microsoft.com). We will assist you in finding the relevant information. + +\[MS-BRWSA\] Microsoft Corporation, "[Common Internet File System (CIFS) Browser Auxiliary Protocol](%5bMS-BRWSA%5d.pdf#Section_5995d2f2fff140af9100ca67794d50a5)". + +\[MS-ERREF\] Microsoft Corporation, "[Windows Error Codes](%5bMS-ERREF%5d.pdf#Section_1bc92ddfb79e413cbbaa99a5281a6c90)". + +\[MS-LSAD\] Microsoft Corporation, "[Local Security Authority (Domain Policy) Remote Protocol](%5bMS-LSAD%5d.pdf#Section_1b5471ef4c334a91b079dfcbb82f05cc)". + +\[MS-MAIL\] Microsoft Corporation, "[Remote Mailslot Protocol](%5bMS-MAIL%5d.pdf#Section_8ea19aa46e5a4aedb6280b5cd75a1ab9)". + +\[MS-NBTE\] Microsoft Corporation, "[NetBIOS over TCP (NBT) Extensions](%5bMS-NBTE%5d.pdf#Section_3461cfa83d284fa38163131bf1046fa3)". + +\[MS-RAP\] Microsoft Corporation, "[Remote Administration Protocol](%5bMS-RAP%5d.pdf#Section_fb8d5bd1e57c4be1b063ec31330bdd58)". + +\[MS-SAMR\] Microsoft Corporation, "[Security Account Manager (SAM) Remote Protocol (Client-to-Server)](%5bMS-SAMR%5d.pdf#Section_4df07fab1bbc452f8e927853a3c7e380)". + +\[MS-SMB\] Microsoft Corporation, "[Server Message Block (SMB) Protocol](%5bMS-SMB%5d.pdf#Section_f210069c70864dc2885e861d837df688)". + +\[MS-SRVS\] Microsoft Corporation, "[Server Service Remote Protocol](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9)". + +\[MS-WKST\] Microsoft Corporation, "[Workstation Service Remote Protocol](%5bMS-WKST%5d.pdf#Section_5bb08058bc364d3cabebb132228281b7)". + +\[RFC1001\] Network Working Group, "Protocol Standard for a NetBIOS Service on a TCP/UDP Transport: Concepts and Methods", RFC 1001, March 1987, [https://www.rfc-editor.org/info/rfc1001](https://go.microsoft.com/fwlink/?LinkId=90260) + +\[RFC1002\] Network Working Group, "Protocol Standard for a NetBIOS Service on a TCP/UDP Transport: Detailed Specifications", STD 19, RFC 1002, March 1987, [https://www.rfc-editor.org/info/rfc1002](https://go.microsoft.com/fwlink/?LinkId=90261) + +\[RFC2119\] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997, [https://www.rfc-editor.org/info/rfc2119](https://go.microsoft.com/fwlink/?LinkId=90317) + +### Informative References + +\[MS-ADOD\] Microsoft Corporation, "[Active Directory Protocols Overview](%5bMS-ADOD%5d.pdf#Section_5ff67bf4c14548cb89cd4f5482d94664)". + +\[MS-ADTS\] Microsoft Corporation, "[Active Directory Technical Specification](%5bMS-ADTS%5d.pdf#Section_d243592709994c628c6d13ba31a52e1a)". + +## Overview + +The Common Internet File System (CIFS) Browser Protocol makes the following possible: + +- A server (or a set of servers) to act as a clearinghouse (or [**browser server**](#gt_3bd1e44e-100e-4f13-ad44-fc267e627495)) for information about the services available in the network. +- A set of servers ([**nonbrowser servers**](#gt_a0a691b5-ba43-46d5-ab2b-acb813ebb636)) that are making services available to access the clearinghouse and advertise the services they offer. +- A set of clients ([**browser clients**](#gt_8cb9694c-b014-426d-8463-66456517b15c)) to access the information clearinghouse and seek details of a particular service. + +For example, the CIFS Browser Protocol can be used by an application to identify all file or print servers on a local subnet. The NetServerEnum2 command, as specified in [\[MS-RAP\]](%5bMS-RAP%5d.pdf#Section_fb8d5bd1e57c4be1b063ec31330bdd58) section 2.5.5.2 allows browser clients to browse services offered by the server.[<1>](#Appendix_A_1) + +The main objective of the CIFS Browser Protocol is as follows: + +- Share the processing load of enumerating the services available in the network across different servers. + +In the context of the CIFS Browser Protocol, browsing is a process for discovering servers that offer particular services. To provide those services, browser servers can assume different roles in their lifetimes and can dynamically switch between these roles. + +Clients of browser servers are of three types: + +- Workstations, which query browser servers for the information they contain. +- Nonbrowser servers, which supply browser servers with information by registering with them. +- Browser servers, which can behave as clients and query other browser servers. + +The CIFS Browser Protocol manages groups of computers. This document refers to such a group of computers as a [**machine group**](#gt_f4153c8c-848d-4db5-b9cc-4113e5f1e406). Machine groups provide a convenient means for clients to restrict the scope of a search when they query browser servers. + +A machine group can be either a [**workgroup**](#gt_9d4eb51b-4b89-4814-be9c-394156ce5e78) or a [**domain**](#gt_b0276eb2-4e65-4cf1-a718-e0920a614aca). In a workgroup configuration, browsing is limited to the scope of a single [**subnet**](#gt_c009a34c-e834-4a3e-9514-e611a6ad52fe). If computers are arranged in a Windows NT operating system security domain, the CIFS Browser Protocol allows for browsing across multiple subnets. This functionality is enabled by a special browser servers role that is known as the [**domain master browser server**](#gt_ef026994-26e6-4c9d-b34b-dfb7f1f80d6f).[<2>](#Appendix_A_2) This role is usually the responsibility of the [**primary domain controller (PDC)**](#gt_663cb13a-8b75-477f-b6e1-bea8f2fba64d), which manages user access and security in the domain. + +One browser server for each machine group on a subnet is selected as the [**local master browser server**](#gt_d294211f-7ae9-4faf-8644-f71c1fade2ca) for that machine group. The selection occurs by an election process, as specified in sections [2.2.3](#Section_6c68cb9eedfc498481a858304a0b1c1d) and [3.3.6](#Section_eb955ab5470a4810b18e6c3659a5199e). Servers that are in the local master browser server machine group on the subnet register with it, as does the local master browser server for other machine groups on the subnet. The local master browser server uses these registrations to maintain authoritative information about its machine group on its subnet. If there are servers in the domain that are located on other subnets on the network, the local master browser server for the domain can obtain information about them from the domain master browser server of the domain. + +A [**backup browser server**](#gt_71f76461-689e-4b50-befc-67f52ec4668b) on a subnet is a browser server that was selected by the local master browser server on that subnet to be available to share the processing load that is required to serve browser clients, as specified in section [3.1](#Section_43090b1a85b74ba2ad1a12b4ddae3649). backup browser servers keep copies of the information that is maintained by the local master browser server by periodically querying that server.[<3>](#Appendix_A_3) + +Multiple backup browser servers can exist on a subnet; the number of backup browser servers is typically configured to enable enough backup browser servers to handle the expected query load. Clients can find backup browser servers by querying the local master browser server. Clients on a subnet query backup browser servers on the subnet, not the local master browser server; also, they are expected to spread their queries evenly across backup browser servers to balance the load. + +When a domain spans multiple subnets, the domain master browser server is responsible for keeping them synchronized. The domain master browser server periodically queries all the local master browser servers within the domain for lists that contain all the servers within their subnets. The domain master browser server merges all the replies into a single master list, which allows it to act as a collection point for inter-subnet browsing information. The local master browser servers periodically query the domain master browser server to retrieve the network-wide information it maintains. + +When a domain spans only a single subnet, there is no distinct local master browser server; this role is instead handled by the domain master browser server. Similarly, the domain master browser server is always the local master browser server for its domain on its own subnet. + +When a browser client suspects that the local master browser server for its machine group has failed, the client initiates an election process in which the browser servers participate. This election process is specified in sections 2.2.3 and 3.3.6. When this election process occurs, some browser servers can change roles. + +## Relationship to Other Protocols + +The CIFS Browser Protocol depends on the following protocols: + +- Remote Mailslot Protocol, as specified in [\[MS-MAIL\]](%5bMS-MAIL%5d.pdf#Section_8ea19aa46e5a4aedb6280b5cd75a1ab9). +- The CIFS Browser Protocol uses NetBIOS names (as specified in [\[RFC1001\]](https://go.microsoft.com/fwlink/?LinkId=90260) section 17 and [\[MS-NBTE\]](%5bMS-NBTE%5d.pdf#Section_3461cfa83d284fa38163131bf1046fa3)) in conjunction with the Remote Mailslot Protocol to deliver datagrams between CIFS Browser Protocol end points. +- Remote Administration Protocol (RAP), as specified in [\[MS-RAP\]](%5bMS-RAP%5d.pdf#Section_fb8d5bd1e57c4be1b063ec31330bdd58). +- Common Internet File System (CIFS) Browser Auxiliary Protocol, as specified in [\[MS-BRWSA\]](%5bMS-BRWSA%5d.pdf#Section_5995d2f2fff140af9100ca67794d50a5). +- CIFS Transaction Server Messenger Block (SMB) data structure, as specified in [\[MS-SMB\]](%5bMS-SMB%5d.pdf#Section_f210069c70864dc2885e861d837df688). +- Workstation Service Remote Protocol (WKST), as specified in [\[MS-WKST\]](%5bMS-WKST%5d.pdf#Section_5bb08058bc364d3cabebb132228281b7). + +In certain situations, the CIFS Browser Protocol can invoke selected interfaces of other related protocols as follows: + +- Security Account Manager (SAM) Remote Protocol Specification [\[MS-SAMR\]](%5bMS-SAMR%5d.pdf#Section_4df07fab1bbc452f8e927853a3c7e380) to query the current [**domain**](#gt_b0276eb2-4e65-4cf1-a718-e0920a614aca) role for the machine on which it is running. +- Active Directory Protocols Overview [\[MS-ADOD\]](%5bMS-ADOD%5d.pdf#Section_5ff67bf4c14548cb89cd4f5482d94664) to locate the primary domain controller for a machine group. + +The CIFS Browser Protocol clearinghouse and advertisements can be affected when: + +- Local Security Authority (Domain Policy) Remote Protocol [\[MS-LSAD\]](%5bMS-LSAD%5d.pdf#Section_1b5471ef4c334a91b079dfcbb82f05cc) causes the [**NetBIOS name**](#gt_0334e0bd-2755-42f6-aeff-2d4a22bf4abf) of the domain or workgroup the client is a member of to change. + +These limited relationships are not depicted in the diagram, for clarity. + +![Relationship to other protocols](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAjcAAAJoCAYAAACa8MCMAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAD7AAAA+5ATi8J/QAAHqQSURBVHhe7Z0v2CRH+a4RCEQEArEiAhGxAhGBiIhAREQgYhArEBGIFYgIREQEIuKIFYgViIiImCNWIBCIiCNWRiBWIH7iiEgEArvn3MP3LO9Wqnt6Znpmqmfu+7reb3rqf1VXVz1d3V/Nj17/f168ePH6iy++0AYyzonIt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NyHIUN/IW/NfU48eP3QPnzlHcjGeKG5HlKG7kBzCQPnr0yD1w7piIG14y//3vf68NYAgbxY3IMhQ30oU9cFi9cQ+c+4QtAhA32ljGqqqI7EdxI5NkgnMPnPsEgfvtt99qA5k3GiLLUNzILO6BIyIiW0NxI3txDxwREdkSihtZRPbAYSVHRERkZBQ3soi6Bw7v4oiIiIyK4kYWU/fA4WVTERGREVHcyEFkDxzMPXBERGREFDdyMOxczOoNqzj+a6qIiIyG4kaOgt+e4v0b2ts9cEREZCQUN3I0/Ho4Aof/pBIRERkFxY2cBHvfIHDYC0dERGQEFDdyMuxe7B44IiIyCoobORneueH3p9wDR0RERkBxI6vAf03xC+LugSMiItdGcSOrwb43P/3pT90DR0REroriRlbFPXBEROTaKG5kddwDR0REroniRs6Ce+CIiMi1UNzI2XAPHBERuQaKGzkr2QPnq6++enARERE5L4obOSvZA4eXjN0DR0RELoHiRs5O9sDh38TdA0dERM6N4kYuwqtXr3biBpHjHjgiInJOFDdyMb799tvd46n333/fPXBERORsKG7konzzzTe7F4w//vhj98AREZGzoLiRi/Pll1/uBM6nn3764CIiIrIeihu5Ck+fPt0JnC+++OLBRUREZB0UN3I1eDTlHjgiIrI2ihu5Grxzw8vF7oEjIiJroriRq/L999+7B46IiKyK4kaujnvgiIjImihuZAjcA0dERNZCcSPD4B44IiKyBoobGQr3wBERkVNR3MhwZA8chI6IiMihKG5kSLIHDo+qREREDkFxI0PCS8XZA4eXjUVERJaiuJFh4d/CswcO/y4uIiKyBMWNDA0b+2UPHDb8ExER2YfiRoaHn2bIHjj+i7iIiOxDcSObgB/XzB44IiIicyhuZDN88cUXO4HDv4qLiIhMobiRTcHmfu6BIyIicyhuZFPwzo174IiIyByKG9kc7oEjIiJzKG5kk7gHjoiITKG4kc3iHjgiItJDcSObxj1wRESkRXEjm8c9cEREpKK4kZvAPXBERCQobuRmePLkiXvgiIiI4kZuB9654fwjcF68ePHgKiIi94biRm4K9sB5/Pjx7iXjly9fPriKiMg9obiR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hE3PVFX66O4ERERmWdYcQOssDBZ84iGyT3vqmTVBiIGeCk47lUMACIggiBCJGlWMVFFRgW3pJEyZFUm8B1BQxqEq+lUQQIcV1FS8035KBf1IV0fS4mIiCxnaHEDrNTk/RM++d6CEGCi5xM4ri/lEqfGY9UnwqCmSZwIhwpuMfKY+pfrCCXSzMoS4F7z5zhlhTZfhFrEEmHxS31qWm06UNMRERG5R4YXNyIiIiKHoLgRERGRm0JxIyIiIjeF4kZERERuiNev/x96egQjbdl5CAAAAABJRU5ErkJggg==) + +Figure 1: Relationship to other protocols + +The diagram shows the following: + +- \[MS-BRWS\] client uses \[MS-RAP\] to request an enumeration of servers or domains from an \[MS-BRWS\] server. +- \[MS-BRWS\] optionally calls \[MS-BRWSA\] to request OtherDomain configuration from the domain master browser. +- \[MS-BRWS\] calls \[MS-MAIL\] to send requests to other clients and servers. +- \[MS-BRWS\] calls \[MS-WKST\] locally to retrieve OtherDomain. + +## Prerequisites/Preconditions + +The CIFS Browser Protocol has the following preconditions: + +- A Remote Mailslot Protocol implementation must be available on all CIFS Browser Protocol end points. +- All [**PDCs**](#gt_663cb13a-8b75-477f-b6e1-bea8f2fba64d) must implement the CIFS Browser Protocol, except on networks that are based exclusively on [**Active Directory**](#gt_e467d927-17bf-49c9-98d1-96ddf61ddd90) that do not use the CIFS Browser Protocol, as specified in section [1.6](#Section_af8ffa0e3cf74f608995b890bd1d0b2b). If the PDC for a [**domain**](#gt_b0276eb2-4e65-4cf1-a718-e0920a614aca) does not implement the CIFS Browser Protocol, [**browser clients**](#gt_8cb9694c-b014-426d-8463-66456517b15c) are not able to retrieve information about servers on [**subnets**](#gt_c009a34c-e834-4a3e-9514-e611a6ad52fe) other than their own. +- A Remote Administration Protocol [\[MS-RAP\]](%5bMS-RAP%5d.pdf#Section_fb8d5bd1e57c4be1b063ec31330bdd58) implementation must be available on all CIFS Browser Protocol end points. + +## Applicability Statement + +The CIFS Browser Protocol is used when automatic discovery of services offered within a network is expected, NetBIOS is available, and the network is not based exclusively on [**Active Directory**](#gt_e467d927-17bf-49c9-98d1-96ddf61ddd90). If all of the services offered on a network are specified within Active Directory, and all of the clients are capable of interrogating Active Directory for these services, there is no need for servers on that network to support the browser protocol. However, if all of the services available within a network are not specified in Active Directory, servers are required to support the CIFS Browser Protocol in order to discover the services that are offered in a network. + +Fine-grained search criteria (that is, by location or by another attribute of a resource) are not supported by the CIFS Browser Protocol, so it is not scalable to servers that provide similar services. It is also not extensible to new service types beyond those specified herein, so the protocol is not suitable for discovering such services. Also, the browser protocol includes no security mechanism and thus is not suitable to networking environments requiring secure discovery. In addition, all of the text elements implemented in the CIFS Browser Protocol are implemented as ASCII text and thus are not suited to internationalization. + +Finally, the information in the list of servers that can be returned by this protocol needs to fit in 64 kilobytes of data. This limits the number of systems that can be in a server list in a single machine group. + +## Versioning and Capability Negotiation + +The CIFS Browser Protocol provides for a version field, as specified in section [2.2.3](#Section_6c68cb9eedfc498481a858304a0b1c1d). It also specifies a biased election mechanism to nominate some servers as [**local master browser servers**](#gt_d294211f-7ae9-4faf-8644-f71c1fade2ca). This election mechanism, specified in section [3.3.6](#Section_eb955ab5470a4810b18e6c3659a5199e), is biased in favor of servers implementing newer versions of the CIFS Browser Protocol. + +## Vendor-Extensible Fields + +Some [**frames**](#gt_1c54183d-33fa-463c-b929-e996d716e3bb) define **OSVersionMajor** and **OSVersionMinor** fields. These fields are returned to clients of the CIFS Browser Protocol. As such, implementations can use any values they want.[<4>](#Appendix_A_4) + +This protocol uses Win32 error codes. These values are taken from the Windows error number space as specified in [\[MS-ERREF\]](%5bMS-ERREF%5d.pdf#Section_1bc92ddfb79e413cbbaa99a5281a6c90). Vendors SHOULD reuse those values with their indicated meaning. Choosing any other value runs the risk of a collision in the future.[<5>](#Appendix_A_5) + +## Standards Assignments + +The CIFS Browser Protocol uses the parameter assignments as shown in the following table. + +| Parameter | Value | Reference | +| ------------- | -------------------------------------------- | ------------------------------------------------------------------------------------------ | +| Mailslot name | \\MAILSLOT\\LANMAN | As specified in [\[MS-MAIL\]](%5bMS-MAIL%5d.pdf#Section_8ea19aa46e5a4aedb6280b5cd75a1ab9). | +| Mailslot name | \\MAILSLOT\\BROWSE | As specified in \[MS-MAIL\]. | +| NetBIOS name | \[0x01\]\[0x02\]\_MSBROWSE\_\[0x02\]\[0x01\] | As specified in [\[MS-RAP\]](%5bMS-RAP%5d.pdf#Section_fb8d5bd1e57c4be1b063ec31330bdd58). | + +For more information about NetBIOS naming conventions and control characters, see section [2.1.1](#Section_940f299f669f4a0b84119ead7e2f31ec). + +# Messages + +This document contains the following information on CIFS Browser Protocol messages: + +- Section [2.1.1](#Section_940f299f669f4a0b84119ead7e2f31ec) specifies the recipients of CIFS Browser Protocol messages. +- Sections [2.2.1](#Section_105366778a144726bc52c0ef39cb7130) through [2.2.10](#Section_bad3829da8e94a85aa2181d50867a77f) specify the syntax of each CIFS Browser Protocol message. +- Section [3.3.5](#Section_6ed7dd194e3c468e8d95544cd50d3738) specifies the details of CIFS Browser Protocol message processing, including events and sequencing rules. + +## Transport + +The CIFS Browser Protocol MUST use the Remote Mailslot Protocol transfer service, as specified in [\[MS-MAIL\]](%5bMS-MAIL%5d.pdf#Section_8ea19aa46e5a4aedb6280b5cd75a1ab9). The CIFS Browser Protocol uses [**Mailslot**](#gt_f53fe4b9-8e1d-4366-9254-3c4f73269e78) messages to accomplish inter-machine communication. This communication can be one-to-one (using unique NetBIOS names) or one-to-many (using group NetBIOS names). Two specific Mailslot names, \\MAILSLOT\\LANMAN and \\MAILSLOT\\BROWSE, are used by the CIFS Browser Protocol. The [**browser client**](#gt_8cb9694c-b014-426d-8463-66456517b15c) or [**browser server**](#gt_3bd1e44e-100e-4f13-ad44-fc267e627495) MUST create these mailslots as specified in \[MS-MAIL\] section 3.2.4.1 and provide the mailslot name as the input parameter. A browser server MUST accept [**browser**](#gt_f06aa0c1-29ec-4d3e-a4e2-e38e8f918933) requests on either of these mailslots. A browser client and server MAY select either mailslot for sending messages. Each browser message specifies the destination mailslot name it uses, as specified in section [2.2](#Section_0e74d70edcf7422e8285e2e193f363d9).[<6>](#Appendix_A_6) + +The CIFS Browser Protocol MUST use the Remote Administration Protocol [\[MS-RAP\]](%5bMS-RAP%5d.pdf#Section_fb8d5bd1e57c4be1b063ec31330bdd58) to transport the request/response command NetServerEnum2, as specified in \[MS-RAP\] section 2.5.5.2. + +### NetBIOS Name Notation + +The CIFS Browser Protocol encapsulates its messages in the Remote Mailslot Protocol, as specified in [\[MS-MAIL\]](%5bMS-MAIL%5d.pdf#Section_8ea19aa46e5a4aedb6280b5cd75a1ab9). The Remote Mailslot Protocol requires a NetBIOS name for identification when specifying the origin of a mailslot message or the destination for a mailslot message. Additionally, CIFS Browser Protocol fields that require a NetBIOS name MUST be formatted as specified in [\[RFC1001\]](https://go.microsoft.com/fwlink/?LinkId=90260) section 14. This section describes additional requirements when using NetBIOS names. + +Before a NetBIOS name can be used, it MUST be registered with a name service as specified in \[RFC1001\] section 5.2. + +As discussed in [\[MS-NBTE\]](%5bMS-NBTE%5d.pdf#Section_3461cfa83d284fa38163131bf1046fa3) section 1.8, the CIFS Browser Protocol uses [**NetBIOS suffix**](#gt_e0056bac-be0a-488d-86b2-eec9c6bfb947). Thus a NetBIOS name is effectively divided into two components: a Name, which MUST be a maximum of 15 bytes (and MUST be padded with spaces \[0x20\] if shorter than 15 bytes) and a NetBIOS suffix in the 16th byte. For example, the notation EXAMPLE\[0x19\] indicates a NetBIOS name that consists of the following hexadecimal bytes. + +- 0x45, 0x58, 0x41, 0x4D, 0x50, 0x4C, 0x45, 0x20, +- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x19 + +This specification also defines a unique NetBIOS name for the CIFS Browser Protocol, referred to as \[01\]\[02\]\__MSBROWSE_\_\[02\]\[01\]. It consists of the following hexadecimal bytes. + +- 0x01, 0x02, 0x5F, 0x5F, 0x4D, 0x53, 0x42, 0x52, +- 0x4F, 0x57, 0x53, 0x45, 0x5F, 0x5F, 0x02, 0x01 + +**Note** There are two underscore (0x5F) characters before and after the word MSBROWSE. The name defines all 16 bytes of the NetBIOS name, thus effectively using a NetBIOS suffix of 0x01. + +Names that are placeholders and that need to be substituted with actual values are placed inside angle brackets (< >). Therefore, the string <domain> becomes REDMOND if the [**domain**](#gt_b0276eb2-4e65-4cf1-a718-e0920a614aca) under consideration is named REDMOND. Details of the various NetBIOS names that are used for browsing are specified in the following sections. + +#### NetBIOS Suffix Definitions + +[**NetBIOS suffix**](#gt_e0056bac-be0a-488d-86b2-eec9c6bfb947) bytes for computer and [**NetBIOS name**](#gt_0334e0bd-2755-42f6-aeff-2d4a22bf4abf) of the domains are listed in the following table. Only the names related to the browser protocol are listed. + +| Name | NetBIOS suffix | Name type | Usage | +| -------------------------------------- | -------------- | --------- | --------------------------------------------------------------------------------------------------------------- | +| <computer> | 0x00 | Unique | Default name registered by a client computer. The Workstation Service, if enabled, registers this default name. | +| <machine group> | 0x00 | Group | Browser clients and servers in <machine group>. | +| \[01\]\[02\]\__MSBROWSE_\_\[02\]\[01\] | 0x01 | Group | Master browser. Note that the Name is a full 16 bytes, implicitly defining the NetBIOS suffix as 0x01. | +| <domain> | 0x1B | Unique | Domain master browser | +| <machine group> | 0x1D | Unique | Master browser | +| <machine group> | 0x1E | Group | Browser service elections | +| <computer> | 0x20 | Unique | Default name registered by a server computer. The Server Service, if enabled, registers this default name. | + +#### Unique Names + +| Name | Comment | +| ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| <computer>\[0x00\] | This name is used by all browser clients to receive second-class mailslot ([\[MS-MAIL\]](%5bMS-MAIL%5d.pdf#Section_8ea19aa46e5a4aedb6280b5cd75a1ab9) section 3.2) messages. A system MUST register this NetBIOS name to receive browser mailslot messages intended for browser clients. The only [**browser**](#gt_f06aa0c1-29ec-4d3e-a4e2-e38e8f918933) requests that use this name are [GetBackupListResponse (section 2.2.5)](#Section_2d27295b3a8b4154951071867616a7cb), [MasterAnnouncement (section 2.2.8)](#Section_1dc94e16c4a94a6e93f97f2e64d273b7), and [LocalMasterAnnouncement (section 2.2.10)](#Section_bad3829da8e94a85aa2181d50867a77f) frames. NetBIOS name registration is as specified in [\[RFC1001\]](https://go.microsoft.com/fwlink/?LinkId=90260) section 5.2.

Historical note: The [**NetBIOS suffix**](#gt_e0056bac-be0a-488d-86b2-eec9c6bfb947) 0x00 was chosen because all computers implementing the CIFS Workstation service were (and still are) required to have that name registered with the NetBIOS name server; therefore, the name was guaranteed to be present on all computers. | +| <computer>\[0x20\] | See entry for <computer>\[0x00\]

Historical note: The NetBIOS suffix 0x20 was chosen because all computers implementing the CIFS Server service were (and still are) required to have that name registered with the NetBIOS name server; therefore, the name was guaranteed to be present on all computers. This is significant, because certain implementations of NetBIOS severely limited the number of NetBIOS names that could be registered on any given computer, and using an already existing name meant that an additional name could be registered. | +| <machine group>\[0x1D\] | This name is used to identify a [**local master browser server**](#gt_d294211f-7ae9-4faf-8644-f71c1fade2ca) for <machine group> on a [**subnet**](#gt_c009a34c-e834-4a3e-9514-e611a6ad52fe). A local master browser server MUST register this name as a NetBIOS [**unique name**](#gt_9e9e2d18-1945-48ac-9574-96de352d5122) (as opposed to a [**group name**](#gt_362f32fb-b6fc-4e9e-beb9-a1347754ed3e)). The only requests that use this name are [GetBackupListRequest (section 2.2.4)](#Section_2fa4f92f9c5947dc87b54333360f8593), [AnnouncementRequest (section 2.2.2)](#Section_12ed4892b92c4f5f8242f839893954e3), and [HostAnnouncement (section 2.2.1)](#Section_105366778a144726bc52c0ef39cb7130) requests.[<7>](#Appendix_A_7) | +| <domain>\[0x1B\] | This name MUST be added by the [**PDC**](#gt_663cb13a-8b75-477f-b6e1-bea8f2fba64d) as a unique name. All other servers MUST refrain from adding this name. This name is used to identify the [**domain master browser server**](#gt_ef026994-26e6-4c9d-b34b-dfb7f1f80d6f) for <domain>. A PDC responds to the GetBackupListRequest (section 2.2.4) request on this name.[<8>](#Appendix_A_8) | + +#### Group Names + +| Name | Comment | +| ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| \[0x01\]\[0x02\]\__MSBROWSE_\_\[0x02\]\[0x01\] | All [**local master browser servers**](#gt_d294211f-7ae9-4faf-8644-f71c1fade2ca) MUST add this name as a [**group name**](#gt_362f32fb-b6fc-4e9e-beb9-a1347754ed3e). This name is used by local master browser servers to periodically announce themselves to local master browser servers for other domains on the [**subnet**](#gt_c009a34c-e834-4a3e-9514-e611a6ad52fe). The only message that uses this name is [DomainAnnouncement (section 2.2.7)](#Section_7401bb1bafee499284baee34fcb6409f). | +| <machine group>\[0x00\] | [**browser clients**](#gt_8cb9694c-b014-426d-8463-66456517b15c) and servers in <machine group> MUST register this name to process one-to-many mailslot messages. The only CIFS Browser Protocol message that uses this name is [AnnouncementRequest (section 2.2.2)](#Section_12ed4892b92c4f5f8242f839893954e3). | +| <machine group>\[0x1E\] | All [**browser servers**](#gt_3bd1e44e-100e-4f13-ad44-fc267e627495) and potential browser servers within <machine group> MUST register this name to receive domain-wide broadcasts on a subnet. The only requests that use this name are [RequestElection (section 2.2.3)](#Section_6c68cb9eedfc498481a858304a0b1c1d), [BecomeBackup (section 2.2.6)](#Section_0901905abff941b29ab09176d26cb91f), and [LocalMasterAnnouncement (section 2.2.9)](#Section_91575c1a07a04d278aa5a11698552c40) frames. | + +## Message Syntax + +[**Browser**](#gt_3bd1e44e-100e-4f13-ad44-fc267e627495) messages are transported via the Mailslot Protocol, as specified in section [2.1](#Section_ced2f3444e604eab87a0ec4dda60b2ff). The [**browser**](#gt_f06aa0c1-29ec-4d3e-a4e2-e38e8f918933) message MUST be contained in the data section of the [**Mailslot**](#gt_f53fe4b9-8e1d-4366-9254-3c4f73269e78) message. + +Browser messages can be categorized according to the server's role. Each of these lists is complete for the specified, individual role. A machine that assumes multiple roles will use the messages for each of those roles, as described here: + +- Messages used by [**nonbrowser servers**](#gt_a0a691b5-ba43-46d5-ab2b-acb813ebb636) are the following: + - [HostAnnouncement](#Section_105366778a144726bc52c0ef39cb7130) (sent) + - [AnnouncementRequest](#Section_12ed4892b92c4f5f8242f839893954e3) (received) +- Messages used by [**browser clients**](#gt_8cb9694c-b014-426d-8463-66456517b15c) are the following: + - [GetBackupListRequest](#Section_2fa4f92f9c5947dc87b54333360f8593) (sent) + - [GetBackupListResponse](#Section_2d27295b3a8b4154951071867616a7cb) (received) + - [RequestElection](#Section_6c68cb9eedfc498481a858304a0b1c1d) (sent) +- Messages used by all browser servers (with subcategories of [**potential browser server**](#gt_eac2d668-c72a-4030-af54-775f11815cd5), [**backup browser servers**](#gt_71f76461-689e-4b50-befc-67f52ec4668b), [**local master browser servers**](#gt_d294211f-7ae9-4faf-8644-f71c1fade2ca), and [**domain master browser servers**](#gt_ef026994-26e6-4c9d-b34b-dfb7f1f80d6f)) are the following: + - RequestElection (sent, received) + - AnnouncementRequest (sent) + - [ResetStateRequest](#Section_543f5af3b72147c38303f2bde1bc8496) (received) + +Messages used by potential browser servers are the following: + +- - All messages used by all browser servers + - [BecomeBackup](#Section_0901905abff941b29ab09176d26cb91f) (received) + +Messages used by backup browser servers are the following: + +- - All messages used by all browser servers + - [LocalMasterAnnouncement](#Section_91575c1a07a04d278aa5a11698552c40) (received) + +Messages used by local master browser servers are the following: + +- - All messages used by all browser servers + - HostAnnouncement (received) + - [DomainAnnouncement](#Section_7401bb1bafee499284baee34fcb6409f) (sent, received) + - BecomeBackup (sent) + - GetBackupListRequest (received) + - GetBackupListResponse (sent) + - LocalMasterAnnouncement (sent) + - [MasterAnnouncement](#Section_1dc94e16c4a94a6e93f97f2e64d273b7) (sent) + - ResetStateRequest (sent, received) + +Messages used by domain master browser servers are the following: + +- - All messages used by local master browser servers except MasterAnnouncement (sent) + - MasterAnnouncement (received) + +More information about how the various browser server messages are used is specified in section [3](#Section_19efd0cab39b43db8a613f7a0b51fbea). + +All multibyte fields specified in messages in this section are transmitted in [**little-endian**](#gt_079478cb-f4c5-4ce5-b72b-2144da5d2ce7) byte order, unless noted otherwise. + +_Browser message opcodes_ + +A browser message operation code (opcode) consists of an 8-bit numeric value. The opcode MUST be one of the values listed in the following table. + +| Value | Meaning | +| ----------------------------------- | -------------------------------------------------------------------------------------- | +| HostAnnouncement

0x01 | For more information, see section 2.2.1. | +| AnnouncementRequest

0x02 | For more information, see section 2.2.2. | +| RequestElection

0x08 | For more information, see section 2.2.3. | +| GetBackupListRequest

0x09 | For more information, see section 2.2.4. | +| GetBackupListResponse

0x0A | For more information, see section 2.2.5. | +| BecomeBackup

0x0B | For more information, see section 2.2.6. | +| DomainAnnouncement

0x0C | For more information, see section 2.2.7. | +| MasterAnnouncement

0x0D | For more information, see section 2.2.8. | +| ResetStateRequest

0x0E | For more information, see section 2.2.9. | +| LocalMasterAnnouncement

0x0F | For more information, see section [2.2.10](#Section_bad3829da8e94a85aa2181d50867a77f). | + +### HostAnnouncement Browser Frame + +A server (including [**nonbrowser servers**](#gt_a0a691b5-ba43-46d5-ab2b-acb813ebb636)) sends a HostAnnouncement browser frame to advertise its presence and to specify the types of resources and services it supports. It MUST be a response to an [AnnouncementRequest](#Section_12ed4892b92c4f5f8242f839893954e3) [**browser**](#gt_f06aa0c1-29ec-4d3e-a4e2-e38e8f918933) [**frame**](#gt_1c54183d-33fa-463c-b929-e996d716e3bb), as specified in section 2.2.2, or to the expiration of the HostAnnouncement timer, as specified in section [3.2.2](#Section_c76cc35a7481439b9749610749d05533). + +A server MUST issue a HostAnnouncement in response to a received AnnouncementRequest browser frame (as defined in section 2.2.2) or as a response to the expiration of the announcement timer, as specified in section [3.2.6](#Section_b3ab99037158486982b0f44dda04a52e). Failure to do so results in this server's resources being absent in the resource enumeration to browser clients. + +A server SHOULD send a HostAnnouncement to the [**local master browser**](#gt_01f30b6e-f78a-462e-899e-9b2f5d299471) using the NetBIOS unique name <machine group>\[0x1D\] and mailslot \\MAILSLOT\\LANMAN.[<9>](#Appendix_A_9) + +The format of the HostAnnouncement frame MUST be as follows. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------- | --- | --- | --- | --- | --- | --- | --- | ------------------- | --- | ---------- | --- | --- | --- | --- | --- | --------------------- | --- | --- | --- | ---------- | --- | --- | --- | -------------- | --- | --- | --- | --- | --- | ---------- | --- | +| 0x01 | | | | | | | | UpdateCount | | | | | | | | Periodicity | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | ServerName (16 bytes) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | OSVersionMajor | | | | | | | | OSVersionMinor | | | | | | | | +| ServerType | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| BrowserVersionMajor | | | | | | | | BrowserVersionMinor | | | | | | | | Signature | | | | | | | | | | | | | | | | +| Comment (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**0x01 (1 byte):** The 8-bit operation code (opcode) that identifies this structure as a HostAnnouncement frame. This opcode MUST have a value of 0x01. + +**UpdateCount (1 byte):** An unsigned 8-bit integer that MUST be sent as 0x00 and MUST be ignored on receipt. + +**Periodicity (4 bytes):** An unsigned 32-bit integer that MUST be the announcement frequency of the server in milliseconds. It MUST be set to the NewHostAnnouncement timer value of the server in milliseconds, as specified in section 3.2.6.[<10>](#Appendix_A_10) + +**ServerName (16 bytes):** MUST be a null-terminated ASCII server name with a length of 16 bytes, including the null terminator. If the name is fewer than 16 bytes in length including the terminator, then the remainder of the 16 bytes must be ignored. + +**OSVersionMajor (1 byte):** An unsigned 8-bit integer that MUST indicate the major version number of the operating system that the server is running. This is entirely informational and does not have any significance for the browsing protocol.[<11>](#Appendix_A_11) + +**OSVersionMinor (1 byte):** An unsigned 8-bit integer that MUST indicate the minor version number of the operating system that the server is running. This is entirely informational and does not have any significance for the browsing protocol.[<12>](#Appendix_A_12) + +**ServerType (4 bytes):** An unsigned 32-bit integer that MUST be the type of the server, as specified in [\[MS-RAP\]](%5bMS-RAP%5d.pdf#Section_fb8d5bd1e57c4be1b063ec31330bdd58) section 2.5.5.2.1. + +**BrowserVersionMajor (1 byte):** A signed 8-bit integer that MUST indicate the major version number of the CIFS Browser Protocol that the server is running. Announcing servers MUST set this to 0x0F. This is entirely informational and does not have any significance for the browsing protocol. This field MUST NOT be validated in any way on receive. + +**BrowserVersionMinor (1 byte):** An unsigned 8-bit integer MUST indicate the minor version number of the CIFS Browser Protocol that the server is running. Announcing servers MUST set this to 0x01. This is entirely informational and does not have any significance for the browsing protocol. This field MUST NOT be validated in any way on receive. + +**Signature (2 bytes):** An unsigned 16-bit integer that MUST be set to 0xAA55. + +**Comment (variable):** A null-terminated ASCII string that MUST be less than or equal to 43 bytes in length including the null terminator. This is a purely informational comment associated with the server and has no effect on the operation of the CIFS Browser Protocol.[<13>](#Appendix_A_13) + +### AnnouncementRequest Browser Frame + +The AnnouncementRequest frame MUST be sent from the NetBIOS computer name <computer>\[0x00\] to the NetBIOS [**group name**](#gt_362f32fb-b6fc-4e9e-beb9-a1347754ed3e) <machine group>\[0x00\], to force all machines in the [**workgroup**](#gt_9d4eb51b-4b89-4814-be9c-394156ce5e78) or domain to announce, or it MUST be sent from the NetBIOS computer name <computer>\[0x00\] to the NetBIOS group name <machine group>\[0x1D\], to force the current master [**browser**](#gt_f06aa0c1-29ec-4d3e-a4e2-e38e8f918933) in the machine group to announce itself to the client. It is sent by a [**local master browser server**](#gt_d294211f-7ae9-4faf-8644-f71c1fade2ca) to <machine group>\[0x00\] at startup to discover the members of <machine group>, as specified in section [3.3.6](#Section_eb955ab5470a4810b18e6c3659a5199e). Its expected response is a set of [HostAnnouncement](#Section_105366778a144726bc52c0ef39cb7130) frames, as specified in section 2.2.1. + +The frame MUST be sent to mailslot \\MAILSLOT\\BROWSE. + +The format of the AnnouncementRequest frame MUST be as follows. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ---- | --- | --- | --- | --- | --- | --- | --- | -------- | --- | ---------- | --- | --- | --- | --- | --- | ----------------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| 0x02 | | | | | | | | Reserved | | | | | | | | ResponseName (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**0x02 (1 byte):** The 8-bit operation code (opcode) that identifies this structure as an AnnouncementRequest frame. This opcode MUST have a value of 0x02. + +**Reserved (1 byte):** This value MUST be 0x00. + +**ResponseName (variable):** A variable-length field that MUST be the name of the sender, up to 16 bytes in length including the null terminator. The receiving computer MUST ignore this name. (Note that the name is not needed to generate a HostAnnouncement response because that message is sent as specified in section 2.2.1.) + +### RequestElection Browser Frame + +The RequestElection frame MUST be broadcast by using the NetBIOS [**group name**](#gt_362f32fb-b6fc-4e9e-beb9-a1347754ed3e) <machine group>\[0x1E\] and mailslot \\MAILSLOT\\BROWSE. For more information about [**browser**](#gt_f06aa0c1-29ec-4d3e-a4e2-e38e8f918933) elections, see sections [3.1.6](#Section_0fef49b090f54a9da87ad2c94be6e7ae), [4.2](#Section_1cd470ba33444d918e54c6872b6cc5f7), [4.3](#Section_d4b8e069241b4180a2e209d241b83496), and [3.3.5.8](#Section_557253965304455caf5b3224e238b2e0). + +The format of the RequestElection frame MUST be as follows. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ---- | --- | --- | --- | --- | --- | --- | --- | ------- | --- | ---------- | --- | --- | --- | --- | --- | --------------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| 0x08 | | | | | | | | Version | | | | | | | | Criteria | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | Uptime | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | Unused | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | ServerName (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**0x08 (1 byte):** The 8-bit opcode that identifies this structure as a RequestElection frame. This opcode MUST have a value of 0x08. + +**Version (1 byte):** An 8-bit integer that specifies the version of this election packet and MUST be transmitted with a value of 0x01. + +**Criteria (4 bytes):** An unsigned 32-bit integer that MUST specify the [**election criteria**](#gt_682b93a8-cd66-40c8-8500-2797c71e2e07) of the sender. If sent by a browser client, the **Criteria** field SHOULD be set to 0. If sent by a browser server, it MUST be produced by applying a bitwise OR operation on a combination of the appropriate operating system value, the browser version value, and the role value as defined below. The election process is specified in section 3.3.5.8. + +**Operating System**: This value represents an operating system-specific value. It MUST be set to either 0x10000000 or 0x20000000, based on the server implementation. Servers that set it to 0x20000000 will be more likely to win an election as described in section 3.3.5.8. As such, a server that is less likely to remain active on the [**subnet**](#gt_c009a34c-e834-4a3e-9514-e611a6ad52fe) SHOULD set this value to 0x10000000 to prevent unnecessary elections.[<14>](#Appendix_A_14) + +**Browser Version**: This value MUST be set to 0x00010F00. + +**Role**: This value is the bitwise OR of zero or more of the flags defined in the following table. + +| Value | Meaning | +| ---------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| 0x00000080 | A browser server running on a machine that is also the [**Primary domain controller (PDC)**](#gt_663cb13a-8b75-477f-b6e1-bea8f2fba64d). | +| 0x00000008 | [**Preferred master browser server**](#gt_72fc4f3e-92ce-4d32-94f8-fc8fab792294) | +| 0x00000004 | A [**master browser server**](#gt_542ffc1e-9bbc-47f9-a6ca-284d0a39c680) that is currently running | +| 0x00000002 | A browser server running on a machine that is also a [**domain controller (DC)**](#gt_76a05049-3531-4abd-aec8-30e19954b4bd) | +| 0x00000001 | A [**backup browser server**](#gt_71f76461-689e-4b50-befc-67f52ec4668b) that is currently running | +| 0x00000020 | A computer using NetBIOS Name Service (or [**Windows Internet Name Service**](#gt_bafb050b-b593-4517-8093-f721bd2378ac)) for NetBIOS | + +**Uptime (4 bytes):** An unsigned 32-bit integer that MUST be the number of seconds since the browser service was started on the server. + +**Unused (4 bytes):** An unsigned 32-bit integer that MUST be sent as 0x00000000 and ignored on receipt. + +**ServerName (variable):** MUST be a null-terminated ASCII server name and MUST be less than or equal to 16 bytes in length, including the null terminator. + +### GetBackupListRequest Browser Frame + +The GetBackupListRequest frame is sent by a [**browser client**](#gt_8cb9694c-b014-426d-8463-66456517b15c) to the [**local master browser server**](#gt_d294211f-7ae9-4faf-8644-f71c1fade2ca) for a [**machine group**](#gt_f4153c8c-848d-4db5-b9cc-4113e5f1e406) to retrieve the identities of [**backup browser servers**](#gt_71f76461-689e-4b50-befc-67f52ec4668b). Its response is a [GetBackupListResponse](#Section_2d27295b3a8b4154951071867616a7cb) frame, as specified in section 2.2.5. For more information about the use of the GetBackupListRequest frame, see section [3.1.5.1](#Section_a53e834fd4a04cae94b90651828e12f9). + +To get the list of backup browser servers for <machine group> from the local master browser server for that domain, the GetBackupListRequest browser frame MUST be sent to the [**master browser server**](#gt_542ffc1e-9bbc-47f9-a6ca-284d0a39c680) with the NetBIOS [**unique name**](#gt_9e9e2d18-1945-48ac-9574-96de352d5122) <machine group>\[0x1D\] and mailslot \\MAILSLOT\\BROWSE. + +To get the list of backup browser servers for <domain> from the [**domain master browser server**](#gt_ef026994-26e6-4c9d-b34b-dfb7f1f80d6f) for that domain, the GetBackupListRequest browser frame MUST be sent to the domain master browser server with the NetBIOS unique name <domain>\[0x1B\] and mailslot \\MAILSLOT\\BROWSE. + +The format of the GetBackupListRequest frame, which is 6 bytes in length, MUST be as follows. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ---- | --- | --- | --- | --- | --- | --- | --- | -------------- | --- | ---------- | --- | --- | --- | --- | --- | ----- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| 0x09 | | | | | | | | RequestedCount | | | | | | | | Token | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | + +**0x09 (1 byte):** The 8-bit opcode that identifies this structure as a GetBackupListRequest frame. This opcode MUST have a value of 0x09. + +**RequestedCount (1 byte):** An 8-bit integer that specifies the number of backup servers that the client is requesting.[<15>](#Appendix_A_15) + +**Token (4 bytes):** MUST be a 32-bit value. This field has significance only to the client issuing the browser frame. The local master browser server MUST return this token unmodified in the corresponding GetBackupListResponse response message. The client MUST use this to distinguish replies to multiple outstanding GetBackupListRequests.[<16>](#Appendix_A_16) + +### GetBackupListResponse Browser Frame + +The GetBackupListResponse frame MUST be sent by a [**master browser server**](#gt_542ffc1e-9bbc-47f9-a6ca-284d0a39c680) to the computer system that sends a [GetBackupListRequest](#Section_2fa4f92f9c5947dc87b54333360f8593) frame. It is a response to a GetBackupListRequest browser frame. + +This frame MUST be sent to the NetBIOS [**unique name**](#gt_9e9e2d18-1945-48ac-9574-96de352d5122) <computer>\[0x00\] and mailslot \\MAILSLOT\\BROWSE, where <computer> is the name of the originator of the GetBackupListRequest frame. + +The format of the GetBackupListResponse frame MUST be as follows. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ---- | --- | --- | --- | --- | --- | --- | --- | ----------------- | --- | ---------- | --- | --- | --- | --- | --- | --------------------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| 0x0A | | | | | | | | BackupServerCount | | | | | | | | Token | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | BackupServerList (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**0x0A (1 byte):** The 8-bit opcode that identifies this structure as a GetBackupListResponse frame. This opcode MUST have a value of 0x0A. + +**BackupServerCount (1 byte):** An unsigned 8-bit integer that MUST be the number of backup servers in the **BackupServerList** field. + +**Token (4 bytes):** An unsigned 32-bit value that MUST be the token value received in GetBackupListRequest. The server MUST return the same value here. + +**BackupServerList (variable):** MUST be a series of null-terminated ASCII strings, each up to 16 bytes in length including the null terminator, where each string MUST denote a server name acting as a [**backup browser server**](#gt_71f76461-689e-4b50-befc-67f52ec4668b). The number of such strings present MUST be specified in BackupServerCount. + +### BecomeBackup Browser Frame + +When a [**local master browser server**](#gt_d294211f-7ae9-4faf-8644-f71c1fade2ca) for a machine group wants to promote a [**potential browser server**](#gt_eac2d668-c72a-4030-af54-775f11815cd5) to [**backup browser server**](#gt_71f76461-689e-4b50-befc-67f52ec4668b), it MUST send a BecomeBackup frame by using the NetBIOS [**group name**](#gt_362f32fb-b6fc-4e9e-beb9-a1347754ed3e) <machine group>\[0x1E\] and mailslot \\MAILSLOT\\BROWSE. + +The definition of the BecomeBackup frame MUST be as follows. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ---- | --- | --- | --- | --- | --- | --- | --- | --------------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| 0x0B | | | | | | | | BrowserToPromote (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**0x0B (1 byte):** The 8-bit opcode that identifies this structure as a BecomeBackup frame. This opcode MUST have a value of 0x0B. + +**BrowserToPromote (variable):** MUST be a null-terminated ASCII string that is less than or equal to 16 bytes in length, including the null terminator, which MUST be the name of the [**browser server**](#gt_3bd1e44e-100e-4f13-ad44-fc267e627495) to be promoted to backup. + +### DomainAnnouncement Browser Frame + +[**Local master browser servers**](#gt_d294211f-7ae9-4faf-8644-f71c1fade2ca) announce the machine group they serve to any other local master browser servers on their [**subnet**](#gt_c009a34c-e834-4a3e-9514-e611a6ad52fe) by broadcasting a DomainAnnouncement frame using the NetBIOS [**group name**](#gt_362f32fb-b6fc-4e9e-beb9-a1347754ed3e) \[0x01\]\[0x02\]\__MSBROWSE_\_\[0x02\]\[0x01\] and mailslot \\MAILSLOT\\BROWSE. + +The format of the DomainAnnouncement frame MUST be as listed in the following table. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------------------------------- | --- | --- | --- | --- | --- | --- | --- | ------------------- | --- | ---------- | --- | --- | --- | --- | --- | ------------------------- | --- | --- | --- | ---------- | --- | --- | --- | ------------------------- | --- | --- | --- | --- | --- | ---------- | --- | +| 0x0C | | | | | | | | UpdateCount | | | | | | | | Periodicity | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | MachineGroup (16 bytes) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | BrowserConfigVersionMajor | | | | | | | | BrowserConfigVersionMinor | | | | | | | | +| ServerType | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| BrowserVersionMajor | | | | | | | | BrowserVersionMinor | | | | | | | | Signature | | | | | | | | | | | | | | | | +| LocalMasterBrowserName (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**0x0C (1 byte):** The 8-bit opcode that identifies this structure as a DomainAnnouncement frame. This opcode MUST have a value of 0x0C. + +**UpdateCount (1 byte):** An unsigned 8-bit integer that MUST be sent as 0x00 and MUST be ignored on receipt. + +**Periodicity (4 bytes):** An unsigned 32-bit integer that MUST be the announcement frequency, in milliseconds, of the machine group, as specified in section [3.3.2](#Section_43cefc76d82d466e958ff6f6371f26d9). + +**MachineGroup (16 bytes):** MUST be a null-terminated ASCII workgroup or [**NetBIOS name**](#gt_0334e0bd-2755-42f6-aeff-2d4a22bf4abf) of the domain with a length of 16 bytes, including the null terminator. If the name is fewer than 16 bytes in length, including the terminator, the remainder of the 16 bytes must be ignored. + +**BrowserConfigVersionMajor (1 byte):** An unsigned 8-bit integer that SHOULD be set to the major version of the browser protocol that the server is running. This value is provided for informational purposes only and is irrelevant to the browsing protocol.[<17>](#Appendix_A_17) + +**BrowserConfigVersionMinor (1 byte):** An unsigned 8-bit integer that SHOULD indicate the minor version of the browser protocol that the server is running. This value is provided for informational purposes only and is irrelevant to the browsing protocol.[<18>](#Appendix_A_18) + +**ServerType (4 bytes):** An unsigned 32-bit integer that MUST be the type of the server. The server type bits MUST be set as specified in [\[MS-RAP\]](%5bMS-RAP%5d.pdf#Section_fb8d5bd1e57c4be1b063ec31330bdd58) section 2.5.5.2.1. + +**BrowserVersionMajor (1 byte):** An unsigned 8-bit integer that SHOULD have the value 0x0F.[<19>](#Appendix_A_19) + +**BrowserVersionMinor (1 byte):** An unsigned 8-bit integer that SHOULD have the value 0x01.[<20>](#Appendix_A_20) + +**Signature (2 bytes):** An unsigned 16-bit integer that SHOULD have the value 0xAA55.[<21>](#Appendix_A_21) + +**LocalMasterBrowserName (variable):** A null-terminated ASCII string that MUST contain the name of the sender, up to 16 bytes in length including the null terminator. + +### MasterAnnouncement Browser Frame + +The MasterAnnouncement frame MUST be sent by a local master [**browser**](#gt_f06aa0c1-29ec-4d3e-a4e2-e38e8f918933) to the domain master browser when the MasterAnnouncement timer expires, as specified in section [3.3.6](#Section_eb955ab5470a4810b18e6c3659a5199e). The MasterAnnouncement frame MUST be sent to the NetBIOS [**unique name**](#gt_9e9e2d18-1945-48ac-9574-96de352d5122) <PDCName>\[0x00\] and mailslot \\MAILSLOT\\BROWSE where <PDCName> is the computer name of the domain master browser. + +The format of the MasterAnnouncement frame MUST be as follows. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ---- | --- | --- | --- | --- | --- | --- | --- | ---------------------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| 0x0D | | | | | | | | MasterBrowserServerName (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**0x0D (1 byte):** The 8-bit opcode that identifies this structure as a MasterAnnouncement frame. This opcode MUST have a value of 0x0D. + +**MasterBrowserServerName (variable):** A null-terminated ASCII string that MUST contain the name of the local master browser and MUST be less than or equal to 16 bytes in length, including the null terminator. + +### ResetStateRequest Browser Frame + +The ResetStateRequest frame instructs a browser server to change its operational state. + +The local master browser SHOULD send a RESET_STATE_CLEAR_ALL request to any backup browser that is determined to be running an earlier version of the browser protocol when the HostAnnouncement Timer count-down reaches 0x00. + +The format of the ResetStateRequest frame MUST be as listed in the following table. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ---- | --- | --- | --- | --- | --- | --- | --- | ---- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| 0x0E | | | | | | | | Type | | | | | | | | + +**0x0E (1 byte):** The 8-bit opcode that identifies this structure as a ResetStateRequest frame. This opcode MUST have a value of 0x0E. + +**Type (1 byte):** An unsigned 8-bit integer that MUST be set to one of the following possible values. + +| Value | Meaning | +| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------- | +| RESET_STATE_STOP_MASTER

0x01 | Instructs master browser server to change its role to browser server. | +| RESET_STATE_CLEAR_ALL

0x02 | Instructs browser server to stop all browser server activities. It is disqualified from acting as a browser server. | +| RESET_STATE_STOP

0x04 | Instructs browser server to stop the browser service.

[<22>](#Appendix_A_22) | + +### LocalMasterAnnouncement Browser Frame + +A local master [**browser**](#gt_f06aa0c1-29ec-4d3e-a4e2-e38e8f918933) for a machine group MUST announce itself with the periodicity listed in section [3.3.2](#Section_43cefc76d82d466e958ff6f6371f26d9) to all the other [**browser servers**](#gt_3bd1e44e-100e-4f13-ad44-fc267e627495) in its machine group that are on its [**subnet**](#gt_c009a34c-e834-4a3e-9514-e611a6ad52fe), using the [LocalMasterAnnouncement](#Section_91575c1a07a04d278aa5a11698552c40) frame. The LocalMasterAnnouncement frame MUST be broadcast by using the NetBIOS [**group name**](#gt_362f32fb-b6fc-4e9e-beb9-a1347754ed3e) <machine group>\[0x1E\] and mailslot \\MAILSLOT\\BROWSE. + +The format of the LocalMasterAnnouncement frame MUST be as listed in the following table. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | ------------------------- | --- | ---------- | --- | --- | --- | --- | --- | --------------------- | --- | --- | --- | ---------- | --- | --- | --- | -------------- | --- | --- | --- | --- | --- | ---------- | --- | +| 0x0F | | | | | | | | UpdateCount | | | | | | | | Periodicity | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | ServerName (16 bytes) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | OSVersionMajor | | | | | | | | OSVersionMinor | | | | | | | | +| ServerType | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| BrowserConfigVersionMajor | | | | | | | | BrowserConfigVersionMinor | | | | | | | | Signature | | | | | | | | | | | | | | | | +| Comment (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**0x0F (1 byte):** The 8-bit opcode that identifies this structure as a LocalMasterAnnouncement frame. This opcode MUST have a value of 0x0F. + +**UpdateCount (1 byte):** An unsigned 8-bit integer that MUST be set to 0x00 and MUST be ignored upon receipt. + +**Periodicity (4 bytes):** An unsigned 32-bit integer that MUST be the announcement frequency of the [**local master browser server**](#gt_d294211f-7ae9-4faf-8644-f71c1fade2ca) in milliseconds. It MUST be set to the NewLocalMasterAnnouncement timer value of the server in milliseconds. For more information, see section 3.3.2. + +**ServerName (16 bytes):** MUST be a null-terminated ASCII server name with a length of 16 bytes, including the null terminator. If the name is fewer than 16 bytes in length including the terminator, then the remainder of the 16 bytes must be ignored. + +**OSVersionMajor (1 byte):** MUST be an unsigned 8-bit integer that indicates the major version of the operating system that the server is running. This value is provided for informational purposes only and is irrelevant to the browsing protocol.[<23>](#Appendix_A_23) + +**OSVersionMinor (1 byte):** MUST be an unsigned 8-bit integer that indicates the minor version of the operating system the server is running. This value is provided for informational purposes only and is irrelevant to the browsing protocol.[<24>](#Appendix_A_24) + +**ServerType (4 bytes):** An unsigned 32-bit integer that MUST be the type of the local master browser server. The type bits are as specified in [\[MS-RAP\]](%5bMS-RAP%5d.pdf#Section_fb8d5bd1e57c4be1b063ec31330bdd58) section 2.5.5.2.1. + +**BrowserConfigVersionMajor (1 byte):** An unsigned 8-bit integer that SHOULD be set to the major version of the browser protocol that the server is running. This value is legacy and is irrelevant to the browsing protocol.[<25>](#Appendix_A_25) + +**BrowserConfigVersionMinor (1 byte):** An unsigned 8-bit integer that SHOULD be set to the minor version of the browser protocol that the server is running. This value is legacy and is irrelevant to the browsing protocol.[<26>](#Appendix_A_26) + +**Signature (2 bytes):** An unsigned 16-bit integer that MUST have the value 0xAA55. + +**Comment (variable):** A null-terminated ASCII string that MUST be less than or equal to 43 bytes in length, including the null terminator. This is a purely informational comment associated with the server and has no effect on the operation of the CIFS Browser Protocol. + +# Protocol Details + +The hosts that are used in the browsing process can be separated into four distinct groups: + +- Workstations +- [**Nonbrowser servers**](#gt_a0a691b5-ba43-46d5-ab2b-acb813ebb636) +- [**Browser servers**](#gt_3bd1e44e-100e-4f13-ad44-fc267e627495) +- [**Domain master browser servers**](#gt_ef026994-26e6-4c9d-b34b-dfb7f1f80d6f) + +## Client Details + +### Abstract Data Model + +This section describes a hypothetical model of [**browser client**](#gt_8cb9694c-b014-426d-8463-66456517b15c) data organization that can be implemented to support the CIFS Browser Protocol. The purpose of this description is to help explain how this aspect of the protocol works. This specification does not prescribe that implementations adhere to this model as long as their external behavior is consistent with what is described throughout this document. + +**BackupBrowserServerTable**: The **BackupBrowserServerTable** is a cache of [**backup browser servers**](#gt_71f76461-689e-4b50-befc-67f52ec4668b) for a given [**machine group**](#gt_f4153c8c-848d-4db5-b9cc-4113e5f1e406). Each entry in the table contains a [**NetBIOS name**](#gt_0334e0bd-2755-42f6-aeff-2d4a22bf4abf) of a machine group along with a list of the NetBIOS name of one or more backup browser servers for that machine group. + +**MachineGroupNameInProgress**: The NetBIOS name of a machine group for which the client is currently requesting a list of backup [**browsers**](#gt_f06aa0c1-29ec-4d3e-a4e2-e38e8f918933). + +**TokenValue**: A 32-bit value used for [GetBackupList](#Section_ce7d2c1c0c714c54bef55fecb17b2f50) requests. + +**BrowserClientUpTime**: Records the time when the browser service was initially started. + +### Timers + +The client uses the following timer: + +**GetBackupListRequest timer:** This timer is used to govern the retransmission of [GetBackupListRequest](#Section_2fa4f92f9c5947dc87b54333360f8593) frames. Its initial duration MUST be 1 second. + +### Initialization + +At startup, to find a [**backup browser server**](#gt_71f76461-689e-4b50-befc-67f52ec4668b), the client MUST do the following: + +- **MachineGroupNameInProgress** is set to an empty string. +- **TokenValue** is set to 0. +- Initialize **BackupBrowserServerTable** to an empty table. +- Initialize the [GetBackupListRequest](#Section_2fa4f92f9c5947dc87b54333360f8593) timer and send a GetBackupListRequest frame for **MachineGroupNameInProgress**, as specified in section [3.1.5.1.1](#Section_ce7d2c1c0c714c54bef55fecb17b2f50). + +If the local master [**browser**](#gt_f06aa0c1-29ec-4d3e-a4e2-e38e8f918933) for a machine group fails to respond to the GetBackupListRequest after an implementation-defined number of retries, as specified in section [3.1.6](#Section_0fef49b090f54a9da87ad2c94be6e7ae), the client MUST force an election by [Sending a RequestElection Frame](#Section_ff716dc43a2e453283b7a5745698c8d9), as specified in section 3.1.5.3. + +The GetBackupListRequest and [GetBackupListResponse](#Section_2d27295b3a8b4154951071867616a7cb) sequences are specified in sections 3.1.5.1.1 and [3.1.5.1.2](#Section_1b1e5e2d3a6b474e86282d332a236114), respectively. If this sequence does not produce a backup browser server, as specified in section 3.1.6, the initialization MUST fail.[<27>](#Appendix_A_27) + +**BrowserClientUpTime** is set to the time when the browser service was initially started. + +### Higher-Layer Triggered Events + +#### Application Requests the Enumeration of Servers in a Machine Group + +The application MUST provide: + +- MachineGroup - The NetBIOS name of the machine group. +- MaxSize - The maximum number of bytes of data to return. +- TypeFilter - Uses the "ServerType" flag field (a 32-bit bitmask) to filter servers by type, in response to the NetServerEnum2 request, as specified in [\[MS-RAP\]](%5bMS-RAP%5d.pdf#Section_fb8d5bd1e57c4be1b063ec31330bdd58) section 2.5.5.2.1, "RAP NetServerEnum2Request". + +If the client has no entry in the **BackupBrowserServerTable** for the machine group, it MUST attempt to obtain a list of [**backup browser servers**](#gt_71f76461-689e-4b50-befc-67f52ec4668b) for MachineGroup, as specified in section [3.1.5.1](#Section_a53e834fd4a04cae94b90651828e12f9). + +If no GetBackupListResponse is received and the maximum number of retries has been sent as, specified in section [3.1.6](#Section_0fef49b090f54a9da87ad2c94be6e7ae), for the GetBackupListRequest timer, the client MUST return ERROR_NO_BROWSER_SERVERS_FOUND to the calling application. + +If the client is able to populate a list of backup browser servers for MachineGroup in the **BackupBrowserServerTable**, it MUST then select a backup server at random from the entry in the **BackupBrowserServerTable** for the machine group requested, and send it a NetServerEnum2 request (as specified in \[MS-RAP\] section 2.5.5.2) with the following parameters. + +| NetServerEnum2Request field | Value | +| --------------------------- | ------------ | +| InfoLevel | 1 | +| ReceiveBufferSize | MaxSize | +| ServerType | TypeFilter | +| Domain | MachineGroup | + +The objective is to enable multiple backup browser servers to effectively handle high browsing loads. If the request fails, the client MUST return the error received in the response to the higher layer. If the request succeeds, the client MUST return the resulting RapOutParams in the NetServerEnum2Response (as specified in \[MS-RAP\] section 2.5.5.2.2) to the caller. + +### Message Processing Events and Sequencing Rules + +A [**browser client**](#gt_8cb9694c-b014-426d-8463-66456517b15c) MUST ignore all CIFS Browser Protocol messages except [GetBackupListResponse](#Section_2d27295b3a8b4154951071867616a7cb). + +#### Retrieving a List of Backup Browser Servers + +When a [**browser client**](#gt_8cb9694c-b014-426d-8463-66456517b15c) needs to determine the set of [**backup browser servers**](#gt_71f76461-689e-4b50-befc-67f52ec4668b) for a particular machine group, the browser client MUST send a [GetBackupListRequest](#Section_2fa4f92f9c5947dc87b54333360f8593) [**frame**](#gt_1c54183d-33fa-463c-b929-e996d716e3bb) and check whether it receives a [GetBackupListResponse](#Section_2d27295b3a8b4154951071867616a7cb) frame. + +##### Sending a GetBackupListRequest Frame + +The caller MUST provide the [**NetBIOS name**](#gt_0334e0bd-2755-42f6-aeff-2d4a22bf4abf) of the machine group. + +The [**browser client**](#gt_8cb9694c-b014-426d-8463-66456517b15c) MUST set **MachineGroupNameInProgress** to the machine group provided. + +The browser client MUST send a [GetBackupListRequest](#Section_2fa4f92f9c5947dc87b54333360f8593) frame, as specified in section 2.2.4. When generating the GetBackupListRequest, the client MUST initialize **TokenValue**. How the client selects the token is implementation-defined. The token exists solely to allow the client to differentiate between [GetBackupListResponse](#Section_2d27295b3a8b4154951071867616a7cb) calls.[<28>](#Appendix_A_28) The client MUST then set the **Token** field of the GetBackupListRequest to **TokenValue**. + +The browser client MUST send the frame to the server by issuing a [**mailslot**](#gt_f53fe4b9-8e1d-4366-9254-3c4f73269e78) write as specified in [\[MS-MAIL\]](%5bMS-MAIL%5d.pdf#Section_8ea19aa46e5a4aedb6280b5cd75a1ab9) section 3.1.4.1, with the following parameters. + +| Parameter name | Value | +| --------------------------------- | ------------------------------------------- | +| NetBIOS name of the remote server | <machine group>\[0x1D\] | +| Mailslot name | \\MAILSLOT\\BROWSE | +| Data | GetBackupListRequest as specified in 2.2.4. | + +The client SHOULD ignore the error even if the send fails. After the [**browser**](#gt_f06aa0c1-29ec-4d3e-a4e2-e38e8f918933) request has been sent, the client MUST start the GetBackupListRequest timer. + +##### Receiving a GetBackupListResponse Frame + +After the [**local master browser server**](#gt_d294211f-7ae9-4faf-8644-f71c1fade2ca) responds with a list of [**backup browser servers**](#gt_71f76461-689e-4b50-befc-67f52ec4668b), the client SHOULD choose an implementation-defined number of servers from within the response by using an implementation-dependent algorithm, and then insert a new entry into **BackupBrowserServerTable** for the [**NetBIOS name**](#gt_0334e0bd-2755-42f6-aeff-2d4a22bf4abf) **MachineGroupNameInProgress** with the list of backup browser servers selected.[<29>](#Appendix_A_29) + +When a [GetBackupListResponse](#Section_2d27295b3a8b4154951071867616a7cb) frame is received, the corresponding timer MUST be stopped. Because a client can only have a single [GetBackupListRequest](#Section_2fa4f92f9c5947dc87b54333360f8593) pending, it needs only one timer. + +#### Receiving a NetServerEnum2 Response + +When the client receives a response to a NetServerEnum2 request that was sent to a server as specified in section [3.1.4.1](#Section_3e5fbd39bc73407b87e5a099a5cb6dc3), the client MUST continue processing as follows: + +- If the response indicates an error, the error MUST be returned to the application that requested the enumeration of servers. +- If the response indicates success, the list of servers or domains received in the response MUST be returned to the calling application. + +#### Sending a RequestElection Frame + +To force an election, the client MUST send a _RequestElection_ frame as specified in section [2.2.3](#Section_6c68cb9eedfc498481a858304a0b1c1d). The RequestElection Browser Frame MUST be sent by issuing a mailslot write as specified in [\[MS-MAIL\]](%5bMS-MAIL%5d.pdf#Section_8ea19aa46e5a4aedb6280b5cd75a1ab9) section 3.1.4.1 with the following parameters: + +| Parameter name | Value | +| --------------------------------- | ---------------------------------------------- | +| NetBIOS name of the remote server | <Machine Group Name>\[0x1E\] | +| Mailslot name | \\MAILSLOT\\BROWSE | +| Data | RequestElection as specified in section 2.2.3. | + +The server SHOULD ignore the error even if the send fails. + +### Timer Events + +When a [GetBackupListRequest](#Section_2fa4f92f9c5947dc87b54333360f8593) timer expires without receiving a [GetBackupListResponse](#Section_2d27295b3a8b4154951071867616a7cb), the GetBackupListRequest frame MAY be retransmitted. The delay MUST be at least twice the expected service time, which MUST be 1 second.[<30>](#Appendix_A_30) Before resending, the client MAY modify **TokenValue**.[<31>](#Appendix_A_31) If TokenValue is modified, the client MUST set the **Token** field of the GetBackupListRequest to the new value of **TokenValue**, and resend the GetBackupListRequest. + +If the local master [**browser**](#gt_f06aa0c1-29ec-4d3e-a4e2-e38e8f918933) for a machine group fails to respond to the GetBackupListRequest after an implementation-defined number of retries, the client MUST set the **Uptime** value with the time difference, in seconds, between the current time and **BrowserClientUpTime**, and the client MUST force an election by [Sending a RequestElection Frame](#Section_ff716dc43a2e453283b7a5745698c8d9), as specified in section 3.1.5.3. If the client is unable to retrieve a list of [**browser servers**](#gt_3bd1e44e-100e-4f13-ad44-fc267e627495) from the local master browser server, it MAY attempt to retrieve a list of [**backup browser servers**](#gt_71f76461-689e-4b50-befc-67f52ec4668b) by sending a GetBackupListRequest frame directly to the domain master browser for that [**domain**](#gt_b0276eb2-4e65-4cf1-a718-e0920a614aca) by using the [**unique name**](#gt_9e9e2d18-1945-48ac-9574-96de352d5122) <domain>\[0x1B\] that is registered by the domain master browser. The value of the retry count MUST be 3. + +### Other Local Events + +None. + +## Nonbrowser Server Details + +### Abstract Data Model + +This section describes a hypothetical model of [**nonbrowser server**](#gt_a0a691b5-ba43-46d5-ab2b-acb813ebb636) data organization that can be implemented to support the CIFS Browser Protocol. The purpose of this description is to help explain how this aspect of the protocol works. This specification does not prescribe that implementations adhere to this model, as long as their external behavior is consistent with the behavior described throughout this document. + +A nonbrowser server MUST implement the abstract data model for a server, as specified in [\[MS-RAP\]](%5bMS-RAP%5d.pdf#Section_fb8d5bd1e57c4be1b063ec31330bdd58). + +In addition to that information, the nonbrowser server MUST implement the following: + +**Server.HostAnnouncementCount:** The number of times the HostAnnouncement timer (as specified in section [3.2.2](#Section_c76cc35a7481439b9749610749d05533)) has expired. + +**Server.Comment:** A null-terminated [**ASCII**](#gt_79fa85ca-ac61-467c-b819-e97dc1a7a599) string that MUST be less than or equal to 43 bytes in length including the null terminator. + +### Timers + +[**Nonbrowser servers**](#gt_a0a691b5-ba43-46d5-ab2b-acb813ebb636) use the following timers: + +**HostAnnouncement timer:** Used to periodically advertise itself to the local master [**browser**](#gt_f06aa0c1-29ec-4d3e-a4e2-e38e8f918933) for its machine group. For more information about the HostAnnouncement timer, see section [3.2.6](#Section_b3ab99037158486982b0f44dda04a52e). + +**AnnouncementRequest response timer:** Used to delay responding to an AnnouncementRequest. For more information, see section [3.2.5.1](#Section_37e20e380d5a435c931d8d8e0d2ffb9b). + +### Initialization + +When a [**nonbrowser server**](#gt_a0a691b5-ba43-46d5-ab2b-acb813ebb636) starts up, it MUST start the HostAnnouncementTimer, as specified in section [3.2.2](#Section_c76cc35a7481439b9749610749d05533). Whenever the HostAnnouncementTimer fires, the nonbrowser server MUST issue a HostAnnouncement [**frame**](#gt_1c54183d-33fa-463c-b929-e996d716e3bb). + +A nonbrowser server MUST register the NetBIOS name <machine group>\[0x00\] corresponding to the domain or [**workgroup**](#gt_9d4eb51b-4b89-4814-be9c-394156ce5e78) within which the nonbrowser server resides. This makes it possible to receive AnnouncementRequest browser frames. + +All other [**browser**](#gt_f06aa0c1-29ec-4d3e-a4e2-e38e8f918933) messages sent to the nonbrowser server with different NetBIOS names MUST be ignored. + +The name <ServerName>\[0x00\] MUST be registered with NetBIOS by the server offering the service. + +### Higher-Layer Triggered Events + +#### Server Application Requests Updating Server Configuration + +The calling application provides the **SERVER_INFO_103** structure ([\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 2.2.4.43) as input parameter to update the server configuration. The following values MUST be set by the server: + +- **Server.Comment** MUST be set to sv103_comment. + +### Message Processing Events and Sequencing Rules + +A [**nonbrowser server**](#gt_a0a691b5-ba43-46d5-ab2b-acb813ebb636) MUST ignore all CIFS Browser Protocol messages except the [AnnouncementRequest](#Section_12ed4892b92c4f5f8242f839893954e3) browser frame. + +#### Receiving an AnnouncementRequest Frame + +On receiving an [AnnouncementRequest](#Section_12ed4892b92c4f5f8242f839893954e3) frame, a [**nonbrowser server**](#gt_a0a691b5-ba43-46d5-ab2b-acb813ebb636) MUST generate a random number in the range of \[0, 30\] seconds. It MUST then set its AnnouncementRequest response timer to that value. + +#### Sending a HostAnnouncement Frame + +To advertise its presence on the network, the server MUST send a HostAnnouncement frame (as specified in section [2.2.1](#Section_105366778a144726bc52c0ef39cb7130)). The server MUST query the current services as specified in [\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 3.1.6.11, and set the **ServerType** field of the HostAnnouncement frame to the value returned, which specifies the type of resources or services that it is advertising. The server MUST set the **Comment** field of the HostAnnouncement frame to **Server.Comment**. This request MUST be sent by issuing a mailslot write as specified in [\[MS-MAIL\]](%5bMS-MAIL%5d.pdf#Section_8ea19aa46e5a4aedb6280b5cd75a1ab9) section 3.1.4.1 with the following parameters. + +| Parameter name | Value | +| --------------------------------- | ---------------------------------------------- | +| NetBIOS name of the remote server | <Machine Group Name>\[0x1D\] | +| Mailslot name | \\MAILSLOT\\BROWSE | +| Data | HostAnnouncement as specified in section 2.2.1 | + +The server SHOULD continue processing as described below even if the send fails. + +### Timer Events + +When either the [HostAnnouncement](#Section_105366778a144726bc52c0ef39cb7130) or [AnnouncementRequest](#Section_12ed4892b92c4f5f8242f839893954e3) response timer expires, a [**nonbrowser server**](#gt_a0a691b5-ba43-46d5-ab2b-acb813ebb636) MUST send a HostAnnouncement frame, as specified in section [3.2.5.2](#Section_9bbd54b40f894b008976247cc9d17f31). + +When the HostAnnouncement timer fires, it SHOULD reset the HostAnnouncement timer based on the following table (as specified in section [3.2.1](#Section_99ce879d612b47c29d51f8a713aed86f)).[<32>](#Appendix_A_32) + +| Server.HostAnnouncementCount value | New HostAnnouncement timer value | +| ---------------------------------- | -------------------------------- | +| 0, 1 | 1 minute | +| 2 | 2 minutes | +| 3 | 4 minutes | +| 4 | 8 minutes | +| \> 4 | 12 minutes | + +### Other Local Events + +A [**nonbrowser server**](#gt_a0a691b5-ba43-46d5-ab2b-acb813ebb636) MUST send a [HostAnnouncement](#Section_105366778a144726bc52c0ef39cb7130) frame (as specified in section [3.2.5.2](#Section_9bbd54b40f894b008976247cc9d17f31)) that specifies a server type of zero, just prior to shutting down, to allow it to be quickly removed from the list of available servers. + +## Browser Server Details + +A [**browser server**](#gt_3bd1e44e-100e-4f13-ad44-fc267e627495) MUST follow all the rules for a [**nonbrowser server**](#gt_a0a691b5-ba43-46d5-ab2b-acb813ebb636), in addition to the rules specified in this section. A browser server MUST follow the state machine shown in the following figure.[<33>](#Appendix_A_33) + +![Browser server state machine](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAY8AAAF/CAYAAACxCEX+AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAACwUAAAsUAZpU61kAADuOSURBVHhe7Z0rtN3GFYYvKDAIMAgwCAgwCCgICAgwKCgIMCgpCAgIKAgMMDAIDCgIKCgICDAIKSgwKCgoDCwoKDAIKCgsMCi97Xd8f3t7LOnosfWa+b+1Zp0jaaQj6Yz2P3vPQze3xhhjzEQsHuY1//73v29/+OGH29/85je3v/rVr24fPHhwe3Nz01T68MMPL9f+5Zdf3v7444+3//3vf+/ujjEmYvEwt//5z39uv/7664tYYDT//Oc/3/7tb3+7iElr/Pzzz5drR0Q///zzyz359ttvLSLGFFg8GgehoLb93Xff3a0xEYT16dOntx9//PHt3//+97u1xhiLR8NQoyZEhYE0w/zzn/+8/fTTT2//8pe/3K0xpm0sHo2Cp/HVV1/dLc2DmrjSniGuFy9e3H3r5+XLl7d//OMf75bmQejqs88+u4S1jGkdi0eDYPwwgkvj+A8fPrx99OjR60R7yTXYZyl4SzGExO9eExDyc45LwUsjhEXbiDEtY/FoDAQD40cYZikIgYw4NXuWZcTxRKjpP3v27LIM5NU+0fjznRBaFACOR2Jd3MY6RIDj6hhxP74jjvx2+RsZ4gG0EyFgxrSMxaMxCFfRsyqDKB6AcWYZ4802jP6TJ09eG20MutaTAK+BxDIGWev5JC/rOAbfOa6OzTrySEx0Hsqv4/EdMsUD3IBuWmeyeOCuZ9RazT5kGj2MuDwAhEHGmc/nz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DswQb0yoWj0bhDXiepG86vK+DqeCNaR2LR6MQtqIG7bj9eGgvcldnY15h8WgYBITwFe+bYMpw0426OLujgTFvsHiYyzuveesdtWq+uzH99jJ+g0GVCCvCgYAYY95g8TAXEAwZy3v37t3ev3//EtZqMen6JabGmHexeJhOqHnTo6jFZM/LmGvc3v4PF9LnuhcpqgMAAAAASUVORK5CYII=) + +Figure 2: Browser server state machine + +- This transition occurs when a local master browser that is not a domain controller (IsDomainController=False) loses an election or when a local master browser receives a ResetState request with type set to RESET_STATE_CLEAR_ALL or RESET_STATE_STOP_MASTER. +- This transition occurs when a backup browser receives a ResetState request with type set to RESET_STATE_CLEAR_ALL. +- This transition occurs when a local master browser that is a domain controller (IsDomainController=TRUE) or that is configured to behave as a domain controller (AlwaysActAsdomainController = TRUE) loses an election. +- This transition occurs when any browser role is terminated. + +For each state, an additional flag MUST be set, as shown in the following table. + +| State | ServerType flag set | +| -------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| Backup [**browser**](#gt_f06aa0c1-29ec-4d3e-a4e2-e38e8f918933) | SV_TYPE_BACKUP_BROWSER, as specified in [\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 2.2.2.7 (BB) | +| Local master browser | SV_TYPE_MASTER_BROWSER, as specified in \[MS-SRVS\] section 2.2.2.7 (MB) | +| Potential Browser | SV_TYPE_POTENTIAL_BROWSER, as specified in \[MS-SRVS\] section 2.2.2.7 (PB) | + +If the [**primary domain controller**](#gt_663cb13a-8b75-477f-b6e1-bea8f2fba64d) assumes the Local master browser role, it MUST act as a [**domain master browser server**](#gt_ef026994-26e6-4c9d-b34b-dfb7f1f80d6f) for its [**subnet**](#gt_c009a34c-e834-4a3e-9514-e611a6ad52fe), as specified in section [3.4](#Section_8e18326b26a24790a914d69f64250eb4). + +When a [**local master browser server**](#gt_d294211f-7ae9-4faf-8644-f71c1fade2ca) starts, its Servers List can be empty; therefore, it MAY force all browser servers to announce themselves. The local master browser server does this by broadcasting an [AnnouncementRequest (section 2.2.2)](#Section_12ed4892b92c4f5f8242f839893954e3) browser [**frame**](#gt_1c54183d-33fa-463c-b929-e996d716e3bb).[<34>](#Appendix_A_34) + +The AnnouncementRequest frame MUST be broadcast by using the NetBIOS [**group name**](#gt_362f32fb-b6fc-4e9e-beb9-a1347754ed3e) <machine group>\[0x00\]. The frame MUST be sent to the mailslot \\MAILSLOT\\BROWSE. + +For more details regarding ServerType flag values, see \[MS-SRVS\] section 2.2.3.7. + +### Abstract Data Model + +This section describes a sample model of [**browser server**](#gt_3bd1e44e-100e-4f13-ad44-fc267e627495) data organization that can be implemented to support this protocol. The purpose of this description is simply to help explain how this aspect of the protocol works. This specification does not prescribe that implementations adhere to this model as long as their external behavior is consistent with what is described throughout this document. + +**AlwaysActAsDomainController:** A Boolean that specifies if the machine on which the browser server is running has to behave as a domain controller for Browser protocol interactions regardless of whether the server truly is a domain controller. This element SHOULD be set locally by a principal with administrative privileges, and is not shared with other protocols.[<35>](#Appendix_A_35) + +**Backup Browser List:** A list of the machines that the local master [**browser**](#gt_f06aa0c1-29ec-4d3e-a4e2-e38e8f918933) has designated as backup browser servers. + +**BrowserServerUpTime:** Records the time when the Browser service was initially started. + +**Current Role:** The current state in the browser server state machine shown in the preceding figure. + +**Machine Group Name**: The [**NetBIOS name**](#gt_0334e0bd-2755-42f6-aeff-2d4a22bf4abf) of the machine group the client is a member of. + +**DomainAnnouncement Timer Count:** A count of the number of times that the DomainAnnouncement timer has expired. It MUST be reset to 0 after a browser wins an election. + +**LocalMasterAnnouncement Timer Count:** A count of the number of times that the LocalMasterAnnouncement timer has expired. It SHOULD be reset to 0 after a browser wins an election.[<36>](#Appendix_A_36) + +**MasterAnnouncement Timer Count:** A count of the number of times that the MasterAnnouncement timer has expired. It MUST be reset to 0 after a browser wins an election. + +**Machine Groups List:** An ordered list of machine groups; each entry MUST contain a [**domain**](#gt_b0276eb2-4e65-4cf1-a718-e0920a614aca) or [**workgroup**](#gt_9d4eb51b-4b89-4814-be9c-394156ce5e78) name, the name of the Local Master browser for that machine group (as received in the DomainAnnouncement frame specified in section [2.2.7](#Section_7401bb1bafee499284baee34fcb6409f)) and a Machine Group Expiration Timer for each machine group. The ordering of the list is implementation defined, but the order MUST be stable, and the list MUST NOT contain entries with duplicate names. The Machine Groups List MUST be ordered to implement the semantics of the NetServerEnum3 request (which specifies a resume point). For details of NetServerEnum2 and NetServerEnum3 as they are used here, see section [3.3.5.6](#Section_995d4fc31e1e4f5095fe190674021266).[<37>](#Appendix_A_37) + +**Election Transmission Count:** A count of the number of RequestElection frames sent by the browser server during an election. The election transmission count MUST be reset on each election. + +**IsDomainController:** A Boolean that specifies if the machine on which the browser server is running is a [**domain controller**](#gt_76a05049-3531-4abd-aec8-30e19954b4bd). + +**IsPrimaryDomainController:** A Boolean that specifies if the machine on which the browser server is running is the [**primary domain controller**](#gt_663cb13a-8b75-477f-b6e1-bea8f2fba64d) (TRUE) or a [**backup domain controller**](#gt_ce1138c6-7ab4-4c37-98b4-95599071c3c3) (FALSE).[<38>](#Appendix_A_38) + +**Servers List:** An ordered list of servers and HostAnnouncementCount values (as specified in section [3.2.1](#Section_99ce879d612b47c29d51f8a713aed86f)), as provided in [HostAnnouncement](#Section_105366778a144726bc52c0ef39cb7130) frames. The ordering of the list is implementation defined, but the order MUST be stable and the list MUST NOT contain entries with duplicate names. The Servers List element MUST be ordered to implement the semantics of the NetServerEnum3 request (section 3.3.5.6), which specifies a resume point.[<39>](#Appendix_A_39) + +**OtherDomains:** Specifies a list of NetBIOS names of domains browsed by the computer. Each name MUST be at most 15 characters in length, and MUST NOT contain trailing spaces or a [**NetBIOS suffix**](#gt_e0056bac-be0a-488d-86b2-eec9c6bfb947) as defined in section [2.1.1](#Section_940f299f669f4a0b84119ead7e2f31ec). The **OtherDomains** element is shared with the Workstation Service Remote Protocol Specification [\[MS-WKST\]](%5bMS-WKST%5d.pdf#Section_5bb08058bc364d3cabebb132228281b7), modified through the WkstaAddOtherDomains event (section 3.2.6.2). This element is also shared with the Common Internet File System (CIFS) Browser Auxiliary Protocol [\[MS-BRWSA\]](%5bMS-BRWSA%5d.pdf#Section_5995d2f2fff140af9100ca67794d50a5) to query the **OtherDomains** information from a domain controller. + +Be aware that the preceding model can be implemented using a variety of techniques. An implementation can implement such data in any way. + +### Timers + +**DomainAnnouncement Timer:** Used by a local master [**browser**](#gt_f06aa0c1-29ec-4d3e-a4e2-e38e8f918933) to periodically announce itself to [**local master browser servers**](#gt_d294211f-7ae9-4faf-8644-f71c1fade2ca) of other machine groups on the [**subnet**](#gt_c009a34c-e834-4a3e-9514-e611a6ad52fe) by sending a DomainAnnouncement frame, as specified in section [2.2.7](#Section_7401bb1bafee499284baee34fcb6409f). For more information about the DomainAnnouncement timer, see section [3.3.6](#Section_eb955ab5470a4810b18e6c3659a5199e).[<40>](#Appendix_A_40) + +**DomainControllerRoleMonitor Timer:** The DomainControllerRoleMonitor timer is used to periodically check for changes to the configuration of the machine on which the [**browser server**](#gt_3bd1e44e-100e-4f13-ad44-fc267e627495) is running. The timer monitors for situations where the machine is promoted (from a backup domain controller to a primary domain controller), or is demoted (from a primary domain controller to a backup domain controller). An implementation that supports a notification mechanism for domain controller role changes, can instead process these changes on notification.[<41>](#Appendix_A_41) + +**Machine Group Expiration Timer:** For each entry in the machine groups list that is created or updated by DomainAnnouncement frames, the local [**master browser server**](#gt_542ffc1e-9bbc-47f9-a6ca-284d0a39c680) keeps a Machine Group Expiration Timer. This timer MUST be initialized to the **Periodicity** field value found in the DomainAnnouncement. + +**Election Delay Timer:** The browser server keeps an election delay timer for use in elections. The value is specified in section [3.3.5.8](#Section_557253965304455caf5b3224e238b2e0). + +**FindMaster Timer:** Used when a browser server must find a local master browser for the machine group of the browser server. This timer value MUST be 1500 milliseconds (msec). + +**LocalMasterAnnouncement Timer:** Used to periodically advertise the local master browser to all the machines in the machine group on the local subnet by sending a [LocalMasterAnnouncement (section 2.2.9)](#Section_91575c1a07a04d278aa5a11698552c40) frame. For more information about the LocalMasterAnnouncement timer, see section 3.3.6.[<42>](#Appendix_A_42) + +**MasterAnnouncement Timer:** Used to periodically advertise the local master browser to the domain master browser by sending a [MasterAnnouncementBrowser (section 2.2.8)](#Section_1dc94e16c4a94a6e93f97f2e64d273b7) frame. For more information about the MasterAnnouncementBrowser timer, see section 3.3.6 . If the local master browser is not a member of a domain, this timer MUST be ignored. The default value for this timer MUST be 12 minutes.[<43>](#Appendix_A_43) + +**NetServerEnum2 Timer:** Used to periodically allow the [**backup browser server**](#gt_71f76461-689e-4b50-befc-67f52ec4668b) to refresh its list of servers from the local master browser server or local master browser servers to refresh their Servers List elements from the [**domain master browser server**](#gt_ef026994-26e6-4c9d-b34b-dfb7f1f80d6f). The NetServerEnum2 timer SHOULD control the accuracy of the information in the browser server lists. If the NetServerEnum2 timer duration is low, the information in the Servers List element SHOULD be more accurate, but the load on the local master browser server (or domain master browser server) MAY be higher. If the NetServerEnum2 timer duration is high, the information in the Servers List element SHOULD be less accurate, but the load on the local master browser server (or domain master browser server) MAY be higher. The default value for this timer is 12 minutes.[<44>](#Appendix_A_44) + +**Server Expiration Timer:** For each server entry in the Servers List element that is created or updated by [HostAnnouncements (section 3.3.5.3)](#Section_b17dc0899e9643f693ee9ed9c96beada)), the local master browser server keeps a Server Expiration Timer. This timer MUST be initialized to the **Periodicity** field value found in the HostAnnouncement. + +### Initialization + +The [**browser server**](#gt_3bd1e44e-100e-4f13-ad44-fc267e627495) MUST register NetBIOS names <Machine Group Name>\[0x00\] and <Machine Group Name>\[0x1E\]. Information on how to register NetBIOS names is as specified in [\[RFC1001\]](https://go.microsoft.com/fwlink/?LinkId=90260). + +**Current Role** MUST be initialized to [**potential browser server**](#gt_eac2d668-c72a-4030-af54-775f11815cd5). + +**BrowserServerUpTime** is set to the time when the Browser service was initially started. + +**Backup Browser List** MUST be initialized to an empty list. + +**Machine Group Name**: MUST be set to the [**NetBIOS name**](#gt_0334e0bd-2755-42f6-aeff-2d4a22bf4abf) of the domain or workgroup the client is a member of. + +**Machine Groups List** MUST be initialized to an empty list. + +**DomainAnnouncement Timer Count** MUST be set to 0. + +**LocalMasterAnnouncement Timer Count** MUST be set to 0. + +**MasterAnnouncement Timer Count** MUST be set to 0. + +The server MUST enable advertising of the browser service by invoking [\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 3.1.6.9, passing SV_TYPE_POTENTIAL_BROWSER as the input parameter. + +The browser server MUST query the current domain role for the machine on which it is running by calling SamrQueryInformationDomain as specified in [\[MS-SAMR\]](%5bMS-SAMR%5d.pdf#Section_4df07fab1bbc452f8e927853a3c7e380) section 3.1.5.5.2. + +The browser server first performs a **SamrConnect** using its own name as the server name and an access mask of SAM*SERVER_CONNECT. The out parameter \_ServerHandle* is used to perform a **SamrQueryInformationDomain** using the DomainServerRoleInformation value (as specified in \[MS-SAMR\] section 2.2.3.16). The returned buffer contains a **DOMAIN_SERVER_ROLE_INFORMATION** structure (see \[MS-SAMR\] section 2.2.3.1 for a detailed explanation of the fields). + +If the call succeeds, the **IsDomainController** and **IsPrimaryDomainController** SHOULD be initialized based on the **DomainServerRole** value in the returned **SAMPR_DOMAIN_GENERAL_INFORMATION** structure as specified in the following table.[<45>](#Appendix_A_45) + +For DomainServerRole: + +| Enumeration DOMAIN_SERVER_ROLE value | unsigned long value | +| ------------------------------------------------------------------------------------------------------------------ | ------------------- | +| DomainServerRoleBackup

**IsDomainController** set to TRUE

**IsPrimaryDomainController** set to FALSE | 2 | +| DomainServerRolePrimary

**IsPrimaryDomainController** set to TRUE

**IsDomainController** set to TRUE | 3 | + +If **IsDomainController** is TRUE, the server MUST set the **DomainControllerRoleMonitor Timer** to 1 second. + +If **IsPrimaryDomainController** is TRUE, the server MUST force an election by sending a [RequestElection](#Section_6c68cb9eedfc498481a858304a0b1c1d) (section 2.2.3) frame. It MUST set the preferred master bit in the Criteria in all RequestElection frames it sends. + +If **IsPrimaryDomainController** is FALSE, the server MUST send a [HostAnnouncement](#Section_105366778a144726bc52c0ef39cb7130) frame as specified in [3.2.5.2](#Section_9bbd54b40f894b008976247cc9d17f31), and if a [BecomeBackup](#Section_0901905abff941b29ab09176d26cb91f) frame is received, it MUST become a backup server.[<46>](#Appendix_A_46) + +The server MUST disable advertising of the service by invoking \[MS-SRVS\] section 3.1.6.10, passing SV_TYPE_DOMAIN_CTRL and SV_TYPE_DOMAIN_BAKCTRL as input parameters. + +If **IsPrimaryDomainController** is TRUE, the server MUST enable advertising of the PDC service as specified in \[MS-SRVS\] section 3.1.6.9, passing SV_TYPE_DOMAIN_CTRL as the input parameter. + +If **IsDomainController** is TRUE but **IsPrimaryDomainController** is FALSE, the server MUST enable advertising as a domain controller as specified in \[MS-SRVS\] section 3.1.6.9, passing SV_TYPE_DOMAIN_BAKCTRL as the input parameter. + +If both **IsDomainController** and **IsPrimaryDomainController** are FALSE, the server SHOULD[<47>](#Appendix_A_47) enable advertising of the NT service as specified in \[MS-SRVS\] section 3.1.6.9, passing SV_TYPE_SERVER_NT as the input parameter. + +### Higher-Layer Triggered Events + +#### PromotedToPrimaryDomainController + +If a [**browser server**](#gt_3bd1e44e-100e-4f13-ad44-fc267e627495) gets promoted to [**primary domain controller (PDC)**](#gt_663cb13a-8b75-477f-b6e1-bea8f2fba64d), it MUST force an election by [Sending a RequestElection Frame](#Section_0e918944016c450ba49152d3394e2cdc) as specified in section 3.3.5.11. + +The server SHOULD continue processing as described below even if the send fails. + +The server MUST assume the duties of a [**domain master browser**](#gt_6cf61580-c702-4c40-9692-88e9986bff1a), as specified in section [3.4](#Section_8e18326b26a24790a914d69f64250eb4). + +#### LocalRequestForServerList + +If the machine is a [**backup browser server**](#gt_71f76461-689e-4b50-befc-67f52ec4668b) or a [**master browser server**](#gt_542ffc1e-9bbc-47f9-a6ca-284d0a39c680), it MUST return Servers List to the calling application. Otherwise the request MUST be failed with ERROR_REQ_NOT_ACCEP. + +#### ShutdownBrowserServer + +If a local administrator requests that the [**browser server**](#gt_3bd1e44e-100e-4f13-ad44-fc267e627495) shuts down, the browser server MUST take the shutdown action as specified in section [3.3.7](#Section_fa094f6690d243f187de5e1f8a89f359). + +### Message Processing Events and Sequencing Rules + +After receiving a CIFS Browser Protocol frame, the opcode MUST first be inspected to determine the message type. If the opcode is not defined in this specification, the frame MUST be silently ignored. If the opcode is recognized, the [**browser server**](#gt_3bd1e44e-100e-4f13-ad44-fc267e627495) MUST then determine if the message is correctly formatted as specified in section [2.2](#Section_0e74d70edcf7422e8285e2e193f363d9). Because messages are transmitted as datagrams, malformed messages MUST be silently ignored.[<48>](#Appendix_A_48) + +A browser server MUST ignore the [GetBackupListResponse](#Section_2d27295b3a8b4154951071867616a7cb) frame. Correctly formed frames MUST then be processed as specified in the following subsections. + +#### Receiving a BecomeBackup Frame + +The [**local master browser server**](#gt_d294211f-7ae9-4faf-8644-f71c1fade2ca) MUST send a BecomeBackup frame to a [**potential browser server**](#gt_eac2d668-c72a-4030-af54-775f11815cd5) when it determines that the number of current [**backup browser servers**](#gt_71f76461-689e-4b50-befc-67f52ec4668b) for the machine group on the local master browser server's [**subnet**](#gt_c009a34c-e834-4a3e-9514-e611a6ad52fe) does not meet the criteria as specified in section [3.3.5.7](#Section_ca95bb43405e4499860217131d7ebc7e). + +A [**browser server**](#gt_3bd1e44e-100e-4f13-ad44-fc267e627495) that receives a BecomeBackup frame MUST attempt to become a backup [**browser**](#gt_f06aa0c1-29ec-4d3e-a4e2-e38e8f918933). + +If the browser server is incapable of becoming a backup (for example, because it is overloaded), the browser server MUST shut down as specified in section [3.3.7](#Section_fa094f6690d243f187de5e1f8a89f359). + +If the browser server does not recognize the name of the local master browser for its machine group, it MUST start the FindMaster timer and send an [AnnouncementRequest](#Section_12ed4892b92c4f5f8242f839893954e3) frame request by issuing a mailslot write as specified in [\[MS-MAIL\]](%5bMS-MAIL%5d.pdf#Section_8ea19aa46e5a4aedb6280b5cd75a1ab9) section 3.1.4.1, passing in the following parameters. + +| Parameter name | Value | +| --------------------------------- | -------------------------------------------------- | +| NetBIOS name of the remote server | <Machine Group Name>\[0x1D\] | +| Mailslot name | \\MAILSLOT\\BROWSE | +| Data | AnnouncementRequest as specified in section 2.2.2. | + +The server SHOULD continue processing as described below even if the send fails. + +If the FindMaster timer expires before the server receives a [LocalMasterAnnouncement](#Section_91575c1a07a04d278aa5a11698552c40) frame, the browser server MUST issue another AnnouncementRequest frame request to <Machine Group Name>\[0x1D\] and reset the FindMaster timer. If the server issues an implementation-defined number of FindMaster frame requests without receiving a LocalMasterAnnouncement frame response, then the server MUST send a [RequestElection](#Section_6c68cb9eedfc498481a858304a0b1c1d) frame as specified in section [3.3.5.11](#Section_0e918944016c450ba49152d3394e2cdc). + +The server SHOULD continue processing as described below even if the send fails. + +For more information on the election process, see section [3.3.5.8](#Section_557253965304455caf5b3224e238b2e0).[<49>](#Appendix_A_49) + +The browser server MUST set Current Role to backup browser server. The browser server MUST enable advertising of the backup browser service as specified in [\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 3.1.6.9, passing SV_TYPE_BACKUP_BROWSER as the input parameter. If the browser server does not have a server list, it MUST attempt to retrieve a list of servers from the master browser for the machine group. If successful, the new backup browser MUST immediately send a [HostAnnouncement Frame](#Section_105366778a144726bc52c0ef39cb7130) as specified in section [3.2.5.2](#Section_9bbd54b40f894b008976247cc9d17f31), with the **Flags** field in the announcement reflecting the new state of the browser.[<50>](#Appendix_A_50) + +The server SHOULD continue processing as described below even if the send fails. + +Note that after the master browser receives the HostAnnouncement frame, it MUST hand out this browser server name in GetBackupListResponse frames, and clients will contact this browser server as if it were a backup browser server. + +A [**nonbrowser server**](#gt_a0a691b5-ba43-46d5-ab2b-acb813ebb636) that receives a BecomeBackup frame MUST ignore the frame, as specified in section [3.2.5](#Section_3848011c5ad74b8e8ef7a29d803625f8). Similarly, a browser server whose Current Role is equal to backup browser server receives a BecomeBackup frame MUST ignore the frame. + +#### Receiving a LocalMasterAnnouncement Frame + +A [**browser server**](#gt_3bd1e44e-100e-4f13-ad44-fc267e627495) can discover the [**master browser server**](#gt_542ffc1e-9bbc-47f9-a6ca-284d0a39c680) for a machine group by issuing an [AnnouncementRequest (section 2.2.2)](#Section_12ed4892b92c4f5f8242f839893954e3) frame to the name <Machine Group Name>\[0x1D\]. + +A [LocalMasterAnnouncement](#Section_91575c1a07a04d278aa5a11698552c40) frame MUST be processed as follows: + +- If the browser server whose Current Role is equal to [**backup browser server**](#gt_71f76461-689e-4b50-befc-67f52ec4668b), it MUST update the name of the local master [**browser**](#gt_f06aa0c1-29ec-4d3e-a4e2-e38e8f918933) that sent it in the Machine Groups list, adding a new entry if one does not exist. +- If the Local master browser server with **IsPrimaryDomainController** set to TRUE receives a LocalMasterAnnouncement frame with the SV_TYPE_MASTER_BROWSER (MB) flag set, it MUST continue to be in the same state and send a [RequestElection](#Section_6c68cb9eedfc498481a858304a0b1c1d) frame as specified in section [3.3.5.11](#Section_0e918944016c450ba49152d3394e2cdc). + +The server SHOULD continue processing as described below even in the send fails. + +- If the Local master browser with **IsPrimaryDomainController** set to FALSE receives a LocalMasterAnnouncement frame with the SV_TYPE_MASTER_BROWSER (MB) flag set from a domain controller, it MUST unregister the NetBIOS unique name <machine group>\[0x1D\] so that the announcing browser server can successfully register it, set Current Role to [**potential browser server**](#gt_eac2d668-c72a-4030-af54-775f11815cd5), and it MUST empty all elements in the Backup Browser List. The browser server MUST disable advertising of the master browser service as specified in [\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 3.1.6.10, passing SV_TYPE_MASTER_BROWSER as the input parameter. +- For any other browser server state, if it receives a LocalMasterAnnouncement frame with the SV_TYPE_MASTER_BROWSER (MB) flag set, ignore the frame and continue to be in the same state. + +#### Receiving a HostAnnouncement Frame + +[**Nonbrowser servers**](#gt_a0a691b5-ba43-46d5-ab2b-acb813ebb636) and [**browser servers**](#gt_3bd1e44e-100e-4f13-ad44-fc267e627495) periodically (see section [3.2.6](#Section_b3ab99037158486982b0f44dda04a52e)) send [HostAnnouncement](#Section_105366778a144726bc52c0ef39cb7130) frames to inform the local master [**browser**](#gt_f06aa0c1-29ec-4d3e-a4e2-e38e8f918933) for the machine group about the status of the server. + +Browser servers receiving the HostAnnouncement frame that are not the local master browser MUST ignore the [**frame**](#gt_1c54183d-33fa-463c-b929-e996d716e3bb). + +If the Local master browser server with **IsPrimaryDomainController** set to TRUE receives a HostAnnouncement frame with the SV_TYPE_MASTER_BROWSER (MB) flag set, it MUST continue to be in the same state and send a [RequestElection (section 2.2.3)](#Section_6c68cb9eedfc498481a858304a0b1c1d) as specified in section [3.3.5.11](#Section_0e918944016c450ba49152d3394e2cdc). + +The server SHOULD continue processing as described below even if the send fails. + +If the Local master browser with IsPrimaryDomainController set to FALSE receives a HostAnnouncement frame with the SV_TYPE_MASTER_BROWSER (MB) flag set from a domain controller, then the browser server MUST do the following: + +- It MUST set Current Role to Potential browser server, and it MUST disable advertising of the master browser service as specified in [\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 3.1.6.10, passing SV_TYPE_MASTER_BROWSER as the input parameter. +- It MUST unregister the NetBIOS unique name <Machine Group Name>\[0x1D\] so that the announcing browser server can successfully register it. +- It MUST empty all elements in the Backup Browser List. + +For any other browser server state, if it receives a HostAnnouncement frame with the SV_TYPE_MASTER_BROWSER (MB) flag set, ignore the frame and continue to be in the same state. + +The local master browser that receives this request MUST update the Servers List as follows: + +- If an entry exists in the Servers List for the ServerName specified in the received HostAnnouncement, the [**local master browser server**](#gt_d294211f-7ae9-4faf-8644-f71c1fade2ca) MUST reset the ServerExpirationTimer for this entry and MUST increment the HostAnnouncementCount. +- If an entry does not exist in the Servers List for the ServerName specified in the received HostAnnouncement, the local master browser server MUST insert a new entry into the list for the Name received with HostAnnouncementCount equal to 1, and MUST create a ServerExpirationTimer for this entry. + +If the ServerType in the HostAnnouncement indicates it is a [**backup browser server**](#gt_71f76461-689e-4b50-befc-67f52ec4668b) and the server is not currently present in the Backup Browser List, the machine MUST be added to the Backup Browser List. + +Upon receipt of a HostAnnouncement, if the number of backup browser servers is not sufficient for the machine group, the local master browser SHOULD send out [BecomeBackup (section 2.2.6)](#Section_0901905abff941b29ab09176d26cb91f) packets according to the behavior as specified in section [3.3.5.7](#Section_ca95bb43405e4499860217131d7ebc7e). The server MUST send the BecomeBackup packet by issuing a mailslot write as specified in [\[MS-MAIL\]](%5bMS-MAIL%5d.pdf#Section_8ea19aa46e5a4aedb6280b5cd75a1ab9) section 3.1.4.1 with the following parameters. + +| Parameter name | Value | +| --------------------------------- | ----------------------------------------------- | +| NetBIOS name of the remote server | <server to be promoted to backup>\[0x00\] | +| Mailslot name | \\MAILSLOT\\BROWSE | +| Data | BecomeBackup as specified in section 2.2.6 | + +The server SHOULD ignore the error even if the send fails. + +#### Receiving a DomainAnnouncement Frame + +[**Local master browser servers**](#gt_d294211f-7ae9-4faf-8644-f71c1fade2ca) periodically send DomainAnnouncement frames to inform the local master [**browsers**](#gt_f06aa0c1-29ec-4d3e-a4e2-e38e8f918933) for other machine groups on the [**subnet**](#gt_c009a34c-e834-4a3e-9514-e611a6ad52fe) about the status of the machine group. (For more details on the timers related to this process, see section [3.3.6](#Section_eb955ab5470a4810b18e6c3659a5199e).) + +[**Browser servers**](#gt_3bd1e44e-100e-4f13-ad44-fc267e627495) receiving the DomainAnnouncement frame that are not the local master browser MUST ignore the frame. + +The local master browsers receiving the request MUST update the machine groups list with the information included in the DomainAnnouncement as follows: + +- If an entry for the received MachineGroup exists in **Machine Groups List**, the server MUST set the name of the local master browser for that entry to the LocalMasterBrowserName in the DomainAnnouncement request, and MUST reset the Machine Group Expiration Timer for this entry to (value received in the Periodicity field of the DomainAnnouncement request) x 3. +- If an entry does not exist, the server MUST create a new entry and insert it into the list. The machine group in the entry MUST be set to MachineGroup in the received DomainAnnouncement request, the local master browser for that entry MUST be set to the LocalMasterBrowserName of the request, and the Machine Group Expiration Timer MUST be set with (the Periodicity value received in the request) x 3. + +The local master browser MUST reset the **Machine Groups List** Machine Group Expiration Timer. + +#### Receiving a GetBackupListRequest Frame + +A [**browser server**](#gt_3bd1e44e-100e-4f13-ad44-fc267e627495) whose Current Role is not equal to local master browser MUST ignore this request. + +The local master [**browser**](#gt_f06aa0c1-29ec-4d3e-a4e2-e38e8f918933) MUST reply with a [GetBackupListResponse Browser Frame](#Section_2d27295b3a8b4154951071867616a7cb) that contains a list of [**backup browser servers**](#gt_71f76461-689e-4b50-befc-67f52ec4668b) for the machine group, as specified in section [3.3.5.9](#Section_992e6c5b43f04fdaa4f5e075471af6f8). The server MUST send the GetBackupListResponse Browser Frame by issuing a mailslot write, as specified in [\[MS-MAIL\]](%5bMS-MAIL%5d.pdf#Section_8ea19aa46e5a4aedb6280b5cd75a1ab9) section 3.1.4.1, with the following parameters: + +| Parameter name | Value | +| --------------------------------- | ------------------------------------------------------------------ | +| NetBIOS name of the remote server | <client that issued the request>\[0x00\] | +| Mailslot name | \\MAILSLOT\\BROWSE | +| Data | GetBackupListResponse Browser Frame as specified in section 2.2.5. | + +#### Receiving a NetServerEnum2 or NetServerEnum3 Request + +[**Browser clients**](#gt_8cb9694c-b014-426d-8463-66456517b15c) issue NetServerEnum2 or NetServerEnum3 Remote Administration Protocol requests, as specified in [\[MS-RAP\]](%5bMS-RAP%5d.pdf#Section_fb8d5bd1e57c4be1b063ec31330bdd58), to retrieve the list of servers or machine groups. + +[**Browser servers**](#gt_3bd1e44e-100e-4f13-ad44-fc267e627495) receiving the NetServerEnum2 or NetServerEnum3 request whose **Current Role** is equal to [**Potential Browser Server**](#gt_eac2d668-c72a-4030-af54-775f11815cd5) MUST respond with Win32ErrorCode set to ERROR_REQ_NOT_ACCEP (as specified in [\[MS-ERREF\]](%5bMS-ERREF%5d.pdf#Section_1bc92ddfb79e413cbbaa99a5281a6c90)). + +If the incoming NetServerEnum2 or NetServerEnum3 request specifies the SV*TYPE_LOCAL_LIST_ONLY flag in the \_ServerType* parameter (as specified in \[MS-RAP\] section 2.5.5.2.1), the browser server MUST restrict the list of servers and machine groups returned to the client to the servers and machine groups on the same [**subnet**](#gt_c009a34c-e834-4a3e-9514-e611a6ad52fe) as the browser server. + +If the _ServerType_ parameter of the incoming NetServerEnum2 or NetServerEnum3 request specifies the SV_TYPE_DOMAIN_ENUM flag, and any other field in the **ServerType** field is set, the browser server MUST respond with the Win32ErrorCode set to ERROR_INVALID_FUNCTION (as specified in \[MS-ERREF\] section 2.2). + +If the incoming NetServerEnum2 or NetServerEnum3 request specifies the SV*TYPE_DOMAIN_ENUM flag in the \_ServerType* parameter (as specified in \[MS-RAP\] section 2.5.5.2.1), the browser server MUST return the server's list of machine groups to the client. + +If the incoming NetServerEnum2 or NetServerEnum3 request specifies the _ServerType_ as 0xFFFFFFFF, the browser server MUST return the complete list of servers to the client. + +If the incoming NetServerEnum2 or NetServerEnum3 request specifies the _ServerType_ as any value other than the preceding, the server MUST return only those servers with a **ServerType** field that contains one of the values in the request _ServerType_ parameter. + +If the browser server is processing a NetServerEnum3 request, it MUST return entries starting from its list of servers or machine groups beginning with the server whose name matches the _FirstServerToReturn_ parameter of the RAP NetServerEnum3Request packet, as specified in \[MS-RAP\]. + +If the request is for a list of servers in a [**domain**](#gt_b0276eb2-4e65-4cf1-a718-e0920a614aca) that is different from the machine group that it serves, the local master browser SHOULD issue a NetServerEnum2 (or NetServerEnum3) request to the [**domain master browser server**](#gt_ef026994-26e6-4c9d-b34b-dfb7f1f80d6f) for the specified domain (which it can find in its list of machine groups and their domain master browser servers). If the domain master browser server returns a NetServerEnum response, that response MUST then be returned to the requester. If the local master browser fails to locate the domain master browser server for the specified domain, or if the request to the domain master browser server fails, the local master browser MUST respond with the Win32ErrorCode set to NERR_DevNotRedirected (0x0000083B). + +If the incoming NetServerEnum2 or NetServerEnum3 request specifies the Domain as NULL, servers from the primary domain, logon domain, and other domain are enumerated and returned. + +If the incoming NetServerEnum2 or NetServerEnum3 request specifies the Domain is not one of the primary domain, logon domain, and other domain, the error code will be mapped to either NERR_Success (with an empty list) for non-NT clients, or remain ERROR_NO_BROWSER_SERVERS_FOUND for NT clients. + +#### Sending BecomeBackup Frames + +A [**browser server**](#gt_3bd1e44e-100e-4f13-ad44-fc267e627495) whose Current Role is equal to local master browser MUST choose the number of browser servers whose Current Role is equal to [**backup browser server**](#gt_71f76461-689e-4b50-befc-67f52ec4668b). The number of backup browser servers is a trade-off between: + +- Minimizing network traffic. +- Ensuring robustness by having multiple backup browser servers. +- Ensuring that when a [**local master browser server**](#gt_d294211f-7ae9-4faf-8644-f71c1fade2ca) fails, there are multiple backup browser servers, which can become local master browser servers.[<51>](#Appendix_A_51) + +If the local master browser server determines that one or more backup browser servers SHOULD be added to its **Backup Browser List**[<52>](#Appendix_A_52), it MUST send [BecomeBackup (section 2.2.6)](#Section_0901905abff941b29ab09176d26cb91f) frames to enough servers to get up to the recommended level of backup servers. Each server to which it sends a BecomeBackup frame MUST be in the local master browser's **Servers List** and MUST NOT be in the **Backup Browser List**. The server MUST send the BecomeBackup frame by issuing a mailslot write as specified in [\[MS-MAIL\]](%5bMS-MAIL%5d.pdf#Section_8ea19aa46e5a4aedb6280b5cd75a1ab9) section 3.1.4.1 with the following parameters: + +| Parameter name | Value | +| --------------------------------- | ------------------------------------------------- | +| NetBIOS name of the remote server | < server to be promoted to backup >\[0x00\] | +| Mailslot name | \\MAILSLOT\\BROWSE | +| Data | BecomeBackup as specified in section 2.2.6. | + +The server SHOULD continue processing as described below even if the send fails. + +The action to add one or more backup browser servers is triggered by the **Server Expiration Timer** as specified in [Timer Events (section 3.3.6)](#Section_eb955ab5470a4810b18e6c3659a5199e). + +#### Receiving a RequestElection Frame + +The [RequestElection](#Section_6c68cb9eedfc498481a858304a0b1c1d) frame (as specified in section 2.2.3) MUST be sent whenever a [**browser client**](#gt_8cb9694c-b014-426d-8463-66456517b15c) or server is unable to retrieve information that is maintained by the [**local master browser server**](#gt_d294211f-7ae9-4faf-8644-f71c1fade2ca). It also MUST be issued when a local master browser server receives a frame that indicates that another machine on the machine group also believes it is a local master browser server. + +When a [**browser server**](#gt_3bd1e44e-100e-4f13-ad44-fc267e627495) receives a RequestElection frame, it MUST calculate its [**election criteria**](#gt_682b93a8-cd66-40c8-8500-2797c71e2e07) and update the **Uptime** value with the time difference, in seconds, between the current time and the **BrowserServerUpTime**, as specified in section 2.2.3. + +The browser server MUST then compare its election criteria value with the election criteria value of the RequestElection frame as an unsigned 32-bit integer. If the browser server's election criteria is greater than the RequestElection frame, the browser server has "won" the election. If the browser server's election criteria is less than the RequestElection frame, the browser server has "lost" the election. + +If the browser server's election criteria value is equal to the election criteria of the request frame, then the browser server MUST compare its **Uptime** field with the **Uptime** field of the RequestElection frame. If the browser server's Uptime value is greater than the **Uptime** value of the RequestElection frame, the browser server has "won" the election. If the browser server's **Uptime** value is less than the **Uptime** value of the RequestElection frame, the browser server has "lost" the election. + +If the browser server's election criteria and **Uptime** are equal to the election criteria and **Uptime** of the Election Request, the browser server MUST compare its name with the name in the RequestElection frame. If the browser server's name is alphabetically less than the name in the RequestElection frame, the browser server has "won" the election. If the browser server's name is alphabetically greater than the name in the RequestElection frame, the browser server has "lost" the election. + +If the browser server has "won" the election, the browser server MUST set **Current Role** to local master browser server. The browser server MUST disable advertising of the backup browser service as specified in [\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 3.1.6.10, passing SV_TYPE_BACKUP_BROWSER as the input parameter, and MUST enable advertising of the master browser service as specified in \[MS-SRVS\] section 3.1.6.9, passing SV_TYPE_MASTER_BROWSER as the input parameter. The server SHOULD set the **LocalMasterAnnouncement Timer Count** to 0.[<53>](#Appendix_A_53) + +The browser server MUST do the following: + +- Set its **Election Transmission Count** to 0. +- Set its **DomainAnnouncement Timer Count** to 0. +- Set its **MasterAnnouncement Timer Count** to 0. +- Set its **Election delay timer** as shown in the following table. + +| Browser role | Election delay timer | +| -------------------------------------------------------------------- | -------------------------------------------------------------- | +| Local master [**browser**](#gt_f06aa0c1-29ec-4d3e-a4e2-e38e8f918933) | 100 ms | +| Backup browser | A pseudo-random number chosen from the range 200 ms to 600 ms | +| Potential browser | A pseudo-random number chosen from the range 800 ms to 3000 ms | + +In a domain environment, the [**master browser server**](#gt_542ffc1e-9bbc-47f9-a6ca-284d0a39c680) SHOULD query the [**primary domain controller**](#gt_663cb13a-8b75-477f-b6e1-bea8f2fba64d) as described in [\[MS-ADOD\]](%5bMS-ADOD%5d.pdf#Section_5ff67bf4c14548cb89cd4f5482d94664) section 2.7.7.3.1. If the primary domain controller is successfully discovered, the master browser server SHOULD issue an I_BrowserrQueryOtherDomains request as specified in [\[MS-BRWSA\]](%5bMS-BRWSA%5d.pdf#Section_5995d2f2fff140af9100ca67794d50a5) section 3.1.4.1 to the primary domain controller, and append each domain name received in the response to OtherDomains as described in [\[MS-WKST\]](%5bMS-WKST%5d.pdf#Section_5bb08058bc364d3cabebb132228281b7) section 3.2.6.2 WkstaAddOtherDomains Event. If the number of domain names in the response is greater than 0, the server SHOULD register the [**NetBIOS name**](#gt_0334e0bd-2755-42f6-aeff-2d4a22bf4abf) <other domain name>\[0x00\] for each domain name in the response, and accept requests on that name as described in section [3.3.3](#Section_03da00e65cb34adcb7de04f9b4d31017). If either the primary domain controller cannot be discovered, or the call to the primary domain controller fails, the server MUST take no action with regards to OtherDomains and the election algorithm continues to execute. + +If the master browser server is running on a machine with **IsPrimaryDomainController** set to TRUE, it MUST act as a [**domain master browser server**](#gt_ef026994-26e6-4c9d-b34b-dfb7f1f80d6f) for its [**subnet**](#gt_c009a34c-e834-4a3e-9514-e611a6ad52fe), as specified in section [3.4](#Section_8e18326b26a24790a914d69f64250eb4). + +This election algorithm continues to execute as specified in section [3.3.6](#Section_eb955ab5470a4810b18e6c3659a5199e). + +If the browser server has "lost" the election, the browser MUST stop its election delay timer and set Current Role to [**potential browser server**](#gt_eac2d668-c72a-4030-af54-775f11815cd5); if it was previously the local master browser server, it MUST do the following: + +- It MUST disable advertising the service as specified in \[MS-SRVS\] section 3.1.6.10, passing SV_TYPE_MASTER_BROWSER as the input parameter. + +It MUST unregister the NetBIOS [**unique name**](#gt_9e9e2d18-1945-48ac-9574-96de352d5122) <machine group>\[0x1D\] so that the winning browser server can successfully register it. + +- If **IsDomainController** is set to TRUE or **AlwaysActAsDomainController** is set to TRUE, the browser server MUST take on the backup browser role and MUST set Current Role to [**backup browser server**](#gt_71f76461-689e-4b50-befc-67f52ec4668b). +- If **IsDomainController** is set to FALSE and **AlwaysActAsDomainController** is set to FALSE, the browser server MUST take on the potential browser server role, and MUST set Current Role to potential browser server. +- It MUST empty all elements in the Backup Browser List. + +#### Sending a GetBackupListResponse Frame + +The **BackupServerCount** field in the GetBackupListResponse frame MUST be set to the number of entries in the **Backup Browser List**, by calculating every time a request is made. The BackupServerList in the frame MUST be filled with the sequence of null-terminated server names from the **Backup Browser List**. + +The frame MUST be sent by issuing a mailslot write as specified in [\[MS-MAIL\]](%5bMS-MAIL%5d.pdf#Section_8ea19aa46e5a4aedb6280b5cd75a1ab9) section 3.1.4.1 with the following parameters: + +| Parameter name | Value | +| --------------------------------- | ----------------------------------------------------------------------------------------- | +| NetBIOS name of the remote server | < computer that issued GetBackupListRequest >\[0x00\] | +| Mailslot name | \\MAILSLOT\\BROWSE | +| Data | [GetBackupListResponse](#Section_2d27295b3a8b4154951071867616a7cb) as specified in 2.2.5. | + +The server SHOULD ignore the error even if the send fails. + +#### Sending ResetState Frames + +If the local [**master browser server**](#gt_542ffc1e-9bbc-47f9-a6ca-284d0a39c680) receives a HostAnnouncement from a server with the SV_TYPE_BACKUP_BROWSER and SV_TYPE_POTENTIAL_BROWSER flags set and that is running a version less than 0x010f, the local master browser server SHOULD send a ResetStateRequest message with RESET_STATE_CLEAR_ALL set to that server.[<54>](#Appendix_A_54) For more details regarding ServerType flag values, see [\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 2.2.2.7. + +If the local master browser server discovers that there are too many backup browsers[<55>](#Appendix_A_55) the local master browser server SHOULD send a ResetStateRequest message with RESET_STATE_CLEAR_ALL set to a plurality of backup browsers to bring the number to the expected level. + +When a backup [**browser**](#gt_f06aa0c1-29ec-4d3e-a4e2-e38e8f918933) receives the ResetStateRequest message with RESET_STATE_CLEAR_ALL set, it MUST transition from being a backup browser to simply a [**browser server**](#gt_3bd1e44e-100e-4f13-ad44-fc267e627495) and set Current Role to [**potential browser server**](#gt_eac2d668-c72a-4030-af54-775f11815cd5). The server MUST disable advertising of the backup and master browser service as specified in \[MS-SRVS\] section 3.1.6.10, passing SV_TYPE_BACKUP_BROWSER and SV_TYPE_MASTER_BROWSER as the input parameters. When a server that is a master browser receives either a RESET_STATE_CLEAR_ALL or a RESET_STATE_STOP_MASTER ResetStateRequest message, it transitions to simply a browser server (that is, no longer a master or backup browser). When a server that is a master browser receives RESET_STATE_STOP ResetStateRequest, the message stops the browser services.[<56>](#Appendix_A_56) + +#### Sending a RequestElection Frame + +To force an election or participate in an election, the server MUST send a [RequestElection Browser Frame](#Section_6c68cb9eedfc498481a858304a0b1c1d) as specified in section 2.2.3 by issuing a mailslot write as specified in [\[MS-MAIL\]](%5bMS-MAIL%5d.pdf#Section_8ea19aa46e5a4aedb6280b5cd75a1ab9) section 3.1.4.1 with the following parameters. + +| Parameter name | Value | +| --------------------------------- | ---------------------------------------------- | +| NetBIOS name of the remote server | <Machine Group Name>\[0x1E\] | +| Mailslot name | \\MAILSLOT\\BROWSE | +| Data | RequestElection as specified in section 2.2.3. | + +The server SHOULD ignore the error even if the send fails. + +### Timer Events + +**DomainAnnouncement timer:** When the DomainAnnouncement timer expires and the machine is a [**local master browser server**](#gt_d294211f-7ae9-4faf-8644-f71c1fade2ca), it MUST send a [DomainAnnouncement (section 2.2.7)](#Section_7401bb1bafee499284baee34fcb6409f) by issuing a mailslot write as specified in [\[MS-MAIL\]](%5bMS-MAIL%5d.pdf#Section_8ea19aa46e5a4aedb6280b5cd75a1ab9) section 3.1.4.1 with the parameters shown in the following table. + +| Parameter Name | Value | +| --------------------------------- | ------------------------------------------------- | +| NetBIOS name of the remote server | \[0x01\]\[0x02\]\__MSBROWSE_\_\[0x02\]\[0x01\] | +| Mailslot name | \\MAILSLOT\\BROWSE | +| Data | DomainAnnouncement as specified in section 2.2.7. | + +The server SHOULD continue processing as described below even in the send fails. + +Next, the server MUST increment DomainAnnouncement Timer Count by 1, and MUST set the timer values (in minutes) according to the following table. + +| DomainAnnouncement timer count value | New DomainAnnouncement timer value | +| ------------------------------------ | ---------------------------------- | +| 1 | 1 minute | +| 2 | 1 minute | +| 3 | 5 minutes | +| 4 | 5 minutes | +| 5 | 10 minutes | +| 6 | 10 minutes | +| \> 6 | 15 minutes | + +**Election Delay Timer:** When this timer expires, the [**browser server**](#gt_3bd1e44e-100e-4f13-ad44-fc267e627495) MUST send a RequestElection frame, as specified in section [3.3.5.11](#Section_0e918944016c450ba49152d3394e2cdc), and increment the election transmission count. + +The server SHOULD continue processing as described below even if the send fails. + +If this counter is less than 4 and the browser server has "won" the election for the first time, or if the browser server lost the election last time and "won" this time, then the browser server MUST reset the election delay timer, as shown in the following table. Otherwise, the election delay timer has to be set to 1000 msec. + +| Browser role | Election delay timer | +| -------------------------------------------------------------------- | ------------------------------------------------------------------ | +| Local master [**browser**](#gt_f06aa0c1-29ec-4d3e-a4e2-e38e8f918933) | 100 msec | +| Backup browser | A pseudo-random number chosen from the range 200 msec to 600 msec | +| Potential browser | A pseudo-random number chosen from the range 800 msec to 3000 msec | + +If the election transmission count is greater than 30, the browser server MUST consider the election as lost. If the browser server whose Current Role is equal to [**local master browser**](#gt_01f30b6e-f78a-462e-899e-9b2f5d299471), the browser server MUST take the actions for losing an election, as specified in section [3.3.5.8](#Section_557253965304455caf5b3224e238b2e0). + +When this counter reaches 4, the browser server MUST consider itself to have won the election and MUST perform the following actions: + +- The browser server must locate the [**domain master browser server**](#gt_ef026994-26e6-4c9d-b34b-dfb7f1f80d6f), which is also the [**primary domain controller (PDC)**](#gt_663cb13a-8b75-477f-b6e1-bea8f2fba64d). This is done by locating the PDC as specified in [\[MS-ADTS\]](%5bMS-ADTS%5d.pdf#Section_d243592709994c628c6d13ba31a52e1a) section 6.3.6.2. If the PDC is successfully identified, the browser server MUST send a Master Announcement frame (as specified in section 2.2.8) to the domain master browser server and start the Master Announcement timer. If the PDC cannot be located, no Master Announcement is sent. +- A newly elected local master browser server that has an empty Servers List element MUST send an AnnouncementRequest frame, as specified in section [2.2.2](#Section_12ed4892b92c4f5f8242f839893954e3) sent by issuing a mailslot write as specified in \[MS-MAIL\] section 3.1.4.1 with the parameters shown in the following table. + +| Parameter Name | Value | +| --------------------------------- | --------------------------------------------- | +| NetBIOS name of the remote server | <Machine Group Name>\[0x1E\] | +| Mailslot name | \\MAILSLOT\\BROWSE | +| Data | RequestElection as specified in section 2.2.2 | + +The server SHOULD continue processing as described below even in the send fails. + +- A local master browser server MUST register the NetBIOS [**unique name**](#gt_9e9e2d18-1945-48ac-9574-96de352d5122) <machine group>\[0x1D\]. If the [**NetBIOS name**](#gt_0334e0bd-2755-42f6-aeff-2d4a22bf4abf) registration fails, the browser server MUST initiate a new election by sending a new ElectionRequest frame. For more information, see section [2.2.3](#Section_6c68cb9eedfc498481a858304a0b1c1d). +- If the Servers List element is not empty, the local master browser server MUST initialize the Backup Browser List by enumerating the servers in the Servers List element for servers with the backup browser (BB) flag set (as specified in [\[MS-RAP\]](%5bMS-RAP%5d.pdf#Section_fb8d5bd1e57c4be1b063ec31330bdd58) section 2.5.5.2.1). If there are not sufficient backup browsers to meet the criteria, as specified in section [3.3.5.7](#Section_ca95bb43405e4499860217131d7ebc7e), the [**master browser server**](#gt_542ffc1e-9bbc-47f9-a6ca-284d0a39c680) MUST send BecomeBackup frames to the potential browsers, as specified in section 3.3.5.7. + +**LocalMasterAnnouncement Timer:** When the LocalMasterAnnouncement timer expires, and the machine is a local master browser server, it MUST announce itself to all browser servers for its machine group on its [**subnet**](#gt_c009a34c-e834-4a3e-9514-e611a6ad52fe) by sending a LocalMasterAnnouncement frame, as specified in section [2.2.9](#Section_91575c1a07a04d278aa5a11698552c40). The LocalMasterAnnouncement frame MUST be sent by issuing a mailslot write as specified in \[MS-MAIL\] section 3.1.4.1 with the parameters shown in the following table. + +| Parameter Name | Value | +| --------------------------------- | ------------------------------------------------------------------------------------------- | +| NetBIOS name of the remote server | <Machine Group Name>\[0x1E\] | +| Mailslot name | \\MAILSLOT\\BROWSE | +| Data | RequestElection as specified in section [2.2.10](#Section_bad3829da8e94a85aa2181d50867a77f) | + +The server SHOULD continue processing as described below even if the send fails. + +Next, the server MUST increment LocalMasterAnnouncement Timer Count by 1, and SHOULD set the timer values (in minutes) according to the following table.[<57>](#Appendix_A_57) + +| LocalMasterAnnouncement timer count value | New LocalMasterAnnouncement timer value | +| ----------------------------------------- | --------------------------------------- | +| 1 | 2 minutes | +| 2 | 2 minutes | +| 3 | 4 minutes | +| 4 | 8 minutes | +| \> 4 | 12 minutes | + +**Machine Group Expiration Timer:** When the Machine Group Expiration Timer for a machine group in the **Machine Groups List** element expires, the machine group MUST be removed from the **Machine Groups List** element. + +**MasterAnnouncement Timer:** When the MasterAnnouncement timer expires and the machine is a local master browser server, it MUST send a [MasterAnnouncement](#Section_1dc94e16c4a94a6e93f97f2e64d273b7), as specified in section 2.2.8. The MasterAnnouncement frame MUST be sent by issuing a mailslot write as specified in \[MS-MAIL\] section 3.1.4.1, with the following parameters. + +| Parameter Name | Value | +| --------------------------------- | ------------------------------------------------- | +| NetBIOS name of the remote server | <PDCName>\[0x00\] | +| Mailslot name | \\MAILSLOT\\BROWSE | +| Data | MasterAnnouncement as specified in section 2.2.8. | + +The server SHOULD continue processing as described below even if the send fails. + +It MUST reset the MasterAnnouncement timer. + +**NetServerEnum2 Timer:** When the NetServerEnum2 timer expires, and the machine is a [**backup browser server**](#gt_71f76461-689e-4b50-befc-67f52ec4668b), the machine MUST send a NetServerEnum2 request to the local master browser server on its subnet for its machine group, to get a list of servers in that machine group, as well as a list of machine groups. It MUST then reset the NetServerEnum2 timer. + +If the NetServerEnum2 request fails twice in succession, the backup browser server MUST send a RequestElection frame (as specified in section 3.3.5.11). For more information on the election process, see section 3.3.5.8. + +If the machine is instead a local master browser server and is a member of the domain, it MUST ask the domain master browser server for a domain-wide list of servers by issuing a NetServerEnum2 request with a ServerType parameter of 0xFFFFFFFF to retrieve the list of servers (as specified in section [3.3.5.6](#Section_995d4fc31e1e4f5095fe190674021266)). This request retrieves the complete list of servers within the domain. The local master browser server then MUST issue the same request with the DL flag specified to retrieve the Master List of Machine Groups. It MUST merge the results with its own list of servers and Master List of Machine Groups. The criteria for merging results are implementation dependent.[<58>](#Appendix_A_58) + +**Server Expiration Timer:** When the Server Expiration Timer for a server in the Servers List element expires, the server MUST be removed from the Servers List element, if the local master browser has not received a HostAnnouncement request from that server for more than three times the periodicity specified by the server in the most-recently received HostAnnouncement frame. The server MUST NOT be removed from the Servers List element before the periodicity field in the last HostAnnouncement frame received from the server has elapsed. + +If the server being removed from the Servers List element is a member of the Backup Browser List, the local master browser server MUST remove the server from the Backup Browser List. It MUST also reevaluate its Backup Browser List according to the algorithm (as specified in section 3.3.5.7) and it issues BecomeBackup messages to selected servers, ensuring that there are sufficient backup browser servers based on the number of computers in the machine group. + +**FindMaster Timer:** When this timer expires, the browser server MUST signal its expiration to the BecomeBackup processing routine that initialized the timer as specified in section [3.3.5.1](#Section_3e9084b16d3a40ca847a883246472d2e). + +**DomainControllerRoleMonitor Timer:** When this timer expires, the browser server MUST query the current domain role for the machine on which it is running by calling SamrQueryInformationDomain as specified in [\[MS-SAMR\]](%5bMS-SAMR%5d.pdf#Section_4df07fab1bbc452f8e927853a3c7e380) section 3.1.5.5.2. + +The browser server first performs a **SamrConnect** using its own name as the server name and an access mask of SAM*SERVER_CONNECT. The out parameter \_ServerHandle* is used to perform a **SamrQueryInformationDomain** using the DomainServerRoleInformation value (as specified in \[MS-SAMR\] section 2.2.3.16). The returned buffer contains a **DOMAIN_SERVER_ROLE_INFORMATION** structure (see \[MS-SAMR\] section 2.2.3.1 for a detailed explanation of the fields). + +If this call fails, the browser server SHOULD set the DomainControllerRoleMonitor Timer to 1 second.[<59>](#Appendix_A_59) + +If the call succeeds, the **IsDomainController** and **IsPrimaryDomainController** SHOULD be initialized based on the **DomainServerRole** value in the returned **SAMPR_DOMAIN_GENERAL_INFORMATION** structure as specified in the following table.[<60>](#Appendix_A_60) + +For DomainServerRole: + +| Enumeration DOMAIN_SERVER_ROLE value | unsigned long value | +| ------------------------------------ | ------------------- | +| DomainServerRoleBackup | 2 | +| DomainServerRolePrimary | 3 | + +If the call succeeds, the browser server MUST perform the following: + +- If IsPrimaryDomainController is FALSE and the DomainServerRolePrimary is equal to 3, the browser server MUST set **IsPrimaryDomainController** to TRUE and follow the actions specified in the [PromotedToPrimaryDomainController](#Section_d8b57f056ec947afa33dc6a464fbc08d) section 3.3.4.1. +- If IsPrimaryDomainController is TRUE and DomainServerRolePrimary is not equal to 3, the browser server MUST set **IsPrimaryDomainController** to FALSE and follow the actions specified in the [DemotedToBackupDomainController](#Section_b9f655ed7f1d4449bce081b2d77c55e5) section 3.4.4.1. + +Then the browser server SHOULD set the DomainControllerRoleMonitor Timer to 1 second.[<61>](#Appendix_A_61) + +The server MUST disable advertising of the domain-related services as specified in [\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 3.1.6.10, passing SV_TYPE_DOMAIN_CTRL and SV_TYPE_DOMAIN_BAKCTRL as input parameters. + +If **IsPrimaryDomainController** is TRUE, the server MUST enable advertising of the PDC service as specified in \[MS-SRVS\] section 3.1.6.9, passing SV_TYPE_DOMAIN_CTRL as the input parameter. + +If **IsDomainController** is TRUE but **IsPrimaryDomainController** is FALSE, the server MUST enable advertising of the domain controller as specified in \[MS-SRVS\] section 3.1.6.9, passing SV_TYPE_DOMAIN_BAKCTRL as the input parameter. + +### Other Local Events + +If the [**browser server**](#gt_3bd1e44e-100e-4f13-ad44-fc267e627495) is shutting down, but the system will continue operating as a [**nonbrowser server**](#gt_a0a691b5-ba43-46d5-ab2b-acb813ebb636), the browser server MUST send a [HostAnnouncement](#Section_105366778a144726bc52c0ef39cb7130) frame as specified in section [3.2.5.2](#Section_9bbd54b40f894b008976247cc9d17f31), with the SV_TYPE_POTENTIAL_BROWSER_SERVER, SV_TYPE_BACKUP_BROWSER, and SV_TYPE_MASTER_BROWSER bits in the **ServerType** field set to 0. The browser server MUST disable advertising of the services as specified in [\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 3.1.6.10, passing SV_TYPE_POTENTIAL_BROWSER, SV_TYPE_BACKUP_BROWSER, and SV_TYPE_MASTER_BROWSER as input parameters. + +If the browser server is shutting down, and the system will not continue to operate as a nonbrowser server, the browser server MUST send a HostAnnouncement as specified in section [3.2.7](#Section_eadfff38b0ea476d9e2371144ddb2fc3). + +The server SHOULD continue processing as described later in this section even if the send fails. + +If the browser server is also a [**local master browser server**](#gt_d294211f-7ae9-4faf-8644-f71c1fade2ca), it MUST send a [RequestElection](#Section_6c68cb9eedfc498481a858304a0b1c1d) frame with both **version** and **criterion** fields set to 0.[<62>](#Appendix_A_62) The server MUST send the RequestElection frame as specified in section [3.3.5.11](#Section_0e918944016c450ba49152d3394e2cdc). + +## Domain Master Browser Details + +A [**domain master browser server**](#gt_ef026994-26e6-4c9d-b34b-dfb7f1f80d6f) for a domain MUST act as a [**local master browser server**](#gt_d294211f-7ae9-4faf-8644-f71c1fade2ca) for its [**subnet**](#gt_c009a34c-e834-4a3e-9514-e611a6ad52fe). Therefore, it acts exactly like a local master browser server (section [3.3](#Section_eaff330e02364263a7d7c19ec307d6df)) except where indicated differently in this section. + +Historical note: By convention, the [**PDC**](#gt_663cb13a-8b75-477f-b6e1-bea8f2fba64d) of a domain SHOULD also be the domain master browser server for two reasons: + +- Some [**browser servers**](#gt_3bd1e44e-100e-4f13-ad44-fc267e627495) make use of the fact that the PDC and domain master browser server are on the same machine. In this way, they locate the name of the PDC. For more information, see section [3.3.5.8](#Section_557253965304455caf5b3224e238b2e0). After the name of the machine is known, the client can form the NetBIOS name <name of the machine>\[0x1D\] to construct a NetBIOS name that can be registered only by the domain master browser server. +- The domain master browser registers the <domain>\[0x1B\] records to the [**WINS**](#gt_bafb050b-b593-4517-8093-f721bd2378ac) server if the [**browser**](#gt_f06aa0c1-29ec-4d3e-a4e2-e38e8f918933) protocol is implemented in a domain with WINS. For more information, see [\[MS-ADTS\]](%5bMS-ADTS%5d.pdf#Section_d243592709994c628c6d13ba31a52e1a) section 6.3.4. The Windows Internet Name Service (WINS) server ensures that the network transport address of the machine that registered the <domain>\[0x1B\] address is always the first address returned when the <domain>\[0x1C\] address is queried.[<63>](#Appendix_A_63) + +### Abstract Data Model + +This section describes a hypothetical model of [**domain master browser server**](#gt_ef026994-26e6-4c9d-b34b-dfb7f1f80d6f) data organization that could be implemented to support this protocol. The purpose of this description is simply to help explain how this aspect of the protocol works. This specification does not prescribe that implementations adhere to this model as long as their external behavior is consistent with what is described throughout this document. + +**Local Master Browser Servers List:** A list of the [**local master browser servers**](#gt_d294211f-7ae9-4faf-8644-f71c1fade2ca) for the domain master browser server's domain on each [**subnet**](#gt_c009a34c-e834-4a3e-9514-e611a6ad52fe). The local master browser servers list MUST NOT contain duplicate server names. + +**Master List of Servers:** Identical to the Servers List element described in section [3.3.1](#Section_59e4ad47ca6547edb3704758a033e690), except that it contains a list merged from all subnets in the domain. + +**Master List of Machine Groups:** Identical to the Machine Groups List element described in section 3.3.1, except that it contains a list merged from all subnets in the domain. + +### Timers + +A [**domain master browser server**](#gt_ef026994-26e6-4c9d-b34b-dfb7f1f80d6f) has the following timers, in addition to those as specified in section [3.3.2](#Section_43cefc76d82d466e958ff6f6371f26d9): + +**Local Master Browser Server Expiration Timer:** For each [**local master browser server**](#gt_d294211f-7ae9-4faf-8644-f71c1fade2ca) in the domain master browser servers list, the domain master browser server keeps an expiration timer. The default value for this timer SHOULD be 36 minutes. + +### Initialization + +A [**domain master browser server**](#gt_ef026994-26e6-4c9d-b34b-dfb7f1f80d6f) MUST register the NetBIOS [**unique name**](#gt_9e9e2d18-1945-48ac-9574-96de352d5122) <domain>\[0x1D\], as well as the NetBIOS [**group names**](#gt_362f32fb-b6fc-4e9e-beb9-a1347754ed3e) <domain>\[0x00\] and <domain>\[0x1E\]. If a server is implemented in a domain with [**WINS**](#gt_bafb050b-b593-4517-8093-f721bd2378ac), the domain master browser server MUST also register the NetBIOS unique name <domain> \[0x1B\], as well as the NetBIOS group name <domain> \[0x1C\] as described in [\[MS-ADTS\]](%5bMS-ADTS%5d.pdf#Section_d243592709994c628c6d13ba31a52e1a) section 6.3.4. + +The server MUST enable advertising of the domain master browser service as specified in [\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 3.1.6.9, passing SV_TYPE_DOMAIN_MASTER as the input parameter. + +Master List of Machine Groups MUST be initialized to an empty list. + +Local Master Browser Servers List MUST be initialized to an empty list. + +Master List of Servers MUST be initialized to an empty list. + +### Higher-Layer Triggered Events + +#### DemotedToBackupDomainController + +If a [**domain master browser server**](#gt_ef026994-26e6-4c9d-b34b-dfb7f1f80d6f) is demoted from a [**primary domain controller (PDC)**](#gt_663cb13a-8b75-477f-b6e1-bea8f2fba64d) to a [**backup domain controller (BDC)**](#gt_ce1138c6-7ab4-4c37-98b4-95599071c3c3), it performs the following actions: + +- The server MUST unregister the NetBIOS unique name <domain>\[0x1D\]. +- The server MUST disable advertising of the domain master service as specified in [\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 3.1.6.10, passing SV_TYPE_DOMAIN_MASTER as the input parameter. +- The server MUST unregister the NetBIOS unique name <domain>\[0x1B\] as part of the demotion of a PDC, as specified in [\[MS-ADTS\]](%5bMS-ADTS%5d.pdf#Section_d243592709994c628c6d13ba31a52e1a) section 6.3.4 (NetBIOS Broadcast and NBNS Background). +- The server MUST cancel the Local [**Master Browser Server**](#gt_542ffc1e-9bbc-47f9-a6ca-284d0a39c680) Expiration Timer. +- The server MUST initialize the Master List of Servers to an empty list. +- The server MUST initialize the Master List of Machine Groups to an empty list. +- The server MUST initialize the Local Master Browser Servers List to an empty list. + +Upon completion of these actions, the server is no longer a domain master browser server. The server MUST then force an election by sending a RequestElection frame as specified in section [3.3.5.11](#Section_0e918944016c450ba49152d3394e2cdc). + +### Message Processing Events and Sequencing Rule + +#### Receiving a MasterAnnouncement Frame + +When a [MasterAnnouncement](#Section_1dc94e16c4a94a6e93f97f2e64d273b7) [**frame**](#gt_1c54183d-33fa-463c-b929-e996d716e3bb) is received, the [**domain master browser server**](#gt_ef026994-26e6-4c9d-b34b-dfb7f1f80d6f) MUST update its [**local master browser servers**](#gt_d294211f-7ae9-4faf-8644-f71c1fade2ca) list to add or update the entry for the sender of the frame. The expiration timer of this [**local master browser**](#gt_01f30b6e-f78a-462e-899e-9b2f5d299471) MUST be reset. The server MUST issue a NetServerEnum2 request to the local master browser server that announced itself, requesting _ServerType_ of SV*TYPE_LOCAL_LIST_ONLY to enumerate the servers maintained by that master browser, and add or update the entries received by the master list of servers. The server MUST then issue a NetServerEnum2 request to the local master browser server that announced itself requesting \_ServerType* of SV_TYPE_DOMAIN_ENUM | SV_TYPE_LOCAL_LIST_ONLY to enumerate the domains maintained by that master browser, and add or update the entries received in the Master List of Machine Groups. + +### Timer Events + +**Local Master Browser Server Expiration Timer:** When the [**local master browser server**](#gt_d294211f-7ae9-4faf-8644-f71c1fade2ca) expiration timer expires, the [**domain master browser server**](#gt_ef026994-26e6-4c9d-b34b-dfb7f1f80d6f) MUST remove the local master browser server that expired from the local master browser servers list. + +### Other Local Events + +If a [**domain master browser server**](#gt_ef026994-26e6-4c9d-b34b-dfb7f1f80d6f) ceases to be a domain master browser (for example, on shutdown, or if its role is locally changed by an administrator), it MUST unregister the NetBIOS [**unique name**](#gt_9e9e2d18-1945-48ac-9574-96de352d5122) <domain>\[0x1D\], as well as the NetBIOS [**group names**](#gt_362f32fb-b6fc-4e9e-beb9-a1347754ed3e) <domain>\[0x00\] and <domain>\[0x1E\]. If the protocol is implemented in a domain with [**WINS**](#gt_bafb050b-b593-4517-8093-f721bd2378ac), it MUST unregister the NetBIOS unique name <domain>\[0x1B\] and the NetBIOS group name <domain>\[0x1C\] as specified in [\[RFC1001\]](https://go.microsoft.com/fwlink/?LinkId=90260) section 15.4 (Name Release Transaction) and [\[RFC1002\]](https://go.microsoft.com/fwlink/?LinkId=90261) section 4.2.9 (Name Release Request and Demand). The server MUST disable advertising of the domain master service as specified in [\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 3.1.6.10, passing SV_TYPE_DOMAIN_MASTER as the input parameter. + +# Protocol Examples + +## Mailslot Frame Example + +The following is an example of a generic [**browser**](#gt_f06aa0c1-29ec-4d3e-a4e2-e38e8f918933) SMB ([\[MS-SMB\]](%5bMS-SMB%5d.pdf#Section_f210069c70864dc2885e861d837df688)) that shows how a browser message is encapsulated in a TRANSACT SMB request. Note that the PID, TID, MID, UID, and flags are all 0 in [**mailslot**](#gt_f53fe4b9-8e1d-4366-9254-3c4f73269e78) requests. + +- SMB: C transact, FileName = \\MAILSLOT\\BROWSE +- SMB: SMB Status = No Error +- SMB: ErrorClass = No Error +- SMB: Error = No Error +- SMB: Header: TID = 0x0000 PID = 0x0000 UID = 0x0000 MID = 0x0000 +- SMB: Flags = 0 (0x0) +- SMB: Flags2 = 0 (0x0) +- SMB: TreeID = 0 (0x0) +- SMB: ProcessID = 0 (0x0) +- SMB: UserID = 0 (0x0) +- SMB: MultiplexID = 0 (0x0) +- SMB: Command = C transact +- SMB: WordCount = 17 (0x11) +- SMB: TotalParameterCount = 0 (0x0) +- SMB: TotalDataCount = 33 (0x21) +- SMB: MaxParameterCount = 0 (0x0) +- SMB: MaxDataCount = 0 (0x0) +- SMB: MaxSetupCount = 0 (0x0) +- SMB: Flags = Do NOT disconnect TID +- SMB: Disconnect = ...............0 (Do NOT disconnect TID) +- SMB: Reserved = 000000000000000. (Reserved) +- SMB: Timeout = 1000 milli sec(s) +- SMB: ParameterCount = 0 (0x0) +- SMB: ParameterOffset = 0 (0x0) +- SMB: DataCount = 33 (0x21) +- SMB: DataOffset = 86 (0x56) +- SMB: SetupCount = 3 (0x3) +- SMB: MailSlotsSetupWords +- SMB: MailSlotOpcode = Write Mail Slot +- SMB: TransactionPriority = 0 (0x0) +- SMB: MailSlotClass = Unreliable & Broadcast +- SMB: ByteCount = 50 (0x32) +- SMB: MailSlotsBuffer: +- SMB: FileName = \\MAILSLOT\\BROWSE +- BROWSER: Local Master Announcement +- BROWSER: Command = Local Master Announcement, 15(0x0F) +- BROWSER: UpdateCount = 0 (0x0) +- BROWSER: Periodicity = 720000 (12 minutes) +- BROWSER: ServerName = GERMANSHA +- BROWSER: OSVersionMajor = 5 (0x5) +- BROWSER: OSVersionMinor = 1 (0x1) +- BROWSER: ServerType = 0x00051003 +- BROWSER: BrowserVersionMajor = 15 (0xF) +- BROWSER: BrowserVersionMinor = 1 (0x1) +- BROWSER: Signature = 43605 (0xAA55) + +## A Browser Server Wins the First Election Round and the Election + +The figure that follows depicts the following election process: + +- A [**browser server**](#gt_3bd1e44e-100e-4f13-ad44-fc267e627495) receives a [RequestElection](#Section_6c68cb9eedfc498481a858304a0b1c1d) frame and determines that it is winning the election, as compared to the sender of the RequestElection (section 2.2.3) frame. +- The potential [**master browser server**](#gt_542ffc1e-9bbc-47f9-a6ca-284d0a39c680) sends out a RequestElection frame that contains its own election **version** and **criteria** values. + +The browser server waits for 200 msec, 400 msec, or 800 msec, based on its role in the [**machine group**](#gt_f4153c8c-848d-4db5-b9cc-4113e5f1e406) (as specified in section [3.3.5.8](#Section_557253965304455caf5b3224e238b2e0)), and then repeats the RequestElection frame. + +- Because the browser server does not receive any RequestElection frames, it repeats the process another three times. +- Finally, the browser server declares itself a winner. + +![A browser server wins the first election round and the election](data:image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BjE/9o1NqR9UOKsQRdYrNTeXD6MRYTz73AOvYYH9meimP3W2OrNvJ8UL3KTO7jEW3Dy2I7Kc8jG1Tj32xkbQkFtvI7Alb8QGsjzMg6D70MYXLHMcIfRztNH0cWe+U897lGvZ1v6D7znqPK5C3NNOEpfJLMJaGNyeGi9PwplwnOJIlpwQ4lhZCBCGhqjjkhvJLT/XQDi200xudWDvFTW2lPHnbHF6303SfOK6eWXT7I92fnsUB40W9iNxI93sbaaOPm3Zor/cB2+lDH1O4zHGM0MdNedDHwfqm8z6ODzA2Gaem+07fcq0Fym8SU+qO7SxheHNyOImGN+U6wclscsJxQjg0BK+dW5wW+3FQkDJsYxMRieNqhxYoGyiHM2LmQRvUT37awm6E90fCmyPdJ2xTLsfD/tSjHfqWfrUjT1n6TV3ITIpt6rCd8thMv7fBMXOM7aAzJkthv9jvYwqXOY6RtEV+p5z/Po5t553ysbM0FqxTHyFkvfue/PQ7NqHbB8rF7jYMb06O4U25bnBUm2YlgEPC2cRZNjj60dlQBqcXR5zrl/201YzOJ7YoGycYaKv7QV76jd2xb83YThj7xDr9pv841K5HHm2TIm6BPMq2LcrEUff+7vdFUHY8LvZlthOwn3LjMcFlj6PJ+I8p7bDex8H+pfMO9Jd941hkf2yNfcdGbC4d09h++rYNw5uTw4VpeFNEZB0Mb04OTzOGN0VE1sHw5uQY3hQRWQ/Dm5NjeFNEZD0Mb06O4U0RkfUwvDk5hjdFRNbD8ObkGN4UEVkPw5uTY3hTRGQ9DG9OjuFNEZH1MLw5OYY3RUTWw/Dm5BjeFBFZD8ObIiIie8vJyf8BTTMC9uIVR2kAAAAASUVORK5CYII=) + +Figure 3: A browser server wins the first election round and the election + +## A Browser Server Wins the First Round but Loses the Election + +The figure that follows depicts the following election process: + +- A [**potential browser server**](#gt_eac2d668-c72a-4030-af54-775f11815cd5) (on the right) receives a [RequestElection](#Section_6c68cb9eedfc498481a858304a0b1c1d) frame and decides it is winning the election, as compared to the sender of the RequestElection frame (for more information, see section 2.2.3). +- The potential browser server sends out a RequestElection frame that contains its own election version and criterion values. +- Meanwhile, a [**browser server**](#gt_3bd1e44e-100e-4f13-ad44-fc267e627495) from the [**browser**](#gt_f06aa0c1-29ec-4d3e-a4e2-e38e8f918933) cloud (on the left) has also received the first RequestElection frame, and decides that it is a winner. +- That browser server sends a RequestElection frame that specifies its own election version and criterion values. +- The potential browser server receives this new RequestElection frame and decides that it has lost the election, when it compares itself to the other browser server. +- The potential browser server on the left sends a total of four RequestElection frames and receives no responses. It declares itself a winner. + +![A browser server wins the first round but loses the Election](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAb0AAAGJCAYAAAAexe3/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADE0AAAxRATS58BMAAD1YSURBVHhe7Z0tlBNfuneRSMQIJAKBRCIQSMQIzAjEFVciEQjEiCuQiCsQI65AYBEIxAgkYgTiCgQCcQUSgUCM6ffd+fev58mZU+mku5JUVfZe66xU1fmsSnJ2nvrovvHz58+zv/71r6aJpVevXp39/v37TETmx+vXr7vfa9NxE767wcKjR4+6BUzHS/fv3z/7n//5n/OvkIjMhU+fPp3duXOn+702HS/FcyvpkWRa/Od//qfSE5khSI8JVqZFXKf0JorSE5knSm+aKL2Jo/RE5onSmyZKb+IoPZF5ovSmidKbOEpPZJ4ovavx5s2b1bHbF0pv4ig9kXmyT+l9+fLl7O7du2uJx5u25du3b2dPnjw5XxsPhMWcVWFcjG9bHj58uNO+7IrSmzhKT2SeHEJ6vJI+fPiwWn/x4sV5ic2k/tggK6RV+fXr16q/bVF6J47SE5knh5BehSirbks0h0SYR378+HGec7aSI2WRCwkxhYiL9Pbt2/Otf0AefdNe2g20QX+13WzPMjDOjKvXB9tq+bFRehNH6YnMk2NKD+FFPpTllfWIb0h6ERl1GD9lqpRYpwx9sT3lYUh67Vjpm/pspw3yWA9K78RReiLz5JDSy+nNyIJ5IzIKCGlIRBCJVdpt1KFuQFY1n/bbNnp9BSTMOGsd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LavepttnbX/IyxkRIyCOSHoJ2qFdT6tQ+WabdjI+Uuux7jmtLygSWM3aW036g3bRFHuuhV15E5oPS24F2kodMinUiDUMTaiSTyAUxVNmxvb4pWSePPtoIpqaeLDZB+bSZPjPuOvlDbZMy7f6Sx/bAPmXMm8bStlOpfWY82dckiAx75DgFltMny+3YaKf+EKjt9sqLiByTg0uPyb1OpCFCqSAWygfymWBzCpH2KJPTay0RCVAXIfaosriMjKH2yTbq1/Zrm739JY/tLe2pz5a2nUrtk32PjFp6eTnV2fZdx37Ze0TfSk9kORjp7QCTIxNgEpNfJsA6kVaYiDnA5FOnLVPbACZbykSC1KM+8mGZ9jIJIynKUoc8oqBM/BnfNlCn9gnUbcda2+ztL3lsh4iD9YxzCPJou6ZIp/YJLOd40C5jT5+0k2NdjwWvbCeazXGs40k+2+mv5tEf2wJl6nhEZF4ovR3IhJxUoyCiijo5VpjAmSiZiKtYgDYua4f6vEmkNgKkLu1mck77bI84LoOybZ+9+nXb0DgTXaVNhFLH1YP8NqWf3jhYj6jq8ciYen2mXdobGnvvPWI7dQJ12/GIiByTvUlPRETmjZGeiIicDEpPRERkxixKelxPqteURETk6hjpTRz/n56IyHgoPRERkRljpCciIl2M9CaO0hMRGQ+lJyIiMmOM9EREpIuR3sRReiIi46H0REREZoyRnoiIdDHSmzhKT0RkPJSeiIjIjDHSExGRLkZ6E0fpiYiMh9ITERGZLWdn/w/jgd28tBHJSQAAAABJRU5ErkJggg==) + +Figure 4: A browser server wins the first round but loses the Election + +# Security + +## Security Considerations for Implementers + +In general, the [**browser**](#gt_f06aa0c1-29ec-4d3e-a4e2-e38e8f918933) service operates without any security. It is possible for applications to spoof elections. Additionally, malfunctioning [**local master browser servers**](#gt_d294211f-7ae9-4faf-8644-f71c1fade2ca) can mount an effective denial-of-service (DOS) attack against the entire browser infrastructure (for example, if a [**browser server**](#gt_3bd1e44e-100e-4f13-ad44-fc267e627495) refuses to release the <machine group>\[0x1D\] name after losing an election). + +The browser service uses null sessions to establish a connection to the IPC\$ share of the server. Null sessions are simply SMB connections [\[MS-SMB\]](%5bMS-SMB%5d.pdf#Section_f210069c70864dc2885e861d837df688) that use no password, no domain, and no user ID to establish the connection. This implies that the connection is highly insecure. + +## Index of Security Parameters + +None. + +# Appendix A: Product Behavior + +The information in this specification is applicable to the following Microsoft products or supplemental software. References to product versions include updates to those products. + +The terms "earlier" and "later", when used with a product version, refer to either all preceding versions or all subsequent versions, respectively. The term "through" refers to the inclusive range of versions. Applicable Microsoft products are listed chronologically in this section. + +- Windows NT operating system +- Windows 98 operating system +- Windows Millennium Edition operating system +- Windows 2000 operating system +- Windows XP operating system +- Windows Server 2003 operating system +- Windows Vista operating system +- Windows Server 2008 operating system +- Windows 7 operating system +- Windows Server 2008 R2 operating system +- Windows 8 operating system +- Windows Server 2012 operating system +- Windows 8.1 operating system +- Windows Server 2012 R2 operating system +- Windows 10 operating system +- Windows Server 2016 operating system +- Windows Server 2019 operating system +- Windows Server 2022 operating system +- Windows 11 operating system +- Windows Server 2025 operating system + +Exceptions, if any, are noted in this section. If an update version, service pack or Knowledge Base (KB) number appears with a product name, the behavior changed in that update. The new behavior also applies to subsequent updates unless otherwise specified. If a product edition appears with the product version, behavior is different in that product edition. + +Unless otherwise specified, any statement of optional behavior in this specification that is prescribed using the terms "SHOULD" or "SHOULD NOT" implies product behavior in accordance with the SHOULD or SHOULD NOT prescription. Unless otherwise specified, the term "MAY" implies that the product does not follow the prescription. + +[<1> Section 1.3](#Appendix_A_Target_1): The CIFS Browser Protocol is ineffectual on Windows-based servers where only IPv6 is enabled. + +[<2> Section 1.3](#Appendix_A_Target_2): The following statement is valid throughout the document. Windows 98, Windows 2000 Professional operating system, Windows XP, and Windows Vista are not capable of being domain master browsers; Windows Server 2008 operating system and later have the browser off by default, which can be turned on through the "Services" UI (User Interface) in "Computer Management". + +[<3> Section 1.3](#Appendix_A_Target_3): There needs to always be at least one backup server in a network for a network with two machines one is promoted to be a backup browser. + +[<4> Section 1.8](#Appendix_A_Target_4): The following table shows the unsigned 8-bit major and minor operating system version numbers that are used by Windows clients and servers. + +| Operating system | Major version | Minor version | +| --------------------------------------- | ------------- | ------------- | +| Windows 98 | 0x04 | 0x0A | +| Windows Millennium Edition | 0x04 | 0x5A | +| Windows NT 4.0 operating system | 0x04 | 0x00 | +| Windows 2000 | 0x05 | 0x00 | +| Windows XP | 0x05 | 0x01 | +| Windows Server 2003 | 0x05 | 0x02 | +| Windows Server 2003 R2 operating system | 0x05 | 0x02 | +| Windows Vista | 0x06 | 0x00 | +| Windows Server 2008 | 0x06 | 0x00 | +| Windows 7 | 0x06 | 0x01 | +| Windows Server 2008 R2 operating system | 0x06 | 0x01 | +| Windows 8 | 0x06 | 0x02 | +| Windows Server 2012 | 0x06 | 0x02 | +| Windows 8.1 | 0x06 | 0x03 | +| Windows Server 2012 R2 | 0x06 | 0x03 | +| Windows 10 and later | 0x0A | 0x00 | +| Windows Server 2016 and later | 0x0A | 0x00 | + +[<5> Section 1.8](#Appendix_A_Target_5): Windows only uses these values as specified in [\[MS-ERREF\]](%5bMS-ERREF%5d.pdf#Section_1bc92ddfb79e413cbbaa99a5281a6c90). + +[<6> Section 2.1](#Appendix_A_Target_6): Windows clients always use \\MAILSLOT\\BROWSE for [**mailslot**](#gt_f53fe4b9-8e1d-4366-9254-3c4f73269e78) requests. + +[<7> Section 2.1.1.2](#Appendix_A_Target_7): Windows-based servers attempt to register the machine group name three times; if all attempts fail, it can be concluded that another server is already the [**master browser server**](#gt_542ffc1e-9bbc-47f9-a6ca-284d0a39c680) for this [**domain**](#gt_b0276eb2-4e65-4cf1-a718-e0920a614aca). Name registration is as specified in [\[RFC1001\]](https://go.microsoft.com/fwlink/?LinkId=90260) section 5.2. + +[<8> Section 2.1.1.2](#Appendix_A_Target_8): **[WINS](#gt_bafb050b-b593-4517-8093-f721bd2378ac)** keeps up to 25 IP addresses for the <domain>\[0x1C\] [**group name**](#gt_362f32fb-b6fc-4e9e-beb9-a1347754ed3e). The [**PDC**](#gt_663cb13a-8b75-477f-b6e1-bea8f2fba64d) is the only machine that registers the <domain>\[0x1B\] name with WINS. WINS ensures that the IP address corresponding to the computer that registered <domain>\[0x1B\] is always placed first in this list of up to 25 IP addresses that registered <domain>\[0x1C\]. + +[<9> Section 2.2.1](#Appendix_A_Target_9): Windows-based servers send announcements to \\MAILSLOT\\LANMAN, but listen for announcements on both \\MAILSLOT\\LANMAN and \\MAILSLOT\\BROWSE as specified in section [2.1](#Section_ced2f3444e604eab87a0ec4dda60b2ff). + +[<10> Section 2.2.1](#Appendix_A_Target_10): The Windows announcement frequency is as specified in section [3.2.6](#Section_b3ab99037158486982b0f44dda04a52e). + +[<11> Section 2.2.1](#Appendix_A_Target_11): For more information, see section [1.8](#Section_bb476516a10147f7878919cc4a8ee75f) for Windows operating system values. + +[<12> Section 2.2.1](#Appendix_A_Target_12): For more information, see section 1.8 for Windows operating system values. + +[<13> Section 2.2.1](#Appendix_A_Target_13): The comment field in Windows is a single byte containing the value 0x00. + +[<14> Section 2.2.3](#Appendix_A_Target_14): The following table shows the operating system values. + +| Value | Meaning | +| ---------- | ---------------------------------------- | +| 0x10000000 | Windows-based clients. | +| 0x20000000 | Windows-based servers which act as PDCs. | + +[<15> Section 2.2.4](#Appendix_A_Target_15): The default value on Windows is 0x04. + +[<16> Section 2.2.4](#Appendix_A_Target_16): The value chosen by the Windows client for token is 0x00000001. + +[<17> Section 2.2.7](#Appendix_A_Target_17): Windows clients and servers set BrowserConfigVersionMajor to 0x03. + +[<18> Section 2.2.7](#Appendix_A_Target_18): Windows clients and servers set BrowserConfigVersionMinor to 0x0A. + +[<19> Section 2.2.7](#Appendix_A_Target_19): Windows-based servers leave this field uninitialized, so the value is undefined. + +[<20> Section 2.2.7](#Appendix_A_Target_20): Windows-based servers leave this field uninitialized, so the value is undefined. + +[<21> Section 2.2.7](#Appendix_A_Target_21): Windows-based servers leave this field uninitialized, so the value is undefined. + +[<22> Section 2.2.9](#Appendix_A_Target_22): Windows based clients and server's ignore the command when this bit is set. + +[<23> Section 2.2.10](#Appendix_A_Target_23): For more information on Windows operating system values, see section 1.8. + +[<24> Section 2.2.10](#Appendix_A_Target_24): For more information about Windows operating system values, see section 1.8. + +[<25> Section 2.2.10](#Appendix_A_Target_25): Windows clients and servers set BrowserConfigVersionMajor to 0x01. + +[<26> Section 2.2.10](#Appendix_A_Target_26): Windows clients and servers set BrowserConfigVersionMinor to 0x0F. + +[<27> Section 3.1.3](#Appendix_A_Target_27): For Windows machines, the requests to enumerate machines on the network would also fail if the initialization has failed. + +[<28> Section 3.1.5.1.1](#Appendix_A_Target_28): The [**browser client**](#gt_8cb9694c-b014-426d-8463-66456517b15c) uses an initial token value of 0, and it increments this value every time it makes a [GetBackupListRequest](#Section_2fa4f92f9c5947dc87b54333360f8593). + +[<29> Section 3.1.5.1.2](#Appendix_A_Target_29): The browser client selects up to three of the [**backup browser servers**](#gt_71f76461-689e-4b50-befc-67f52ec4668b) and uses a pseudo-random number generator to determine which one of the servers to use from that list. + +[<30> Section 3.1.6](#Appendix_A_Target_30): Upon expiration of the timer, a Windows-based client retransmits the GetBackupListRequest twice more and, if both transmissions result in no [GetBackupListResponse](#Section_2d27295b3a8b4154951071867616a7cb) frames being received, a Windows-based client sends a [RequestElection](#Section_6c68cb9eedfc498481a858304a0b1c1d) frame (section 2.2.3) with the version and criteria values set to 0. For more information about the election process, see section [3.3.5.8](#Section_557253965304455caf5b3224e238b2e0). + +[<31> Section 3.1.6](#Appendix_A_Target_31): Windows increments **TokenValue**. + +[<32> Section 3.2.6](#Appendix_A_Target_32): Windows 98, Windows 2000, Windows XP, and Windows Server 2003 use the following time-out values (as specified in 3.2.6). + +| Server.HostAnnouncementCount value | New HostAnnouncement timer value | +| ---------------------------------- | -------------------------------- | +| 0, 1 | 4 minutes | +| 2 | 8 minutes | +| \> 2 | 12 minutes | + +[<33> Section 3.3](#Appendix_A_Target_33): There needs to always be at least one backup server in a network for a network with two machines one is promoted to be a backup browser. + +[<34> Section 3.3](#Appendix_A_Target_34): The new [**local master browser server**](#gt_d294211f-7ae9-4faf-8644-f71c1fade2ca) sends the announcement request only if its Servers List is empty. If the local master browser server was previously a backup [**browser**](#gt_f06aa0c1-29ec-4d3e-a4e2-e38e8f918933), it does not send the announcement request. + +[<35> Section 3.3.1](#Appendix_A_Target_35): Windows-based servers retrieve this value by reading the MaintainServerList registry setting. The default value is FALSE, but if MaintainServerList is set to "true", **AlwaysActAsDomainController** is set to TRUE. + +[<36> Section 3.3.1](#Appendix_A_Target_36): A Windows-based server that is elected to a master browser does not reset the **LocalMasterAnnouncement Timer Count**. + +[<37> Section 3.3.1](#Appendix_A_Target_37): The contents of the Machine Groups List element are ordered alphabetically. + +[<38> Section 3.3.1](#Appendix_A_Target_38): Windows NT Server operating system sets **IsPrimaryDomainController** to TRUE if the IsDomainMaster registry key is set. + +[<39> Section 3.3.1](#Appendix_A_Target_39): In Windows, the contents of the Servers List element are ordered alphabetically. + +[<40> Section 3.3.2](#Appendix_A_Target_40): The local master browser will use the time-out values as specified in the DomainAnnouncement table in section [3.3.6](#Section_eb955ab5470a4810b18e6c3659a5199e). + +[<41> Section 3.3.2](#Appendix_A_Target_41): Windows-based servers use an internal notification API instead of a timer. + +[<42> Section 3.3.2](#Appendix_A_Target_42): The local master browser uses the default time-out values as specified in the [LocalMasterAnnouncement](#Section_91575c1a07a04d278aa5a11698552c40) table in section 3.3.6. + +[<43> Section 3.3.2](#Appendix_A_Target_43): The local master browser will use the default time-out of 12 minutes. + +[<44> Section 3.3.2](#Appendix_A_Target_44): Windows implementations use the default value of 12 minutes for this timer. + +[<45> Section 3.3.3](#Appendix_A_Target_45): Windows-based servers will set **IsDomainController** to TRUE if the MaintainServerList registry key is set to "Yes". + +[<46> Section 3.3.3](#Appendix_A_Target_46): In browser initialization, if the server is executing a scheduled announcement and determining whether to become a backup browser or master browser, SV_TYPE_POTENTIAL_BROWSER, SV_TYPE_MASTER_BROWSER, SV_TYPE_BACKUP_BROWSER flags are not set. + +[<47> Section 3.3.3](#Appendix_A_Target_47): Windows 2000 Server operating system operating system and later register as SV_TYPE_SERVER_NT. Windows XP operating system and later do not register this flag. + +[<48> Section 3.3.5](#Appendix_A_Target_48): Malformed messages are written to the Windows event log. + +[<49> Section 3.3.5.1](#Appendix_A_Target_49): If the FindMaster timer expires three times (4.5 seconds), the [**browser server**](#gt_3bd1e44e-100e-4f13-ad44-fc267e627495) sends a RequestElection (section 2.2.3) frame. + +[<50> Section 3.3.5.1](#Appendix_A_Target_50): Windows XP, Windows XP Professional operating system, Windows XP 64-Bit Edition operating system, Windows Server 2003, Windows XP Professional x64 Edition operating system, Windows Vista, and Windows Server 2008 acting as the Local Master Browser for a network with fewer than 11 machines on it will return only the local master browser in response to a Get BackupList response. Windows XP Home Edition operating system and Windows Vista will return only the local master browser if fewer than 6 machines are on the network. + +[<51> Section 3.3.5.7](#Appendix_A_Target_51): A Windows local master browser attempts to maintain a number of backup browser servers that it nominates as follows. + +| Number of servers | Number of backup browser servers | +| ----------------- | -------------------------------- | +| 1 | 0 | +| 2-31 | 1 | +| 32-63 | 2 | +| \> 63 | 3 | + +[<52> Section 3.3.5.7](#Appendix_A_Target_52): Windows-based servers attempt to maintain the desired number of backup browser servers as 1 backup browser for every 32 servers in **Servers List**. + +[<53> Section 3.3.5.8](#Appendix_A_Target_53): A Windows-based server that is elected to a master browser does not reset the **LocalMasterAnnouncement Timer Count**. + +[<54> Section 3.3.5.10](#Appendix_A_Target_54): For machines running Windows, the ResetState message might not be seen for 17 minutes, because promotion or demotion of backup servers and version checking occurs during the ServerExpiration timer. The timer is delayed for the first 15 minutes after becoming a master where no demotion or promotion is done. + +[<55> Section 3.3.5.10](#Appendix_A_Target_55): Windows-based servers attempt to maintain the desired number of backup browser servers as 1 backup browser for every 32 servers in the **Servers List**. + +[<56> Section 3.3.5.10](#Appendix_A_Target_56): When Windows-based clients and servers ignore the command, this bit is set. + +[<57> Section 3.3.6](#Appendix_A_Target_57): Windows Server 2003 uses the time-out value of 12 minutes. Windows 98, Windows Millennium Edition, and Windows 2000 use the following time-out values. + +| LocalMasterAnnouncement timer count value | New LocalMasterAnnouncement timer value | +| ----------------------------------------- | --------------------------------------- | +| 1 | 4 minutes | +| 2 | 8 minutes | +| \> 2 | 12 minutes | + +Windows 7 operating system and later and Windows Server 2008 R2 operating system and later use the following time-out values. + +| LocalMasterAnnouncement timer count value | New LocalMasterAnnouncement timer value | +| ----------------------------------------- | --------------------------------------- | +| 1 | 2 minutes | +| 2 | 4 minutes | +| 3 | 8 minutes | +| 4 | 12 minutes | +| \> 4 | 12 minutes | + +[<58> Section 3.3.6](#Appendix_A_Target_58): Servers lists and machine groups lists are merged alphabetically. + +[<59> Section 3.3.6](#Appendix_A_Target_59): Windows-based servers use an internal notification API instead of a timer. + +[<60> Section 3.3.6](#Appendix_A_Target_60): Windows-based servers will set **IsDomainController** to TRUE if the MaintainServerList registry key is set to "Yes". + +[<61> Section 3.3.6](#Appendix_A_Target_61): Windows-based servers use an internal notification API instead of a timer. + +[<62> Section 3.3.7](#Appendix_A_Target_62): Windows-based servers might not send the [HostAnnouncement](#Section_105366778a144726bc52c0ef39cb7130) or RequestElection on shutdown as the shutdown process disconnects the network before the browser sends HostAnnouncement or RequestElection frame. + +[<63> Section 3.4](#Appendix_A_Target_63): WINS maintains a set of up to 25 addresses for the <domain>\[0x1C\] group address. + +# Change Tracking + +No table of changes is available. The document is either new or has had no changes since its last release. + +# Index + +A + +[A browser server wins the first election round and the election example](#section_1cd470ba33444d918e54c6872b6cc5f7) 54 + +[A browser server wins the first round but loses the election example](#section_d4b8e069241b4180a2e209d241b83496) 55 + +Abstract data model + +[browser server](#section_59e4ad47ca6547edb3704758a033e690) 36 + +[client](#section_f3968e50bd1345acb0bb3913e34ab674) 29 + +[domain master browser server](#section_4b884d971bfa43edb700fe7ad0002c80) 51 + +[nonbrowser server](#section_99ce879d612b47c29d51f8a713aed86f) 32 + +server ([section 3.2.1](#section_99ce879d612b47c29d51f8a713aed86f) 32, [section 3.3.1](#section_59e4ad47ca6547edb3704758a033e690) 36) + +[AnnouncementRequest Frame](#section_37e20e380d5a435c931d8d8e0d2ffb9b) 33 + +[AnnouncementRequest_Browser_Frame packet](#section_12ed4892b92c4f5f8242f839893954e3) 21 + +[Applicability](#section_af8ffa0e3cf74f608995b890bd1d0b2b) 14 + +B + +[Backup browser servers - retrieving list](#section_a53e834fd4a04cae94b90651828e12f9) 30 + +BecomeBackup Frame ([section 3.3.5.1](#section_3e9084b16d3a40ca847a883246472d2e) 40, [section 3.3.5.7](#section_ca95bb43405e4499860217131d7ebc7e) 44) + +[BecomeBackup_Browser_Frame packet](#section_0901905abff941b29ab09176d26cb91f) 24 + +[browser interface](#section_eaff330e02364263a7d7c19ec307d6df) 34 + +Browser server + +[abstract data model](#section_59e4ad47ca6547edb3704758a033e690) 36 + +[higher-layer triggered events](#section_d1d04385b2f24a24b238cf61146288cd) 39 + +[initialization](#section_03da00e65cb34adcb7de04f9b4d31017) 38 + +[local events](#section_fa094f6690d243f187de5e1f8a89f359) 51 + +[message processing](#section_6ed7dd194e3c468e8d95544cd50d3738) 40 + +[overview](#section_eaff330e02364263a7d7c19ec307d6df) 34 + +[sequencing rules](#section_6ed7dd194e3c468e8d95544cd50d3738) 40 + +[timer events](#section_eb955ab5470a4810b18e6c3659a5199e) 47 + +[timers](#section_43cefc76d82d466e958ff6f6371f26d9) 37 + +C + +[Capability negotiation](#section_73294abe55a8495699271e937870308f) 14 + +[Change tracking](#section_803d8f4bef6b45deb7ac7f0cfbd00040) 64 + +Client + +[abstract data model](#section_f3968e50bd1345acb0bb3913e34ab674) 29 + +[higher-layer triggered events](#section_2e370282752a4df5a4689c2868e5bfeb) 30 + +[initialization](#section_90d05d0f78d546ca8b7c7d9706c89065) 29 + +[local events](#section_85fdb6bab6c348c1a655405a81b256e4) 32 + +[message processing](#section_3e079abc663b4670bd4b743d24d2397d) 30 + +[Receiving a NetServerEnum2 Response method](#section_a694bcb248fa445d96217157552dc6c6) 31 + +[Retrieving a List of Backup Browser Servers method](#section_a53e834fd4a04cae94b90651828e12f9) 30 + +[Sending a RequestElection Frame method](#section_ff716dc43a2e453283b7a5745698c8d9) 31 + +[sequencing rules](#section_3e079abc663b4670bd4b743d24d2397d) 30 + +[timer events](#section_0fef49b090f54a9da87ad2c94be6e7ae) 32 + +[timers](#section_a0c24bbe49a44228a8ef558b28a5b41a) 29 + +D + +Data model - abstract + +[browser server](#section_59e4ad47ca6547edb3704758a033e690) 36 + +[client](#section_f3968e50bd1345acb0bb3913e34ab674) 29 + +[domain master browser server](#section_4b884d971bfa43edb700fe7ad0002c80) 51 + +[nonbrowser server](#section_99ce879d612b47c29d51f8a713aed86f) 32 + +server ([section 3.2.1](#section_99ce879d612b47c29d51f8a713aed86f) 32, [section 3.3.1](#section_59e4ad47ca6547edb3704758a033e690) 36) + +Domain master browser server + +[abstract data model](#section_4b884d971bfa43edb700fe7ad0002c80) 51 + +[higher-layer triggered events](#section_4b30a1625f694dad89f4d5fc3be99d66) 52 + +[initialization](#section_1e40fb2279004aab89907821207f8647) 52 + +[local events](#section_855b07a3c8ce4a1b8ff2e74ef24c68ac) 53 + +[message processing](#section_672e9129e5044fa38b5416ad1ca795c3) 53 + +[overview](#section_8e18326b26a24790a914d69f64250eb4) 51 + +[sequencing rules](#section_672e9129e5044fa38b5416ad1ca795c3) 53 + +[timers](#section_76b93b8c2d3e4534b129b959f34a8ec1) 52 + +[DomainAnnouncement Frame](#section_5b6bbb79f4e04bd8a1ba5ccd86404143) 42 + +[DomainAnnouncement_Browser_Frame packet](#section_7401bb1bafee499284baee34fcb6409f) 25 + +E + +Election examples ([section 4.2](#section_1cd470ba33444d918e54c6872b6cc5f7) 54, [section 4.3](#section_d4b8e069241b4180a2e209d241b83496) 55) + +Events + +[local - client](#section_85fdb6bab6c348c1a655405a81b256e4) 32 + +local - server ([section 3.2.7](#section_eadfff38b0ea476d9e2371144ddb2fc3) 34, [section 3.3.7](#section_fa094f6690d243f187de5e1f8a89f359) 51) + +[timer - client](#section_0fef49b090f54a9da87ad2c94be6e7ae) 32 + +timer - server ([section 3.2.6](#section_b3ab99037158486982b0f44dda04a52e) 34, [section 3.3.6](#section_eb955ab5470a4810b18e6c3659a5199e) 47) + +[Examples](#section_fde597aa55ca435f9928db57781c876a) 54 + +[a browser server wins the first election round and the election](#section_1cd470ba33444d918e54c6872b6cc5f7) 54 + +[a browser server wins the first round but loses the election](#section_d4b8e069241b4180a2e209d241b83496) 55 + +[mailslot frame example](#section_6a2b85e035634fb6b313eea44ec3182c) 54 + +F + +[Fields - vendor-extensible](#section_bb476516a10147f7878919cc4a8ee75f) 14 + +G + +GetBackupListRequest Frame ([section 3.1.5.1.1](#section_ce7d2c1c0c714c54bef55fecb17b2f50) 31, [section 3.3.5.5](#section_10737253c7684b30a0c27e099f16c5b5) 43) + +[GetBackupListRequest_Browser_Frame packet](#section_2fa4f92f9c5947dc87b54333360f8593) 23 + +GetBackupListResponse Frame ([section 3.1.5.1.2](#section_1b1e5e2d3a6b474e86282d332a236114) 31, [section 3.3.5.9](#section_992e6c5b43f04fdaa4f5e075471af6f8) 46) + +[GetBackupListResponse_Browser_Frame packet](#section_2d27295b3a8b4154951071867616a7cb) 24 + +[Glossary](#section_f95bb7d56c674957bebc41687f07e21a) 7 + +[Group names](#section_e901ed92581241f18915451dd20ae7d6) 18 + +H + +Higher-layer triggered events + +[browser server](#section_d1d04385b2f24a24b238cf61146288cd) 39 + +[client](#section_2e370282752a4df5a4689c2868e5bfeb) 30 + +[domain master browser server](#section_4b30a1625f694dad89f4d5fc3be99d66) 52 + +[nonbrowser server](#section_3f24a7d068e64e669a0ff2d4cfd0a951) 33 + +[HostAnnouncement Frame](#section_b17dc0899e9643f693ee9ed9c96beada) 41 + +[HostAnnouncement_Browser_Frame packet](#section_105366778a144726bc52c0ef39cb7130) 20 + +I + +[Implementer - security considerations](#section_9b74c6e1e4654efab1e06cc5bc93ccdb) 57 + +[Implementers - security considerations](#section_9b74c6e1e4654efab1e06cc5bc93ccdb) 57 + +[Index of security parameters](#section_b4b5e378db90409c8c5082752791ef7a) 57 + +[Informative references](#section_913c9eff4ea8484ea3b9601a088982a4) 10 + +Initialization + +[browser server](#section_03da00e65cb34adcb7de04f9b4d31017) 38 + +[client](#section_90d05d0f78d546ca8b7c7d9706c89065) 29 + +[domain master browser server](#section_1e40fb2279004aab89907821207f8647) 52 + +[nonbrowser server](#section_30a503dda7554d0ca266c1e045951bb3) 33 + +server ([section 3.2.3](#section_30a503dda7554d0ca266c1e045951bb3) 33, [section 3.3.3](#section_03da00e65cb34adcb7de04f9b4d31017) 38) + +Interfaces - server + +[browser](#section_eaff330e02364263a7d7c19ec307d6df) 34 + +[Introduction](#section_bee999068e3d424ca0d86ab1475fec59) 7 + +L + +Local events + +[browser server](#section_fa094f6690d243f187de5e1f8a89f359) 51 + +[client](#section_85fdb6bab6c348c1a655405a81b256e4) 32 + +[domain master browser server](#section_855b07a3c8ce4a1b8ff2e74ef24c68ac) 53 + +[nonbrowser server](#section_eadfff38b0ea476d9e2371144ddb2fc3) 34 + +server ([section 3.2.7](#section_eadfff38b0ea476d9e2371144ddb2fc3) 34, [section 3.3.7](#section_fa094f6690d243f187de5e1f8a89f359) 51) + +[LocalMasterAnnouncement Frame](#section_2ca216dcd9ae4b0698444c0b9548fdb5) 41 + +[LocalMasterAnnouncement_Browser_Frame packet](#section_bad3829da8e94a85aa2181d50867a77f) 27 + +M + +[Mailslot Frame example](#section_6a2b85e035634fb6b313eea44ec3182c) 54 + +[Mailslot frame example example](#section_6a2b85e035634fb6b313eea44ec3182c) 54 + +[MasterAnnouncement Frame](#section_537e3264877f4774ba85b5327f49da2f) 53 + +[MasterAnnouncement_Browser_Frame packet](#section_1dc94e16c4a94a6e93f97f2e64d273b7) 26 + +Message processing + +[browser server](#section_6ed7dd194e3c468e8d95544cd50d3738) 40 + +[client](#section_3e079abc663b4670bd4b743d24d2397d) 30 + +[domain master browser server](#section_672e9129e5044fa38b5416ad1ca795c3) 53 + +[nonbrowser server](#section_3848011c5ad74b8e8ef7a29d803625f8) 33 + +server ([section 3.2.5](#section_3848011c5ad74b8e8ef7a29d803625f8) 33, [section 3.3.5](#section_6ed7dd194e3c468e8d95544cd50d3738) 40) + +Messages + +[overview](#section_2c4ac70975314a89856d145ff11480ce) 16 + +[syntax](#section_0e74d70edcf7422e8285e2e193f363d9) 18 + +[transport](#section_ced2f3444e604eab87a0ec4dda60b2ff) 16 + +Methods + +[Receiving a BecomeBackup Frame](#section_3e9084b16d3a40ca847a883246472d2e) 40 + +[Receiving a DomainAnnouncement Frame](#section_5b6bbb79f4e04bd8a1ba5ccd86404143) 42 + +[Receiving a GetBackupListRequest Frame](#section_10737253c7684b30a0c27e099f16c5b5) 43 + +[Receiving a HostAnnouncement Frame](#section_b17dc0899e9643f693ee9ed9c96beada) 41 + +[Receiving a LocalMasterAnnouncement Frame](#section_2ca216dcd9ae4b0698444c0b9548fdb5) 41 + +[Receiving a NetServerEnum2 or NetServerEnum3 Request](#section_995d4fc31e1e4f5095fe190674021266) 43 + +[Receiving a NetServerEnum2 Response](#section_a694bcb248fa445d96217157552dc6c6) 31 + +[Receiving a RequestElection Frame](#section_557253965304455caf5b3224e238b2e0) 44 + +[Receiving an AnnouncementRequest Frame](#section_37e20e380d5a435c931d8d8e0d2ffb9b) 33 + +[Retrieving a List of Backup Browser Servers](#section_a53e834fd4a04cae94b90651828e12f9) 30 + +[Sending a GetBackupListResponse Frame](#section_992e6c5b43f04fdaa4f5e075471af6f8) 46 + +[Sending a HostAnnouncement Frame](#section_9bbd54b40f894b008976247cc9d17f31) 33 + +Sending a RequestElection Frame ([section 3.1.5.3](#section_ff716dc43a2e453283b7a5745698c8d9) 31, [section 3.3.5.11](#section_0e918944016c450ba49152d3394e2cdc) 47) + +[Sending BecomeBackup Frames](#section_ca95bb43405e4499860217131d7ebc7e) 44 + +[Sending ResetState Frames](#section_543f5af3b72147c38303f2bde1bc8496) 46 + +N + +[NetBIOS Name Notation](#section_940f299f669f4a0b84119ead7e2f31ec) 16 + +[NetBIOS suffix definitions](#section_0c773bdd78e24d8b8b3db7506849847b) 17 + +[NetServerEnum2 Request](#section_995d4fc31e1e4f5095fe190674021266) 43 + +[NetServerEnum3 Request](#section_995d4fc31e1e4f5095fe190674021266) 43 + +Nonbrowser server + +[abstract data model](#section_99ce879d612b47c29d51f8a713aed86f) 32 + +[higher-layer triggered events](#section_3f24a7d068e64e669a0ff2d4cfd0a951) 33 + +[initialization](#section_30a503dda7554d0ca266c1e045951bb3) 33 + +[local events](#section_eadfff38b0ea476d9e2371144ddb2fc3) 34 + +[message processing](#section_3848011c5ad74b8e8ef7a29d803625f8) 33 + +[sequencing rules](#section_3848011c5ad74b8e8ef7a29d803625f8) 33 + +[timer events](#section_b3ab99037158486982b0f44dda04a52e) 34 + +[timers](#section_c76cc35a7481439b9749610749d05533) 32 + +[Normative references](#section_9f29a1cacb154a92b0bff05cf049f649) 9 + +O + +[Overview (synopsis)](#section_3cfbad9209b34abc808fc6f6347d5677) 10 + +P + +[Parameters - security](#section_b4b5e378db90409c8c5082752791ef7a) 57 + +[Parameters - security index](#section_b4b5e378db90409c8c5082752791ef7a) 57 + +[Preconditions](#section_14cff6743d2443e0b51889a6efea1a49) 13 + +[Prerequisites](#section_14cff6743d2443e0b51889a6efea1a49) 13 + +[Product behavior](#section_175706dd38af47f59e2ca7921b948da6) 58 + +Protocol Details + +[overview](#section_19efd0cab39b43db8a613f7a0b51fbea) 29 + +R + +[Receiving a BecomeBackup Frame method](#section_3e9084b16d3a40ca847a883246472d2e) 40 + +[Receiving a DomainAnnouncement Frame method](#section_5b6bbb79f4e04bd8a1ba5ccd86404143) 42 + +[Receiving a GetBackupListRequest Frame method](#section_10737253c7684b30a0c27e099f16c5b5) 43 + +[Receiving a HostAnnouncement Frame method](#section_b17dc0899e9643f693ee9ed9c96beada) 41 + +[Receiving a LocalMasterAnnouncement Frame method](#section_2ca216dcd9ae4b0698444c0b9548fdb5) 41 + +[Receiving a NetServerEnum2 or NetServerEnum3 Request method](#section_995d4fc31e1e4f5095fe190674021266) 43 + +[Receiving a NetServerEnum2 Response method](#section_a694bcb248fa445d96217157552dc6c6) 31 + +[Receiving a RequestElection Frame method](#section_557253965304455caf5b3224e238b2e0) 44 + +[Receiving an AnnouncementRequest Frame method](#section_37e20e380d5a435c931d8d8e0d2ffb9b) 33 + +[References](#section_d2961358aeca4e8d8b38a20a7c206ebe) 9 + +[informative](#section_913c9eff4ea8484ea3b9601a088982a4) 10 + +[normative](#section_9f29a1cacb154a92b0bff05cf049f649) 9 + +[Relationship to other protocols](#section_774fa3f3fd244c349b1bf3fd92c70081) 11 + +[RequestElection Frame](#section_557253965304455caf5b3224e238b2e0) 44 + +[RequestElection_Browser_Frame packet](#section_6c68cb9eedfc498481a858304a0b1c1d) 22 + +[ResetStateRequest_Browser_Frame packet](#section_91575c1a07a04d278aa5a11698552c40) 26 + +[Retrieving a List of Backup Browser Servers method](#section_a53e834fd4a04cae94b90651828e12f9) 30 + +S + +[Security](#section_7ac6d66b5f714e08a74ab4ba4c0c537c) 57 + +[implementer considerations](#section_9b74c6e1e4654efab1e06cc5bc93ccdb) 57 + +[parameter index](#section_b4b5e378db90409c8c5082752791ef7a) 57 + +[Sending a GetBackupListResponse Frame method](#section_992e6c5b43f04fdaa4f5e075471af6f8) 46 + +[Sending a HostAnnouncement Frame method](#section_9bbd54b40f894b008976247cc9d17f31) 33 + +Sending a RequestElection Frame method ([section 3.1.5.3](#section_ff716dc43a2e453283b7a5745698c8d9) 31, [section 3.3.5.11](#section_0e918944016c450ba49152d3394e2cdc) 47) + +[Sending BecomeBackup Frames method](#section_ca95bb43405e4499860217131d7ebc7e) 44 + +[Sending ResetState Frames](#section_543f5af3b72147c38303f2bde1bc8496) 46 + +[Sending ResetState Frames method](#section_543f5af3b72147c38303f2bde1bc8496) 46 + +Sequencing rules + +[browser server](#section_6ed7dd194e3c468e8d95544cd50d3738) 40 + +[client](#section_3e079abc663b4670bd4b743d24d2397d) 30 + +[domain master browser server](#section_672e9129e5044fa38b5416ad1ca795c3) 53 + +[nonbrowser server](#section_3848011c5ad74b8e8ef7a29d803625f8) 33 + +server ([section 3.2.5](#section_3848011c5ad74b8e8ef7a29d803625f8) 33, [section 3.3.5](#section_6ed7dd194e3c468e8d95544cd50d3738) 40) + +Server + +abstract data model ([section 3.2.1](#section_99ce879d612b47c29d51f8a713aed86f) 32, [section 3.3.1](#section_59e4ad47ca6547edb3704758a033e690) 36) + +[browser interface](#section_eaff330e02364263a7d7c19ec307d6df) 34 + +initialization ([section 3.2.3](#section_30a503dda7554d0ca266c1e045951bb3) 33, [section 3.3.3](#section_03da00e65cb34adcb7de04f9b4d31017) 38) + +local events ([section 3.2.7](#section_eadfff38b0ea476d9e2371144ddb2fc3) 34, [section 3.3.7](#section_fa094f6690d243f187de5e1f8a89f359) 51) + +message processing ([section 3.2.5](#section_3848011c5ad74b8e8ef7a29d803625f8) 33, [section 3.3.5](#section_6ed7dd194e3c468e8d95544cd50d3738) 40) + +[overview](#section_eaff330e02364263a7d7c19ec307d6df) 34 + +[Receiving a BecomeBackup Frame method](#section_3e9084b16d3a40ca847a883246472d2e) 40 + +[Receiving a DomainAnnouncement Frame method](#section_5b6bbb79f4e04bd8a1ba5ccd86404143) 42 + +[Receiving a GetBackupListRequest Frame method](#section_10737253c7684b30a0c27e099f16c5b5) 43 + +[Receiving a HostAnnouncement Frame method](#section_b17dc0899e9643f693ee9ed9c96beada) 41 + +[Receiving a LocalMasterAnnouncement Frame method](#section_2ca216dcd9ae4b0698444c0b9548fdb5) 41 + +[Receiving a NetServerEnum2 or NetServerEnum3 Request method](#section_995d4fc31e1e4f5095fe190674021266) 43 + +[Receiving a RequestElection Frame method](#section_557253965304455caf5b3224e238b2e0) 44 + +[Receiving an AnnouncementRequest Frame method](#section_37e20e380d5a435c931d8d8e0d2ffb9b) 33 + +[Sending a GetBackupListResponse Frame method](#section_992e6c5b43f04fdaa4f5e075471af6f8) 46 + +[Sending a HostAnnouncement Frame method](#section_9bbd54b40f894b008976247cc9d17f31) 33 + +[Sending a RequestElection Frame method](#section_0e918944016c450ba49152d3394e2cdc) 47 + +[Sending BecomeBackup Frames method](#section_ca95bb43405e4499860217131d7ebc7e) 44 + +[Sending ResetState Frames method](#section_543f5af3b72147c38303f2bde1bc8496) 46 + +sequencing rules ([section 3.2.5](#section_3848011c5ad74b8e8ef7a29d803625f8) 33, [section 3.3.5](#section_6ed7dd194e3c468e8d95544cd50d3738) 40) + +timer events ([section 3.2.6](#section_b3ab99037158486982b0f44dda04a52e) 34, [section 3.3.6](#section_eb955ab5470a4810b18e6c3659a5199e) 47) + +timers ([section 3.2.2](#section_c76cc35a7481439b9749610749d05533) 32, [section 3.3.2](#section_43cefc76d82d466e958ff6f6371f26d9) 37) + +Server - browser + +[higher-layer triggered events](#section_d1d04385b2f24a24b238cf61146288cd) 39 + +[initialization](#section_03da00e65cb34adcb7de04f9b4d31017) 38 + +[local events](#section_fa094f6690d243f187de5e1f8a89f359) 51 + +[message processing](#section_6ed7dd194e3c468e8d95544cd50d3738) 40 + +[overview](#section_eaff330e02364263a7d7c19ec307d6df) 34 + +[sequencing rules](#section_6ed7dd194e3c468e8d95544cd50d3738) 40 + +[timer events](#section_eb955ab5470a4810b18e6c3659a5199e) 47 + +[timers](#section_43cefc76d82d466e958ff6f6371f26d9) 37 + +Server - domain master browser + +[abstract data model](#section_4b884d971bfa43edb700fe7ad0002c80) 51 + +[higher-layer triggered events](#section_4b30a1625f694dad89f4d5fc3be99d66) 52 + +[initialization](#section_1e40fb2279004aab89907821207f8647) 52 + +[local events](#section_855b07a3c8ce4a1b8ff2e74ef24c68ac) 53 + +[message processing](#section_672e9129e5044fa38b5416ad1ca795c3) 53 + +[overview](#section_8e18326b26a24790a914d69f64250eb4) 51 + +[sequencing rules](#section_672e9129e5044fa38b5416ad1ca795c3) 53 + +[timers](#section_76b93b8c2d3e4534b129b959f34a8ec1) 52 + +Server - nonbrowser + +[abstract data model](#section_99ce879d612b47c29d51f8a713aed86f) 32 + +[higher-layer triggered events](#section_3f24a7d068e64e669a0ff2d4cfd0a951) 33 + +[initialization](#section_30a503dda7554d0ca266c1e045951bb3) 33 + +[local events](#section_eadfff38b0ea476d9e2371144ddb2fc3) 34 + +[message processing](#section_3848011c5ad74b8e8ef7a29d803625f8) 33 + +[sequencing rules](#section_3848011c5ad74b8e8ef7a29d803625f8) 33 + +[timer events](#section_b3ab99037158486982b0f44dda04a52e) 34 + +[timers](#section_c76cc35a7481439b9749610749d05533) 32 + +[Standards assignments](#section_1bde560788bd4dca99b8deb4d60cce79) 14 + +[Syntax - message](#section_0e74d70edcf7422e8285e2e193f363d9) 18 + +T + +Timer events + +[browser server](#section_eb955ab5470a4810b18e6c3659a5199e) 47 + +[client](#section_0fef49b090f54a9da87ad2c94be6e7ae) 32 + +[nonbrowser server](#section_b3ab99037158486982b0f44dda04a52e) 34 + +server ([section 3.2.6](#section_b3ab99037158486982b0f44dda04a52e) 34, [section 3.3.6](#section_eb955ab5470a4810b18e6c3659a5199e) 47) + +Timers + +[browser server](#section_43cefc76d82d466e958ff6f6371f26d9) 37 + +[client](#section_a0c24bbe49a44228a8ef558b28a5b41a) 29 + +[domain master browser server](#section_76b93b8c2d3e4534b129b959f34a8ec1) 52 + +[nonbrowser server](#section_c76cc35a7481439b9749610749d05533) 32 + +server ([section 3.2.2](#section_c76cc35a7481439b9749610749d05533) 32, [section 3.3.2](#section_43cefc76d82d466e958ff6f6371f26d9) 37) + +[Tracking changes](#section_803d8f4bef6b45deb7ac7f0cfbd00040) 64 + +[Transport](#section_ced2f3444e604eab87a0ec4dda60b2ff) 16 + +[Transport - message](#section_ced2f3444e604eab87a0ec4dda60b2ff) 16 + +Triggered events - higher-layer + +[browser server](#section_d1d04385b2f24a24b238cf61146288cd) 39 + +[client](#section_2e370282752a4df5a4689c2868e5bfeb) 30 + +[domain master browser server](#section_4b30a1625f694dad89f4d5fc3be99d66) 52 + +[nonbrowser server](#section_3f24a7d068e64e669a0ff2d4cfd0a951) 33 + +U + +[Unique names](#section_b064c2e78bdb4ee99857ca91662f4f1e) 17 + +V + +[Vendor-extensible fields](#section_bb476516a10147f7878919cc4a8ee75f) 14 + +[Versioning](#section_73294abe55a8495699271e937870308f) 14 \ No newline at end of file diff --git a/spec/ms-cifs.md b/spec/ms-cifs.md new file mode 100644 index 0000000..38b5e1a --- /dev/null +++ b/spec/ms-cifs.md @@ -0,0 +1,27033 @@ +**\[MS-CIFS\]:** + +**Common Internet File System (CIFS) Protocol** + +Intellectual Property Rights Notice for Open Specifications Documentation + +- **Technical Documentation.** Microsoft publishes Open Specifications documentation ("this documentation") for protocols, file formats, data portability, computer languages, and standards support. Additionally, overview documents cover inter-protocol relationships and interactions. +- **Copyrights**. This documentation is covered by Microsoft copyrights. Regardless of any other terms that are contained in the terms of use for the Microsoft website that hosts this documentation, you can make copies of it in order to develop implementations of the technologies that are described in this documentation and can distribute portions of it in your implementations that use these technologies or in your documentation as necessary to properly document the implementation. You can also distribute in your implementation, with or without modification, any schemas, IDLs, or code samples that are included in the documentation. This permission also applies to any documents that are referenced in the Open Specifications documentation. +- **No Trade Secrets**. Microsoft does not claim any trade secret rights in this documentation. +- **Patents**. Microsoft has patents that might cover your implementations of the technologies described in the Open Specifications documentation. Neither this notice nor Microsoft's delivery of this documentation grants any licenses under those patents or any other Microsoft patents. However, a given Open Specifications document might be covered by the Microsoft [Open Specifications Promise](https://go.microsoft.com/fwlink/?LinkId=214445) or the [Microsoft Community Promise](https://go.microsoft.com/fwlink/?LinkId=214448). If you would prefer a written license, or if the technologies described in this documentation are not covered by the Open Specifications Promise or Community Promise, as applicable, patent licenses are available by contacting [iplg@microsoft.com](mailto:iplg@microsoft.com). +- **License Programs**. To see all of the protocols in scope under a specific license program and the associated patents, visit the [Patent Map](https://aka.ms/AA9ufj8). +- **Trademarks**. The names of companies and products contained in this documentation might be covered by trademarks or similar intellectual property rights. This notice does not grant any licenses under those rights. For a list of Microsoft trademarks, visit [www.microsoft.com/trademarks](https://www.microsoft.com/trademarks). +- **Fictitious Names**. The example companies, organizations, products, domain names, email addresses, logos, people, places, and events that are depicted in this documentation are fictitious. No association with any real company, organization, product, domain name, email address, logo, person, place, or event is intended or should be inferred. + +**Reservation of Rights**. All other rights are reserved, and this notice does not grant any rights other than as specifically described above, whether by implication, estoppel, or otherwise. + +**Tools**. The Open Specifications documentation does not require the use of Microsoft programming tools or programming environments in order for you to develop an implementation. If you have access to Microsoft programming tools and environments, you are free to take advantage of them. Certain Open Specifications documents are intended for use in conjunction with publicly available standards specifications and network programming art and, as such, assume that the reader either is familiar with the aforementioned material or has immediate access to it. + +**Support.** For questions and support, please contact [dochelp@microsoft.com](mailto:dochelp@microsoft.com). + +**Revision Summary** + +| Date | Revision History | Revision Class | Comments | +| ---------- | ---------------- | -------------- | ---------------------------------------------------------------------------- | +| 9/25/2009 | 1.0 | Major | First Release. | +| 11/6/2009 | 2.0 | Major | Updated and revised the technical content. | +| 12/18/2009 | 3.0 | Major | Updated and revised the technical content. | +| 1/29/2010 | 4.0 | Major | Updated and revised the technical content. | +| 3/12/2010 | 5.0 | Major | Updated and revised the technical content. | +| 4/23/2010 | 6.0 | Major | Updated and revised the technical content. | +| 6/4/2010 | 7.0 | Major | Updated and revised the technical content. | +| 7/16/2010 | 8.0 | Major | Updated and revised the technical content. | +| 8/27/2010 | 9.0 | Major | Updated and revised the technical content. | +| 10/8/2010 | 10.0 | Major | Updated and revised the technical content. | +| 11/19/2010 | 11.0 | Major | Updated and revised the technical content. | +| 1/7/2011 | 12.0 | Major | Updated and revised the technical content. | +| 2/11/2011 | 13.0 | Major | Updated and revised the technical content. | +| 3/25/2011 | 14.0 | Major | Updated and revised the technical content. | +| 5/6/2011 | 15.0 | Major | Updated and revised the technical content. | +| 6/17/2011 | 15.1 | Minor | Clarified the meaning of the technical content. | +| 9/23/2011 | 16.0 | Major | Updated and revised the technical content. | +| 12/16/2011 | 17.0 | Major | Updated and revised the technical content. | +| 3/30/2012 | 18.0 | Major | Updated and revised the technical content. | +| 7/12/2012 | 19.0 | Major | Updated and revised the technical content. | +| 10/25/2012 | 20.0 | Major | Updated and revised the technical content. | +| 1/31/2013 | 21.0 | Major | Updated and revised the technical content. | +| 8/8/2013 | 22.0 | Major | Updated and revised the technical content. | +| 11/14/2013 | 22.0 | None | No changes to the meaning, language, or formatting of the technical content. | +| 2/13/2014 | 23.0 | Major | Updated and revised the technical content. | +| 5/15/2014 | 24.0 | Major | Updated and revised the technical content. | +| 6/30/2015 | 25.0 | Major | Significantly changed the technical content. | +| 10/16/2015 | 25.0 | None | No changes to the meaning, language, or formatting of the technical content. | +| 7/14/2016 | 26.0 | Major | Significantly changed the technical content. | +| 6/1/2017 | 27.0 | Major | Significantly changed the technical content. | +| 9/12/2018 | 28.0 | Major | Significantly changed the technical content. | +| 3/4/2020 | 29.0 | Major | Significantly changed the technical content. | +| 10/1/2020 | 30.0 | Major | Significantly changed the technical content. | +| 11/19/2024 | 31.0 | Major | Significantly changed the technical content. | +| 1/13/2025 | 31.0 | None | No changes to the meaning, language, or formatting of the technical content. | +| 2/10/2025 | 31.0 | None | No changes to the meaning, language, or formatting of the technical content. | +| 6/10/2025 | 31.0 | None | No changes to the meaning, language, or formatting of the technical content. | +| 11/21/2025 | 31.0 | None | No changes to the meaning, language, or formatting of the technical content. | + +Table of Contents + +[1 Introduction 17](#_Toc214495456) + +[1.1 Glossary 17](#_Toc214495457) + +[1.2 References 23](#_Toc214495458) + +[1.2.1 Normative References 23](#_Toc214495459) + +[1.2.2 Informative References 24](#_Toc214495460) + +[1.3 Overview 27](#_Toc214495461) + +[1.4 Relationship to Other Protocols 29](#_Toc214495462) + +[1.5 Prerequisites/Preconditions 30](#_Toc214495463) + +[1.6 Applicability Statement 30](#_Toc214495464) + +[1.7 Versioning and Capability Negotiation 30](#_Toc214495465) + +[1.8 Vendor-Extensible Fields 32](#_Toc214495466) + +[1.9 Standards Assignments 33](#_Toc214495467) + +[2 Messages 34](#_Toc214495468) + +[2.1 Transport 34](#_Toc214495469) + +[2.1.1 NetBIOS-Based Transports 34](#_Toc214495470) + +[2.1.1.1 NetBIOS Frames (NBF) Protocol Transport 34](#_Toc214495471) + +[2.1.1.2 NetBIOS over TCP/UDP (NBT) Transport 35](#_Toc214495472) + +[2.1.1.3 NetBIOS over IPX/SPX (NBIPX) Transport 35](#_Toc214495473) + +[2.1.1.4 Other NetBIOS-Based Transports 35](#_Toc214495474) + +[2.1.2 Direct Hosting 35](#_Toc214495475) + +[2.1.2.1 Direct IPX Transport 35](#_Toc214495476) + +[2.1.3 Virtual Circuits 39](#_Toc214495477) + +[2.2 Message Syntax 39](#_Toc214495478) + +[2.2.1 Common Data Types 41](#_Toc214495479) + +[2.2.1.1 Character Sequences 42](#_Toc214495480) + +[2.2.1.1.1 File and Directory names 42](#_Toc214495481) + +[2.2.1.1.2 Pathnames 43](#_Toc214495482) + +[2.2.1.1.3 Wildcards 43](#_Toc214495483) + +[2.2.1.2 File Attributes 43](#_Toc214495484) + +[2.2.1.2.1 SMB_GEA 43](#_Toc214495485) + +[2.2.1.2.1.1 SMB_GEA_LIST 44](#_Toc214495486) + +[2.2.1.2.2 SMB_FEA 44](#_Toc214495487) + +[2.2.1.2.2.1 SMB_FEA_LIST 46](#_Toc214495488) + +[2.2.1.2.3 SMB_EXT_FILE_ATTR 46](#_Toc214495489) + +[2.2.1.2.4 SMB_FILE_ATTRIBUTES 47](#_Toc214495490) + +[2.2.1.3 Named Pipe Status (SMB_NMPIPE_STATUS) 48](#_Toc214495491) + +[2.2.1.4 Time 49](#_Toc214495492) + +[2.2.1.4.1 SMB_DATE 50](#_Toc214495493) + +[2.2.1.4.2 SMB_TIME 50](#_Toc214495494) + +[2.2.1.4.3 UTIME 50](#_Toc214495495) + +[2.2.1.5 Status Codes (SMB_ERROR) 50](#_Toc214495496) + +[2.2.1.6 Unique Identifiers 51](#_Toc214495497) + +[2.2.1.6.1 FID Generation 52](#_Toc214495498) + +[2.2.1.6.2 MID Generation 52](#_Toc214495499) + +[2.2.1.6.3 PID Generation 52](#_Toc214495500) + +[2.2.1.6.4 Connection ID (CID) Generation 53](#_Toc214495501) + +[2.2.1.6.5 Search ID (SID) Generation 53](#_Toc214495502) + +[2.2.1.6.6 SessionKey Generation 53](#_Toc214495503) + +[2.2.1.6.7 TID Generation 54](#_Toc214495504) + +[2.2.1.6.8 UID Generation 54](#_Toc214495505) + +[2.2.2 Defined Constants 54](#_Toc214495506) + +[2.2.2.1 SMB_COM Command Codes 54](#_Toc214495507) + +[2.2.2.2 Transaction Subcommand Codes 61](#_Toc214495508) + +[2.2.2.3 Information Level Codes 64](#_Toc214495509) + +[2.2.2.3.1 FIND Information Level Codes 64](#_Toc214495510) + +[2.2.2.3.2 QUERY_FS Information Level Codes 65](#_Toc214495511) + +[2.2.2.3.3 QUERY Information Level Codes 65](#_Toc214495512) + +[2.2.2.3.4 SET Information Level Codes 66](#_Toc214495513) + +[2.2.2.4 SMB Error Classes and Codes 67](#_Toc214495514) + +[2.2.2.5 Data Buffer Format Codes 77](#_Toc214495515) + +[2.2.3 SMB Message Structure 78](#_Toc214495516) + +[2.2.3.1 The SMB Header 78](#_Toc214495517) + +[2.2.3.2 Parameter Block 83](#_Toc214495518) + +[2.2.3.3 Data Block 84](#_Toc214495519) + +[2.2.3.4 Batched Messages ("AndX" Messages) 84](#_Toc214495520) + +[2.2.3.4.1 Follow-on Commands 85](#_Toc214495521) + +[2.2.4 SMB Commands 85](#_Toc214495522) + +[2.2.4.1 SMB_COM_CREATE_DIRECTORY (0x00) 85](#_Toc214495523) + +[2.2.4.1.1 Request 86](#_Toc214495524) + +[2.2.4.1.2 Response 86](#_Toc214495525) + +[2.2.4.2 SMB_COM_DELETE_DIRECTORY (0x01) 88](#_Toc214495526) + +[2.2.4.2.1 Request 88](#_Toc214495527) + +[2.2.4.2.2 Response 89](#_Toc214495528) + +[2.2.4.3 SMB_COM_OPEN (0x02) 91](#_Toc214495529) + +[2.2.4.3.1 Request 91](#_Toc214495530) + +[2.2.4.3.2 Response 94](#_Toc214495531) + +[2.2.4.4 SMB_COM_CREATE (0x03) 97](#_Toc214495532) + +[2.2.4.4.1 Request 97](#_Toc214495533) + +[2.2.4.4.2 Response 99](#_Toc214495534) + +[2.2.4.5 SMB_COM_CLOSE (0x04) 102](#_Toc214495535) + +[2.2.4.5.1 Request 102](#_Toc214495536) + +[2.2.4.5.2 Response 103](#_Toc214495537) + +[2.2.4.6 SMB_COM_FLUSH (0x05) 104](#_Toc214495538) + +[2.2.4.6.1 Request 104](#_Toc214495539) + +[2.2.4.6.2 Response 105](#_Toc214495540) + +[2.2.4.7 SMB_COM_DELETE (0x06) 107](#_Toc214495541) + +[2.2.4.7.1 Request 107](#_Toc214495542) + +[2.2.4.7.2 Response 108](#_Toc214495543) + +[2.2.4.8 SMB_COM_RENAME (0x07) 109](#_Toc214495544) + +[2.2.4.8.1 Request 109](#_Toc214495545) + +[2.2.4.8.2 Response 111](#_Toc214495546) + +[2.2.4.9 SMB_COM_QUERY_INFORMATION (0x08) 113](#_Toc214495547) + +[2.2.4.9.1 Request 113](#_Toc214495548) + +[2.2.4.9.2 Response 114](#_Toc214495549) + +[2.2.4.10 SMB_COM_SET_INFORMATION (0x09) 117](#_Toc214495550) + +[2.2.4.10.1 Request 117](#_Toc214495551) + +[2.2.4.10.2 Response 118](#_Toc214495552) + +[2.2.4.11 SMB_COM_READ (0x0A) 120](#_Toc214495553) + +[2.2.4.11.1 Request 120](#_Toc214495554) + +[2.2.4.11.2 Response 122](#_Toc214495555) + +[2.2.4.12 SMB_COM_WRITE (0x0B) 125](#_Toc214495556) + +[2.2.4.12.1 Request 125](#_Toc214495557) + +[2.2.4.12.2 Response 127](#_Toc214495558) + +[2.2.4.13 SMB_COM_LOCK_BYTE_RANGE (0x0C) 130](#_Toc214495559) + +[2.2.4.13.1 Request 130](#_Toc214495560) + +[2.2.4.13.2 Response 132](#_Toc214495561) + +[2.2.4.14 SMB_COM_UNLOCK_BYTE_RANGE (0x0D) 133](#_Toc214495562) + +[2.2.4.14.1 Request 134](#_Toc214495563) + +[2.2.4.14.2 Response 135](#_Toc214495564) + +[2.2.4.15 SMB_COM_CREATE_TEMPORARY (0x0E) 137](#_Toc214495565) + +[2.2.4.15.1 Request 137](#_Toc214495566) + +[2.2.4.15.2 Response 138](#_Toc214495567) + +[2.2.4.16 SMB_COM_CREATE_NEW (0x0F) 141](#_Toc214495568) + +[2.2.4.16.1 Request 141](#_Toc214495569) + +[2.2.4.16.2 Response 143](#_Toc214495570) + +[2.2.4.17 SMB_COM_CHECK_DIRECTORY (0x10) 145](#_Toc214495571) + +[2.2.4.17.1 Request 145](#_Toc214495572) + +[2.2.4.17.2 Response 146](#_Toc214495573) + +[2.2.4.18 SMB_COM_PROCESS_EXIT (0x11) 147](#_Toc214495574) + +[2.2.4.18.1 Request 147](#_Toc214495575) + +[2.2.4.18.2 Response 148](#_Toc214495576) + +[2.2.4.19 SMB_COM_SEEK (0x12) 149](#_Toc214495577) + +[2.2.4.19.1 Request 150](#_Toc214495578) + +[2.2.4.19.2 Response 151](#_Toc214495579) + +[2.2.4.20 SMB_COM_LOCK_AND_READ (0x13) 153](#_Toc214495580) + +[2.2.4.20.1 Request 153](#_Toc214495581) + +[2.2.4.20.2 Response 154](#_Toc214495582) + +[2.2.4.21 SMB_COM_WRITE_AND_UNLOCK (0x14) 158](#_Toc214495583) + +[2.2.4.21.1 Request 158](#_Toc214495584) + +[2.2.4.21.2 Response 160](#_Toc214495585) + +[2.2.4.22 SMB_COM_READ_RAW (0x1A) 163](#_Toc214495586) + +[2.2.4.22.1 Request 163](#_Toc214495587) + +[2.2.4.22.2 Response 165](#_Toc214495588) + +[2.2.4.23 SMB_COM_READ_MPX (0x1B) 166](#_Toc214495589) + +[2.2.4.23.1 Request 166](#_Toc214495590) + +[2.2.4.23.2 Response 168](#_Toc214495591) + +[2.2.4.24 SMB_COM_READ_MPX_SECONDARY (0x1C) 171](#_Toc214495592) + +[2.2.4.25 SMB_COM_WRITE_RAW (0x1D) 172](#_Toc214495593) + +[2.2.4.25.1 Request 172](#_Toc214495594) + +[2.2.4.25.2 Interim Server Response 175](#_Toc214495595) + +[2.2.4.25.3 Final Server Response 176](#_Toc214495596) + +[2.2.4.26 SMB_COM_WRITE_MPX (0x1E) 179](#_Toc214495597) + +[2.2.4.26.1 Request 179](#_Toc214495598) + +[2.2.4.26.2 Response 182](#_Toc214495599) + +[2.2.4.27 SMB_COM_WRITE_MPX_SECONDARY (0x1F) 185](#_Toc214495600) + +[2.2.4.28 SMB_COM_WRITE_COMPLETE (0x20) 185](#_Toc214495601) + +[2.2.4.29 SMB_COM_QUERY_SERVER (0x21) 185](#_Toc214495602) + +[2.2.4.30 SMB_COM_SET_INFORMATION2 (0x22) 185](#_Toc214495603) + +[2.2.4.30.1 Request 185](#_Toc214495604) + +[2.2.4.30.2 Response 187](#_Toc214495605) + +[2.2.4.31 SMB_COM_QUERY_INFORMATION2 (0x23) 188](#_Toc214495606) + +[2.2.4.31.1 Request 189](#_Toc214495607) + +[2.2.4.31.2 Response 189](#_Toc214495608) + +[2.2.4.32 SMB_COM_LOCKING_ANDX (0x24) 192](#_Toc214495609) + +[2.2.4.32.1 Request 193](#_Toc214495610) + +[2.2.4.32.2 Response 197](#_Toc214495611) + +[2.2.4.33 SMB_COM_TRANSACTION (0x25) 200](#_Toc214495612) + +[2.2.4.33.1 Request 200](#_Toc214495613) + +[2.2.4.33.2 Response 205](#_Toc214495614) + +[2.2.4.34 SMB_COM_TRANSACTION_SECONDARY (0x26) 210](#_Toc214495615) + +[2.2.4.34.1 Request 210](#_Toc214495616) + +[2.2.4.34.2 Response 213](#_Toc214495617) + +[2.2.4.35 SMB_COM_IOCTL (0x27) 213](#_Toc214495618) + +[2.2.4.35.1 Request 214](#_Toc214495619) + +[2.2.4.35.2 Response 217](#_Toc214495620) + +[2.2.4.36 SMB_COM_IOCTL_SECONDARY (0x28) 220](#_Toc214495621) + +[2.2.4.37 SMB_COM_COPY (0x29) 221](#_Toc214495622) + +[2.2.4.38 SMB_COM_MOVE (0x2A) 221](#_Toc214495623) + +[2.2.4.39 SMB_COM_ECHO (0x2B) 221](#_Toc214495624) + +[2.2.4.39.1 Request 221](#_Toc214495625) + +[2.2.4.39.2 Response 222](#_Toc214495626) + +[2.2.4.40 SMB_COM_WRITE_AND_CLOSE (0x2C) 224](#_Toc214495627) + +[2.2.4.40.1 Request 224](#_Toc214495628) + +[2.2.4.40.2 Response 226](#_Toc214495629) + +[2.2.4.41 SMB_COM_OPEN_ANDX (0x2D) 229](#_Toc214495630) + +[2.2.4.41.1 Request 229](#_Toc214495631) + +[2.2.4.41.2 Response 233](#_Toc214495632) + +[2.2.4.42 SMB_COM_READ_ANDX (0x2E) 238](#_Toc214495633) + +[2.2.4.42.1 Request 238](#_Toc214495634) + +[2.2.4.42.2 Response 240](#_Toc214495635) + +[2.2.4.43 SMB_COM_WRITE_ANDX (0x2F) 244](#_Toc214495636) + +[2.2.4.43.1 Request 245](#_Toc214495637) + +[2.2.4.43.2 Response 248](#_Toc214495638) + +[2.2.4.44 SMB_COM_NEW_FILE_SIZE (0x30) 251](#_Toc214495639) + +[2.2.4.45 SMB_COM_CLOSE_AND_TREE_DISC (0x31) 252](#_Toc214495640) + +[2.2.4.46 SMB_COM_TRANSACTION2 (0x32) 252](#_Toc214495641) + +[2.2.4.46.1 Request 252](#_Toc214495642) + +[2.2.4.46.2 Response 257](#_Toc214495643) + +[2.2.4.47 SMB_COM_TRANSACTION2_SECONDARY (0x33) 261](#_Toc214495644) + +[2.2.4.47.1 Request 261](#_Toc214495645) + +[2.2.4.47.2 Response 264](#_Toc214495646) + +[2.2.4.48 SMB_COM_FIND_CLOSE2 (0x34) 264](#_Toc214495647) + +[2.2.4.48.1 Request 264](#_Toc214495648) + +[2.2.4.48.2 Response 265](#_Toc214495649) + +[2.2.4.49 SMB_COM_FIND_NOTIFY_CLOSE (0x35) 266](#_Toc214495650) + +[2.2.4.50 SMB_COM_TREE_CONNECT (0x70) 266](#_Toc214495651) + +[2.2.4.50.1 Request 266](#_Toc214495652) + +[2.2.4.50.2 Response 268](#_Toc214495653) + +[2.2.4.51 SMB_COM_TREE_DISCONNECT (0x71) 270](#_Toc214495654) + +[2.2.4.51.1 Request 271](#_Toc214495655) + +[2.2.4.51.2 Response 271](#_Toc214495656) + +[2.2.4.52 SMB_COM_NEGOTIATE (0x72) 272](#_Toc214495657) + +[2.2.4.52.1 Request 272](#_Toc214495658) + +[2.2.4.52.2 Response 274](#_Toc214495659) + +[2.2.4.53 SMB_COM_SESSION_SETUP_ANDX (0x73) 280](#_Toc214495660) + +[2.2.4.53.1 Request 281](#_Toc214495661) + +[2.2.4.53.2 Response 287](#_Toc214495662) + +[2.2.4.54 SMB_COM_LOGOFF_ANDX (0x74) 290](#_Toc214495663) + +[2.2.4.54.1 Request 290](#_Toc214495664) + +[2.2.4.54.2 Response 291](#_Toc214495665) + +[2.2.4.55 SMB_COM_TREE_CONNECT_ANDX (0x75) 293](#_Toc214495666) + +[2.2.4.55.1 Request 293](#_Toc214495667) + +[2.2.4.55.2 Response 297](#_Toc214495668) + +[2.2.4.56 SMB_COM_SECURITY_PACKAGE_ANDX (0x7E) 300](#_Toc214495669) + +[2.2.4.57 SMB_COM_QUERY_INFORMATION_DISK (0x80) 300](#_Toc214495670) + +[2.2.4.57.1 Request 300](#_Toc214495671) + +[2.2.4.57.2 Response 301](#_Toc214495672) + +[2.2.4.58 SMB_COM_SEARCH (0x81) 303](#_Toc214495673) + +[2.2.4.58.1 Request 303](#_Toc214495674) + +[2.2.4.58.2 Response 306](#_Toc214495675) + +[2.2.4.59 SMB_COM_FIND (0x82) 310](#_Toc214495676) + +[2.2.4.59.1 Request 310](#_Toc214495677) + +[2.2.4.59.2 Response 312](#_Toc214495678) + +[2.2.4.60 SMB_COM_FIND_UNIQUE (0x83) 316](#_Toc214495679) + +[2.2.4.60.1 Request 316](#_Toc214495680) + +[2.2.4.60.2 Response 318](#_Toc214495681) + +[2.2.4.61 SMB_COM_FIND_CLOSE (0x84) 321](#_Toc214495682) + +[2.2.4.61.1 Request 321](#_Toc214495683) + +[2.2.4.61.2 Response 323](#_Toc214495684) + +[2.2.4.62 SMB_COM_NT_TRANSACT (0xA0) 325](#_Toc214495685) + +[2.2.4.62.1 Request 326](#_Toc214495686) + +[2.2.4.62.2 Response 330](#_Toc214495687) + +[2.2.4.63 SMB_COM_NT_TRANSACT_SECONDARY (0xA1) 334](#_Toc214495688) + +[2.2.4.63.1 Request 334](#_Toc214495689) + +[2.2.4.63.2 Response 337](#_Toc214495690) + +[2.2.4.64 SMB_COM_NT_CREATE_ANDX (0xA2) 338](#_Toc214495691) + +[2.2.4.64.1 Request 338](#_Toc214495692) + +[2.2.4.64.2 Response 346](#_Toc214495693) + +[2.2.4.65 SMB_COM_NT_CANCEL (0xA4) 351](#_Toc214495694) + +[2.2.4.65.1 Request 352](#_Toc214495695) + +[2.2.4.66 SMB_COM_NT_RENAME (0xA5) 353](#_Toc214495696) + +[2.2.4.66.1 Request 353](#_Toc214495697) + +[2.2.4.66.2 Response 354](#_Toc214495698) + +[2.2.4.67 SMB_COM_OPEN_PRINT_FILE (0xC0) 356](#_Toc214495699) + +[2.2.4.67.1 Request 356](#_Toc214495700) + +[2.2.4.67.2 Response 358](#_Toc214495701) + +[2.2.4.68 SMB_COM_WRITE_PRINT_FILE (0xC1) 360](#_Toc214495702) + +[2.2.4.68.1 Request 360](#_Toc214495703) + +[2.2.4.68.2 Response 361](#_Toc214495704) + +[2.2.4.69 SMB_COM_CLOSE_PRINT_FILE (0xC2) 363](#_Toc214495705) + +[2.2.4.69.1 Request 363](#_Toc214495706) + +[2.2.4.69.2 Response 364](#_Toc214495707) + +[2.2.4.70 SMB_COM_GET_PRINT_QUEUE (0xC3) 365](#_Toc214495708) + +[2.2.4.71 SMB_COM_READ_BULK (0xD8) 365](#_Toc214495709) + +[2.2.4.72 SMB_COM_WRITE_BULK (0xD9) 365](#_Toc214495710) + +[2.2.4.73 SMB_COM_WRITE_BULK_DATA (0xDA) 365](#_Toc214495711) + +[2.2.4.74 SMB_COM_INVALID (0xFE) 365](#_Toc214495712) + +[2.2.4.75 SMB_COM_NO_ANDX_COMMAND (0xFF) 366](#_Toc214495713) + +[2.2.5 Transaction Subcommands 366](#_Toc214495714) + +[2.2.5.1 TRANS_SET_NMPIPE_STATE (0x0001) 366](#_Toc214495715) + +[2.2.5.1.1 Request 366](#_Toc214495716) + +[2.2.5.1.2 Response 367](#_Toc214495717) + +[2.2.5.2 TRANS_RAW_READ_NMPIPE (0x0011) 369](#_Toc214495718) + +[2.2.5.2.1 Request 369](#_Toc214495719) + +[2.2.5.2.2 Response 369](#_Toc214495720) + +[2.2.5.3 TRANS_QUERY_NMPIPE_STATE (0x0021) 371](#_Toc214495721) + +[2.2.5.3.1 Request 371](#_Toc214495722) + +[2.2.5.3.2 Response 372](#_Toc214495723) + +[2.2.5.4 TRANS_QUERY_NMPIPE_INFO (0x0022) 373](#_Toc214495724) + +[2.2.5.4.1 Request 373](#_Toc214495725) + +[2.2.5.4.2 Response 375](#_Toc214495726) + +[2.2.5.5 TRANS_PEEK_NMPIPE (0x0023) 377](#_Toc214495727) + +[2.2.5.5.1 Request 377](#_Toc214495728) + +[2.2.5.5.2 Response 378](#_Toc214495729) + +[2.2.5.6 TRANS_TRANSACT_NMPIPE (0x0026) 380](#_Toc214495730) + +[2.2.5.6.1 Request 380](#_Toc214495731) + +[2.2.5.6.2 Response 381](#_Toc214495732) + +[2.2.5.7 TRANS_RAW_WRITE_NMPIPE (0x0031) 383](#_Toc214495733) + +[2.2.5.7.1 Request 383](#_Toc214495734) + +[2.2.5.7.2 Response 384](#_Toc214495735) + +[2.2.5.8 TRANS_READ_NMPIPE (0x0036) 386](#_Toc214495736) + +[2.2.5.8.1 Request 386](#_Toc214495737) + +[2.2.5.8.2 Response 386](#_Toc214495738) + +[2.2.5.9 TRANS_WRITE_NMPIPE (0x0037) 388](#_Toc214495739) + +[2.2.5.9.1 Request 388](#_Toc214495740) + +[2.2.5.9.2 Response 389](#_Toc214495741) + +[2.2.5.10 TRANS_WAIT_NMPIPE (0x0053) 391](#_Toc214495742) + +[2.2.5.10.1 Request 391](#_Toc214495743) + +[2.2.5.10.2 Response 392](#_Toc214495744) + +[2.2.5.11 TRANS_CALL_NMPIPE (0x0054) 393](#_Toc214495745) + +[2.2.5.11.1 Request 393](#_Toc214495746) + +[2.2.5.11.2 Response 394](#_Toc214495747) + +[2.2.5.12 TRANS_MAILSLOT_WRITE (0x0001) 396](#_Toc214495748) + +[2.2.6 Transaction2 Subcommands 396](#_Toc214495749) + +[2.2.6.1 TRANS2_OPEN2 (0x0000) 396](#_Toc214495750) + +[2.2.6.1.1 Request 396](#_Toc214495751) + +[2.2.6.1.2 Response 399](#_Toc214495752) + +[2.2.6.2 TRANS2_FIND_FIRST2 (0x0001) 402](#_Toc214495753) + +[2.2.6.2.1 Request 403](#_Toc214495754) + +[2.2.6.2.2 Response 404](#_Toc214495755) + +[2.2.6.3 TRANS2_FIND_NEXT2 (0x0002) 406](#_Toc214495756) + +[2.2.6.3.1 Request 407](#_Toc214495757) + +[2.2.6.3.2 Response 409](#_Toc214495758) + +[2.2.6.4 TRANS2_QUERY_FS_INFORMATION (0x0003) 410](#_Toc214495759) + +[2.2.6.4.1 Request 411](#_Toc214495760) + +[2.2.6.4.2 Response 411](#_Toc214495761) + +[2.2.6.5 TRANS2_SET_FS_INFORMATION (0x0004) 412](#_Toc214495762) + +[2.2.6.6 TRANS2_QUERY_PATH_INFORMATION (0x0005) 412](#_Toc214495763) + +[2.2.6.6.1 Request 412](#_Toc214495764) + +[2.2.6.6.2 Response 413](#_Toc214495765) + +[2.2.6.7 TRANS2_SET_PATH_INFORMATION (0x0006) 415](#_Toc214495766) + +[2.2.6.7.1 Request 415](#_Toc214495767) + +[2.2.6.7.2 Response 416](#_Toc214495768) + +[2.2.6.8 TRANS2_QUERY_FILE_INFORMATION (0x0007) 417](#_Toc214495769) + +[2.2.6.8.1 Request 418](#_Toc214495770) + +[2.2.6.8.2 Response 419](#_Toc214495771) + +[2.2.6.9 TRANS2_SET_FILE_INFORMATION (0x0008) 420](#_Toc214495772) + +[2.2.6.9.1 Request 420](#_Toc214495773) + +[2.2.6.9.2 Response 421](#_Toc214495774) + +[2.2.6.10 TRANS2_FSCTL (0x0009) 423](#_Toc214495775) + +[2.2.6.11 TRANS2_IOCTL2 (0x000A) 423](#_Toc214495776) + +[2.2.6.12 TRANS2_FIND_NOTIFY_FIRST (0x000B) 423](#_Toc214495777) + +[2.2.6.13 TRANS2_FIND_NOTIFY_NEXT (0x000C) 423](#_Toc214495778) + +[2.2.6.14 TRANS2_CREATE_DIRECTORY (0x000D) 424](#_Toc214495779) + +[2.2.6.14.1 Request 424](#_Toc214495780) + +[2.2.6.14.2 Response 424](#_Toc214495781) + +[2.2.6.15 TRANS2_SESSION_SETUP (0x000E) 426](#_Toc214495782) + +[2.2.6.16 TRANS2_GET_DFS_REFERRAL (0x0010) 427](#_Toc214495783) + +[2.2.6.16.1 Request 427](#_Toc214495784) + +[2.2.6.16.2 Response 427](#_Toc214495785) + +[2.2.6.17 TRANS2_REPORT_DFS_INCONSISTENCY (0x0011) 428](#_Toc214495786) + +[2.2.7 NT Transact Subcommands 428](#_Toc214495787) + +[2.2.7.1 NT_TRANSACT_CREATE (0x0001) 428](#_Toc214495788) + +[2.2.7.1.1 Request 428](#_Toc214495789) + +[2.2.7.1.2 Response 435](#_Toc214495790) + +[2.2.7.2 NT_TRANSACT_IOCTL (0x0002) 440](#_Toc214495791) + +[2.2.7.2.1 Request 440](#_Toc214495792) + +[2.2.7.2.2 Response 441](#_Toc214495793) + +[2.2.7.3 NT_TRANSACT_SET_SECURITY_DESC (0x0003) 443](#_Toc214495794) + +[2.2.7.3.1 Request 443](#_Toc214495795) + +[2.2.7.3.2 Response 445](#_Toc214495796) + +[2.2.7.4 NT_TRANSACT_NOTIFY_CHANGE (0x0004) 446](#_Toc214495797) + +[2.2.7.4.1 Request 446](#_Toc214495798) + +[2.2.7.4.2 Response 448](#_Toc214495799) + +[2.2.7.5 NT_TRANSACT_RENAME (0x0005) 449](#_Toc214495800) + +[2.2.7.6 NT_TRANSACT_QUERY_SECURITY_DESC (0x0006) 449](#_Toc214495801) + +[2.2.7.6.1 Request 449](#_Toc214495802) + +[2.2.7.6.2 Response 450](#_Toc214495803) + +[2.2.8 Information Levels 452](#_Toc214495804) + +[2.2.8.1 FIND Information Levels 453](#_Toc214495805) + +[2.2.8.1.1 SMB_INFO_STANDARD 453](#_Toc214495806) + +[2.2.8.1.2 SMB_INFO_QUERY_EA_SIZE 454](#_Toc214495807) + +[2.2.8.1.3 SMB_INFO_QUERY_EAS_FROM_LIST 455](#_Toc214495808) + +[2.2.8.1.4 SMB_FIND_FILE_DIRECTORY_INFO 456](#_Toc214495809) + +[2.2.8.1.5 SMB_FIND_FILE_FULL_DIRECTORY_INFO 457](#_Toc214495810) + +[2.2.8.1.6 SMB_FIND_FILE_NAMES_INFO 458](#_Toc214495811) + +[2.2.8.1.7 SMB_FIND_FILE_BOTH_DIRECTORY_INFO 458](#_Toc214495812) + +[2.2.8.2 QUERY_FS Information Levels 459](#_Toc214495813) + +[2.2.8.2.1 SMB_INFO_ALLOCATION 459](#_Toc214495814) + +[2.2.8.2.2 SMB_INFO_VOLUME 460](#_Toc214495815) + +[2.2.8.2.3 SMB_QUERY_FS_VOLUME_INFO 460](#_Toc214495816) + +[2.2.8.2.4 SMB_QUERY_FS_SIZE_INFO 461](#_Toc214495817) + +[2.2.8.2.5 SMB_QUERY_FS_DEVICE_INFO 461](#_Toc214495818) + +[2.2.8.2.6 SMB_QUERY_FS_ATTRIBUTE_INFO 463](#_Toc214495819) + +[2.2.8.3 QUERY Information Levels 463](#_Toc214495820) + +[2.2.8.3.1 SMB_INFO_STANDARD 463](#_Toc214495821) + +[2.2.8.3.2 SMB_INFO_QUERY_EA_SIZE 464](#_Toc214495822) + +[2.2.8.3.3 SMB_INFO_QUERY_EAS_FROM_LIST 465](#_Toc214495823) + +[2.2.8.3.4 SMB_INFO_QUERY_ALL_EAS 465](#_Toc214495824) + +[2.2.8.3.5 SMB_INFO_IS_NAME_VALID 465](#_Toc214495825) + +[2.2.8.3.6 SMB_QUERY_FILE_BASIC_INFO 466](#_Toc214495826) + +[2.2.8.3.7 SMB_QUERY_FILE_STANDARD_INFO 466](#_Toc214495827) + +[2.2.8.3.8 SMB_QUERY_FILE_EA_INFO 467](#_Toc214495828) + +[2.2.8.3.9 SMB_QUERY_FILE_NAME_INFO 467](#_Toc214495829) + +[2.2.8.3.10 SMB_QUERY_FILE_ALL_INFO 467](#_Toc214495830) + +[2.2.8.3.11 SMB_QUERY_FILE_ALT_NAME_INFO 468](#_Toc214495831) + +[2.2.8.3.12 SMB_QUERY_FILE_STREAM_INFO 469](#_Toc214495832) + +[2.2.8.3.13 SMB_QUERY_FILE_COMRESSION_INFO 469](#_Toc214495833) + +[2.2.8.4 SET Information levels 470](#_Toc214495834) + +[2.2.8.4.1 SMB_INFO_STANDARD 470](#_Toc214495835) + +[2.2.8.4.2 SMB_INFO_SET_EAS 471](#_Toc214495836) + +[2.2.8.4.3 SMB_SET_FILE_BASIC_INFO 471](#_Toc214495837) + +[2.2.8.4.4 SMB_SET_FILE_DISPOSITION_INFO 472](#_Toc214495838) + +[2.2.8.4.5 SMB_SET_FILE_ALLOCATION_INFO 472](#_Toc214495839) + +[2.2.8.4.6 SMB_SET_FILE_END_OF_FILE_INFO 473](#_Toc214495840) + +[3 Protocol Details 474](#_Toc214495841) + +[3.1 Common Details 474](#_Toc214495842) + +[3.1.1 Abstract Data Model 474](#_Toc214495843) + +[3.1.1.1 Global 474](#_Toc214495844) + +[3.1.2 Timers 474](#_Toc214495845) + +[3.1.3 Initialization 474](#_Toc214495846) + +[3.1.4 Higher-Layer Triggered Events 474](#_Toc214495847) + +[3.1.4.1 Sending Any Message 474](#_Toc214495848) + +[3.1.4.1.1 Command Sequence Requirements 475](#_Toc214495849) + +[3.1.5 Processing Events and Sequencing Rules 475](#_Toc214495850) + +[3.1.5.1 Receiving Any Message 475](#_Toc214495851) + +[3.1.5.2 Algorithms for Challenge/Response Authentication 476](#_Toc214495852) + +[3.1.6 Timer Events 477](#_Toc214495853) + +[3.1.7 Other Local Events 477](#_Toc214495854) + +[3.2 Client Details 477](#_Toc214495855) + +[3.2.1 Abstract Data Model 477](#_Toc214495856) + +[3.2.1.1 Global 477](#_Toc214495857) + +[3.2.1.2 Per SMB Connection 479](#_Toc214495858) + +[3.2.1.3 Per SMB Session 481](#_Toc214495859) + +[3.2.1.4 Per Tree Connect 481](#_Toc214495860) + +[3.2.1.5 Per Unique Open 481](#_Toc214495861) + +[3.2.1.6 Per Unique Open Search 482](#_Toc214495862) + +[3.2.2 Timers 482](#_Toc214495863) + +[3.2.2.1 Request Expiration Timer 482](#_Toc214495864) + +[3.2.3 Initialization 482](#_Toc214495865) + +[3.2.4 Higher-Layer Triggered Events 483](#_Toc214495866) + +[3.2.4.1 Sending Any Message 483](#_Toc214495867) + +[3.2.4.1.1 Command Processing 484](#_Toc214495868) + +[3.2.4.1.2 Processing Options 484](#_Toc214495869) + +[3.2.4.1.3 Message Signing 485](#_Toc214495870) + +[3.2.4.1.4 Sending Any Batched ("AndX") Request 485](#_Toc214495871) + +[3.2.4.1.5 Sending Any Transaction 486](#_Toc214495872) + +[3.2.4.1.6 Accessing a Share in the DFS Namespace 489](#_Toc214495873) + +[3.2.4.2 Application Requests Connecting to a Share 490](#_Toc214495874) + +[3.2.4.2.1 Connection Establishment 491](#_Toc214495875) + +[3.2.4.2.2 Dialect Negotiation 492](#_Toc214495876) + +[3.2.4.2.3 Capabilities Negotiation 492](#_Toc214495877) + +[3.2.4.2.4 User Authentication 493](#_Toc214495878) + +[3.2.4.2.5 Connecting to the Share (Tree Connect) 495](#_Toc214495879) + +[3.2.4.3 Application Requests Creating a Directory 495](#_Toc214495880) + +[3.2.4.4 Application Requests Deleting a Directory 496](#_Toc214495881) + +[3.2.4.5 Application Requests Opening an Existing File 496](#_Toc214495882) + +[3.2.4.5.1 Compatibility Mode 499](#_Toc214495883) + +[3.2.4.5.2 FID Permissions 499](#_Toc214495884) + +[3.2.4.6 Application Requests to Create or Overwrite a File 500](#_Toc214495885) + +[3.2.4.7 Application Requests Closing a File 502](#_Toc214495886) + +[3.2.4.8 Application Requests Flushing File Data 502](#_Toc214495887) + +[3.2.4.9 Application Requests Deleting a File or Set of Files 503](#_Toc214495888) + +[3.2.4.10 Application Requests Renaming a File or Set of Files 503](#_Toc214495889) + +[3.2.4.11 Application Requests Creating a Hard Link to a File 504](#_Toc214495890) + +[3.2.4.12 Application Requests Querying File Attributes 505](#_Toc214495891) + +[3.2.4.13 Application Requests Setting File Attributes 506](#_Toc214495892) + +[3.2.4.14 Application Requests Reading from a File, Named Pipe, or Device 508](#_Toc214495893) + +[3.2.4.14.1 Client Requests Read Raw 510](#_Toc214495894) + +[3.2.4.14.2 Client Requests Multiplexed Read 512](#_Toc214495895) + +[3.2.4.15 Application Requests Writing to a File, Named Pipe, or Device 512](#_Toc214495896) + +[3.2.4.15.1 Client Requests Raw Write 514](#_Toc214495897) + +[3.2.4.15.2 Client Requests Multiplexed Write 515](#_Toc214495898) + +[3.2.4.16 Application Requests a Byte-Range Lock on a File 518](#_Toc214495899) + +[3.2.4.17 Application Requests the Release of a Byte-Range Lock on a File 519](#_Toc214495900) + +[3.2.4.18 Application Requests an Opportunistic Lock on a File 520](#_Toc214495901) + +[3.2.4.19 Application Requests Verifying a Directory Path 520](#_Toc214495902) + +[3.2.4.20 Client Notifies the Server of a Process Exit 521](#_Toc214495903) + +[3.2.4.21 Application Requests to Seek to a Location in a File 521](#_Toc214495904) + +[3.2.4.22 Application Requests Sending an IOCTL to a File or Device 521](#_Toc214495905) + +[3.2.4.23 Application Requests Testing Transport Layer Connection 522](#_Toc214495906) + +[3.2.4.24 Application Requests a Tree Disconnect (Unmount Share) 522](#_Toc214495907) + +[3.2.4.25 Application Requests an SMB Session Logoff 522](#_Toc214495908) + +[3.2.4.26 Application Requests Querying File System Attributes 522](#_Toc214495909) + +[3.2.4.27 Application Requests a Directory Enumeration 523](#_Toc214495910) + +[3.2.4.28 Application Requests Canceling Pending Operations 524](#_Toc214495911) + +[3.2.4.29 Application Requests to Print a File 525](#_Toc214495912) + +[3.2.4.30 Application Requests Setting Named Pipe State 525](#_Toc214495913) + +[3.2.4.31 Application Requests Querying Named Pipe Handle State 525](#_Toc214495914) + +[3.2.4.32 Application Requests Querying Named Pipe Information 526](#_Toc214495915) + +[3.2.4.33 Application Requests Peeking at Named Pipe Data 526](#_Toc214495916) + +[3.2.4.34 Application Requests Executing a Transaction on a Named Pipe 526](#_Toc214495917) + +[3.2.4.35 Application Requests Waiting for Named Pipe Availability 526](#_Toc214495918) + +[3.2.4.36 Application Requests Named Pipe Exchange (Call) 526](#_Toc214495919) + +[3.2.4.37 Application Requests to Read from a Named Pipe 527](#_Toc214495920) + +[3.2.4.38 Application Requests Writing to a Named Pipe 527](#_Toc214495921) + +[3.2.4.39 Application Requests Notification of Change in Directory Contents 527](#_Toc214495922) + +[3.2.4.40 Application Requests Querying Security Descriptors 528](#_Toc214495923) + +[3.2.4.41 Application Requests Setting Security Descriptors 528](#_Toc214495924) + +[3.2.4.42 Application Requests a Named RAP Transaction 528](#_Toc214495925) + +[3.2.4.43 DFS Subsystem Notifies That It Is Active 529](#_Toc214495926) + +[3.2.4.44 Application Requests Querying DFS Referrals 529](#_Toc214495927) + +[3.2.4.45 Application Requests Querying Cryptographic Session Key 529](#_Toc214495928) + +[3.2.4.46 Application Requests Number of Opens on a Tree Connect 529](#_Toc214495929) + +[3.2.5 Processing Events and Sequencing Rules 530](#_Toc214495930) + +[3.2.5.1 Receiving Any Message 530](#_Toc214495931) + +[3.2.5.1.1 Command Processing 531](#_Toc214495932) + +[3.2.5.1.2 Message Signing 531](#_Toc214495933) + +[3.2.5.1.3 Receiving any Batched ("AndX") Response 531](#_Toc214495934) + +[3.2.5.1.4 Receiving Any Transaction Response 531](#_Toc214495935) + +[3.2.5.2 Receiving an SMB_COM_NEGOTIATE Response 532](#_Toc214495936) + +[3.2.5.3 Receiving an SMB_COM_SESSION_SETUP_ANDX Response 533](#_Toc214495937) + +[3.2.5.4 Receiving an SMB_COM_TREE_CONNECT or SMB_COM_TREE_CONNECT_ANDX Response 534](#_Toc214495938) + +[3.2.5.5 Receiving an SMB_COM_OPEN Response 534](#_Toc214495939) + +[3.2.5.6 Receiving an SMB_COM_CREATE Response 535](#_Toc214495940) + +[3.2.5.7 Receiving an SMB_COM_CLOSE Response 535](#_Toc214495941) + +[3.2.5.8 Receiving an SMB_COM_QUERY_INFORMATION Response 535](#_Toc214495942) + +[3.2.5.9 Receiving an SMB_COM_READ Response 535](#_Toc214495943) + +[3.2.5.10 Receiving an SMB_COM_WRITE Response 535](#_Toc214495944) + +[3.2.5.11 Receiving an SMB_COM_CREATE_TEMPORARY Response 536](#_Toc214495945) + +[3.2.5.12 Receiving an SMB_COM_CREATE_NEW Response 536](#_Toc214495946) + +[3.2.5.13 Receiving an SMB_COM_SEEK Response 536](#_Toc214495947) + +[3.2.5.14 Receiving an SMB_COM_LOCK_AND_READ Response 536](#_Toc214495948) + +[3.2.5.15 Receiving an SMB_COM_WRITE_AND_UNLOCK Response 536](#_Toc214495949) + +[3.2.5.16 Receiving an SMB_COM_READ_RAW Response 537](#_Toc214495950) + +[3.2.5.17 Receiving an SMB_COM_READ_MPX Response 537](#_Toc214495951) + +[3.2.5.18 Receiving an SMB_COM_WRITE_RAW Response 538](#_Toc214495952) + +[3.2.5.19 Receiving an SMB_COM_WRITE_MPX Response 538](#_Toc214495953) + +[3.2.5.20 Receiving an SMB_COM_QUERY_INFORMATION2 Response 539](#_Toc214495954) + +[3.2.5.21 Receiving an SMB_COM_TRANSACTION Response 539](#_Toc214495955) + +[3.2.5.22 Receiving an SMB_COM_IOCTL Response 539](#_Toc214495956) + +[3.2.5.23 Receiving an SMB_COM_ECHO Response 539](#_Toc214495957) + +[3.2.5.24 Receiving an SMB_COM_WRITE_AND_CLOSE Response 539](#_Toc214495958) + +[3.2.5.25 Receiving an SMB_COM_OPEN_ANDX Response 539](#_Toc214495959) + +[3.2.5.26 Receiving an SMB_COM_READ_ANDX Response 540](#_Toc214495960) + +[3.2.5.27 Receiving an SMB_COM_WRITE_ANDX Response 540](#_Toc214495961) + +[3.2.5.28 Receiving an SMB_COM_TRANSACTION2 Response 541](#_Toc214495962) + +[3.2.5.29 Receiving an SMB_COM_FIND_CLOSE2 Response 541](#_Toc214495963) + +[3.2.5.30 Receiving an SMB_COM_TREE_DISCONNECT Response 541](#_Toc214495964) + +[3.2.5.31 Receiving an SMB_COM_LOGOFF_ANDX Response 541](#_Toc214495965) + +[3.2.5.32 Receiving an SMB_COM_QUERY_INFORMATION_DISK Response 541](#_Toc214495966) + +[3.2.5.33 Receiving an SMB_COM_SEARCH or SMB_COM_FIND Response 541](#_Toc214495967) + +[3.2.5.34 Receiving an SMB_COM_FIND_UNIQUE Response 542](#_Toc214495968) + +[3.2.5.35 Receiving an SMB_COM_NT_TRANSACT Response 542](#_Toc214495969) + +[3.2.5.36 Receiving an SMB_COM_NT_CREATE_ANDX Response 542](#_Toc214495970) + +[3.2.5.37 Receiving an SMB_COM_OPEN_PRINT_FILE Response 542](#_Toc214495971) + +[3.2.5.38 Receiving any SMB_COM_TRANSACTION Subcommand Response 543](#_Toc214495972) + +[3.2.5.38.1 Receiving a RAP Transaction Response 543](#_Toc214495973) + +[3.2.5.38.2 Receiving a TRANS_RAW_READ_NMPIPE Response 543](#_Toc214495974) + +[3.2.5.38.3 Receiving a TRANS_QUERY_NMPIPE_STATE Response 543](#_Toc214495975) + +[3.2.5.38.4 Receiving a TRANS_QUERY_NMPIPE_INFO Response 543](#_Toc214495976) + +[3.2.5.38.5 Receiving a TRANS_PEEK_NMPIPE Response 543](#_Toc214495977) + +[3.2.5.38.6 Receiving a TRANS_TRASACT_NMPIPE Response 543](#_Toc214495978) + +[3.2.5.38.7 Receiving a TRANS_RAW_WRITE_NMPIPE Response 544](#_Toc214495979) + +[3.2.5.38.8 Receiving a TRANS_READ_NMPIPE Response 544](#_Toc214495980) + +[3.2.5.38.9 Receiving a TRANS_WRITE_NMPIPE Response 544](#_Toc214495981) + +[3.2.5.38.10 Receiving a TRANS_CALL_NMPIPE Response 544](#_Toc214495982) + +[3.2.5.39 Receiving any SMB_COM_TRANSACTION2 Subcommand Response 544](#_Toc214495983) + +[3.2.5.39.1 Receiving a TRANS2_OPEN2 Response 544](#_Toc214495984) + +[3.2.5.39.2 Receiving a TRANS2_FIND_FIRST2 or TRANS2_FIND_NEXT2 Response 545](#_Toc214495985) + +[3.2.5.39.3 Receiving a TRANS2_QUERY_FS_INFORMATION Response 545](#_Toc214495986) + +[3.2.5.39.4 Receiving a TRANS2_QUERY_PATH_INFORMATION or TRANS2_QUERY_FILE_INFORMATION Response 545](#_Toc214495987) + +[3.2.5.39.5 Receiving a TRANS2_CREATE_DIRECTORY Response 545](#_Toc214495988) + +[3.2.5.39.6 Receiving a TRANS2_GET_DFS_REFERRAL Response 545](#_Toc214495989) + +[3.2.5.40 Receiving any SMB_COM_NT_TRANSACT Subcommand Response 546](#_Toc214495990) + +[3.2.5.40.1 Receiving an NT_TRANSACT_CREATE Response 546](#_Toc214495991) + +[3.2.5.40.2 Receiving an NT_TRANSACT_IOCTL Response 546](#_Toc214495992) + +[3.2.5.40.3 Receiving an NT_TRANSACT_NOTIFY_CHANGE Response 546](#_Toc214495993) + +[3.2.5.40.4 Receiving an NT_TRANSACT_QUERY_SECURITY_DESC Response 546](#_Toc214495994) + +[3.2.5.41 Receiving any OpLock Grant 546](#_Toc214495995) + +[3.2.5.42 Receiving an OpLock Break Notification 547](#_Toc214495996) + +[3.2.5.43 Receiving a STATUS_PATH_NOT_COVERED (ERRSRV/ERRbadpath) Error for an Object in DFS 547](#_Toc214495997) + +[3.2.6 Timer Events 548](#_Toc214495998) + +[3.2.6.1 Request Expiration Timer Event 548](#_Toc214495999) + +[3.2.7 Other Local Events 548](#_Toc214496000) + +[3.2.7.1 Handling a Transport Disconnect 548](#_Toc214496001) + +[3.3 Server Details 549](#_Toc214496002) + +[3.3.1 Abstract Data Model 549](#_Toc214496003) + +[3.3.1.1 Global 549](#_Toc214496004) + +[3.3.1.2 Per Share 551](#_Toc214496005) + +[3.3.1.3 Per SMB Connection 552](#_Toc214496006) + +[3.3.1.4 Per Pending SMB Command 554](#_Toc214496007) + +[3.3.1.5 Per SMB Session 555](#_Toc214496008) + +[3.3.1.6 Per Tree Connect 555](#_Toc214496009) + +[3.3.1.7 Per Unique Open 556](#_Toc214496010) + +[3.3.1.8 Per Unique Open Search 556](#_Toc214496011) + +[3.3.2 Timers 557](#_Toc214496012) + +[3.3.2.1 OpLock Break Acknowledgment Timer 557](#_Toc214496013) + +[3.3.2.2 Idle Connection Timer 557](#_Toc214496014) + +[3.3.2.3 Unused Open Search Timer 557](#_Toc214496015) + +[3.3.2.4 Unused Connection Timer 557](#_Toc214496016) + +[3.3.3 Initialization 557](#_Toc214496017) + +[3.3.4 Higher-Layer Triggered Events 558](#_Toc214496018) + +[3.3.4.1 Sending Any Message 558](#_Toc214496019) + +[3.3.4.1.1 Processing Options 559](#_Toc214496020) + +[3.3.4.1.2 Sending Any Error Response Message 559](#_Toc214496021) + +[3.3.4.2 Object Store Indicates an OpLock Break 559](#_Toc214496022) + +[3.3.4.3 DFS Subsystem Notifies That It Is Active 560](#_Toc214496023) + +[3.3.4.4 DFS Subsystem Notifies That a Share Is a DFS Share 560](#_Toc214496024) + +[3.3.4.5 DFS Subsystem Notifies That a Share Is Not a DFS Share 560](#_Toc214496025) + +[3.3.4.6 Application Requests the Session Key Associated with a Client Session 561](#_Toc214496026) + +[3.3.4.7 Application Requests the Security Context Associated with a Client Session 561](#_Toc214496027) + +[3.3.4.8 Server Application Requests Closing a Session 561](#_Toc214496028) + +[3.3.4.9 Server Application Registers a Share 561](#_Toc214496029) + +[3.3.4.10 Server Application Updates a Share 562](#_Toc214496030) + +[3.3.4.11 Server Application Deregisters a Share 562](#_Toc214496031) + +[3.3.4.12 Server Application Requests Querying a Share 563](#_Toc214496032) + +[3.3.4.13 Server Application Requests Closing an Open 563](#_Toc214496033) + +[3.3.4.14 Server Application Queries a Session 563](#_Toc214496034) + +[3.3.4.15 Server Application Queries a TreeConnect 564](#_Toc214496035) + +[3.3.4.16 Server Application Queries an Open 564](#_Toc214496036) + +[3.3.4.17 Server Application Requests Transport Binding Change 565](#_Toc214496037) + +[3.3.4.18 Server Service Enables the CIFS Server 565](#_Toc214496038) + +[3.3.4.19 Server Services Disables the CIFS Server 565](#_Toc214496039) + +[3.3.4.20 Server Service Pauses the CIFS Server 566](#_Toc214496040) + +[3.3.4.21 Server Services Resumes (Continues) the CIFS Server 566](#_Toc214496041) + +[3.3.4.22 Server Application Requests Updating the Server Configuration 566](#_Toc214496042) + +[3.3.4.23 Server Application Requests Server Statistics 566](#_Toc214496043) + +[3.3.5 Processing Events and Sequencing Rules 567](#_Toc214496044) + +[3.3.5.1 Accepting an Incoming Connection 567](#_Toc214496045) + +[3.3.5.2 Receiving Any Message 568](#_Toc214496046) + +[3.3.5.2.1 Command Processing 569](#_Toc214496047) + +[3.3.5.2.2 Processing Options 570](#_Toc214496048) + +[3.3.5.2.3 Message Signing 570](#_Toc214496049) + +[3.3.5.2.4 Receiving any Batched ("AndX") Request 570](#_Toc214496050) + +[3.3.5.2.5 Receiving Any Transaction Request 571](#_Toc214496051) + +[3.3.5.2.6 Supporting Shares in the DFS Namespace 571](#_Toc214496052) + +[3.3.5.2.7 Granting OpLocks 572](#_Toc214496053) + +[3.3.5.3 Receiving an SMB_COM_CREATE_DIRECTORY Request 572](#_Toc214496054) + +[3.3.5.4 Receiving an SMB_COM_DELETE_DIRECTORY Request 573](#_Toc214496055) + +[3.3.5.5 Receiving an SMB_COM_OPEN Request 573](#_Toc214496056) + +[3.3.5.6 Receiving an SMB_COM_CREATE Request 574](#_Toc214496057) + +[3.3.5.7 Receiving an SMB_COM_CLOSE Request 575](#_Toc214496058) + +[3.3.5.8 Receiving an SMB_COM_FLUSH Request 575](#_Toc214496059) + +[3.3.5.9 Receiving an SMB_COM_DELETE Request 576](#_Toc214496060) + +[3.3.5.10 Receiving an SMB_COM_RENAME Request 577](#_Toc214496061) + +[3.3.5.11 Receiving an SMB_COM_QUERY_INFORMATION Request 578](#_Toc214496062) + +[3.3.5.12 Receiving an SMB_COM_SET_INFORMATION Request 578](#_Toc214496063) + +[3.3.5.13 Receiving an SMB_COM_READ Request 579](#_Toc214496064) + +[3.3.5.14 Receiving an SMB_COM_WRITE Request 579](#_Toc214496065) + +[3.3.5.15 Receiving an SMB_COM_LOCK_BYTE_RANGE Request 580](#_Toc214496066) + +[3.3.5.16 Receiving an SMB_COM_UNLOCK_BYTE_RANGE Request 581](#_Toc214496067) + +[3.3.5.17 Receiving an SMB_COM_CREATE_TEMPORARY Request 581](#_Toc214496068) + +[3.3.5.18 Receiving an SMB_COM_CREATE_NEW Request 582](#_Toc214496069) + +[3.3.5.19 Receiving an SMB_COM_CHECK_DIRECTORY Request 583](#_Toc214496070) + +[3.3.5.20 Receiving an SMB_COM_PROCESS_EXIT Request 583](#_Toc214496071) + +[3.3.5.21 Receiving an SMB_COM_SEEK Request 584](#_Toc214496072) + +[3.3.5.22 Receiving an SMB_COM_LOCK_AND_READ Request 584](#_Toc214496073) + +[3.3.5.23 Receiving an SMB_COM_WRITE_AND_UNLOCK Request 585](#_Toc214496074) + +[3.3.5.24 Receiving an SMB_COM_READ_RAW Request 585](#_Toc214496075) + +[3.3.5.25 Receiving an SMB_COM_READ_MPX Request 586](#_Toc214496076) + +[3.3.5.26 Receiving an SMB_COM_WRITE_RAW Request 587](#_Toc214496077) + +[3.3.5.27 Receiving an SMB_COM_WRITE_MPX Request 589](#_Toc214496078) + +[3.3.5.28 Receiving an SMB_COM_QUERY_INFORMATION2 Request 590](#_Toc214496079) + +[3.3.5.29 Receiving an SMB_COM_SET_INFORMATION2 Request 590](#_Toc214496080) + +[3.3.5.30 Receiving an SMB_COM_LOCKING_ANDX Request 590](#_Toc214496081) + +[3.3.5.31 Receiving an SMB_COM_TRANSACTION Request 592](#_Toc214496082) + +[3.3.5.32 Receiving an SMB_COM_IOCTL Request 592](#_Toc214496083) + +[3.3.5.33 Receiving an SMB_COM_ECHO Request 592](#_Toc214496084) + +[3.3.5.34 Receiving an SMB_COM_WRITE_AND_CLOSE Request 592](#_Toc214496085) + +[3.3.5.35 Receiving an SMB_COM_OPEN_ANDX Request 593](#_Toc214496086) + +[3.3.5.36 Receiving an SMB_COM_READ_ANDX Request 595](#_Toc214496087) + +[3.3.5.37 Receiving an SMB_COM_WRITE_ANDX Request 596](#_Toc214496088) + +[3.3.5.38 Receiving an SMB_COM_TRANSACTION2 Request 597](#_Toc214496089) + +[3.3.5.39 Receiving an SMB_COM_FIND_CLOSE2 Request 597](#_Toc214496090) + +[3.3.5.40 Receiving an SMB_COM_TREE_CONNECT Request 598](#_Toc214496091) + +[3.3.5.41 Receiving an SMB_COM_TREE_DISCONNECT Request 599](#_Toc214496092) + +[3.3.5.42 Receiving an SMB_COM_NEGOTIATE Request 599](#_Toc214496093) + +[3.3.5.43 Receiving an SMB_COM_SESSION_SETUP_ANDX Request 600](#_Toc214496094) + +[3.3.5.44 Receiving an SMB_COM_LOGOFF_ANDX Request 602](#_Toc214496095) + +[3.3.5.45 Receiving an SMB_COM_TREE_CONNECT_ANDX Request 602](#_Toc214496096) + +[3.3.5.46 Receiving an SMB_COM_QUERY_INFORMATION_DISK Request 604](#_Toc214496097) + +[3.3.5.47 Receiving an SMB_COM_SEARCH or SMB_COM_FIND Request 604](#_Toc214496098) + +[3.3.5.48 Receiving an SMB_COM_FIND_UNIQUE Request 606](#_Toc214496099) + +[3.3.5.49 Receiving an SMB_COM_FIND_CLOSE Request 606](#_Toc214496100) + +[3.3.5.50 Receiving an SMB_COM_NT_TRANSACT Request 607](#_Toc214496101) + +[3.3.5.51 Receiving an SMB_COM_NT_CREATE_ANDX Request 607](#_Toc214496102) + +[3.3.5.52 Receiving an SMB_COM_NT_CANCEL Request 609](#_Toc214496103) + +[3.3.5.53 Receiving an SMB_COM_NT_RENAME Request 609](#_Toc214496104) + +[3.3.5.54 Receiving an SMB_COM_OPEN_PRINT_FILE Request 611](#_Toc214496105) + +[3.3.5.55 Receiving an SMB_COM_WRITE_PRINT_FILE Request 611](#_Toc214496106) + +[3.3.5.56 Receiving an SMB_COM_CLOSE_PRINT_FILE Request 611](#_Toc214496107) + +[3.3.5.57 Receiving any SMB_COM_TRANSACTION Subcommand Request 612](#_Toc214496108) + +[3.3.5.57.1 Receiving a RAP Transaction Request 613](#_Toc214496109) + +[3.3.5.57.2 Receiving a TRANS_SET_NMPIPE_STATE Request 613](#_Toc214496110) + +[3.3.5.57.3 Receiving a TRANS_RAW_READ_NMPIPE Request 614](#_Toc214496111) + +[3.3.5.57.4 Receiving a TRANS_QUERY_NMPIPE_STATE Request 614](#_Toc214496112) + +[3.3.5.57.5 Receiving a TRANS_QUERY_NMPIPE_INFO Request 614](#_Toc214496113) + +[3.3.5.57.6 Receiving a TRANS_PEEK_NMPIPE Request 614](#_Toc214496114) + +[3.3.5.57.7 Receiving a TRANS_TRANSACT_NMPIPE Request 615](#_Toc214496115) + +[3.3.5.57.8 Receiving a TRANS_RAW_WRITE_NMPIPE Request 615](#_Toc214496116) + +[3.3.5.57.9 Receiving a TRANS_READ_NMPIPE Request 615](#_Toc214496117) + +[3.3.5.57.10 Receiving a TRANS_WRITE_NMPIPE Request 616](#_Toc214496118) + +[3.3.5.57.11 Receiving a TRANS_WAIT_NMPIPE Request 616](#_Toc214496119) + +[3.3.5.57.12 Receiving a TRANS_CALL_NMPIPE Request 616](#_Toc214496120) + +[3.3.5.58 Receiving Any SMB_COM_TRANSACTION2 Subcommand Request 617](#_Toc214496121) + +[3.3.5.58.1 Receiving Any Information Level 617](#_Toc214496122) + +[3.3.5.58.2 Receiving a TRANS2_OPEN2 Request 617](#_Toc214496123) + +[3.3.5.58.3 Receiving a TRANS2_FIND_FIRST2 Request 618](#_Toc214496124) + +[3.3.5.58.4 Receiving a TRANS2_FIND_NEXT2 Request 619](#_Toc214496125) + +[3.3.5.58.5 Receiving a TRANS2_QUERY_FS_INFORMATION Request 620](#_Toc214496126) + +[3.3.5.58.6 Receiving a TRANS2_QUERY_PATH_INFORMATION Request 620](#_Toc214496127) + +[3.3.5.58.7 Receiving a TRANS2_SET_PATH_INFORMATION Request 620](#_Toc214496128) + +[3.3.5.58.8 Receiving a TRANS2_QUERY_FILE_INFORMATION Request 620](#_Toc214496129) + +[3.3.5.58.9 Receiving a TRANS2_SET_FILE_INFORMATION Request 620](#_Toc214496130) + +[3.3.5.58.10 Receiving a TRANS2_CREATE_DIRECTORY Request 621](#_Toc214496131) + +[3.3.5.58.11 Receiving a TRANS2_GET_DFS_REFERRAL Request 621](#_Toc214496132) + +[3.3.5.59 Receiving any SMB_COM_NT_TRANSACT Subcommand Request 621](#_Toc214496133) + +[3.3.5.59.1 Receiving an NT_TRANSACT_CREATE Request 621](#_Toc214496134) + +[3.3.5.59.2 Receiving an NT_TRANSACT_IOCTL Request 623](#_Toc214496135) + +[3.3.5.59.3 Receiving an NT_TRANSACT_SET_SECURITY_DESC Request 623](#_Toc214496136) + +[3.3.5.59.4 Receiving an NT_TRANSACT_NOTIFY_CHANGE Request 624](#_Toc214496137) + +[3.3.5.59.5 Receiving an NT_TRANSACT_QUERY_SECURITY_DESC Request 625](#_Toc214496138) + +[3.3.6 Timer Events 625](#_Toc214496139) + +[3.3.6.1 OpLock Break Acknowledgment Timer Event 625](#_Toc214496140) + +[3.3.6.2 Idle Connection Timer Event 625](#_Toc214496141) + +[3.3.6.3 Unused Open Search Timer Event 626](#_Toc214496142) + +[3.3.6.4 Unused Connection Timer Event 626](#_Toc214496143) + +[3.3.7 Other Local Events 626](#_Toc214496144) + +[3.3.7.1 Handling a Transport Disconnect 626](#_Toc214496145) + +[3.3.7.2 Server Disconnects a Connection 626](#_Toc214496146) + +[3.3.7.3 Handling an Incoming Transport Connection 626](#_Toc214496147) + +[3.4 Local Interface Details for RPC Client Applications 626](#_Toc214496148) + +[3.4.1 Abstract Data Model 627](#_Toc214496149) + +[3.4.2 Timers 627](#_Toc214496150) + +[3.4.3 Initialization 627](#_Toc214496151) + +[3.4.4 Higher-Layer Triggered Events 627](#_Toc214496152) + +[3.4.4.1 An RPC Client Application Opens a Named Pipe 627](#_Toc214496153) + +[3.4.4.2 An RPC Client Application Writes to a Named Pipe 629](#_Toc214496154) + +[3.4.4.3 An RPC Client Application Reads from a Named Pipe 629](#_Toc214496155) + +[3.4.4.4 An RPC Client Application Issues a Named Pipe Transaction 630](#_Toc214496156) + +[3.4.4.5 An RPC Client Application Closes a Named Pipe 630](#_Toc214496157) + +[3.4.4.6 An RPC Client Application Requests the Session Key for an Authenticated Context 631](#_Toc214496158) + +[3.4.4.7 A Local Client Application Initiates a Server Session 631](#_Toc214496159) + +[3.4.4.8 A Local Client Application Terminates a Server Session 631](#_Toc214496160) + +[3.4.4.9 A Local Client Application Queries DFS Referrals 631](#_Toc214496161) + +[3.4.4.10 A Local Client Application Requests a Connection to a Share 632](#_Toc214496162) + +[3.4.4.11 A Local Client Application Requests a Tree Disconnect 633](#_Toc214496163) + +[3.4.4.12 A Local Client Application Queries the Extended DFS Referral Capability 633](#_Toc214496164) + +[3.4.5 Message Processing Events and Sequencing Rules 633](#_Toc214496165) + +[3.4.6 Timer Events 633](#_Toc214496166) + +[3.4.7 Other Local Events 633](#_Toc214496167) + +[3.5 Local Interface Details for RPC Server Applications 634](#_Toc214496168) + +[3.5.1 Abstract Data Model 634](#_Toc214496169) + +[3.5.2 Timers 634](#_Toc214496170) + +[3.5.3 Initialization 634](#_Toc214496171) + +[3.5.4 Higher-Layer Triggered Events 634](#_Toc214496172) + +[3.5.4.1 An RPC Server Application Waits for Clients to Open a Named Pipe 634](#_Toc214496173) + +[3.5.4.2 An RPC Server Application Closes its Open to a Named Pipe 635](#_Toc214496174) + +[3.5.4.3 An RPC Server Application Requests the Security Context of a Client 635](#_Toc214496175) + +[3.5.4.4 An RPC Server Application Requests the Session Key of a Client 635](#_Toc214496176) + +[3.5.5 Message Processing Events and Sequencing Rules 635](#_Toc214496177) + +[3.5.6 Timer Events 635](#_Toc214496178) + +[3.5.7 Other Local Events 635](#_Toc214496179) + +[4 Protocol Examples 636](#_Toc214496180) + +[4.1 Negotiate and Tree Connect Example 636](#_Toc214496181) + +[4.2 Disconnect Example 636](#_Toc214496182) + +[4.3 Message Signing Example 637](#_Toc214496183) + +[4.4 Get File Attributes Example 639](#_Toc214496184) + +[4.5 Set File Attributes Example 640](#_Toc214496185) + +[4.6 Copy File from Share Example 642](#_Toc214496186) + +[4.7 Copy File to Share Example 643](#_Toc214496187) + +[5 Security 644](#_Toc214496188) + +[5.1 Security Considerations for Implementers 644](#_Toc214496189) + +[5.2 Index of Security Parameters 644](#_Toc214496190) + +[6 Appendix A: Product Behavior 645](#_Toc214496191) + +[7 Change Tracking 708](#_Toc214496192) + +[8 Index 709](#_Toc214496193) + +# Introduction + +The Common Internet File System (CIFS) Protocol is a cross-platform, transport-independent protocol that provides a mechanism for client systems to use file and print services made available by server systems over a network. + +[**CIFS**](#gt_fb37399e-d72d-41b6-b073-086da2d96e09) is a dialect of the [**Server Message Block (SMB)**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) protocol, which was originally developed by IBM Corporation and then further enhanced by Microsoft, IBM, Intel, 3Com, and others. There are several dialects of SMB. A standard for the SMB protocol, covering dialects prior to CIFS, was published by X/Open (now The Open Group) as \[XOPEN-SMB\]. + +The meaning of the term "CIFS" has changed since it was first introduced. It was originally used to indicate a proposed standard version of SMB based upon the design of the Windows NT 4.0 operating system and Windows 2000 operating system implementations. In some references, "CIFS" has been used as a name for the SMB protocol in general (all dialects) and, additionally, the suite of protocols that support and include SMB. In this document, the term "CIFS" is used specifically to identify the Windows [**NT LAN Manager (NTLM)**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) dialect of SMB as designed for use with Windows: in particular, Windows NT Server 3.51 operating system and Windows NT Server 4.0 operating system, Windows NT Workstation 4.0 operating system, and Windows 98 operating system. + +This document defines the protocol as it was designed for Windows NT operating system. It also specifies the behaviors of Windows NT and Windows 98, with respect to optional behavior, and documents known errors and variances in implementation. Changes and enhancements made to the SMB protocol are documented in [\[MS-SMB\]](%5bMS-SMB%5d.pdf#Section_f210069c70864dc2885e861d837df688). + +Sections 1.5, 1.8, 1.9, 2, and 3 of this specification are normative. All other sections and examples in this specification are informative. + +## Glossary + +This document uses the following terms: + +**8.3 name**: A [**file**](#gt_a04c146a-de3b-4e4b-829f-a9e772f3fe25) name string restricted in length to 12 characters that includes a base name of up to eight characters, one character for a period, and up to three characters for a file name extension. For more information on 8.3 file names, see [\[MS-CIFS\]](%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.1.1.1. + +**ASCII**: The American Standard Code for Information Interchange (ASCII) is an 8-bit character-encoding scheme based on the English alphabet. ASCII codes represent text in computers, communications equipment, and other devices that work with text. ASCII refers to a single 8-bit ASCII character or an array of 8-bit ASCII characters with the high bit of each character set to zero. + +**blocking mode**: Determines if input/output (I/O) operations will wait for their entire data to be transferred before returning to the caller. For a write operation, if blocking is enabled, the write request will not complete until the [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca) reader has consumed all of the data inserted into the [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca) as part of a write request. If blocking is not enabled, the write will complete as soon as the data has been inserted into the [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca), regardless of when the data in the [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca) is consumed. For a read operation, if blocking is enabled, the read request will be suspended until the data is available to be read. If blocking is not enabled, the read will complete immediately, even if there is no data available to be read. + +**broadcast**: A style of resource location or data transmission in which a client makes a request to all parties on a network simultaneously (a one-to-many communication). Also, a mode of resource location that does not use a name service. + +**byte mode**: One of two kinds of [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca), the other of which is [**message mode**](#gt_c49a48e8-f1ac-4568-bc87-0672eb08868b). In byte mode, the data sent or received on the named pipe does not have message boundaries but is treated as a continuous stream. \[XOPEN-SMB\] uses the term stream mode instead of byte mode, and [\[SMB-LM1X\]](https://go.microsoft.com/fwlink/?LinkId=164302) refers to byte mode as byte stream mode. + +**Common Internet File System (CIFS)**: The "NT LM 0.12" / [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) dialect of the [**Server Message Block (SMB)**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) Protocol, as implemented in Windows NT. The CIFS name originated in the 1990's as part of an attempt to create an Internet standard for [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625), based upon the then-current Windows NT implementation. + +**connection**: Each user that has a session with a server can create multiple share connections, or resource connections, using that user ID. This resource connection is created using a tree connect [**Server Message Block (SMB)**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) and is identified by an SMB TreeID or TID. + +**deprecated**: A deprecated feature is one that has been superseded in the protocol by a newer feature. Use of deprecated features is discouraged. Server implementations might need to implement deprecated features to support clients that negotiate earlier [**SMB dialects**](#gt_29b8d978-7450-42b5-845c-045fc72b0fe1). + +**dialog**: The exchange of messages between client and server over a given SMB connection. + +**discretionary access control list (DACL)**: An access control list (ACL) that is controlled by the owner of an object and that specifies the access particular users or groups can have to the object. + +**disk**: A persistent storage device that can include physical hard disks, removable disk units, optical drive units, and logical unit numbers (LUNs) unmasked to the system. + +**Distributed File System (DFS)**: A file system that logically groups physical shared folders located on different servers by transparently connecting them to one or more hierarchical namespaces. [**DFS**](#gt_0b8086c9-d025-45b8-bf09-6b5eca72713e) also provides fault-tolerance and load-sharing capabilities. + +**Distributed File System (DFS) namespace**: A virtual view of shares on different servers as provided by [**DFS**](#gt_0b8086c9-d025-45b8-bf09-6b5eca72713e). Each file in the namespace has a logical name and a corresponding address (path). A [**DFS namespace**](#gt_6a3f0be9-b9b4-49df-9d1c-a3b89e4e9890) consists of a root and many links and targets. The namespace starts with a root that maps to one or more root targets. Below the root are links that map to their own targets. + +**Distributed File System (DFS) path**: Any [**Universal Naming Convention (UNC)**](#gt_c9507dca-291d-4fd6-9cba-a9ee7da8c908) path that starts with a DFS root and is used for accessing a file or directory in a [**DFS namespace**](#gt_6a3f0be9-b9b4-49df-9d1c-a3b89e4e9890). + +**Distributed File System (DFS) referral**: A DFS client issues a [**DFS referral**](#gt_c6f2eabf-2138-4f97-a788-5d6a41a27bdd) request to a DFS root target or a DC, depending on the [**DFS path**](#gt_151c87db-05a4-40c3-99bd-4b682530d210) accessed, to resolve a DFS root to a set of DFS root targets, or a DFS link to a set of DFS link targets. The DFS client uses the referral request process as needed to finally identify the actual [**share**](#gt_a49a79ea-dac7-4016-9a84-cf87161db7e3) on a server that has accessed the leaf component of the [**DFS path**](#gt_151c87db-05a4-40c3-99bd-4b682530d210). The request for a [**DFS referral**](#gt_c6f2eabf-2138-4f97-a788-5d6a41a27bdd) is referred to as [**DFS referral request**](#gt_04b0cb20-df63-44f7-9855-3ca702d25813), and the response for such a request is referred to as [**DFS referral response**](#gt_2a06d5c0-030e-4b0c-96f0-c707e24130e1). + +**Distributed File System (DFS) referral request**: The request for a [**DFS referral**](#gt_c6f2eabf-2138-4f97-a788-5d6a41a27bdd). + +**Distributed File System (DFS) referral response**: The response to a [**Distributed File System (DFS) referral request**](#gt_04b0cb20-df63-44f7-9855-3ca702d25813). + +**Fid**: A 16-bit value that the [**Server Message Block (SMB)**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) server uses to represent an opened [**file**](#gt_a04c146a-de3b-4e4b-829f-a9e772f3fe25), [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca), printer, or device. A [**Fid**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) is returned by an [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) server in response to a client request to open or create a [**file**](#gt_a04c146a-de3b-4e4b-829f-a9e772f3fe25), [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca), printer, or device. The [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) server guarantees that the [**Fid**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) value returned is unique for a given [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) connection until the [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) connection is closed, at which time the [**Fid**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) value can be reused. The [**Fid**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) is used by the [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) client in subsequent [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) commands to identify the opened [**file**](#gt_a04c146a-de3b-4e4b-829f-a9e772f3fe25), [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca), printer, or device. + +**file**: An entity of data in the file system that a user can access and manage. A file has to have a unique name in its directory. It consists of one or more streams of bytes that hold a set of related data, plus a set of attributes also called properties that describe the file or the data within the file. The creation time of a file is an example of a file attribute. + +**file attribute**: A 32-bit bitmask containing information on a [**file's**](#gt_a04c146a-de3b-4e4b-829f-a9e772f3fe25) properties. For instance, 0x00000001 is used for the read-only attribute. + +**file system control (FSCTL)**: A command issued to a file system to alter or query the behavior of the file system and/or set or query metadata that is associated with a particular [**file**](#gt_a04c146a-de3b-4e4b-829f-a9e772f3fe25) or with the file system itself. + +**guest account**: A security account available to users who do not have an account on the computer. + +**I/O control (IOCTL)**: A command that is issued to a target file system or target device in order to query or alter the behavior of the target; or to query or alter the data and attributes that are associated with the target or the objects that are exposed by the target. + +**information level**: A number used to identify the volume, file, or device information being requested by a client. Corresponding to each [**information level**](#gt_b01da706-86d0-4ee2-9461-2d9fb1060543), the server returns a specific structure to the client that contains different information in the response. + +**Internet Protocol version 6 (IPv6)**: A revised version of the Internet Protocol (IP) designed to address growth on the Internet. Improvements include a 128-bit IP address size, expanded routing capabilities, and support for authentication and privacy. + +**Internetwork Packet Exchange (IPX)**: A protocol that provides connectionless datagram delivery of messages. See [\[IPX\]](https://go.microsoft.com/fwlink/?LinkId=89914). + +**little-endian**: Multiple-byte values that are byte-ordered with the least significant byte stored in the memory location with the lowest address. + +**mailslot**: A mechanism for one-way interprocess communications (IPC). For more information, see [\[MSLOT\]](https://go.microsoft.com/fwlink/?LinkId=90218) and [\[MS-MAIL\]](%5bMS-MAIL%5d.pdf#Section_8ea19aa46e5a4aedb6280b5cd75a1ab9). + +**message mode**: A named pipe can be of two types: byte mode or [**message mode**](#gt_c49a48e8-f1ac-4568-bc87-0672eb08868b). In byte mode, the data sent or received on the named pipe does not have message boundaries but is treated as a continuous Stream. In message mode, message boundaries are enforced. + +**named pipe**: A named, one-way, or duplex pipe for communication between a pipe server and one or more pipe clients. + +**NetBIOS**: A particular network transport that is part of the LAN Manager protocol suite. [**NetBIOS**](#gt_b86c44e6-57df-4c48-8163-5e3fa7bdcff4) uses a broadcast communication style that was applicable to early segmented local area networks. A protocol family including name resolution, datagram, and connection services. For more information, see [\[RFC1001\]](https://go.microsoft.com/fwlink/?LinkId=90260) and [\[RFC1002\]](https://go.microsoft.com/fwlink/?LinkId=90261). + +**NetBIOS datagram service**: An implementation of [**NetBIOS**](#gt_b86c44e6-57df-4c48-8163-5e3fa7bdcff4) services in a datagram environment as specified in \[RFC1001\] section 17. + +**NetBIOS name**: A 16-byte address that is used to identify a [**NetBIOS**](#gt_b86c44e6-57df-4c48-8163-5e3fa7bdcff4) resource on the network. For more information, see \[RFC1001\] and \[RFC1002\]. + +**NetBIOS Name Server (NBNS)**: A server that stores NetBIOS name-to-IPv4 address mappings and that resolves NetBIOS names for NBT-enabled hosts. A server running the Windows Internet Name Service (WINS) is the Microsoft implementation of an NBNS. + +**network address translation (NAT)**: The process of converting between IP addresses used within an intranet, or other private network, and Internet IP addresses. + +**non-blocking mode (of a named pipe)**: Determines if input/output (I/O) operations on a [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca) will return to the caller without waiting for the data transfer to complete. When non-blocking mode is set, read requests return with all data available to be read from the named pipe, up to the maximum read size set in the request; write requests return after writing data to the named pipe without waiting for the data to be consumed. + +**NT file system (NTFS)**: A proprietary Microsoft file system. For more information, see [\[MSFT-NTFS\]](https://go.microsoft.com/fwlink/?LinkId=90200). + +**NT LAN Manager (NTLM)**: An authentication protocol that is based on a challenge-response sequence for authentication. + +**object store**: A system that provides the ability to create, query, modify, or apply policy to a local resource on behalf of a remote client. The object store is backed by a file system, a named pipe, or a print job that is accessed as a file. + +**Obsolescent**: A feature that has no replacement but is becoming obsolete. Although the use of obsolescent features is discouraged, server implementations might need to implement them to support clients that negotiate earlier [**SMB dialects**](#gt_29b8d978-7450-42b5-845c-045fc72b0fe1). + +**obsolete**: An [**obsolete**](#gt_73fb9153-adab-4f17-b472-426f982e360c) feature is one that was introduced in an earlier dialect but that is no longer supported in the NT LAN Manager dialect. Support for [**obsolete**](#gt_73fb9153-adab-4f17-b472-426f982e360c) features is to be avoided in new implementations. + +**open**: A runtime object that corresponds to a currently established access to a specific file or a named pipe from a specific client to a specific server, using a specific user security context. Both clients and servers maintain opens that represent active accesses. + +**oplock break**: An unsolicited request sent by a [**Server Message Block (SMB)**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) server to an [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) client to inform the client to change the [**oplock**](#gt_7b8c743e-84b1-4c7e-83ea-cfb818cdb394) level for a file. + +**opportunistic lock (oplock)**: A mechanism designed to allow clients to dynamically alter their buffering strategy in a consistent manner to increase performance and reduce network use. The network performance for remote file operations can be increased if a client can locally buffer file data, which reduces or eliminates the need to send and receive network packets. For example, a client might not have to write information into a file on a remote server if the client knows that no other process is accessing the data. Likewise, the client could buffer read-ahead data from the remote file if the client knows that no other process is writing data to the remote file. There are three types of oplocks: 1) Exclusive oplock allows a client to open a file for exclusive access and allows the client to perform arbitrary buffering. 2) Batch oplock allows a client to keep a file open on the server even though the local accessor on the client machine has closed the file. 3) Level II oplock indicates that there are multiple readers of a file and no writers. Level II Oplocks are supported if the negotiated SMB Dialect is NT LM 0.12 or later. When a client opens a file, it requests the server to grant it a particular type of oplock on the file. The response from the server indicates the type of oplock granted to the client. The client uses the granted oplock type to adjust its buffering policy. + +**original equipment manufacturer (OEM) character**: An 8-bit encoding used in MS-DOS and Windows operating systems to associate a sequence of bits with specific characters. The [**ASCII**](#gt_79fa85ca-ac61-467c-b819-e97dc1a7a599) character set maps the letters, numerals, and specified punctuation and control characters to the numbers from 0 to 127. The term "code page" is used to refer to extensions of the [**ASCII**](#gt_79fa85ca-ac61-467c-b819-e97dc1a7a599) character set that map specified characters and symbols to the numbers from 128 to 255. These code pages are referred to as OEM character sets. For more information, see [\[MSCHARSET\]](https://go.microsoft.com/fwlink/?LinkId=89944). + +**original equipment manufacturer (OEM) character set**: A character encoding used where the mappings between characters is dependent upon the code page configured on the machine, typically by the manufacturer. + +**path**: When referring to a file path on a file system, a hierarchical sequence of folders. When referring to a connection to a storage device, a connection through which a machine can communicate with the storage device. + +**pipe instance**: A request to open a [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca) by a client application. Multiple Server Message Block (SMB) clients can open the same [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca). Each request to open the same [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca) is a [**pipe instance**](#gt_10cdea2b-f767-4276-a91e-5f4d06b31617). + +**pipe state**: A series of attributes that describe how the pipe interacts with processes for various input/output (I/O) operations and that indicate how much data is currently available to be read from the [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca). + +**print job**: The rendered page description language (PDL) output data sent to a print device for a particular application or user request. + +**process identifier (PID)**: A nonzero integer used by some operating systems (for example, Windows and UNIX) to uniquely identify a process. For more information, see [\[PROCESS\]](https://go.microsoft.com/fwlink/?LinkId=90251). + +**raw read (on a named pipe)**: The act of reading data from a [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca) that ignores message boundaries even if the pipe was set up as a [**message mode**](#gt_c49a48e8-f1ac-4568-bc87-0672eb08868b) pipe. + +**RPC client**: A computer on the network that sends messages using remote procedure call (RPC) as its transport, waits for responses, and is the initiator in an RPC exchange. + +**RPC server**: A computer on the network that waits for messages, processes them when they arrive, and sends responses using RPC as its transport acts as the responder during a remote procedure call (RPC) exchange. + +**security context**: An abstract data structure that contains authorization information for a particular security principal in the form of a Token/Authorization Context (see [\[MS-DTYP\]](%5bMS-DTYP%5d.pdf#Section_cca2742956894a16b2b49325d93e4ba2) section 2.5.2). A server uses the authorization information in a [**security context**](#gt_88d49f20-6c95-4b64-a52c-c3eca2fe5709) to check access to requested resources. A [**security context**](#gt_88d49f20-6c95-4b64-a52c-c3eca2fe5709) also contains a key identifier that associates mutually established cryptographic keys, along with other information needed to perform secure communication with another security principal. + +**security descriptor**: A data structure containing the security information associated with a securable object. A [**security descriptor**](#gt_e5213722-75a9-44e7-b026-8e4833f0d350) identifies an object's owner by its security identifier (SID). If access control is configured for the object, its [**security descriptor**](#gt_e5213722-75a9-44e7-b026-8e4833f0d350) contains a [**discretionary access control list (DACL)**](#gt_d727f612-7a45-48e4-9d87-71735d62b321) with SIDs for the security principals who are allowed or denied access. Applications use this structure to set and query an object's security status. The [**security descriptor**](#gt_e5213722-75a9-44e7-b026-8e4833f0d350) is used to guard access to an object as well as to control which type of auditing takes place when the object is accessed. The [**security descriptor**](#gt_e5213722-75a9-44e7-b026-8e4833f0d350) format is specified in \[MS-DTYP\] section 2.4.6; a string representation of [**security descriptors**](#gt_e5213722-75a9-44e7-b026-8e4833f0d350), called SDDL, is specified in \[MS-DTYP\] section 2.5.1. + +**Server Message Block (SMB)**: A protocol that is used to request file and print services from server systems over a network. The SMB protocol extends the CIFS protocol with additional security, file, and disk management support. For more information, see [\[CIFS\]](https://go.microsoft.com/fwlink/?linkid=2109334) and [\[MS-SMB\]](%5bMS-SMB%5d.pdf#Section_f210069c70864dc2885e861d837df688). + +**Server Service**: The CIFS file sharing service. The [**Server Service**](#gt_30c16b9f-63f9-472d-b344-08ba77497806) registers a [**NetBIOS**](#gt_b86c44e6-57df-4c48-8163-5e3fa7bdcff4) name with a suffix byte value of 0x20 and responds to [**SMB commands**](#gt_dbae2612-173d-4988-9301-86cb559029f9). + +**session**: In [**Server Message Block (SMB)**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625), a persistent-state association between an SMB client and SMB server. A session is tied to the lifetime of the underlying [**NetBIOS**](#gt_b86c44e6-57df-4c48-8163-5e3fa7bdcff4) or TCP connection. + +**session key**: A relatively short-lived symmetric key (a cryptographic key negotiated by the client and the server based on a shared secret). A [**session key's**](#gt_4f67a585-fb00-4166-93e8-cf4abca8226d) lifespan is bounded by the [**session**](#gt_0cd96b80-a737-4f06-bca4-cf9efb449d12) to which it is associated. A [**session key**](#gt_4f67a585-fb00-4166-93e8-cf4abca8226d) has to be strong enough to withstand cryptanalysis for the lifespan of the [**session**](#gt_0cd96b80-a737-4f06-bca4-cf9efb449d12). + +**share**: A resource offered by a Common Internet File System (CIFS) server for access by CIFS clients over the network. A share typically represents a directory tree and its included files (referred to commonly as a "disk share" or "file share") or a printer (a "print share"). If the information about the share is saved in persistent store (for example, Windows registry) and reloaded when a file server is restarted, then the share is referred to as a "sticky share". Some share names are reserved for specific functions and are referred to as special shares: IPC\$, reserved for interprocess communication, ADMIN\$, reserved for remote administration, and A\$, B\$, C\$ (and other local disk names followed by a dollar sign), assigned to local disk devices. + +**share connect**: The act of establishing authentication and shared state between a Common Internet File System (CIFS) server and client that allows a CIFS client to access a [**share**](#gt_a49a79ea-dac7-4016-9a84-cf87161db7e3) offered by the CIFS server. + +**SMB command**: A set of SMB messages that are exchanged in order to perform an operation. An [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) command is typically identified by a unique command code in the message headers, although some [**SMB commands**](#gt_dbae2612-173d-4988-9301-86cb559029f9) require the use of secondary commands. Within \[MS-CIFS\], the term command means an [**SMB command**](#gt_dbae2612-173d-4988-9301-86cb559029f9) unless otherwise stated. + +**SMB connection**: A transport connection between a [**Server Message Block (SMB)**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) client and an [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) server. The [**SMB connection**](#gt_e1d88514-18e6-4e2e-a459-20d5e17e9078) is assumed to provide reliable in-order message delivery semantics. An [**SMB connection**](#gt_e1d88514-18e6-4e2e-a459-20d5e17e9078) can be established over any available [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) transport that is supported by both the [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) client and the [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) server, as specified in \[MS-CIFS\]. + +**SMB dialect**: There are several different versions and subversions of the [**Server Message Block (SMB)**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) protocol. A particular version of the [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) protocol is referred to as an [**SMB dialect**](#gt_29b8d978-7450-42b5-845c-045fc72b0fe1). Different [**SMB dialects**](#gt_29b8d978-7450-42b5-845c-045fc72b0fe1) can include both new [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) messages as well as changes to the fields and semantics of existing [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) messages used in other [**SMB dialects**](#gt_29b8d978-7450-42b5-845c-045fc72b0fe1). When an [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) client connects to an [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) server, the client and server negotiate the [**SMB dialect**](#gt_29b8d978-7450-42b5-845c-045fc72b0fe1) to be used. + +**SMB message**: A protocol data unit. [**SMB messages**](#gt_fb37399e-d72d-41b6-b073-086da2d96e09) are comprised of a header, a parameter section, and a data section. The latter two can be zero length. An [**SMB message**](#gt_1308cf27-6aba-4d86-b38d-7926ba662311) is sometimes referred to simply as an SMB. Within \[MS-CIFS\], the term command means an [**SMB command**](#gt_dbae2612-173d-4988-9301-86cb559029f9) unless otherwise stated. + +**SMB session**: An authenticated user connection established between an [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) client and an [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) server over an [**SMB connection**](#gt_e1d88514-18e6-4e2e-a459-20d5e17e9078). There can be multiple active [**SMB sessions**](#gt_ee1ec898-536f-41c4-9d90-b4f7d981fd67) over a single [**SMB connection**](#gt_e1d88514-18e6-4e2e-a459-20d5e17e9078). The Uid field in the [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) packet header distinguishes the various sessions. + +**SMB transport**: Any protocol that acts as a transport layer for the [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) Protocol. + +**system access control list (SACL)**: An access control list (ACL) that controls the generation of audit messages for attempts to access a securable object. The ability to get or set an object's [**SACL**](#gt_c189801e-3752-4715-88f4-17804dad5782) is controlled by a privilege typically held only by system administrators. + +**Transmission Control Protocol (TCP)**: A protocol used with the Internet Protocol (IP) to send data in the form of message units between computers over the Internet. TCP handles keeping track of the individual units of data (called packets) that a message is divided into for efficient routing through the Internet. + +**tree connect**: A connection between a CIFS client and a share on a remote CIFS server. + +**Unicode**: A character encoding standard developed by the Unicode Consortium that represents almost all of the written languages of the world. The [**Unicode**](#gt_c305d0ab-8b94-461a-bd76-13b40cb8c4d8) standard [\[UNICODE5.0.0/2007\]](https://go.microsoft.com/fwlink/?LinkId=154659) provides three forms (UTF-8, UTF-16, and UTF-32) and seven schemes (UTF-8, UTF-16, UTF-16 BE, UTF-16 LE, UTF-32, UTF-32 LE, and UTF-32 BE). + +**Unicode character**: Unless otherwise specified, a 16-bit UTF-16 code unit. + +**Unicode string**: A [**Unicode**](#gt_c305d0ab-8b94-461a-bd76-13b40cb8c4d8) 8-bit string is an ordered sequence of 8-bit units, a [**Unicode**](#gt_c305d0ab-8b94-461a-bd76-13b40cb8c4d8) 16-bit string is an ordered sequence of 16-bit code units, and a [**Unicode**](#gt_c305d0ab-8b94-461a-bd76-13b40cb8c4d8) 32-bit string is an ordered sequence of 32-bit code units. In some cases, it could be acceptable not to terminate with a terminating null character. Unless otherwise specified, all [**Unicode strings**](#gt_b069acb4-e364-453e-ac83-42d469bb339e) follow the UTF-16LE encoding scheme with no Byte Order Mark (BOM). + +**unique identifier (UID)**: A pair consisting of a GUID and a version sequence number to identify each resource uniquely. The UID is used to track the object for its entire lifetime through any number of times that the object is modified or renamed. + +**Universal Naming Convention (UNC)**: A string format that specifies the location of a resource. For more information, see \[MS-DTYP\] section 2.2.57. + +**User Datagram Protocol (UDP)**: The connectionless protocol within TCP/IP that corresponds to the transport layer in the ISO/OSI reference model. + +**virtual circuit (VC)**: A transport-level connection between a CIFS client and a server. Some references use the term "virtual connection" instead of "virtual circuit". + +**MAY, SHOULD, MUST, SHOULD NOT, MUST NOT:** These terms (in all caps) are used as defined in [\[RFC2119\]](https://go.microsoft.com/fwlink/?LinkId=90317). All statements of optional behavior use either MAY, SHOULD, or SHOULD NOT. + +## References + +Links to a document in the Microsoft Open Specifications library point to the correct section in the most recently published version of the referenced document. However, because individual documents in the library are not updated at the same time, the section numbers in the documents may not match. You can confirm the correct section numbering by checking the [Errata](https://go.microsoft.com/fwlink/?linkid=850906). + +### Normative References + +We conduct frequent surveys of the normative references to assure their continued availability. If you have any issue with finding a normative reference, please contact [dochelp@microsoft.com](mailto:dochelp@microsoft.com). We will assist you in finding the relevant information. + +\[IEEE802.2-1998\] Institute of Electrical and Electronics Engineers, "Telecommunications and information exchange between systems - Local and metropolitan area networks - Specific requirements - Part 2: Logical Link Control", ISO/IEC 8802-2:1998 ANSI/IEEE Std 802.2, 1998 edition, [https://www.iso.org/standard/30174.html](https://go.microsoft.com/fwlink/?LinkId=127827) + +**Note** There is a charge to download the PDF. + +\[MS-BRWS\] Microsoft Corporation, "[Common Internet File System (CIFS) Browser Protocol](%5bMS-BRWS%5d.pdf#Section_d2d83b294b62479eb4279b750303387b)". + +\[MS-DFSC\] Microsoft Corporation, "[Distributed File System (DFS): Referral Protocol](%5bMS-DFSC%5d.pdf#Section_3109f4be2dbb42c99b8e0b34f7a2135e)". + +\[MS-DFSNM\] Microsoft Corporation, "[Distributed File System (DFS): Namespace Management Protocol](%5bMS-DFSNM%5d.pdf#Section_95a506a8cae64c42b19d9c1ed1223979)". + +\[MS-DTYP\] Microsoft Corporation, "[Windows Data Types](%5bMS-DTYP%5d.pdf#Section_cca2742956894a16b2b49325d93e4ba2)". + +\[MS-ERREF\] Microsoft Corporation, "[Windows Error Codes](%5bMS-ERREF%5d.pdf#Section_1bc92ddfb79e413cbbaa99a5281a6c90)". + +\[MS-FSCC\] Microsoft Corporation, "[File System Control Codes](%5bMS-FSCC%5d.pdf#Section_efbfe12773ad41409967ec6500e66d5e)". + +\[MS-LSAD\] Microsoft Corporation, "[Local Security Authority (Domain Policy) Remote Protocol](%5bMS-LSAD%5d.pdf#Section_1b5471ef4c334a91b079dfcbb82f05cc)". + +\[MS-MSRP\] Microsoft Corporation, "[Messenger Service Remote Protocol](%5bMS-MSRP%5d.pdf#Section_b3dd697e6e3e456da53604ddde16ac95)". + +\[MS-NLMP\] Microsoft Corporation, "[NT LAN Manager (NTLM) Authentication Protocol](%5bMS-NLMP%5d.pdf#Section_b38c36ed28044868a9ff8dd3182128e4)". + +\[MS-RAP\] Microsoft Corporation, "[Remote Administration Protocol](%5bMS-RAP%5d.pdf#Section_fb8d5bd1e57c4be1b063ec31330bdd58)". + +\[MS-RPCE\] Microsoft Corporation, "[Remote Procedure Call Protocol Extensions](%5bMS-RPCE%5d.pdf#Section_290c38b192fe422991e64fc376610c15)". + +\[MS-SRVS\] Microsoft Corporation, "[Server Service Remote Protocol](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9)". + +\[NBF2CIFS\] Evans, T. D., "NetBIOS, NetBEUI, NBF, NBT, NBIPX, SMB, CIFS Networking", July 2003, [http://timothydevans.me.uk/n2c.html](https://go.microsoft.com/fwlink/?LinkId=162020) + +\[NBF\] Microsoft Corporation, "Comparison of Windows NT Network Protocols", November 2006. + +**Note** An archived copy is available upon request. + +\[NETBEUI\] IBM Corporation, "LAN Technical Reference: 802.2 and NetBIOS APIs", 1986, [https://www.ardent-tool.com/docs/boo/bk8p7001.boo](https://go.microsoft.com/fwlink/?LinkId=90224) + +**Note** Requires IBM Softcopy Reader for Windows V4.0 to read the file. + +\[RFC1001\] Network Working Group, "Protocol Standard for a NetBIOS Service on a TCP/UDP Transport: Concepts and Methods", RFC 1001, March 1987, [https://www.rfc-editor.org/info/rfc1001](https://go.microsoft.com/fwlink/?LinkId=90260) + +\[RFC1002\] Network Working Group, "Protocol Standard for a NetBIOS Service on a TCP/UDP Transport: Detailed Specifications", STD 19, RFC 1002, March 1987, [https://www.rfc-editor.org/info/rfc1002](https://go.microsoft.com/fwlink/?LinkId=90261) + +\[RFC1321\] Rivest, R., "The MD5 Message-Digest Algorithm", RFC 1321, April 1992, [https://www.rfc-editor.org/info/rfc1321](https://go.microsoft.com/fwlink/?LinkId=90275) + +\[RFC2119\] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997, [https://www.rfc-editor.org/info/rfc2119](https://go.microsoft.com/fwlink/?LinkId=90317) + +\[RFC2743\] Linn, J., "Generic Security Service Application Program Interface Version 2, Update 1", RFC 2743, January 2000, [https://www.rfc-editor.org/info/rfc2743](https://go.microsoft.com/fwlink/?LinkId=90378) + +\[RYAN\] Ryan, R., and Ryan, B., "LAN Manager: A Programmer's Guide, Version 2", Microsoft Press, July 1990, ISBN: 1556151667. + +\[XOPEN-SMB\] The Open Group, "Protocols for X/Open PC Interworking: SMB, Version 2", The Open Group, 1992, ISBN: 1872630456, [https://pubs.opengroup.org/onlinepubs/9697999099/toc.pdf](https://go.microsoft.com/fwlink/?linkid=2297696) + +### Informative References + +\[CIFS\] Leach, P. and Naik, D., "A Common Internet File System (CIFS/1.0) Protocol", March 1997, [https://winprotocoldocs-bhdugrdyduf5h2e4.b02.azurefd.net/references/draft-leach-cifs-v1-spec-02.txt](https://go.microsoft.com/fwlink/?linkid=2109334) + +\[ENSIGN\] Microsoft Corporation, "How to enable SMB signing in Windows NT", SP3 May 1997, KB 161372 Last modified August 2001, [https://jeffpar.github.io/kbarchive/kb/161/Q161372/](https://go.microsoft.com/fwlink/?LinkId=161959) + +**Note** NT 4.0 SP3 Readme + +\[FSBO\] Microsoft Corporation, "File System Behavior in the Microsoft Windows Environment", June 2008, [http://download.microsoft.com/download/4/3/8/43889780-8d45-4b2e-9d3a-c696a890309f/File%20System%20Behavior%20Overview.pdf](https://go.microsoft.com/fwlink/?LinkId=140636) + +\[IBM-SMB\] IBM Personal Computer Seminar Proceedings, "The IBM PC Network Program", vol 2, No 8, October 1984. + +\[IMPCIFS\] Hertel, C. R., "Implementing CIFS - The Common Internet File System", Prentice Hall, August 2003, ISBN: 013047116X. + +\[KB102067\] Microsoft Corporation, "SESSTIMEOUT Information", Last modified August 2001, [https://jeffpar.github.io/kbarchive/kb/102/Q102067/](https://go.microsoft.com/fwlink/?LinkId=162005) + +\[KB129202\] Microsoft Corporation, "PC Ext: Explanation of Opportunistic Locking on Windows NT", Last modified December 2003, [https://www.betaarchive.com/wiki/index.php?title=Microsoft_KB_Archive/129202](https://go.microsoft.com/fwlink/?LinkId=162006) + +\[KB143474\] Microsoft Corporation, "Restricting information available to anonymous logon users", Last modifed May 2007, [https://www.betaarchive.com/wiki/index.php?title=Microsoft_KB_Archive/143474](https://go.microsoft.com/fwlink/?LinkId=162009) + +**Note** Applies to NT 3.5.1 to NT 4.0 + +\[KB297684\] Microsoft Corporation, "Mapped Drive Connection to Network Share May Be Lost", [http://support.microsoft.com/kb/297684](https://go.microsoft.com/fwlink/?LinkId=162010) + +\[KB301673\] Microsoft Corporation, "You cannot make more than one client connection over a NAT device", [https://www.betaarchive.com/wiki/index.php/Microsoft_KB_Archive/301673](https://go.microsoft.com/fwlink/?LinkId=162011) + +\[KB887429\] Microsoft Corporation, "Overview of Server Message Block signing", Version 2.4, November 2007, [http://support.microsoft.com/kb/887429](https://go.microsoft.com/fwlink/?LinkId=122493) + +\[MD5Collision\] Klima, V., "Tunnels in Hash Functions: MD5 Collisions Within a Minute", March 2006, [http://eprint.iacr.org/2006/105.pdf](https://go.microsoft.com/fwlink/?LinkId=89937) + +\[MS-FSA\] Microsoft Corporation, "[File System Algorithms](%5bMS-FSA%5d.pdf#Section_860b1516c45247b4bdbc625d344e2041)". + +\[MS-MAIL\] Microsoft Corporation, "[Remote Mailslot Protocol](%5bMS-MAIL%5d.pdf#Section_8ea19aa46e5a4aedb6280b5cd75a1ab9)". + +\[MS-NBTE\] Microsoft Corporation, "[NetBIOS over TCP (NBT) Extensions](%5bMS-NBTE%5d.pdf#Section_3461cfa83d284fa38163131bf1046fa3)". + +\[MS-SMB2\] Microsoft Corporation, "[Server Message Block (SMB) Protocol Versions 2 and 3](%5bMS-SMB2%5d.pdf#Section_5606ad475ee0437a817e70c366052962)". + +\[MS-SMB\] Microsoft Corporation, "[Server Message Block (SMB) Protocol](%5bMS-SMB%5d.pdf#Section_f210069c70864dc2885e861d837df688)". + +\[MS-WPO\] Microsoft Corporation, "[Windows Protocols Overview](%5bMS-WPO%5d.pdf#Section_c5f54a7765be40a0bb829e4181d8ab67)". + +\[MSDFS\] Microsoft Corporation, "How DFS Works", March 2003, [http://technet.microsoft.com/en-us/library/cc782417%28WS.10%29.aspx](https://go.microsoft.com/fwlink/?LinkId=89945) + +\[MSDN-CallNmdPipe\] Microsoft Corporation, "CallNamedPipe function", [http://msdn.microsoft.com/en-us/library/aa365144(VS.85).aspx](https://go.microsoft.com/fwlink/?LinkId=182715) + +\[MSDN-CreateFile\] Microsoft Corporation, "CreateFile function", [http://msdn.microsoft.com/en-us/library/aa363858(VS.85).aspx](https://go.microsoft.com/fwlink/?LinkId=182698) + +\[MSDN-DiscntEndpoint\] Microsoft Corporation, "Disconnecting an Endpoint-to-Endpoint Connection", [http://msdn.microsoft.com/en-us/library/ff545611(v=VS.85).aspx](https://go.microsoft.com/fwlink/?LinkId=214274) + +\[MSDN-ENPLAINTXT\] Microsoft Corporation, "EnablePlainTextPassword", [http://msdn.microsoft.com/en-us/library/cc939354.aspx](https://go.microsoft.com/fwlink/?LinkId=162040) + +\[MSDN-GetNmdPipeHndState\] Microsoft Corporation, "GetNamedPipeHandleState function", [http://msdn.microsoft.com/en-us/library/aa365443(VS.85).aspx](https://go.microsoft.com/fwlink/?LinkId=182699) + +\[MSDN-GetNmdPipeInfo\] Microsoft Corporation, "GetNamedPipeInfo function", [http://msdn.microsoft.com/en-us/library/aa365445(VS.85).aspx](https://go.microsoft.com/fwlink/?LinkId=182705) + +\[MSDN-IMPERS\] Microsoft Corporation, "Impersonation", [http://msdn.microsoft.com/en-us/library/ms691341.aspx](https://go.microsoft.com/fwlink/?LinkId=106009) + +\[MSDN-IoCreateFile\] Microsoft Corporation, "IoCreateFile routine", [http://msdn.microsoft.com/en-us/library/ff548418.aspx](https://go.microsoft.com/fwlink/?LinkId=182725) + +\[MSDN-MakeEndpoint\] Microsoft Corporation, "Making an Endpoint-to-Endpoint Connection", [http://msdn.microsoft.com/en-us/library/ff549239(v=VS.85).aspx](https://go.microsoft.com/fwlink/?LinkId=214275) + +\[MSDN-PkNmdPipe\] Microsoft Corporation, "PeekNamedPipe function", [http://msdn.microsoft.com/en-us/library/aa365779(VS.85).aspx](https://go.microsoft.com/fwlink/?LinkId=121801) + +\[MSDN-RecErrorNotif\] Microsoft Corporation, "Receiving Error Notifications", [http://msdn.microsoft.com/en-us/library/ff563300(v=VS.85).aspx](https://go.microsoft.com/fwlink/?LinkId=214276) + +\[MSDN-SDCTRLREQSTS\] Microsoft Corporation, "Serial Device Control Requests", [https://learn.microsoft.com/en-us/windows-hardware/drivers/serports/serial-device-control-requests2](https://go.microsoft.com/fwlink/?LinkId=182724) + +\[MSDN-SetNmdPipeHndState\] Microsoft Corporation, "SetNamedPipeHandleState function", [http://msdn.microsoft.com/en-us/library/aa365787(VS.85).aspx](https://go.microsoft.com/fwlink/?LinkId=182918) + +\[MSDN-TDIDeviceObj\] Microsoft Corporation, "TDI Device Objects", [http://msdn.microsoft.com/en-us/library/ff565087(v=VS.85).aspx](https://go.microsoft.com/fwlink/?LinkId=214277) + +\[MSDN-TrnsactNmdPipe\] Microsoft Corporation, "TransactNamedPipe function", [http://msdn.microsoft.com/en-us/library/aa365790(VS.85).aspx](https://go.microsoft.com/fwlink/?LinkId=182709) + +\[MSDN-TrnspDrvIntfc\] Microsoft Corporation, "Transport Driver interface", [http://msdn.microsoft.com/en-us/library/ff565685(v=VS.85).aspx](https://go.microsoft.com/fwlink/?LinkId=214278) + +\[MSDN-WaitNmdPipe\] Microsoft Corporation, "WaitNamedPipe function", [http://msdn.microsoft.com/en-us/library/aa365800(VS.85).aspx](https://go.microsoft.com/fwlink/?LinkId=182711) + +\[MSDOCS-OBJ_ATTRIBS\] MIcrosoft Corporation, "OBJECT_ATTRIBUTES structure", [https://learn.microsoft.com/en-us/windows/win32/api/ntdef/ns-ntdef-\_object_attributes](https://go.microsoft.com/fwlink/?linkid=2105002) + +\[MSFT-IPXWAN\] Microsoft Corporation, "IPX WAN Broadcasting", [http://technet.microsoft.com/en-us/library/cc957949.aspx](https://go.microsoft.com/fwlink/?LinkId=162041) + +\[MSFT-NBNWLINK\] Microsoft Corporation, "The NWLink IPX/SPX/NetBIOS Compatible Transport Protocol (NWLink)", January 2005, [http://technet.microsoft.com/en-us/library/cc782167(WS.10).aspx](https://go.microsoft.com/fwlink/?LinkId=162031) + +\[MSFT-SecurityWatch\] Microsoft Corporation, "Security Watch", [http://technet.microsoft.com/en-us/magazine/2006.08.securitywatch.aspx](https://go.microsoft.com/fwlink/?LinkId=177588) + +\[MSFT-XEXTNP\] Microsoft Corporation, "OpenNET/Microsoft Networks FILE SHARING PROTOCOL EXTENSIONS", Version 1.9, September 1986, [https://winprotocoldocs-bhdugrdyduf5h2e4.b02.azurefd.net/references/XEXTNP.TXT](https://go.microsoft.com/fwlink/?LinkId=162042) + +\[MSKB-235717\] Microsoft Corporation, "BUG: CallNamedPipe() API lpBytesRead Parameter Returns Bogus Number", Version 3.3, February 2007, [https://www.betaarchive.com/wiki/index.php?title=Microsoft_KB_Archive/235717](https://go.microsoft.com/fwlink/?LinkId=182630) + +\[MSKB-239869\] Microsoft Corporation, "How to enable NTLM 2 authentication", Version 4.7, January 2007, [https://support.microsoft.com/en-us/help/239869/how-to-enable-ntlm-2-authentication](https://go.microsoft.com/fwlink/?LinkId=182633) + +\[MSKB-288358\] Microsoft Corporation, "How to install the Active Directory Client Extension", Last reviewed June 2001, [https://www.betaarchive.com/wiki/index.php?title=Microsoft_KB_Archive/288358](https://go.microsoft.com/fwlink/?LinkId=182635) + +\[MSKB-320829\] Microsoft Corporation, "How to modify the default SizReqBuf value in Windows 2000 and Windows Server 2003", November 2006, [http://support.microsoft.com/kb/320829](https://go.microsoft.com/fwlink/?LinkId=304224) + +\[MSLOT\] Microsoft Corporation, "Mailslots", [http://msdn.microsoft.com/en-us/library/aa365576.aspx](https://go.microsoft.com/fwlink/?LinkId=90218) + +\[NWLINK\] Microsoft Corporation, "Description of Microsoft NWLINK IPX/SPX-Compatible Transport", October 2006, [http://support.microsoft.com/?kbid=203051](https://go.microsoft.com/fwlink/?LinkId=90239) + +\[RAP\] Leach, P. and Naik, D., "CIFS Remote Administration Protocol - Preliminary Draft", February 1997, [https://winprotocoldocs-bhdugrdyduf5h2e4.b02.azurefd.net/references/cifsrap2.txt](https://go.microsoft.com/fwlink/?LinkId=90255) + +\[SMB-CORE\] Microsoft Corporation, Intel Corporation, "Microsoft Networks / OpenNet", Document Version 2, November 1988, [https://winprotocoldocs-bhdugrdyduf5h2e4.b02.azurefd.net/references/SMB-CORE.ps](https://go.microsoft.com/fwlink/?LinkId=164301) + +\[SMB-LM12\] Microsoft Corporation, "Microsoft Networks SMB File Sharing Protocol Extensions", Version 3.0, Document Version 1.09, November 1989, [https://winprotocoldocs-bhdugrdyduf5h2e4.b02.azurefd.net/references/SMB.TXT](https://go.microsoft.com/fwlink/?LinkId=163208) + +\[SMB-LM1X\] Microsoft Corporation, "Microsoft Networks SMB File Sharing Protocol Extensions", Version 2.0, Document Version 3.3, November 1988, [https://winprotocoldocs-bhdugrdyduf5h2e4.b02.azurefd.net/references/SMB-LM1X.pdf](https://go.microsoft.com/fwlink/?LinkId=164302) + +\[SMB-LM20\] Microsoft Corporation, "Microsoft Networks SMB File Sharing Protocol Extensions", Version 3.0, Document Version 1.11, June 1990, [https://winprotocoldocs-bhdugrdyduf5h2e4.b02.azurefd.net/references/SMB-LM20.ps](https://go.microsoft.com/fwlink/?LinkId=163213) + +\[SMB-LM21\] Microsoft Corporation, "Microsoft Networks SMB File Sharing Protocol Extensions", Document Version 3.4, February 1992, [https://winprotocoldocs-bhdugrdyduf5h2e4.b02.azurefd.net/references/SMB-LM21.doc](https://go.microsoft.com/fwlink/?LinkId=163216) + +\[SNIA\] Storage Networking Industry Association, "Common Internet File System (CIFS) Technical Reference, Revision 1.0", March 2002, [https://www.cs.miami.edu/home/burt/learning/Csc521.071/docs/CIFS-TR-1p00_FINAL.pdf](https://go.microsoft.com/fwlink/?LinkId=90519) + +## Overview + +The [**Common Internet File System (CIFS)**](#gt_fb37399e-d72d-41b6-b073-086da2d96e09) is a general-purpose network file system protocol. It provides clients with managed, concurrent access to files and directories hosted on server systems. It also provides access to print queues and interprocess communication services, and supports authenticated transport for remote procedure call subprotocols. With a few exceptions, CIFS is client-driven in that a client makes requests to which a server responds. + +To this end, CIFS defines three entities: the **client**, the **server**, and the **application**. The client is an implementation of the protocol and originates most of the messages. The server is also an implementation of the protocol and provides the majority of the functionality described herein as a service. Remaining functionality is handled by a number of subsystems associated with CIFS. These include: + +- Transaction processing subsystems (SMB Trans, SMB Trans2, and NT Trans) +- User authentication subsystem +- [**Distributed File System (DFS)**](#gt_0b8086c9-d025-45b8-bf09-6b5eca72713e) processing subsystem +- **Remote Administration Protocol (RAP)** processing subsystem +- **Remote Procedure Call (RPC)** processing subsystem + +These subsystems can be integrated into a CIFS server implementation or can be accessed as separate services via CIFS. + +Although the client originates most exchanges in CIFS, it is not the triggering entity in most cases; that role is filled by the application. The application is an entity that needs support of the CIFS protocol, but does not directly implement the protocol. Instead, the application relies on the implementation of CIFS by the client to gain the benefits of the CIFS services, through an API or other access method that is not defined in this specification. The application can be a piece of software that fulfills purposes such as word processing or a graphic user interface to file management, but can be particular to CIFS. + +Hereafter, the terms "client", "server", and "application" describe the aforementioned entities. This specification assumes that although the client and the application are independent entities, they are considered to be tightly bound as far as CIFS is concerned. There is no direct interaction between the application and the server, except through the client. As such, there is no independent role attributed to the application in this specification. + +CIFS is a stateful protocol. It imposes state to maintain [**security contexts**](#gt_88d49f20-6c95-4b64-a52c-c3eca2fe5709), cryptographic protections, and file access semantics such as locking and caching. CIFS allows multiple clients to concurrently share files and printers hosted by server systems, thus facilitating collaboration, efficient use of resources, and centralized management. + +CIFS supports the following features: + +- **Transport independence**. The CIFS protocol itself does not place any requirements upon the transport protocol that is used to pass [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) messages between the client and the server. CIFS is typically carried over a connection-oriented protocol, but connectionless protocols have been used as CIFS transports. +- **Flexible connectivity**. A single client can connect to multiple servers, and can make one or more connections to each server. The activity of multiple client processes can be multiplexed over a single connection. +- **Feature negotiation**. The dialect and the supported feature set of the protocol are negotiated on a per-connection basis. +- **Resource access**. A client can concurrently access multiple shared resources (files, named pipes, print queues) on the target server. +- **Security contexts**. A client can create and use one or more security contexts over a connection. +- **File access**. A client can open, read, write, modify, delete, and close multiple files on the target server. File sharing is managed by the server, so multiple clients can have the same file open at the same time. +- **Extended subprotocols**. CIFS supports a set of subprotocols that provide direct access to additional server functionality. +- **Named pipe interprocess communication**. A client can open, read, write, and close [**named pipes**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca) on the target server. Named pipes provide a communications path between client and server processes. +- **File and record locking, and safe caching**. CIFS supports file and record locking, as well as opportunistic locking of files to allow clients to cache data for better performance. +- **File, directory, and volume attributes**. CIFS provides the ability to query and (with limitations) set file, directory, and volume attributes, including extended attributes. CIFS also provides support for the use of **Access Control Lists (ACLs)**. +- **File and directory change notification**. CIFS clients can post a request to be notified when a change is made to a file within a directory or directory tree on the server. +- **Batched commands**. CIFS AndX messages can be chained together and executed in sequence on the server, avoiding multiple message round-trips. +- **Distributed File System (DFS) support**. The **DFS namespace** is supported. DFS provides a single consistent object naming scheme (a unified namespace) that can span a collection of different servers and shares. The DFS model employed is a referral-based model, which is specified in [\[MS-DFSC\]](%5bMS-DFSC%5d.pdf#Section_3109f4be2dbb42c99b8e0b34f7a2135e). CIFS specifies the manner in which clients and servers receive and process referrals. +- **Remote Procedure Call Transport**. CIFS provides authenticated transport for remote procedure call protocols such as RPC [\[MS-RPCE\]](%5bMS-RPCE%5d.pdf#Section_290c38b192fe422991e64fc376610c15) and RAP [\[MS-RAP\]](%5bMS-RAP%5d.pdf#Section_fb8d5bd1e57c4be1b063ec31330bdd58). +- **Message verification**. CIFS supports message signing, as described in [\[KB887429\]](https://go.microsoft.com/fwlink/?LinkId=122493), which is used to ensure that messages have not been modified in transit. +- **Unicode file name support**. CIFS supports both extended ASCII (OEM) character set and Unicode file names. CIFS supports [**8.3 name**](#gt_d2302116-d3d3-4465-a72e-c07a7737b7ae) format file names, long file names using the extended ASCII character set (8-bit characters), and long file names in [**Unicode**](#gt_c305d0ab-8b94-461a-bd76-13b40cb8c4d8). + +## Relationship to Other Protocols + +**CIFS Transports** + +The [**CIFS**](#gt_fb37399e-d72d-41b6-b073-086da2d96e09) protocol is transport-independent. It requires only a mechanism for sending and receiving the [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) messages that are specified in this document. CIFS is designed for use over reliable transport, and is most commonly carried over connection-oriented [**sessions**](#gt_0cd96b80-a737-4f06-bca4-cf9efb449d12). With only minor modifications, however, it is possible to use a connectionless transport to exchange CIFS messages. + +The transport protocols most commonly used by CIFS fall into two basic categories: NetBIOS-based and Direct Hosting. NetBIOS-based transports include: + +- NetBIOS over TCP/IP (NBT), as specified in [\[RFC1001\]](https://go.microsoft.com/fwlink/?LinkId=90260) and [\[RFC1002\]](https://go.microsoft.com/fwlink/?LinkId=90261). +- NetBIOS Frames Protocol (NBF), as specified in [\[NETBEUI\]](https://go.microsoft.com/fwlink/?LinkId=90224). +- NetBIOS over IPX/SPX, known as NBIPX, and described in [\[MSFT-NBNWLINK\]](https://go.microsoft.com/fwlink/?LinkId=162031). + +NetBIOS-based transports provide three common services: a Name Service, a Datagram Service, and a Session Service. On DOS, OS/2, and Windows platforms, these three services are used to support a NetBIOS interface layer that is accessed via a common API. Implementation of the NetBIOS API is not required for CIFS. + +It is also possible to build a direct interface between CIFS and an underlying network transport without the use of a NetBIOS interface layer. In Microsoft documentation, this is referred to as "Direct Hosting". CIFS on DOS, OS/2, and Windows systems supports Direct Hosting over the connectionless IPX protocol. IPX Direct Hosting is briefly described in the Understanding NWLink section of \[MSFT-NBNWLINK\]. + +**Protocols Transported by CIFS** + +The following protocols use CIFS as a transport and provide CIFS clients with access to additional server functionality: + +- The SMB Transaction, Transaction2, and NT Transaction subprotocols. These are **SMB/CIFS** extensions and are described within this document. The SMB Transaction subprotocol provides support for writing to and reading from named pipes. +- **Remote Administration Protocol (RAP)**, as specified in [\[MS-RAP\]](%5bMS-RAP%5d.pdf#Section_fb8d5bd1e57c4be1b063ec31330bdd58). See also [\[RAP\]](https://go.microsoft.com/fwlink/?LinkId=90255) and [\[XOPEN-SMB\]](https://go.microsoft.com/fwlink/?linkid=2297696). +- The **Remote Procedure Call (RPC)** protocol over Named Pipes. SMB Transaction calls are used to perform I/O to named pipes. See [\[MS-RPCE\]](%5bMS-RPCE%5d.pdf#Section_290c38b192fe422991e64fc376610c15) for more information on **RPC** Protocol Extensions. + +**Additional Related Protocols** + +- CIFS supports the [**Distributed File System (DFS)**](#gt_0b8086c9-d025-45b8-bf09-6b5eca72713e) Namespace Referral Protocol, as specified in [\[MS-DFSC\]](%5bMS-DFSC%5d.pdf#Section_3109f4be2dbb42c99b8e0b34f7a2135e). For an overview of DFS, see [\[MSDFS\]](https://go.microsoft.com/fwlink/?LinkId=89945). For management of DFS, see [\[MS-DFSNM\]](%5bMS-DFSNM%5d.pdf#Section_95a506a8cae64c42b19d9c1ed1223979). +- CIFS services are announced via the **CIFS Browser Protocol**. CIFS clients access **Local Master Browser Server** and **Backup Browser Server** nodes in order to retrieve a copy of the services list, known as the **Browse List**. The **CIFS Browser Protocol**, which is specified in [\[MS-BRWS\]](%5bMS-BRWS%5d.pdf#Section_d2d83b294b62479eb4279b750303387b), creates and maintains the **Browse List**. +- The **Messenger Service**, which is documented in [\[MS-MSRP\]](%5bMS-MSRP%5d.pdf#Section_b3dd697e6e3e456da53604ddde16ac95), is related to CIFS in that it uses messages that are formatted as SMB messages. Although they are formatted as SMB messages, Messenger Service messages are not part of the CIFS protocol. +- The CIFS server interacts with the Server Service Remote Protocol [\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) for file server management and for synchronizing the information on [**shares**](#gt_a49a79ea-dac7-4016-9a84-cf87161db7e3), sessions, treeconnects, file [**opens**](#gt_0d572cce-4683-4b21-945a-7f8035bb6469), and server configurations. The synchronization mechanism is dependent on the CIFS server and the [**server service**](#gt_30c16b9f-63f9-472d-b344-08ba77497806) starting up and terminating at the same time. + +**CIFS Successors** + +The Server Message Block Version 1.0 (SMB) Protocol, as implemented in Windows 2000 and above, is specified in [\[MS-SMB\]](%5bMS-SMB%5d.pdf#Section_f210069c70864dc2885e861d837df688), which lists extensions, enhancements, and clarifications to this document. Note, however, that the protocol described in \[MS-SMB\] uses the same dialect identifier ("NT LM 0.12") as CIFS. + +The Server Message Block Version 2.0 (SMB2) Protocol, in contrast, is an entirely new file sharing protocol based upon SMB concepts. SMB2 is specified in [\[MS-SMB2\]](%5bMS-SMB2%5d.pdf#Section_5606ad475ee0437a817e70c366052962). + +## Prerequisites/Preconditions + +[**CIFS**](#gt_fb37399e-d72d-41b6-b073-086da2d96e09) requires an underlying network transport that is generally connection-oriented. With some minor modifications to CIFS protocol behavior, CIFS messages can be exchanged using a connectionless transport. If the transport is connection-oriented, the connection needs to be established before CIFS messages can be exchanged. + +CIFS assumes that the server has one or more of the following local resources available: + +- For file sharing services, a local file system or some other resource (such as a database) that can be presented as a file system. This resource is known as the [**object store**](#gt_0cc469e1-4b1f-41c4-9f94-d6209fcf468e). +- For printer services, a local print queue that spools print jobs to a printer. +- For interprocess communications using the named pipe abstraction, a file system that supports named pipes or a suitable emulation built into the CIFS server. + +The server is also required to provide or have access to a password database for authentication. To support challenge/response authentication, the password database is required to store the **LAN Manager** (LM) and [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) (NTLM) password hashes. + +## Applicability Statement + +[**CIFS**](#gt_fb37399e-d72d-41b6-b073-086da2d96e09) is a dialect of the [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) network file sharing protocol, designed to provide concurrent access to directories and files hosted on server systems. CIFS is applicable for all scenarios that involve transferring files between client and server. It is also applicable for accessing centralized print queues, and for interprocess communications using named pipes. + +## Versioning and Capability Negotiation + +The [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) Protocol supports dialect negotiation. A dialect is a version of the SMB Protocol that is generally defined in terms of additions and changes relative to a previous version. New SMB dialects typically provide new commands, can include modifications to previous commands, and are likely to include extensions to existing semantics. When the SMB Protocol starts up, its first task is to determine which dialect the client and server use to communicate. See the SMB_COM_NEGOTIATE command for a detailed description of the SMB dialect negotiation process. + +In the protocol negotiation process, SMB dialects are identified by Dialect Identifier Strings. For example, the **Core Protocol** is identified by two strings: "PCLAN1.0" or "PC NETWORK PROGRAM 1.0". Either or both of these strings can be sent by the client. The CIFS dialect is also known as [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) (or, simply NT LANMAN), and is identified by the dialect string "NT LM 0.12". + +The earliest dialect of SMB is now referred to as the **Core Protocol** because, for many years, it represented the least common set of commands that were required to be implemented for interoperability--the "core" set. In [**CIFS**](#gt_fb37399e-d72d-41b6-b073-086da2d96e09), many older commands including some original **Core Protocol** commands have been declared [**obsolete**](#gt_73fb9153-adab-4f17-b472-426f982e360c) and are no longer used. Others are listed as [**deprecated**](#gt_129acedf-ccf1-4e13-8df7-3bc59eff6f6d) or [**obsolescent**](#gt_8377951d-81ca-44a2-af83-2a6d6388c121), which means that they are likely to become obsolete and are not recommended to be used by clients, even though it is recommended that servers support them. + +The table below lists the most common or best-known dialects, as well as related documentation (if available). + +[**SMB Dialects**](#gt_29b8d978-7450-42b5-845c-045fc72b0fe1) + +| Dialect name | Dialect Identifier String | Comments | +| ------------------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Core Protocol | PCLAN1.0 | The dialect supported by IBM Corporation in early implementations of the SMB Protocol. It is documented in \[IBM-SMB\]. | +| Core Protocol | PC NETWORK PROGRAM 1.0 | Represents the MSNET SMB Protocol, which is also known as the "core protocol". This dialect is identical to the "PCLAN1.0" dialect, and some versions of MSNET accept either dialect string. This dialect is documented in [\[SMB-CORE\]](https://go.microsoft.com/fwlink/?LinkId=164301). | +| Xenix Extensions | xenix1.1 | The "xenix1.1" dialect is documented in [\[MSFT-XEXTNP\]](https://go.microsoft.com/fwlink/?LinkId=162042). This dialect provides a set of extensions to SMB to support the XENIX operating system.

Also known as the XENIX dialect. | +| Xenix Extensions | XENIX CORE | Another dialect supporting XENIX extensions, possibly the same as "xenix1.1". The "XENIX CORE" dialect string is sent in protocol negotiation performed by Windows NT and OS/2, among others. | +| CorePlus | MICROSOFT NETWORKS 1.03 | This string denotes the "CorePlus" dialect, consisting of several minor extensions to the core protocol, including raw read and write commands and compound commands such as SMB_COM_LOCK_AND_READ and SMB_COM_WRITE_AND_UNLOCK. The CorePlus extensions are documented in [\[XOPEN-SMB\]](https://go.microsoft.com/fwlink/?linkid=2297696). | +| LAN Manager 1.0 | LANMAN1.0 | The LAN Manager 1.0 extended protocol was created to support OS/2 system functions and file system features. It is documented in [\[SMB-LM1X\]](https://go.microsoft.com/fwlink/?LinkId=164302) and \[XOPEN-SMB\]. | +| DOS LAN Manager 1.0 | MICROSOFT NETWORKS 3.0 | This is the DOS LAN Manager 1.0 extended protocol. It is identical to "LANMAN1.0", except that OS/2 error codes are translated to DOS error codes before being transmitted to the client. | +| LAN Manager 1.2 | LANMAN1.2 | The LAN Manager 1.2 extended protocol adds support for additional OS/2 commands and features to "LANMAN1.0". LAN Manager 1.2 is documented in [\[SMB-LM12\]](https://go.microsoft.com/fwlink/?LinkId=163208) and \[XOPEN-SMB\]. | +| LAN Manager 2.0 | LM1.2X002 | This represents the LAN Manager 2.0 extended protocol for OS/2. It is documented in [\[SMB-LM20\]](https://go.microsoft.com/fwlink/?LinkId=163213) and \[XOPEN-SMB\].

Also known as the LANMAN2.0 dialect. | +| DOS LAN Manager 2.0 | DOS LM1.2X002 | This is the DOS version of LAN Manager 2.0. It is also documented in \[SMB-LM20\] and \[XOPEN-SMB\]. When this dialect is selected, OS/2 error codes are translated to DOS error codes by the server before transmission to the client.

Also known as the DOS LANMAN2.0 dialect. | +| LAN Manager 2.1 | LANMAN2.1 | LAN Manager 2.1 extended protocol. The additions and changes with respect to LAN Manager 2.0 are documented in [\[SMB-LM21\]](https://go.microsoft.com/fwlink/?LinkId=163216). | +| DOS LAN Manager 2.1 | DOS LANMAN2.1 | DOS LAN Manager 2.1 extended protocol. This is, once again, identical to the OS/2 version of the dialect except that error codes are translated. See \[SMB-LM21\]. | +| NT LAN Manager | NT LM 0.12 | NT LAN Manager extended protocol. This set of extensions was created to support Windows NT. OS/2 LAN Manager 2.1 features are also supported. This dialect was originally documented in [\[CIFS\]](https://go.microsoft.com/fwlink/?linkid=2109334).

Also known as the NT LANMAN dialect. | + +Security Negotiation: During the initialization of the SMB session, the server indicates support for: + +- Either user-oriented or resource-oriented access controls. +- Plaintext or challenge/response authentication. +- Message signing. If it is supported, the server indicates that it is required. + +If the client or server requires message signing but the other node does not support it, then SMB session establishment fails. Similarly, if either node requires a higher level of authentication security than the other supports, session establishment fails. See the SMB_COM_NEGOTIATE command for a detailed description of security negotiation. + +Feature Negotiation: The client and server can negotiate individual features on a per-connection or, in some cases, per-message basis: + +- CIFS provides a mechanism for negotiating a specific set of Capabilities, including support for Unicode file names, 64-bit file offsets, and Opportunistic Locking. For the complete list of Capabilities, see the SMB_COM_NEGOTIATE command specification. Capabilities are negotiated at session startup. +- Each SMB message includes two bit fields (Flags and Flags2) that indicate whether a specific feature or option has been selected for use in that message. These fields are described in section [2.2.3.1](#Section_69a29f73de0c45a6a1aa8ceeea42217f). + +## Vendor-Extensible Fields + +This protocol uses NTSTATUS values as defined in [\[MS-ERREF\]](%5bMS-ERREF%5d.pdf#Section_1bc92ddfb79e413cbbaa99a5281a6c90) section 2.3. Vendors are free to choose their own values for this field, as long as the C bit (0x20000000) is set, indicating that it is a customer code. + +[**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) command codes listed as **Reserved** or **Unused** can be defined in future versions of [**CIFS**](#gt_fb37399e-d72d-41b6-b073-086da2d96e09) or new SMB dialects, and thus MUST NOT be used in any CIFS implementation. Similarly, fields (including bit fields) that are marked **Reserved** MUST NOT be used. Undefined transaction sub-command codes and undefined [**Information Level**](#gt_b01da706-86d0-4ee2-9461-2d9fb1060543) values are reserved for future use. + +## Standards Assignments + +[**CIFS**](#gt_fb37399e-d72d-41b6-b073-086da2d96e09) transports can have assigned port numbers or other assigned values. See the documentation for the specific transport for more information. + +# Messages + +## Transport + +This section describes the transport protocols that are implemented by the operating systems discussed in section [1](#Section_934c2faa54af4526ac746a24d126724e), and which are used in transporting SMB messages.[<1>](#Appendix_A_1) Other transports could be available from third parties. In this document, the transport layer is referred to generically as the "SMB transport". The server assigns an implementation-specific name to each transport, as specified in [\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 2.2.4.96. + +### NetBIOS-Based Transports + +The [**Network Basic Input/Output System (NetBIOS)**](#gt_b86c44e6-57df-4c48-8163-5e3fa7bdcff4) is a software interface layer. NetBIOS is specified in [\[NETBEUI\]](https://go.microsoft.com/fwlink/?LinkId=90224).[<2>](#Appendix_A_2) NetBIOS imposes semantic requirements on the underlying transport mechanism. NetBIOS-based transports MUST support three common services: + +- The **NetBIOS name service** +- The [**NetBIOS datagram service**](#gt_1cb3033f-8302-4ae3-819b-8a265f96f909) +- The **NetBIOS session service** + +The **NetBIOS name service** provides a mechanism for registering and releasing [**NetBIOS names**](#gt_0334e0bd-2755-42f6-aeff-2d4a22bf4abf). NetBIOS names are end-point addresses; each name represents an application or service running on a node on the network. + +The NetBIOS datagram service provides connectionless, unreliable transport for unicast, multicast, and [**broadcast**](#gt_7f275cc2-a1c5-47d7-83ae-9a84178f2481) messages (datagrams). + +The **NetBIOS session service** provides reliable, point-to-point transport. When using the **NetBIOS session service**, [**CIFS**](#gt_fb37399e-d72d-41b6-b073-086da2d96e09) makes no higher-level attempts to ensure reliable, sequenced delivery of messages between the client and server. The underlying transport is responsible for detecting failures of either the client node or server node and for delivering failure indications to the client or server software so that resources can be freed and errors can be reported to applications. + +The **NetBIOS session service** supports the following behavior: + +- If the client generates malformed requests (for example, if messages received on the session do not begin with the '\\xFF', 'S', 'M', 'B' protocol identifier string), a server can drop the transport connection to the client. The server SHOULD[<3>](#Appendix_A_3) first return an error message response with an [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) error class of ERRCMD (0xFF). If a server receives a hard error on the transport (such as a send failure) the transport connection to that client can be aborted. +- If a client has no open resources on the server (no open files, directories, search contexts, and so on), the server can terminate the transport connection. It is expected that the client implementation can automatically reconnect to the server. See section [3.3.2.2](#Section_01688aa7038d484991ff3b55781a7253) for a description of the Idle Connection Timer. + +For more information about NetBIOS, see [\[NBF2CIFS\]](https://go.microsoft.com/fwlink/?LinkId=162020), [\[XOPEN-SMB\]](https://go.microsoft.com/fwlink/?linkid=2297696) Appendix E, \[NBF\], and \[RYAN\]. + +#### NetBIOS Frames (NBF) Protocol Transport + +The **NetBIOS Frames (NBF)** protocol is a non-routable transport that provides [**NetBIOS**](#gt_b86c44e6-57df-4c48-8163-5e3fa7bdcff4) services over IEEE 802.2 as specified in [\[NETBEUI\]](https://go.microsoft.com/fwlink/?LinkId=90224). The **NBF NetBIOS session service** makes use of IEEE 802.2 Logical Link Control connection-oriented services (Type 2), as specified in [\[IEEE802.2-1998\]](https://go.microsoft.com/fwlink/?LinkId=127827). + +IBM Corporation first introduced the **NBF** protocol specification in 1985 (see \[NETBEUI\]). The **NBF** transport protocol is sometimes referred to as NetBEUI (NetBIOS Extended User Interface) in Microsoft documentation (for more information, see \[NBF\]). + +#### NetBIOS over TCP/UDP (NBT) Transport + +**NetBIOS over TCP/UDP (NBT)** is specified in [\[RFC1001\]](https://go.microsoft.com/fwlink/?LinkId=90260) and [\[RFC1002\]](https://go.microsoft.com/fwlink/?LinkId=90261). **NBT** provides a mapping of the required [**NetBIOS**](#gt_b86c44e6-57df-4c48-8163-5e3fa7bdcff4) services to the [**TCP**](#gt_b08d36f6-b5c6-4ce4-8d2d-6f2ab75ea4cb) and [**UDP**](#gt_a70f5e84-6960-42f0-a160-ba0281eb548d) internet protocols. Because the underlying [**IP**](#gt_64c29bb6-c8b2-4281-9f3a-c1eb5d2288aa) protocol is routable, **NBT** transport can provide NetBIOS services across an internetwork. However, special servers are required in order to maintain the coherency of the **NetBIOS name space** across multiple subnets. These are the [**NetBIOS Name Server (NBNS)**](#gt_a28c2e64-21dd-46ca-9aea-42204fbb8411) and the **NetBIOS Datagram Distribution Server (NBDD)**.[<4>](#Appendix_A_4) + +#### NetBIOS over IPX/SPX (NBIPX) Transport + +[**Internetwork Packet Exchange/Sequenced Packet Exchange (IPX/SPX)**](#gt_f4b3465a-8dcb-4e48-b4e9-1369bb1fe7af) is a network protocol suite provided by Novell. [**CIFS**](#gt_fb37399e-d72d-41b6-b073-086da2d96e09) can use **NetBIOS over IPX/SPX (NBIPX)** as a transport for SMB messages. + +Novell introduced an implementation of **NetBIOS over IPX** in 1986. Microsoft later provided its own **IPX/SPX/NetBIOS**\-compatible transport, **NWLINK** (see [\[NWLINK\]](https://go.microsoft.com/fwlink/?LinkId=90239)). **NBIPX** provides a mapping of the required [**NetBIOS**](#gt_b86c44e6-57df-4c48-8163-5e3fa7bdcff4) services to IPX/SPX. The **NBIPX NetBIOS session service** is mapped to **SPX** sessions, while datagrams are sent using the connectionless IPX protocol. For more information on **NWLINK** and **NBIPX** components, see \[NBF\] and \[NWLINK\]. + +#### Other NetBIOS-Based Transports + +Several other NetBIOS-based transports have been defined and/or implemented. Many of these are proprietary, and most have fallen out of common use. + +[**TOP/NetBIOS**](#gt_b86c44e6-57df-4c48-8163-5e3fa7bdcff4) provides a specification for NetBIOS service support over OSI protocols. This specification is available in Appendix E of [\[XOPEN-SMB\]](https://go.microsoft.com/fwlink/?linkid=2297696). + +### Direct Hosting + +Microsoft has also produced "Direct Hosting" transports, which bypass the [**NetBIOS**](#gt_b86c44e6-57df-4c48-8163-5e3fa7bdcff4) interface layer.[<5>](#Appendix_A_5) + +#### Direct IPX Transport + +**Direct IPX Transport** (also known as **Direct Hosting IPX**) carries [**CIFS**](#gt_fb37399e-d72d-41b6-b073-086da2d96e09) over [**IPX**](#gt_f4b3465a-8dcb-4e48-b4e9-1369bb1fe7af) protocol without the use of the [**NetBIOS**](#gt_b86c44e6-57df-4c48-8163-5e3fa7bdcff4) interface layer. + +Unlike other transport protocols used with CIFS, the **Direct IPX Transport** protocol is asymmetric. Wherever possible, processing is moved from the server to the client so that the server can scale to a large number of clients efficiently. For example, the server does not initiate retransmission of lost responses. It is entirely up to the client to resend the request in the case of lost packets in either direction. + +IPX is also a connectionless protocol, so CIFS itself provides mechanisms for ensuring sequential delivery of messages between the client and server, and for detecting and recovering from failures of either the client node or server node. To accomplish these goals, the SMB Header (section [2.2.3.1](#Section_69a29f73de0c45a6a1aa8ceeea42217f)) is modified to include a connection identifier (**CID**) and a sequence number (**SequenceNumber**). The **CID** value is generated by the server and returned to the client in the SMB_COM_NEGOTIATE Response (section [2.2.4.52.2](#Section_a4229e1a8a4e489aa2eb11b7f360e60c)). The client MUST use this **CID** in all future [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) exchanges with this server during this resource sharing session. + +The **SequenceNumber** value is provided by the client. If the sequence number is zero, the command is known as an "unsequenced command" and the client MUST use the **PID** and **MID** fields to match a response message to the client process that generated the request. In particular, the client MUST ensure that it never has more than one distinct outstanding unsequenced request with the same **MID**. + +Sequenced commands have nonzero **SequenceNumber** values. Sequenced commands are used for operations that cause state changes on the server which cannot be repeated. For example, file open, file close, or byte-range locking. Unsequenced commands are used for operations that can be performed as many times as necessary with the same result each time. For example, reading or writing to a disk file. + +CIFS servers using **Direct IPX Transport** MUST maintain a small buffer for each client. This buffer is used to temporarily store the response information from the most recent sequenced command. If the client does not receive a response to a sequenced request it SHOULD resend the request. If the server has already processed the request, the response MUST still be in the buffer and can be resent. If the server did not receive the original request, it is able to process the retransmitted request. When the client sends the next sequenced command request, it signals that the previous sequenced response was received and that the buffer can be reused. + +Because of the asymmetric nature of the **Direct IPX Transport**, the server allocates a limited amount of space for the response buffer. Therefore, the client MUST send all commands that have a "large" response size as unsequenced. Such commands include file read and directory search operations. If the response to a sequenced command is too large for the response buffer, the server MUST fail the request with ERRSRV/ERRerror. + +SMB Transactions are capable of transferring large amounts of data from the server to the client. Transactions can be used to change server state and so MUST NOT be sent as unsequenced commands. There are ways for clients to organize the commands to work around this limitation. Transactions can contain multi-part requests and/or multi-part responses. The sizes of the response messages can be adjusted to fit within the response buffer. Therefore, SMB Transactions are handled as a set of sequenced commands. + +Section [3.2.4.1.5](#Section_9d877a4ac60c40e98520849c5a94fc1d) describes SMB Transactions as used over connection-oriented transports. Transaction processing is modified when CIFS is carried over a connectionless transport, such as **Direct IPX Transport**. + +When transactions are carried over a connectionless transport, each request message is sent as a sequenced command. Each message MUST have a consistent **MID** value and a nonzero **SequenceNumber** value that increases by one with each new message in the transaction. The server MUST respond to each request message, except the last one, with a response indicating that the server is ready for the next secondary request. For the initial transaction request message and all subsequent transaction secondary requests, except for the last request message, the server MUST send an interim response. + +![CIFS transaction messages over connectionless transport](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAToAAAGyCAYAAAB0oQjpAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAACw4AAAsPAVml0AAAADFtSURBVHhe7Z0tmBTH+kcjIpCRiAhEBCICGXFFREREBCYCEXHFFYgrIhCIK5FIJAKBiUAgkBERiAhEBAKBiEAiENj9P6czv/2/FD0fvTO1W7N7zvPU01/10dNTdXirZ+n+4v379yf/+9//TAdMXFORs/Dx48eTBw8ezPYr09nS27dvT75g5fvvv5/NYFqeci1FzsLjx49Pbt269Vm/Mp0t3b59++Tf//73P6IjyWHweso+IDoGphyGXE9Fd2C8nrIPiu6wKLpOeD1lHxTdYVF0nfB6yj4ousOi6Drh9ZR9UHSHRdF1wusp+6DoDoui64TXU/ZB0R0WRdcJr6fsg6I7LIquE15P2QdFd1gUXSe8nrIPiu6wKLpOeD1lHxTdYVF0nfB6yj4ousOi6Drh9ZR9UHSHRdF1wusp+6DoDoui64TXU/ZB0R0WRdcJr6fsg6I7LIquE15P2QdFd1gUXSe8nrIPiu6wKLpOeD1lHxTdYVF0nfB6yj4ousMynOhevXq1WjtuFJ3sg6I7LOcuukePHp3861//Ok337t07efPmzeroyck333xzKjtO7JBf9u+//z61fx4oOtmHXqJ7/vz5J+OPt2M9efJkdfTycq6iy8XlwiIzxEPj7AtVdEjpkGLiPZm1rZ4oOtmHHqJjLDG+Mv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XSfoJEs6ytL8cnxsE9I2kFCiQgZipp3Z18qrQh7kyBSb9TZSq4MaGVaRVtifdJFw/kuiTUXXiaXiWppfpIJ4NomOgQtIbI46qJlC10iywoNc8/guHudFunXr1rR9586d6Sk3nEdk+P79+1XJw8J50Dbtto8Pm0PRdULRyYgkCqywrxUgg3zX/khkhdSePn06ie7+/funMuQ9KAjpxo0b0/aPP/54+tgvBEW5t2/frmraHdqIaCNbHja7DkXXCUUnx0ymuIcCmSE15BbRIT3khwSRFVKMIBEZeZAn5dppKiKqokvigbFEe20kqeg6oehEloGckBqJ6S+iYzqM+IjYIjO2EymuSxxHlvl1WdF1QtGJ9AER5pH/uySk9fPPPyu6Hig6kX7kRU+bElFd7gmyVHQdUHQifWA6Oic2XvXJW++4r9e++N2paycUnUgf+GGCqSu/FOdPWbah6Dqh6ETGQdF1QtGJjIOi64SiExkHRdcJRScyDoquE4pOZBwUXScUncg4KLpOKDqRcVB0nVB0IuOg6Dqh6ETGQdF1QtGJjIOi64SiExkHRdcJRScyDoquE4pOZBwUXScUncg4KLpOKDqRcVB0nVB0IuOg6Dqh6ETGQdF1QtGJjIOi64SiExkHRdcJRScyDoquE0iLN5DnreTbEnkVnUgfEBevP5wbe3OJF2Yruh347bffTv7zn/98dgETubX7yUsZETk8f/zxx8kvv/zy2bj76aefJqm1+//73/+ePHz4cFV6HIYT3TpyIUXk4nn8+PEU7R0LRyM6EZGzYkQnIosxouuEohMZB0UnIjIYRnQishgjuk4oOpFxUHQiIoNhRCciizGi64SiExkHRSciMhhGdCKyGCO6Tig6kXFQdCIig2FEJyKLMaLrxKtXr05+//331ZaIXCSvX78+efHixWprdE5O/g8XokcXYRWvjgAAAABJRU5ErkJggg==) + +Figure 1: CIFS transaction messages over connectionless transport + +When the last transaction request has been received by the server, the server MUST respond with a final response message, as described in section 3.2.4.1.5. However, if the there are multiple final response messages, then the client MUST respond to each of the final response messages, except the last one, by sending an empty secondary request message. No parameters or data are transferred to the server in these messages. They are used only as acknowledgments to indicate that the response message has been received. These acknowledgment messages contain the following information: + +- **ParameterDisplacement** is set to the number of parameter bytes that the client has received from the server so far in this transaction. +- **DataDisplacement** is set to the number of data bytes that the client has received from the server so far in this transaction. +- **ParameterCount**, **ParameterOffset**, **DataCount**, and **DataOffset** MUST be set to zero. + +When the transaction has been completed, the client MUST send another sequenced command to the server. This indicates to the server that all of the transaction final response messages have been received and that the parameter and data transfer is complete. Resources allocated to the transaction command can then be released by the server. + +![CIFS transaction completion messages over connectionless transport](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAToAAAGyCAYAAAB0oQjpAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAACw4AAAsPAVml0AAAAC4uSURBVHhe7Z0vuBRH2kcjEJHIiBWICAQCsQKxImIFIgITgYhYGbECgUCsRCKRiCswEQgEYkVEBAKBiEAgECuQCAT2fs8Z5sf30vTMdN/pmltz7znPU0//e6u6p6fq5K0ecvu7Dx8+nP7nP/+xLFi4pyJn4dOnT6cPHz4c7VeWs5V3796dfsfKTz/9NBpgmV9yL0XOwpMnT05v3rz5Tb+ynK3cuXPn9F//+tdn0VFkGbyfsg+IjoEpy5D7qegWxvsp+6DolkXRNcL7Kfug6JZF0TXC+yn7oOiWRdE1wvsp+6DolkXRNcL7Kfug6JZF0TXC+yn7oOiWRdE1wvsp+6DolkXRNcL7Kfug6JZF0TXC+yn7oOiWRdE1wvsp+6DolkXRNcL7Kfug6JZF0TXC+yn7oOiWRdE1wvsp+6DolkXRNcL7Kfug6JZF0TXC+yn7oOiWRdE1wvsp+6DolkXRNcL7Kfug6JZF0TXC+yn7oOiWRdE1wvsp+6DolqU70b1+/Xq9dtwoOtkHRbcsBxfd48ePT//xj398Kffv3z99+/bt+ujp6Y8//vhFdlzYkl/2H3/8sTr/IVB0sg+tRPf8+fOvxh9vxzo5OVkfvbgcVHS5udxYZIZ4ODn7QhUdUlpSTLwns56rJYpO9qGF6BhLjK+MPwqJBvsuOgcT3TbJ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RttbhIdbUU6nL/ea841rMe5KJyDeixTh2viejg3pV6X9ImiawSDog6mXcyNP2aQCh2JJQVZZH+EU9chGRdQlzpsR3aAkDbdw8SHoexYJyb7E8s11HPDtvNIn8wV19z4Q6HojgikQSdCInX6irSQynAdIj6yp9oBq3S2CSj1K5yjPuOjfq5lG3meKMeDomvEXHHNje+d4f8A/vLly/WRzULaJi3aofMBHRBJJZurHTLZ3RCfiV1uFF0j5oprbvy7d+++kschOctfsXjx4sW69meJjXUisrXcg7oO1InEOC/rydA4JrINRdeIueKaGs+g5ktAJiyX5lB/imdTJ6rTSwUmS6HoGrG06MiIEAuiSeGFH3Po6e+J0Z7IoVB0jVhKdE+ePDm9efPmV4JLQU7hmP8ookhrFF0j9hHdhw8fTh89erR6a9FQbrVcuXJFiYlMQNE14iyiu3Xr1kpSV69e/UZqmwp/LFFEtoO4GFckAFMKsyhFN4GziO7GjRurTI4pJy/bHRPbsJitiezmzz//PP3111+/EdrPP/+8ktpw/7///e/VWOyNC/mMjiksP0Jw45mSjmV69Z9tiMg8eAZOtncsXNgfI4aQwfHl3Lt3bzXVZV1ELgeXRnQishxmdHui6ET6R9HtiaITkaVRdCIyGzO6PVF0Iv2j6PZE0YnI0nQpOv4hYv7/012FWEUncljM6Pbk999/X8kr//9pCv9vKmW4/+9//3uX/xJb5CKj6EREOuNoRJf/l05Ezh8zukYoOpF+UHQiIp1hRiciszGja4SiE+kHRSci0hlmdCIyGzO6Rig6kX5QdCIinWFGJyKzMaNrhKIT6QdFJyLSGWZ0IjIbM7pGKDqRflB0IiKdYUYnIrMxo2uEohPpB0UnItIZZnQiMhszukYoOpF+UHQiIp1hRiciszGja4SiE+kHRSci0hlmdCIyGzO6Rig6kX5QdCIinWFGJyKzMaNrxOvXr0//+OOP9ZaInCdv3rw5ffHixXqrd05P/w94xfTVr8qEKgAAAABJRU5ErkJggg==) + +Figure 2: CIFS transaction completion messages over connectionless transport + +For sequenced commands, the server requires that the sequence numbers are nonzero, start at 1, and increase by one for each new sequenced command. At 65535 (216 - 1), the sequence wraps to 0x0001, not 0x0000. Sequenced command requests that have an incorrect sequence number MUST be ignored. + +If the **CID** value is incorrect, the server MUST fail the request with ERRSRV/ERRinvsess. If the server is currently processing a command that matches either the sequence number (for sequenced commands) or the **MID** (for unsequenced commands) of a new request, the server MUST respond with ERRSRV/ERRworking. The values of ERRinvsess (0x0010) and ERRworking (0x0011) are defined only for the **Direct IPX Transport**. + +The server waits to receive commands from the client periodically; if no commands are received, the server treats the client as no longer running and closes the [**SMB session**](#gt_ee1ec898-536f-41c4-9d90-b4f7d981fd67). This includes closing file handles and releasing any resources allocated on behalf of the client. Clients SHOULD, at minimum, send an SMB_COM_ECHO (section [2.2.4.39](#Section_8c85435267c647f7a60da6c87b6b3aac)) to the server every few minutes. The server MUST NOT disconnect clients that have been inactive less than 5 minutes.[<6>](#Appendix_A_6) + +**Direct IPX Transport** can be used in situations in which multiple low-bandwidth connections are multiplexed together (for example, by using multiple telephone modems in parallel). CIFS provides special SMB commands, such as SMB_COM_READ_MPX (section [2.2.4.23](#Section_9688c7181f3543f280c530d8a59ac305)), for these environments. These commands, and the **Direct IPX Transport** itself, are obsolescent. + +See [\[MSFT-IPXWAN\]](https://go.microsoft.com/fwlink/?LinkId=162041) for more information on **Direct IPX Transport**. + +### Virtual Circuits + +In [**CIFS**](#gt_fb37399e-d72d-41b6-b073-086da2d96e09), a [**virtual circuit (VC)**](#gt_cb807fcb-1083-4081-b497-69b81d269a6b) represents a transport-level connection between a client and a server. VCs are of use in situations in which multiple physical connections are being combined to provide improved overall bandwidth for an [**SMB connection**](#gt_e1d88514-18e6-4e2e-a459-20d5e17e9078). For example, VCs make it possible to multiplex SMB messages from a single SMB connection over multiple dial-up modem connections in order to increase throughput. Virtual circuits are rarely used over connection-oriented transports such as **NBT**; they are typically associated with connectionless transports such as **Direct-hosting IPX**. VC multiplexing is performed at the command level, with the exception of the SMB_COM_READ_MPX and SMB_COM_WRITE_MPX commands, which are specifically designed to be multiplexed. + +VCs are established using the SMB_COM_SESSION_SETUP_ANDX command, and are combined based upon the **SessionKey** provided in the SMB_COM_NEGOTIATE response.[<7>](#Appendix_A_7) Every VC created between a client and server pair using the same **SessionKey** is considered to be part of the same SMB connection. Each VC thus created MUST have a unique **VcNumber** in the SMB_COM_SESSION_SETUP_ANDX request that is used to establish it. The first VC created SHOULD have a **VcNumber** of zero (0). The implementation-defined maximum number of virtual circuits that the client can establish per SMB connection is indicated by the **MaxNumberVcs** field in the server's SMB_COM_NEGOTIATE response.[<8>](#Appendix_A_8) + +A **VcNumber** of zero (0) has special significance. It is possible for a connectionless transport to not provide any indication of failure when a client fails or is reset. A virtual circuit with a **VcNumber** of zero (0), regardless of the **SessionKey** value, is defined to indicate to the server that the client has abandoned all previous virtual circuits and that the server MUST close those VCs as well, ensuring proper cleanup of resources.[<9>](#Appendix_A_9) This behavior can have unintended consequences in situations where separate applications running on the same client establish individual connections to the same server, or in cases in which multiple clients connect to a single server through a [**Network Address Translation (NAT)**](#gt_7ee5c1a4-6768-4256-817c-6686382e0f39) device (see [\[KB301673\]](https://go.microsoft.com/fwlink/?LinkId=162011) for a detailed explanation). In these situations, each connection attempt from the same client (or NAT device) can cause all others from that client to be disconnected. To avoid this, clients can use a **VcNumber** of greater than or equal to one, or servers MAY be configured to bypass special processing of **VcNumber** zero over connection-oriented transports. + +## Message Syntax + +The [**CIFS**](#gt_fb37399e-d72d-41b6-b073-086da2d96e09) Protocol is composed of, and driven by, [**SMB commands**](#gt_dbae2612-173d-4988-9301-86cb559029f9). SMB commands are comprised of [**SMB message**](#gt_1308cf27-6aba-4d86-b38d-7926ba662311) exchanges between the client and the server. SMB commands can be categorized by functionality as follows. + +| Session management | Transaction subprotocol | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| SMB_COM_NEGOTIATE

SMB_COM_SESSION_SETUP_ANDX

SMB_COM_TREE_CONNECT

SMB_COM_TREE_CONNECT_ANDX

SMB_COM_TREE_DISCONNECT

SMB_COM_LOGOFF_ANDX | SMB_COM_TRANSACTION

SMB_COM_TRANSACTION_SECONDARY

SMB_COM_TRANSACTION2

SMB_COM_TRANSACTION2_SECONDARY

SMB_COM_NT_TRANSACT

SMB_COM_NT_TRANSACT_SECONDARY | + +| File/directory access methods | Read/write/lock methods | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| SMB_COM_CREATE_DIRECTORY

SMB_COM_DELETE_DIRECTORY

SMB_COM_OPEN

SMB_COM_OPEN_ANDX

SMB_COM_CREATE

SMB_COM_CREATE_NEW

SMB_COM_CREATE_TEMPORARY

SMB_COM_NT_CREATE_ANDX

SMB_COM_CLOSE

SMB_COM_DELETE | SMB_COM_FLUSH

SMB_COM_SEEK

SMB_COM_READ

SMB_COM_LOCK_AND_READ

SMB_COM_LOCK_BYTE_RANGE

SMB_COM_UNLOCK_BYTE_RANGE

SMB_COM_LOCKING_ANDX

SMB_COM_READ_ANDX

SMB_COM_READ_RAW

SMB_COM_READ_MPX

SMB_COM_WRITE

SMB_COM_WRITE_AND_CLOSE

SMB_COM_WRITE_AND_UNLOCK

SMB_COM_WRITE_ANDX

SMB_COM_WRITE_RAW

SMB_COM_WRITE_COMPLETE

SMB_COM_WRITE_MPX | + +| Query directory information | Query/set attributes methods | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| SMB_COM_CHECK_DIRECTORY

SMB_COM_SEARCH

SMB_COM_FIND

SMB_COM_FIND_UNIQUE

SMB_COM_FIND_CLOSE

SMB_COM_FIND_CLOSE2 | SMB_COM_RENAME

SMB_COM_NT_RENAME

SMB_COM_QUERY_INFORMATION

SMB_COM_SET_INFORMATION

SMB_COM_QUERY_INFORMATION_DISK

SMB_COM_QUERY_INFORMATION2

SMB_COM_SET_INFORMATION2 | + +| Printing methods | Other | +| --------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | +| SMB_COM_OPEN_PRINT_FILE

SMB_COM_WRITE_PRINT_FILE

SMB_COM_CLOSE_PRINT_FILE | SMB_COM_ECHO

SMB_COM_PROCESS_EXIT

SMB_COM_NT_CANCEL

SMB_COM_INVALID

SMB_COM_IOCTL

SMB_COM_NO_ANDX_COMMAND | + +CIFS has evolved over time. As a result, some commands have become obsolete and other commands have been proposed but never implemented. The client MUST NOT use the commands listed in the table below. The server SHOULD return implementation-specific error codes in response to receiving any of these command requests. + +| Obsolete | Reserved but not implemented | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| SMB_COM_COPY

SMB_COM_MOVE

SMB_COM_READ_MPX_SECONDARY

SMB_COM_SECURITY_PACKAGE_ANDX

SMB_COM_WRITE_MPX_SECONDARY

SMB_COM_GET_PRINT_QUEUE | SMB_COM_CLOSE_AND_TREE_DISC

SMB_COM_FIND_NOTIFY_CLOSE

SMB_COM_IOCTL_SECONDARY

SMB_COM_NEW_FILE_SIZE

SMB_COM_QUERY_SERVER

SMB_COM_READ_BULK

SMB_COM_WRITE_BULK

SMB_COM_WRITE_BULK_DATA | + +Specifications for the commands listed in the preceding tables are located in section [2.2.3](#Section_4d330f4c151c4d79b20740bd4f754da9). + +An SMB message is the payload packet encapsulated in a transport packet. SMB messages are divided into three blocks: a fixed-length SMB Header (section [2.2.3.1](#Section_69a29f73de0c45a6a1aa8ceeea42217f)), and two variable-length blocks called SMB Parameters (section [2.2.3.2](#Section_c87a9a6ee31844d385e182398f8dc9f5)) and SMB Data (section [2.2.3.3](#Section_48b4bd5d72064002bde1c34cf614b138)). + +Unless otherwise specified, multiple-byte fields (SHORT, USHORT, LONG, and so on) in an SMB message MUST be transmitted in [**little-endian**](#gt_079478cb-f4c5-4ce5-b72b-2144da5d2ce7) order (least-significant byte first). Unless otherwise indicated, numeric fields are integers of the specified byte length. + +In dialects prior to [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a), data alignment was not a consideration in SMB messages. Commands introduced in the NT LAN Manager dialect, however, can include fixed or variable-length padding fields used to align succeeding fields to 16-bit or 32-bit boundaries. [**Unicode strings**](#gt_b069acb4-e364-453e-ac83-42d469bb339e), also introduced in NT LAN Manager, MUST be aligned to 16-bit boundaries unless otherwise noted. + +Unless otherwise noted, fields marked as "reserved" SHOULD be set to zero when sent and MUST be ignored on receipt. These fields are reserved for future protocol expansion and MUST NOT be used for implementation-specific functionality. When it is necessary to insert padding bytes into a buffer for data alignment purposes, such bytes SHOULD be set to 0x00 when sent and MUST be ignored on receipt. + +CIFS defines a set of data types and data structures that are commonly used across multiple commands in the protocol. These are specified in section [2.2.1](#Section_8d0ae1fbb2814e0394451d99bdc783f3). Some data structures exist that are used only in one or two commands. Those are specified in their respective command's subsection of section [2.2.4](#Section_5cd5747ffe0b40a689d0d67f751f8232). All data types encountered in sections [2](#Section_9584ef77c3644222a0e5ccbe44650b7f) and [3](#Section_9e7b073d88204de2885e4ddb8e4d199d) that are not defined in section 2.2 are found in [\[MS-DTYP\]](%5bMS-DTYP%5d.pdf#Section_cca2742956894a16b2b49325d93e4ba2). + +Unless otherwise noted, when an error occurs the server MUST return a response SMB message with a proper status code in the header (see section 2.2.3.1). Error responses SHOULD be sent with empty SMB Parameters and SMB Data blocks (**WordCount** and **ByteCount** fields set to zero; see sections 2.2.3.2 and 2.2.3.3 respectively). + +CIFS defines a number of constants, including CIFS-specific error codes, which are commonly used across multiple commands in the protocol. The CIFS specific error codes include STATUS*INVALID_SMB and all status code constants with names beginning with STATUS_SMB* and STATUS*OS2. These status codes are specified in section [2.2.2.4](#Section_8f11e0f3d54546cc97e6f00569e3e1bc). All other constants in section 2 and 3 that begin with STATUS* are defined in [\[MS-ERREF\]](%5bMS-ERREF%5d.pdf#Section_1bc92ddfb79e413cbbaa99a5281a6c90) section 2.3. + +### Common Data Types + +CIFS makes use of the following data types and structures from [\[MS-DTYP\]](%5bMS-DTYP%5d.pdf#Section_cca2742956894a16b2b49325d93e4ba2): + +- BOOLEAN +- NTSTATUS +- UCHAR +- ULONG +- USHORT +- WCHAR +- FILETIME +- LARGE_INTEGER +- SECURITY_DESCRIPTOR + +In addition, CIFS defines its own data types and structures, as specified in the following subsections. + +#### Character Sequences + +In all dialects prior to [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a), all character sequences were encoded using the [**OEM character set**](#gt_3240e34e-920e-40ac-a672-342ac34a5e22) (extended [**ASCII**](#gt_79fa85ca-ac61-467c-b819-e97dc1a7a599)). The NT LAN Manager dialect introduced support for [**Unicode**](#gt_c305d0ab-8b94-461a-bd76-13b40cb8c4d8), which is negotiated during protocol negotiation and session setup. The use of [**Unicode characters**](#gt_fd33af2e-e1ce-4f8e-a706-f9fb8123f9b0) is indicated on a per-message basis by setting the SMB_FLAGS2_UNICODE flag in the **SMB_Header.Flags2** field. All Unicode characters MUST be in UTF-16LE encoding. + +In [**CIFS**](#gt_fb37399e-d72d-41b6-b073-086da2d96e09), character sequences are transmitted over the wire as arrays of either UCHAR (for [**OEM characters**](#gt_681188c8-235a-47f5-af29-7fbd0676a6b8)) or WCHAR (for Unicode characters). Throughout this document, null-terminated character sequence fields that can be encoded in either Unicode or OEM characters (depending on the result of Unicode capability negotiation) are labeled as **SMB_STRING** fields. + +String fields that restrict character encoding to OEM characters only, even if Unicode support has been negotiated, are labeled as **OEM_STRING**. Some examples of strings that are never passed in Unicode are: + +- The dialect strings in the SMB_COM_NEGOTIATE (section [2.2.4.52](#Section_96ccc2bd67ba463abb73fd6a9265199e)) command. +- The service name string in the SMB_COM_TREE_CONNECT_ANDX (section [2.2.4.55](#Section_a105173ad8544950be283d3240529ec3)) command. + +##### File and Directory names + +Dialects prior to **LAN Manager 2.0** required that file and directory names adhere to the [**8.3 name**](#gt_d2302116-d3d3-4465-a72e-c07a7737b7ae) format. Names of this format consist of two parts: a basename of no more than eight characters, and an extension of no more than three characters. The basename and extension are separated by a "." (period). All characters are legal in the basename and extension except: + +- The space character (0x20) +- "\\/\[\]:+|<>=;?,\*. + +The **LAN Manager 2.0** dialect introduced the SMB_FLAGS2_KNOWS_LONG_NAMES flag. If a client or server sets this flag in its messages, this indicates that they are not bound by the 8.3 name convention and support long file and directory names. Long names MUST have a total length of less than 255 characters. The following characters are illegal in a long name: + +- "\\/\[\]:+|<>=;?,\* + +A "." (period) is treated as a delimiter of file name components. The 8.3 name format uses the period to separate the filename from the file extension. + +##### Pathnames + +[**CIFS**](#gt_fb37399e-d72d-41b6-b073-086da2d96e09) makes use of the pathname structure as defined in [\[MS-FSCC\]](%5bMS-FSCC%5d.pdf#Section_efbfe12773ad41409967ec6500e66d5e) section 2.1.5, with the following restrictions: + +Pathnames MUST adhere to the [**Universal Naming Convention (UNC)**](#gt_c9507dca-291d-4fd6-9cba-a9ee7da8c908). The <sharename> component of a UNC-compliant pathname MUST adhere to the restrictions of a Share Name structure as defined in \[MS-FSCC\] section 2.1.6, with an additional note that it MAY be subject to the restrictions of file and directory names (section [2.2.1.1.1](#Section_09c2ccc84aaf439f9b4e13b3fe85a4cf)). The <filename> component of a UNC-compliant pathname MAY be zero or more name components separated by the "\\" (backslash) character. All name components of a pathname MUST adhere to the restrictions of file and directory names as specified in section 2.2.1.1.1. + +If a pathname points to an object or device in [**DFS**](#gt_0b8086c9-d025-45b8-bf09-6b5eca72713e), it is a [**DFS Path**](#gt_151c87db-05a4-40c3-99bd-4b682530d210) and certain restrictions apply as specified in [\[MS-DFSC\]](%5bMS-DFSC%5d.pdf#Section_3109f4be2dbb42c99b8e0b34f7a2135e) section 2.2.1. A client that recognizes DFS SHOULD set the SMB_FLAGS2_DFS flag in the SMB Header (section [2.2.3.1](#Section_69a29f73de0c45a6a1aa8ceeea42217f)) in all [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) requests using a DFS Path, and the server SHOULD resolve it within the [**DFS namespace**](#gt_6a3f0be9-b9b4-49df-9d1c-a3b89e4e9890). + +##### Wildcards + +Some [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) requests allow wildcards to be used in a file name. Wildcards allow a client to operate on a number of files as a unit without having to separately enumerate the files and operate on them individually.[<10>](#Appendix_A_10) + +Two wild card characters, the question mark and the asterisk, are used to match files whose names are selected by the wildcard string used as a selection criterion. The "?" (question mark) character matches a single character. If a file name selection criterion contains one or more "?" characters, then exactly that number of characters is matched by the wildcards. For example, the criterion "??x" matches "abx" but not "abcx" or "ax", because the two file names do not have enough characters preceding the literal. When a file name criterion has "?" characters trailing a literal, then the match is made with specified number of characters or less. For example, the criterion "x??" matches "xab", "xa", and "x", but not "xabc". If only "?" characters are present in the file name selection criterion, then the match is made as if the criterion contained "?" characters trailing a literal. The "\*" (asterisk) character matches an entire file name. A null or empty specification criterion also selects all file names. For example, "\*.abc" or ".abc" match any file with an extension of "abc". "\*.\*", "\*", or empty string("") match all files in a directory. + +If the negotiated dialect is [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) or later, and the filename in the client request contains any of the following wildcards, the server SHOULD translate them as follows and the server MUST use the resulting string to attempt the file operation: + +- Translate the ? literal to > +- Translate the . literal to " if it is immediately followed by a ? or a \* +- Translate the \* literal to < if it is immediately followed by a . + +#### File Attributes + +CIFS makes use of three distinct methods for encoding file attributes: + +- Extended Attributes (SMB_GEA (section [2.2.1.2.1](#Section_e40c0bee37894b24869448b796a2d4fc)) and SMB_FEA (section [2.2.1.2.2](#Section_53d6fe8e489a4ec6bf98a3040baad686))) +- Extended File Attributes (SMB_EXT_FILE_ATTR (section [2.2.1.2.3)](#Section_6008aa8fd2d84366b775b81aece05bb1)) +- File Attributes (SMB_FILE_ATTRIBUTES (section [2.2.1.2.4)](#Section_2198f480e0474df0ba64f28eadef00b9)) + +##### SMB_GEA + +The SMB_GEA data structure is used in Transaction2 subcommand requests to request specific extended attribute (EA) name/value pairs by name. This structure is used when the SMB_INFO_QUERY_EAS_FROM_LIST information level is specified. "GEA" stands for "get extended attribute". + +- SMB_GEA +- { + +- UCHAR AttributeNameLengthInBytes; + +- UCHAR AttributeName\[AttributeNameLengthInBytes + 1\]; + +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------------------- | --- | --- | --- | --- | --- | --- | --- | ------------------------ | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| AttributeNameLengthInBytes | | | | | | | | AttributeName (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**AttributeNameLengthInBytes (1 byte):** This field MUST contain the length, in bytes (excluding the trailing null padding byte), of the AttributeName field. + +**AttributeName (variable):** This field contains the name, in extended ASCII (OEM) characters, of an extended attribute. The length of the name MUST NOT exceed 255 bytes. An additional byte is added to store a null padding byte. This field MAY be interpreted as an OEM_STRING. + +###### SMB_GEA_LIST + +The SMB_GEA_LIST data structure is used to send a concatenated list of SMB_GEA (section [2.2.1.2.1](#Section_e40c0bee37894b24869448b796a2d4fc)) structures. + +- SMB_GEA_LIST +- { +- ULONG SizeOfListInBytes; +- UCHAR GEAList\[\]; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------ | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SizeOfListInBytes | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| GEAList (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SizeOfListInBytes (4 bytes):** This field MUST contain the total size of the **GEAList** field, plus the size of the **SizeOfListInBytes** field (4 bytes).[<11>](#Appendix_A_11) + +**GEAList (variable):** A concatenated list of SMB_GEA (section 2.2.1.2.1) structures. + +##### SMB_FEA + +The SMB_FEA data structure is used in Transaction2 subcommands and in the NT_TRANSACT_CREATE subcommand to encode an extended attribute (EA) name/value pair. "FEA" stands for "full extended attribute".[<12>](#Appendix_A_12) + +- SMB_FEA +- { +- UCHAR ExtendedAttributeFlag; +- UCHAR AttributeNameLengthInBytes; +- USHORT AttributeValueLengthInBytes; +- UCHAR AttributeName\[AttributeNameLengthInBytes + 1\]; +- UCHAR AttributeValue\[AttributeValueLengthInBytes\]; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | -------------------------- | --- | ---------- | --- | --- | --- | --- | --- | --------------------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ExtendedAttributeFlag | | | | | | | | AttributeNameLengthInBytes | | | | | | | | AttributeValueLengthInBytes | | | | | | | | | | | | | | | | +| AttributeName (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| AttributeValue (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ExtendedAttributeFlag (1 byte):** This is a bit field. Only the 0x80 bit is defined. + +| Name and Bitmask | Meaning | +| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| 0x7F | Reserved. | +| FILE_NEED_EA

0x80 | If set (1), this bit indicates that extended attribute (EA) support is required on this file. Otherwise, EA support is not required. If this flag is set, the file to which the EA belongs cannot be properly interpreted without understanding the associated extended attributes.

A CIFS client that supports EAs can set this bit when adding an EA to a file residing on a server that also supports EAs. The server MUST NOT allow this bit to be set on an EA associated with directories.

If this bit is set on any EA associated with a file on the server, the server MUST reject client requests to open the file (except to truncate the file) if the SMB_FLAGS2_EAS flag is not set in the request header. In this case, the server SHOULD fail this request with STATUS_ACCESS_DENIED (ERRDOS/ERRnoaccess) in the **Status** field of the SMB Header (section [2.2.3.1](#Section_69a29f73de0c45a6a1aa8ceeea42217f)) in the server response. | + +**AttributeNameLengthInBytes (1 byte):** This field MUST contain the length, in bytes, of the **AttributeName** field (excluding the trailing null byte). + +**AttributeValueLengthInBytes (2 bytes):** This field MUST contain the length, in bytes, of the **AttributeValue** field. + +**AttributeName (variable):** This field contains the name, in extended ASCII (OEM) characters, of an extended attribute. The length of the name MUST NOT exceed 255 bytes. An additional byte is added to store a null padding byte. This field MAY be interpreted as an OEM_STRING. + +**AttributeValue (variable):** This field contains the value of an extended file attribute. The value is expressed as an array of extended ASCII (OEM) characters. This array MUST NOT be null-terminated, and its length MUST NOT exceed 65,535 bytes. + +###### SMB_FEA_LIST + +The SMB_FEA_LIST data structure is used to send a concatenated list of SMB_FEA (section [2.2.1.2.2](#Section_53d6fe8e489a4ec6bf98a3040baad686)) structures. + +- SMB_FEA_LIST +- { +- ULONG SizeOfListInBytes; +- UCHAR FEAList\[\]; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------ | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SizeOfListInBytes | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| FEAList (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SizeOfListInBytes (4 bytes):** This field MUST contain the total size of the **FEAList** field, plus the size of the **SizeOfListInBytes** field (4 bytes).[<13>](#Appendix_A_13) + +**FEAList (variable):** A concatenated list of SMB_FEA structures. + +##### SMB_EXT_FILE_ATTR + +A 32-bit field containing encoded file attribute values and file access behavior flag values. The attribute and flag value names are for reference purposes only. If ATTR_NORMAL (see following) is set as the requested attribute value, it MUST be the only attribute value set. Including any other attribute value causes the ATTR_NORMAL value to be ignored. Any combination of the flag values (see following) is acceptable.[<14>](#Appendix_A_14) + +This type is declared as follows: + +- typedef DWORD SMB_EXT_FILE_ATTR; + +| Name and bitmask | Meaning | +| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| ATTR_READONLY

0x00000001 | The file is read only. Applications can read the file but cannot write to it or delete it. | +| ATTR_HIDDEN

0x00000002 | The file is hidden. It is not to be included in an ordinary directory listing. | +| ATTR_SYSTEM

0x00000004 | The file is part of or is used exclusively by the operating system. | +| ATTR_DIRECTORY

0x00000010 | The file is a directory. | +| ATTR_ARCHIVE

0x00000020 | The file has not been archived since it was last modified. | +| ATTR_NORMAL

0x00000080 | The file has no other attributes set. This attribute is valid only if used alone. | +| ATTR_TEMPORARY

0x00000100 | The file is temporary. This is a hint to the cache manager that it does not need to flush the file to backing storage. | +| ATTR_COMPRESSED

0x00000800 | The file or directory is compressed. For a file, this means that all of the data in the file is compressed. For a directory, this means that compression is the default for newly created files and subdirectories. | +| POSIX_SEMANTICS

0x01000000 | Indicates that the file is to be accessed according to POSIX rules. This includes allowing multiple files with names differing only in case, for file systems that support such naming.[<15>](#Appendix_A_15) | +| BACKUP_SEMANTICS

0x02000000 | Indicates that the file is being opened or created for a backup or restore operation. The server SHOULD allow the client to override normal file security checks, provided it has the necessary permission to do so. | +| DELETE_ON_CLOSE

0x04000000 | Requests that the server delete the file immediately after all of its handles have been closed. | +| SEQUENTIAL_SCAN

0x08000000 | Indicates that the file is to be accessed sequentially from beginning to end.[<16>](#Appendix_A_16) | +| RANDOM_ACCESS

0x10000000 | Indicates that the application is designed to access the file randomly. The server can use this flag to optimize file caching. | +| NO_BUFFERING

0x20000000 | Requests that the server open the file with no intermediate buffering or caching; the server might not honor the request. The application MUST meet certain requirements when working with files opened with FILE_FLAG_NO_BUFFERING. File access MUST begin at offsets within the file that are integer multiples of the volume's sector size and MUST be for numbers of bytes that are integer multiples of the volume's sector size. For example, if the sector size is 512 bytes, an application can request reads and writes of 512, 1024, or 2048 bytes, but not of 335, 981, or 7171 bytes. | +| WRITE_THROUGH

0x80000000 | Instructs the operating system to write through any intermediate cache and go directly to the file. The operating system can still cache write operations, but cannot lazily flush them. | + +##### SMB_FILE_ATTRIBUTES + +An unsigned 16-bit field that defines the basic file attributes supported by the SMB Protocol. In addition, exclusive search attributes (those Names prefixed with SMB_SEARCH_ATTRIBUTE) are defined for use when searching for files within a directory. + +| Name and bitmask | Description | +| -------------------------------------------- | ----------------------------------------------------------------- | +| SMB_FILE_ATTRIBUTE_NORMAL

0x0000 | Normal file. | +| SMB_FILE_ATTRIBUTE_READONLY

0x0001 | Read-only file. | +| SMB_FILE_ATTRIBUTE_HIDDEN

0x0002 | Hidden file. | +| SMB_FILE_ATTRIBUTE_SYSTEM

0x0004 | System file. | +| SMB_FILE_ATTRIBUTE_VOLUME

0x0008 | Volume Label. | +| SMB_FILE_ATTRIBUTE_DIRECTORY

0x0010 | Directory file. | +| SMB_FILE_ATTRIBUTE_ARCHIVE

0x0020 | File changed since last archive. | +| SMB_SEARCH_ATTRIBUTE_READONLY

0x0100 | Search for Read-only files. | +| SMB_SEARCH_ATTRIBUTE_HIDDEN

0x0200 | Search for Hidden files. | +| SMB_SEARCH_ATTRIBUTE_SYSTEM

0x0400 | Search for System files. | +| SMB_SEARCH_ATTRIBUTE_DIRECTORY

0x1000 | Search for Directory files. | +| SMB_SEARCH_ATTRIBUTE_ARCHIVE

0x2000 | Search for files that have changed since they were last archived. | +| Other

0xC8C0 | Reserved. | + +#### Named Pipe Status (SMB_NMPIPE_STATUS) + +The SMB_NMPIPE_STATUS data type is a 16-bit field that encodes the status of a named pipe. Any combination of the following flags MUST be valid. The **ReadMode** and **NamedPipeType** bit fields are defined as 2-bit integers. Subfields marked **Reserved** SHOULD be set to zero by the server and MUST be ignored by the client. + +This type is declared as follows: + +- typedef unsigned SHORT SMB_NMPIPE_STATUS; + +| Name and bitmask | Meaning | +| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| ICount

0x000FF | An 8-bit unsigned integer that gives the maximum number of instances the named pipe can have. | +| ReadMode

0x0300 | 0

This bit field indicates the client read mode for the named pipe. This bit field has no effect on writes to the named pipe. A value of zero indicates that the named pipe was opened in or set to [**byte mode**](#gt_8586fe9a-1cfa-458a-a145-8db64d69c69c) by the client.

1

A value of 1 indicates that the client opened or set the named pipe to [**message mode**](#gt_c49a48e8-f1ac-4568-bc87-0672eb08868b).

2,3

**Reserved**. Bit 0x0200 MUST be ignored. | +| NamedPipeType

0x0C00 | 0

This bit field indicates the type of the named pipe when the named pipe was created by the server. A value of zero indicates that the named pipe was created as a byte mode pipe.

1

The named pipe was created by the server as a message mode pipe.

2,3

**Reserved**. Bit 0x0800 MUST be ignored. | +| 0x3000 | **Reserved**. MUST be ignored. | +| Endpoint

0x4000 | 0

Client-side end of the named pipe. The SMB server MUST clear the Endpoint bit (set it to zero) when responding to the client request because the CIFS client is a consumer requesting service from the named pipe. When this bit is clear, it indicates that the client is accessing the consumer endpoint.

1

Indicates the server end of the pipe. | +| Nonblocking

0x8000 | 0

A named pipe read or raw read request will wait (block) until sufficient data to satisfy the read request becomes available, or until the request is canceled.

A named pipe write or raw write request blocks until its data is consumed, if the write request length is greater than zero.

1

A read or a raw read request returns all data available to be read from the named pipe, up to the maximum read size set in the request.

Write operations return after writing data to named pipes without waiting for the data to be consumed.

Named pipe non-blocking raw writes are not allowed. Raw writes MUST be performed in blocking mode. | + +#### Time + +In addition to making use of the FILETIME data type, CIFS defines three more data types for encoding time: + +- SMB_DATE (section [2.2.1.4.1](#Section_31b65222417149b4aeed7d3f38ecf68b)) +- SMB_TIME (section [2.2.1.4.2](#Section_401749d1ee4142739dcb698180e68745)) +- UTIME (section [2.2.1.4.3](#Section_94ef49b8648c47f19c64def4ad0a63a0)) + +##### SMB_DATE + +This is a 16-bit value in little-endian byte order used to encode a date. An SMB_DATE value SHOULD be interpreted as follows. The date is represented in the local time zone of the server. The following field names are provided for reference only. + +| Field name and bitmask | Description | +| ---------------------- | ------------------------------------------------------------------------------------------------ | +| YEAR

0xFE00 | The year. Add 1980 to the resulting value to return the actual year.[<17>](#Appendix_A_17) | +| MONTH

0x01E0 | The month. Values range from 1 to 12. | +| DAY

0x001F | The date. Values range from 1 to 31. | + +##### SMB_TIME + +This is a 16-bit value in little-endian byte order used to encode a time of day. The SMB_TIME value is usually accompanied by an SMB_DATE (section [2.2.1.4.1](#Section_31b65222417149b4aeed7d3f38ecf68b)) value that indicates what date corresponds with the specified time. An SMB_TIME value SHOULD be interpreted as follows. The field names below are provided for reference only. The time is represented in the local time zone of the server. + +| Field name and bitmask | Description | +| ---------------------- | --------------------------------------------------------- | +| HOUR

0xF800 | The hours. Values range from 0 to 23. | +| MINUTES

0x07E0 | The minutes. Values range from 0 to 59. | +| SECONDS

0x001F | The seconds. Values MUST represent two-second increments. | + +##### UTIME + +This is a 32-bit unsigned integer in little-endian byte order indicating the number of seconds since Jan 1, 1970, 00:00:00.0. + +This type is declared as follows: + +- typedef unsigned int UTIME; + +#### Status Codes (SMB_ERROR) + +An SMB_ERROR MUST be interpreted in one of two ways, depending on the capabilities negotiated between client and server: either as an NTSTATUS value (a 32-bit value in little-endian byte order used to encode an error message, as defined in [\[MS-ERREF\]](%5bMS-ERREF%5d.pdf#Section_1bc92ddfb79e413cbbaa99a5281a6c90) section 2.3), or as an SMBSTATUS value (as defined following). + +- SMBSTATUS +- { +- UCHAR ErrorClass; +- UCHAR Reserved; +- USHORT ErrorCode; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ---------- | --- | --- | --- | --- | --- | --- | --- | -------- | --- | ---------- | --- | --- | --- | --- | --- | --------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ErrorClass | | | | | | | | Reserved | | | | | | | | ErrorCode | | | | | | | | | | | | | | | | + +**ErrorClass (1 byte):** An SMB error class code. + +**Reserved (1 byte):** This field is reserved and MUST be ignored by both server and client. + +**ErrorCode (2 bytes):** An SMB error code. + +The set of NTSTATUS values defined in \[MS-ERREF\] is extended in this document to include 32-bit CIFS-specific error codes. Each CIFS-specific error code is wire-identical to the equivalent SMBSTATUS ErrorClass/ErrorCode pair, as listed in section [2.2.2.4](#Section_8f11e0f3d54546cc97e6f00569e3e1bc). CIFS-specific error codes can be interpreted by the client either as 32-bit values or as SMBSTATUS values.[<18>](#Appendix_A_18) + +#### Unique Identifiers + +[**CIFS**](#gt_fb37399e-d72d-41b6-b073-086da2d96e09) unique identifiers are used in to represent open files, authenticated users, SMB sessions, and so on within the protocol. To be a "unique identifier", an identifier MUST be unique with respect to other identifiers of the same type within the same context. The following is a list of unique identifiers used in CIFS and their relevant contexts: + +- **FID (File ID):** A file handle, representing an open file on the server. A FID returned from an Open or Create operation MUST be unique within an SMB connection. +- **MID (Multiplex ID):** The MID is assigned by the client. All messages include a MID along with a PID (process ID, see below) to uniquely identify groups of commands belonging to the same logical thread of operation on the client node. The client MAY use the PID/MID pair to demultiplex command responses and to identify outstanding requests that are pending on the server (see SMB_COM_NT_CANCEL). In earlier SMB Protocol dialects, the MID was defined as a number that uniquely identified a protocol request and response within a process (see [\[SMB-LM1X\]](https://go.microsoft.com/fwlink/?LinkId=164302), section 1). In CIFS, except where noted, a client MAY have multiple outstanding requests (within the limit set by the **MaxMPXCount** connection value) with the same PID and MID values. Clients inform servers of the creation of a new thread simply by introducing a new MID into the [**dialog**](#gt_71ad645f-db5b-4e9f-9b3d-887039ada331). +- **PID (Process ID):** The PID is assigned by the client. The client SHOULD [<19>](#Appendix_A_19) set this to a value that identifies the process on the client node that initiated the request. The server MUST return both the PID and the MID to the client in any response to a client request. Clients inform servers of the creation of a new process simply by introducing a new PID into the dialog. In CIFS, the PID is a 32-bit value constructed by combining two 16-bit fields (**PIDLow** and **PIDHigh**) in the SMB Header (section [2.2.3.1](#Section_69a29f73de0c45a6a1aa8ceeea42217f)). +- **SessionKey:** A Session Key is returned in the SMB_COM_NEGOTIATE response received during establishment of the SMB connection. This Session Key is used to logically bind separate virtual circuits (VCs) together. This Session Key is not used in any authentication or message signing. It is returned to the server in the SMB_COM_SESSION_SETUP_ANDX request messages that are used to create SMB sessions. +- **SessionKey:** The term "Session Key" also refers to a cryptographic secret key used to perform challenge/response authentication and is also used in the message signing algorithm. For each SMB session, the Session Key is the LM or NTLM password hash used in the generation of the response from the server-supplied challenge. The Session Key used in the first successful user authentication (non-anonymous, non-guest) becomes the signing Session Key for the SMB connection. +- **CID (Connection ID):** If a connectionless transport is in use, the Connection ID (CID) is generated by the server and passed in the SMB Header of every subsequent SMB message to identify the SMB connection to which the message belongs. +- **SID (Search ID):** A search ID (also known as a SID) is similar to a FID. It identifies an open directory search, the state of which is maintained on the server. Open SIDs MUST be unique to the SMB connection. +- **TID (Tree ID):** A TID represents an open connection to a share, otherwise known as a tree connect. An open TID MUST be unique within an SMB connection. +- **UID (User ID):** A UID represents an authenticated SMB session (including those created using anonymous or guest authentication). Some implementations refer to this value as a Virtual User ID (VUID) to distinguish it from the user IDs used by the underlying account management system. + +##### FID Generation + +File IDs (**FID**s) are generated on CIFS servers. The generation of **FID**s MUST satisfy the following constraints: + +- The **FID** MUST be a 16-bit opaque value. +- The **FID** MUST be unique within a specified client/server SMB connection. +- The **FID** MUST remain valid for the lifetime of the SMB connection on which the open request is performed, or until the client sends a request to the server to close the **FID**. +- Once a **FID** has been closed, the value can be reused for another create or open request. +- The value 0xFFFF MUST NOT be used as a valid **FID**. All other possible values for **FID**, including zero (0x0000) are valid. The value 0xFFFF is used to specify all **FID**s or no **FID**, depending upon the context in which it is used. + +##### MID Generation + +Multiplex IDs (**MIDs**) are generated on CIFS clients. The generation of **MIDs** MUST satisfy the following constraints: + +- The **MID** MUST be a 16-bit opaque value. +- The **MID** MUST be unique with respect to a valid client **PID** over a single SMB connection. +- The **PID**/**MID** pair MUST remain valid as long as there are outstanding requests on the server identified by that **PID**/**MID** pair. +- The value 0xFFFF MUST NOT be used as a valid **MID**. All other possible values for **MID**, including zero (0x0000), are valid. The value 0xFFFF is used in an OpLock Break Notification request, which is an SMB_COM_LOCKING_ANDX Request (section [2.2.4.32.1](#Section_b5c6eae7976b4444b52ec76c68c861ad)) sent from the server. + +##### PID Generation + +Process IDs (**PIDs**) are generated on the [**CIFS**](#gt_fb37399e-d72d-41b6-b073-086da2d96e09) client. The generation of **PIDs** MUST satisfy the following constraints: + +- The **PID** MUST be a 32-bit opaque value. The **PID** value is transferred in two fields (**PIDHigh** and **PIDLow**) in the SMB Header (section [2.2.3.1](#Section_69a29f73de0c45a6a1aa8ceeea42217f)). +- The **PID** MUST be unique within a specified client/server SMB connection. +- The **PID** MUST remain valid as long as there are outstanding client requests at the server. +- The value 0xFFFF MUST NOT be used as a valid **PIDLow**. All other possible values for **PID**, including zero (0x0000), are valid. The **PIDLow** value 0xFFFF is used in an OpLock Break Notification request, which is an SMB_COM_LOCKING_ANDX Request (section [2.2.4.32.1](#Section_b5c6eae7976b4444b52ec76c68c861ad)) sent from the server. + +In earlier dialects of the SMB Protocol, the **PID** value was a 16-bit unsigned value. The NT LAN Manager dialect introduced the use of the **PIDHigh** header field to extend the **PID** value to 32 bits. + +##### Connection ID (CID) Generation + +In order to support [**CIFS**](#gt_fb37399e-d72d-41b6-b073-086da2d96e09) over connectionless transport, such as Direct IPX, CIFS servers MUST support the generation of Connection IDs (**CID**s). The generation of **CID**s MUST satisfy the following constraints: + +- The **CID** MUST be a 16-bit opaque value. +- The **CID** MUST be unique across all [**SMB connections**](#gt_e1d88514-18e6-4e2e-a459-20d5e17e9078) carried over connectionless transports. +- The **CID** MUST remain valid for the lifetime of the SMB connection. +- Once the connection has been closed, the **CID** value can be reused for another SMB connection. +- The values 0x0000 and 0xFFFF MUST NOT be used as valid **CID**s. All other possible values for **CID** are valid. + +##### Search ID (SID) Generation + +Search IDs (**SID**s) are generated on CIFS servers. The generation of **SID**s MUST satisfy the following constraints: + +- The **SID** MUST be a 16-bit opaque value for a specific TRANS2_FIND_FIRST2 Request (section [2.2.6.2.1](#Section_b2b2a73094994f05884ed5bb7b9caf90)). +- The **SID** MUST be unique for a specified client/server SMB connection. +- The **SID** MUST remain valid for the lifetime of the SMB connection while the search operation is being performed, or until the client sends a request to the server to close the SID. +- Once a **SID** has been closed, the value can be reused by another TRANS2_FIND_FIRST2 Request. +- The value 0xFFFF MUST NOT be used as a valid **SID**. All other possible values for **SID**, including zero (0x0000), are valid. The value 0xFFFF is reserved. + +The acronym **SID** is also used to indicate a session ID. The two usages appear in completely different contexts. + +##### SessionKey Generation + +The term session key, in this context, does not refer to the cryptographic session keys used in authentication and message signing. Rather, it refers to the **SessionKey** unique identifier sent by the server in the SMB_COM_NEGOTIATE Response (section [2.2.4.52.2](#Section_a4229e1a8a4e489aa2eb11b7f360e60c)). + +Virtual circuit session keys (**SessionKeys**) are generated on [**CIFS**](#gt_fb37399e-d72d-41b6-b073-086da2d96e09) servers. The generation of **SessionKeys** SHOULD satisfy the following constraints:[<20>](#Appendix_A_20) + +- The **SessionKey** MUST be a 32-bit opaque value generated by the CIFS server for a particular [**SMB connection**](#gt_e1d88514-18e6-4e2e-a459-20d5e17e9078), and returned in the SMB_COM_NEGOTIATE Response for that connection. +- The **SessionKey** MUST be unique for a specified client/server SMB connection. +- The **SessionKey** MUST remain valid for the lifetime of the SMB connection. +- Once the SMB connection has been closed, the **SessionKey** value can be reused. +- There are no restrictions on the permitted values of **SessionKey**. A value of 0x00000000 suggests, but does not require, that the server ignore the **SessionKey**. + +##### TID Generation + +Tree IDs (**TIDs**) are generated on [**CIFS**](#gt_fb37399e-d72d-41b6-b073-086da2d96e09) servers. The generation of **TIDs** MUST satisfy the following constraints: + +- The **TID** MUST be a 16-bit opaque value. +- The **TID** MUST be unique within a specified client/server [**SMB connection**](#gt_e1d88514-18e6-4e2e-a459-20d5e17e9078). +- The **TID** MUST remain valid for the lifetime of the SMB connection on which the tree connect request is performed, or until the client sends a request to the server to close the **TID**. +- Once a **TID** has been closed, the value can be reused in the response to another tree connect request. +- The value 0xFFFF MUST NOT be used as a valid **TID**. All other possible values for **TID**, including zero (0x0000), are valid. The value 0xFFFF is used to specify all **TIDs** or no **TID**, depending upon the context in which it is used. + +##### UID Generation + +User IDs (**UID**s) are generated on [**CIFS**](#gt_fb37399e-d72d-41b6-b073-086da2d96e09) servers. The generation of **UIDs** MUST satisfy the following constraints: + +- The **UID** MUST be a 16-bit opaque value. +- The **UID** MUST be unique for a specified client/server [**SMB connection**](#gt_e1d88514-18e6-4e2e-a459-20d5e17e9078). +- The **UID** MUST remain valid for the lifetime of the SMB connection on which the authentication is performed, or until the client sends a request to the server to close the **UID** (to log off the user). +- Once a **UID** has been closed, the value can be reused in the response to another authentication request. +- The value 0xFFFE was declared reserved in the LAN Manager 1.0 documentation, so a value of 0xFFFE SHOULD NOT be used as a valid **UID**.[<21>](#Appendix_A_21) All other possible values for a **UID**, excluding zero (0x0000), are valid. + +### Defined Constants + +#### SMB_COM Command Codes + +Following is a listing of all [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) commands used in [**CIFS**](#gt_fb37399e-d72d-41b6-b073-086da2d96e09) and their associated command codes, as well as additional useful information. The table reads as follows: + +**NT LAN Manager name and pre-NT LAN Manager name:** Current name of command and alternate name used in older documentation, if available. If a code or code range is marked **Unused**, it is undefined and reserved for future use. If a code or code range is marked **Reserved**, it is or was reserved for a specific purpose. Both of these indicate that client implementations SHOULD NOT send messages using any of those command codes. + +**Code:** An SMB command code. + +**Description:** A short description of the command. If a code or code range is marked as Reserved, this field lists its intended use. + +**Status:** Current status of the command's usage ([**Deprecated**](#gt_129acedf-ccf1-4e13-8df7-3bc59eff6f6d), [**Obsolescent**](#gt_8377951d-81ca-44a2-af83-2a6d6388c121), or [**Obsolete**](#gt_73fb9153-adab-4f17-b472-426f982e360c)) as used in this context. + +- C = Currently used +- D = Deprecated +- O = Obsolescent +- X = Obsolete +- N = Not implemented - The command code was reserved and in some cases documented, but the command was never implemented. + +**Earliest dialect:** Earliest known dialect in which this command appears. + +| NT LAN Manager name and pre-NT LAN Manager name | Code | Description | Status | Earliest dialect | +| ---------------------------------------------------------------------------------------------------------------- | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | ---------------- | +| SMB_COM_CREATE_DIRECTORY (section [2.2.4.1](#Section_e6e870ad70374b79ac544a42a1ba4561))

SMBmkdir | 0x00 | Create a new directory. | D | CORE | +| SMB_COM_DELETE_DIRECTORY (section [2.2.4.2](#Section_0bca354c42d946b7a0aed8c6870242ca))

SMBrmdir | 0x01 | Delete an empty directory. | C | CORE | +| SMB_COM_OPEN (section [2.2.4.3](#Section_ec064de86538401e8c73b37231c36f2b))

SMBopen | 0x02 | Open a file. | D | CORE | +| SMB_COM_CREATE (section [2.2.4.4](#Section_87622f4337584bf9b1fb35109f0e5c15))

SMBcreate | 0x03 | Create or open a file. | D | CORE | +| SMB_COM_CLOSE (section [2.2.4.5](#Section_10059dd2ae0a48a2a95ca92505e9145f))

SMBclose | 0x04 | Close a file. | C | CORE | +| SMB_COM_FLUSH (section [2.2.4.6](#Section_32acdf03011d4e93b169a787f21dc13d))

SMBflush | 0x05 | Flush data for a file, or all files associated with a client, PID pair. | C | CORE | +| SMB_COM_DELETE (section [2.2.4.7](#Section_e455faa4d99643a587eb9993b0ceb896))

SMBunlink | 0x06 | Delete a file. | C | CORE | +| SMB_COM_RENAME (section [2.2.4.8](#Section_d78c549c9ab84d92bbbc6843bed943f6))

SMBmv | 0x07 | Rename a file or set of files. | C | CORE | +| SMB_COM_QUERY_INFORMATION (section [2.2.4.9](#Section_d36b4a5cdf1b4255aa5bac6ef5c2fb7c))

SMBgetattr | 0x08 | Get file attributes. | D | CORE | +| SMB_COM_SET_INFORMATION (section [2.2.4.10](#Section_e3cd0acdaa844fbf8c9d3e7d3bb3fd52))

SMBsetattr | 0x09 | Set file attributes. | D | CORE | +| SMB_COM_READ (section [2.2.4.11](#Section_b88922ddb18e46e09f7408eaace9a95c))

SMBread | 0x0A | Read from a file. | D | CORE | +| SMB_COM_WRITE (section [2.2.4.12](#Section_5f3ebf6a5d0643ee9429c8cc1b58eef5))

SMBwrite | 0x0B | Write to a file. | D | CORE | +| SMB_COM_LOCK_BYTE_RANGE (section [2.2.4.13](#Section_21f7b95a56c6482d80d6881ec0e6db69))

SMBlock | 0x0C | Request a byte-range lock on a file. | D | CORE | +| SMB_COM_UNLOCK_BYTE_RANGE (section [2.2.4.14](#Section_3cfce68297d8499b8a2cef000f5d6b26))

SMBunlock | 0x0D | Release a byte-range lock on a file. | D | CORE | +| SMB_COM_CREATE_TEMPORARY (section [2.2.4.15](#Section_6ea3a4b22a9b4749a4a441efebdf4015))

SMBctemp | 0x0E | Create a temporary file. | O | CORE | +| SMB_COM_CREATE_NEW (section [2.2.4.16](#Section_161fa213ba9d4bad948329e8b5872dca))

SMBmknew | 0x0F | Create and open a new file. | D | CORE | +| SMB_COM_CHECK_DIRECTORY (section [2.2.4.17](#Section_6a989d5130bf4ceba46e7ae1cee6b516))

SMBchkpth | 0x10 | Verify that the specified pathname resolves to a directory.

Listed as SMBchkpath in some documentation. | C | CORE | +| SMB_COM_PROCESS_EXIT (section [2.2.4.18](#Section_233f62a6f565478db9b82b58ff347547))

SMBexit | 0x11 | Indicate process exit. | O | CORE | +| SMB_COM_SEEK (section [2.2.4.19](#Section_80846ca98b50418385c601c4e586227e))

SMBlseek | 0x12 | Set the current file pointer within a file. | O | CORE | +| SMB_COM_LOCK_AND_READ (section [2.2.4.20](#Section_88a423e782324b22904dd9e6cc0a226e))

SMBlockread | 0x13 | Lock and read a byte-range within a file. | D | CorePlus | +| SMB_COM_WRITE_AND_UNLOCK (section [2.2.4.21](#Section_5006049ae39b4dac83f20ec64c731c9c))

SMBwriteunlock | 0x14 | Write and unlock a byte-range within a file. | D | CorePlus | +| **Unused** | 0x15

...

0x19 | | | | +| SMB_COM_READ_RAW (section [2.2.4.22](#Section_a8c3a184272c4168bbb2dcc621c503a0))

SMBreadBraw | 0x1A | Read a block in raw mode. | D | CorePlus | +| SMB_COM_READ_MPX (section [2.2.4.23](#Section_9688c7181f3543f280c530d8a59ac305))

SMBreadBmpx | 0x1B | Multiplexed block read.

Listed as SMBreadmpx in some documentation. | O | LANMAN1.0 | +| SMB_COM_READ_MPX_SECONDARY (section [2.2.4.24](#Section_f0c06fcc62384119be52e3e9606d209b))

SMBreadBs | 0x1C | Multiplexed block read, secondary request. | X | LANMAN1.0 | +| SMB_COM_WRITE_RAW (section [2.2.4.25](#Section_5feebf73e3b34bbda4497aea0a4cf87e))

SMBwriteBraw | 0x1D | Write a block in raw mode. | D | CorePlus | +| SMB_COM_WRITE_MPX (section [2.2.4.26](#Section_ab9a94409c2249fd859e2fd81c57e9d9))

SMBwriteBmpx | 0x1E | Multiplexed block write. | O | LANMAN1.0 | +| SMB_COM_WRITE_MPX_SECONDARY (section [2.2.4.27](#Section_d07bc94a9da843f787779e9033891ef7))

SMBwriteBs | 0x1F | Multiplexed block write, secondary request. | X | LANMAN1.0 | +| SMB_COM_WRITE_COMPLETE (section [2.2.4.28](#Section_1e82640ccd3149ee972984b30ee1132c))

SMBwriteC | 0x20 | Raw block write, final response. | D | LANMAN1.0 | +| SMB_COM_QUERY_SERVER (section [2.2.4.29](#Section_d7ad4160575846859f680e6c531982a2)) | 0x21 | Reserved, but not implemented.

Also known as SMB_COM_QUERY_INFORMATION_SRV. | N | | +| SMB_COM_SET_INFORMATION2 (section [2.2.4.30](#Section_cfcda87d76344902a137c60a1f4a5ae5))

SMBsetattrE | 0x22 | Set an extended set of file attributes. | D | LANMAN1.0 | +| SMB_COM_QUERY_INFORMATION2 (section [2.2.4.31](#Section_33ebe09e4c9d4adcb23b40e4348c704f))

SMBgetattrE | 0x23 | Get an extended set of file attributes. | D | LANMAN1.0 | +| SMB_COM_LOCKING_ANDX (section [2.2.4.32](#Section_df492170a2e840d1b7d5eb29364047e1))

SMBlockingX | 0x24 | Lock multiple byte ranges; AndX chaining. | C | LANMAN1.0 | +| SMB_COM_TRANSACTION (section [2.2.4.33](#Section_0ed1ad9fab964a7ab94a0915f3796781))

SMBtrans | 0x25 | Transaction. | C | LANMAN1.0 | +| SMB_COM_TRANSACTION_SECONDARY (section [2.2.4.34](#Section_a4c643871dc445fbb01f9ad8b69e83e1))

SMBtranss | 0x26 | Transaction secondary request. | C | LANMAN1.0 | +| SMB_COM_IOCTL (section [2.2.4.35](#Section_0d8f5f1716af499da192a5fd85fbb7e1))

SMBioctl | 0x27 | Pass an I/O Control function request to the server. | O | LANMAN1.0 | +| SMB_COM_IOCTL_SECONDARY (section [2.2.4.36](#Section_3a5f8e4716e6484d93466c4cbdc22dec))

SMBioctls | 0x28 | IOCTL secondary request. | N | LANMAN1.0 | +| SMB_COM_COPY (section [2.2.4.37](#Section_14b0f5c56fa84e1a9a597556206bcd56))

SMBcopy | 0x29 | Copy a file or directory. | X | LANMAN1.0 | +| SMB_COM_MOVE (section [2.2.4.38](#Section_817ee280ffc9443db9f3475c4c02a4f1))

SMBmove | 0x2A | Move a file or directory. | X | LANMAN1.0 | +| SMB_COM_ECHO (section [2.2.4.39](#Section_8c85435267c647f7a60da6c87b6b3aac))

SMBecho | 0x2B | Echo request (ping). | C | LANMAN1.0 | +| SMB_COM_WRITE_AND_CLOSE (section [2.2.4.40](#Section_029b038c4d4b42fc8c5199eb23055e9c))

SMBwriteclose | 0x2C | Write to and close a file. | D | LANMAN1.0 | +| SMB_COM_OPEN_ANDX (section [2.2.4.41](#Section_49a0f97dc4a748a3bf5046d816825729))

SMBopenX | 0x2D | Extended file open with AndX chaining. | D | LANMAN1.0 | +| SMB_COM_READ_ANDX (section [2.2.4.42](#Section_129aa093574b483ea55ddf334606a622))

SMBreadX | 0x2E | Extended file read with AndX chaining. | C | LANMAN1.0 | +| SMB_COM_WRITE_ANDX (section [2.2.4.43](#Section_81aec3770ff44fc4bc568f05b70c3e42))

SMBwriteX | 0x2F | Extended file write with AndX chaining. | C | LANMAN1.0 | +| SMB_COM_NEW_FILE_SIZE (section [2.2.4.44](#Section_e3b0e8eca0f348d792b925715e5ec6c8)) | 0x30 | Reserved, but not implemented.

Also known as SMB_COM_SET_NEW_SIZE. | N | | +| SMB_COM_CLOSE_AND_TREE_DISC (section [2.2.4.45](#Section_3b4c6712d77c48ed90d8653956601ecd)) | 0x31 | Close an open file and tree disconnect. | N | NT LANMAN | +| [SMB_COM_TRANSACTION2 (section 2.2.4.46)](#Section_3d9d8f3edc70410da3fc6f4a881e8cab)

SMBtrans2 | 0x32 | Transaction 2 format request/response. | C | LANMAN1.2 | +| [SMB_COM_TRANSACTION2_SECONDARY (section 2.2.4.47)](#Section_80207e036cd64bbe863fdb52f4d2cb1a)

SMBtranss2 | 0x33 | Transaction 2 secondary request. | C | LANMAN1.2 | +| [SMB_COM_FIND_CLOSE2 (section 2.2.4.48)](#Section_31cdb10b8c1b4ee99ad23221c3941760)

SMBfindclose | 0x34 | Close an active search. | C | LANMAN1.2 | +| [SMB_COM_FIND_NOTIFY_CLOSE (section 2.2.4.49)](#Section_98e3f3b8adf74dfaa63391c19f0b83b0)

SMBfindnclose | 0x35 | Notification of the closure of an active search. | N | LANMAN1.2 | +| **Unused** | 0x36

...

0x5F | | | | +| **Reserved** | 0x60

...

0x6F | This range of codes was reserved for use by the "xenix1.1" dialect of SMB. See [\[MSFT-XEXTNP\]](https://go.microsoft.com/fwlink/?LinkId=162042). [\[XOPEN-SMB\]](https://go.microsoft.com/fwlink/?linkid=2297696) page 41 lists this range as "Reserved for proprietary dialects." | X | XENIX | +| [SMB_COM_TREE_CONNECT (section 2.2.4.50)](#Section_4a6fc9eade6d484da59b3ba68a6d760c)

SMBtcon | 0x70 | Tree connect. | D | CORE | +| [SMB_COM_TREE_DISCONNECT (section 2.2.4.51)](#Section_31cc172a80844f0baad6d8d69da76a0e)

SMBtdis | 0x71 | Tree disconnect. | C | CORE | +| [SMB_COM_NEGOTIATE (section 2.2.4.52)](#Section_96ccc2bd67ba463abb73fd6a9265199e)

SMBnegprot | 0x72 | Negotiate protocol dialect. | C | CORE | +| [SMB_COM_SESSION_SETUP_ANDX (section 2.2.4.53)](#Section_d902407ce73b46f58f9ea2de2b6085a2)

SMBsesssetupX | 0x73 | Session Setup with AndX chaining. | C | LANMAN1.0 | +| [SMB_COM_LOGOFF_ANDX (section 2.2.4.54)](#Section_53800b5cf0c64b9cbaeb1ad6b08ecb6b)

SMBulogoffX | 0x74 | User logoff with AndX chaining. | C | LANMAN1.2 | +| [SMB_COM_TREE_CONNECT_ANDX (section 2.2.4.55)](#Section_a105173ad8544950be283d3240529ec3)

SMBtconX | 0x75 | Tree connect with AndX chaining. | C | LANMAN1.0 | +| **Unused** | 0x76

...

0x7D | | | | +| [SMB_COM_SECURITY_PACKAGE_ANDX (section 2.2.4.56)](#Section_adb39707dd584d278aa07a98c04cff42)

SMBsecpkgX | 0x7E | Negotiate security packages with AndX chaining. | X | LANMAN1.0 | +| **Unused** | 0x7F | | | | +| [SMB_COM_QUERY_INFORMATION_DISK (section 2.2.4.57)](#Section_c5b02889bcf44ad19bd7014614179107)

SMBdskattr | 0x80 | Retrieve file system information from the server. | D | CORE | +| [SMB_COM_SEARCH (section 2.2.4.58)](#Section_d33e84721356406d88edbd9fc10b060b)

SMBsearch | 0x81 | Directory wildcard search. | D | CORE | +| [SMB_COM_FIND (section 2.2.4.59)](#Section_5df45d03d4e94dfd850f639363b8dffd)

SMBffirst | 0x82 | Start or continue an extended wildcard directory search. | D | LANMAN1.0 | +| [SMB_COM_FIND_UNIQUE (section 2.2.4.60)](#Section_828fff83d37b4deb811824c950dca87a)

SMBfunique | 0x83 | Perform a one-time extended wildcard directory search. | D | LANMAN1.0 | +| [SMB_COM_FIND_CLOSE (section 2.2.4.61)](#Section_3ffcd296c7cc43938ab06c902a928eec)

SMBfclose | 0x84 | End an extended wildcard directory search. | D | LANMAN1.0 | +| **Unused** | 0x85

...

0x9F | | | | +| [SMB_COM_NT_TRANSACT (section 2.2.4.62)](#Section_55db04d6105f45d184ac6972c0a1ddc8) | 0xA0 | NT format transaction request/response. | C | NT LANMAN | +| [SMB_COM_NT_TRANSACT_SECONDARY (section 2.2.4.63)](#Section_0941c749cbf34c1b91b2b013a7473827) | 0xA1 | NT format transaction secondary request. | C | NT LANMAN | +| [SMB_COM_NT_CREATE_ANDX (section 2.2.4.64)](#Section_d3f83a7e493b4d29b21c55768b93e144) | 0xA2 | Create or open a file or a directory. | C | NT LANMAN | +| **Unused** | 0xA3 | | | | +| [SMB_COM_NT_CANCEL (section 2.2.4.65)](#Section_bf04c12be5ee41079b760e5ffda9cc3f) | 0xA4 | Cancel a request currently pending at the server. | C | NT LANMAN | +| [SMB_COM_NT_RENAME (section 2.2.4.66)](#Section_014a414742064ab2a167b58a4d11f1a7) | 0xA5 | File rename with extended semantics. | O | NT LANMAN | +| **Unused** | 0xA6

...

0xBF | | | | +| [SMB_COM_OPEN_PRINT_FILE (section 2.2.4.67)](#Section_4cce0e9fab2740f797cc6f12b4a9afef)

SMBsplopen | 0xC0 | Create a print queue spool file. | C | CORE | +| [SMB_COM_WRITE_PRINT_FILE (section 2.2.4.68)](#Section_1b14601f89a54e21b2ac0bf1d2374957)

SMBsplwr | 0xC1 | Write to a print queue spool file. | D | CORE | +| [SMB_COM_CLOSE_PRINT_FILE (section 2.2.4.69)](#Section_c4993aeed13b4a6e87bdefdaf7506906)

SMBsplclose | 0xC2 | Close a print queue spool file. | D | CORE | +| [SMB_COM_GET_PRINT_QUEUE (section 2.2.4.70)](#Section_8aaa6b27b1444cd69171102217b1406d)

SMBsplretq | 0xC3 | Request print queue information. | X | CORE | +| **Unused** | 0xC4

...

0xCF | | | | +| **Reserved** | 0xD0

...

0xD7 | Messenger Service command codes.

This range is reserved for use by the SMB Messenger Service. See [\[MS-MSRP\]](%5bMS-MSRP%5d.pdf#Section_b3dd697e6e3e456da53604ddde16ac95), and section 6 of [\[SMB-CORE\]](https://go.microsoft.com/fwlink/?LinkId=164301). | O | CORE | +| [SMB_COM_READ_BULK (section 2.2.4.71)](#Section_c5d7c2d74c994bd8b4efa756f09e114a) | 0xD8 | Reserved, but not implemented. | N | | +| [SMB_COM_WRITE_BULK (section 2.2.4.72)](#Section_a5baa1040ad040889d96848aa59aef3b) | 0xD9 | Reserved, but not implemented. | N | | +| [SMB_COM_WRITE_BULK_DATA (section 2.2.4.73)](#Section_0cc4166580d549aaaf4e6fff0ed1820f) | 0xDA | Reserved, but not implemented. | N | | +| **Unused** | 0xDB

...

0xFD | | | | +| [SMB_COM_INVALID (section 2.2.4.74)](#Section_56cd8dd298cb4ef7a0885c53905e0fc0)

SMBinvalid | 0xFE | As the name suggests, this command code is a designated invalid command and SHOULD NOT be used. | C | LANMAN1.0 | +| [SMB_COM_NO_ANDX_COMMAND (section 2.2.4.75)](#Section_10921e06804f4b5a92a51cc562f43068) | 0xFF | Also known as the "NIL" command. It identifies the end of an AndX Chain, and is only valid in that context. See section [2.2.3.4](#Section_fc4d19f78040426d91547219c57453c8). | C | LANMAN1.0 | + +#### Transaction Subcommand Codes + +Transaction Codes used with [SMB_COM_TRANSACTION (section 2.2.4.46)](#Section_3d9d8f3edc70410da3fc6f4a881e8cab): + +| Name | Code | Description | Status | Earliest dialect | +| --------------------------------------------------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | ---------------- | +| [TRANS_MAILSLOT_WRITE (section 2.2.5.12)](#Section_be3b074f9c634869b5ef9ecb598f0591) | 0x0001 | Allows a client to write data to a specific mailslot on the server. | C | LANMAN1.0 | +| [TRANS_SET_NMPIPE_STATE (section 2.2.5.1)](#Section_2481644c725944b89b8bae539f7b3eb6) | 0x0001 | Used to set the read mode and [**non-blocking mode**](#gt_dcf90453-4055-4474-8357-2523ddfdb63d) of a specified named pipe. | C | LANMAN1.0 | +| [TRANS_RAW_READ_NMPIPE (section 2.2.5.2)](#Section_cfcebfaeed1345ee9117fdc6da5a4060) | 0x0011 | Allows for a raw read of data from a named pipe. This method of reading data from a [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca) ignores message boundaries even if the pipe was set up as a [**message mode**](#gt_c49a48e8-f1ac-4568-bc87-0672eb08868b) pipe. | D | LANMAN1.0 | +| [TRANS_QUERY_NMPIPE_STATE (section 2.2.5.3)](#Section_905e248a9fc44c09aeae5cf2a6dfd015) | 0x0021 | Allows for a client to retrieve information about a specified named pipe. | C | LANMAN1.0 | +| [TRANS_QUERY_NMPIPE_INFO (section 2.2.5.4)](#Section_58c3b35b06834035941616c62e941203) | 0x0022 | Used to retrieve pipe information about a named pipe. | C | LANMAN1.0 | +| [TRANS_PEEK_NMPIPE (section 2.2.5.5)](#Section_80f114bfb3e34b82a0f517c039d70e9e) | 0x0023 | Used to copy data out of a named pipe without removing it from the named pipe. | C | LANMAN1.0 | +| [TRANS_TRANSACT_NMPIPE (section 2.2.5.6)](#Section_f599d0f080b148869657944f36a44138) | 0x0026 | Used to execute a transacted exchange against a named pipe. This transaction has a constraint that it can be used only on a duplex, message-type pipe. | C | LANMAN1.0 | +| [TRANS_RAW_WRITE_NMPIPE (section 2.2.5.7)](#Section_84397ad8d55c4ba7933ca96f2f64167d) | 0x0031 | Allows for a raw write of data to a named pipe. Raw writes to named pipes put bytes directly into a pipe, regardless of whether it is a message mode pipe or [**byte mode**](#gt_8586fe9a-1cfa-458a-a145-8db64d69c69c) pipe. | D | LANMAN1.0 | +| [TRANS_READ_NMPIPE (section 2.2.5.8)](#Section_d9004cc94b844d4ca522ec559f53c1a7) | 0x0036 | Allows a client to read data from a named pipe. | C | NT LANMAN | +| [TRANS_WRITE_NMPIPE (section 2.2.5.9)](#Section_de6ca9e1b30f426ebc072198375b1bd7) | 0x0037 | Allows a client to write data to a named pipe. | C | NT LANMAN | +| [TRANS_WAIT_NMPIPE (section 2.2.5.10)](#Section_385ce4de217048a1910053f3c4aad60d) | 0x0053 | Allows a client to be notified when the specified named pipe is available to be connected to. | C | LANMAN1.0 | +| [TRANS_CALL_NMPIPE (section 2.2.5.11)](#Section_a600138d46b741b49d9380a3bd5096de) | 0x0054 | Connect to a named pipe, issue a write to the named pipe, issue a read from the named pipe, and close the named pipe. | C | LANMAN1.0 | + +The meaning of the SMB_COM_TRANSACTION subcommand codes is defined by the resource being accessed. For example, the 0x0001 subcommand code is interpreted as TRANS_MAILSLOT_WRITE if the operation is being performed on a mailslot. The same code is interpreted as a TRANS_SET_NMPIPE_STATE (section 2.2.5.1) if the operation is performed on a named pipe. + +Transaction Codes used with SMB_COM_TRANSACTION2 (section 2.2.4.46): + +| Name | Code | Description | Status | Earliest dialect | +| ----------------------------------------------------------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | ---------------- | +| [TRANS2_OPEN2 (section 2.2.6.1)](#Section_ee2f11ca7c7e49ac9cb78b1ed1259c2c) | 0x0000 | Open or create a file and set extended attributes on the file. | C | NT LANMAN | +| [TRANS2_FIND_FIRST2 (section 2.2.6.2)](#Section_a782468b56f14066bb6ee2630f0e8695) | 0x0001 | Begin a search for files within a directory or for a directory. | C | NT LANMAN | +| [TRANS2_FIND_NEXT2 (section 2.2.6.3)](#Section_8f2e9ab5a6be4540a8fdf62492b34d24) | 0x0002 | Continue a search for files within a directory or for a directory. | C | NT LANMAN | +| [TRANS2_QUERY_FS_INFORMATION (section 2.2.6.4)](#Section_a96c1c03cade4a4a81a9b00674d23d93) | 0x0003 | Request information about a file system on the server. | C | LANMAN2.0 | +| [TRANS2_SET_FS_INFORMATION (section 2.2.6.5)](#Section_ac4b00db6015416a89a1bf5da2503bc3) | 0x0004 | | N | LANMAN2.0 | +| [TRANS2_QUERY_PATH_INFORMATION (section 2.2.6.6)](#Section_39021262e1624948b4999dfccef77ef6) | 0x0005 | Get information about a specific file or directory using a path. | C | LANMAN2.0 | +| [TRANS2_SET_PATH_INFORMATION (section 2.2.6.7)](#Section_a23483d965434aaaa996e7c9506f8b94) | 0x0006 | Set the standard and extended attribute information of a specific file or directory using a path. | C | LANMAN2.0 | +| [TRANS2_QUERY_FILE_INFORMATION (section 2.2.6.8)](#Section_16c2516fc82c43b79ab732fb1109f9fe) | 0x0007 | Get information about a specific file or directory using a **FID**. | C | LANMAN2.0 | +| [TRANS2_SET_FILE_INFORMATION (section 2.2.6.9)](#Section_cb2b7f2138774bc5adf4b78c8aa2a717) | 0x0008 | Set the standard and extended attribute information of a specific file or directory using a **FID**. | C | LANMAN2.0 | +| [TRANS2_FSCTL (section 2.2.6.10)](#Section_57b86f1028c245c6a3703daecf746461) | 0x0009 | | N | LANMAN2.0 | +| [TRANS2_IOCTL2 (section 2.2.6.11)](#Section_94e0959682cf40b48c6112f454506643) | 0x000a | | N | NT LANMAN | +| [TRANS2_FIND_NOTIFY_FIRST (section 2.2.6.12)](#Section_ba5cd70dff5c4ddf844162609c092e58) | 0x000b | | X | LANMAN2.0 | +| [TRANS2_FIND_NOTIFY_NEXT (section 2.2.6.13)](#Section_0fb0df5b36fa47d984345d0a512b517a) | 0x000c | | X | LANMAN2.0 | +| [TRANS2_CREATE_DIRECTORY (section 2.2.6.14)](#Section_d77e09845be54aba9f8a8606e48ff7d0) | 0x000d | Create a new directory and optionally set the extended attribute information. | C | LANMAN2.0 | +| [TRANS2_SESSION_SETUP (section 2.2.6.15)](#Section_3dd0b2797a3b4c42af0b62a1e15acb1c) | 0x000e | | N | NT LANMAN | +| [TRANS2_GET_DFS_REFERRAL (section 2.2.6.16)](#Section_795a49a409894a15aa475b167fca6c7b) | 0x0010 | Request a [**DFS referral**](#gt_c6f2eabf-2138-4f97-a788-5d6a41a27bdd) for a file or directory. See [\[MS-DFSC\]](%5bMS-DFSC%5d.pdf#Section_3109f4be2dbb42c99b8e0b34f7a2135e) section [2.2.2](#Section_5d765c4b80b64826a01f0b2535cdbdf0) for details. | C | NT LANMAN | +| [TRANS2_REPORT_DFS_INCONSISTENCY (section 2.2.6.17)](#Section_ed6cd621ec064a17ba0d4f3f2ec9eb87) | 0x0011 | | N | NT LANMAN | + +Transaction codes used with [SMB_COM_NT_TRANSACT (section 2.2.4.62)](#Section_55db04d6105f45d184ac6972c0a1ddc8): + +| Name | Code | Description | Status | Earliest dialect | +| ---------------------------------------------------------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | ---------------- | +| [NT_TRANSACT_CREATE (section 2.2.7.1)](#Section_f85bb6cf2d3949c9bfe5307ad57d5da5) | 0x0001 | Used to create or open a file or directory when extended attributes (EAs) or a [**security descriptor (SD)**](#gt_e5213722-75a9-44e7-b026-8e4833f0d350) are to be applied. | C | NT LANMAN | +| [NT_TRANSACT_IOCTL (section 2.2.7.2)](#Section_26a843f52fee43ea889100a31cb5d854) | 0x0002 | Allows device and file system control functions to be transferred transparently from client to server. | C | NT LANMAN | +| [NT_TRANSACT_SET_SECURITY_DESC (section 2.2.7.3)](#Section_ee4287977c94413fa19ee2176f66501d) | 0x0003 | Allows a client to change the security descriptor for a file. | C | NT LANMAN | +| [NT_TRANSACT_NOTIFY_CHANGE (section 2.2.7.4)](#Section_2a65e0f460e041ef8184ae9bc2430316) | 0x0004 | Notifies the client when the directory specified by **FID** is modified. It also returns the names of any files that changed. | C | NT LANMAN | +| [NT_TRANSACT_RENAME (section 2.2.7.5)](#Section_95b5e7287ff14e53a9f266f031d86b4c) | 0x0005 | | N | | +| [NT_TRANSACT_QUERY_SECURITY_DESC (section 2.2.7.6)](#Section_a4cb863952e14115b2f10c3b179a0479) | 0x0006 | Allows a client to retrieve the security descriptor for a file. | C | NT LANMAN | + +#### Information Level Codes + +The SMB protocol uses information levels in several Transaction2 subcommands to allow clients to query or set information about files, devices, and underlying object stores on servers. The following lists of information levels are organized based on their intended purpose: finding files or devices and related information, querying a specific file or device for information, setting file or device information, and querying object store information. + +A small number of information levels (most notably SMB_INFO_STANDARD and the other LANMAN2.0 information levels) share the same name across multiple categories. This indicates that these information levels share similar, or at times identical, structures, but are distinct in their intended purposes. + +##### FIND Information Level Codes + +FIND information levels are used in [TRANS2_FIND_FIRST2 (section 2.2.6.2)](#Section_a782468b56f14066bb6ee2630f0e8695) and [TRANS2_FIND_NEXT2 (section 2.2.6.3)](#Section_8f2e9ab5a6be4540a8fdf62492b34d24) subcommand requests to indicate the level of information that a server MUST respond with for each file matching the request's search criteria. + +| Name | Code | Meaning | Dialect | +| --------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | +| SMB_INFO_STANDARD | 0x0001 | Return creation, access, and last write timestamps, size and file attributes along with the file name. | LANMAN2.0 | +| SMB_INFO_QUERY_EA_SIZE | 0x0002 | Return the SMB_INFO_STANDARD data along with the size of a file's extended attributes (EAs). | LANMAN2.0 | +| SMB_INFO_QUERY_EAS_FROM_LIST | 0x0003 | Return the SMB_INFO_QUERY_EA_SIZE data along with a specific list of a file's EAs. The requested EAs are provided in the **Trans2_Data** block of the request. | LANMAN2.0 | +| SMB_FIND_FILE_DIRECTORY_INFO | 0x0101 | Return 64-bit format versions of: creation, access, last write, and last attribute change timestamps; size. In addition, return extended file attributes and file name. | NT LANMAN | +| SMB_FIND_FILE_FULL_DIRECTORY_INFO | 0x0102 | Returns the SMB_FIND_FILE_DIRECTORY_INFO data along with the size of a file's EAs. | NT LANMAN | +| SMB_FIND_FILE_NAMES_INFO | 0x0103 | Returns the name(s) of the file(s). | NT LANMAN | +| SMB_FIND_FILE_BOTH_DIRECTORY_INFO | 0x0104 | Returns a combination of the data from SMB_FIND_FILE_FULL_DIRECTORY_INFO and SMB_FIND_FILE_NAMES_INFO. | NT LANMAN | + +##### QUERY_FS Information Level Codes + +QUERY_FS information levels are used in [TRANS2_QUERY_FS_INFORMATION (section 2.2.6.4)](#Section_a96c1c03cade4a4a81a9b00674d23d93) subcommand requests to indicate the level of information that a server MUST respond with for the underlying object store indicated in the request. + +| Name | Code | Meaning | Dialect | +| --------------------------- | ------ | ------------------------------------------------------------------------------ | --------- | +| SMB_INFO_ALLOCATION | 0x0001 | Query file system allocation unit information. | LANMAN2.0 | +| SMB_INFO_VOLUME | 0x0002 | Query volume name and serial number. | LANMAN2.0 | +| SMB_QUERY_FS_VOLUME_INFO | 0x0102 | Query the creation timestamp, serial number, and Unicode-encoded volume label. | NT LANMAN | +| SMB_QUERY_FS_SIZE_INFO | 0x0103 | Query 64-bit file system allocation unit information. | NT LANMAN | +| SMB_QUERY_FS_DEVICE_INFO | 0x0104 | Query a file system's underlying device type and characteristics. | NT LANMAN | +| SMB_QUERY_FS_ATTRIBUTE_INFO | 0x0105 | Query file system attributes. | NT LANMAN | + +##### QUERY Information Level Codes + +QUERY information levels are used in [TRANS2_QUERY_PATH_INFORMATION (section 2.2.6.6)](#Section_39021262e1624948b4999dfccef77ef6) and [TRANS2_QUERY_FILE_INFORMATION (section 2.2.6.8)](#Section_16c2516fc82c43b79ab732fb1109f9fe) subcommand requests to indicate the level of information that a server MUST respond with for the file or directory indicated in the request. + +| Name | Code | Description | Dialect | +| ------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | +| SMB_INFO_STANDARD | 0x0001 | Query creation, access, and last write timestamps, size and file attributes. | LANMAN2.0 | +| SMB_INFO_QUERY_EA_SIZE | 0x0002 | Query the SMB_INFO_STANDARD data along with the size of the file's extended attributes (EAs). | LANMAN2.0 | +| SMB_INFO_QUERY_EAS_FROM_LIST | 0x0003 | Query a file's specific EAs by attribute name. | LANMAN2.0 | +| SMB_INFO_QUERY_ALL_EAS | 0x0004 | Query all of a file's EAs. | LANMAN2.0 | +| SMB_INFO_IS_NAME_VALID | 0x0006 | Validate the syntax of the path provided in the request. Not supported for TRANS2_QUERY_FILE_INFORMATION. | LANMAN2.0 | +| SMB_QUERY_FILE_BASIC_INFO | 0x0101 | Query 64-bit create, access, write, and change timestamps along with extended file attributes. | NT LANMAN | +| SMB_QUERY_FILE_STANDARD_INFO | 0x0102 | Query size, number of links, if a delete is pending, and if the path is a directory. | NT LANMAN | +| SMB_QUERY_FILE_EA_INFO | 0x0103 | Query the size of the file's EAs. | NT LANMAN | +| SMB_QUERY_FILE_NAME_INFO | 0x0104 | Query the long file name in Unicode format. | NT LANMAN | +| SMB_QUERY_FILE_ALL_INFO | 0x0107 | Query the SMB_QUERY_FILE_BASIC_INFO, SMB_QUERY_FILE_STANDARD_INFO, SMB_QUERY_FILE_EA_INFO, and SMB_QUERY_FILE_NAME_INFO data as well as access flags, access mode, and alignment information in a single request. | NT LANMAN | +| SMB_QUERY_FILE_ALT_NAME_INFO | 0x0108 | Query the 8.3 file name.[<22>](#Appendix_A_22) | NT LANMAN | +| SMB_QUERY_FILE_STREAM_INFO | 0x0109 | Query file stream information. | NT LANMAN | +| SMB_QUERY_FILE_COMPRESSION_INFO | 0x010B | Query file compression information. | NT LANMAN | + +##### SET Information Level Codes + +SET information levels are used in [TRANS2_SET_PATH_INFORMATION (section 2.2.6.7)](#Section_a23483d965434aaaa996e7c9506f8b94) and [TRANS2_SET_FILE_INFORMATION (section 2.2.6.9)](#Section_cb2b7f2138774bc5adf4b78c8aa2a717) subcommand requests to indicate what level of information is being set on the file or directory in the request. + +| Name | Code | Description | Dialect | +| ----------------------------- | ------ | -------------------------------------------------------------------------------------------- | --------- | +| SMB_INFO_STANDARD | 0x0001 | Set creation, access, and last write timestamps. | LANMAN2.0 | +| SMB_INFO_SET_EAS | 0x0002 | Set a specific list of extended attributes (EAs). | LANMAN2.0 | +| SMB_SET_FILE_BASIC_INFO | 0x0101 | Set 64-bit create, access, write, and change timestamps along with extended file attributes. | NT LANMAN | +| SMB_SET_FILE_DISPOSITION_INFO | 0x0102 | Set whether or not the file is marked for deletion. | NT LANMAN | +| SMB_SET_FILE_ALLOCATION_INFO | 0x0103 | Set file allocation size. | NT LANMAN | +| SMB_SET_FILE_END_OF_FILE_INFO | 0x0104 | Set file EOF offset. | NT LANMAN | + +#### SMB Error Classes and Codes + +This section provides an overview of status codes that can be returned by the SMB commands listed in this document, including mappings between the NTSTATUS codes used in the [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) dialect, the SMBSTATUS class/code pairs used in earlier SMB dialects, and common POSIX equivalents. The POSIX error code mappings are based upon those used in the Xenix server implementation. This is not an exhaustive listing and MUST NOT be considered normative. + +Each command and subcommand description also includes a list of status codes that are returned by [**CIFS**](#gt_fb37399e-d72d-41b6-b073-086da2d96e09)\-compliant servers. Individual implementations can return status codes from their underlying operating systems; it is up to the implementer to decide how to interpret those status codes. + +The listing below is organized by SMBSTATUS Error Class. It shows SMBSTATUS Error Code values and a general description, as well as mappings from NTSTATUS values ([\[MS-ERREF\]](%5bMS-ERREF%5d.pdf#Section_1bc92ddfb79e413cbbaa99a5281a6c90) section 2.3.1) and POSIX-style error codes where possible. Note that multiple NTSTATUS values can map to a single SMBSTATUS value. + +**SUCCESS Class 0x00** + +| Error code | NTSTATUS values | POSIX equivalent | Description | +| --------------------- | --------------- | ---------------- | ------------------------------- | +| SUCCESS

0x0000 | STATUS_OK | 0 | Everything worked, no problems. | + +**ERRDOS Class 0x01** + +| Error code | NTSTATUS values | POSIX equivalent | Description | +| ---------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- | ----------------------------------------------------------------------------------------------------------------- | +| ERRbadfunc

0x0001 | STATUS_NOT_IMPLEMENTED

0xC0000002

STATUS_INVALID_DEVICE_REQUEST

0xC0000010

STATUS_ILLEGAL_FUNCTION

0xC00000AF | EINVAL | Invalid Function. | +| ERRbadfile

0x0002 | STATUS_NO_SUCH_FILE

0xC000000F

STATUS_NO_SUCH_DEVICE

0xC000000E

STATUS_OBJECT_NAME_NOT_FOUND

0xC0000034 | ENOENT | File not found. | +| ERRbadpath

0x0003 | STATUS_OBJECT_PATH_INVALID

0xC0000039

STATUS_OBJECT_PATH_NOT_FOUND

0xC000003A

STATUS_OBJECT_PATH_SYNTAX_BAD

0xC000003B

STATUS_DFS_EXIT_PATH_FOUND

0xC000009B

STATUS_REDIRECTOR_NOT_STARTED

0xC00000FB | ENOENT | A component in the path prefix is not a directory. | +| ERRnofids

0x0004 | STATUS_TOO_MANY_OPENED_FILES

0xC000011F | EMFILE | Too many open files. No FIDs are available. | +| ERRnoaccess

0x0005 | STATUS_ACCESS_DENIED

0xC0000022

STATUS_INVALID_LOCK_SEQUENCE

0xC000001E

STATUS_INVALID_VIEW_SIZE

0xC000001F

STATUS_ALREADY_COMMITTED

0xC0000021

STATUS_PORT_CONNECTION_REFUSED

0xC0000041

STATUS_THREAD_IS_TERMINATING

0xC000004B

STATUS_DELETE_PENDING

0xC0000056

STATUS_PRIVILEGE_NOT_HELD

0xC0000061

STATUS_LOGON_FAILURE

0xC000006D

STATUS_FILE_IS_A_DIRECTORY

0xC00000BA

STATUS_FILE_RENAMED

0xC00000D5

STATUS_PROCESS_IS_TERMINATING

0xC000010A

STATUS_DIRECTORY_NOT_EMPTY

0xC0000101

STATUS_CANNOT_DELETE

0xC0000121

STATUS_FILE_DELETED

0xC0000123 | EPERM | Access denied. | +| ERRbadfid

0x0006 | STATUS_SMB_BAD_FID

0x00060001

STATUS_INVALID_HANDLE

0xC0000008

STATUS_OBJECT_TYPE_MISMATCH

0xC0000024

STATUS_PORT_DISCONNECTED

0xC0000037

STATUS_INVALID_PORT_HANDLE

0xC0000042

STATUS_FILE_CLOSED

0xC0000128

STATUS_HANDLE_NOT_CLOSABLE

0xC0000235 | EBADF | Invalid FID. | +| ERRbadmcb

0x0007 | | | Memory Control Blocks were destroyed. | +| ERRnomem

0x0008 | STATUS_SECTION_TOO_BIG

0xC0000040

STATUS_TOO_MANY_PAGING_FILES

0xC0000097

STATUS_INSUFF_SERVER_RESOURCES

0xC0000205 | ENOMEM | Insufficient server memory to perform the requested operation. | +| ERRbadmem

0x0009 | | EFAULT | The server performed an invalid memory access (invalid address). | +| ERRbadenv

0x000A | | | Invalid environment. | +| ERRbadformat

0x000B | | | Invalid format. | +| ERRbadaccess

0x000C | STATUS_OS2_INVALID_ACCESS

0x000C0001

STATUS_ACCESS_DENIED

0xC00000CA | | Invalid open mode. | +| ERRbaddata

0x000D | STATUS_DATA_ERROR

0xC000009C | E2BIG | Bad data. (May be generated by IOCTL calls on the server.) | +| ERRbaddrive

0x000F | | ENXIO | Invalid drive specified. | +| ERRremcd

0x0010 | STATUS_DIRECTORY_NOT_EMPTY

0xC0000101 | | Remove of directory failed because it was not empty. | +| ERRdiffdevice

0x0011 | STATUS_NOT_SAME_DEVICE

0xC00000D4 | EXDEV | A file system operation (such as a rename) across two devices was attempted. | +| ERRnofiles

0x0012 | STATUS_NO_MORE_FILES

0x80000006 | | No (more) files found following a file search command. | +| ERRgeneral

0x001F | STATUS_UNSUCCESSFUL

0xC0000001 | | General error. | +| ERRbadshare

0x0020 | STATUS_SHARING_VIOLATION

0xC0000043 | ETXTBSY | Sharing violation. A requested open mode conflicts with the sharing mode of an existing file handle. | +| ERRlock

0x0021 | STATUS_FILE_LOCK_CONFLICT

0xC0000054

STATUS_LOCK_NOT_GRANTED

0xC0000055 | EDEADLOCK | A lock request specified an invalid locking mode, or conflicted with an existing file lock. | +| ERReof

0x0026 | STATUS_END_OF_FILE

0xC0000011 | EEOF | Attempted to read beyond the end of the file. | +| ERRunsup

0x0032 | STATUS_NOT_SUPPORTED

0XC00000BB | | This command is not supported by the server. | +| ERRfilexists

0x0050 | STATUS_OBJECT_NAME_COLLISION

0xC0000035 | EEXIST | An attempt to create a file or directory failed because an object with the same pathname already exists. | +| ERRinvalidparam

0x0057 | STATUS_INVALID_PARAMETER

0xC000000D | | A parameter supplied with the message is invalid. | +| ERRunknownlevel

0x007C | STATUS_OS2_INVALID_LEVEL

0x007C0001 | | Invalid information level. | +| ERRinvalidseek

0x0083 | STATUS_OS2_NEGATIVE_SEEK

0x00830001 | | An attempt was made to seek to a negative absolute offset within a file. | +| ERROR_NOT_LOCKED

0x009E | STATUS_RANGE_NOT_LOCKED

0xC000007E | | The byte range specified in an unlock request was not locked. | +| ERROR_NO_MORE_SEARCH_HANDLES

0x0071 | STATUS_OS2_NO_MORE_SIDS

0x00710001 | | Maximum number of searches has been exhausted. | +| ERROR_CANCEL_VIOLATION

0x00AD | STATUS_OS2_CANCEL_VIOLATION

0x00AD0001 | | No lock request was outstanding for the supplied cancel region. | +| ERROR_ATOMIC_LOCKS_NOT_SUPPORTED

0x00AE | STATUS_OS2_ATOMIC_LOCKS_NOT_SUPPORTED

0x00AE0001 | | The file system does not support atomic changes to the lock type. | +| ERRbadpipe

0x00E6 | STATUS_INVALID_INFO_CLASS

0xC0000003

STATUS_INVALID_PIPE_STATE

0xC00000AD

STATUS_INVALID_READ_MODE

0xC00000B4 | | Invalid named pipe. | +| ERROR_CANNOT_COPY

0x010A | STATUS_OS2_CANNOT_COPY

0x010A0001 | | The copy functions cannot be used. | +| ERRpipebusy

0x00E7 | STATUS_INSTANCE_NOT_AVAILABLE

0xC00000AB

STATUS_PIPE_NOT_AVAILABLE

0xC00000AC

STATUS_PIPE_BUSY

0xC00000AE | | All instances of the designated named pipe are busy. | +| ERRpipeclosing

0x00E8 | STATUS_PIPE_CLOSING

0xC00000B1

STATUS_PIPE_EMPTY

0xC00000D9 | | The designated named pipe is in the process of being closed. | +| ERRnotconnected

0x00E9 | STATUS_PIPE_DISCONNECTED

0xC00000B0 | | The designated named pipe exists, but there is no server process listening on the server side. | +| ERRmoredata

0x00EA | STATUS_BUFFER_OVERFLOW

0x80000005

STATUS_MORE_PROCESSING_REQUIRED

0xC0000016 | | There is more data available to read on the designated named pipe. | +| ERRbadealist

0x00FF | | | Inconsistent extended attribute list. | +| ERROR*EAS*

DIDNT_FIT

0x0113 | STATUS_EA_TOO_LARGE

0xC0000050

STATUS_OS2_EAS_DIDNT_FIT

0x01130001 | | Either there are no extended attributes, or the available extended attributes did not fit into the response. | +| ERROR*EAS*

NOT_SUPPORTED

0x011A | STATUS_EAS_NOT_SUPPORTED

0xC000004F | | The server file system does not support Extended Attributes. | +| ERROR_EA_ACCESS_DENIED

0x03E2 | STATUS_OS2_EA_ACCESS_DENIED

0x03E20001 | | Access to the extended attribute was denied. | +| ERR_NOTIFY_ENUM_DIR

0x03FE | STATUS_NOTIFY_ENUM_DIR

0x0000010C | | More changes have occurred within the directory than will fit within the specified Change Notify response buffer. | + +**ERRSRV Class 0x02** + +| Error code | NTSTATUS values | POSIX equivalent | Description | +| -------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| ERRerror

0x0001 | STATUS_INVALID_SMB

0x00010002 | | Unspecified server error.[<23>](#Appendix_A_23) | +| ERRbadpw

0x0002 | STATUS_WRONG_PASSWORD

0xC000006A | | Invalid password. | +| ERRbadpath

0x0003 | STATUS_PATH_NOT_COVERED

0xC0000257 | | DFS pathname not on local server. | +| ERRaccess

0x0004 | STATUS_NETWORK_ACCESS_DENIED

0xC00000CA | EACCES | Access denied. The specified UID does not have permission to execute the requested command within the current context (TID). | +| ERRinvtid

0x0005 | STATUS_NETWORK_NAME_DELETED

0xC00000C9

STATUS_SMB_BAD_TID

0x00050002 | | The TID specified in the command was invalid.

Earlier documentation, with the exception of [\[SNIA\]](https://go.microsoft.com/fwlink/?LinkId=90519), refers to this error code as ERRinvnid (Invalid Network Path Identifier). \[SNIA\] uses both names.[<24>](#Appendix_A_24) | +| ERRinvnetname

0x0006 | STATUS_BAD_NETWORK_NAME

0xC00000CC | | Invalid server name in Tree Connect. | +| ERRinvdevice

0x0007 | STATUS_BAD_DEVICE_TYPE

0xC00000CB | | A printer request was made to a non-printer device or, conversely, a non-printer request was made to a printer device. | +| ERRinvsess

0x0010 | | | Invalid Connection ID (CID). This error code is only defined when the Direct IPX connectionless transport is in use. | +| ERRworking

0x0011 | | | A command with matching MID or SequenceNumber is currently being processed. This error code is defined only when the Direct IPX connectionless transport is in use. | +| ERRnotme

0x0012 | | | Incorrect NetBIOS Called Name when starting an SMB session over Direct IPX. This error code is only defined when the Direct IPX connectionless transport is in use. | +| ERRbadcmd

0x0016 | STATUS_SMB_BAD_COMMAND

0x00160002 | | An unknown SMB command code was received by the server. | +| ERRqfull

0x0031 | STATUS_PRINT_QUEUE_FULL

0xC00000C6 | | Print queue is full - too many queued items. | +| ERRqtoobig

0x0032 | STATUS_NO_SPOOL_SPACE

0xC00000C7 | | Print queue is full - no space for queued item, or queued item too big. | +| ERRqeof

0x0033 | | | End Of File on print queue dump. | +| ERRinvpfid

0x0034 | STATUS_PRINT_CANCELLED

0xC00000C8 | | Invalid FID for print file. | +| ERRsmbcmd

0x0040 | STATUS_NOT_IMPLEMENTED

0xC0000002 | | Unrecognized SMB command code. | +| ERRsrverror

0x0041 | STATUS_UNEXPECTED_NETWORK_ERROR

0xC00000C4 | | Internal server error. | +| ERRfilespecs

0x0043 | | | The FID and pathname contain incompatible values. | +| ERRbadpermits

0x0045 | STATUS_NETWORK_ACCESS_DENIED

0xC00000CA | | An invalid combination of access permissions for a file or directory was presented. The server cannot set the requested attributes. | +| ERRsetattrmode

0x0047 | | | The attribute mode presented in a set mode request was invalid. | +| ERRtimeout

0x0058 | STATUS_UNEXPECTED_NETWORK_ERROR

0xC00000C4

STATUS_IO_TIMEOUT

0xC00000B5 | | Operation timed out. | +| ERRnoresource

0x0059 | STATUS_REQUEST_NOT_ACCEPTED

0xC00000D0 | | No resources currently available for this SMB request. | +| ERRtoomanyuids

0x005A | STATUS_TOO_MANY_SESSIONS

0xC00000CE | | Too many UIDs active for this SMB [**connection**](#gt_866b0055-ceba-4acf-a692-98452943b981). | +| ERRbaduid

0x005B | STATUS_SMB_BAD_UID

0x005B0002 | | The UID specified is not known as a valid ID on this server session. | +| ERRnotconnected

0x00E9 | STATUS_PIPE_DISCONNECTED

0xC00000B0 | EPIPE | Write to a named pipe with no reader. | +| ERRusempx

0x00FA | STATUS_SMB_USE_MPX

0x00FA0002 | | Temporarily unable to support RAW mode transfers. Use MPX mode. | +| ERRusestd

0x00FB | STATUS_SMB_USE_STANDARD

0x00FB0002 | | Temporarily unable to support RAW or MPX mode transfers. Use standard read/write. | +| ERRcontmpx

0x00FC | STATUS_SMB_CONTINUE_MPX

0x00FC0002 | | Continue in MPX mode.

This error code is reserved for future use. | +| ERRaccountExpired

0x08BF | **STATUS_ACCOUNT_DISABLED**

0xC0000072

STATUS_ACCOUNT_EXPIRED

0xC0000193 | | User account on the target machine is disabled or has expired. | +| ERRbadClient

0x08C0 | STATUS_INVALID_WORKSTATION

0xC0000070 | | The client does not have permission to access this server. | +| ERRbadLogonTime

0x08C1 | STATUS_INVALID_LOGON_HOURS

0xC000006F | | Access to the server is not permitted at this time. | +| ERRpasswordExpired

0x08C2 | STATUS_PASSWORD_EXPIRED

0xC0000071

STATUS_PASSWORD_MUST_CHANGE

0xC0000224 | | The user's password has expired. | +| ERRnosupport

0xFFFF | STATUS_SMB_NO_SUPPORT

0XFFFF0002 | | Function not supported by the server. | + +**ERRHRD Class 0x03** + +| Error code | NTSTATUS values | POSIX equivalent | Description | +| ---------------------------- | ----------------------------------------------------------------------------- | ---------------- | ------------------------------------------------------------------------------------------- | +| ERRnowrite

0x0013 | STATUS_MEDIA_WRITE_PROTECTED

0xC00000A2 | EROFS | Attempt to modify a read-only file system. | +| ERRbadunit

0x0014 | | ENODEV | Unknown unit. | +| ERRnotready

0x0015 | STATUS_NO_MEDIA_IN_DEVICE

0xC0000013 | EUCLEAN | Drive not ready. | +| ERRbadcmd

0x0016 | STATUS_INVALID_DEVICE_STATE

0xC0000184 | | Unknown command. | +| ERRdata

0x0017 | STATUS_DATA_ERROR

0xC000003E

STATUS_CRC_ERROR

0xC000003F | EIO | Data error (incorrect CRC). | +| ERRbadreq

0x0018 | STATUS_DATA_ERROR

0xC000003E | ERANGE | Bad request structure length. | +| ERRseek

0x0019 | | | Seek error. | +| ERRbadmedia

0x001A | STATUS_DISK_CORRUPT_ERROR

0xC0000032 | | Unknown media type. | +| ERRbadsector

0x001B | STATUS_NONEXISTENT_SECTOR

0xC0000015 | | Sector not found. | +| ERRnopaper

0x001C | STATUS_DEVICE_PAPER_EMPTY

0x8000000E | | Printer out of paper. | +| ERRwrite

0x001D | | | Write fault. | +| ERRread

0x001E | | | Read fault. | +| ERRgeneral

0x001F | | | General hardware failure. | +| ERRbadshare

0x0020 | STATUS_SHARING_VIOLATION

0xC0000043 | ETXTBSY | An attempted open operation conflicts with an existing open. | +| ERRlock

0x0021 | STATUS_FILE_LOCK_CONFLICT

0xC0000054 | EDEADLOCK | A lock request specified an invalid locking mode, or conflicted with an existing file lock. | +| ERRwrongdisk

0x0022 | STATUS_WRONG_VOLUME

0xC0000012 | | The wrong [**disk**](#gt_c4133b2a-a990-4042-ba44-7fda3090f118) was found in a drive. | +| ERRFCBUnavail

0x0023 | | | No server-side File Control Blocks are available to process the request. | +| ERRsharebufexc

0x0024 | | | A sharing buffer has been exceeded. | +| ERRdiskfull

0x0027 | STATUS_DISK_FULL

0xC000007F | ENOSPC | No space on file system. | + +**ERRCMD Class 0xFF** + +The ERRCMD error class is used to indicate that the server received a command that was not in the SMB format. No error codes are defined for use with the ERRCMD (0XFF) class.[<25>](#Appendix_A_25) + +#### Data Buffer Format Codes + +Data buffer format codes are used to identify the type and format of the fields that immediately follow them in the data block of SMB messages. See section [2.2.3.3](#Section_48b4bd5d72064002bde1c34cf614b138) for a description of the data block. + +In **Core Protocol** commands, every field in the data block (following the **ByteCount** field) is preceded by a one-byte buffer format field. Commands introduced in dialects subsequent to the **Core Protocol** typically do not include buffer format fields unless they are intended as an extension to an existing command. For example, [SMB_COM_FIND (section 2.2.4.59)](#Section_5df45d03d4e94dfd850f639363b8dffd) was introduced in the **LAN Manager 1.0** dialect in order to improve the semantics of the [SMB_COM_SEARCH (section 2.2.4.58)](#Section_d33e84721356406d88edbd9fc10b060b) **Core Protocol** command. Both commands share the same request and response message structures, including the buffer format fields. + +Data block fields that are preceded by buffer format codes take one of two basic forms: + +- A null-terminated string or +- A structure consisting of a two-byte length field followed by an array of bytes: + +- struct +- { +- USHORT Length; +- UCHAR Data\[Length\]; +- } + +| Buffer format code | Name | Format of the field that follows | +| ------------------ | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| 0x01 | Data Buffer | A two-byte USHORT value indicating the length of the data buffer. The data buffer follows immediately after the length field. | +| 0x02 | Dialect String | A null-terminated **OEM_STRING**.

This format code is used only in the [SMB_COM_NEGOTIATE (section 2.2.4.52)](#Section_96ccc2bd67ba463abb73fd6a9265199e) command to identify SMB dialect strings. | +| 0x03 | Pathname | A null-terminated string representing a file system path.

In the [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) dialect, the string is of type **SMB_STRING** unless otherwise specified. | +| 0x04 | SMB String | A null-terminated string.

In the NT LAN Manager dialect, the string is of type **SMB_STRING** unless otherwise specified. | +| 0x05 | Variable Block | A two-byte **USHORT** value indicating the length of the variable block. The variable block follows immediately after the length field. | + +### SMB Message Structure + +SMB Messages are divisible into three parts: + +- A fixed-length header +- A variable length parameter block +- A variable length data block + +The header identifies the message as an SMB message, specifies the command to be executed, and provides context. In a response message, the header also includes status information that indicates whether (and how) the command succeeded or failed. + +The parameter block is a short array of two-byte values (words), while the data block is an array of up to 64 KB in size. The structure and contents of these blocks are specific to each SMB message. + +SMB messages are structured this way because the protocol was originally conceived of as a rudimentary remote procedure call system. The parameter values were meant to represent the parameters passed into a function. The data section would contain larger structures or data buffers, such as the block of data to be written using an SMB_COM_WRITE command. Although the protocol has evolved over time, this differentiation has been generally maintained. + +#### The SMB Header + +The SMB_Header structure is a fixed 32-bytes in length. + +- SMB_Header +- { +- UCHAR Protocol\[4\]; +- UCHAR Command; +- SMB_ERROR Status; +- UCHAR Flags; +- USHORT Flags2; +- USHORT PIDHigh; +- UCHAR SecurityFeatures\[8\]; +- USHORT Reserved; +- USHORT TID; +- USHORT PIDLow; +- USHORT UID; +- USHORT MID; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------- | --- | --- | --- | --- | --- | --- | --- | ------ | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Protocol | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Command | | | | | | | | Status | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | Flags | | | | | | | | Flags2 | | | | | | | | | | | | | | | | +| PIDHigh | | | | | | | | | | | | | | | | SecurityFeatures | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | Reserved | | | | | | | | | | | | | | | | +| TID | | | | | | | | | | | | | | | | PIDLow | | | | | | | | | | | | | | | | +| UID | | | | | | | | | | | | | | | | MID | | | | | | | | | | | | | | | | + +**Protocol (4 bytes):** This field MUST contain the 4-byte literal string '\\xFF', 'S', 'M', 'B', with the letters represented by their respective ASCII values in the order shown. In the earliest available SMB documentation, this field is defined as a one byte message type (0xFF) followed by a three byte server type identifier. + +**Command (1 byte):** A one-byte command code. Defined SMB command codes are listed in section [2.2.2.1](#Section_32b5d4b7d90b483fad6a003fd110f0ec). + +**Status (4 bytes):** A 32-bit field used to communicate error messages from the server to the client. + +**Flags (1 byte):** An 8-bit field of 1-bit flags describing various features in effect for the message. + +| Name and bitmask | Description | Earliest dialect | +| ----------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- | +| SMB_FLAGS_LOCK_AND_READ_OK

0x01 | This bit is set (1) in the [SMB_COM_NEGOTIATE (0x72) Response (section 2.2.4.52.2)](#Section_a4229e1a8a4e489aa2eb11b7f360e60c) if the server supports [SMB_COM_LOCK_AND_READ (0x13) (section 2.2.4.20)](#Section_88a423e782324b22904dd9e6cc0a226e) and [SMB_COM_WRITE_AND_UNLOCK (0x14) (section 2.2.4.21)](#Section_5006049ae39b4dac83f20ec64c731c9c) commands. | LANMAN1.0 | +| SMB_FLAGS_BUF_AVAIL

0x02 | [**Obsolete**](#gt_73fb9153-adab-4f17-b472-426f982e360c)

When set (on an SMB request being sent to the server), the client guarantees that there is a receive buffer posted such that a send without acknowledgment can be used by the server to respond to the client's request.

This behavior is specific to an obsolete transport. This bit MUST be set to zero by the client and MUST be ignored by the server. | LANMAN1.0 | +| Reserved

0x04 | This flag MUST be set to zero by the client and MUST be ignored by the server. | LANMAN1.0 | +| SMB_FLAGS_CASE_INSENSITIVE

0x08 | Obsolete

If this bit is set then all pathnames in the SMB SHOULD be treated as case-insensitive.[<26>](#Appendix_A_26) | LANMAN1.0 | +| SMB_FLAGS_CANONICALIZED_PATHS

0x10 | [**Obsolescent**](#gt_8377951d-81ca-44a2-af83-2a6d6388c121)

When set in session setup, this bit indicates that all paths sent to the server are already in canonical format. That is, all file and directory names are composed of valid file name characters in all upper-case, and that the path segments are separated by backslash characters ('\\'). | LANMAN1.0 | +| SMB_FLAGS_OPLOCK

0x20 | Obsolescent

This bit has meaning only in the [**deprecated**](#gt_129acedf-ccf1-4e13-8df7-3bc59eff6f6d) [SMB_COM_OPEN (0x02) Request (section 2.2.4.3.1)](#Section_ab9bb87219674088b4446a35d0af305e), [SMB_COM_CREATE (0x03) Request (section 2.2.4.4.1)](#Section_244621046b354fe4aeaa7c30cd727bc9), and [SMB_COM_CREATE_NEW (0x0F) Request (section 2.2.4.16.1)](#Section_2e4852f086724d62984842f931b91533) messages, where it is used to indicate that the client is requesting an Exclusive OpLock. It SHOULD be set to zero by the client, and ignored by the server, in all other SMB requests. If the server grants this OpLock request, then this bit SHOULD remain set in the corresponding response SMB to indicate to the client that the OpLock request was granted. | LANMAN1.0 | +| SMB_FLAGS_OPBATCH

0x40 | Obsolescent

This bit has meaning only in the deprecated SMB_COM_OPEN (0x02) Request (section 2.2.4.3.1), SMB_COM_CREATE (0x03) Request (section 2.2.4.4.1), and SMB_COM_CREATE_NEW (0x0F) Request (section 2.2.4.16.1) messages, where it is used to indicate that the client is requesting a Batch OpLock. It SHOULD be set to zero by the client, and ignored by the server, in all other SMB requests. If the server grants this OpLock request, then this bit SHOULD remain set in the corresponding response SMB to indicate to the client that the OpLock request was granted.

If the SMB_FLAGS_OPLOCK bit is clear (0), then the SMB_FLAGS_OPBATCH bit is ignored. | LANMAN1.0 | +| SMB_FLAGS_REPLY

0x80 | When on, this message is being sent from the server in response to a client request. The **Command** field usually contains the same value in a protocol request from the client to the server as in the matching response from the server to the client. This bit unambiguously distinguishes the message as a server response. | LANMAN1.0 | + +**Flags2 (2 bytes):** A 16-bit field of 1-bit flags that represent various features in effect for the message. Unspecified bits are reserved and MUST be zero. + +| Name and bitmask | Description | Earliest dialect | +| ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------- | +| SMB_FLAGS2_LONG_NAMES

0x0001 | If the bit is set, the message MAY contain long file names. If the bit is clear then file names in the message MUST adhere to the 8.3 naming convention.

If set in a client request for directory enumeration, the server MAY return long names (that is, names that are not 8.3 names) in the response to this request. If not set in a client request for directory enumeration, the server MUST return only 8.3 names in the response to this request. This flag indicates that in a direct enumeration request, paths returned by the server are not restricted to 8.3 names format. This bit field SHOULD be set to 1 when the negotiated dialect is LANMAN2.0 or later. | LANMAN2.0 | +| SMB_FLAGS2_EAS

0x0002 | If the bit is set, the client is aware of extended attributes (EAs).

The client MUST set this bit if the client is aware of extended attributes. In response to a client request with this flag set, a server MAY include extended attributes in the response. This bit field SHOULD be set to 1 when the negotiated dialect is LANMAN2.0 or later. | LANMAN1.2 | +| SMB_FLAGS2_SMB_SECURITY_SIGNATURE

0x0004 | If set by the client, the client is requesting signing (if signing is not yet active) or the message being sent is signed. This bit is used on the SMB header of an [SMB_COM_SESSION_SETUP_ANDX (section 2.2.4.53)](#Section_d902407ce73b46f58f9ea2de2b6085a2) client request to indicate that the client supports signing and that the server can choose to enforce signing on the connection based on its configuration.

To turn on signing for a connection, the server MUST set this flag and also sign the SMB_COM_SESSION_SETUP_ANDX Response (section 2.2.4.53), after which all of the traffic on the connection (except for OpLock Break notifications) MUST be signed. In the SMB header of other CIFS client requests, the setting of this bit indicates that the packet has been signed. This bit field SHOULD be set to 1 when the negotiated dialect is NT LANMAN or later. | NT LANMAN | +| SMB_FLAGS2_IS_LONG_NAME

0x0040 | Reserved but not implemented. | NT LANMAN | +| SMB_FLAGS2_DFS

0x1000 | If the bit is set, any pathnames in this SMB SHOULD be resolved in the [**Distributed File System (DFS)**](#gt_0b8086c9-d025-45b8-bf09-6b5eca72713e). | NT LANMAN | +| SMB_FLAGS2_PAGING_IO

0x2000 | This flag is useful only on a read request. If the bit is set, then the client MAY read the file if the client does not have read permission but does have execute permission. This bit field SHOULD be set to 1 when the negotiated dialect is LANMAN2.0 or later. This flag is also known as SMB_FLAGS2_READ_IF_EXECUTE. | NT LANMAN | +| SMB_FLAGS2_NT_STATUS

0x4000 | If this bit is set in a client request, the server MUST return errors as 32-bit NTSTATUS codes in the response. If it is clear, the server SHOULD[<27>](#Appendix_A_27) return errors in SMBSTATUS format.

If this bit is set in the server response, the **Status** field in the header is formatted as an **NTSTATUS** code; else, it is in SMBSTATUS format. | NT LANMAN | +| SMB_FLAGS2_UNICODE

0x8000 | If set in a client request or server response, each field that contains a string in this SMB message MUST be encoded as an array of 16-bit [**Unicode**](#gt_c305d0ab-8b94-461a-bd76-13b40cb8c4d8) characters, unless otherwise specified.

If this bit is clear, each of these fields MUST be encoded as an array of [**OEM characters**](#gt_681188c8-235a-47f5-af29-7fbd0676a6b8). This bit field SHOULD be set to 1 when the negotiated dialect is NT LANMAN. | NT LANMAN | + +**PIDHigh (2 bytes):** If set to a nonzero value, this field represents the high-order bytes of a process identifier (**PID**). It is combined with the **PIDLow** field below to form a full **PID**. + +**SecurityFeatures (8 bytes):** This 8-byte field has three possible interpretations. + +In the case that security signatures are negotiated (see [SMB_COM_NEGOTIATE (0x72) (section 2.2.4.52)](#Section_96ccc2bd67ba463abb73fd6a9265199e), the following format MUST be observed. + +- SecurityFeatures +- { +- UCHAR SecuritySignature\[8\]; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SecuritySignature | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SecuritySignature (8 bytes):** If SMB signing has been negotiated, this field MUST contain an 8-byte cryptographic message signature that can be used to detect whether the message was modified while in transit. The use of message signing is mutually exclusive with connectionless transport. + +In the case that [**CIFS**](#gt_fb37399e-d72d-41b6-b073-086da2d96e09) is being transported over a connectionless transport (see section [2.1.2.1](#Section_f33a2e37706347ffaeb428de05c9857e)), the following format MUST be observed. + +- SecurityFeatures +- { +- ULONG Key; +- USHORT CID; +- USHORT SequenceNumber; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | -------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Key | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| CID | | | | | | | | | | | | | | | | SequenceNumber | | | | | | | | | | | | | | | | + +**Key (4 bytes):** An encryption key used for validating messages over connectionless transports. + +**CID (2 bytes):** A connection identifier (**CID)**. + +**SequenceNumber (2 bytes):** A number used to identify the sequence of a message over connectionless transports. + +Finally, if neither of the above two cases applies, the **SecurityFeatures** field is treated as a reserved field, which MUST be set to zero by the client and MUST be ignored by the server. + +**Reserved (2 bytes):** This field is reserved and SHOULD be set to 0x0000. + +**TID (2 bytes):** A tree identifier (**TID**). + +**PIDLow (2 bytes):** The lower 16-bits of the **PID**. + +**UID (2 bytes):** A user identifier (**UID**). + +**MID (2 bytes):** A multiplex identifier (**MID**). + +#### Parameter Block + +[**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) was originally designed as a rudimentary remote procedure call protocol, and the parameter block was defined as an array of "one word (two byte) fields containing SMB command dependent parameters". In the [**CIFS**](#gt_fb37399e-d72d-41b6-b073-086da2d96e09) dialect, however, the **SMB_Parameters.Words** array can contain any arbitrary structure. The format of the **SMB_Parameters.Words** structure is defined individually for each command message. The size of the **Words** array is still measured as a count of byte pairs. + +The general format of the parameter block is as follows. + +- SMB_Parameters +- { +- UCHAR WordCount; +- USHORT Words\[WordCount\] (variable); +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ---------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** The size, in two-byte words, of the **Words** field. This field can be zero, indicating that the **Words** field is empty. Note that the size of this field is one byte and comes after the fixed 32-byte [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f), which causes the **Words** field to be unaligned. + +**Words (variable):** The message-specific parameters structure. The size of this field MUST be (2 x **WordCount**) bytes. If **WordCount** is 0x00, this field is not included. + +#### Data Block + +The general structure of the data block is similar to that of the Parameter block, except that the length of the buffer portion is measured in bytes. + +- SMB_Data +- { +- USHORT ByteCount; +- UCHAR Bytes\[ByteCount\] (variable); +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** The size, in bytes, of the **Bytes** field. This field can be 0x0000, indicating that the **Bytes** field is empty. Because the **SMB_Parameters.Words** field is unaligned and the **SMB_Data.ByteCount** field is two bytes in size, the first byte of **SMB_Data.Bytes** is also unaligned. + +**Bytes (variable):** The message-specific data structure. The size of this field MUST be **ByteCount** bytes. If **ByteCount** is 0x0000, this field is not included. + +#### Batched Messages ("AndX" Messages) + +Batched messages using the AndX construct were introduced in the LAN Manager 1.0 dialect. Batched messages reduce the number of messages required to complete a series of commands by sending multiple command requests or responses in a single message. SMB commands that apply the AndX construct are known as "AndX Commands", and are identified by the [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) convention of appending "\_ANDX" to the command name. Messages of this type are known as AndX Messages. + +In AndX Messages, only one [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) is sent. The header is then followed by zero or more Parameter and Data block pairs, each corresponding to an additional command request/response. There is no limit on the number of block pairs in a message specifically, only on the total message size. The total size of a Batched Message MUST NOT exceed the negotiated **MaxBufferSize**. AndX Messages contain a construct, conceptually similar to a linked-list, that is used to connect the batched block pairs. The resulting list is referred to as an AndX Chain. The structure of this construct is shown below. + +- AndX +- { +- UCHAR AndXCommand; +- UCHAR AndXReserved; +- USHORT AndXOffset; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------- | --- | --- | --- | --- | --- | --- | --- | ------------ | --- | ---------- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| AndXCommand | | | | | | | | AndXReserved | | | | | | | | AndXOffset | | | | | | | | | | | | | | | | + +**AndXCommand (1 byte):** The command code associated with the next block pair in the AndX Chain. + +**AndXReserved (1 byte):** This field is reserved and MUST be 0x00. + +**AndXOffset (2 bytes):** The offset in bytes, relative to the start of the SMB Header, of the next Parameter block in the AndX Message. This offset is independent of any other size parameters or offsets within the command. This offset can point to a location past the end of the current block pair. + +The AndX construct is located at the start of the Parameter block of an AndX command request/response. + +An AndX Chain is considered terminated when its last command is either a non-AndX SMB command or an AndX SMB command with the AndXCommand field set to [SMB_COM_NO_ANDX_COMMAND (section 2.2.4.75)](#Section_10921e06804f4b5a92a51cc562f43068) (0xFF, representing the chain terminator). The SMB_COM_NO_ANDX_COMMAND command code is not used in any other context. + +##### Follow-on Commands + +Each AndX Command has a specific list of commands that can follow it in an AndX Chain. Each command's list of permitted follow-on commands is documented in the command's corresponding subsection of section [2.2.4](#Section_5cd5747ffe0b40a689d0d67f751f8232), SMB Commands. + +### SMB Commands + +#### SMB_COM_CREATE_DIRECTORY (0x00) + +This is an original **Core Protocol** command. This command is [**deprecated**](#gt_129acedf-ccf1-4e13-8df7-3bc59eff6f6d). Clients SHOULD use the TRANS2_CREATE_DIRECTORY subcommand. + +The Create Directory command creates a new directory on the server, relative to a connected share. The client MUST provide a valid UID and TID, as well as the pathname (relative to the TID) of the directory to be created. + +Servers MUST require clients to have, at minimum, create permission within the parent directory in order to create a new directory. The creator's access rights to the new directory are be determined by local policy on the server. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR BufferFormat; +- SMB_STRING DirectoryName; +- } +- } + +**SMB_Header:** + +**TID (2 bytes):** A valid TID MUST be provided. The TID represents the root of the directory tree in which the new directory is created. + +**UID (2 bytes):** A valid UID MUST be provided. At minimum, the user MUST have create permission for the subtree that is to contain the new directory. The creator's access rights to the new directory are determined by local policy on the server. + +**SMB_Parameters:** + +**WordCount (1 byte):** This field MUST be 0x00. No parameters are sent by this message. + +**SMB_Data:** + +**ByteCount (2 bytes):** This field MUST be greater than or equal to 0x0002. + +**Bytes (variable):** The message-specific data structure as follows: + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------ | --- | --- | --- | --- | --- | --- | --- | ------------------------ | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| BufferFormat | | | | | | | | DirectoryName (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**BufferFormat (1 byte):** This field MUST be 0x04. + +**DirectoryName (variable):** A null-terminated string giving the full pathname, relative to the supplied **TID**, of the directory to be created. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | -------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | SMB_Data | | | | | | | | | | | | | | | | + +**SMB_Parameters (1 byte):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x00. No parameters are sent by this message. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ---------------------------- | ---------------------------------------------------------------------------------------------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRbadpath

(0x0003) | STATUS_OBJECT_PATH_SYNTAX_BAD

(0xC000003B) | ENOENT | The path syntax is invalid. | +| ERRDOS

(0x01) | ERRbadpath

(0x0003) | STATUS_OBJECT_NAME_INVALID

(0xC0000033) | ENOENT | Object Name invalid. | +| ERRDOS

(0x01) | ERRbadpath

(0x0003) | STATUS_OBJECT_PATH_NOT_FOUND

(0xC000003A) | ENOENT | The path does not exist. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | EACCESS | A component of the path-prefix denied search permission. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | | ENOSPC | The parent directory is full. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | | EMLINK | There are too many links to the parent directory. | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205)

STATUS_NO_MEMORY

(0xC0000017) | ENOMEM | The server is out of resources. | +| ERRDOS

(0x01) | ERRfilexists

(0x0050) | STATUS_OBJECT_NAME_COLLISION

(0xC0000035) | EEXIST | The specified directory already exists. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. Not enough parameter bytes were sent. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | The TID is no longer valid. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** supplied is not known to the session, or the user identified by the **UID** does not have sufficient privileges. | +| ERRHRD

(0x03) | ERRnowrite

(0x0013) | STATUS_MEDIA_WRITE_PROTECTED

(0xC00000A2) | EROFS | Attempt to write to a read-only file system. | +| ERRHRD

(0x03) | ERRdata

(0x0017) | STATUS_DATA_ERROR

(0xC000003E) | EIO | Disk I/O error. | + +#### SMB_COM_DELETE_DIRECTORY (0x01) + +This is an original **Core Protocol** command. + +This command is used to delete an empty directory. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR BufferFormat; +- SMB_STRING DirectoryName; +- } +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | ------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | SMB_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (1 byte):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x00. No parameters are sent by this message. + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be greater than or equal to 0x0002. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------ | --- | --- | --- | --- | --- | --- | --- | ------------------------ | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| BufferFormat | | | | | | | | DirectoryName (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**BufferFormat (1 byte):** This field MUST contain the value 0x04. + +**DirectoryName (variable):** A null-terminated string that contains the full pathname, relative to the supplied **TID**, of the directory to be deleted. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | -------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | SMB_Data | | | | | | | | | | | | | | | | + +**SMB_Parameters (1 byte):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x00. No parameters are sent by this message. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | --------------------------- | -------------------------------------------------- | ---------------- | -------------------------------------------------------- | +| ERRDOS

(0x01) | ERRbadfile

(0x0002) | STATUS_NO_SUCH_FILE

(0xC000000F) | ENOENT | The directory was not found. | +| ERRDOS

(0x01) | ERRbadpath

(0x0003) | STATUS_OBJECT_PATH_SYNTAX_BAD

(0xC000003B) | ENOENT | The path syntax is invalid. | +| ERRDOS

(0x01) | ERRbadpath

(0x0003) | STATUS_OBJECT_PATH_INVALID

(0xC0000039) | ENOTDIR | A component of the path-prefix was not a directory. | +| ERRDOS

(0x01) | ERRbadpath

(0x0003) | STATUS_OBJECT_PATH_NOT_FOUND

(0xC000003A) | ENOENT | The path does not exist. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | EACCESS | A component of the path-prefix denied search permission. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_CANNOT_DELETE

(0xC0000121) | EBUSY | The directory is in use. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_DIRECTORY_NOT_EMPTY

(0xC0000101) | EEXIST | The directory is not empty. | +| ERRDOS

(0x01) | ERRbadshare

(0x0020) | STATUS_SHARING_VIOLATION

(0xC0000043) | ETXTBSY | Sharing violation. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. Not enough parameter bytes were sent. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | The TID is no longer valid. | +| ERRSRV

(0x02) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The UID supplied is not known to the session. | +| ERRHRD

(0x03) | ERRnowrite

(0x0013) | STATUS_MEDIA_WRITE_PROTECTED

(0xC00000A2) | EROFS | Attempt to write to a read-only file system. | +| ERRHRD

(0x03) | ERRdata

(0x0017) | STATUS_DATA_ERROR

(0xC000003E) | EIO | Disk I/O error. | + +#### SMB_COM_OPEN (0x02) + +This is an original **Core Protocol** command. This command has been [**deprecated**](#gt_129acedf-ccf1-4e13-8df7-3bc59eff6f6d). Client implementations SHOULD use SMB_COM_NT_CREATE_ANDX. + +This request is used to open an existing regular file. This command MUST NOT be used to open directories or named pipes. The command includes the pathname of the file, relative to the TID, that the client wishes to open. If the command is successful, the server response MUST include a FID. The client MUST supply the FID in subsequent operations on the file. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT AccessMode; +- SMB_FILE_ATTRIBUTES SearchAttributes; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR BufferFormat; +- SMB_STRING FileName; +- } +- } + +**SMB_Header:** + +**Flags (1 byte):** + +| Name and bitmask | Description | +| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | +| SMB_FLAGS_OPLOCK

0x20 | If set, the client is requesting an Exclusive Opportunistic Lock (OpLock) on the file. | +| SMB_FLAGS_OPBATCH

0x40 | If set, the client is requesting a Batch Exclusive OpLock on the file. The SMB_FLAGS_OPLOCK bit MUST be set if this bit is set. | + +  + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | ------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | SMB_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (5 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x02. + +**Words (4 bytes):** The message-specific parameters structure. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| AccessMode | | | | | | | | | | | | | | | | SearchAttributes | | | | | | | | | | | | | | | | + +**AccessMode (2 bytes):** A 16-bit field for encoding the requested access mode. See section [3.2.4.5.1](#Section_9a45e9e773774da199d6d66d97532550) for a discussion on sharing modes. + +| **Name and bitmask** | **Values** | **Meaning** | +| ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| AccessMode

0x0007 | 0 | Open for reading | +| 1 | Open for writing | +| 2 | Open for reading and writing | +| 3 | Open for execution | +| 4-7 | **Reserved**. For compatibility with older dialects, the server MUST return STATUS_OS2_INVALID_ACCESS (ERRDOS/ERRbadaccess) if these values are requested. | +| 0x0008 | Reserved. MUST be ignored by the server. | | +| SharingMode

0x0070 | 0 | Compatibility mode | +| 1 | Deny read/write/execute to others (exclusive use requested) | +| 2 | Deny write to others | +| 3 | Deny read/execute to others | +| 4 | Deny nothing to others | +| 0x0080 | **Reserved** | | +| ReferenceLocality

0x0700 | 0 | Unknown locality of reference | +| 1 | Mainly sequential access | +| 2 | Mainly random access | +| 3 | Random access with some locality | +| 4-7 | Undefined | +| 0x0800 | **Reserved** | | +| CacheMode

0x1000 | 0 | Perform caching on file | +| 1 | Do not cache the file | +| 0x2000 | **Reserved** | | +| WritethroughMode

0x4000 | 0 | Write-through mode. If this bit is set, no read ahead or write behind is allowed on this file or device. When the response is returned, data is expected to be on the disk or device. | +| 1 | +| 0x8000 | **Reserved** | | + +**SearchAttributes (2 bytes):** Specifies the type of file. This field is used as a search mask. Both the **FileName** and the **SearchAttributes** of a file MUST match in order for the file to be opened.[<28>](#Appendix_A_28) + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be greater than or equal to 0x0002. + +**Bytes (variable):** The message-specific data structure, which follows. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------ | --- | --- | --- | --- | --- | --- | --- | ------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| BufferFormat | | | | | | | | FileName (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**BufferFormat (1 byte):** A buffer format identifier. The value of this field MUST be 0x04. + +**FileName (variable):** A null-terminated string containing the file name of the file to be opened. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT FID; +- SMB_FILE_ATTRIBUTES FileAttrs; +- UTIME LastModified; +- ULONG FileSize; +- USHORT AccessMode; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | -------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters (15 bytes) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data | | | | | | | | +| ... | | | | | | | | + +**SMB_Parameters (15 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ---------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words (14 bytes) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x07. The length, in 2-byte words, of the remaining **SMB_Parameters**. + +**Words (14 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------ | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| FID | | | | | | | | | | | | | | | | FileAttrs | | | | | | | | | | | | | | | | +| LastModified | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| FileSize | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| AccessMode | | | | | | | | | | | | | | | | + +**FID (2 bytes):** The FID returned for the open file. + +**FileAttrs (2 bytes):** The set of attributes currently assigned to the file. This field is formatted in the same way as the **SearchAttributes** field in the request. + +**LastModified (4 bytes):** The time of the last modification to the opened file. + +**FileSize (4 bytes):** The current size of the opened file, in bytes. + +**AccessMode (2 bytes):** A 16-bit field for encoding the granted access mode. This field is formatted in the same way as the Request equivalent. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ---------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRbadfile

(0x0002) | STATUS_NO_SUCH_FILE

(0xC000000F) | ENOENT | The named file was not found. | +| ERRDOS

(0x01) | ERRbadpath

(0x0003) | STATUS_OBJECT_PATH_SYNTAX_BAD

(0xC000003B) | ENOENT | The file path syntax is invalid. | +| ERRDOS

(0x01) | ERRnofids

(0x0004) | STATUS_OS2_TOO_MANY_OPEN_FILES

(0x00040001)

STATUS_TOO_MANY_OPENED_FILES

(0xC000011F) | ENFILE | Too many open files, no more FIDs available. | +| ERRDOS

(0x01) | ERRbadpath

(0x0003) | STATUS_OBJECT_PATH_INVALID

(0xC0000039) | ENOTDIR | A component of the path-prefix was not a directory. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | EACCESS | A component of the path-prefix denied search permission OR the requested access permission is denied for the file OR an open mode failure occurred. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_FILE_IS_A_DIRECTORY

(0xC00000BA) | EISDIR | Named file is an existing directory and requested open mode is write or read/write. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | ETXTBSY | File is an executable binary file that is being executed and requested access permission specifies write or read/write. | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRDOS

(0x01) | ERRbadaccess

(0x000C) | STATUS_OS2_INVALID_ACCESS

(0x000C0001) | | The Reserved bit (0x0008) in the **AccessMode.AccessMode** subfield was set (1) in the request. | +| ERRDOS

(0x01) | ERRbadshare

(0x0020) | STATUS_SHARING_VIOLATION

(0xC0000043) | EAGAIN | File exists, mandatory file/record locking is set, and there are outstanding record locks on the file. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. Not enough parameter bytes were sent. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | | EFAULT | The path points outside the allocated address space of the process. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | | EINTR | A signal was caught during the open operation. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | | ENXIO | Generic server open failure. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_ACCESS_DENIED

(0xC0000022) | EROFS | The named file resides on a read-only file system and the requested access permission is write or read/write. | +| ERRSRV

(0x02) | ERRaccess

(0x0004) | STATUS_NETWORK_ACCESS_DENIED

(0xC00000CA) | | Permission conflict between the requested permission and permissions for the shared resource; for example, open for write of a file in a read-only file system subtree. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** is no longer valid. | +| ERRSRV

(0x02) | ERRinvdevice

(0x0007) | STATUS_BAD_DEVICE_TYPE

(0xC00000CB) | | A file creation request was made to a share that is not a file system subtree. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** supplied is not known to the session. | +| ERRHRD

(0x03) | ERRnowrite

(0x0013) | STATUS_MEDIA_WRITE_PROTECTED

(0xC00000A2) | EROFS | Attempt to write to a read-only file system. | +| ERRHRD

(0x03) | ERRdata

(0x0017) | STATUS_DATA_ERROR

(0xC000003E) | EIO | Disk I/O error. | + +#### SMB_COM_CREATE (0x03) + +This is an original **Core Protocol** command. This command is [**deprecated**](#gt_129acedf-ccf1-4e13-8df7-3bc59eff6f6d). Implementations SHOULD use SMB_COM_NT_CREATE_ANDX. + +This command is used to create and open a new file or open and truncate an existing file to zero length. The FID that is returned can be used in subsequent read, write, lock, unlock, and close messages. This command MUST NOT be used to create directories or named pipes. The request includes the pathname of the file relative to the supplied TID that the client wishes to create. If the command is successful, the server response MUST include a FID. The client MUST supply the FID in subsequent operations on the file. The client MUST have write permission on the file's parent directory in order to create a new file, or write permissions on the file itself in order to truncate the file. The client's access permissions on a newly created file MUST be read/write. Access permissions on truncated files are not modified. The file is opened in read/write/compatibility mode. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- SMB_FILE_ATTRIBUTES FileAttributes; +- UTIME CreationTime; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR BufferFormat; +- SMB_STRING FileName; +- } +- } + +**SMB_Header:** + +**TID (2 bytes):** A valid Tree Identifier obtained from a previously successful message exchange. + +**UID (2 bytes):** A valid User Identifier that MUST be the same value as the User Identifier associated with the current SMB Session. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ------------------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data (variable) | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (7 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x03. + +**Words (6 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ------------ | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| FileAttributes | | | | | | | | | | | | | | | | CreationTime | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | + +**FileAttributes (2 bytes):** A 16-bit field of 1-bit flags that represent the file attributes to assign to the file if it is created successfully. + +**CreationTime (4 bytes):** The time that the file was created, represented as the number of seconds since Jan 1, 1970, 00:00:00.0. + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be greater than or equal to 0x0002. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------ | --- | --- | --- | --- | --- | --- | --- | ------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| BufferFormat | | | | | | | | FileName (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**BufferFormat (1 byte):** This field MUST be 0x04. + +**FileName (variable):** A null-terminated string that represents the fully qualified name of the file relative to the supplied TID to create or truncate on the server. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT FID; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | -------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data | | | | | | | | +| ... | | | | | | | | + +**SMB_Parameters (3 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x01. + +**Words (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| FID | | | | | | | | | | | | | | | | + +**FID (2 bytes):** The **FID** representing the file on the server. This value MUST be supplied in the **FID** field of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) in subsequent requests that manipulate the file. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ---------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRbadfile

(0x0002) | STATUS_OBJECT_NAME_NOT_FOUND

(0xC0000034) | ENOENT | The named file was not found. | +| ERRDOS

(0x01) | ERRbadpath

(0x0003) | STATUS_OBJECT_PATH_SYNTAX_BAD

(0xC000003B) | ENOENT | The file path syntax is invalid. | +| ERRDOS

(0x01) | ERRnofids

(0x0004) | STATUS_OS2_TOO_MANY_OPEN_FILES

(0x00040001)

STATUS_TOO_MANY_OPENED_FILES

(0xC000011F) | EMFILE | Too many open files, no more **FIDs** available. | +| ERRDOS

(0x01) | ERRbadpath

(0x0003) | STATUS_OBJECT_PATH_INVALID

(0xC0000039) | ENOTDIR | A component of the path-prefix was not a directory. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | EACCESS | A component of the path-prefix denied search permission OR requested access permission is denied for the file OR open mode failure. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_FILE_IS_A_DIRECTORY

(0xC00000BA) | EISDIR | Named file is an existing directory and requested open mode is write or read/write. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | ETXTBSY | File is an executable binary file that is being executed and requested access permission specifies write or read/write. | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRSRV

(0x02) | ERRbadshare

(0x0020) | STATUS_SHARING_VIOLATION

(0xC0000043) | EAGAIN | File exists, mandatory file/record locking is set, and there are outstanding record locks on the file. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. Not enough parameter bytes were sent. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | | EFAULT | Path points outside the allocated address space of the process. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | | EINTR | A signal was caught during the open operation. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | | ENXIO | Generic server open failure. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_ACCESS_DENIED

(0xC0000022) | EROFS | Named file resides on read-only file system and requested access permission is write or read/write. | +| ERRSRV

(0x02) | ERRaccess

(0x0004) | STATUS_NETWORK_ACCESS_DENIED

(0xC00000CA) | | Permission conflict between requested permission and permissions for the shared resource; for example, open for write of a file in a read-only file system subtree. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** is no longer valid. | +| ERRSRV

(0x02) | ERRinvdevice

(0x0007) | STATUS_BAD_DEVICE_TYPE

(0xC00000CB) | | File creation request made to a share that is not a file system subtree. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** supplied is not known to the session. | +| ERRHRD

(0x03) | ERRnowrite

(0x0013) | STATUS_MEDIA_WRITE_PROTECTED

(0xC00000A2) | EROFS | Attempt to write to a read-only file system. | +| ERRHRD

(0x03) | ERRdata

(0x0017) | STATUS_DATA_ERROR

(0xC000003E) | EIO | Disk I/O error. | + +#### SMB_COM_CLOSE (0x04) + +This is an original **Core Protocol** command. + +This command is used by the client to close an instance of an object associated with a valid FID. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT FID; +- UTIME LastTimeModified; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | -------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data | | | | | | | | +| ... | | | | | | | | + +**SMB_Parameters (7 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x03. + +**Words (6 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| FID | | | | | | | | | | | | | | | | LastTimeModified | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | + +**FID (2 bytes):** The FID of the object to be closed. + +**LastTimeModified (4 bytes):** A time value encoded as the number of seconds since January 1, 1970 00:00:00.0. The client can request that the last modification time for the file be updated to this time value. A value of 0x00000000 or 0xFFFFFFFF results in the server not updating the last modification time. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | -------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | SMB_Data | | | | | | | | | | | | | | | | + +**SMB_Parameters (1 byte):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x00. No parameters are sent by this message. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x00. No data is sent by this message + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ---------------------------- | --------------------------------------------------------------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| ERRDOS

(0x01) | ERRbadfid

(0x0006) | STATUS_INVALID_HANDLE

(0xC0000008)

STATUS_SMB_BAD_FID

(0x00060001) | ENFILE | The **FID** is invalid. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | The **TID** specified in the command is invalid. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** specified in the command is invalid. | +| ERRSRV

(0x02) | ERRinvdevice

(0x0007) | STATUS_BAD_DEVICE_TYPE

(0xC00000CB) | | Invalid attempt to close an open spool file.

OR

Invalid device - printer request made to a non-printer connection or non-printer request made to a printer connection. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** specified is not known as a valid ID on this server session, or the user identified by the **UID** does not have sufficient privileges. | + +#### SMB_COM_FLUSH (0x05) + +This is an original **Core Protocol** command. + +This command requests that the server flush data and allocation information for a specified file or for all open files under the session. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT FID; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | -------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data | | | | | | | | +| ... | | | | | | | | + +**SMB_Parameters (3 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x01. + +**Words (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| FID | | | | | | | | | | | | | | | | + +**FID (2 bytes):** The FID of the file to be flushed. If this field is set to 0xFFFF (65535), all files opened by the same PID within the SMB connection are to be flushed. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | -------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | SMB_Data | | | | | | | | | | | | | | | | + +**SMB_Parameters (1 byte):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x00. No parameters are sent by this message. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | --------------------------- | --------------------------------------------------------------------------------------- | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRbadfid

(0x0006) | STATUS_INVALID_HANDLE

(0xC0000008)

STATUS_SMB_BAD_FID

(0x00060001) | ENFILE | Attempt to read from a **FID** that the server does not have open. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | EACCESS | The client does not have write permissions. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | The **TID** specified in the command is invalid. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** specified in the command is invalid. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** specified is not known as a valid ID on this server session, or the user identified by the **UID** does not have sufficient privileges. | +| ERRHRD

(0x03) | ERRnowrite

(0x0013) | STATUS_MEDIA_WRITE_PROTECTED

(0xC00000A2) | EROFS | Attempt to write to a read-only file system. | +| ERRHRD

(0x03) | ERRdata

(0x0017) | STATUS_DATA_ERROR

(0xC000003E) | EIO | Disk I/O error. | +| ERRHRD

(0x03) | ERRdiskfull(0x0027) | STATUS_DISK_FULL(0xC000007F) | ENOSPC | The file system is full. | + +#### SMB_COM_DELETE (0x06) + +This is an original **Core Protocol** command. + +This command is used by the client to delete one or more regular files. It supports the use of wildcards in file names, allowing for deletion of multiple files in a single request. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- SMB_FILE_ATTRIBUTES SearchAttributes; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR BufferFormat; +- SMB_STRING FileName; +- } +- } + +**SMB_Header:** + +**Flags2 (2 bytes): USHORT** + +| Name and bitmask | Relevance | +| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| SMB_FLAGS2_LONG_NAMES

0x0001 | Wildcard pattern matching behavior.

If this flag is not set, wildcard patterns MUST compare against [**8.3 names**](#gt_d2302116-d3d3-4465-a72e-c07a7737b7ae) only. If a file has a long name, the wildcard pattern MUST be compared to that file's 8.3 name.

If this flag is set, file names can be long file names and wildcard patterns MUST compare against the long file name of a file if it is available. | + +  + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ------------------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data (variable) | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (3 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x01. + +**Words (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ---------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SearchAttributes | | | | | | | | | | | | | | | | + +**SearchAttributes (2 bytes):** The file attributes of the file(s) to be deleted. If the value of this field is 0x0000, then only normal files MUST be matched for deletion. If the System or Hidden attributes MUST be specified, then entries with those attributes are matched in addition to the normal files. Read-only files MUST NOT be deleted. The read-only attribute of the file MUST be cleared before the file can be deleted. + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be greater than or equal to 0x0002. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------ | --- | --- | --- | --- | --- | --- | --- | ------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| BufferFormat | | | | | | | | FileName (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**BufferFormat (1 byte):** This field MUST be 0x04. + +**FileName (variable):** The pathname of the file(s) to be deleted, relative to the supplied **TID**. Wildcards MAY be used in the filename component of the path. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | -------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | SMB_Data | | | | | | | | | | | | | | | | + +**SMB_Parameters (1 byte):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x00. No parameters are sent by this message. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | --------------------------- | -------------------------------------------------- | ---------------- | -------------------------------------------------- | +| ERRDOS

(0x01) | ERRbadfile

(0x0002) | STATUS_NO_SUCH_FILE

(0xC000000F) | ENOENT | The named file was not found. | +| ERRDOS

(0x01) | ERRbadpath

(0x0003) | STATUS_OBJECT_PATH_SYNTAX_BAD

(0xC000003B) | ENOENT | The file path syntax is invalid. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | EPERM | Access denied. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. Not enough parameter bytes were sent. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** is no longer valid. | +| ERRSRV

(0x02) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** supplied is not known to the session. | +| ERRHRD

(0x03) | ERRnowrite

(0x0013) | STATUS_MEDIA_WRITE_PROTECTED

(0xC00000A2) | EROFS | Attempt to write to a read-only file system. | + +#### SMB_COM_RENAME (0x07) + +This is an original **Core Protocol** command. + +This command changes the name of one or more files or directories. It supports the use of wildcards in file names, allowing the renaming of multiple files in a single request. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- SMB_FILE_ATTRIBUTES SearchAttributes; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR BufferFormat1; +- SMB_STRING OldFileName; +- UCHAR BufferFormat2; +- SMB_STRING NewFileName; +- } +- } + +**SMB_Header:** + +**Flags2 (2 bytes): USHORT** + +| Name and bitmask | Relevance | +| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| SMB_FLAGS2_LONG_NAMES

0x0001 | Wildcard pattern matching behavior.

If this flag is not set, wildcard patterns MUST compare against 8.3 names only. If a file has a long name, the wildcard pattern MUST be compared to that file's 8.3 name.

If this flag is set, file names MAY be long file names and wildcard patterns MUST compare against the long file name of a file if it is available. | + +**TID (2 bytes):** This field MUST contain a valid TID. + +**UID (2 bytes):** This field MUST contain a valid UID. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ------------------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data (variable) | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (3 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x01. + +**Words (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ---------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SearchAttributes | | | | | | | | | | | | | | | | + +**SearchAttributes (2 bytes):** Indicates the file attributes that the file(s) to be renamed MUST have. If the value of this field is 0x0000, then only normal files MUST be matched to be renamed. If the System or Hidden attributes are specified, then entries with those attributes MAY be matched in addition to the normal files. Read-only files MUST NOT be renamed. The read-only attribute of the file MUST be cleared before it can be renamed. + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be greater than or equal to 0x0002. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------- | --- | --- | --- | --- | --- | --- | --- | ---------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| BufferFormat1 | | | | | | | | OldFileName (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| BufferFormat2 | | | | | | | | NewFileName (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**BufferFormat1 (1 byte):** This field MUST be 0x04. + +**OldFileName (variable):** A null-terminated string that contains the name of the file or files to be renamed. Wildcards MAY be used in the filename component of the path. + +**BufferFormat2 (1 byte):** This field MUST be 0x04. + +**NewFileName (variable):** A null-terminated string containing the new name(s) to be given to the file(s) that matches OldFileName or the name of the destination directory into which the files matching OldFileName MUST be moved. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | -------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | SMB_Data | | | | | | | | | | | | | | | | + +**SMB_Parameters (1 byte):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x00. No parameters are sent by this message. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| --------------- | --------------------------- | -------------------------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------ | +| ERRDOS (0x01) | ERRbadfile (0x0002) | STATUS_NO_SUCH_FILE

(0xC000000F) | ENOENT | File not found. | +| ERRDOS (0x01) | ERRbadpath (0x0003) | STATUS_OBJECT_PATH_SYNTAX_BAD

(0xC000003B) | ENOENT | A component in the path prefix is not a directory. | +| ERRDOS (0x01) | ERRnoaccess (0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | EPERM | The new file already exists. | +| ERRDOS (0x01) | ERRnoaccess (0x0005) | | | The directory is full. | +| ERRDOS (0x01) | ERRnoaccess (0x0005) | | | The old path is the mounted point for a file system. | +| ERRDOS (0x01) | ERRnoaccess (0x0005) | | | The old path is the last link to an executing program. | +| ERRDOS (0x01) | ERRdiffdevice (0x0011) | STATUS_NOT_SAME_DEVICE

(0xC00000D4) | EXDEV | The new path is on a different file system. | +| ERRDOS (0x01) | ERRbadshare

(0x0020) | STATUS_SHARING_VIOLATION

(0xC0000043) | ETXTBSY | Sharing violation. A requested open mode conflicts with the sharing mode of an existing file handle. | +| ERRDOS (0x01) | ERRfilexists (0x0051) | STATUS_OBJECT_NAME_COLLISION

(0xC0000035) | EEXIST | The new file name already exists. | +| ERRSRV (0x02) | ERRerror (0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. The request contains a packaging or value error. | +| ERRSRV (0x02) | ERRaccess (0x0004) | STATUS_NETWORK_ACCESS_DENIED

(0xC00000CA) | EACCES | Access denied. The specified **UID** does not have permission to execute the requested command within the current context (**TID**). | +| ERRSRV (0x02) | ERRaccess (0x0004) | | | An attempt was made to change a volume label. | +| ERRSRV (0x02) | ERRinvtid (0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** specified in the command was invalid. | +| ERRSRV (0x02) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRSRV (0x02) | ERRbaduid (0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** specified is not known as a valid ID on this server session. | +| ERRHRD (0x03) | ERRnowrite (0x0013) | STATUS_MEDIA_WRITE_PROTECTED

(0x0C00000A2) | EROFS | Attempt to modify a read-only file system. | + +#### SMB_COM_QUERY_INFORMATION (0x08) + +This is an original **Core Protocol** command. This command is [**deprecated**](#gt_129acedf-ccf1-4e13-8df7-3bc59eff6f6d). New client implementations SHOULD use the [SMB_COM_TRANSACTION2 (section 2.2.4.46)](#Section_3d9d8f3edc70410da3fc6f4a881e8cab) subcommand [TRANS2_QUERY_PATH_INFORMATION (section 2.2.6.6)](#Section_39021262e1624948b4999dfccef77ef6) instead. + +This command MAY be sent by a client to obtain attribute information about a file using the name and path to the file. No **FID** is required. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR BufferFormat; +- SMB_STRING FileName; +- } +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | ------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | SMB_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (1 byte):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x00. No parameters are sent by this message. + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be greater than or equal to 0x0002. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------ | --- | --- | --- | --- | --- | --- | --- | ------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| BufferFormat | | | | | | | | FileName (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**BufferFormat (1 byte):** This field MUST be 0x04. + +**FileName (variable):** A null-terminated string that represents the fully qualified name of the file relative to the supplied **TID**. This is the file for which attributes are queried and returned. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- SMB_FILE_ATTRIBUTES FileAttributes; +- UTIME LastWriteTime; +- ULONG FileSize; +- USHORT Reserved\[5\]; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | -------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters (21 bytes) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | SMB_Data | | | | | | | | | | | | | | | | + +**SMB_Parameters (21 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ---------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words (20 bytes) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x0A. + +**Words (20 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| FileAttributes | | | | | | | | | | | | | | | | LastWriteTime | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | FileSize | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | Reserved | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**FileAttributes (2 bytes):** This field is a 16-bit unsigned bit field encoded as **SMB_FILE_ATTRIBUTES** (see section [2.2.1.2.4](#Section_2198f480e0474df0ba64f28eadef00b9)). + +**LastWriteTime (4 bytes):** The time of the last write to the file. + +**FileSize (4 bytes):** This field contains the size of the file, in bytes. Because this size is limited to 32 bits, this command is inappropriate for files whose size is too large. + +**Reserved (10 bytes):** This field is reserved, and all entries MUST be set to 0x00. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | --------------------------- | -------------------------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------ | +| ERRDOS

(0x01) | ERRbadfile

(0x0002) | STATUS_NO_SUCH_FILE

(0xC000000F) | ENOENT | The file does not exist. | +| ERRDOS

(0x01) | ERRbadpath

(0x0003) | STATUS_OBJECT_PATH_NOT_FOUND

(0xC000003A) | ENOENT | The file path syntax is invalid. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | EPERM | Access denied. | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000022) | EPERM | Access denied. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. Not enough parameter bytes were sent. | +| ERRSRV

(0x02) | ERRaccess

(0x0004) | STATUS_NETWORK_ACCESS_DENIED

(0xC00000CA) | | The specified **UID** does not have permission to execute the requested command within the context of the **TID**. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** is no longer valid. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** supplied is not known to the session. | +| ERRHRD

(0x03) | ERRnotready

(0x0015) | STATUS_NO_MEDIA_IN_DEVICE

(0x0xC0000013) | | Share represents a removable device and there is no media present in the device. | +| ERRHRD

(0x03) | ERRdata

(0x0017) | STATUS_DATA_ERROR

(0xC000003E) | EIO | Disk I/O error. | + +#### SMB_COM_SET_INFORMATION (0x09) + +This is an original **Core Protocol** command. This command is [**deprecated**](#gt_129acedf-ccf1-4e13-8df7-3bc59eff6f6d). New client implementations SHOULD use the [SMB_COM_TRANSACTION2 (section 2.2.4.46)](#Section_3d9d8f3edc70410da3fc6f4a881e8cab) subcommand [TRANS2_SET_PATH_INFORMATION (section 2.2.6.7)](#Section_a23483d965434aaaa996e7c9506f8b94) instead. + +This command MAY be sent by a client to change the attribute information of a regular file or directory. + +**FileName** MUST be the fully qualified name of the file relative to the **TID**. Support of all parameters is optional. A server that does not implement one of the parameters MUST ignore that field. If the **LastWriteTime** field contains 0x00000000, then the file's **LastWriteTime** MUST NOT be changed. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- SMB_FILE_ATTRIBUTES FileAttributes; +- UTIME LastWriteTime; +- USHORT Reserved\[5\]; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR BufferFormat; +- SMB_STRING FileName; +- } +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | ------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters (17 bytes) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | SMB_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (17 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ---------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words (16 bytes) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x08. + +**Words (16 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| FileAttributes | | | | | | | | | | | | | | | | LastWriteTime | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | Reserved | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**FileAttributes (2 bytes):** This field is a 16-bit unsigned bit field encoded as SMB_FILE_ATTRIBUTES (section 2.2.4.10.1) + +**LastWriteTime (4 bytes):** The time of the last write to the file. + +**Reserved (10 bytes):** This field is reserved, and all bytes MUST be set to 0x00. + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be greater than or equal to 0x0002. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------ | --- | --- | --- | --- | --- | --- | --- | ------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| BufferFormat | | | | | | | | FileName (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**BufferFormat (1 byte):** This field MUST be 0x04. + +**FileName (variable):** A null-terminated string that represents the fully qualified name of the file relative to the supplied **TID**. This is the file for which attributes are set. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | -------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | SMB_Data | | | | | | | | | | | | | | | | + +**SMB_Parameters (1 byte):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x00. No parameters are sent by this message. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRbadfile

(0x0002) | STATUS_NO_SUCH_FILE

(0xC000000F) | ENOENT | The file was not found. | +| ERRDOS

(0x01) | ERRbadpath

(0x0003) | STATUS_OBJECT_PATH_SYNTAX_BAD

(0xC000003B) | ENOTDIR | A portion of the path is not a directory. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | EPERM | Read permission denied on a portion of the path. | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205)

STATUS_NO_MEMORY

(0xC0000017) | ENOMEM | The server is out of resources. | +| ERRDOS

(0x01) | ERRinvalidparam

(0x0057) | STATUS_INVALID_PARAMETER

(0xC000000D) | | One of the attributes in FileAttributes was invalid. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. Error in request format or session has not been established. | +| ERRSRV

(0x02) | ERRaccess

(0x0004) | STATUS_NETWORK_ACCESS_DENIED

(0xC00000CA) | | Access denied. The specified UID does not have permission to execute the requested command within the current context (TID). | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | The TID is no longer valid or the tree connect is closing. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | | Share type does not match share type of TID OR the null session is not allowed to access the TID. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The UID supplied is not known to the session. | +| ERRHRD

(0x03) | ERRnotready

(0x0015) | STATUS_NO_MEDIA_IN_DEVICE

(0x0xC0000013) | | Share represents a removable device and there is no media present in the device. | +| ERRHRD

(0x03) | ERRdata

(0x0017) | STATUS_DATA_ERROR

(0xC000003E) | EIO | Disk I/O error. | + +#### SMB_COM_READ (0x0A) + +This is an original **Core Protocol** command. This command is [**deprecated**](#gt_129acedf-ccf1-4e13-8df7-3bc59eff6f6d). Clients SHOULD use [SMB_COM_READ_ANDX (section 2.2.4.42)](#Section_129aa093574b483ea55ddf334606a622). + +This command is used to read bytes from a regular file. If the client has negotiated a protocol that supports named pipes or directly accessible devices, this command can also be used to read from those objects. The end of file condition is indicated by the server returning fewer bytes than the client requested. A read request starting at or beyond the end of the file returns zero bytes. If a read requests more data than can be placed in a message of **MaxBufferSize** for the SMB connection, the server MUST abort the connection to the client. Because this client request supports 32-bit offsets only, it is inappropriate for files that have 64-bit offsets. The client MUST have at least read access to the file. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- SHORT FID; +- USHORT CountOfBytesToRead; +- ULONG ReadOffsetInBytes; +- USHORT EstimateOfRemainingBytesToBeRead; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +**SMB_Header** + +**Flags2 (2 bytes):** + +| Name and bitmask | Relevance | +| ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| SMB_FLAGS2_READ_IF_EXECUTE

0x2000 | If the bit is set and client has execute permission on the file, then the client MAY read the file even if the client does not have READ permission.

This flag is also known as SMB_FLAGS2_PAGING_IO. | + +  + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | -------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data | | | | | | | | +| ... | | | | | | | | + +**SMB_Parameters (11 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x05. + +**Words (10 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ------------------ | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| FID | | | | | | | | | | | | | | | | CountOfBytesToRead | | | | | | | | | | | | | | | | +| ReadOffsetInBytes | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| EstimateOfRemainingBytesToBeRead | | | | | | | | | | | | | | | | + +**FID (2 bytes):** This field MUST be a valid 16-bit signed integer indicating the file from which the data MUST be read. + +**CountOfBytesToRead (2 bytes):** This field is a 16-bit unsigned integer indicating the number of bytes to be read from the file. The client MUST ensure that the amount of data requested will fit in the negotiated maximum buffer size. + +**ReadOffsetInBytes (4 bytes):** This field is a 32-bit unsigned integer indicating the offset, in number of bytes, from which to begin reading from the file. The client MUST ensure that the amount of data requested fits in the negotiated maximum buffer size. Because this field is limited to 32 bits, this command is inappropriate for files having 64-bit offsets. + +**EstimateOfRemainingBytesToBeRead (2 bytes):** This field is a 16-bit unsigned integer indicating the remaining number of bytes that the client intends to read from the file. This is an advisory field and MAY be 0x0000. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT CountOfBytesReturned; +- USHORT Reserved\[4\]; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR BufferFormat; +- USHORT CountOfBytesRead; +- UCHAR Bytes\[CountOfBytesRead\]; +- } +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ------------------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data (variable) | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (11 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x05. + +**Words (10 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | -------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| CountOfBytesReturned | | | | | | | | | | | | | | | | Reserved | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | + +**CountOfBytesReturned (2 bytes):** The actual number of bytes returned to the client. This MUST be equal to **CountOfBytesToRead** unless the end of file was reached before reading **CoutOfBytesToRead** bytes or the **ReadOffsetInBytes** pointed at or beyond the end of file. + +**Reserved (8 bytes):** Reserved. All bytes MUST be 0x00. + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0003 + **CountOfBytesRead**. + +**Bytes:** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------ | --- | --- | --- | --- | --- | --- | --- | ---------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ---------------- | --- | --- | --- | --- | --- | ---------- | --- | +| BufferFormat | | | | | | | | CountOfBytesRead | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**BufferFormat (1 byte):** This field MUST be 0x01. + +**CountOfBytesRead (2 bytes):** The number of bytes read that are contained in the following array of bytes. + +**Bytes (variable):** The actual bytes read from the file. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ---------------------------- | ------------------------------------------------------------------------------------------------ | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_ALREADY_COMMITTED

(0xC0000021) | ENOLCK | Attempt to read from a portion of the file that the server determines has been locked or has been opened in deny-read mode. | +| ERRDOS

(0x01) | ERRbadfid

(0x0006) | STATUS_INVALID_HANDLE

(0xC0000008)

STATUS_SMB_BAD_FID

(0x00060001) | ENFILE | Attempt to read from a **FID** that the server does not have open. | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRDOS

(0x01) | ERRbadaccess

(0x000C) | STATUS_ACCESS_DENIED

(0xC0000022) | | Read permission required. | +| ERRDOS

(0x01) | ERRlock

(0x0021) | STATUS_FILE_LOCK_CONFLICT

(0xC0000054)

STATUS_LOCK_NOT_GRANTED

(0xC0000055) | EAGAIN | The requested byte range was already locked by a different process ([**PID**](#gt_38a420dd-6f31-456e-ae5c-63ec6905380d)). | +| ERRDOS

(0x01) | ERReof

(0x0026) | STATUS_END_OF_FILE

(0xC0000011) | | Attempted to read beyond the end of the file. | +| ERRDOS

(0x01) | ERRmoredata

(0x00EA) | STATUS_BUFFER_OVERFLOW

(0x80000005) | | The message on a [**message mode**](#gt_c49a48e8-f1ac-4568-bc87-0672eb08868b) named pipe exceeds the requested number of bytes. The server MUST send a full [SMB_COM_READ](#Section_b88922ddb18e46e09f7408eaace9a95c) response with this error code. The requested number of bytes are read and returned to the client. | +| ERRSRV

(0x02) | ERRerror (0x0001) | | EBADF | The **FID** was validated by the server but unacceptable to the system. | +| ERRSRV

(0x02) | ERRerror (0x0001) | | EDEADLK | The read would block and deadlock would result. | +| ERRSRV

(0x02) | ERRerror (0x0001) | STATUS_INVALID_SMB

(0x00010002) | | A corrupt request has been encountered. | +| ERRSRV

(0x02) | ERRinvdevice (0x0007) | STATUS_BAD_DEVICE_TYPE

(0xC00000CB) | | Attempt to read from an open spool file. | +| ERRSRV

(0x02) | ERRinvtid (0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | Invalid TID in request. | +| ERRSRV

(0x02) | ERRbaduid (0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** specified is not known as a valid ID for this session, or the user identified by the **UID** does not have sufficient privileges. | +| ERRHRD

(0x03) | ERRdata

(0x0017) | STATUS_DATA_ERROR

(0xC000003E) | EIO | A problem has occurred in the physical I/O. | +| ERRHRD

(0x03) | ERRread

(0x001E) | | ENXIO | The device associated with the file descriptor is a block-special or character-special file and the value of the file pointer is out of range. | + +#### SMB_COM_WRITE (0x0B) + +This is an original **Core Protocol** command. This command is [**deprecated**](#gt_129acedf-ccf1-4e13-8df7-3bc59eff6f6d). Clients SHOULD use the SMB_COM_WRITE_ANDX command. Support for named pipes and I/O devices was introduced in the **LAN Manager 1.0** dialect. + +This command is used to write bytes to a regular file. If the client has negotiated a protocol dialect that supports named pipes, mailslots, or directly accessible devices, this command MAY also be used to write to those object. This command MAY also be used to truncate a file to a specified point or to extend a file beyond its current size. The command MUST include a valid TID and FID in the request. This command supports 32-bit offsets only and is inappropriate for files having 64-bit offsets. The client SHOULD use SMB_COM_WRITE_ANDX to write to files requiring a 64-bit file offset. + +When FID represents a disk file and the request specifies a byte range (WriteOffsetInBytes) beyond the current end of file, the file MUST be extended. Any bytes between the previous end of file and the requested offset are initialized to 0x00. When a write specifies a length (CountOfBytesToWrite) of 0x0000, the file is truncated (or extended) to the length specified by the offset. + +The client MUST have at least write access to the file. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT FID; +- USHORT CountOfBytesToWrite; +- ULONG WriteOffsetInBytes; +- USHORT EstimateOfRemainingBytesToBeWritten; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR BufferFormat; +- USHORT DataLength; +- UCHAR Data\[ CountOfBytesToWrite \]; +- } +- } + +**SMB_Header:** + +**TID (2 bytes):** This field MUST contain a valid TID. + +**UID (2 bytes):** This field MUST contain a valid UID. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ------------------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data (variable) | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (11 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x05. + +**Words (10 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ------------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| FID | | | | | | | | | | | | | | | | CountOfBytesToWrite | | | | | | | | | | | | | | | | +| WriteOffsetInBytes | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| EstimateOfRemainingBytesToBeWritten | | | | | | | | | | | | | | | | + +**FID (2 bytes):** This field MUST be a valid 16-bit unsigned integer indicating the file to which the data MUST be written. + +**CountOfBytesToWrite (2 bytes):** This field is a 16-bit unsigned integer indicating the number of bytes to be written to the file. The client MUST ensure that the amount of data sent can fit in the negotiated maximum buffer size. + +**WriteOffsetInBytes (4 bytes):** This field is a 32-bit unsigned integer indicating the offset, in number of bytes, from the beginning of the file at which to begin writing to the file. The client MUST ensure that the amount of data sent fits in the negotiated maximum buffer size. Because this field is limited to 32 bits, this command is inappropriate for files that have 64-bit offsets. + +**EstimateOfRemainingBytesToBeWritten (2 bytes):** This field is a 16-bit unsigned integer indicating the remaining number of bytes that the client anticipates to write to the file. This is an advisory field and can be 0x0000. This information can be used by the server to optimize cache behavior. + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be greater than or equal to 0x0003. The total value represents the size of the **BufferFormat** field in bytes plus the size of the **DataLength** field in bytes plus the value of the **CountOfBytesToWrite** field. See [Data Buffer Format Codes (section 2.2.2.5)](#Section_9189a82fc1c04af9818c85050f7e5e66) for a complete description of data buffer format codes and their usages. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------ | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --------------- | --- | --- | --- | --- | --- | ---------- | --- | +| BufferFormat | | | | | | | | DataLength | | | | | | | | | | | | | | | | Data (variable) | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**BufferFormat (1 byte):** This field MUST be 0x01. + +**DataLength (2 bytes):** This field MUST match SMB_Parameters.CountOfBytesToWrite. + +**Data (variable):** The raw bytes to be written to the file. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT CountOfBytesWritten; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | -------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data | | | | | | | | +| ... | | | | | | | | + +**SMB_Parameters (3 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x01. + +**Words (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| CountOfBytesWritten | | | | | | | | | | | | | | | | + +**CountOfBytesWritten (2 bytes):** Indicates the actual number of bytes written to the file. For successful writes, this MUST equal the CountOfBytesToWrite in the client Request. If the number of bytes written differs from the number requested and no error is indicated, then the server has no resources available to satisfy the complete write. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| --------------- | ------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| SUCCESS (0x00) | SUCCESS

(0x0000) | | EFBIG | The file has grown too large and no more data can be written to the file. A **Count** of zero (0x0000) MUST be returned to the client in the server response. This indicates to the client that the file system is full. | +| SUCCESS (0x00) | SUCCESS

(0x0000) | | NOSPC | No space on the file system. The server MUST return a zero (0x0000) in the **Count** field of the response. This indicates that the file system is full. | +| ERRDOS (0x01) | ERRnoaccess

(0x0005) | | EAGAIN | Resources for I/O on the server are temporarily exhausted. | +| ERRDOS (0x01) | ERRnoaccess

(0x0005) | STATUS_ALREADY_COMMITTED

(0xC0000021) | ENOLCK | A record lock has been taken on the file or the client has attempted to write to a portion of the file that the server determines has been locked, opened in deny-write mode, or opened in read-only mode. | +| ERRDOS (0x01) | ERRbadfid

(0x0006) | STATUS_INVALID_HANDLE

(0xC0000008)

STATUS_SMB_BAD_FID

(0x00060001) | ENFILE | Invalid FID, or FID mapped to a valid server FID but it was not acceptable to the operating system. | +| ERRDOS (0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205)

STATUS_NO_MEMORY

(0xC0000017) | ENOMEM | The server is out of resources. | +| ERRDOS (0x01) | ERRbadaccess

(0x000C) | STATUS_ACCESS_DENIED

(0xC0000022) | | Write permission required. | +| ERRDOS (0x01) | ERRlock

(0x0021) | STATUS_FILE_LOCK_CONFLICT

(0xC0000054) | | The requested byte range was already locked by a different process (**PID**). | +| ERRDOS (0x01) | ERRnotconnected

(0x00E9) | STATUS_PIPE_DISCONNECTED

(0xC00000B0) | EPIPE | Write to a named pipe with no reader. | +| ERRSRV (0x02) | ERRerror

(0x0001) | | EDEADLK | The write would block due to locking and deadlock would result. | +| ERRSRV (0x02) | ERRerror

(0x0001) | | ERANGE | Attempted write size is outside of the minimum or maximum ranges that can be written to the supplied FID. | +| ERRSRV (0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | A corrupt or invalid SMB request was received. | +| ERRSRV (0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | Invalid **TID** in request. | +| ERRSRV (0x02) | ERRqfull

(0x0031) | STATUS_PRINT_QUEUE_FULL

(0xC00000C6) | | Print queue is full - too many queued items. | +| ERRSRV (0x02) | ERRqtoobig

(0x0032) | STATUS_NO_SPOOL_SPACE

(0xC00000C7) | | Print queue is full - too many queued items. | +| ERRSRV (0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** specified is not a valid ID on this server session, or the user identified by the **UID** does not have sufficient privileges. | +| ERRHRD (0x03) | ERRdata

(0x0017) | STATUS_DATA_ERROR

(0xC000003E) | EIO | A problem has occurred in the physical I/O. | +| ERRHRD (0x03) | ERRwrite

(0x001D) | | ENXIO | The device associated with the file descriptor is a block-special or character-special file, and the value of the file pointer is out of range. | +| ERRHRD (0x03) | ERRdiskfull

(0x0027) | STATUS_DISK_FULL

(0xC000007F) | ENOSPC | The file system is full. | + +#### SMB_COM_LOCK_BYTE_RANGE (0x0C) + +This is an original **Core Protocol** command. This command is [**deprecated**](#gt_129acedf-ccf1-4e13-8df7-3bc59eff6f6d). Clients SHOULD use the [SMB_COM_LOCKING_ANDX (section 2.2.4.32)](#Section_df492170a2e840d1b7d5eb29364047e1) command. + +This command is not compatible with files having greater than 32-bit offsets. The SMB_COM_LOCKING_ANDX command introduced in the **LAN Manager 1.0** dialect was modified in the [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) dialect to support files that have 64-bit offsets. SMB_COM_LOCKING_ANDX is the preferred method of locking and unlocking byte ranges for clients that negotiate the **LAN Manager 1.0** dialect or later. The client MUST negotiate NT LAN Manager or later dialect to access the support for 64-bit file offsets. + +This command is used to explicitly lock a contiguous range of bytes in an open regular file. More than one non-overlapping byte range can be locked in any specified file. Locks prevent attempts to lock, read, or write the locked portion of the file by other clients or **PIDs**. Overlapping locks MUST be failed with STATUS_LOCK_NOT_GRANTED (ERRDOS/ERRlock). Offsets beyond the current end of file are allowed to be locked. Such locks MUST NOT cause allocation of additional file space. Locks MUST be unlocked only by the client **PID** that performed the lock. + +Because this client request supports 32-bit offsets only, it is inappropriate for files that have 64-bit offsets. The client MUST have at least read access to the file. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT FID; +- ULONG CountOfBytesToLock; +- ULONG LockOffsetInBytes; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | -------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data | | | | | | | | +| ... | | | | | | | | + +**SMB_Parameters (11 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x05. + +**Words (10 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ------------------ | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| FID | | | | | | | | | | | | | | | | CountOfBytesToLock | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | LockOffsetInBytes | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | + +**FID (2 bytes):** This field MUST be a valid 16-bit unsigned integer indicating the file from which the data MUST be read. + +**CountOfBytesToLock (4 bytes):** This field is a 32-bit unsigned integer indicating the number of contiguous bytes to be locked. + +**LockOffsetInBytes (4 bytes):** This field is a 32-bit unsigned integer indicating the offset, in number of bytes, from which to begin the lock. Because this field is limited to 32 bits, this command is inappropriate for files that have 64-bit offsets. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | -------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | SMB_Data | | | | | | | | | | | | | | | | + +**SMB_Parameters (1 byte):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x00. No parameters are sent by this message. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ---------------------------- | ------------------------------------------------------------------------------------------------ | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------ | +| ERRDOS (0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED | EACCESS | File access rights do not match requested locks. | +| ERRDOS (0x01) | ERRbadfid

(0x0006) | STATUS_INVALID_HANDLE

(0xC0000008)

STATUS_SMB_BAD_FID

(0x00060001) | ENFILE | Attempt to read from a **FID** that the server does not have open. | +| ERRDOS (0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | Insufficient server resources to place the lock. | +| ERRDOS (0x01) | ERRlock

(0x0021) | STATUS_FILE_LOCK_CONFLICT

(0xC0000054)

STATUS_LOCK_NOT_GRANTED

(0xC0000055) | EACCESS | The intended byte range has already been locked. | +| ERRSRV (0x02) | ERRerror

(0x0001) | | EBADF | A valid **FID** was rejected by the underlying system. | +| ERRSRV (0x02) | ERRerror

(0x0001) | | EDEADLK | The lock request would block and cause a deadlock with another process. | +| ERRSRV (0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. | +| ERRSRV (0x02) | ERRinvdevice

(0x0007) | STATUS_BAD_DEVICE_TYPE

(0xC00000CB) | | Attempt to lock a non-regular file such as a named pipe. | +| ERRSRV (0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | Invalid **TID** in request. | +| ERRSRV (0x02) | ERRbaduid (0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** specified is not a valid ID for this session, or the user identified by the **UID** does not have sufficient privileges. | +| ERRHRD

(0x03) | ERRdata

(0x0017) | STATUS_DATA_ERROR

(0xC000003E) | EIO | Disk I/O error. | + +#### SMB_COM_UNLOCK_BYTE_RANGE (0x0D) + +This is an original **Core Protocol** command. This command is [**deprecated**](#gt_129acedf-ccf1-4e13-8df7-3bc59eff6f6d). Clients SHOULD use the [SMB_COM_LOCKING_ANDX (section 2.2.4.32)](#Section_df492170a2e840d1b7d5eb29364047e1) command. + +This command is not compatible with files having greater than 32-bit offsets. The SMB_COM_LOCKING_ANDX command introduced in the **LAN Manager 1.0** dialect was modified in the [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) dialect to support files having 64-bit offsets. SMB_COM_LOCKING_ANDX is the preferred method of locking and unlocking byte ranges for clients that negotiate the **LAN Manager 1.0** dialect or later. The client MUST negotiate the NT LAN Manager or later dialect to access the support for 64-bit file offsets. + +This command is used to explicitly unlock a contiguous range of bytes in an open regular file. The byte range specified MUST be exactly the same as that specified in a previous successful lock request from the same CIFS client and process; the FID and PID MUST be the same as the lock request. An unlock request for a range that was not locked is treated as an error. + +If the server cannot immediately (within 200-300 milliseconds) grant the unlock on the byte range, an error MUST be returned to the client. Because this client request supports 32-bit offsets only, it is inappropriate for files that have 64-bit offsets. The client MUST have at least read access to the file. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- SHORT FID; +- ULONG CountOfBytesToUnlock; +- ULONG UnlockOffsetInBytes; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +**SMB_Header:** + +**TID (2 bytes):** This field MUST contain a valid **TID**, and the **TID** MUST be the same **TID** used in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) when the block range was locked. + +**UID (2 bytes):** This field MUST contain a valid UID, and the UID MUST be the same UID used in the SMB Header when the block range was locked. + +**PID (2 bytes):** This field MUST contain a valid **PID**, and the **PID** MUST be the same **PID** used in the SMB Header when the block range was locked. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | -------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data | | | | | | | | +| ... | | | | | | | | + +**SMB_Parameters (11 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x05. + +**Words (10 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | -------------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| FID | | | | | | | | | | | | | | | | CountOfBytesToUnlock | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | UnlockOffsetInBytes | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | + +**FID (2 bytes):** This field MUST be a valid 16-bit signed integer indicating the file from which the data MUST be read. + +**CountOfBytesToUnlock (4 bytes):** This field is a 32-bit unsigned integer indicating the number of contiguous bytes to be unlocked. + +**UnlockOffsetInBytes (4 bytes):** This field is a 32-bit unsigned integer indicating the offset, in number of bytes, from which to begin the unlock. Because this field is limited to 32-bits, this command is inappropriate for files that have 64-bit offsets. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | -------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | SMB_Data | | | | | | | | | | | | | | | | + +**SMB_Parameters (1 byte):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x00. No parameters are sent by this message. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| --------------- | -------------------------------- | --------------------------------------------------------------------------------------- | ---------------- | ----------------------------------------------------------------------- | +| ERRDOS (0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | EACCESS | File access rights do not match requested locks. | +| ERRDOS (0x01) | ERRbadfid

(0x0006) | STATUS_INVALID_HANDLE

(0xC0000008)

STATUS_SMB_BAD_FID

(0x00060001) | ENFILE | Attempt to read from a **FID** that the server does not have open. | +| ERRDOS (0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOLOCK | Insufficient server resources to place the lock. | +| ERRDOS (0x01) | ERRlock

(0x0021) | STATUS_FILE_LOCK_CONFLICT

(0xC0000054) | EACCESS | The intended byte range has already been locked by another process. | +| ERRDOS (0x01) | ERROR_NOT_LOCKED

(0x009E) | STATUS_RANGE_NOT_LOCKED

(0xC000007E) | | The byte range specified in an unlock request was not locked. | +| ERRSRV (0x02) | ERRerror

(0x0001) | | EBADF | A valid FID was rejected by the underlying system. | +| ERRSRV (0x02) | ERRerror

(0x0001) | | EDEADLK | The lock request would block and cause a deadlock with another process. | +| ERRSRV (0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. | +| ERRSRV (0x02) | ERRinvdevice

(0x0007) | STATUS_BAD_DEVICE_TYPE

(0xC00000CB) | | Attempt to lock a non-regular file such as a named pipe. | +| ERRSRV (0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | Invalid **TID** in request. | +| ERRSRV (0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** specified is not defined as a valid ID for this session | + +#### SMB_COM_CREATE_TEMPORARY (0x0E) + +This is an original **Core Protocol** command. This command is [**obsolescent**](#gt_8377951d-81ca-44a2-af83-2a6d6388c121). + +This command is used to create a file for temporary use by the client. The message includes the directory (see **DirectoryName** following) in which the client requests to create the temporary file. The server generates a file name that is unique within the supplied directory. The supplied directory MUST be relative to the supplied valid TID in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f). The client MUST have write permission on the directory in order to create the temporary file. If successful, the [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) returned by the server MAY be used in subsequent file operation messages. The client MUST supply this FID in subsequent operations on the temporary file. The file is opened in compatibility mode with read and write permissions for the client. The server does not automatically delete the temporary file after the client closes the file. The client MUST delete the file when it is no longer needed. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- SMB_FILE_ATTRIBUTES FileAttributes; +- UTIME CreationTime; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR BufferFormat; +- SMB_STRING DirectoryName; +- } +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ------------------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data (variable) | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (7 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x03. + +**Words (6 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ------------ | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| FileAttributes | | | | | | | | | | | | | | | | CreationTime | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | + +**FileAttributes (2 bytes):** This field SHOULD be ignored by the server. + +**CreationTime (4 bytes):** The time that the file was created, represented as the number of seconds since Jan 1, 1970, 00:00:00.0. + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be greater than or equal to 0x0002. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------ | --- | --- | --- | --- | --- | --- | --- | ------------------------ | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| BufferFormat | | | | | | | | DirectoryName (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**BufferFormat (1 byte):** This field MUST be 0x04. + +**DirectoryName (variable):** A null-terminated string that represents the fully qualified name of the directory relative to the supplied **TID** in which to create the temporary file. + +##### Response + +The response format is different from the original **Core Protocol**. For the original response format, refer to [\[SNIA\]](https://go.microsoft.com/fwlink/?LinkId=90519) or [\[XOPEN-SMB\]](https://go.microsoft.com/fwlink/?linkid=2297696). + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT FID; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR TemporaryFileName\[ByteCount\]; +- } +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ------------------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data (variable) | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (3 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x01. + +**Words (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| FID | | | | | | | | | | | | | | | | + +**FID (2 bytes):** The **FID** representing the file on the server. This value MUST be supplied in the **FID** field of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) in subsequent requests that manipulate the file. + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be greater than or equal to 0x0002. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ---------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| TemporaryFileName (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**TemporaryFileName (variable):** A null-terminated string that contains the temporary file name generated by the server.[<29>](#Appendix_A_29) The string SHOULD be a null-terminated array of ASCII characters. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ------------------------------ | ---------------------------------------------------------------------------------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRbadfile

(0x0002) | STATUS_NO_SUCH_FILE

(0xC000000F) | ENOENT | The named directory was not found. | +| ERRDOS

(0x01) | ERRbadpath

(0x0003) | STATUS_OBJECT_PATH_SYNTAX_BAD

(0xC000003B) | ENOENT | The file path syntax is invalid. | +| ERRDOS

(0x01) | ERRbadpath

(0x0003) | STATUS_OBJECT_PATH_INVALID

(0xC0000039) | ENOTDIR | A component of the path-prefix was not a directory. | +| ERRDOS

(0x01) | ERRnofids

(0x0004) | STATUS_OS2_TOO_MANY_OPEN_FILES

(0x00040001)

STATUS_TOO_MANY_OPENED_FILES

(0xC000011F) | EMFILE | Too many open files. No more **FIDs** available. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | EACCESS | A component of the path-prefix denied search permission OR requested access permission is denied for the directory. | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) DOS | ENOMEM | The server is out of resources. | +| ERRDOS

(0x01) | ERRinvalidname

(0x007B) | STATUS_OBJECT_NAME_COLLISION

(0xC00000BA) | | Temporary file could not be created because a unique name could not be generated. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. The wrong number of parameter bytes was sent. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | | EFAULT | Path points outside the allocated address space of the process. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | | EINTR | A signal was caught during the open operation. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | | ENXIO | Generic server open failure. | +| ERRSRV

(0x02) | ERRaccess

(0x0004) | STATUS_NETWORK_ACCESS_DENIED

(0xC00000CA) | | Permission conflict between requested permission and permissions for the shared resource: for example, open for write of a file in a read-only file system subtree. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** is no longer valid. | +| ERRSRV

(0x02) | ERRinvdevice

(0x0007) | STATUS_BAD_DEVICE_TYPE

(0xC00000CB) | | File creation request made to a share that is not a file system subtree. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0X005B0002) | | The **UID** supplied is not defined for the session, or the user identified by the **UID** does not have sufficient privileges. | +| ERRHRD

(0x03) | ERRnowrite

(0x0013) | STATUS_MEDIA_WRITE_PROTECTED

(0xC00000A2) | EROFS | Attempt to write to a read-only file system. | +| ERRHRD

(0x03) | ERRdata

(0x0017) | STATUS_DATA_ERROR

(0xC000003E) | EIO | Disk I/O error. | + +#### SMB_COM_CREATE_NEW (0x0F) + +This is an original **Core Protocol** command. This command is [**deprecated**](#gt_129acedf-ccf1-4e13-8df7-3bc59eff6f6d). Implementations SHOULD use SMB_COM_NT_CREATE_ANDX. + +This command is used to create a new file. It MUST NOT truncate or overwrite an existing file. If a file with the requested pathname already exits, the command MUST fail. This command MUST NOT be used to create directories or named pipes. + +The request message includes the pathname of the file relative to the supplied TID that the client requests to create. If the command is successful, the server response MUST include a valid FID. The client MUST supply the FID in subsequent operations on the file, such as read, write, lock, unlock, and close. The client MUST have write permission on the file's parent directory in order to create a new file. The client's access permissions on a newly created file MUST be read/write. The file is opened in read/write/compatibility mode. Server support of the client-supplied **CreationTime**(see section [2.2.4.16.1](#Section_2e4852f086724d62984842f931b91533)) is optional. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- SMB_FILE_ATTRIBUTES FileAttributes; +- UTIME CreationTime; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR BufferFormat; +- SMB_STRING FileName; +- } +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ------------------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data (variable) | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (7 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x03. + +**Words (6 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ------------ | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| FileAttributes | | | | | | | | | | | | | | | | CreationTime | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | + +**FileAttributes (2 bytes):** A 16-bit field of 1-bit flags that represent the file attributes to assign to the file if it is created successfully. + +**CreationTime (4 bytes):** The time that the file was created on the client, represented as the number of seconds since Jan 1, 1970, 00:00:00.0. + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be greater than or equal to 0x0002. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------ | --- | --- | --- | --- | --- | --- | --- | ------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| BufferFormat | | | | | | | | FileName (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**BufferFormat (1 byte):** MUST be 0x04, the format code for an SMB_STRING. + +**FileName (variable):** A null-terminated string that contains the fully qualified name of the file, relative to the supplied TID, to create on the server. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT FID; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | -------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data | | | | | | | | +| ... | | | | | | | | + +**SMB_Parameters (3 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x01. + +**Words (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| FID | | | | | | | | | | | | | | | | + +**FID (2 bytes):** The **FID** representing the file on the server. This value MUST be supplied in subsequent requests that manipulate the file. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ---------------------------- | -------------------------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRbadpath

(0x0003) | STATUS_OBJECT_PATH_SYNTAX_BAD

(0xC000003B) | ENOENT | The file path syntax is invalid. | +| ERRDOS

(0x01) | ERRbadpath

(0x0003) | STATUS_OBJECT_PATH_INVALID

(0xC0000039) | ENOTDIR | A component of the path-prefix was not a directory. | +| ERRDOS

(0x01) | ERRnofids

(0x0004) | STATUS_TOO_MANY_OPENED_FILES

(0xC000011F) | EMFILE | Too many open files; no more **FIDs** available. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | EACCESS | A component of the path-prefix denied search permission OR requested access permission is denied for the file OR open mode failure. | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRDOS

(0x01) | ERRfilexists

(0x0050) | STATUS_OBJECT_NAME_COLLISION

(0xC0000035) | EEXIST | The specified file already exists. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. Not enough parameter bytes were sent. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | | EFAULT | Path points outside the allocated address space of the process. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | | EINTR | A signal was caught during the open operation. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | | ENXIO | Generic server open failure. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_ACCESS_DENIED

(0xC0000022) | EROFS | Named file resides on read-only file system and requested access permission is write or read/write. | +| ERRSRV

(0x02) | ERRaccess

(0x0004) | STATUS_NETWORK_ACCESS_DENIED

(0xC00000CA) | | Permission conflict between requested permission and permissions for the shared resource: for example, open for write of a file in a read-only file system subtree. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** is no longer valid. | +| ERRSRV

(0x02) | ERRinvdevice

(0x0007) | STATUS_BAD_DEVICE_TYPE

(0xC00000CB) | | File creation request made to a share that is not a file system subtree. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** supplied is not defined for the session, or the user identified by the **UID** does not have sufficient privileges. | +| ERRHRD

(0x03) | ERRnowrite

(0x0013) | STATUS_MEDIA_WRITE_PROTECTED

(0xC00000A2) | EROFS | Attempt to write to a read-only file system. | +| ERRHRD

(0x03) | ERRdata

(0x0017) | STATUS_DATA_ERROR

(0xC000003E) | EIO | Disk I/O error. | + +#### SMB_COM_CHECK_DIRECTORY (0x10) + +This is an original **Core Protocol** command. + +This command is used to verify that a specified path resolves to a valid directory on the server. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR BufferFormat; +- SMB_STRING DirectoryName; +- } +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | ------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | SMB_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (1 byte):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x00. No parameters are sent by this message. + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be greater than or equal to 0x0002. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------ | --- | --- | --- | --- | --- | --- | --- | ------------------------ | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| BufferFormat | | | | | | | | DirectoryName (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**BufferFormat (1 byte):** This field MUST be 0x04. This is a buffer type indicator that identifies the next field as an SMB_STRING. + +**DirectoryName (variable):** A null-terminated character string giving the pathname to be tested. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | -------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | SMB_Data | | | | | | | | | | | | | | | | + +**SMB_Parameters (1 byte):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x00. No parameters are sent by this message. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | --------------------------- | -------------------------------------------------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRbadfile

(0x0002) | STATUS_NO_SUCH_FILE

(0xC000000F) | ENOENT | The directory was not found. | +| ERRDOS

(0x01) | ERRbadpath

(0x0003) | STATUS_OBJECT_PATH_NOT_FOUND

(0xC000003A) | ENOENT | The path does not exist or a component of the path is not a directory. | +| ERRDOS

(0x01) | ERRbadpath

(0x0003) | STATUS_OBJECT_PATH_SYNTAX_BAD

(0xC000003B) | ENOENT | The directory path syntax is invalid. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | EACCESS | A component of the path-prefix denied search permission. | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. Not enough parameter bytes were sent. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** is no longer valid. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** supplied is not known to the session, or the user identified by the **UID** does not have sufficient privileges. | +| ERRHRD

(0x03) | ERRdata

(0x0017) | STATUS_DATA_ERROR

(0xC000003E) | EIO | Disk I/O error. | + +#### SMB_COM_PROCESS_EXIT (0x11) + +This is an original **Core Protocol** command. This command is [**obsolescent**](#gt_8377951d-81ca-44a2-af83-2a6d6388c121). It was declared obsolete in the **LAN Manager 1.0** dialect (see [\[SMB-LM1X\]](https://go.microsoft.com/fwlink/?LinkId=164302)) but continues to be included in later documentation. [\[CIFS\]](https://go.microsoft.com/fwlink/?linkid=2109334) lists this command as obsolescent, and that designation is retained here. + +An SMB_COM_PROCESS_EXIT request is sent by the client to indicate the catastrophic failure of a client process. Upon receiving an SMB_COM_PROCESS_EXIT request, the server MUST close any resources owned by the Process ID (PID) listed in the request header. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- SMB_Data +- { +- USHORT ByteCount; +- } + +**SMB_Header:** + +**PIDLow (2 bytes):** The lowest-order two bytes of the process ID, as an unsigned short. + +**PIDHigh (2 bytes):** If 32-bit PID values are in use, this field MUST contain the two highest-order bytes. If the client is using 16-bit PIDs, then this field MUST be zero. + +The server MUST calculate the actual PID by multiplying the value of **SMB_Header.PIDHigh** by 2^16 and adding the result to the value of **SMB_Header.PIDLow**. + +In **Core Protocol**, open files (identified by [**FIDs**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766)) and any locks on those files were considered "owned" by the client process. Starting with the LAN Manager 1.0 dialect, FIDs are no longer associated with PIDs. The client MAY allow open file handles to be shared between multiple processes. CIFS clients SHOULD NOT send SMB_COM_PROCESS_EXIT requests. Instead, CIFS clients SHOULD perform all process cleanup operations, sending individual file close operations as needed. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | -------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | SMB_Data | | | | | | | | | | | | | | | | + +**SMB_Parameters (1 byte):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | + +**WordCount (1 byte):** MUST be 0x00. No parameters are sent. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** MUST be 0x0000. No data bytes are sent. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | -------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | SMB_Data | | | | | | | | | | | | | | | | + +**SMB_Parameters (1 byte):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | + +**WordCount (1 byte):** MUST be 0x00. No parameters are returned. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** MUST be 0x0000. No data bytes are returned. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | Description | +| -------------------- | ------------------------- | -------------------------------------- | --------------------------------------------------- | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | Invalid SMB. There is no session established. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | The **UID** supplied is not defined to the session. | + +#### SMB_COM_SEEK (0x12) + +This is an original **Core Protocol** command. This command is [**obsolescent**](#gt_8377951d-81ca-44a2-af83-2a6d6388c121). + +SMB_COM_SEEK is used to position a file pointer associated with an open [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) within a regular file. SMB_COM_SEEK can also be used to retrieve the current value of the file pointer, which is maintained by the server. The file pointer value returned in the SMB_COM_SEEK response is an unsigned 32-bit value, representing the absolute offset (in bytes) from the start of the file. It is possible to seek beyond the end of the file, but an attempt to seek to a negative offset (a position before the start of the file) sets the offset to zero (0). An offset of zero represents the start of the file. + +It is not necessary to use SMB_COM_SEEK to position the file pointer before sending a read or write request. CIFS read and write command requests contain an offset field. Read and write operations also change the value of the file pointer, setting it equal to the requested offset plus the number of bytes read or written. + +Since SMB_COM_SEEK is not required in order to set the file pointer before a read or write operation, its utility is fairly limited. It MAY be used to retrieve the current file pointer or, by seeking to the current end-of-file, to retrieve the file size. It is not appropriate for use with very large files (those that are near or above 4 gigabytes in size). + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT FID; +- USHORT Mode; +- LONG Offset; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | -------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | SMB_Data | | | | | | | | | | | | | | | | + +**SMB_Parameters (9 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x0004. + +**Words (8 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------ | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| FID | | | | | | | | | | | | | | | | Mode | | | | | | | | | | | | | | | | +| Offset | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**FID (2 bytes):** The File ID of the open file within which to seek. + +**Mode (2 bytes):** The seek mode. Possible values are as follows. + +| Value | Meaning | +| ------ | -------------------------------- | +| 0x0000 | Seek from the start of the file. | +| 0x0001 | Seek from the current position. | +| 0x0002 | Seek from the end of the file. | + +The "current position" is the offset specified in a previous seek request, or the offset plus data length specified in a previous read or write request, whichever is most recent. The next successful read, write, or seek command changes the position of the file pointer. + +**Offset (4 bytes):** A 32-bit signed long value indicating the file position, relative to the position indicated in **Mode**, to which to set the updated file pointer. The value of **Offset** ranges from -2 gigabytes to +2 gigabytes ((-2\*\*31) to (2\*\*31 -1) bytes).[<30>](#Appendix_A_30) + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- ULONG Offset; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | -------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | SMB_Data | | | | | | | | | | | | | | | | + +**SMB_Parameters (5 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x0002. + +**Words (4 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------ | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Offset | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Offset (4 bytes):** A 32-bit unsigned value indicating the absolute file position relative to the start of the file at which the file pointer is currently set. The value of **Offset** ranges from 0 to 4 gigabytes (0 to 2\*\*32 - 1 bytes). + +A seek that results in a file position value that cannot be expressed in 32 bits MUST set **Offset** to the least significant 32 bits.[<31>](#Appendix_A_31) + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +The response returns the new file pointer in **Offset**, expressed as the number of bytes from the start of the file. The **Offset** MAY be beyond the current end of file. An attempt to seek to before the start of file sets the current file pointer to the start of the file (0x00000000). + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| --------------- | ------------------------------- | --------------------------------------------------------------------------------------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | +| ERRDOS (0x01) | ERRbadfid

(0x0006) | STATUS_INVALID_HANDLE

(0xC0000008)

STATUS_SMB_BAD_FID

(0x00060001) | ENFILE | Invalid **FID**, or **FID** mapped to a valid server **FID**, but it was not acceptable to the operating system. | +| ERRDOS (0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRDOS (0x01) | ERReof

(0x0026) | STATUS_END_OF_FILE

(0xC0000011) | EEOF | The end of the file is beyond where the client can read; file is larger than 4GB. | +| ERRDOS (0x01) | ERRinvalidparam

(0x0057) | STATUS_INVALID_PARAMETER

(0xC000000D) | EEOF | The Mode field value is out of range. | +| ERRDOS (0x01) | ERRinvalidseek

(0x0083) | STATUS_OS2_NEGATIVE_SEEK

(0x00830001) | | An attempt was made to seek to a negative absolute offset within a file. | +| ERRSRV (0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | A corrupt SMB request was received. | +| ERRSRV (0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | Invalid **TID** in request. | +| ERRSRV (0x02) | ERRinvdevice (0x0007) | STATUS_BAD_DEVICE_TYPE

(0xC00000CB) | | Invalid file type. Attempt to seek in a non-regular file. | +| ERRSRV (0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** specified is not defined as a valid ID on this server session, or the user identified by the **UID** does not have sufficient privileges. | + +#### SMB_COM_LOCK_AND_READ (0x13) + +This command was introduced in the **CorePlus** dialect, but is often listed as part of the **LAN Manager 1.0** dialect. This command is [**deprecated**](#gt_129acedf-ccf1-4e13-8df7-3bc59eff6f6d). Clients SHOULD use the [SMB_COM_LOCKING_ANDX (section 2.2.4.32)](#Section_df492170a2e840d1b7d5eb29364047e1) command. + +This command is used to explicitly lock and read bytes from a regular file. The byte range requested is first locked and then read. The lock type is an exclusive read/write lock. If the server cannot immediately grant the lock on the byte range an error MUST be returned to the client. If the lock cannot be obtained the server SHOULD NOT read the bytes. + +The end of file condition is indicated by the server returning fewer bytes than the client has requested. A read request starting at or beyond the end of the file returns zero bytes. If a read requests more data than can be placed in a message of **MaxBufferSize** for the SMB connection, the server will abort the connection to the client. This client request is inappropriate for files having 64-bit offsets since it supports 32-bit offsets only. The client MUST have at least read access to the file. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT FID; +- USHORT CountOfBytesToRead; +- ULONG ReadOffsetInBytes; +- USHORT EstimateOfRemainingBytesToBeRead; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | -------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data | | | | | | | | +| ... | | | | | | | | + +**SMB_Parameters (11 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x05. + +**Words (10 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ------------------ | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| FID | | | | | | | | | | | | | | | | CountOfBytesToRead | | | | | | | | | | | | | | | | +| ReadOffsetInBytes | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| EstimateOfRemainingBytesToBeRead | | | | | | | | | | | | | | | | + +**FID (2 bytes):** This field MUST be a valid 16-bit unsigned integer indicating the file from which the data MUST be read. + +**CountOfBytesToRead (2 bytes):** This field is a 16-bit unsigned integer indicating the number of bytes to be read from the file. The client MUST ensure that the amount of data requested will fit in the negotiated maximum buffer size. + +**ReadOffsetInBytes (4 bytes):** This field is a 32-bit unsigned integer indicating the offset in number of bytes from which to begin reading from the file. The client MUST ensure that the amount of data requested fits in the negotiated maximum buffer size. Because this field is limited to 32 bits, this command is inappropriate for files that have 64-bit offsets. + +**EstimateOfRemainingBytesToBeRead (2 bytes):** This field is a 16-bit unsigned integer indicating the remaining number of bytes that the client has designated to be read from the file. This is an advisory field and can be zero. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT CountOfBytesReturned; +- USHORT Reserved\[4\]; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR BufferType; +- USHORT CountOfBytesRead; +- UCHAR Bytes\[CountOfBytesRead\]; +- } +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ------------------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data (variable) | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (11 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x05. + +**Words (10 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | -------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| CountOfBytesReturned | | | | | | | | | | | | | | | | Reserved | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | + +**CountOfBytesReturned (2 bytes):** The actual number of bytes returned to the client. This MUST be equal to **CountOfBytesToRead** unless the end of file was reached before reading **CountOfBytesToRead** bytes or the **ReadOffsetInBytes** pointed at or beyond the end of file. + +**Reserved (8 bytes):** Reserved. All bytes MUST be 0x00. + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0003 + CountOfBytesRead. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ---------- | --- | --- | --- | --- | --- | --- | --- | ---------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ---------------- | --- | --- | --- | --- | --- | ---------- | --- | +| BufferType | | | | | | | | CountOfBytesRead | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**BufferType (1 byte):** This field MUST be 0x01. + +**CountOfBytesRead (2 bytes):** The number of bytes read that are contained in the following array of bytes. + +**Bytes (variable):** The array of bytes read from the file. The array is not null-terminated. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ---------------------------- | ------------------------------------------------------------------------------------------------ | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRnoaccess

(0x0001) | STATUS_INVALID_DEVICE_REQUEST

(0xC0000010) | EINVAL | Attempt to lock a non-regular file such as a named pipe. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | EACCESS | File access rights do not match requested locks. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_ALREADY_COMMITTED

(0xC0000021) | ENOLCK | Attempt to read from a portion of the file that the server determines has been locked or has been opened in deny-read mode. | +| ERRDOS

(0x01) | ERRbadfid

(0x0006) | STATUS_INVALID_HANDLE

(0xC0000008)

STATUS_SMB_BAD_FID

(0x00060001) | ENFILE | Attempt to read from a FID that the server does not have open. | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRDOS

(0x01) | ERRbadaccess

(0x000C) | STATUS_ACCESS_DENIED

(0xC0000022) | | Read permission required. | +| ERRDOS

(0x01) | ERRlock

(0x0021) | STATUS_FILE_LOCK_CONFLICT

(0xC0000054) | EACCESS | The intended byte range has already been locked. | +| ERRDOS

(0x01) | ERRlock

(0x0021) | STATUS_FILE_LOCK_CONFLICT

(0xC0000054)

STATUS_LOCK_NOT_GRANTED

(0xC0000055) | EAGAIN | The requested byte range was already locked by a different process ([**PID**](#gt_38a420dd-6f31-456e-ae5c-63ec6905380d)). | +| ERRDOS

(0x01) | ERReof

(0x0026) | STATUS_END_OF_FILE

(0xC0000011) | | Attempted to read beyond the end of the file. | +| ERRSRV

(0x02) | ERRerror (0x0001) | STATUS_INVALID_SMB

(0x00010002) | | A corrupt or invalid request has been encountered. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | | EBADF | A valid FID was rejected by the underlying system. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | | EDEADLK | The lock request would block and cause a deadlock with another process. | +| ERRSRV

(0x02) | ERRinvdevice

(0x0007) | STATUS_BAD_DEVICE_TYPE

(0xC00000CB) | | Attempt to lock a non-regular file such as a named pipe. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | Invalid TID in request. | +| ERRSRV

(0x02) | ERRbaduid (0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** specified is not defined as a valid ID for this session, or the user identified by the **UID** does not have sufficient privileges. | +| ERRSRV

(0x02) | ERRmoredata

(0x00EA) | STATUS_BUFFER_OVERFLOW

(0x80000005) | | The number of bytes read from the named pipe exceeds the requested number of bytes. The data was returned to the client in the response. | +| ERRHRD

(0x03) | ERRdata

(0x0017) | STATUS_DATA_ERROR

(0xC000003E) | EIO | A problem has occurred in the physical I/O. | +| ERRHRD

(0x03) | ERRread

(0x001E) | | ENXIO | The device associated with the file descriptor is a block-special or character-special file and the value of the file pointer is out of range. | + +#### SMB_COM_WRITE_AND_UNLOCK (0x14) + +This command was introduced in the **CorePlus** dialect, but is often listed as part of the **LAN Manager 1.0** dialect. This command is [**deprecated**](#gt_129acedf-ccf1-4e13-8df7-3bc59eff6f6d). Clients SHOULD use the [SMB_COM_LOCKING_ANDX (section 2.2.4.32)](#Section_df492170a2e840d1b7d5eb29364047e1) command. + +The write and unlock command has the effect of writing to a range of bytes and then unlocking them. This command is usually associated with an earlier usage of [SMB_COM_LOCK_AND_READ (section 2.2.4.20)](#Section_88a423e782324b22904dd9e6cc0a226e) on the same range of bytes. The server's response field **CountOfBytesWritten** indicates the number of bytes actually written. + +Aside from the lack of special handling of zero-length writes, this request behaves in an identical fashion to the [SMB_COM_WRITE (section 2.2.4.12)](#Section_5f3ebf6a5d0643ee9429c8cc1b58eef5) command followed by a core protocol [SMB_COM_UNLOCK_BYTE_RANGE](#Section_3cfce68297d8499b8a2cef000f5d6b26) command. Support for this SMB command is optional. A server SHOULD set bit 0 in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) **Flags** field of the [SMB_COM_NEGOTIATE (section 2.2.4.52)](#Section_96ccc2bd67ba463abb73fd6a9265199e) response to indicate to the client that the command is supported. If the command sends a message of length greater than the **MaxBufferSize** for the **TID** specified, the server MAY abort the connection to the client. If an error occurs on the write, the bytes remain locked. + +This command supports only 32-bit offsets and is inappropriate for files having 64-bit offsets. The client SHOULD use [SMB_COM_WRITE_ANDX (section 2.2.4.43)](#Section_81aec3770ff44fc4bc568f05b70c3e42) to write to files requiring 64-bit file offsets. + +When **FID** represents a disk file and the request specifies a byte range beyond the current end of file, the file MUST be extended. Any bytes between the previous end of file and the requested offset are initialized to zero (0x00). When a write specifies a count of zero, the file is not truncated or extended to the length specified by the offset. + +The client MUST have at least write access to the file. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT FID; +- USHORT CountOfBytesToWrite; +- ULONG WriteOffsetInBytes; +- USHORT EstimateOfRemainingBytesToBeWritten; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { + +- UCHAR BufferFormat; +- USHORT DataLength; +- UCHAR Data\[DataLength\]; +- } +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ------------------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data (variable) | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (11 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x05. + +**Words (10 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ------------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| FID | | | | | | | | | | | | | | | | CountOfBytesToWrite | | | | | | | | | | | | | | | | +| WriteOffsetInBytes | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| EstimateOfRemainingBytesToBeWritten | | | | | | | | | | | | | | | | + +**FID (2 bytes):** This field MUST be a valid 16-bit unsigned integer indicating the file to which the data MUST be written. + +**CountOfBytesToWrite (2 bytes):** This field is a 16-bit unsigned integer indicating the number of bytes to be written to the file. The client MUST ensure that the amount of data sent can fit in the negotiated maximum buffer size. + +**WriteOffsetInBytes (4 bytes):** This field is a 32-bit unsigned integer indicating the offset, in number of bytes, from the beginning of the file at which to begin writing to the file. The client MUST ensure that the amount of data sent can fit in the negotiated maximum buffer size. Because this field is limited to 32 bits, this command is inappropriate for files that have 64-bit offsets. + +**EstimateOfRemainingBytesToBeWritten (2 bytes):** This field is a 16-bit unsigned integer indicating the remaining number of bytes that the client designates to write to the file. This is an advisory field and MAY be zero. This information can be used by the server to optimize cache behavior. + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be greater than or equal to 0x0003. The total value represents the size of the **BufferFormat** field in bytes plus the size of the **DataLength** field in bytes plus the value of the **CountOfBytesToWrite** field. See [Data Buffer Format Codes (section 2.2.2.5)](#Section_9189a82fc1c04af9818c85050f7e5e66) for a complete description of data buffer format codes and their usages. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------ | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --------------- | --- | --- | --- | --- | --- | ---------- | --- | +| BufferFormat | | | | | | | | DataLength | | | | | | | | | | | | | | | | Data (variable) | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**BufferFormat (1 byte):** This field MUST be 0x01. + +**DataLength (2 bytes):** This field MUST be **CountOfBytesToWrite**. + +**Data (variable):** The raw bytes to be written to the file. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT CountOfBytesWritten; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | -------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data | | | | | | | | +| ... | | | | | | | | + +**SMB_Parameters (3 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x01. + +**Words (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| CountOfBytesWritten | | | | | | | | | | | | | | | | + +**CountOfBytesWritten (2 bytes):** Indicates the actual number of bytes written to the file. For successful writes, this MUST equal the **CountOfBytesToWrite** in the client Request. If the number of bytes written differs from the number requested and no error is indicated, then the server has no resources available to satisfy the complete write. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| --------------- | -------------------------------- | ------------------------------------------------------------------------------------------------ | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| SUCCESS (0x00) | SUCCESS

(0x0000) | | EFBIG | The file has grown too large and no more data can be written to the file. A **CountOfBytesWritten** of zero (0x0000) MUST be returned to the client in the server response. This indicates to the client that the file system is full. | +| SUCCESS (0x00) | SUCCESS

(0x0000) | | NOSPC | No space on the file system. The server MUST return a zero (0x0000) in the **CountOfBytesWritten** field of the response. This indicates that the file system is full. | +| ERRDOS (0x01) | ERRnoaccess

(0x0005) | | EAGAIN | Resources for I/O on the server are temporarily exhausted. | +| ERRDOS (0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED

(0xC0000022)/td> | EACCESS | File access rights do not match requested locks. | +| ERRDOS (0x01) | ERRnoaccess

(0x0005) | STATUS_ALREADY_COMMITTED

(0xC0000021) | ENOLCK | A record lock has been taken on the file or the client has attempted to write to a portion of the file that the server detects has been locked, opened in deny-write mode, or opened in read-only mode. | +| ERRDOS (0x01) | ERRbadfid

(0x0006) | STATUS_INVALID_HANDLE

(0xC0000008)

STATUS_SMB_BAD_FID

(0x00060001) | ENFILE | Invalid **FID**, or **FID** mapped to a valid server **FID**, but it was not acceptable to the operating system. | +| ERRDOS (0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205)

STATUS_NO_MEMORY

(0xC0000017) | ENOMEM | The server is out of resources. | +| ERRDOS (0x01) | ERRbadaccess

(0x000C) | STATUS_ACCESS_DENIED

(0xC0000022) | | Write permission required. | +| ERRDOS (0x01) | ERRlock

(0x0021) | STATUS_FILE_LOCK_CONFLICT

(0xC0000054)

STATUS_LOCK_NOT_GRANTED

(0xC0000055) | | The requested byte range was already locked by a different process (**PID**). | +| ERRDOS (0x01) | ERROR_NOT_LOCKED

(0x009E) | STATUS_RANGE_NOT_LOCKED

(0xC000007E) | | The byte range specified in an unlock request was not locked. | +| ERRSRV (0x02) | ERRerror

(0x0001) | | EDEADLK | The write would block due to locking and deadlock would result. | +| ERRSRV (0x02) | ERRerror

(0x0001) | | ERANGE | Attempted write size is outside of the minimum or maximum ranges that can be written to the supplied **FID**. | +| ERRSRV (0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | A corrupt or invalid SMB request was received. | +| ERRSRV (0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | Invalid **TID** in request. | +| ERRSRV (0x02) | ERRinvdevice

(0x0007) | STATUS_BAD_DEVICE_TYPE

(0xC00000CB) | | Attempt to unlock a non-regular file such as a named pipe. | +| ERRSRV (0x02) | ERRqfull

(0x0031) | STATUS_PRINT_QUEUE_FULL

(0xC00000C6) | | Print queue is full - too many queued items. | +| ERRSRV (0x02) | ERRqtoobig

(0x0032) | STATUS_NO_SPOOL_SPACE

(0xC00000C7) | | Print queue is full - too many queued items. | +| ERRSRV (0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** specified is not defined as a valid ID on this server session, or the user identified by the **UID** does not have sufficient privileges. | +| ERRHRD (0x03) | ERRdata

(0x0017) | STATUS_DATA_ERROR

(0xC000003E) | EIO | A problem has occurred in the physical I/O. | +| ERRHRD (0x03) | ERRwrite

(0x001D) | | ENXIO | The device associated with the file descriptor is a block-special or character-special file and the value of the file pointer is out of range. | +| ERRHRD (0x03) | ERRdiskfull

(0x0027) | STATUS_DISK_FULL

(0xC000007F) | ENOSPC | The file system is full. | + +#### SMB_COM_READ_RAW (0x1A) + +This command was introduced in the **CorePlus** dialect, but is often listed as part of the **LAN Manager 1.0** dialect. This command is [**deprecated**](#gt_129acedf-ccf1-4e13-8df7-3bc59eff6f6d). Clients SHOULD use the SMB_COM_READ_ANDX command. + +The server indicates support by setting the CAP_RAW_MODE capabilities bit in the SMB_COM_NEGOTIATE response. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT FID; +- ULONG Offset; +- USHORT MaxCountOfBytesToReturn; +- USHORT MinCountOfBytesToReturn; +- ULONG Timeout; +- USHORT Reserved; +- ULONG OffsetHigh (optional); +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| SMB_Data | | | | | | | | | | | | | | | | + +**SMB_Parameters (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ---------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be either 0x08 or 0x0A. + +**Words (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ----------------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| FID | | | | | | | | | | | | | | | | Offset | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | MaxCountOfBytesToReturn | | | | | | | | | | | | | | | | +| MinCountOfBytesToReturn | | | | | | | | | | | | | | | | Timeout | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | Reserved | | | | | | | | | | | | | | | | +| OffsetHigh | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**FID (2 bytes**): This field MUST be a valid 16-bit signed integer indicating the file from which the data MUST be read. + +**Offset (4 bytes):** The offset, in bytes, from the start of the file at which the read MUST begin. This is the lower 32 bits of a 64-bit value if the WordCount is 0x0A. + +**MaxCountOfBytesToReturn (2 bytes):** The requested maximum number of bytes to read from the file and return to the client. The value MAY exceed the negotiated buffer size. + +**MinCountOfBytesToReturn (2 bytes):** The requested minimum number of bytes to read from the file and return to the client. This field is used only when reading from a named pipe or a device. It is ignored when reading from a standard file. + +**Timeout (4 bytes):** The number of milliseconds that the server is requested to wait while processing this command. This field is optionally honored only when reading from a named pipe or I/O device. It does not apply when reading from a regular file. + +**Reserved (2 bytes):** This field SHOULD be set to 0x0000. + +**OffsetHigh (4 bytes):** This field is optional, and is included only when WordCount is 0x0A. This field is the upper 32 bits of the offset, in bytes, from the start of the file at which the read MUST start. This field allows the client request to specify 64-bit file offsets. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** The length in bytes of the remaining SMB_Data. This field MUST be 0x0000. + +##### Response + +The server MUST not return the typical response data when responding to this request. The server MUST respond with one message containing the raw data being read from the file or named pipe. The server relies on the transport layer to provide the client with the length, in bytes, of the received message. This enables the client to request up to 65,535 bytes of data and receive it directly into an arbitrary buffer space. The amount of data requested is expected to be larger than the negotiated buffer size for this session. If the client request is to read more bytes than the file or named pipe contains, the size of the returned server message MUST be the number of bytes actually read from the file or named pipe. When the number of bytes returned to the client in the unformatted raw message is less than the bytes requested, this outcome indicates to the client that the end of file (EOF) has been reached. + +Because the server does not return the typical response data, the SMB Protocol cannot guarantee that the client can associate the server response data (message) with the correct corresponding client request. Therefore, the client MUST guarantee that there are and will be no other requests from the client to the server for the duration of the [SMB_COM_READ_RAW (section 2.2.4.22)](#Section_a8c3a184272c4168bbb2dcc621c503a0) command's processing. + +Because the server does not provide the typical response data, it cannot provide error information when an error occurs. In the event of an error, the server MUST return zero bytes to the client. The client is then responsible for issuing an alternative file I/O command request that provides the typical server response data. The client SHOULD send [SMB_COM_READ_ANDX (section 2.2.4.42)](#Section_129aa093574b483ea55ddf334606a622) to determine the cause of the error. The server MUST then respond with the appropriate status and error information. It is up to the client to take appropriate action to recover from the error. Care needs to be taken when interpreting the server returning 0 bytes to the client, because this condition is also used to indicate that the EOF has been reached. + +#### SMB_COM_READ_MPX (0x1B) + +This is command was introduced in the **LAN Manager 1.0** dialect. This command is [**obsolescent**](#gt_8377951d-81ca-44a2-af83-2a6d6388c121). The command was redesigned for [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a). This document describes only the NT LAN Manager behavior. See section [2.1.2.1](#Section_f33a2e37706347ffaeb428de05c9857e) for more information. + +This is a specialized read command intended to maximize the performance of reading large blocks of data from a regular file while allowing for other operations to take place between the client and the server. This command is valid only when using a multiplexed session (see section [2.1.3](#Section_402e87ee4cff49ed817b88e8ef0d13cb)). The server MUST respond to the command request with one or more response messages until the requested amount of data has been returned or an error occurs. Each server response MUST contain the **TID**, **UID**, **PID**, **MID** and **CID** of the original client request and the **Offset** and **Count** describing the returned data (see the Response format following). + +The client has received all of the data bytes when the sum of the **DataLength** fields received in each response equals the total amount of data bytes expected (the smallest **Count** received). This allows the protocol to work even if the responses are received out of sequence. + +As is true in SMB_COM_READ, the total number of bytes returned can be less than the number requested only if a read specifies bytes beyond the current file size and [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) refers to a disk file. In this case, only the bytes that exist MUST be returned. A read completely beyond the end of file MUST result in a single response with a **Count** value of 0x0000. If the total number of bytes returned is less than the number of bytes requested, this indicates end of file (if reading other than a standard blocked disk file, only zero bytes returned indicates end of file). + +Once started, the Read Block Multiplexed operation is expected to go to completion. The client is expected to receive all the responses generated by the server. Conflicting commands (such as file close) MUST NOT be sent to the server while a multiplexed operation is in progress. + +This command supports 32-bit file offsets only. Servers MAY[<32>](#Appendix_A_32) support this command. If the server supports this command, it MUST set the CAP_MPX_MODE (0x00000002) bit in the **Capabilities** field of the response to SMB Protocol negotiation on connectionless transports. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT FID; +- ULONG Offset; +- USHORT MaxCountOfBytesToReturn; +- USHORT MinCountOfBytesToReturn; +- ULONG Timeout; +- USHORT Reserved; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +[SMB_Header](#Section_69a29f73de0c45a6a1aa8ceeea42217f)**:** + +**CID (2 bytes):** This field MUST contain the Connection ID (CID) of the connectionless transport session. + +**MID (2 bytes):** This field MUST contain a valid MID that MUST be unique to this request within the client's session. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | -------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters (17 bytes) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | SMB_Data | | | | | | | | | | | | | | | | + +**SMB_Parameters (17 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ---------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words (16 bytes) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x08. The length, in two-byte words, of the remaining SMB_Parameters. + +**Words (16 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ----------------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| FID | | | | | | | | | | | | | | | | Offset | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | MaxCountOfBytesToReturn | | | | | | | | | | | | | | | | +| MinCountOfBytesToReturn | | | | | | | | | | | | | | | | Timeout | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | Reserved | | | | | | | | | | | | | | | | + +**FID (2 bytes):** This field MUST be a valid 16-bit unsigned integer indicating the file from which the data MUST be read. + +**Offset (4 bytes):** The offset, in bytes, from the start of the file at which the read begins. + +**MaxCountOfBytesToReturn (2 bytes):** The requested maximum number of bytes to read from the file and return to the client. The value MAY exceed the negotiated buffer size. + +**MinCountOfBytesToReturn (2 bytes):** The requested minimum number of bytes to read from the file and return to the client. This field is used only when reading from a named pipe or a device. It MUST be ignored when reading from a standard file. + +**Timeout (4 bytes):** The number of milliseconds that the server is requested to wait while processing this command. This field is optionally honored only when reading from a named pipe or I/O device. It does not apply when reading from a regular file. + +**Reserved (2 bytes):** This field SHOULD be set to 0x0000. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- ULONG Offset; +- USHORT Count; +- USHORT Remaining; +- USHORT DataCompactionMode; +- USHORT Reserved; +- USHORT DataLength; +- USHORT DataOffset; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR Pad\[\]; +- UCHAR Data\[DataLength\]; +- } +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | ------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters (17 bytes) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | SMB_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (17 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ---------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words (16 bytes) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x08. The length, in two-byte words, of the remaining **SMB_Parameters**. + +**Words (16 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------ | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Offset | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Count | | | | | | | | | | | | | | | | Remaining | | | | | | | | | | | | | | | | +| DataCompactionMode | | | | | | | | | | | | | | | | Reserved | | | | | | | | | | | | | | | | +| DataLength | | | | | | | | | | | | | | | | DataOffset | | | | | | | | | | | | | | | | + +**Offset (4 bytes):** The offset, in bytes, from the start of the file at which the read occurred. + +**Count (2 bytes):** The total number of bytes designated to be returned in all responses to this request. This value usually starts at **MaxCountOfBytesToReturn**, but can be an overestimate. The overestimate can be reduced while the read is in progress. The last response generated by the server MUST contain the actual total number of bytes read and sent to the client in all of the responses. If the value in the last response is less than **MaxCountOfBytesToReturn**, the end of file was encountered during the read. If this value is exactly zero (0x0000), the original **Offset** into the file began at or after the end of file; in this case, only one response MUST be generated. The value of the field can (and usually does) exceed the negotiated buffer size. + +**Remaining (2 bytes):** This integer MUST be -1 for regular files. For I/O devices or named pipes, this indicates the number of bytes remaining to be read from the file after the bytes returned in the response were de-queued. Servers SHOULD return 0xFFFF if they do not support this function on I/O devices or named pipes. + +**DataCompactionMode (2 bytes):** Not used and MUST be 0x0000. + +**Reserved (2 bytes):** This field MUST be set to 0x0000. + +**DataLength (2 bytes):** This field is the number of bytes read and included in the response. The value of this field MUST NOT cause the message to exceed the client's maximum buffer size as specified in **MaxBufferSize** of the [SMB_COM_SESSION_SETUP_ANDX (section 2.2.4.53)](#Section_d902407ce73b46f58f9ea2de2b6085a2) client request. + +**DataOffset (2 bytes):** The offset, in bytes, from the beginning of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) to the start of the **Buffer** field in the **SMB_Data**.block. + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** The length, in bytes, of the remaining SMB_Data. The length MUST be between **DataLength** and **DataLength** + 0x0003. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Pad (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Buffer (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Pad (variable):** Padding bytes to align data on a proper address boundary. The **DataOffset** field points to the first byte after this field. + +**Buffer (variable):** The bytes read from the file. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ---------------------------- | ------------------------------------------------------------------------------------------------ | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_ALREADY_COMMITTED

(0xC0000021) | ENOLCK | Attempt to read from a portion of the file that the server detects has been locked or has been opened in deny-read. | +| ERRDOS

(0x01) | ERRbadfid

(0x0006) | STATUS_INVALID_HANDLE

(0xC0000008)

STATUS_SMB_BAD_FID

(0x00060001) | ENFILE | Attempt to read from a FID that the server does not have open. | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRDOS

(0x01) | ERRbadaccess

(0x000C) | STATUS_ACCESS_DENIED

(0xC0000022) | | Read permission required. | +| ERRDOS

(0x01) | ERRlock

(0x0021) | STATUS_FILE_LOCK_CONFLICT

(0xC0000054)

STATUS_LOCK_NOT_GRANTED

(0xC0000055) | EAGAIN | The requested byte range was already locked by a different process ([**PID**](#gt_38a420dd-6f31-456e-ae5c-63ec6905380d)). | +| ERRDOS

(0x01) | ERReof

(0x0026) | STATUS_END_OF_FILE

(0xC0000011) | | Attempted to read beyond the end of the file. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | | EBADF | The FID was validated by the server but unacceptable to the system. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | | EDEADLK | The read would block and deadlock would result. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | A corrupt request has been encountered. | +| ERRSRV

(0x02) | ERRinvdevice

(0x0007) | STATUS_BAD_DEVICE_TYPE

(0xC00000CB) | | Attempt to read from an open spool file. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | Invalid TID in request. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** specified is not defined as a valid ID for this session, or the user identified by the **UID** does not have sufficient privileges. | +| ERRSRV

(0x02) | ERRuseSTD

(0x00FB) | STATUS_SMB_USE_STD

(0x00FB0002) | | This command is not supported for the FID at this time. Use a standard read command. | +| ERRHRD

(0x03) | ERRdata

(0x0017) | STATUS_DATA_ERROR

(0xC000003E) | EIO | A problem has occurred in the physical I/O. | +| ERRHRD

(0x03) | ERRread

(0x001E) | | ENXIO | The device associated with the file descriptor is a block-special or character-special file and the value of the file pointer is out of range. | + +#### SMB_COM_READ_MPX_SECONDARY (0x1C) + +This command was introduced in the **LAN Manager 1.0** dialect (see [\[SMB-LM1X\]](https://go.microsoft.com/fwlink/?LinkId=164302) section 9.2.13). It was rendered obsolete in the [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) dialect. + +This command is no longer used in conjunction with the SMB_COM_READ_MPX command. Clients SHOULD NOT send requests using this command code. Servers receiving requests with this command code SHOULD return STATUS_NOT_IMPLEMENTED (ERRDOS/ERRbadfunc).[<33>](#Appendix_A_33) + +#### SMB_COM_WRITE_RAW (0x1D) + +This command was introduced in the **CorePlus** dialect, but is often listed as part of the **LAN Manager 1.0** dialect. This command is [**deprecated**](#gt_129acedf-ccf1-4e13-8df7-3bc59eff6f6d). Clients SHOULD use the [SMB_COM_WRITE_ANDX (section 2.2.4.43)](#Section_81aec3770ff44fc4bc568f05b70c3e42) command. + +Server support of this command is optional. The server MUST indicate support for Raw Read/Write using the CAP_RAW_MODE Capabilities bit during protocol negotiation. + +SMB_COM_WRITE_RAW is a specialized write command intended to maximize performance when writing large blocks of data to an open regular file, a named pipe, a device, or spooled output. The command permits a client to send a large unformatted data (raw byte) message over the [**SMB transport**](#gt_f8b0f8a6-e412-459a-b8ba-219008e5bcd7) without requiring the usual SMB request format. It also permits a client to send messages in excess of the maximum buffer size established during session setup. + +The server MUST accept an unformatted data message of up to 65,535 bytes in length. The server MUST allow the client [SMB_COM_WRITE_RAW Request (section 2.2.4.25.1)](#Section_1ff2a25fefe2470ca780b06ef46c4089) to include an unformatted message. The client MAY send part of the data to be written along with the SMB_COM_WRITE_RAW Request. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT FID; +- USHORT CountOfBytes; +- USHORT Reserved1; +- ULONG Offset; +- ULONG Timeout; +- USHORT WriteMode; +- ULONG Reserved2; +- USHORT DataLength; +- USHORT DataOffset; +- ULONG OffsetHigh (optional); +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Words +- { +- UCHAR Pad\[\]; +- UCHAR Data\[DataLength\]; +- } +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| SMB_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ---------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x0C or 0x0E + +**Words (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ------------ | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| FID | | | | | | | | | | | | | | | | CountOfBytes | | | | | | | | | | | | | | | | +| Reserved1 | | | | | | | | | | | | | | | | Offset | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | Timeout | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | WriteMode | | | | | | | | | | | | | | | | +| Reserved2 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| DataLength | | | | | | | | | | | | | | | | DataOffset | | | | | | | | | | | | | | | | +| OffsetHigh | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**FID (2 bytes):** This field MUST be a valid 16-bit unsigned integer indicating the file, named pipe, or device to which the data MUST be written. + +**CountOfBytes (2 bytes):** The total number of bytes to be written to the file during the entire [**dialog**](#gt_71ad645f-db5b-4e9f-9b3d-887039ada331). The value MAY exceed the maximum buffer size (**MaxBufferSize**) established for the session. + +**Reserved1 (2 bytes):** This field is reserved and MUST be ignored by the server. + +**Offset (4 bytes):** The offset, in bytes, from the start of the file at which the write SHOULD begin. If **WordCount** is 0x0E, this is the lower 32 bits of a 64-bit value. + +**Timeout (4 bytes):** This field is the time-out, in milliseconds, to wait for the write to complete. This field is optionally honored only when writing to a named pipe or I/O device. It does not apply and MUST be 0x00000000 when writing to a regular file. + +**WriteMode (2 bytes):** A 16-bit field containing flags defined as follows. The flag names below are provided for reference only. + +| Name and bitmask | Meaning | +| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| WritethroughMode

0x0001 | If set, the server MUST NOT respond to the client before the data is written to disk (write-through). | +| ReadBytesAvailable

0x0002 | If set, the server SHOULD set the Interim Response **Response.SMB_Parameters.Available** field correctly for writes to named pipes or I/O devices. | +| NamedPipeRaw

0x0004 | Applicable to named pipes only. If set, the named pipe MUST be written to in raw mode (no translation; the opposite of [**message mode**](#gt_c49a48e8-f1ac-4568-bc87-0672eb08868b)). | +| NamedPipeStart

0x0008 | Applicable to named pipes only. If set, this data is the start of a message. | + +If **WritethroughMode** is not set, this SMB is assumed to be a form of write behind (cached write). The [**SMB transport**](#gt_f8b0f8a6-e412-459a-b8ba-219008e5bcd7) layer guarantees delivery of raw data from the client. If an error occurs at the server end, all bytes MUST be received and discarded. If an error occurs while writing data to disk (such as disk full) the next access to the file handle (another write, close, read, etc.) MUST result in an error, reporting this situation. + +If **WritethroughMode** is set, the server MUST receive the data, write it to disk and then send a Final Server Response (section [2.2.4.25.3](#Section_f767334e77244f41b5df31b56d3b4328)) indicating the result of the write. The total number of bytes successfully written MUST also be returned in the **SMB_Parameters.Count** field of the response. + +**Reserved2 (4 bytes):** This field MUST be 0x00000000. + +**DataLength (2 bytes):** This field is the number of bytes included in the SMB_Data block that are to be written to the file. + +**DataOffset (2 bytes):** This field is the offset, in bytes, from the start of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) to the start of the data to be written to the file from the **Data\[\]** field. Specifying this offset allows the client to efficiently align the data buffer. + +**OffsetHigh (4 bytes):** If **WordCount** is 0x0E, this is the upper 32 bits of the 64-bit offset in bytes from the start of the file at which the write MUST start. Support of this field is optional. + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be greater than or equal to 0x0000. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Pad (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Pad (variable):** Padding bytes for the client to align the data on an appropriate boundary for transfer of the SMB transport. The server MUST ignore these bytes. + +**Data (variable):** The bytes to be written to the file. + +##### Interim Server Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT Available; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | -------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data | | | | | | | | +| ... | | | | | | | | + +**SMB_Parameters (3 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x01. + +**Words (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Available | | | | | | | | | | | | | | | | + +**Available (2 bytes):** This field is valid when writing to [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca) or I/O devices. This field indicates the number of bytes remaining to be written after the requested write was completed. If the client writes to a disk file, this field MUST be set to 0xFFFF.[<34>](#Appendix_A_34) + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +##### Final Server Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT Count; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +[SMB_Header](#Section_69a29f73de0c45a6a1aa8ceeea42217f)**:** + +**Command (1 byte):** This field MUST contain the [SMB_COM_WRITE_COMPLETE (section 2.2.4.28)](#Section_1e82640ccd3149ee972984b30ee1132c) command code of 0x20. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | -------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data | | | | | | | | +| ... | | | | | | | | + +**SMB_Parameters (3 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x01. + +**Words (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Count | | | | | | | | | | | | | | | | + +**Count (2 bytes):** This field contains the total number of bytes written to the file by the server. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| --------------- | ------------------------------- | ------------------------------------------------------------------------------------------------ | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| SUCCESS (0x00) | SUCCESS

(0x0) | STATUS_SUCCESS

(0x00000000) | EFBIG | The file has grown too large and no more data can be written to the file. A **Count** of zero (0x0000) MUST be returned to the client in the server response. This indicates to the client that the file system is full. | +| SUCCESS (0x00) | SUCCESS

(0x0) | STATUS_SUCCESS

(0x00000000) | NOSPC | No space on the file system. The server MUST return a zero (0x0000) in the **Count** field of the response. This indicates that the file system is full. | +| ERRDOS (0x01) | ERRnoaccess

(0x0005) | | EAGAIN | Resources for I/O on the server are temporarily exhausted. | +| ERRDOS (0x01) | ERRnoaccess

(0x0005) | STATUS_ALREADY_COMMITTED

(0xC0000021) | ENOLCK | A record lock has been taken on the file or the client has attempted to write to a portion of the file that the server knows has been locked, opened in deny-write mode, or opened in read-only mode. | +| ERRDOS (0x01) | ERRbadfid

(0x0006) | STATUS_INVALID_HANDLE

(0xC0000008)

STATUS_SMB_BAD_FID

(0x00060001) | ENFILE | Invalid FID, or FID mapped to a valid server FID but it was not acceptable to the operating system. | +| ERRDOS (0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRDOS (0x01) | ERRbadaccess

(0x000C) | STATUS_ACCESS_DENIED

(0xC0000022) | | Write permission required. The UID provided does not have write permission on the specified [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766). | +| ERRDOS (0x01) | ERRlock

(0x0021) | STATUS_FILE_LOCK_CONFLICT

(0xC0000054)

STATUS_LOCK_NOT_GRANTED

(0xC0000055) | | The requested byte range was already locked by a different process (PID). | +| ERRDOS (0x01) | ERRnotconnected

(0x00E9) | STATUS_PIPE_DISCONNECTED

(0xC00000B0) | EPIPE | Write to a named pipe with no reader. | +| ERRSRV (0x02) | ERRerror

(0x0001) | | EDEADLK | The write would block due to locking and deadlock would result. | +| ERRSRV (0x02) | ERRerror

(0x0001) | | ERANGE | Attempted write size is outside of the minimum or maximum ranges that can be written to the supplied FID. | +| ERRSRV (0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | A corrupt SMB request was received. In addition to other causes, this status is sent if the value of the **DataLength** field is invalid with respect to either the **CountOfBytes** field or the number of bytes in the **SMB_Data_Bytes.Data** field. | +| ERRSRV (0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | Invalid **TID** in request. | +| ERRSRV (0x02) | ERRqfull

(0x0031) | STATUS_PRINT_QUEUE_FULL

(0xC00000C6) | | Print queue is full - too many queued items. | +| ERRSRV (0x02) | ERRqtoobig

(0x0032) | STATUS_NO_SPOOL_SPACE

(0xC00000C7) | | Print queue is full - too many queued items. | +| ERRSRV (0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** specified is not known as a valid ID on this server session, or the user identified by the **UID** does not have sufficient privileges. | +| ERRSRV (0x02) | ERRusestd

(0x00FB) | STATUS_SMB_USE_STANDARD

(0x00FB0002) | | Write MPX support is not available. Use a standard write request. | +| ERRHRD (0x03) | ERRdata

(0x0017) | STATUS_DATA_ERROR

(0xC000003E) | EIO | A problem has occurred in the physical I/O. | +| ERRHRD (0x03) | ERRwrite

(0x001D) | | ENXIO | The device associated with the file descriptor is a block-special or character-special file and the value of the file pointer is out of range. | +| ERRHRD (0x03) | ERRdiskfull

(0x0027) | STATUS_DISK_FULL

(0xC000007F) | ENOSPC | The file system is full. | + +#### SMB_COM_WRITE_MPX (0x1E) + +This command was introduced in the **LAN Manager 1.0** dialect and is [**obsolescent**](#gt_8377951d-81ca-44a2-af83-2a6d6388c121). The command was redesigned for [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a). This document describes only the NT LAN Manager behavior. See section [2.1.2.1](#Section_f33a2e37706347ffaeb428de05c9857e) for more information. + +SMB_COM_WRITE_MPX is used to maximize performance when writing a large block of data from the client to the server. This command is valid only when using a multiplexed session over a connectionless transport; see section [2.1.3](#Section_402e87ee4cff49ed817b88e8ef0d13cb). The **TID**, **PID**, **UID**, **MID**, and **CID** MUST be identical in all requests and responses in a given SMB_COM_WRITE_MPX exchange. + +This command supports 32-bit file offsets only. Server support of this command is optional. If the server supports this command, it MUST set the CAP_MPX_MODE bit in the **Capabilities** field of the response to SMB Protocol negotiation.[<35>](#Appendix_A_35) + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT FID; +- USHORT TotalByteCount; +- USHORT Reserved; +- ULONG ByteOffsetToBeginWrite; +- ULONG Timeout; +- USHORT WriteMode; +- ULONG RequestMask; +- USHORT DataLength; +- USHORT DataOffset; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR Pad\[\]; +- UCHAR Buffer\[DataLength\]; +- } +- } + +[SMB_Header](#Section_69a29f73de0c45a6a1aa8ceeea42217f)**:** + +**SequenceNumber (2 bytes):** This field MUST be zero (0x0000) unless the request is the last request in the multiplexed write sequence, in which case it MUST be a nonzero value. The nonzero value indicates to the server that this is the last request of the sequence and the server MUST respond by sending an [SMB_COM_WRITE_MPX Response (section 3.2.5.19)](#Section_2dc811a7539d4970b143393d4786bb7e). + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | ------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters (25 bytes) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | SMB_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (25 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ---------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words (24 bytes) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x0C. The length, in two-byte words, of the remaining **SMB_Parameters**. + +**Words (24 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| FID | | | | | | | | | | | | | | | | TotalByteCount | | | | | | | | | | | | | | | | +| Reserved | | | | | | | | | | | | | | | | ByteOffsetToBeginWrite | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | Timeout | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | WriteMode | | | | | | | | | | | | | | | | +| RequestMask | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| DataLength | | | | | | | | | | | | | | | | DataOffset | | | | | | | | | | | | | | | | + +**FID (2 bytes):** This field MUST be a valid 16-bit unsigned integer indicating the file to which the data is to be written. + +**TotalByteCount (2 bytes):** The requested total number of bytes to write to the file. The value MAY exceed the negotiated buffer size. + +**Reserved (2 bytes):** The server MUST ignore this value. + +**ByteOffsetToBeginWrite (4 bytes):** The offset, in bytes, from the start of the file at which the write is to begin. This value indicates the offset at which to write the data contained in the **SMB_Data.Bytes.Buffer** field of the same message. + +**Timeout (4 bytes):** This field MUST be ignored by the server.[<36>](#Appendix_A_36) + +**WriteMode (2 bytes):** A 16-bit field containing flags defined as follows. + +| Name and bitmask | Meaning | +| -------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| WritethroughMode

0x0001 | If set, the server MUST NOT respond to the client before the data is written to disk. | +| ConnectionlessMode

0x0080 | If set, this flag indicates that messages are being sent over a connectionless transport. This flag MUST be set. | + +If **WritethroughMode** is not set, the server is assumed to be performing a form of write behind (cached writing). The [**SMB transport**](#gt_f8b0f8a6-e412-459a-b8ba-219008e5bcd7) layer guarantees delivery of all secondary requests from the client. If an error occurs at the server end, all bytes received MUST be ignored and discarded. If an error such as disk full occurs while writing data to disk, the next access of the file handle (another write, close, read, and so on). MUST return the fact that the error occurred. The value of this error status MUST be the same for all requests that are part of the same write operation. + +If **WritethroughMode** is set, the server MUST receive the data, write it to disk, and then send a final response indicating the result of the write. + +**RequestMask (4 bytes):** This field is a bit mask indicating this SMB request's identity to the server. The server's response MUST contain the logical OR of all of the **RequestMask** values received. This response MUST be generated. + +**DataLength (2 bytes):** This field value is the number of data bytes included in this request. + +**DataOffset (2 bytes):** This field value is the offset, in bytes, from the start of the SMB Header (section 2.2.3.1) to the start of the data buffer. + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be greater than or equal to 0x0001. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Pad (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Buffer (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Pad (variable):** Null padding bytes to align **Buffer** to a 16- or 32-bit boundary. + +**Buffer (variable):** The raw data, in bytes, that is to be written to the file. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- ULONG ResponseMask; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | -------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | SMB_Data | | | | | | | | | | | | | | | | + +**SMB_Parameters (5 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x02. + +**Words (4 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------ | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ResponseMask | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ResponseMask (4 bytes):** This field is the logical OR-ing of the **RequestMask** value contained in each [SMB_COM_WRITE_MPX (section 2.2.4.26)](#Section_ab9a94409c2249fd859e2fd81c57e9d9) received since the last sequenced SMB_COM_WRITE_MPX. The server responds only to the final (sequenced) command. This response contains the accumulated **ResponseMask** from all successfully received requests. The client uses the **ResponseMask** received to determine which packets, if any, MUST be retransmitted. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +**Error Codes** + +If the **WritethroughMode** flag is clear in the client requests (particularly the sequenced request), the server SHOULD return a response upon receiving the sequenced request. Any data not yet written MUST be written after the response has been sent. Any errors generated after the server has sent the SMB_COM_WRITE_MPX response MUST be saved and returned the next time that the [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) is referenced. + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| --------------- | ---------------------------- | --------------------------------------------------------------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| SUCCESS (0x00) | SUCCESS

(0x0) | STATUS_SUCCESS

(0x00000000) | EFBIG | The file has grown too large and no more data can be written to the file. A **Count** of zero (0x0000) MUST be returned to the client in the server response. This indicates to the client that the file system is full. | +| SUCCESS (0x00) | SUCCESS

(0x0) | STATUS_SUCCESS

(0x00000000) | NOSPC | No space on the file system. The server MUST return a zero (0x0000) in the **Count** field of the response. This indicates that the file system is full. | +| ERRDOS (0x01) | ERRnoaccess

(0x0005) | | EAGAIN | Resources for I/O on the server are temporarily exhausted. | +| ERRDOS (0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | | The client does not have write permission. | +| ERRDOS (0x01) | ERRbadfid

(0x0006) | STATUS_INVALID_HANDLE

(0xC0000008)

STATUS_SMB_BAD_FID

(0x00060001) | ENFILE | Invalid FID, or FID mapped to a valid server FID but it was not acceptable to the operating system. | +| ERRDOS (0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRDOS (0x01) | ERRbadaccess

(0x000C) | STATUS_ACCESS_DENIED

(0xC0000022) | | Write permission required. | +| ERRDOS (0x01) | ERRlock

(0x0021) | STATUS_FILE_LOCK_CONFLICT

(0xC0000054) | | The requested byte range was already locked by a different process (PID). | +| ERRSRV (0x02) | ERRerror

(0x0001) | | EDEADLK | The write would block due to locking and deadlock would result. | +| ERRSRV (0x02) | ERRerror

(0x0001) | | ERANGE | Attempted write size is outside of the minimum or maximum ranges that can be written to the supplied FID. | +| ERRSRV (0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | A corrupt or invalid SMB request was received. | +| ERRSRV (0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | Invalid TID in request. | +| ERRSRV (0x02) | ERRqfull

(0x0031) | STATUS_PRINT_QUEUE_FULL

(0xC00000C6) | | Print queue is full - too many queued items. | +| ERRSRV (0x02) | ERRqtoobig

(0x0032) | STATUS_NO_SPOOL_SPACE

(0xC00000C7) | | Print queue is full - too many queued items. | +| ERRSRV (0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** specified is not known as a valid ID on this server session, or the user identified by the **UID** does not have sufficient privileges. | +| ERRSRV (0x02) | ERRuseSTD

(0x00FB) | STATUS_SMB_USE_STANDARD

(0x00FB0002) | | Not a datagram or connectionless transport OR the FID is not a disk file OR print queue client MUST use standard write commands. | +| ERRHRD (0x03) | ERRdata

(0x0017) | STATUS_DATA_ERROR

(0xC000003E) | EIO | A problem has occurred in the physical I/O. | +| ERRHRD (0x03) | ERRwrite

(0x001D) | | ENXIO | The device associated with the file descriptor is a block-special or character-special file and the value of the file pointer is out of range. | +| ERRHRD (0x03) | ERRgeneral

(0x001F) | STATUS_CANCELLED

(0xC0000120) | | A transport error occurred and the request was canceled. | +| ERRHRD (0x03) | ERRdiskfull

(0x0027) | STATUS_DISK_FULL

(0xC000007F) | ENOSPC | The file system is full. | + +#### SMB_COM_WRITE_MPX_SECONDARY (0x1F) + +This command was introduced in the **LAN Manager 1.0** dialect (see [\[SMB-LM1X\]](https://go.microsoft.com/fwlink/?LinkId=164302) section 9.2.22). It was rendered [**obsolete**](#gt_73fb9153-adab-4f17-b472-426f982e360c) in the [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) dialect. + +This command is no longer used in conjunction with the [SMB_COM_WRITE_MPX (section 2.2.4.26)](#Section_ab9a94409c2249fd859e2fd81c57e9d9) command. Clients SHOULD NOT send requests using this command code, and servers receiving requests with this command code SHOULD return STATUS_NOT_IMPLEMENTED (ERRDOS/ERRbadfunc).[<37>](#Appendix_A_37) + +#### SMB_COM_WRITE_COMPLETE (0x20) + +This command was introduced in **LAN Manager 1.0** dialect (see [\[SMB-LM1X\]](https://go.microsoft.com/fwlink/?LinkId=164302) section 9.2.22). This command is [**deprecated**](#gt_129acedf-ccf1-4e13-8df7-3bc59eff6f6d). This command is sent by the server as the final response of an [SMB_COM_WRITE_RAW (section 2.2.4.25)](#Section_5feebf73e3b34bbda4497aea0a4cf87e) command sequence. + +#### SMB_COM_QUERY_SERVER (0x21) + +This command was introduced in the **NT LAN Manager** dialect, and was reserved but not implemented. + +Clients SHOULD NOT send requests using this command code, and servers receiving requests with this command code SHOULD return STATUS_NOT_IMPLEMENTED (ERRDOS/ERRbadfunc).[<38>](#Appendix_A_38) + +#### SMB_COM_SET_INFORMATION2 (0x22) + +This command was introduced in the **LAN Manager 1.0** dialect. This command is [**deprecated**](#gt_129acedf-ccf1-4e13-8df7-3bc59eff6f6d). New client implementations SHOULD use the [SMB_COM_TRANSACTION2 (section 2.2.4.46)](#Section_3d9d8f3edc70410da3fc6f4a881e8cab) subcommand [TRANS2_SET_FILE_INFORMATION (section 2.2.6.9)](#Section_cb2b7f2138774bc5adf4b78c8aa2a717). + +This command MAY be sent by a client to set attribute information about an open file. The client MUST provide a valid **FID** in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f). The **FID** SHOULD have been acquired through a previously successful use of one of the SMB commands for opening a file. The client MUST have at least write permission on the file. The target file is updated from the values specified in the request. This command allows the client to set more attribute information for the file than the [SMB_COM_SET_INFORMATION (section 2.2.4.10)](#Section_e3cd0acdaa844fbf8c9d3e7d3bb3fd52) command. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT FID; +- SMB_DATE CreateDate; +- SMB_TIME CreationTime; +- SMB_DATE LastAccessDate; +- SMB_TIME LastAccessTime; +- SMB_DATE LastWriteDate; +- SMB_TIME LastWriteTime; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | -------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters (15 bytes) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data | | | | | | | | +| ... | | | | | | | | + +**SMB_Parameters (15 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ---------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words (14 bytes) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x07. + +**Words (14 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | -------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| FID | | | | | | | | | | | | | | | | CreateDate | | | | | | | | | | | | | | | | +| CreateTime | | | | | | | | | | | | | | | | LastAccessDate | | | | | | | | | | | | | | | | +| LastAccessTime | | | | | | | | | | | | | | | | LastWriteDate | | | | | | | | | | | | | | | | +| LastWriteTime | | | | | | | | | | | | | | | | + +**FID (2 bytes):** This is the FID representing the file for which attributes are to be set. + +**CreateDate (2 bytes):** This is the date when the file was created. + +**CreateTime (2 bytes):** This is the time on **CreateDate** when the file was created. + +**LastAccessDate (2 bytes):** This is the date when the file was last accessed. + +**LastAccessTime (2 bytes):** This is the time on **LastAccessDate** when the file was last accessed. + +**LastWriteDate (2 bytes):** This is the date when data was last written to the file. + +**LastWriteTime (2 bytes):** This is the time on **LastWriteDate** when data was last written to the file. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | -------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | SMB_Data | | | | | | | | | | | | | | | | + +**SMB_Parameters (1 byte):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x00. No parameters are sent by this message. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ---------------------------- | --------------------------------------------------------------------------------------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | EACCESS | Access denied, no write access. | +| ERRDOS

(0x01) | ERRbadfid

(0x0006) | STATUS_INVALID_HANDLE

(0xC0000008)

STATUS_SMB_BAD_FID

(0x00060001) | ENFILE | The FID supplied is invalid. | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. Not enough parameter bytes were sent. | +| ERRSRV

(0x02) | ERRerror (0x0001) | | EINTR | The operation was interrupted by the system. | +| ERRSRV

(0x02) | ERRaccess

(0x0004) | STATUS_NETWORK_ACCESS_DENIED

(0xC00000CA) | EACCESS | Write access denied on a portion of the shared path. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | The TID is no longer valid. | +| ERRSRV

(0x02) | ERRinvdevice

(0x0007) | STATUS_BAD_DEVICE_TYPE

(0xC00000CB) | | The FID does not specify a disk resource; printer or other. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** supplied is not known to the session, or the user identified by the **UID** does not have sufficient privileges. | +| ERRHRD

(0x03) | ERRnowrite

(0x0013) | STATUS_MEDIA_WRITE_PROTECTED

(0xC00000A2) | EROFS | The FID supplied is on write-protected media. | +| ERRHRD

(0x03) | ERRdata

(0x0017) | STATUS_DATA_ERROR

(0xC000003E) | EIO | Disk I/O error. | + +#### SMB_COM_QUERY_INFORMATION2 (0x23) + +This command was introduced in the **LAN Manager 1.0** dialect. This command is [**deprecated**](#gt_129acedf-ccf1-4e13-8df7-3bc59eff6f6d). New client implementations SHOULD use the SMB_COM_TRANSACTION2 subcommand TRANS2_QUERY_FILE_INFORMATION. + +This command MAY be sent by a client to obtain attribute information about an open file. The client MUST provide a valid **FID** in the SMB Request. The FID SHOULD have been acquired through a previously successful use of one of the SMB commands for opening a file. This command provides more information about the file than the SMB_COM_QUERY_INFORMATION command. The server response is limited to providing a 32-bit file size in bytes and is inappropriate for files exceeding that size. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT FID; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | -------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data | | | | | | | | +| ... | | | | | | | | + +**SMB_Parameters (3 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x01. + +**Words (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| FID | | | | | | | | | | | | | | | | + +**FID (2 bytes):** This field MUST be a valid FID that the client has obtained through a previous SMB command that successfully opened the file. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- SMB_DATE CreateDate; +- SMB_TIME CreationTime; +- SMB_DATE LastAccessDate; +- SMB_TIME LastAccessTime; +- SMB_DATE LastWriteDate; +- SMB_TIME LastWriteTime; +- ULONG FileDataSize; +- ULONG FileAllocationSize; +- SMB_FILE_ATTRIBUTES FileAttributes; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | -------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters (23 bytes) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data | | | | | | | | +| ... | | | | | | | | + +**SMB_Parameters (23 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ---------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words (22 bytes) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x0B. + +**Words (22 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------ | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | -------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| CreateDate | | | | | | | | | | | | | | | | CreateTime | | | | | | | | | | | | | | | | +| LastAccessDate | | | | | | | | | | | | | | | | LastAccessTime | | | | | | | | | | | | | | | | +| LastWriteDate | | | | | | | | | | | | | | | | LastWriteTime | | | | | | | | | | | | | | | | +| FileDataSize | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| FileAllocationSize | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| FileAttributes | | | | | | | | | | | | | | | | + +**CreateDate (2 bytes):** This field is the date when the file was created. + +**CreateTime (2 bytes):** This field is the time on **CreateDate** when the file was created. + +**LastAccessDate (2 bytes):** This field is the date when the file was last accessed. + +**LastAccessTime (2 bytes):** This field is the time on **LastAccessDate** when the file was last accessed. + +**LastWriteDate (2 bytes):** This field is the date when data was last written to the file. + +**LastWriteTime (2 bytes):** This field is the time on **LastWriteDate** when data was last written to the file. + +**FileDataSize (4 bytes):** This field contains the number of bytes in the file, in bytes. Because this size is limited to 32 bits, this command is inappropriate for files whose size is too large. + +**FileAllocationSize (4 bytes):** This field contains the allocation size of the file, in bytes. Because this size is limited to 32 bits, this command is inappropriate for files whose size is too large. + +**FileAttributes (2 bytes):** This field is a 16-bit unsigned bit field encoding the attributes of the file. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | --------------------------- | --------------------------------------------------------------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------ | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | EPERM | Access denied, no read permission on FID. | +| ERRDOS

(0x01) | ERRbadfid

(0x0006) | STATUS_INVALID_HANDLE

(0xC0000008)

STATUS_SMB_BAD_FID

(0x00060001) | ENFILE | The FID supplied is not valid. | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. Not enough parameter bytes were sent. | +| ERRSRV

(0x02) | ERRaccess

(0x0004) | STATUS_NETWORK_ACCESS_DENIED

(0xC00000CA) | EACCESS | A component in the path denied the required permission. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** is no longer valid. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** supplied is not defined to the session, or the user identified by the **UID** does not have sufficient privileges. | +| ERRHRD

(0x03) | ERRdata

(0x0017) | STATUS_DATA_ERROR

(0xC000003E) | EIO | Disk I/O error. | + +#### SMB_COM_LOCKING_ANDX (0x24) + +This is command was introduced in the **LAN Manager 1.0** dialect. The **LAN Manager 1.0** version of this command is not compatible with files that have greater than 32-bit offsets. The support for files that have 64-bit offsets was introduced into this command in the [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) dialect. + +This command is used to explicitly lock and/or unlock a contiguous range of bytes in a regular file. More than one non-overlapping byte range can be locked and/or unlocked on an open file. Locks prevent attempts to lock, read, or write the locked portion of the file by other processes using a separate file handle (FID). Any process using the same [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) specified in the request that obtained the lock has access to the locked bytes. + +SMB_COM_LOCKING_ANDX (section 2.2.4.32) is also used by the server to send OpLock break notification messages to the client, and by the client to acknowledge the OpLock break. This is the one instance in the CIFS Protocol in which the server sends a request. + +The following are the commands that can follow an SMB_COM_LOCKING_ANDX (section 2.2.4.32) in an AndX chain: + +- [SMB_COM_CLOSE (section 2.2.4.5)](#Section_10059dd2ae0a48a2a95ca92505e9145f) +- [SMB_COM_FLUSH (section 2.2.4.6)](#Section_32acdf03011d4e93b169a787f21dc13d) +- SMB_COM_LOCKING_ANDX +- [SMB_COM_READ (section 2.2.4.11)](#Section_b88922ddb18e46e09f7408eaace9a95c) +- [SMB_COM_READ_ANDX (section 2.2.4.42)](#Section_129aa093574b483ea55ddf334606a622) +- [SMB_COM_WRITE (section 2.2.4.12)](#Section_5f3ebf6a5d0643ee9429c8cc1b58eef5) +- [SMB_COM_WRITE_ANDX (section 2.2.4.43)](#Section_81aec3770ff44fc4bc568f05b70c3e42) + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- UCHAR AndXCommand; +- UCHAR AndXReserved; +- USHORT AndXOffset; +- USHORT FID; +- UCHAR TypeOfLock; +- UCHAR NewOpLockLevel; +- ULONG Timeout; +- USHORT NumberOfRequestedUnlocks; +- USHORT NumberOfRequestedLocks; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- LOCKING_ANDX_RANGE Unlocks\[NumberOfRequestedUnlocks\]; +- LOCKING_ANDX_RANGE Locks\[NumberOfRequestedLocks\]; +- } +- } + +**SMB_Header: Flags** (1 byte): If the server sends an OpLock Break Notification to a client holding an OpLock, the SMB_FLAGS_REPLY bit (0x80) MUST be clear (0) to indicate that the message is a request. This is the only instance in the protocol in which the server sends a request message. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | ------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters (17 bytes) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | SMB_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (17 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ---------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words (16 bytes) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x08. + +**Words (16 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------ | --- | --- | --- | --- | --- | --- | --- | ------------ | --- | ---------- | --- | --- | --- | --- | --- | ---------------------- | --- | --- | --- | ---------- | --- | --- | --- | -------------- | --- | --- | --- | --- | --- | ---------- | --- | +| AndXCommand | | | | | | | | AndXReserved | | | | | | | | AndXOffset | | | | | | | | | | | | | | | | +| FID | | | | | | | | | | | | | | | | TypeOfLock | | | | | | | | NewOpLockLevel | | | | | | | | +| Timeout | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| NumberOfRequestedUnlocks | | | | | | | | | | | | | | | | NumberOfRequestedLocks | | | | | | | | | | | | | | | | + +**AndXCommand (1 byte):** The command code for the next SMB command in the packet. This value MUST be set to 0xFF if there are no additional SMB commands in the client request packet. + +**AndXReserved (1 byte):** A reserved field. This MUST be set to 0x00 when this request is sent, and the server MUST ignore this value when the message is received. + +**AndXOffset (2 bytes):** This field MUST be set to the offset, in bytes, from the start of the [SMB_Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) to the start of the WordCount field in the next SMB command in this packet. This field is valid only if the **AndXCommand** field is not set to 0xFF. If **AndXCommand** is 0xFF, this field MUST be ignored by the server. + +**FID (2 bytes):** This field MUST be a valid 16-bit unsigned integer indicating the file from which the data SHOULD be read. + +**TypeOfLock (1 byte):** This field is an 8-bit unsigned integer bit mask indicating the nature of the lock request and the format of the **LOCKING*ANDX***RANGE data. If the negotiated protocol is [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) or later, CAP_LARGE_FILES was negotiated and LARGE_FILES bit is set, then the **Locks** and **Unlocks** arrays are in the large file 64-bit offset **LOCKING_ANDX_RANGE** format. This allows specification of 64-bit offsets for very large files. + +If **TypeOfLock** has the SHARED_LOCK bit set, the lock is specified as a shared read-only lock. If shared read-only locks cannot be supported by a server, the server SHOULD map the lock to an exclusive lock for both read and write. Locks for both read and write messages in which **TypeOfLock** bit READ_WRITE_LOCK is set SHOULD be prohibited by the server, and the server SHOULD return an implementation-specific error to the client. If **TypeOfLock** has the CHANGE_LOCKTYPE bit set, the client is requesting that the server atomically change the lock type from a shared lock to an exclusive lock, or vice versa. If the server cannot do this in an atomic fashion, the server MUST reject this request and return an implementation-specific error to the client. Closing a file with locks still in force causes the locks to be released in a nondeterministic order. + +If the **Locks** vector contains one and only one entry (**NumberOfRequestedLocks** == 1) and **TypeOfLock** has the **CANCEL_LOCK** bit set, the client is requesting that the server cancel a previously requested but unacknowledged lock. This allows the client to cancel lock requests that can wait forever to complete (see **Timeout** below). + +| Lock type and bitmask | Meaning | +| --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| READ_WRITE_LOCK

0x00 | Request for an exclusive read and write lock. | +| SHARED_LOCK

0x01 | Request for a shared read-only lock. | +| OPLOCK_RELEASE

0x02 | When sent from the server to the client in an OpLock Break Notification, this bit indicates to the client that an OpLock change has occurred on the **FID** supplied in the request. The client MUST set this bit when sending the OpLock Break Request message acknowledging the OpLock Break. | +| CHANGE_LOCKTYPE

0x04 | Request to atomically change the lock type from a shared lock to an exclusive lock or vice versa for the specified **Locks**.[<39>](#Appendix_A_39) | +| CANCEL_LOCK

0x08 | Request to cancel all outstanding lock requests for the specified **FID** and **PID**.[<40>](#Appendix_A_40) | +| LARGE_FILES

0x10 | Indicates that the **LOCKING_ANDX_RANGE** format is the 64-bit file offset version. If this flag is not set, then the **LOCKING_ANDX_RANGE** format is the 32-bit file offset version. | + +**NewOpLockLevel (1 byte):** This field is valid only in [SMB_COM_LOCKING_ANDX (0x24) (section 2.2.4.32)](#Section_df492170a2e840d1b7d5eb29364047e1) SMB requests sent from the server to the client in response to a change in an existing OpLock's state. This field is an 8-bit unsigned integer indicating the OpLock level now in effect for the **FID** in the request. If NewOpLockLevel is 0x00, the client possesses no OpLocks on the file at all. If **NewOpLockLevel** is 0x01, then the client possesses a Level II OpLock. + +**Timeout (4 bytes):** This field is a 32-bit unsigned integer value. **Timeout** is the maximum amount of time to wait, in milliseconds, for the byte range(s) specified in **Locks** to become locked. A **Timeout** value of 0x00000000 indicates that the server fails immediately if any lock range specified is already locked and cannot be locked by this request. A **Timeout** value of -1 (0xFFFFFFFF) indicates that the server waits as long as it takes (wait forever) for each byte range specified to become unlocked so that it can be locked by this request. Any other value of **Timeout** specifies the maximum number of milliseconds to wait for all lock ranges specified in **Locks** to become available and to be locked by this request. + +**NumberOfRequestedUnlocks (2 bytes):** This field is a 16-bit unsigned integer value containing the number of entries in the **Unlocks** array. + +**NumberOfRequestedLocks (2 bytes):** This field is a 16-bit unsigned integer value containing the number of entries in the **Locks** array. + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be greater than or equal to 0x0000. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------ | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Unlocks (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Locks (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Unlocks (variable):** An array of byte ranges to be unlocked. If 32-bit offsets are being used, this field uses **LOCKING_ANDX_RANGE32** (see below) and is (10 \* **NumberOfRequestedUnlocks**) bytes in length. If 64-bit offsets are being used, this field uses **LOCKING_ANDX_RANGE64** (see below) and is (20 \* **NumberOfRequestedUnlocks**) bytes in length. + +**Locks (variable):** An array of byte ranges to be locked. If 32-bit offsets are being used, this field uses **LOCKING_ANDX_RANGE32** (see following) and is (10 \* **NumberOfRequestedLocks**) bytes in length. If 64-bit offsets are being used, this field uses **LOCKING_ANDX_RANGE64** (see following) and is (20 \* **NumberOfRequestedLocks**) bytes in length. + +The **LOCKING_ANDX_RANGE32** data type has the following structure. + +- LOCKING_ANDX_RANGE32 +- { +- USHORT PID; +- ULONG ByteOffset; +- ULONG LengthInBytes; +- } + +**PID** **(2 bytes):** The [**PID**](#gt_38a420dd-6f31-456e-ae5c-63ec6905380d) of the process requesting the locking change. + +**ByteOffset** **(4 bytes):** The 32-bit unsigned integer value that is the offset into the file at which the locking change MUST begin. + +**LengthInBytes** **(4 bytes):** The 32-bit unsigned integer value that is the number of bytes, beginning at **OffsetInBytes**, that MUST be locked or unlocked. + +The **LOCKING_ANDX_RANGE64** data type has the following structure. + +- LOCKING_ANDX_RANGE64 +- { +- USHORT PID; +- USHORT Pad; +- ULONG ByteOffsetHigh; +- ULONG ByteOffsetLow; +- ULONG LengthInBytesHigh; +- ULONG LengthInBytesLow; +- } + +**PID** **(2 bytes):** The PID of the process requesting the locking change. + +**Pad** **(2 bytes):** This field pads the structure to DWORD alignment and MUST be zero (0x0000). + +**OffsetInBytesHigh** **(4 bytes):** The 32-bit unsigned integer value that is the high 32 bits of a 64-bit offset into the file at which the locking change MUST begin. + +**OffsetInBytesLow** **(4 bytes):** The 32-bit unsigned integer value that is the low 32 bits of a 64-bit offset into the file at which the locking change MUST begin. + +**LengthInBytesHigh** **(4 bytes):** The 32-bit unsigned integer value that is the high 32 bits of a 64-bit value specifying the number of bytes that MUST be locked or unlocked. + +**LengthInBytesLow** **(4 bytes):** The 32-bit unsigned integer value that is the low 32 bits of a 64-bit value specifying the number of bytes that MUST be locked or unlocked. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- UCHAR AndXCommand; +- UCHAR AndXReserved; +- UCHAR AndXOffset; +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | -------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | SMB_Data | | | | | | | | | | | | | | | | + +**SMB_Parameters (5 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x02. + +**Words (4 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------- | --- | --- | --- | --- | --- | --- | --- | ------------ | --- | ---------- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| AndXCommand | | | | | | | | AndXReserved | | | | | | | | AndXOffset | | | | | | | | | | | | | | | | + +**AndXCommand (1 byte):** The command code for the next SMB command in the packet. This value MUST be set to 0xFF if there are no additional SMB command responses in the server response packet. + +**AndXReserved (1 byte):** A reserved field. This MUST be set to 0x00 when this response is sent, and the client MUST ignore this field. + +**AndXOffset (2 bytes):** This field MUST be set to the offset, in bytes, from the start of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) to the start of the WordCount field in the next SMB command response in this packet. This field is valid only if the AndXCommand field is not set to 0xFF. If AndXCommand is 0xFF, this field MUST be ignored by the client. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ------------------------------------ | --------------------------------------------------------------------------------------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | +| ERRDOS (0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | EACCESS | File access rights do not match requested locks. | +| ERRDOS (0x01) | ERRbadfid

(0x0006) | STATUS_INVALID_HANDLE

(0xC0000008)

STATUS_SMB_BAD_FID

(0x00060001) | ENFILE | Attempt to read from a **FID** that the server does not have open. | +| ERRDOS (0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | Insufficient server resources to place the lock. | +| ERRDOS (0x01) | ERRlock

(0x0021) | STATUS_FILE_LOCK_CONFLICT

(0xC0000054) | EACCESS | The intended byte range has already been locked. | +| ERRDOS (0x01) | ERRlock

(0x0021) | | ENOLOCK | Insufficient server resources to place the lock. | +| ERRDOS (0x01) | ERROR_NOT_LOCKED

(0x009E) | STATUS_RANGE_NOT_LOCKED

(0xC000007E) | | The byte range specified in an unlock request was not locked. | +| ERRDOS (0x01) | ERROR_CANCEL_VIOLATION

0x00AD | STATUS_OS2_CANCEL_VIOLATION

0x00AD0001 | | No lock request was outstanding for the supplied cancel region. | +| ERRSRV (0x02) | ERRerror

(0x0001) | | EBADF | A valid **FID** was rejected by the underlying system. | +| ERRSRV (0x02) | ERRerror

(0x0001) | | EDEADLK | The lock request would block and cause a deadlock with another process. | +| ERRSRV (0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. Not enough parameter bytes were sent or the ANDX command is invalid. | +| ERRSRV (0x02) | ERRinvdevice

(0x0007) | STATUS_BAD_DEVICE_TYPE

(0xC00000CB) | | Attempt to lock a non-regular file such as a named pipe. | +| ERRSRV (0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | Invalid **TID** in request. | +| ERRSRV (0x02) | ERRbaduid (0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** specified is not defined as a valid ID for this session, or the user identified by the **UID** does not have sufficient privileges. | +| ERRHRD

(0x03) | ERRdata

(0x0017) | STATUS_DATA_ERROR

(0xC000003E) | EIO | Disk I/O error. | + +#### SMB_COM_TRANSACTION (0x25) + +This command was introduced in the **LAN Manager 1.0** dialect. + +This command serves as the transport for the Transaction Subprotocol Commands. These commands operate on mailslots and named pipes, which are interprocess communication endpoints within the [**CIFS**](#gt_fb37399e-d72d-41b6-b073-086da2d96e09) file system. If the size in bytes of the request exceeds the **MaxBufferSize** established during session setup, then the transaction MUST use the [SMB_COM_TRANSACTION_SECONDARY (section 2.2.4.34)](#Section_a4c643871dc445fbb01f9ad8b69e83e1) SMB to send the additional command data. + +Transaction Subprotocol Command messages can exceed the maximum size of a single SMB message as determined by the value of the **MaxBufferSize** session parameter. If this is the case, then the client MUST use one or more [SMB_COM_TRANSACTION_SECONDARY Requests (section 2.2.4.34.1)](#Section_79ece32a139d46b0ba28055f822a8c05) to transfer the transaction **SMB_Data.Trans_Data** and **SMB_Data.Trans_Parameter** bytes that did not fit in the initial message. + +The client indicates that it has not sent all of the **SMB_Data.Trans_Data** bytes by setting **DataCount** to a value less than **TotalDataCount**. Similarly, if **ParameterCount** is less than **TotalParameterCount**, the client has more **SMB_Data.Trans_Parameters** bytes to send. Parameter bytes SHOULD take precedence over Data bytes, and clients SHOULD attempt to send as many bytes as possible in each message. Servers SHOULD be prepared, however, to accept **SMB_Data.Trans_Parameters** and **SMB_Data.Trans_Data** bytes in any order, in large or small amounts. + +For both the request and the response, the position and length of the **SMB_Data.Trans_Parameters** and **SMB_Data.Trans_Data** fields is determined by the values of the **SMB_Parameters.ParameterOffset**, **SMB_Parameters.ParameterCount**, **SMB_Parameters.DataOffset**, and **SMB_Parameters.DataCount** fields. In addition, the **SMB_Parameters.ParameterDisplacement** and **SMB_Parameters.DataDisplacement** fields can be used to change the order in which subranges of bytes are transferred. Servers SHOULD transfer bytes in order and give precedence to **SMB_Data.Trans_Parameters** bytes. Clients SHOULD be prepared to reconstruct transaction **SMB_Data.Trans_Parameters** and **SMB_Data.Trans_Data**, regardless of the order or locations in which they are delivered. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT TotalParameterCount; +- USHORT TotalDataCount; +- USHORT MaxParameterCount; +- USHORT MaxDataCount; +- UCHAR MaxSetupCount; +- UCHAR Reserved1; +- USHORT Flags; +- ULONG Timeout; +- USHORT Reserved2; +- USHORT ParameterCount; +- USHORT ParameterOffset; +- USHORT DataCount; +- USHORT DataOffset; +- UCHAR SetupCount; +- UCHAR Reserved3; +- USHORT Setup\[SetupCount\]; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- SMB_STRING Name; +- UCHAR Pad1\[\]; +- UCHAR Trans_Parameters\[ParameterCount\]; +- UCHAR Pad2\[\]; +- UCHAR Trans_Data\[DataCount\]; +- } +- } + +**SMB_Header:** + +The **PID**, **MID**, **TID**, and **UID** MUST be the same for all requests and responses that are part of the same transaction. + +**TID (2 bytes):** If the transaction request is being sent as a class 2 mailslot message, this field MUST have a value of 0xFFFF. The mailslot receiver MAY ignore the TID in the request. In all other cases, this field MUST contain a valid TID. The TID MUST refer to the IPC\$ share. + +**UID (2 bytes):** If the transaction request is being sent as a class 2 mailslot message, this field MUST have a value of 0xFFFF. The mailslot receiver MAY ignore the UID in the request. In all other cases, this field MUST contain a valid UID. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| SMB_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (variable):** + +The SMB_Parameters section of the [SMB_COM_TRANSACTION](#Section_0ed1ad9fab964a7ab94a0915f3796781) request contains the information to manage the transaction along with flags and setup information that provide the context for the execution of the operation on the server. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ---------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be **Words.SetupCount** (see below) plus 14 (0x0E). This value represents the total number of parameter words and MUST be greater than or equal to 14 (0x0E). + +**Words (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------- | --- | --- | --- | --- | --- | --- | --- | --------- | --- | ---------- | --- | --- | --- | --- | --- | -------------- | --- | --- | --- | ---------- | --- | --- | --- | --------- | --- | --- | --- | --- | --- | ---------- | --- | +| TotalParameterCount | | | | | | | | | | | | | | | | TotalDataCount | | | | | | | | | | | | | | | | +| MaxParameterCount | | | | | | | | | | | | | | | | MaxDataCount | | | | | | | | | | | | | | | | +| MaxSetupCount | | | | | | | | Reserved1 | | | | | | | | Flags | | | | | | | | | | | | | | | | +| Timeout | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Reserved2 | | | | | | | | | | | | | | | | ParameterCount | | | | | | | | | | | | | | | | +| ParameterOffset | | | | | | | | | | | | | | | | DataCount | | | | | | | | | | | | | | | | +| DataOffset | | | | | | | | | | | | | | | | SetupCount | | | | | | | | Reserved3 | | | | | | | | +| Setup (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**TotalParameterCount (2 bytes):** The total number of transaction parameter bytes the client expects to send to the server for this request. Parameter bytes for a transaction are carried within the **SMB_Data.Trans_Parameters** field of the SMB_COM_TRANSACTION request. If the size of all of the required **SMB_Data.Trans_Parameters** for a given transaction causes the request to exceed the **MaxBufferSize** established during session setup, then the client MUST NOT send all of the parameters in one request. The client MUST break up the parameters and send additional requests using the SMB_COM_TRANSACTION_SECONDARY command to send the additional parameters. Any single request MUST NOT exceed the **MaxBufferSize** established during session setup. The client indicates to the server to expect additional parameters, and thus at least one SMB_COM_TRANSACTION_SECONDARY, by setting **ParameterCount** (see following) to be less than **TotalParameterCount**. See SMB_COM_TRANSACTION_SECONDARY for more information. + +**TotalDataCount (2 bytes):** The total number of transaction data bytes that the client attempts to send to the server for this request. Data bytes of a transaction are carried within the **SMB_Data.Trans_Data** field of the SMB_COM_TRANSACTION request. If the size of all of the required **SMB_Data.Trans_Data** for a given transaction causes the request to exceed the **MaxBufferSize** established during session setup, then the client MUST NOT send all of the data in one request. The client MUST break up the data and send additional requests using the SMB_COM_TRANSACTION_SECONDARY command to send the additional data. Any single request MUST NOT exceed the **MaxBufferSize** established during session setup. The client indicates to the server to expect additional data, and thus at least one SMB_COM_TRANSACTION_SECONDARY, by setting **DataCount** (see following) to be less than **TotalDataCount**. See SMB_COM_TRANSACTION_SECONDARY for more information. + +**MaxParameterCount (2 bytes):** The maximum number of **SMB_Data.Trans_Parameters** bytes that the client accepts in the transaction response. The server MUST NOT return more than this number of bytes in the **SMB_Data.Trans_Parameters** field of the response. + +**MaxDataCount (2 bytes):** The maximum number of **SMB_Data.Trans_Data** bytes that the client accepts in the transaction response. The server MUST NOT return more than this number of bytes in the **SMB_Data.Trans_Data** field. + +**MaxSetupCount (1 byte):** The maximum number of bytes that the client accepts in the **Setup** field of the transaction response. The server MUST NOT return more than this number of bytes in the **Setup** field. + +**Reserved1 (1 byte):** A padding byte. This field MUST be 0x00. Existing CIFS implementations MAY combine this field with **MaxSetupCount** to form a USHORT. If **MaxSetupCount** is defined as a USHORT, the high order byte MUST be 0x00. + +**Flags (2 bytes):** A set of bit flags that alter the behavior of the requested operation. Unused bit fields MUST be set to zero by the client sending the request, and MUST be ignored by the server receiving the request. The client can set either or both of the following bit flags. + +| Name and bitmask | Meaning | +| ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| DISCONNECT_TID

0x0001 | If set, following the completion of the operation the server MUST disconnect the tree connect associated with the tree identifier (TID) field received in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) of this request. The client SHOULD NOT send a subsequent SMB_COM_TREE_DISCONNECT for this tree connect. | +| NO_RESPONSE

0x0002 | This is a one-way transaction. The server MUST attempt to complete the transaction, but MUST NOT send a response to the client.[<41>](#Appendix_A_41) | + +**Timeout (4 bytes):** The value of this field MUST be the maximum number of milliseconds that the server SHOULD wait for completion of the transaction before generating a time-out and returning a response to the client. The client SHOULD set this field to 0x00000000 to indicate that no time-out is expected. A value of 0x00000000 indicates that the server returns an error if the resource is not immediately available. If the operation does not complete within the specified time, the server MAY abort the request and send a failure response.[<42>](#Appendix_A_42) + +**Reserved2 (2 bytes):** Reserved. This field MUST be 0x0000 in the client request. The server MUST ignore the contents of this field. + +**ParameterCount (2 bytes):** The number of transaction parameter bytes that the client attempts to send to the server in this request. Parameter bytes for a transaction are carried within the **SMB_Data.Trans_Parameters** field of the SMB_COM_TRANSACTION request. If the transaction request fits within a single SMB_COM_TRANSACTION request (the request size does not exceed **MaxBufferSize**), then this value SHOULD be equal to **TotalParameterCount**. Otherwise, the sum of the **ParameterCount** values in the primary and secondary transaction request messages MUST be equal to the smallest **TotalParameterCount** value reported to the server. If the value of this field is less than the value of **TotalParameterCount**, then at least one SMB_COM_TRANSACTION_SECONDARY message MUST be used to transfer the remaining transaction **SMB_Data.Trans_Parameters** bytes. The **ParameterCount** field MUST be used to determine the number of transaction **SMB_Data.Trans_Parameters** bytes that are contained within the SMB_COM_TRANSACTION message. + +**ParameterOffset (2 bytes):** This field MUST contain the number of bytes from the start of the SMB Header to the start of the **SMB_Data.Trans_Parameters** field. Server implementations MUST use this value to locate the transaction parameter block within the request. If **ParameterCount** is zero, the client/server MAY set this field to zero.[<43>](#Appendix_A_43) + +**DataCount (2 bytes):** The number of transaction data bytes that the client sends to the server in this request. Data bytes for a transaction are carried within the **SMB_Data.Trans_Data** field of the SMB_COM_TRANSACTION request. If the transaction request fits within a single SMB_COM_TRANSACTION request (the request size does not exceed **MaxBufferSize**), then this value SHOULD be equal to **TotalDataCount**. Otherwise, the sum of the **DataCount** values in the primary and secondary transaction request messages MUST be equal to the smallest **TotalDataCount** value reported to the server. If the value of this field is less than the value of **TotalDataCount**, then at least one SMB_COM_TRANSACTION_SECONDARY message MUST be used to transfer the remaining transaction **SMB_Data.Trans_Data** bytes. The **DataCount** field MUST be used to determine the number of transaction **SMB_Data.Trans_Data** bytes contained within the SMB_COM_TRANSACTION message. + +**DataOffset (2 bytes):** This field MUST be the number of bytes from the start of the SMB Header of the request to the start of the **SMB_Data.Trans_Data** field. Server implementations MUST use this value to locate the transaction data block within the request. If **DataCount** is zero, the client/server MAY[<44>](#Appendix_A_44) set this field to zero. + +**SetupCount (1 byte):** This field MUST be the number of setup words that are included in the transaction request. + +**Reserved3 (1 byte):** A padding byte. This field MUST be 0x00. Existing CIFS implementations MAY combine this field with **SetupCount** to form a USHORT. If **SetupCount** is defined as a USHORT, the high order byte MUST be 0x00. + +**Setup (variable):** An array of two-byte words that provides transaction context to the server. The size and content of the array are specific to individual subcommands. + +**SMB_Data (variable):** + +The SMB_Data section of the SMB_COM_TRANSACTION request contains the parameters and data that are the input to the transaction operation on the server. SMB_COM_TRANSACTION also includes a Name string that MAY identify the resource (a specific Mailslot or Named Pipe) against which the operation is performed. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** The number of bytes in the **Bytes** array that follows. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Name (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Pad1 (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Trans_Parameters (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Pad2 (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Name (variable):** The pathname of the mailslot or named pipe to which the transaction subcommand applies, or a client-supplied identifier that provides a name for the transaction. See the individual SMB_COM_TRANSACTION subprotocol subcommand descriptions for information about the value set for each subcommand. If the field is not specified in the section for the subcommands, the field SHOULD be set to \\pipe\\. If SMB_FLAGS2_UNICODE is set in the **Flags2** field of the SMB Header (section 2.2.3.1) of the request, this field MUST be a null-terminated array of 16-bit Unicode characters which MUST be aligned to start on a 2-byte boundary from the start of the SMB header. Otherwise, this field MUST be a null-terminated array of OEM characters. The **Name** field MUST be the first field in this section. + +**Pad1 (variable):** This field SHOULD be used as an array of padding bytes to align the following field to a 4-byte boundary. relative to the start of the SMB Header. This constraint can cause this field to be a zero-length field. This field SHOULD be set to zero by the client/server, and MUST be ignored by the server/client. + +**Trans_Parameters (variable):** Transaction parameter bytes. See the individual SMB_COM_TRANSACTION subprotocol subcommands descriptions for information on the parameters sent for each subcommand. + +**Pad2 (variable):** This field SHOULD be used as an array of padding bytes to align the following field to a 4-byte boundary. relative to the start of the SMB Header. This can cause this field to be a zero-length field. This field SHOULD be set to zero by the client/server, and MUST be ignored by the server/client. + +**Data (variable):** Transaction data bytes. See the individual SMB_COM_TRANSACTION subprotocol subcommands descriptions for information on the data sent for each subcommand. + +##### Response + +The SMB_COM_TRANSACTION response has two possible formats. The standard format is used to return the results of the completed transaction. A shortened interim response message is sent following the initial SMB_COM_TRANSACTION request if the server determines that at least one SMB_COM_TRANSACTION_SECONDARY request message is expected from the client. + +Whenever a transaction request is split across multiple SMB requests, the server MUST evaluate the initial SMB_COM_TRANSACTION request to determine whether or not it has the resources necessary to process the transaction. It MUST also check for any other errors that it can detect and then send back an interim response. If the interim response returns SUCCESS, then the client MUST send the next request of the transaction to the server. If the interim response reports an error, the client MUST NOT send the next request of the transaction to the server and SHOULD take appropriate action based on the error information included in the interim response. + +The format of the SMB_COM_TRANSACTION Interim Server Response message is an [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) with an empty **SMB_Parameters** and **SMB_Data** section. **SMB_Parameters.WordCount** and **SMB_Data.ByteCount** MUST be 0x00 and 0x0000, respectively. Error codes are returned in the **SMB_Header.Status** field. + +- SMB_Parameters +- { +- UCHAR WordCount; +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +If no error is returned in the SMB_COM_TRANSACTION Interim Server Response, the transaction can proceed. The client sends as many SMB_COM_TRANSACTION_SECONDARY requests as required in order to transfer the remainder of the transaction subcommand **SMB_Data.Trans_Parameters** and **SMB_Data.Trans_Data**. The server processes the transaction and replies with one or more SMB_COM_TRANSACTION response messages. + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT TotalParameterCount; +- USHORT TotalDataCount; +- USHORT Reserved1; +- USHORT ParameterCount; +- USHORT ParameterOffset; +- USHORT ParameterDisplacement; +- USHORT DataCount; +- USHORT DataOffset; +- USHORT DataDisplacement; +- UCHAR SetupCount; +- UCHAR Reserved2; +- USHORT Setup\[SetupCount\]; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR Pad1\[\]; +- UCHAR Trans_Parameters\[ParameterCount\]; +- UCHAR Pad2\[\]; +- UCHAR Trans_Data\[DataCount\]; +- } +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| SMB_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (variable):** + +The SMB_Parameters section of the SMB_COM_TRANSACTION response contains information used to manage the transfer of the transaction response. It can also contain additional information that can include subcommand return codes or state information returned by the server. See the individual subprotocol subcommands for details. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ---------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** The value of **Words.SetupCount** plus 10 (0x0A). This value represents the total number of SMB parameter words and MUST be greater than or equal to 10 (0x0A). + +**Words (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --------------------- | --- | --- | --- | ---------- | --- | --- | --- | --------- | --- | --- | --- | --- | --- | ---------- | --- | +| TotalParameterCount | | | | | | | | | | | | | | | | TotalDataCount | | | | | | | | | | | | | | | | +| Reserved1 | | | | | | | | | | | | | | | | ParameterCount | | | | | | | | | | | | | | | | +| ParameterOffset | | | | | | | | | | | | | | | | ParameterDisplacement | | | | | | | | | | | | | | | | +| DataCount | | | | | | | | | | | | | | | | DataOffset | | | | | | | | | | | | | | | | +| DataDisplacement | | | | | | | | | | | | | | | | SetupCount | | | | | | | | Reserved2 | | | | | | | | +| Setup (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**TotalParameterCount (2 bytes):** The total number of transaction parameter bytes that the server expects to send to the client for this response. Parameter bytes for a transaction are carried within the **SMB_Data.Trans_Parameters** field of the SMB_COM_TRANSACTION response. If the size of all of the required **SMB_Data.Trans_Parameters** for a given transaction causes the response to exceed the **MaxBufferSize** established during session setup, then the server MUST NOT send all of the parameters in one response. The server MUST break up the parameters and send additional responses using the SMB_COM_TRANSACTION command to send the additional parameters. Any single response MUST NOT exceed the **MaxBufferSize** established during session setup. The server indicates to the client to expect additional parameters in at least one more SMB_COM_TRANSACTION response by setting **ParameterCount** (see following) to be less than **TotalParameterCount**. + +**TotalDataCount (2 bytes):** The total number of transaction data bytes that the server expects to send to the client for this response. Data bytes of a transaction are carried within the **SMB_Data.Trans_Data** field of the SMB_COM_TRANSACTION response. If the size of all of the required **SMB_Data.Trans_Data** for a given transaction causes the response to exceed the **MaxBufferSize** established during session setup, then the server MUST NOT send all of the data in one response. The server MUST break up the data and send additional responses using the SMB_COM_TRANSACTION command to send the additional data. Any single response MUST NOT exceed the **MaxBufferSize** established during session setup. The server indicates to the client to expect additional data in at least one more SMB_COM_TRANSACTION response by setting **DataCount** (see following) to be less than **TotalDataCount**. + +**Reserved1 (2 bytes):** Reserved. This field MUST be 0x0000 in the client request. The server MUST ignore the contents of this field. + +**ParameterCount (2 bytes):** The number of transaction parameter bytes being sent in this response. If the transaction fits within a single SMB_COM_TRANSACTION response, then this value MUST be equal to **TotalParameterCount**. Otherwise, the sum of the **ParameterCount** values in the transaction response messages MUST be equal to the smallest **TotalParameterCount** value reported by the server. The **ParameterCount** field MUST be used to determine the number of transaction parameter bytes contained within the response. + +**ParameterOffset (2 bytes):** This field MUST contain the number of bytes from the start of the SMB Header to the start of the **SMB_Data.Trans_Parameters** field. Client implementations MUST use this value to locate the transaction parameter block within the response. If **ParameterCount** is zero, the client/server MAY set this field to zero.[<45>](#Appendix_A_45) + +**ParameterDisplacement (2 bytes):** The offset, in bytes, relative to all of the transaction parameter bytes in this transaction response at which this block of parameter bytes SHOULD be placed. This value MUST be used by the client to correctly reassemble the transaction response parameters when the response messages are received out of order. + +**DataCount (2 bytes):** The number of transaction data bytes being sent in this response. If the transaction response fits within a single SMB_COM_TRANSACTION, then this value MUST be equal to **TotalDataCount**. Otherwise, the sum of the **DataCount** values in the primary and secondary transaction responses MUST be equal to the smallest **TotalDataCount** value reported to the client. If the value of this field is less than the value of **TotalDataCount**, then at least one additional SMB_COM_TRANSACTION response MUST be used to transfer the remaining data bytes. + +**DataOffset (2 bytes):** This field MUST be the number of bytes from the start of the SMB Header of the response to the start of the **SMB_Data.Trans_Data** field. Client implementations MUST use this value to locate the transaction data block within the response. If **DataCount** is zero, the client/server MAY set this field to zero.[<46>](#Appendix_A_46) + +**DataDisplacement (2 bytes):** The offset, in bytes, relative to all of the transaction data bytes in this transaction response at which this block of data bytes SHOULD be placed. This value MUST be used by the client to correctly reassemble the transaction data when the response messages are received out of order. + +**SetupCount (1 byte):** The number of setup words that are included in the transaction response. + +**Reserved2 (1 byte):** A padding byte. This field MUST be 0x00. Existing CIFS implementations can combine this field with **SetupCount** to form a USHORT. If **SetupCount** is defined as a USHORT, the high order byte MUST be zero. + +**Setup (variable):** An array of two-byte words that provides transaction results from the server. The size and content of the array are specific to individual subprotocol subcommands. + +**SMB_Data (variable):** + +The SMB_Data section of the SMB_COM_TRANSACTION response contains the parameters and data generated by the transaction subcommand. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** The number of bytes in the **SMB_Data.Bytes** array that follows. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Pad1 (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Trans_Parameters (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Pad2 (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Trans_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Pad1 (variable):** This field SHOULD be used as an array of padding bytes to align the following field to a 4-byte boundary relative to the start of the SMB Header (section 2.2.3.1), This can cause this field to be a zero-length field. This field SHOULD be set to zero by the client/server, and MUST be ignored by the server/client. + +**Trans_Parameters (variable):** Transaction parameter bytes. See the individual SMB_COM_TRANSACTION subcommand descriptions for information on parameters returned by the server for each subcommand. + +**Pad2 (variable):** This field SHOULD be used as an array of padding bytes to align the following field to a 4-byte boundary relative to the start of the SMB Header. This constraint can cause this field to be a zero-length field. This field SHOULD be set to zero by the client/server and MUST be ignored by the server/client. + +**Trans_Data (variable):** Transaction data bytes. See the individual SMB_COM_TRANSACTION subcommand descriptions for information on data returned by the server for each subcommand. + +**Error Codes** + +The errors returned from calls to SMB_COM_TRANSACTION are specific to the subcommand being executed. See the documentation for the individual subcommands for more detailed information. + +#### SMB_COM_TRANSACTION_SECONDARY (0x26) + +This command was introduced in the **LAN Manager 1.0** dialect. + +The SMB_COM_TRANSACTION_SECONDARY command is used to complete a data transfer initiated by an SMB_COM_TRANSACTION Request. + +For both the request and the response, the positions and lengths of the **SMB_Data.Trans_Parameters** and **SMB_Data.Trans_Data** fields are determined by the values of the **SMB_Parameters.ParameterOffset**, **SMB_Parameters.ParameterCount**, **SMB_Parameters.DataOffset**, and **SMB_Parameters.DataCount** fields. In addition, the **SMB_Parameters.ParameterDisplacement** and **SMB_Parameters.DataDisplacement** fields can be used to change the order in which subranges of bytes are transferred. Servers SHOULD transfer bytes in order and give precedence to **SMB_Data.Trans_Parameters** bytes. Clients SHOULD be prepared to reconstruct transaction **SMB_Data.Trans_Parameters** and **SMB_Data.Trans_Data**, regardless of the order or locations in which they are delivered. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT TotalParameterCount; +- USHORT TotalDataCount; +- USHORT ParameterCount; +- USHORT ParameterOffset; +- USHORT ParameterDisplacement; +- USHORT DataCount; +- USHORT DataOffset; +- USHORT DataDisplacement; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR Pad1\[\]; +- UCHAR Trans_Parameters\[ParameterCount\]; +- UCHAR Pad2\[\]; +- UCHAR Trans_Data\[DataCount\]; +- } +- } + +**SMB_Header:** + +This command MUST be sent following a successful [SMB_COM_TRANSACTION (section 2.2.4.33)](#Section_0ed1ad9fab964a7ab94a0915f3796781) Intermediate Response from the server. The **PID**, **MID**, **TID**, and **UID** MUST be the same for all requests and responses that are part of the same transaction. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | ------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters (17 bytes) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | SMB_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (17 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ---------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words (16 bytes) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x08. + +**Words (16 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| TotalParameterCount | | | | | | | | | | | | | | | | TotalDataCount | | | | | | | | | | | | | | | | +| ParameterCount | | | | | | | | | | | | | | | | ParameterOffset | | | | | | | | | | | | | | | | +| ParameterDisplacement | | | | | | | | | | | | | | | | DataCount | | | | | | | | | | | | | | | | +| DataOffset | | | | | | | | | | | | | | | | DataDisplacement | | | | | | | | | | | | | | | | + +**TotalParameterCount (2 bytes):** The total number of transaction parameter bytes to be sent to the server over the course of this transaction. This value MAY be less than or equal to the **TotalParameterCount** in preceding request messages that are part of the same transaction. This value represents transaction parameter bytes, not SMB parameter words. + +**TotalDataCount (2 bytes):** The total number of transaction data bytes to be sent to the server over the course of this transaction. This value MAY be less than or equal to the **TotalDataCount** in preceding request messages that are part of the same transaction. This value represents transaction data bytes, not SMB data bytes. + +**ParameterCount (2 bytes):** The number of transaction parameter bytes being sent in the SMB message. This value MUST be less than **TotalParameterCount**. The sum of the **ParameterCount** values across all of the request messages in a transaction MUST be equal to the **TotalParameterCount** reported in the last request message of the transaction. + +**ParameterOffset (2 bytes):** The offset, in bytes, from the start of the SMB_Header to the transaction parameter bytes contained in this SMB message. This MUST be the number of bytes from the start of the SMB message to the start of the **SMB_Data.Bytes.Trans_Parameters** field. Server implementations MUST use this value to locate the transaction parameter block within the SMB message. If ParameterCount is zero, the client/server MAY set this field to zero.[<47>](#Appendix_A_47) + +**ParameterDisplacement (2 bytes):** The offset, relative to all of the transaction parameter bytes sent to the server in this transaction, at which this block of parameter bytes MUST be placed. This value can be used by the server to correctly reassemble the transaction parameters even if the SMB request messages are received out of order. + +**DataCount (2 bytes):** The number of transaction data bytes being sent in this SMB message. This value MUST be less than the value of **TotalDataCount**. The sum of the **DataCount** values across all of the request messages in a transaction MUST be equal to the smallest **TotalDataCount** value reported to the server. + +**DataOffset (2 bytes):** The offset, in bytes, from the start of the SMB_Header to the transaction data bytes contained in this SMB message. This MUST be the number of bytes from the start of the SMB message to the start of the **SMB_Data.Bytes.Trans_Data** field. Server implementations MUST use this value to locate the transaction data block within the SMB message. If DataCount is zero, the client/server MAY set this field to zero.[<48>](#Appendix_A_48) + +**DataDisplacement (2 bytes):** The offset, relative to all of the transaction data bytes sent to the server in this transaction, at which this block of parameter bytes MUST be placed. This value can be used by the server to correctly reassemble the transaction data block even if the SMB request messages are received out of order. + +**SMB_Data (variable):** + +The SMB_Data section of the SMB_COM_TRANSACTION_SECONDARY request contains parameters and data bytes being sent to the server. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** The number of bytes in the **SMB_Data.Bytes** array, which follows. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Pad1 (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Trans_Parameters (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Pad2 (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Trans_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Pad1 (variable):** This field SHOULD be used as an array of padding bytes to align the following field to a 4-byte boundary relative to the start of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f). This constraint can cause this field to be a zero-length field. This field SHOULD be set to zero by the client/server and MUST be ignored by the server/client. + +**Trans_Parameters (variable):** Transaction parameter bytes. + +**Pad2 (variable):** This field SHOULD be used as an array of padding bytes to align the following field to a 4-byte boundary relative to the start of the SMB Header. This constraint can cause this field to be a zero-length field. This field SHOULD be set to zero by the client/server and MUST be ignored by the server/client. + +**Trans_Data (variable):** Transaction data bytes. + +##### Response + +There is no response message defined for the SMB_COM_TRANSACTION_SECONDARY request. + +**Error Codes** + +Since there is no response to an SMB_COM_TRANSACTION_SECONDARY request, there are no error codes defined. + +#### SMB_COM_IOCTL (0x27) + +This command was introduced in the **LAN Manager 1.0** dialect. It was rendered [**obsolescent**](#gt_8377951d-81ca-44a2-af83-2a6d6388c121) in the [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) dialect. NT LAN Manager also removed the transaction-like behavior that supported multiple request and response messages to complete an IOCTL. The command now supports a single request followed by a single response. + +This command delivers a device- or file-specific IOCTL request to a server, and a device- or file-specific IOCTL response to the requester. The target file or device is identified by the [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) in the request. The request defines a function that is specific to a particular device type on a particular server type. Therefore, the functions supported are not defined by the protocol, but by the systems on which the [**CIFS**](#gt_fb37399e-d72d-41b6-b073-086da2d96e09) implementations execute. The protocol simply provides a means of delivering the requests and accepting the responses.[<49>](#Appendix_A_49) + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT FID; +- USHORT Category; +- USHORT Function; +- USHORT TotalParameterCount; +- USHORT TotalDataCount; +- USHORT MaxParameterCount; +- USHORT MaxDataCount; +- ULONG Timeout; +- USHORT Reserved; +- USHORT ParameterCount; +- USHORT ParameterOffset; +- USHORT DataCount; +- USHORT DataOffset; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR Pad1\[\]; +- UCHAR Parameters\[ParameterCount\]; +- UCHAR Pad2\[\]; +- UCHAR Data\[DataCount\]; +- } +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | ------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters (29 bytes) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | SMB_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (29 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ---------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words (28 bytes) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | + +**WordCount (1 byte):** This value of this field MUST be set to 0x0E. + +**Words (28 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ------------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| FID | | | | | | | | | | | | | | | | Category | | | | | | | | | | | | | | | | +| Function | | | | | | | | | | | | | | | | TotalParameterCount | | | | | | | | | | | | | | | | +| TotalDataCount | | | | | | | | | | | | | | | | MaxParameterCount | | | | | | | | | | | | | | | | +| MaxDataCount | | | | | | | | | | | | | | | | Timeout | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | Reserved2 | | | | | | | | | | | | | | | | +| ParameterCount | | | | | | | | | | | | | | | | ParameterOffset | | | | | | | | | | | | | | | | +| DataCount | | | | | | | | | | | | | | | | DataOffset | | | | | | | | | | | | | | | | + +**FID (2 bytes):** The FID of the device or file to which the IOCTL is to be sent. + +**Category (2 bytes):** The implementation-dependent device category for the request. + +**Function (2 bytes):** The implementation-dependent device function for the request. + +**TotalParameterCount (2 bytes):** The total number of IOCTL parameter bytes that the client sends to the server in this request. Parameter bytes for an IOCTL are carried within the **SMB_Data.Parameters** field of the SMB_COM_IOCTL request. This value MUST be the same as **ParameterCount**. + +**TotalDataCount (2 bytes):** The total number of IOCTL data bytes that the client sends to the server in this request. Data bytes for an IOCTL are carried within the **SMB_Data.Data** field of the SMB_COM_IOCTL request. This value MUST be the same as **DataCount**. + +**MaxParameterCount (2 bytes):** The maximum number of **SMB_Data.Parameters** bytes that the client accepts in the IOCTL response. The server MUST NOT return more than this number of bytes in the **SMB_Data.Parameters** field of the response. + +**MaxDataCount (2 bytes):** The maximum number of **SMB_Data.Data** bytes that the client accepts in the IOCTL response. The server MUST NOT return more than this number of bytes in the **SMB_Data.Data** field. + +**Timeout (4 bytes):** The value of this field MUST be the maximum number of milliseconds that the server SHOULD wait for completion of the transaction before generating a time-out and returning a response to the client. The client SHOULD set this to 0x00000000 to indicate that no time-out is expected. A value of 0x00000000 indicates that the server returns an error if the resource is not immediately available. If the operation does not complete within the specified time, the server aborts the request and sends a failure response. + +**Reserved2 (2 bytes):** Reserved. This field MUST be 0x0000 in the client request. The server MUST ignore the contents of this field. + +**ParameterCount (2 bytes):** The number of IOCTL parameter bytes that the client sends to the server in this request. Parameter bytes for an IOCTL are carried within the **SMB_Data.Parameters** field of the SMB_COM_IOCTL request. This value MUST be the same as **TotalParameterCount**. + +**ParameterOffset (2 bytes):** The client SHOULD set the value of this field to 0x0000. The server MUST ignore the value of this field. + +**DataCount (2 bytes):** The total number of IOCTL data bytes that the client sends to the server in this request. Data bytes for an IOCTL are carried within the **SMB_Data.Data** field of the SMB_COM_IOCTL request. This value MUST be the same as **TotalDataCount**. + +**DataOffset (2 bytes):** The client SHOULD set the value of this field to 0x0000. The server MUST ignore the value of this field. + +**SMB_Data (variable):** + +The **SMB_Data** section of the SMB_COM_IOCTL Request (section 2.2.4.35.1) contains the parameters and data that are the input to the IOCTL operation on the server. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** The number of bytes in the **Bytes** array that follows. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Pad1 (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Parameters (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Pad2 (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Pad1 (variable):** An array of padding bytes used to align the next field to a 2-byte or 4-byte boundary. + +**Parameters (variable):** IOCTL parameter bytes. The contents are implementation-dependent. + +**Pad2 (variable):** An array of padding bytes, used to align the next field to a 2-byte or 4-byte boundary. + +**Data (variable):** Transaction data bytes. The contents are implementation-dependent. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT TotalParameterCount; +- USHORT TotalDataCount; +- USHORT ParameterCount; +- USHORT ParameterOffset; +- USHORT ParameterDisplacement; +- USHORT DataCount; +- USHORT DataOffset; +- USHORT DataDisplacement; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR Pad1\[\]; +- UCHAR Parameters\[ParameterCount\]; +- UCHAR Pad2\[\]; +- UCHAR Data\[DataCount\]; +- } +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| SMB_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (variable):** + +The SMB_Parameters section of the SMB_COM_IOCTL response contains information that is used to manage the transfer of the IOCTL response. It can also contain additional information that can include IOCTL return codes or state information returned by the server. Such information is **CIFS** implementation-dependent. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ---------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** The value of this field MUST be set to 0x08. + +**Words (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| TotalParameterCount | | | | | | | | | | | | | | | | TotalDataCount | | | | | | | | | | | | | | | | +| ParameterCount | | | | | | | | | | | | | | | | ParameterOffset | | | | | | | | | | | | | | | | +| ParameterDisplacement | | | | | | | | | | | | | | | | DataCount | | | | | | | | | | | | | | | | +| DataOffset | | | | | | | | | | | | | | | | DataDisplacement | | | | | | | | | | | | | | | | + +**TotalParameterCount (2 bytes):** The total number of IOCTL parameter bytes that the server sends to the client in this response. Parameter bytes for an IOCTL are carried within the **SMB_Data.Parameters** field of the SMB_COM_IOCTL request. This value MUST be the same as **ParameterCount,** and this value MUST be less than or equal to the **MaxParameterCount** field value in the client's request. + +**TotalDataCount (2 bytes):** The total number of IOCTL data bytes that the server sends to the client in this response. Data bytes for an IOCTL are carried within the **SMB_Data.Data** field of the SMB_COM_IOCTL request. This value MUST be the same as **DataCount,** and this value MUST be less than or equal to the **MaxDataCount** field value in the client's request. + +**ParameterCount (2 bytes):** The total number of IOCTL parameter bytes that the server sends to the client in this response. Parameter bytes for an IOCTL are carried within the **SMB_Data.Parameters** field of the SMB_COM_IOCTL request. This value MUST be the same as **TotalParameterCount** and this value MUST be less than or equal to the **MaxParameterCount** field value in the client's request. + +**ParameterOffset (2 bytes):** This field MUST contain the number of bytes from the start of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) to the start of the **SMB_Data.Parameters** field. Client implementations MUST use this value to locate the IOCTL parameter block within the response. + +**ParameterDisplacement (2 bytes):** The server SHOULD set the value of this field to 0x0000. The client MUST ignore the value of this field. + +**DataCount (2 bytes):** The total number of IOCTL data bytes that the server sends to the client in this response. Data bytes for an IOCTL are carried within the **SMB_Data.Data** field of the SMB_COM_IOCTL request. This value MUST be the same as **TotalDataCount,** and this value MUST be less than or equal to the **MaxDataCount** field value of the client's request. + +**DataOffset (2 bytes):** This field MUST be the number of bytes from the start of the SMB Header of the response to the start of the **SMB_Data.Data** field. Client implementations MUST use this value to locate the IOCTL data block within the response. + +**DataDisplacement (2 bytes):** The server SHOULD set the value of this field to 0x0000. The client MUST ignore the value of this field. + +**SMB_Data (variable):** + +The SMB_Data section of the SMB_COM_IOCTL response contains the parameters and data generated by the IOCTL command. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** The number of bytes in the **SMB_Data.Bytes** array, which follows. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Pad1 (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Parameters (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Pad2 (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Pad1 (variable):** An array of padding bytes used to align the next field to a 16- or 32-bit boundary. + +**Parameters (variable):** IOCTL parameter bytes. The contents are implementation-dependent. + +**Pad2 (variable):** An array of padding bytes used to align the next field to a 16- or 32-bit boundary. + +**Data (variable):** IOCTL data bytes. The contents are implementation-dependent. + +**Error Codes** + +The errors returned from calls to SMB_COM_IOCTL are implementation-dependent. The list below provides a summary of error codes returned by the IOCTL mechanism. + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ---------------------------- | --------------------------------------------------------------------------------------- | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRbadfunc

(0x0001) | STATUS_NOT_IMPLEMENTED

(0xC0000002) | | Requested category and function are not implemented by the server. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | EACCESS | File access rights do not match requested locks. | +| ERRDOS

(0x01) | ERRbadfid

(0x0006) | STATUS_INVALID_HANDLE

(0xC0000008)

STATUS_SMB_BAD_FID

(0x00060001) | ENFILE | Attempt to read from a FID that the server does not have open. | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | Insufficient server resources to place the lock. | +| ERRDOS

(0x01) | ERRunsup

(0x0032) | STATUS_NOT_SUPPORTED

(0xC00000BB) | | Requested category and function are not supported by the server. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | | | Unspecified error. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. | +| ERRSRV

(0x02) | ERRerror

(0x0004) | | EACCES | Access denied. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | Invalid TID in request. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** specified is not known as a valid ID for this session, or the user identified by the **UID** does not have sufficient privileges. | +| ERRSRV

(0x02) | ERRmoredata

(0x00EA) | STATUS_BUFFER_OVERFLOW

(0xC0000005) | | There is more data available (on the specified named pipe) than can be returned in this transaction. | +| ERRSRV

(0x02) | ERRnosupport

(0xFFFF) | STATUS_SMB_NO_SUPPORT

(0xFFFF0002) | | The command is not supported by the server.[<50>](#Appendix_A_50) | + +#### SMB_COM_IOCTL_SECONDARY (0x28) + +This command was introduced in the **LAN Manager 1.0** dialect (see [\[SMB-LM1X\]](https://go.microsoft.com/fwlink/?LinkId=164302) section 9.2.7). It was rendered obsolete in the [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) dialect and is considered reserved but not implemented. Clients SHOULD NOT send requests using this command code, and servers receiving requests with this command code MUST return STATUS_NOT_IMPLEMENTED (ERRDOS/ERRbadfunc). + +This command is a companion to SMB_COM_IOCTL, which has been deprecated. Please see [SMB_COM_IOCTL (section 2.2.4.35)](#Section_0d8f5f1716af499da192a5fd85fbb7e1) for more information. + +#### SMB_COM_COPY (0x29) + +This command was introduced in the **LAN Manager 1.0** dialect (see [\[SMB-LM1X\]](https://go.microsoft.com/fwlink/?LinkId=164302) section 9.2.1 and [\[XOPEN-SMB\]](https://go.microsoft.com/fwlink/?linkid=2297696) sections 14.1 and 15.2). It was rendered [**obsolete**](#gt_73fb9153-adab-4f17-b472-426f982e360c) in the [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) dialect. + +This command was used to perform server-side file copies, but is no longer used. Clients SHOULD NOT send requests using this command code. Servers receiving requests with this command code SHOULD return STATUS_NOT_IMPLEMENTED (ERRDOS/ERRbadfunc).[<51>](#Appendix_A_51) + +#### SMB_COM_MOVE (0x2A) + +This command was introduced in the **LAN Manager 1.0** dialect (see [\[SMB-LM1X\]](https://go.microsoft.com/fwlink/?LinkId=164302) section 9.2.10 and [\[XOPEN-SMB\]](https://go.microsoft.com/fwlink/?linkid=2297696) section 14.4). It was rendered [**obsolete**](#gt_73fb9153-adab-4f17-b472-426f982e360c) in the [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) dialect. + +This command was used to move files on the server, but is no longer in use. Clients SHOULD NOT send requests using this command code. Servers receiving requests with this command code SHOULD[<52>](#Appendix_A_52) return STATUS_NOT_IMPLEMENTED (ERRDOS/ERRbadfunc). + +#### SMB_COM_ECHO (0x2B) + +This command was introduced in the **LAN Manager 1.0** dialect. + +The SMB_COM_ECHO command is sent by the client to test the transport layer connection with the server. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT EchoCount; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR Data\[ByteCount\]; +- } +- } + +**SMB_Header:** + +**TID (2 bytes):** This field MUST contain a valid TID or 0xFFFF.[<53>](#Appendix_A_53) + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ------------------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data (variable) | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (3 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x01. + +**Words (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| EchoCount | | | | | | | | | | | | | | | | + +**EchoCount (2 bytes): USHORT** The number of times that the server SHOULD echo the contents of the **SMB_Data.Data** field. + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be greater than or equal to 0x0000, indicating the number of bytes of data. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Data (variable)**: Data to echo. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT SequenceNumber; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR Data\[ByteCount\]; +- } +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ------------------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data (variable) | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (3 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x01. + +**Words (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SequenceNumber | | | | | | | | | | | | | | | | + +**SequenceNumber (2 bytes):** The sequence number of this echo response message.[<54>](#Appendix_A_54) + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ---------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (1 byte):** This field MUST be the same as it was in the request. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Data (variable):** This field MUST be the same as it was in the request. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| --------------- | ------------------------- | -------------------------------------- | ---------------- | --------------------------------------------- | +| ERRSRV (0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | The TID specified in the command was invalid. | + +#### SMB_COM_WRITE_AND_CLOSE (0x2C) + +This command was introduced in the **LAN Manager 1.0** dialect. This command is [**deprecated**](#gt_129acedf-ccf1-4e13-8df7-3bc59eff6f6d). Clients SHOULD[<55>](#Appendix_A_55) use the [SMB_COM_WRITE_ANDX (section 2.2.4.43)](#Section_81aec3770ff44fc4bc568f05b70c3e42) command. + +This write and close command has the effect of writing to a range of bytes and then closing the file associated with the supplied FID. This command behaves identically to an [SMB_COM_WRITE (section 2.2.4.12)](#Section_5f3ebf6a5d0643ee9429c8cc1b58eef5) command followed by an [SMB_COM_CLOSE (section 2.2.4.5)](#Section_10059dd2ae0a48a2a95ca92505e9145f) command. See SMB_COM_WRITE and SMB_COM_CLOSE for more details. This command supports two request formats: one with six parameter words and one with 12 parameter words. + +This command supports 32-bit offsets only and is inappropriate for files having 64-bit offsets. The client SHOULD use SMB_COM_WRITE_ANDX to write to files requiring 64-bit file offsets. + +The client MUST have at least write access to the file. If an error is returned by the underlying [**object store**](#gt_0cc469e1-4b1f-41c4-9f94-d6209fcf468e), the server SHOULD still close the file. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT FID; +- USHORT CountOfBytesToWrite; +- ULONG WriteOffsetInBytes; +- UTIME LastWriteTime; +- ULONG Reserved\[3\] (optional); +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR Pad; +- UCHAR Data\[CountOfBytesToWrite\]; +- } +- } + +**SMB_Header:** + +**TID (2 bytes):** This field MUST contain a valid TID. + +**UID (2 bytes):** This field MUST contain a valid UID. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| SMB_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ---------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be either 0x06 or 0x0C. + +**Words (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------ | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ------------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| FID | | | | | | | | | | | | | | | | CountOfBytesToWrite | | | | | | | | | | | | | | | | +| WriteOffsetInBytes | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| LastWriteTime | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Reserved | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**FID (2 bytes):** This field MUST be a valid 16-bit unsigned integer indicating the file to which the data SHOULD be written. + +**CountOfBytesToWrite (2 bytes):** This field is a 16-bit unsigned integer indicating the number of bytes to be written to the file. The client MUST ensure that the amount of data sent can fit in the negotiated maximum buffer size. If the value of this field is zero (0x0000), the server MUST truncate or extend the file to match the **WriteOffsetInBytes**. + +**WriteOffsetInBytes (4 bytes):** This field is a 32-bit unsigned integer indicating the offset, in number of bytes, from the beginning of the file at which to begin writing to the file. The client MUST ensure that the amount of data sent can fit in the negotiated maximum buffer size. Because this field is limited to 32-bits, this command is inappropriate for files that have 64-bit offsets. + +**LastWriteTime (4 bytes):** This field is a 32-bit unsigned integer indicating the number of seconds since Jan 1, 1970, 00:00:00.0. The server SHOULD set the last write time of the file represented by the FID to this value. If the value is zero (0x00000000), the server SHOULD use the current local time of the server to set the value. Failure to set the time MUST NOT result in an error response from the server. + +**Reserved (12 bytes):** This field is optional. This field is reserved, and all entries MUST be zero (0x00000000). This field is used only in the 12-word version of the request. + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ----------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Buffer (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0001 + **CountOfBytesToWrite**. + +**Buffer (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --- | --- | --- | --- | --- | --- | --- | --- | --------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Pad | | | | | | | | Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Pad (1 byte):** The value of this field SHOULD be ignored. This is padding to force the byte alignment to a double word boundary. + +**Data (variable):** The raw bytes to be written to the file. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT CountOfBytesWritten; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | -------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data | | | | | | | | +| ... | | | | | | | | + +**SMB_Parameters (3 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x01. + +**Words (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| CountOfBytesWritten | | | | | | | | | | | | | | | | + +**CountOfBytesWritten (2 bytes):** Indicates the actual number of bytes written to the file. For successful writes, this MUST equal the **CountOfBytesToWrite** in the client's request. If the number of bytes written differs from the number requested and no error is indicated, then the server has no resources available with which to satisfy the complete write. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message.[<56>](#Appendix_A_56) + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| --------------- | ------------------------------- | ---------------------------------------------------------------------------------------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| ERRDOS (0x01) | ERRnoaccess

(0x0005) | | EAGAIN | Resources for I/O on the server are temporarily exhausted. | +| ERRDOS (0x01) | ERRnoaccess

(0x0005) | STATUS_ALREADY_COMMITTED

(0xC0000021) | ENOLCK | A record lock has been taken on the file or the client has attempted to write to a portion of the file that the server detects has been locked, opened in deny-write mode, or opened in read-only mode. | +| ERRDOS (0x01) | ERRbadfid

(0x0006) | STATUS_INVALID_HANDLE

(0xC0000008)

STATUS_SMB_BAD_FID

(0x00060001) | ENFILE | Invalid FID, or FID mapped to a valid server FID but it was not acceptable to the operating system. | +| ERRDOS (0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205)

STATUS_NO_MEMORY

(0xC0000017) | ENOMEM | The server is out of resources. | +| ERRDOS (0x01) | ERRbadaccess

(0x000C) | STATUS_ACCESS_DENIED

(0xC0000022) | | Write permission required. | +| ERRDOS (0x01) | ERRlock

(0x0021) | STATUS_FILE_LOCK_CONFLICT

(0xC0000054) | | The requested byte range was already locked by a different process (PID). | +| ERRDOS (0x01) | ERRnotconnected

(0x00E9) | STATUS_PIPE_DISCONNECTED

(0xC00000B0) | EPIPE | Write to a named pipe with no reader. | +| ERRSRV (0x02) | ERRerror

(0x0001) | | EDEADLK | The write would block due to locking and deadlock would result. | +| ERRSRV (0x02) | ERRerror

(0x0001) | | ERANGE | Attempted write size is outside of the minimum or maximum ranges that can be written to the supplied FID. | +| ERRSRV (0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | A corrupt SMB request was received. | +| ERRSRV (0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | Invalid **TID** in request. | +| ERRSRV (0x02) | ERRqfull

(0x0031) | STATUS_PRINT_QUEUE_FULL

(0xC00000C6) | | Print queue is full - too many queued items. | +| ERRSRV (0x02) | ERRqtoobig

(0x0032) | STATUS_NO_SPOOL_SPACE

(0xC00000C7) | | Print queue is full - too many queued items. | +| ERRSRV (0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** specified is not known as a valid ID on this server session, or the user identified by the **UID** does not have sufficient privileges. | +| ERRHRD (0x03) | ERRdata

(0x0017) | STATUS_DATA_ERROR

(0xC000003E) | EIO | A problem has occurred in the physical I/O. | +| ERRHRD (0x03) | ERRwrite

(0x001D) | | ENXIO | The device associated with the file descriptor is a block-special or character-special file, and the value of the file pointer is out of range. | +| ERRHRD (0x03) | ERRdiskfull

(0x0027) | STATUS_DISK_FULL

(0xC000007F) | ENOSPC

EFBIG | The file system is full, or the file has grown too large and no more data can be written to the file. | + +#### SMB_COM_OPEN_ANDX (0x2D) + +This command was introduced in the **LAN Manager 1.0** dialect. + +This command is used to create and open a new file or open an existing regular file and chain additional messages along with the request. See section [3.2.4.1.1](#Section_d0c84681ee6a4f6db9a0e9a1cefbbc79) for details on chaining commands. The command includes the pathname relative to the **TID** of the file, named pipe, or device that the client attempts to open. + +The following are the commands that can follow an SMB_COM_OPEN_ANDX in an AndX chain: + +- [SMB_COM_READ (section 2.2.4.11)](#Section_b88922ddb18e46e09f7408eaace9a95c) +- [SMB_COM_READ_ANDX (section 2.2.4.42)](#Section_129aa093574b483ea55ddf334606a622) +- [SMB_COM_IOCTL (section 2.2.4.35)](#Section_0d8f5f1716af499da192a5fd85fbb7e1) +- [SMB_COM_NO_ANDX_COMMAND (section 2.2.4.75)](#Section_10921e06804f4b5a92a51cc562f43068) + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- UCHAR AndXCommand; +- UCHAR AndXReserved; +- USHORT AndXOffset; +- USHORT Flags; +- USHORT AccessMode; +- SMB_FILE_ATTRIBUTES SearchAttrs; +- SMB_FILE_ATTRIBUTES FileAttrs; +- UTIME CreationTime; +- USHORT OpenMode; +- ULONG AllocationSize; +- ULONG Timeout; +- USHORT Reserved\[2\]; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- SMB_STRING FileName; +- } +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ------------------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters (31 bytes) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data (variable) | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (31 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ---------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words (30 bytes) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x0F. + +**Words (30 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------ | --- | --- | --- | --- | --- | --- | --- | ------------ | --- | ---------- | --- | --- | --- | --- | --- | -------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| AndXCommand | | | | | | | | AndXReserved | | | | | | | | AndXOffset | | | | | | | | | | | | | | | | +| Flags | | | | | | | | | | | | | | | | AccessMode | | | | | | | | | | | | | | | | +| SearchAttrs | | | | | | | | | | | | | | | | FileAttrs | | | | | | | | | | | | | | | | +| CreationTime | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| OpenMode | | | | | | | | | | | | | | | | AllocationSize | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | Timeout | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | Reserved | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | + +**AndXCommand (1 byte):** The command code for the next SMB command in the packet. This value MUST be set to 0xFF if there are no additional SMB commands in the client request packet. + +**AndXReserved (1 byte):** A reserved field. This field MUST be 0x00 when the message is sent, and the server MUST ignore this value when the message is received. + +**AndXOffset (2 bytes):** This field MUST be set to the offset, in bytes, from the start of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) to the start of the **WordCount** field in the next SMB command in this packet. This field is valid only if the AndXCommand field is not set to 0xFF. If AndXCommand is 0xFF, this field MUST be ignored by the server. + +**Flags (2 bytes):** A 16-bit field of flags for requesting attribute data and locking. + +| Name and bitmask | Description | +| -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| REQ_ATTRIB

0x0001 | If this bit is set, the client requests that the file attribute data in the response be populated. All fields after the **FID** in the response are also populated. If this bit is not set, all fields after the **FID** in the response are zero. | +| REQ_OPLOCK

0x0002 | Client requests an exclusive OpLock on the file. | +| REQ \_OPLOCK_BATCH

0x0004 | Client requests a Batch OpLock on the file. | + +**AccessMode (2 bytes):** A 16-bit field for encoding the requested access mode. See section [3.2.4.5.1](#Section_9a45e9e773774da199d6d66d97532550) for a discussion on sharing modes. + +| Name and bitmask | Values | Meaning | +| ------------------------------- | ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| AccessMode

0x0007 | 0 | Open for reading | +| 1 | Open for writing | +| 2 | Open for reading and writing | +| 3 | Open for execution | +| 0x0008 | **Reserved** | | +| SharingMode

0x0070 | 0 | Compatibility mode | +| 1 | Deny read/write/execute to others (exclusive use requested) | +| 2 | Deny write to others | +| 3 | Deny read/execute to others | +| 4 | Deny nothing to others | +| 0x0080 | **Reserved** | | +| ReferenceLocality

0x0700 | 0 | Unknown locality of reference | +| 1 | Mainly sequential access | +| 2 | Mainly random access | +| 3 | Random access with some locality | +| 4 - 7 | **Undefined** | +| 0x0800 | **Reserved** | | +| CacheMode

0x1000 | 0 | Perform caching on file | +| 1 | Do not cache the file | +| 0x2000 | **Reserved** | | +| WritethroughMode

0x4000 | 0 | Write-through mode. If this flag is set, no read ahead or write behind allowed on this file or device. When the response is returned, data is expected to be on the target disk or device. | +| 1 | +| 0x8000 | **Reserved** | | + +**SearchAttrs (2 bytes):** The set of attributes that the file MUST have in order to be found. If none of the attribute bytes is set, the file attributes MUST refer to a regular file.[<57>](#Appendix_A_57) + +**FileAttrs (2 bytes):** The set of attributes that the file is to have if the file needs to be created. If none of the attribute bytes is set, the file attributes MUST refer to a regular file. + +**CreationTime (4 bytes):** A 32-bit integer time value to be assigned to the file as the time of creation if the file is created. + +**OpenMode (2 bytes):** A 16-bit field that controls the way a file SHOULD be treated when it is opened for use by certain extended SMB requests. + +| Name and bitmask | Values | Meaning | +| ---------------------------- | ----------------------------------------------- | ----------------------------------------------------------------------------------------- | +| FileExistsOpts

0x0003 | 0 | The request SHOULD fail and an error returned indicating the prior existence of the file. | +| 1 | The file is to be appended. | +| 2 | The file is to be truncated to zero (0) length. | +| 3 | **Reserved** | +| CreateFile

0x0010 | 0 | If the file does not exist, return an error. | +| 1 | If the file does not exist, create it. | + +All other bits are reserved, SHOULD NOT be used by the client, and MUST be ignored by the server. + +**AllocationSize (4 bytes):** The number of bytes to reserve on file creation or truncation. This field MAY be ignored by the server. + +**Timeout (4 bytes):** This field is a 32-bit unsigned integer value containing the number of milliseconds to wait on a blocked open request before returning without successfully opening the file. + +**Reserved (4 bytes):** This field is reserved and MUST be 0x00000000. + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be greater than or equal to 0x0002. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| FileName (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**FileName (variable):** A buffer containing the name of the file to be opened. + +##### Response + +The server MUST populate the **FID** field only, unless the client has requested file attribute data by setting bit 0 of the **Flags** field in the request. If file attribute data is not requested, all fields following the **FID** in the response MUST be set to zero. + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- UCHAR AndXCommand; +- UCHAR AndXReserved; +- USHORT AndXOffset; +- USHORT FID; +- SMB_FILE_ATTRIBUTES FileAttrs; +- UTIME LastWriteTime; +- ULONG FileDataSize; +- USHORT AccessRights; +- USHORT ResourceType; +- SMB_NMPIPE_STATUS NMPipeStatus; +- USHORT OpenResults; +- USHORT Reserved\[3\]; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | -------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters (31 bytes) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data | | | | | | | | +| ... | | | | | | | | + +**SMB_Parameters (31 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ---------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words (30 bytes) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x0F. + +**Words (30 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------- | --- | --- | --- | --- | --- | --- | --- | ------------ | --- | ---------- | --- | --- | --- | --- | --- | ------------ | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| AndXCommand | | | | | | | | AndXReserved | | | | | | | | AndXOffset | | | | | | | | | | | | | | | | +| FID | | | | | | | | | | | | | | | | FileAttrs | | | | | | | | | | | | | | | | +| LastWriteTime | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| FileDataSize | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| AccessRights | | | | | | | | | | | | | | | | ResourceType | | | | | | | | | | | | | | | | +| NMPipeStatus | | | | | | | | | | | | | | | | OpenResults | | | | | | | | | | | | | | | | +| Reserved | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | + +**AndXCommand (1 byte):** The command code for the next SMB command in the packet. This value MUST be set to 0xFF if there are no additional SMB command responses in the server response packet. + +**AndXReserved (1 byte):** A reserved field. This MUST be set to 0x00 when this response is sent, and the client MUST ignore this field. + +**AndXOffset (2 bytes):** This field MUST be set to the offset, in bytes, from the start of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) to the start of the **WordCount** field in the next SMB command response in this packet. This field is valid only if the **AndXCommand** field is not set to 0xFF. If **AndXCommand** is 0xFF, this field MUST be ignored by the client. + +**FID (2 bytes):** A valid FID representing the open instance of the file. + +**FileAttrs (2 bytes):** The actual file system attributes of the file. If none of the attribute bytes is set, the file attributes refer to a regular file. + +**LastWriteTime (4 bytes):** A 32-bit integer time value of the last modification to the file. + +**FileDataSize (4 bytes):** The number of bytes in the file. This field is advisory and MAY be used. + +**AccessRights (2 bytes):** A 16-bit field that shows granted access rights to the file. + +| Name andvalue | Meaning | +| -------------------------------------- | ----------------- | +| SMB_DA_ACCESS_READ

0x0000 | Read-only Access | +| SMB_DA_ACCESS_WRITE

0x0001 | Write-only Access | +| SMB_DA_ACCESS_READ_WRITE

0x0002 | Read/Write Access | + +All other values are reserved and MUST NOT be used. + +**ResourceType (2 bytes):** A 16-bit field that shows the resource type opened. + +| Name and value | Meaning | +| ------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| FileTypeDisk

0x0000 | Disk file or directory. | +| FileTypeByteModePipe

0x0001 | [**Byte mode**](#gt_8586fe9a-1cfa-458a-a145-8db64d69c69c) named pipe. | +| FileTypeMessageModePipe

0x0002 | Message-mode named pipe. | +| FileTypePrinter

0x0003 | Printer device. | +| FileTypeCommDevice

0x0004 | Character-mode device. When an extended protocol has been negotiated, this value allows a device to be opened for driver-level I/O. This provides direct access to real-time and interactive devices such as modems, scanners, and so on. | +| FileTypeUnknown

0xFFFF | Unknown file type. | + +All other values are reserved and MUST NOT be used. + +**NMPipeStatus (2 bytes):** A 16-bit field that contains the status of the named pipe if the resource type opened is a named pipe. + +This field is formatted as an SMB_NMPIPE_STATUS (section [2.2.1.3](#Section_6911a7095dfb4ffbb0903e8ef872f85c)). + +**OpenResults (2 bytes):** A 16-bit field that shows the results of the open operation. + +| Name and

bitmask | Values | Meaning | +| ------------------------ | -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| OpenResult

0x0003 | 1 | The file existed and was opened. | +| 2 | The file did not exist and was therefore created. | +| 3 | The file existed and was truncated. | +| Other | **Reserved** | +| LockStatus

0x8000 | 0 | No OpLock was requested, the OpLock could not be granted, or the server does not support OpLocks. | +| 1 | An OpLock was requested by the client and was granted by the server. | + +**Reserved (6 bytes):** All entries MUST be 0x0000. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ---------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRbadfile

(0x0002) | STATUS_NO_SUCH_FILE

(0xC000000F) | ENOENT | The named file was not found. | +| ERRDOS

(0x01) | ERRbadpath

(0x0003) | STATUS_OBJECT_PATH_SYNTAX_BAD

(0xC000003B) | ENOENT | The file path syntax is invalid. | +| ERRDOS

(0x01) | ERRbadpath

(0x0003) | STATUS_OBJECT_PATH_INVALID

(0xC0000039) | ENOTDIR | A component of the path-prefix was not a directory. | +| ERRDOS

(0x01) | ERRnofids

(0x0004) | STATUS_OS2_TOO_MANY_OPEN_FILES

(0x00040001)

STATUS_TOO_MANY_OPENED_FILES

(0xC000011F) | ENFILE | Too many open files, no more FIDs available. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | EACCESS | A component of the path-prefix denied search permission OR requested access permission is denied for the file OR open mode failure. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_FILE_IS_A_DIRECTORY

(0xC00000BA) | EISDIR | Named file is an existing directory and requested open mode is write or read/write. | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRDOS

(0x01) | ERRbadshare

(0x0020) | STATUS_SHARING_VIOLATION

(0xC0000043) | EAGAIN | File exists, mandatory file/record locking is set, and there are outstanding record locks on the file. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. Not enough parameter bytes were sent or the ANDX command is invalid. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | | EFAULT | Path points outside the allocated address space of the process. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | | EINTR | A signal was caught during the open operation. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | | ENXIO | Generic server open failure | +| ERRSRV

(0x02) | ERRerror (0x0001) | | EEXIST | The file could not be created because another file with attributes that do not match those specified in the **SMB_Parameters.Words.FileAttrs** field already exists and has a conflicting name. | +| ERRSRV

(0x02) | ERRerror (0x0001) | | EMFILE | The maximum number of file descriptors available on the server for this session are currently open. | +| ERRSRV

(0x02) | ERRerror (0x0001) | | ENOSPC | No space left on device. The system is out of resources required to create the file. | +| ERRSRV

(0x02) | ERRerror (0x0001) | | EROFS | Read-Only File System. Write or read/write access was requested on a file existing within a read-only file system. | +| ERRSRV

(0x02) | ERRerror (0x0001) | | ETXTBSY | Text file is busy. Write or read/write access was requested on a batch script that is currently being executed. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_ACCESS_DENIED

(0xC0000022) | EROFS | Named file resides on read-only file system, and requested access permission is write or read/write. | +| ERRSRV

(0x02) | ERRaccess

(0x0004) | STATUS_NETWORK_ACCESS_DENIED

(0xC00000CA) | | Permission conflict between requested permission and permissions for the shared resource: for example, open for write of a file in a read-only file system subtree. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** is no longer valid. | +| ERRSRV

(0x02) | ERRinvdevice

(0x0007) | STATUS_BAD_DEVICE_TYPE

(0xC00000CB) | | Server does not support the requested device type. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** supplied is not defined to the session, or the user identified by the **UID** does not have sufficient privileges. | +| ERRHRD

(0x03) | ERRnowrite

(0x0013) | STATUS_MEDIA_WRITE_PROTECTED

(0xC00000A2) | EROFS | Attempt to write to a read-only file system. | +| ERRHRD

(0x03) | ERRdata

(0x0017) | STATUS_DATA_ERROR

(0xC000003E) | EIO | Disk I/O error. | + +#### SMB_COM_READ_ANDX (0x2E) + +This command was introduced in the **LAN Manager 1.0** dialect. Extensions to this command were added with the introduction of the [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) dialect. + +This command is used to read bytes from a regular file, a named pipe, or a directly accessible device such as a serial port (COM) or printer port (LPT). If the client negotiates the NT LAN Manager dialect or later, the client SHOULD use the 12-parameter words version of the request, as this version allows specification of 64-bit file offsets. This is the only read command that supports 64-bit file offsets. + +The following are the commands that can follow an SMB_COM_READ_ANDX in an AndX chain: + +- [SMB_COM_CLOSE (section 2.2.4.5)](#Section_10059dd2ae0a48a2a95ca92505e9145f) + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- UCHAR AndXCommand; +- UCHAR AndXReserved; +- USHORT AndXOffset; +- USHORT FID; +- ULONG Offset; + +- USHORT MaxCountOfBytesToReturn; +- USHORT MinCountOfBytesToReturn; +- ULONG Timeout; +- USHORT Remaining; +- ULONG OffsetHigh (optional); +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | -------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters (25 bytes) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | SMB_Data | | | | | | | | | | | | | | | | + +**SMB_Parameters (25 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ---------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words (24 bytes) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | + +**WordCount (1 byte):** This field MUST be either 0x0A or 0x0C. + +**Words (24 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------------------- | --- | --- | --- | --- | --- | --- | --- | ------------ | --- | ---------- | --- | --- | --- | --- | --- | ----------------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| AndXCommand | | | | | | | | AndXReserved | | | | | | | | AndXOffset | | | | | | | | | | | | | | | | +| FID | | | | | | | | | | | | | | | | Offset | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | MaxCountOfBytesToReturn | | | | | | | | | | | | | | | | +| MinCountOfBytesToReturn | | | | | | | | | | | | | | | | Timeout | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | Remaining | | | | | | | | | | | | | | | | +| OffsetHigh | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**AndXCommand (1 byte):** The command code for the next SMB command in the packet. This value MUST be set to 0xFF if there are no additional SMB commands in the client request packet. + +**AndXReserved (1 byte):** A reserved field. This MUST be set to 0x00 when this request is sent, and the server MUST ignore this value when the message is received. + +**AndXOffset (2 bytes):** This field MUST be set to the offset in bytes from the start of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) to the start of the **WordCount** field in the next SMB command in this packet. This field is valid only if the **AndXCommand** field is not set to 0xFF. If **AndXCommand** is 0xFF, this field MUST be ignored by the server. + +**FID (2 bytes):** This field MUST be a valid [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) indicating the file from which the data MUST be read. + +**Offset (4 bytes):** If **WordCount** is 0x0A, this field represents a 32-bit offset, measured in bytes, of where the read MUST start relative to the beginning of the file. If **WordCount** is 0x0C, this field represents the lower 32 bits of a 64-bit offset. + +**MaxCountOfBytesToReturn (2 bytes):** The maximum number of bytes to read. A single request MUST NOT return more data than permitted by the maximum negotiated buffer size (**MaxBufferSize**) for the session unless CAP_LARGE_READX has been negotiated as specified in sections [2.2.4.53.1](#Section_81e15dee8fb6410286447eaa7ded63f7) and [3.3.5.43](#Section_905fbe981fe540e9b17a22ec8b17f7b3). If **MaxCountOfBytesToReturn** would cause the total size of the response message to exceed the maximum negotiated buffer size, the server MUST return only the number of bytes that fit within the maximum negotiated buffer size. + +**MinCountOfBytesToReturn (2 bytes):** The requested minimum number of bytes to return. This field is used only when reading from a named pipe or a device. It is ignored when reading from a standard file. + +**Timeout (4 bytes):** This field represents the amount of time, in milliseconds, that a server MUST wait before sending a response. It is used only when reading from a named pipe or I/O device and does not apply when reading from a regular file. + +**Remaining (2 bytes):** Count of bytes remaining to satisfy client's read request. This field is not used in the **NT LAN Manager** dialect. Clients MUST set this field to 0x0000, and servers MUST ignore it. + +**OffsetHigh (4 bytes):** This field is optional. If **WordCount** is 0x0A this field is not included in the request. If **WordCount** is 0x0C this field represents the upper 32 bits of a 64-bit offset, measured in bytes, of where the read SHOULD start relative to the beginning of the file. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- UCHAR AndXCommand; +- UCHAR AndXReserved; +- USHORT AndXOffset; +- USHORT Available; +- USHORT DataCompactionMode; +- USHORT Reserved1; +- USHORT DataLength; +- USHORT DataOffset; +- USHORT Reserved2\[5\]; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR Pad\[\] (optional); +- UCHAR Data\[DataLength\]; +- } +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | ------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters (25 bytes) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | SMB_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (25 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ---------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words (24 bytes) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x0C. + +**Words (24 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------- | --- | --- | --- | --- | --- | --- | --- | ------------ | --- | ---------- | --- | --- | --- | --- | --- | ------------------ | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| AndXCommand | | | | | | | | AndXReserved | | | | | | | | AndXOffset | | | | | | | | | | | | | | | | +| Available | | | | | | | | | | | | | | | | DataCompactionMode | | | | | | | | | | | | | | | | +| Reserved1 | | | | | | | | | | | | | | | | DataLength | | | | | | | | | | | | | | | | +| DataOffset | | | | | | | | | | | | | | | | Reserved2 | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**AndXCommand (1 byte):** The command code for the next SMB command in the packet. This value MUST be set to [SMB_COM_NO_ANDX_COMMAND (section 2.2.4.75)](#Section_10921e06804f4b5a92a51cc562f43068) (0xFF) if there are no additional SMB command responses in the server response packet.[<58>](#Appendix_A_58) + +**AndXReserved (1 byte):** A reserved field. This MUST be set to 0x00 when this response is sent, and the client MUST ignore this field. + +**AndXOffset (2 bytes):** This field MUST be set to the offset in bytes from the start of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) to the start of the **WordCount** field in the next SMB command response in this packet. This field is valid only if the **AndXCommand** field is not set to SMB_COM_NO_ANDX_COMMAND (0xFF). If **AndXCommand** is SMB_COM_NO_ANDX_COMMAND, this field MUST be ignored by the client.[<59>](#Appendix_A_59) + +**Available (2 bytes):** This field is valid when reading from [**named pipes**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca). This field indicates the number of bytes remaining to be read after the requested read was completed. + +**DataCompactionMode (2 bytes):** Reserved and SHOULD be 0x0000. + +**Reserved1 (2 bytes):** This field MUST be 0x0000. + +**DataLength (2 bytes):** The number of data bytes included in the response. If this value is less than the value in the **Request.SMB_Parameters.MaxCountOfBytesToReturn** field, it indicates that the read operation has reached the end of the file (EOF). + +**DataOffset (2 bytes):** The offset in bytes from the header of the read data. + +**Reserved2 (10 bytes):** Reserved. All entries MUST be 0x0000. The last 5 words are reserved in order to make the SMB_COM_READ_ANDX Response (section 2.2.4.42.2) the same size as the [SMB_COM_WRITE_ANDX Response (section 2.2.4.43.2)](#Section_43a10562269f4536b46017b494405cc4). + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be greater than or equal to 0x0000. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --- | --- | --- | --- | --- | --- | --- | --- | --------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Pad | | | | | | | | Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Pad (1 byte):** This field is optional. When using the [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) dialect, this field can be used to align the **Data** field to a 16-bit boundary relative to the start of the SMB Header. If **Unicode strings** are being used, this field MUST be present. When used, this field MUST be one padding byte long. + +**Data (variable):** The actual bytes read in response to the request. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ------------------------------ | ------------------------------------------------------------------------------------------------ | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_ALREADY_COMMITTED

(0xC0000021) | ENOLCK | Attempt to read from a portion of the file that the server detects has been locked or been opened in deny-read. | +| ERRDOS

(0x01) | ERRbadfid

(0x0006) | STATUS_INVALID_HANDLE

(0xC0000008)

STATUS_SMB_BAD_FID

(0x00060001) | ENFILE | Attempt to read from a FID that the server does not have open. | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRDOS

(0x01) | ERRbadaccess

(0x000C) | STATUS_ACCESS_DENIED

(0xC0000022) | | Invalid open mode for the attempted operation. | +| ERRDOS

(0x01) | ERRlock

(0x0021) | STATUS_FILE_LOCK_CONFLICT

(0xC0000054)

STATUS_LOCK_NOT_GRANTED

(0xC0000055) | EAGAIN | The requested byte range was already locked by a different process ([**PID**](#gt_38a420dd-6f31-456e-ae5c-63ec6905380d)). | +| ERRDOS

(0x01) | ERReof

(0x0026) | STATUS_END_OF_FILE

(0xC0000011) | | Attempted to read beyond the end of the file.[<60>](#Appendix_A_60) | +| ERRDOS

(0x01) | ERRpipebusy

(0x00E7) | STATUS_PIPE_BUSY

(0xC00000AE) | EAGAIN | Attempted to read from a busy pipe. | +| ERRDOS

(0x01) | ERRpipeclosing

(0x00E8) | STATUS_PIPE_EMPTY

(0xC00000D9) | | Attempted to read from an empty pipe. | +| ERRDOS

(0x01) | ERRmoredata

(0x00EA) | STATUS_BUFFER_OVERFLOW

(0x80000005) | | The message on a [**message mode**](#gt_c49a48e8-f1ac-4568-bc87-0672eb08868b) named pipe exceeds the requested number of bytes. The server MUST send a full SMB_COM_READ response with this error code. The requested number of bytes are read and returned to the client. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | | EBADF | The FID was validated by the server but unacceptable to the system. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | | EDEADLK | The read would block and deadlock would result. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | A corrupt request has been encountered. | +| ERRSRV

(0x02) | ERRinvdevice

(0x0007) | STATUS_BAD_DEVICE_TYPE

(0xC00000CB) | | Attempt to read from an open spool file. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | Invalid TID in request. | +| ERRSRV

(0x02) | ERRtimeout

(0x0058) | | | The requested operation on a named pipe or an I/O device has timed out. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The UID specified is not defined as a valid ID for this session, or the user identified by the UID does not have sufficient privileges. | +| ERRHRD

(0x03) | ERRdata

(0x0017) | STATUS_DATA_ERROR

(0xC000003E) | EIO | A problem has occurred in the physical I/O. | +| ERRHRD

(0x03) | ERRread

(0x001E) | | ENXIO | The device associated with the file descriptor is a block-special or character-special file and the value of the file pointer is out of range. | + +#### SMB_COM_WRITE_ANDX (0x2F) + +This command was introduced in the **LAN Manager 1.0** dialect. + +This request is used to write bytes to a regular file, a named pipe, or a directly accessible I/O device such as a serial port (COM) or printer port (LPT). If the client negotiates the [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) dialect or later the client SHOULD use the 14-parameter word version of the request, as this version allows specification of 64-bit file offsets. This is the only write command that supports 64-bit file offsets. + +The following are the commands that can follow an SMB_COM_WRITE_ANDX in an AndX chain: + +- [SMB_COM_READ (section 2.2.4.11)](#Section_b88922ddb18e46e09f7408eaace9a95c) +- [SMB_COM_READ_ANDX (section 2.2.4.42)](#Section_129aa093574b483ea55ddf334606a622) +- [SMB_COM_LOCK_AND_READ (section 2.2.4.20)](#Section_88a423e782324b22904dd9e6cc0a226e) +- [SMB_COM_CLOSE (section 2.2.4.5)](#Section_10059dd2ae0a48a2a95ca92505e9145f) + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- UCHAR AndXCommand; +- UCHAR AndXReserved; +- USHORT AndXOffset; +- USHORT FID; +- ULONG Offset; +- ULONG Timeout; +- USHORT WriteMode; +- USHORT Remaining; +- USHORT Reserved; +- USHORT DataLength; +- USHORT DataOffset; +- ULONG OffsetHigh (optional); +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR Pad; +- UCHAR Data\[DataLength\]; +- } +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| SMB_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ---------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be either 0x0C or 0x0E. + +**Words (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------- | --- | --- | --- | --- | --- | --- | --- | ------------ | --- | ---------- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| AndXCommand | | | | | | | | AndXReserved | | | | | | | | AndXOffset | | | | | | | | | | | | | | | | +| FID | | | | | | | | | | | | | | | | Offset | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | Timeout | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | WriteMode | | | | | | | | | | | | | | | | +| Remaining | | | | | | | | | | | | | | | | Reserved | | | | | | | | | | | | | | | | +| DataLength | | | | | | | | | | | | | | | | DataOffset | | | | | | | | | | | | | | | | +| OffsetHigh | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**AndXCommand (1 byte):** The command code for the next SMB command in the packet. This value MUST be set to 0xFF if there are no additional SMB commands in the client request packet. + +**AndXReserved (1 byte):** A reserved field. This MUST be set to 0x00 when this request is sent, and the server MUST ignore this value when the message is received. + +**AndXOffset (2 bytes):** This field MUST be set to the offset in bytes from the start of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) to the start of the **WordCount** field in the next SMB command in this packet. This field is valid only if the AndXCommand field is not set to 0xFF. If AndXCommand is 0xFF, this field MUST be ignored by the server. + +**FID (2 bytes):** This field MUST be a valid FID indicating the file to which the data SHOULD be written. + +**Offset (4 bytes):** If **WordCount** is 0x0C, this field represents a 32-bit offset, measured in bytes, of where the write SHOULD start relative to the beginning of the file. If **WordCount** is 0xE, this field represents the lower 32 bits of a 64-bit offset. + +**Timeout (4 bytes):** This field is the time-out, in milliseconds, to wait for the write to complete. This field is used only when writing to a [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca) or an I/O device. It does not apply and MUST be 0x00000000 when writing to a regular file. + +**WriteMode (2 bytes):** A 16-bit field containing flags defined as follows: + +| Name and bitmask | Meaning | +| -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | +| WritethroughMode

0x0001 | If set the server MUST NOT respond to the client before the data is written to disk (write-through). | +| ReadBytesAvailable

0x0002 | If set the server SHOULD set the **Response.SMB_Parameters.Available** field correctly for writes to named pipes or I/O devices. | +| RAW_MODE

0x0004 | Applicable to named pipes only. If set, the named pipe MUST be written to in raw mode (no translation). | +| MSG_START

0x0008 | Applicable to named pipes only. If set, this data is the start of a message. | + +**Remaining (2 bytes):** This field is an advisory field telling the server approximately how many bytes are to be written to this file before the next non-write operation. It SHOULD include the number of bytes to be written by this request. The server MAY either ignore this field or use it to perform optimizations. If a pipe write spans multiple requests, the client SHOULD set this field to the number of bytes remaining to be written.[<61>](#Appendix_A_61) + +**Reserved (2 bytes):** This field MUST be 0x0000. + +**DataLength (2 bytes):** This field is the number of bytes included in the **SMB_Data** that are to be written to the file. + +**DataOffset (2 bytes):** The offset in bytes from the start of the SMB Header (section 2.2.3.1) to the start of the data that is to be written to the file. The offset is relative to the start of the SMB Header (section 2.2.3.1), regardless of the command request's position in an AndX chain. Specifying this offset allows a client to efficiently align the data buffer. + +The **DataOffset** field can be used to relocate the **SMB_Data.Bytes.Data** block to the end of the message, even if the message is a multi-part AndX chain. If the **SMB_Data.Bytes.Data** block is relocated, the contents of **SMB_Data.Bytes** will not be contiguous. + +Consider, for example, an SMB_COM_WRITE_ANDX + SMB_COM_CLOSE AndX chain. The client can specify a value for **SMB_Parameters.Words.DataOffset** that relocates the **SMB_Data.Bytes.Data** block to the end of the message, beyond the SMB_COM_CLOSE, even though the **Data** block is part of the SMB_COM_WRITE_ANDX request. In this case, the message would be structured as follows: + +- The SMB Header (section 2.2.3.1), with a command code of SMB_COM_WRITE_ANDX. +- The complete **SMB_Parameters** block of the SMB_COM_WRITE_ANDX. +- The **SMB_Data** block of the SMB_COM_WRITE_ANDX: + - The value of **SMB_Data.ByteCount** is equal to 1 + **SMB_Parameters.Words.DataLength**. The additional 1 byte is to account for the **SMB_Data.Bytes.Pad** byte. + - The **SMB_Data.Bytes.Pad** byte. + - The **SMB_Data.Bytes.Data** block is not included because it has been relocated. +- The **SMB_Parameters** block of the SMB_COM_CLOSE follows immediately after the **SMB_Data.Bytes.Pad** byte of the SMB_COM_WRITE_ANDX. The location of the **SMB_Parameters** block of the SMB_COM_CLOSE, relative to the start of the SMB Header (section 2.2.3.1), is specified by the offset given in the **SMB_Parameters.AndXOffset** field of the SMB_COM_WRITE_ANDX portion of the message. +- The **SMB_Data** block of the SMB_COM_CLOSE (consisting of a **ByteCount** of 0x0000). +- Optional padding follows the **SMB_Data** block of the SMB_COM_CLOSE. If present, the padding is used to align the **SMB_Data.Bytes.Data** block to a 16- or 32-bit boundary. +- The **SMB_Data.Bytes.Data** block, which is **SMB_Parameters.Words.DataLength** bytes in length. The location of the **SMB_Data.Bytes.Data** block within the message, relative to the start of the SMB Header (section 2.2.3.1), is indicated by the **SMB_Parameters.Words.DataOffset** field in the SMB_COM_WRITE_ANDX portion of the request. + +**OffsetHigh (4 bytes):** This field is optional. If **WordCount** is 0x0C, this field is not included in the request. If **WordCount** is 0x0E, this field represents the upper 32 bits of a 64-bit offset, measured in bytes, of where the write SHOULD start relative to the beginning of the file. + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be greater than or equal to 0x0001. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --- | --- | --- | --- | --- | --- | --- | --- | --------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Pad | | | | | | | | Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Pad (1 byte):** Padding byte that MUST be ignored. + +**Data (variable):** The bytes to be written to the file. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- UCHAR AndXCommand; +- UCHAR AndXReserved; +- USHORT AndXOffset; +- USHORT Count; +- USHORT Available; + +- ULONG Reserved; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | ------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters (13 bytes) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | SMB_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (13 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x06. The length in two-byte words of the remaining SMB_Parameters. + +**Words (12 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------- | --- | --- | --- | --- | --- | --- | --- | ------------ | --- | ---------- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| AndXCommand | | | | | | | | AndXReserved | | | | | | | | AndXOffset | | | | | | | | | | | | | | | | +| Count | | | | | | | | | | | | | | | | Available | | | | | | | | | | | | | | | | +| Reserved | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**AndXCommand (1 byte):** The command code for the next [**SMB command**](#gt_dbae2612-173d-4988-9301-86cb559029f9) in the packet. This value MUST be set to 0xFF if there are no additional SMB command responses in the server response packet. + +**AndXReserved (1 byte):** A reserved field. This MUST be set to 0x00 when this response is sent, and the client MUST ignore this field. + +**AndXOffset (2 bytes):** This field MUST be set to the offset in bytes from the start of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) to the start of the **WordCount** field in the next SMB command response in this packet. This field is valid only if the **AndXCommand** field is not set to 0xFF. If **AndXCommand** is 0xFF, this field MUST be ignored by the client. + +**Count (2 bytes):** The number of bytes written to the file. + +**Available (2 bytes):** This field is valid when writing to [**named pipes**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca) or I/O devices. This field indicates the number of bytes remaining to be written after the requested write was completed. If the client wrote to a disk file, this field MUST be set to 0xFFFF.[<62>](#Appendix_A_62) + +**Reserved (4 bytes):** This field MUST be 0x00000000. + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| --------------------- | ------------------------------- | --------------------------------------------------------------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| SUCCESS

(0x00) | SUCCESS

(0x0000) | STATUS_SUCCESS

(0x00000000) | EFBIG | The file has grown too large and no more data can be written to the file. A **Count** of zero (0x0000) MUST be returned to the client in the server response. This indicates to the client that the file system is full. | +| SUCCESS

(0x00) | SUCCESS

(0x0000) | STATUS_SUCCESS

(0x00000000) | NOSPC | No space on the file system. The server MUST return a zero (0x0000) in the **Count** field of the response. This indicates that the file system is full. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | | EAGAIN | Resources for I/O on the server are temporarily exhausted. | +| ERRDOS

(0x01) | ERRlock

(0x0021) | STATUS_FILE_LOCK_CONFLICT

(0xC0000054) | ENOLCK | A record lock has been taken on the file or the client has attempted to write to a portion of the file that the server detects has been locked. | +| ERRDOS

(0x01) | ERRbadfid

(0x0006) | STATUS_INVALID_HANDLE

(0xC0000008)

STATUS_SMB_BAD_FID

(0x00060001) | ENFILE | Invalid FID, or FID mapped to a valid server FID but it was not acceptable to the operating system. | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRDOS

(0x01) | ERRbadaccess

(0x000C) | STATUS_ACCESS_DENIED

(0xC0000022) | | Write permission required. | +| ERRDOS

(0x01) | ERRlock

(0x0021) | STATUS_FILE_LOCK_CONFLICT

(0xC0000054) | | The requested byte range was already locked by a different process (PID). | +| ERRDOS

(0x01) | ERRpipebusy

(0x00E7) | STATUS_PIPE_BUSY

(0xC00000AE) | EAGAIN | Attempted to read from a busy pipe. | +| ERRDOS

(0x01) | ERRnotconnected

(0x00E9) | STATUS_PIPE_DISCONNECTED

(0xC00000B0) | EPIPE | Write to a named pipe with no reader. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | | EDEADLK | The write would block due to locking and deadlock would result. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | | ERANGE | Attempted write size is outside of the minimum or maximum ranges that can be written to the supplied FID. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | A corrupt or invalid [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) request was received. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | Invalid TID in request. | +| ERRSRV

(0x02) | ERRqfull

(0x0031) | STATUS_PRINT_QUEUE_FULL

(0xC00000C6) | | Print queue is full--too many queued items. | +| ERRSRV

(0x02) | ERRqtoobig

(0x0032) | STATUS_NO_SPOOL_SPACE

(0xC00000C7) | | Print queue is full--too many queued items. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** specified is not known as a valid ID on this server session, or the user identified by the **UID** does not have sufficient privileges. | +| ERRHRD

(0x03) | ERRdata

(0x0017) | STATUS_DATA_ERROR

(0xC000003E) | EIO | A problem has occurred in the physical I/O. | +| ERRHRD

(0x03) | ERRwrite

(0x001D) | | ENXIO | The device associated with the file descriptor is a block-special or character-special file and the value of the file pointer is out of range. | +| ERRHRD

(0x03) | ERRdiskfull

(0x0027) | STATUS_DISK_FULL

(0xC000007F) | ENOSPC | The file system is full. | + +#### SMB_COM_NEW_FILE_SIZE (0x30) + +This command was **reserved but not implemented**. It was also never defined. It is listed in [\[SNIA\]](https://go.microsoft.com/fwlink/?LinkId=90519), but it is not defined in that document and does not appear in any other references. + +Clients SHOULD NOT send requests using this command code, and servers receiving requests with this command code SHOULD return STATUS_NOT_IMPLEMENTED (ERRDOC/ERRbadfunc).[<63>](#Appendix_A_63) + +#### SMB_COM_CLOSE_AND_TREE_DISC (0x31) + +This command was introduced in the [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) dialect, and was **reserved but not implemented.** + +Clients SHOULD NOT send requests using this command code. Servers receiving requests with this command code SHOULD return STATUS_NOT_IMPLEMENTED (ERRDOS/ERRbadfunc).[<64>](#Appendix_A_64) + +#### SMB_COM_TRANSACTION2 (0x32) + +This command was introduced in the **LAN Manager 1.2** dialect. + +SMB_COM_TRANSACTION2 subcommands provide support for a richer set of server-side file system semantics. The "Trans2 subcommands", as they are called, allow clients to set and retrieve Extended Attribute key/value pairs, make use of long file names (longer than the original 8.3 format names), and perform directory searches, among other tasks. + +The client indicates that it has not sent all of the **Data** bytes by setting **DataCount** to a value less than **TotalDataCount**. Similarly, if **ParameterCount** is less than **TotalParameterCount**, then the client has more **Parameter** bytes to send. **Parameter** bytes SHOULD be sent before **Data** bytes, and clients SHOULD attempt to send as many bytes as possible in each message. Servers SHOULD be prepared, however, to accept **Parameters** and **Data** in any order, in large or small amounts. + +For both the request and the response, the positions and lengths of the **SMB_Data.Trans2_Parameters** and **SMB_Data.Trans2_Data** fields are determined by the values of the **SMB_Parameters.ParameterOffset**, **SMB_Parameters.ParameterCount**, **SMB_Parameters.DataOffset**, and **SMB_Parameters.DataCount** fields. In addition, the **SMB_Parameters.ParameterDisplacement** and **SMB_Parameters.DataDisplacement** fields can be used to change the order in which subranges of bytes are transferred. Servers SHOULD transfer bytes in order and give precedence to **SMB_Data.Trans2_Parameters** bytes. Clients SHOULD be prepared to reconstruct transaction **SMB_Data.Trans2_Parameters** and **SMB_Data.Trans_Data**, regardless of the order or locations in which they are delivered. + +##### Request + +The SMB_COM_TRANSACTION2 request format is similar to that of the SMB_COM_TRANSACTION request except for the **Name** field. The differences are in the subcommands supported, and in the purposes and usages of some of the fields. + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT TotalParameterCount; +- USHORT TotalDataCount; +- USHORT MaxParameterCount; +- USHORT MaxDataCount; +- UCHAR MaxSetupCount; +- UCHAR Reserved1; +- USHORT Flags; +- ULONG Timeout; +- USHORT Reserved2; +- USHORT ParameterCount; +- USHORT ParameterOffset; +- USHORT DataCount; +- USHORT DataOffset; +- UCHAR SetupCount; +- UCHAR Reserved3; +- USHORT Setup\[SetupCount\]; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR Name; +- UCHAR Pad1\[\]; +- UCHAR Trans2_Parameters\[ParameterCount\]; +- UCHAR Pad2\[\]; +- UCHAR Trans2_Data\[DataCount\]; +- } +- } + +**SMB_Header:** + +The **Command** for the initial request and for all responses MUST be SMB_COM_TRANSACTION2 (0x32). The **Command** for secondary request messages that are part of the same transaction MUST be SMB_COM_TRANSACTION2_SECONDARY (0x33). The **PID**, **MID**, **TID**, and **UID** MUST be the same for all requests and responses that are part of the same transaction. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (variable):** + +The SMB_Parameters section of the SMB_COM_TRANSACTION2 request contains the information used to manage the transaction itself. It also contains flags and setup information that provide context for the execution of the operation on the server side. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------- | --- | --- | --- | --- | --- | --- | --- | ---------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| SMB_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** The value of **Words.SetupCount** plus 14 (0x0E). This value represents the total number of SMB parameter words and MUST be greater than or equal to 14 (0x0E). + +**Words (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------- | --- | --- | --- | --- | --- | --- | --- | --------- | --- | ---------- | --- | --- | --- | --- | --- | -------------- | --- | --- | --- | ---------- | --- | --- | --- | --------- | --- | --- | --- | --- | --- | ---------- | --- | +| TotalParameterCount | | | | | | | | | | | | | | | | TotalDataCount | | | | | | | | | | | | | | | | +| MaxParameterCount | | | | | | | | | | | | | | | | MaxDataCount | | | | | | | | | | | | | | | | +| MaxSetupCount | | | | | | | | Reserved1 | | | | | | | | Flags | | | | | | | | | | | | | | | | +| Timeout | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Reserved2 | | | | | | | | | | | | | | | | ParameterCount | | | | | | | | | | | | | | | | +| ParameterOffset | | | | | | | | | | | | | | | | DataCount | | | | | | | | | | | | | | | | +| DataOffset | | | | | | | | | | | | | | | | SetupCount | | | | | | | | Reserved3 | | | | | | | | +| Setup (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**TotalParameterCount (2 bytes):** The total number of SMB_COM_TRANSACTION2 parameter bytes to be sent in this transaction request. This value MAY be reduced in any or all subsequent SMB_COM_TRANSACTION2_SECONDARY requests that are part of the same transaction. This value represents transaction parameter bytes, not SMB parameter words. Transaction parameter bytes are carried in the SMB_Data block of the SMB_COM_TRANSACTION2 request. + +**TotalDataCount (2 bytes):** The total number of SMB_COM_TRANSACTION2 data bytes to be sent in this transaction request. This value MAY be reduced in any or all subsequent SMB_COM_TRANSACTION2_SECONDARY requests that are part of the same transaction. This value represents transaction data bytes, not SMB data bytes. + +**MaxParameterCount (2 bytes):** The maximum number of parameter bytes that the client will accept in the transaction reply. The server MUST NOT return more than this number of parameter bytes. + +**MaxDataCount (2 bytes):** The maximum number of data bytes that the client will accept in the transaction reply. The server MUST NOT return more than this number of data bytes. + +**MaxSetupCount (1 byte):** The maximum number of setup bytes that the client will accept in the transaction reply. The server MUST NOT return more than this number of setup bytes. + +**Reserved1 (1 byte):** A padding byte. This field MUST be zero. Existing CIFS implementations MAY combine this field with **MaxSetupCount** to form a USHORT. If **MaxSetupCount** is defined as a USHORT, the high order byte MUST be 0x00. + +**Flags (2 bytes):** A set of bit flags that alter the behavior of the requested operation. Unused bit fields MUST be set to zero by the client sending the request, and MUST be ignored by the server receiving the request. The client MAY set either or both of the following bit flags: + +| Name and bitmask | Meaning | +| ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| DISCONNECT_TID

0x0001 | If set, following the completion of the operation the server MUST disconnect the tree connect associated with the tree identifier (TID) field received in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) of this request. The client SHOULD NOT send a subsequent SMB_COM_TREE_DISCONNECT for this tree connect. | +| NO_RESPONSE

0x0002 | This is a one-way transaction. The server MUST attempt to complete the transaction, but SHOULD NOT send a response to the client.[<65>](#Appendix_A_65) | + +**Timeout (4 bytes):** The number of milliseconds that the server waits for completion of the transaction before generating a time-out. A value of 0x00000000 indicates that the operation is not blocked.[<66>](#Appendix_A_66) + +**Reserved2 (2 bytes):** Reserved. This field MUST be 0x0000 in the client request. The server MUST ignore the contents of this field. + +**ParameterCount (2 bytes):** The number of transaction parameter bytes being sent in this SMB message. If the transaction fits within a single SMB_COM_TRANSACTION2 request, then this value MUST be equal to **TotalParameterCount**. Otherwise, the sum of the **ParameterCount** values in the primary and secondary transaction request messages MUST be equal to the smallest **TotalParameterCount** value reported to the server. If the value of this field is less than the value of **TotalParameterCount**, then at least one SMB_COM_TRANSACTION2_SECONDARY message MUST be used to transfer the remaining parameter bytes. The **ParameterCount** field MUST be used to determine the number of transaction parameter bytes contained within the SMB_COM_TRANSACTION2 message. + +**ParameterOffset (2 bytes):** The offset, in bytes, from the start of the SMB_Header to the transaction parameter bytes. This MUST be the number of bytes from the start of the SMB message to the start of the **SMB_Data.Bytes.Parameters** field. Server implementations MUST use this value to locate the transaction parameter block within the SMB message. If **ParameterCount** is zero, the client/server MAY set this field to zero.[<67>](#Appendix_A_67) + +**DataCount (2 bytes):** The number of transaction data bytes being sent in this SMB message. If the transaction fits within a single SMB_COM_TRANSACTION2 request, then this value MUST be equal to **TotalDataCount**. Otherwise, the sum of the **DataCount** values in the primary and secondary transaction request messages MUST be equal to the smallest **TotalDataCount** value reported to the server. If the value of this field is less than the value of **TotalDataCount**, then at least one SMB_COM_TRANSACTION2_SECONDARY message MUST be used to transfer the remaining data bytes. + +**DataOffset (2 bytes):** The offset, in bytes, from the start of the SMB Header (section 2.2.3.1) to the transaction data bytes. This MUST be the number of bytes from the start of the SMB message to the start of the **SMB_Data.Bytes.Data** field. Server implementations MUST use this value to locate the transaction data block within the SMB message. If **DataCount** is zero, the client/server MAY set this field to zero.[<68>](#Appendix_A_68) + +**SetupCount (1 byte):** The number of setup words that are included in the transaction request. + +**Reserved3 (1 byte):** A padding byte. This field MUST be 0x00. Existing CIFS implementations MAY combine this field with **SetupCount** to form a USHORT. If **SetupCount** is defined as a USHORT, the high order byte MUST be0x00. + +**Setup (variable):** An array of two-byte words that provide transaction context to the server. The size and content of the array are specific to individual subcommands.SMB_COM_TRANSACTION2 messages MAY exceed the maximum size of a single SMB message (as determined by the value of the **MaxBufferSize** session parameter). If this is the case, then the client MUST use one or more SMB_COM_TRANSACTION2_SECONDARY messages to transfer transaction **Data** and **Parameter** bytes that did not fit in the initial message. + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** The number of bytes in the **SMB_Data.Bytes** array. + +**Bytes (variable):** The **Name** field MUST be the first field in this section. The locations and sizes of all other fields, including the padding, are determined by the values of **ParameterOffset**, **ParameterCount**, **DataOffset**, and **DataCount**. The server SHOULD be able to read the **Parameters** and **Data** regardless of their locations within the **SMB_Data** section of the message. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ---------------------------- | --- | --- | --- | --- | --- | --- | --- | --------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Name | | | | | | | | Pad1 (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Trans2_Parameters (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Pad2 (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Trans2_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Name (1 byte):** This field is not used in SMB_COM_TRANSACTION2 requests. This field MUST be set to zero, and the server MUST ignore it on receipt. + +**Pad1 (variable):** This field MUST be used as an array of padding bytes to align the following field to a 4-byte boundary relative to the start of the SMB Header (section 2.2.3.1). This constraint can cause this field to be a zero-length field. This field SHOULD be set to zero by the client/server and MUST be ignored by the server/client. + +**Trans2_Parameters (variable):** Transaction parameter bytes. See the individual SMB_COM_TRANSACTION2 subcommand descriptions for information on parameters sent for each subcommand. + +**Pad2 (variable):** This field MUST be used as an array of padding bytes to align the following field to a 4-byte boundary relative to the start of the SMB Header. This constraint can cause this field to be a zero-length field. This field SHOULD be set to zero by the client/server and MUST be ignored by the server/client. + +**Trans2_Data (variable):** Transaction data bytes. See the individual SMB_COM_TRANSACTION2 subcommand descriptions for information on data sent for each subcommand. + +##### Response + +The SMB_COM_TRANSACTION2 response has two possible formats. The standard format is used to return the results of the completed transaction. A shortened interim response message is sent following the initial SMB_COM_TRANSACTION2 request if secondary request messages (SMB_COM_TRANSACTION2_SECONDARY) are pending. Whenever a transaction request is split across multiple SMB requests, the server MUST evaluate the initial SMB_COM_TRANSACTION2 request to determine whether or not it has the resources necessary to process the transaction. It MUST also check for any other errors it can detect based upon the initial request, and then send back an interim response. The interim response advises the client as to whether it can send the rest of the transaction to the server. + +**Interim Response** + +The format of the SMB_COM_TRANSACTION2 Interim Server Response message MUST be an [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) with an empty **Parameter** and **Data** section, and the **WordCount** and **ByteCount** fields MUST be zero. Error codes MUST be returned in the **SMB_Header.Status** field if errors occur. + +- SMB_Parameters +- { +- UCHAR WordCount; +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +If no error is returned in the SMB_COM_TRANSACTION2 Interim Server Response, the transaction MAY proceed. The client can send as many SMB_COM_TRANSACTION2_SECONDARY messages as needed in order to transfer the remainder of the transaction subcommand. The server MUST process the transaction and MUST reply with one or more SMB_COM_TRANSACTION2 response messages. + +**Final Response** + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT TotalParameterCount; +- USHORT TotalDataCount; +- USHORT Reserved1; +- USHORT ParameterCount; +- USHORT ParameterOffset; +- USHORT ParameterDisplacement; +- USHORT DataCount; +- USHORT DataOffset; +- USHORT DataDisplacement; +- UCHAR SetupCount; +- UCHAR Reserved2; +- USHORT Setup\[SetupCount\]; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR Pad1\[\]; +- UCHAR Trans2_Parameters\[ParameterCount\]; +- UCHAR Pad2\[\]; +- UCHAR Trans2_Data\[DataCount\]; +- } +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| SMB_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ---------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** The value of **Words.SetupCount** plus 10 (0x0A). This value represents the total number of SMB parameter words and MUST be greater than or equal to 10 (0x0A). + +**Words (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --------------------- | --- | --- | --- | ---------- | --- | --- | --- | --------- | --- | --- | --- | --- | --- | ---------- | --- | +| TotalParameterCount | | | | | | | | | | | | | | | | TotalDataCount | | | | | | | | | | | | | | | | +| Reserved1 | | | | | | | | | | | | | | | | ParameterCount | | | | | | | | | | | | | | | | +| ParameterOffset | | | | | | | | | | | | | | | | ParameterDisplacement | | | | | | | | | | | | | | | | +| DataCount | | | | | | | | | | | | | | | | DataOffset | | | | | | | | | | | | | | | | +| DataDisplacement | | | | | | | | | | | | | | | | SetupCount | | | | | | | | Reserved2 | | | | | | | | +| Setup (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**TotalParameterCount (2 bytes):** The total number of SMB_COM_TRANSACTION2 parameter bytes to be sent in this transaction response. This value can be reduced in any or all subsequent SMB_COM_TRANSACTION2 responses that are part of the same transaction. This value represents transaction parameter bytes, not SMB parameter words. Transaction parameter bytes are carried within in the SMB_data block. + +**TotalDataCount (2 bytes):** The total number of SMB_COM_TRANSACTION2 data bytes to be sent in this transaction response. This value MAY be reduced in any or all subsequent SMB_COM_TRANSACTION2 responses that are part of the same transaction. This value represents transaction data bytes, not SMB data bytes. + +**Reserved1 (2 bytes):** Reserved. This field MUST be 0x0000 in the client request. The server MUST ignore the contents of this field. + +**ParameterCount (2 bytes):** The number of transaction parameter bytes being sent in this SMB message. If the transaction fits within a single SMB_COM_TRANSACTION2 response, this value MUST be equal to **TotalParameterCount**. Otherwise, the sum of the **ParameterCount** values in the transaction response messages MUST be equal to the smallest **TotalParameterCount** value reported by the server. The **ParameterCount** field MUST be used to determine the number of transaction parameter bytes contained within the SMB message. + +**ParameterOffset (2 bytes):** The offset, in bytes, from the start of the SMB_Header to the transaction parameter bytes. This MUST be the number of bytes from the start of the SMB message to the start of the **SMB_Data.Bytes.Parameters** field. Server implementations MUST use this value to locate the transaction parameter block within the SMB message. If **ParameterCount** is zero, the client/server MAY set this field to zero.[<69>](#Appendix_A_69) + +**ParameterDisplacement (2 bytes):** The offset relative to all of the transaction parameter bytes in this transaction response at which this block of parameter bytes MUST be placed. This value MAY be used by the client to correctly reassemble the transaction parameters even if the SMB response messages are received out of order. + +**DataCount (2 bytes):** The number of transaction data bytes being sent in this SMB message. If the transaction fits within a single SMB_COM_TRANSACTION2 response, then this value MUST be equal to **TotalDataCount**. Otherwise, the sum of the **DataCount** values in the transaction response messages MUST be equal to the smallest **TotalDataCount** value reported by the server. + +**DataOffset (2 bytes):** The offset, in bytes, from the start of the SMB_Header to the transaction data bytes. This MUST be the number of bytes from the start of the SMB message to the start of the **SMB_Data.Bytes.Data** field. Server implementations MUST use this value to locate the transaction data block within the SMB message. If **DataCount** is zero, the client/server MAY set this field to zero.[<70>](#Appendix_A_70) + +**DataDisplacement (2 bytes):** The offset relative to all of the transaction data bytes in this transaction response at which this block of data bytes MUST be placed. This value MAY be used by the client to correctly reassemble the transaction data even if the SMB response messages are received out of order. + +**SetupCount (1 byte):** The number of setup words that are included in the transaction response. + +**Reserved2 (1 byte):** A padding byte. This field MUST be 0x00. If **SetupCount** is defined as a USHORT, the high order byte MUST be 0x00. + +**Setup (variable):** An array of two-byte words that provides transaction results from the server. The size and content of the array are specific to individual subcommands. + +**SMB_Data (variable):** + +The SMB_Data section of the SMB_COM_TRANSACTION2 response contains the parameters and data generated by the transaction subcommand. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** The number of bytes in the **SMB_Data.Bytes** array, which follows. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ---------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Pad1 (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Trans2_Parameters (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Pad2 (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Trans2_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Pad1 (variable):** This field SHOULD be used as an array of padding bytes to align the following field to a 4-byte boundary relative to the start of the SMB Header (section 2.2.3.1). This can cause this field to be a zero-length field. This field SHOULD be set to zero by the client/server and MUST be ignored by the server/client. + +**Trans2_Parameters (variable):** Transaction parameter bytes. See the individual SMB_COM_TRANSACTION2 subcommand descriptions for information on parameters returned by the server for each subcommand. + +**Pad2 (variable):** This field SHOULD be used as an array of padding bytes to align the following field to a 4 byte boundary relative to the start of the SMB Header. This constraint can cause this field to be a zero-length field. This field SHOULD be set to zero by the client/server and MUST be ignored by the server/client. + +**Trans2_Data (variable):** Transaction data bytes. See the individual SMB_COM_TRANSACTION2 subcommand descriptions for information on data returned by the server for each subcommand.[<71>](#Appendix_A_71) + +#### SMB_COM_TRANSACTION2_SECONDARY (0x33) + +This command was introduced in the **LAN Manager 1.2** dialect. + +The SMB_COM_TRANSACTION2_SECONDARY command is used to complete a data transfer initiated by an SMB_COM_TRANSACTION2 request. + +##### Request + +The SMB_COM_TRANSACTION2_SECONDARY request message differs from the [SMB_COM_TRANSACTION_SECONDARY Request (section 2.2.4.34.1)](#Section_79ece32a139d46b0ba28055f822a8c05) by the addition of the **FID** field in the **SMB_Parameters.Words** section. + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT TotalParameterCount; +- USHORT TotalDataCount; +- USHORT ParameterCount; +- USHORT ParameterOffset; +- USHORT ParameterDisplacement; +- USHORT DataCount; +- USHORT DataOffset; +- USHORT DataDisplacement; +- USHORT FID; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR Pad1\[\]; +- UCHAR Trans2_Parameters\[ParameterCount\]; +- UCHAR Pad2\[\]; +- UCHAR Trans2_Data\[DataCount\]; +- } +- } + +**SMB_Header:** + +This command MUST be sent following a successful SMB_COM_TRANSACTION2 Intermediate Response from the server. The **PID**, **MID**, **TID**, and **UID** MUST be the same for all requests and responses that are part of the same transaction. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| SMB_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ---------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Wordcount | | | | | | | | Words (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Wordcount (1 byte):** This value represents the total number of SMB parameter words and MUST be 0x09. + +**Words (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| TotalParameterCount | | | | | | | | | | | | | | | | TotalDataCount | | | | | | | | | | | | | | | | +| ParameterCount | | | | | | | | | | | | | | | | ParameterOffset | | | | | | | | | | | | | | | | +| ParameterDisplacement | | | | | | | | | | | | | | | | DataCount | | | | | | | | | | | | | | | | +| DataOffset | | | | | | | | | | | | | | | | DataDisplacement | | | | | | | | | | | | | | | | +| FID | | | | | | | | | | | | | | | | + +**TotalParameterCount (2 bytes):** The total number of transaction parameter bytes to be sent to the server over the course of this transaction. This value MAY be less than or equal to the **TotalParameterCount** in preceding request messages that are part of the same transaction. This value represents transaction parameter bytes, not SMB parameter words. + +**TotalDataCount (2 bytes):** The total number of transaction data bytes to be sent to the server over the course of this transaction. This value MAY be less than or equal to the **TotalDataCount** in preceding request messages that are part of the same transaction. This value represents transaction data bytes, not SMB data bytes. + +**ParameterCount (2 bytes):** The number of transaction parameter bytes being sent in the SMB message. This value MUST be less than **TotalParameterCount**. The sum of the **ParameterCount** values across all of the request messages in a transaction MUST be equal to the **TotalParameterCount** reported in the last request message of the transaction. + +**ParameterOffset (2 bytes):** The offset, in bytes, from the start of the SMB_Header to the transaction parameter bytes contained in this SMB message. This MUST be the number of bytes from the start of the SMB message to the start of the **SMB_Data.Bytes.Trans2_Parameters** field. Server implementations MUST use this value to locate the transaction parameter block within the SMB message. If **ParameterCount** is zero, the client/server MAY set this field to zero.[<72>](#Appendix_A_72) + +**ParameterDisplacement (2 bytes):** The offset relative to all of the transaction parameter bytes sent to the server in this transaction at which this block of parameter bytes SHOULD be placed. This value can be used by the server to correctly reassemble the transaction parameters even if the SMB request messages are received out of order. + +**DataCount (2 bytes):** The number of transaction data bytes being sent in this SMB message. This value MUST be less than the value of **TotalDataCount**. The sum of the **DataCount** values across all of the request messages in a transaction MUST be equal to the smallest TotalDataCount value reported to the server. + +**DataOffset (2 bytes):** The offset, in bytes, from the start of the SMB_Header to the transaction data bytes contained in this SMB message. This MUST be the number of bytes from the start of the SMB message to the start of the **SMB_Data.Bytes.Trans2_Data** field. Server implementations MUST use this value to locate the transaction data block within the SMB message. If **DataCount** is zero, the client/server MAY set this field to zero.[<73>](#Appendix_A_73) + +**DataDisplacement (2 bytes):** The offset relative to all of the transaction data bytes sent to the server in this transaction at which this block of parameter bytes SHOULD be placed. This value MAY be used by the server to correctly reassemble the transaction data block even if the SMB request messages are received out of order. + +**FID (2 bytes):** Either a valid File ID returned by a previous Open or Create operation, or 0xFFFF. A **FID** value of 0xFFFF is, by definition, an invalid **FID** and indicates that no **FID** is being sent in this request. See the individual descriptions of the Trans2 subcommands for specific information on the use of this field. + +**SMB_Data (variable):** + +The SMB_Data section of the SMB_COM_TRANSACTION2_SECONDARY request contains parameters and data bytes being sent to the server. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** The number of bytes in the **SMB_Data.Bytes** array, which follows. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ---------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Pad1 (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Trans2_Parameters (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Pad2 (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Trans2_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Pad1 (variable):** This field SHOULD be used as an array of padding bytes to align the following field to a 4-byte boundary relative to the start of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f). This constraint can cause this field to be a zero-length field. This field SHOULD be set to zero by the client/server and MUST be ignored by the server/client. + +**Trans2_Parameters (variable):** Transaction parameter bytes. + +**Pad2 (variable):** This field SHOULD be used as an array of padding bytes to align the following field to a 4-byte boundary relative to the start of the SMB Header. This constraint can cause this field to be a zero-length field. This field SHOULD be set to zero by the client/server and MUST be ignored by the server/client. + +**Trans2_Data (variable):** Transaction data bytes. + +##### Response + +There is no response message defined for the SMB_COM_TRANSACTION2_SECONDARY request. + +**Error Codes** + +Since there is no response to an SMB_COM_TRANSACTION2_SECONDARY request, there are no error codes defined. + +#### SMB_COM_FIND_CLOSE2 (0x34) + +This command was introduced in the **LAN Manager 1.2** dialect. + +The SMB_COM_FIND_CLOSE2 command is used to close a search handle that was created by a TRANS2_FIND_FIRST2 subcommand. Closing the search handle allows the server to release any resources associated with the handle. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT SearchHandle; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +**SMB_Header:** + +**TID (2 bytes):** A valid **TID** MUST be provided. The **TID** MUST refer to a connected server share. + +**UID (2 bytes):** A valid **UID** MUST be provided and MUST match the UID used to initiate the directory search. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | -------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data | | | | | | | | +| ... | | | | | | | | + +**SMB_Parameters (3 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x01. + +**Words (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SID | | | | | | | | | | | | | | | | + +**SID (2 bytes):** A search handle, also known as a Search ID (SID). This MUST be the **SID** value returned in the initial TRANS2_FIND_FIRST2 subcommand request. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | -------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | SMB_Data | | | | | | | | | | | | | | | | + +**SMB_Parameters (1 byte):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x00. No parameters are sent by this message. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| --------------- | ------------------------- | --------------------------------------------------------------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------ | +| ERRDOS (0x01) | ERRbadfid (0x0006) | STATUS_INVALID_HANDLE

(0xC0000008)

STATUS_SMB_BAD_FID

(0x00060001) | ENFILE | The search handle is invalid. | +| ERRSRV (0x02) | ERRerror (0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid or corrupt SMB. | +| ERRSRV (0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The [**UID**](#gt_3d9dd73b-8923-43cc-ac95-8103f17683d7) supplied is not defined for the session. | + +#### SMB_COM_FIND_NOTIFY_CLOSE (0x35) + +This command was introduced in the **LAN Manager 1.2** dialect (see [\[XOPEN-SMB\]](https://go.microsoft.com/fwlink/?linkid=2297696) section 15.3), and was **reserved but not implemented**. + +This command was intended to close a directory search handle that was created by a TRANS2_FIND_NOTIFY_FIRST subcommand request to the server. The TRANS2_FIND_NOTIFY_FIRST and TRANS2_FIND_NOTIFY_NEXT subcommands were also not implemented. + +Clients SHOULD NOT send requests using this command code, and servers receiving requests with this command code MUST return STATUS_NOT_IMPLEMENTED (ERRDOS/ERRbadfunc). + +#### SMB_COM_TREE_CONNECT (0x70) + +This is an original **Core Protocol** command. **This command has been deprecated.** Client Implementations SHOULD use SMB_COM_TREE_CONNECT_ANDX. + +This command is used to establish a client connection to a server share. The share is identified by name, and the connection, once established, is identified by a TID which is returned to the client. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR BufferFormat1; +- OEM_STRING Path; +- UCHAR BufferFormat2; +- OEM_STRING Password; +- UCHAR BufferFormat3; +- OEM_STRING Service; +- } +- } + +**SMB_Header** + +**Flags2 (2 bytes):** The SMB_FLAGS2_UNICODE flag bit SHOULD be zero. Servers MUST ignore the SMB_FLAGS2_UNICODE flag and interpret strings in this request as OEM_STRING strings.[<74>](#Appendix_A_74) + +**TID (2 bytes):** This field MUST be ignored by the server. + +**UID (2 bytes):** This field represents an authenticated user. If the server is operating in share level access control mode, then the UID is ignored. If the server is operating in user level access control mode, then the server MUST validate the UID. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | ------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | SMB_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (1 byte):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x00. No parameters are sent by this message. + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be greater than or equal to 0x0006. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------- | --- | --- | --- | --- | --- | --- | --- | ------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| BufferFormat1 | | | | | | | | Path (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| BufferFormat2 | | | | | | | | Password (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| BufferFormat3 | | | | | | | | Service (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**BufferFormat1 (1 byte):** A buffer format identifier. The value of this field MUST be 0x04. + +**Path (variable):** A null-terminated string that represents the server and share name of the resource to which the client is attempting to connect. This field MUST be encoded using Universal Naming Convention (UNC) syntax. The string MUST be a null-terminated array of OEM characters, even if the client and server have negotiated to use Unicode strings. + +A share path in UNC syntax would be represented by a string in the following form: + +- \\\\server\\share + +**BufferFormat2 (1 byte):** A buffer format identifier. The value of this field MUST be 0x04. + +**Password (variable):** A null-terminated string that represents a share password in plaintext form. The string MUST be a null-terminated array of OEM characters, even if the client and server have negotiated to use Unicode strings. + +**BufferFormat3 (1 byte):** A buffer format identifier. The value of this field MUST be 0x04. + +**Service (variable):** A null-terminated string representing the type of resource that the client intends to access. This field MUST be a null-terminated array of OEM characters, even if the client and server have negotiated to use Unicode strings. The valid values for this field are as follows: + +| Service String | Description | +| -------------- | -------------------------------------- | +| "A:" | Disk Share | +| "LPT1:" | Printer Share | +| "IPC" | Named Pipe | +| "COMM" | Serial Communications device | +| "?????" | Matches any type of device or resource | + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT MaxBufferSize; +- USHORT TID; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | -------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | SMB_Data | | | | | | | | | | | | | | | | + +**SMB_Parameters (5 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | + +**WordCount (1 byte):** This field MUST be set to 0x02. + +**Words (4 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| MaxBufferSize | | | | | | | | | | | | | | | | TID | | | | | | | | | | | | | | | | + +**MaxBufferSize (2 bytes):** The maximum size, in bytes, of the largest SMB message that the server can receive. This is the size of the largest SMB message that the client can send to the server. SMB message size includes the size of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f), parameter, and data blocks. This size MUST NOT include any transport-layer framing or other transport-layer data. + +**TID (2 bytes):** The newly generated Tree ID, used in subsequent CIFS client requests to refer to a resource relative to the **SMB_Data.Bytes.Path** specified in the request. Most access to the server requires a valid **TID**, whether the resource is password protected or not. The value 0xFFFF is reserved; the server MUST NOT return a **TID** value of 0xFFFF. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ------------------------------- | -------------------------------------------------- | ---------------- | ----------------------------------------------------------------------------------------------- | +| ERRDOS (0x01) | ERRbadpath

(0x0003) | STATUS_OBJECT_PATH_NOT_FOUND

(0xC000003A) | ENOENT | The share path does not reference a valid resource. | +| ERRDOS (0x01) | ERRnoaccess

(0x0005) | STATUS_LOGON_FAILURE

(0xC000006D) | EPERM | The server rejected the client logon attempt. | +| ERRDOS (0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources. Out of memory or **TID**s. | +| ERRDOS (0x01) | ERRnosuchshare

(0x0043) | STATUS_BAD_NETWORK_NAME

(0xC00000CC) | | The server is temporarily paused. | +| ERRDOS (0x01) | ERRpaused

(0x0046) | STATUS_SHARING_PAUSED

(0xC00000CF) | | The server is temporarily paused. | +| ERRDOS (0x01) | ERRreqnotaccep

(0x0047) | STATUS_REQUEST_NOT_ACCEPTED

(0xC00000D0) | | The server has no more connections available. | +| ERRDOS (0x01) | ERRinvalidparam

(0x0057) | STATUS_INVALID_PARAMETER

(0xC000000D) | | Tree connect request after request to end session or internal error. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. Not enough parameter bytes were sent. Did the client omit a session setup? | +| ERRSRV

(0x02) | ERRbadpw

(0x0002) | STATUS_LOGON_FAILURE

(0xC000006D) | | Incorrect password during logon attempt. | +| ERRSRV

(0x02) | ERRaccess

(0x0004) | STATUS_ACCESS_DENIED

(0xC0000022) | | The user is not authorized to access the resource. | +| ERRSRV

(0x02) | ERRinvnetname

(0x0006) | STATUS_BAD_NETWORK_NAME

(0xC00000CC) | | The share path is not valid. | +| ERRSRV

(0x02) | ERRinvdevice

(0x0007) | STATUS_BAD_DEVICE_TYPE

(0xC00000CB) | | Resource type invalid. Value of Service field in the request was invalid. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The [**UID**](#gt_3d9dd73b-8923-43cc-ac95-8103f17683d7) supplied is not defined to the session. | + +#### SMB_COM_TREE_DISCONNECT (0x71) + +This is an original **Core Protocol** command. + +This command is used to logically disconnect client access to a server resource. The resource sharing connection is identified by the TID in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f), and the TID is invalidated. It MUST NOT be recognized if used by the client in subsequent requests. All open files, directories, and other resources that exist within the resource identified by the TID are released. Locks on files or directories within the shared resource are also released. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +**SMB_Header** + +**TID (2 bytes):** The Tree ID of the resource connection to be closed. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | -------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | SMB_Data | | | | | | | | | | | | | | | | + +**SMB_Parameters (1 byte):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x00. No parameters are sent by this message. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | -------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | SMB_Data | | | | | | | | | | | | | | | | + +**SMB_Parameters (1 byte):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x00. No parameters are sent by this message. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ------------------------- | -------------------------------------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| ERRSRV (0x02) | ERRerror (0x0001) | STATUS_INVALID_SMB

(0x00010002) | | The client sent a badly formatted SMB_COM_TREE_DISCONNECT request. | +| ERRSRV (0x02) | ERRbadtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** specified in the request is invalid. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** supplied is not known to the session, or the user identified by the **UID** does not have sufficient privileges. | + +#### SMB_COM_NEGOTIATE (0x72) + +This is an original **Core Protocol** command. + +This command is used to initiate an [**SMB connection**](#gt_e1d88514-18e6-4e2e-a459-20d5e17e9078) between the client and the server. An SMB_COM_NEGOTIATE exchange MUST be completed before any other [**SMB messages**](#gt_fb37399e-d72d-41b6-b073-086da2d96e09) are sent to the server. + +There MUST be only one SMB_COM_NEGOTIATE exchange per SMB connection. Subsequent SMB_COM_NEGOTIATE requests received by the server MUST be rejected with error responses. The server MUST NOT take any other action. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR Dialects\[\]; +- } +- } + +SMB_Header + +**CID (2 bytes):** If the transport is connectionless (for example, Direct IPX Transport), then this field MUST be 0x0000. + +**TID (2 bytes):** The **TID** is uninitialized at this point and MUST be ignored by the server.[<75>](#Appendix_A_75) + +**UID (2 bytes):** The **UID** is uninitialized at this point and MUST be ignored by the server.[<76>](#Appendix_A_76) + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | ------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | SMB_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (1 byte):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x00. No parameters are sent by this message. + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be greater than or equal to 0x0002. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Dialects (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Dialects (variable):** This is a variable length list of dialect identifiers in order of preference from least to most preferred. The client MUST list only dialects that it supports. The structure of the list entries is as follows: + +- SMB_Dialect +- { +- UCHAR BufferFormat; +- OEM_STRING DialectString; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------ | --- | --- | --- | --- | --- | --- | --- | ------------------------ | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| BufferFormat | | | | | | | | DialectString (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**BufferFormat (1 byte):** This field MUST be 0x02. This is a buffer format indicator that identifies the next field as a null-terminated array of characters. + +**DialectString (variable):** A null-terminated string identifying an SMB dialect. A list of common dialects is presented in section [1.7](#Section_80850595e3014464974558e4945eb99b). + +##### Response + +The server's response is dependent upon the dialect, if any, that the server has selected. + +- If the server is returning an error, the **WordCount** and **ByteCount** SHOULD be 0x00 and 0x0000, respectively. +- If the server has selected the **Core Protocol** dialect, or if none of the offered protocols is supported by the server, then **WordCount** MUST be 0x01 and the dialect index (the selected dialect) MUST be returned as the only parameter. +- If the server has selected any dialect from **LAN Manager 1.0** through **LAN Manager 2.1**, **WordCount** MUST be 0x0D. See [\[XOPEN-SMB\]](https://go.microsoft.com/fwlink/?linkid=2297696) for a specification of the LAN Manager dialects other than **LAN Manager 2.1**. [\[SMB-LM21\]](https://go.microsoft.com/fwlink/?LinkId=163216) provides documentation on the extensions to the **LAN Manager 2.0** dialect that define the **LAN Manager 2.1** dialect. +- If the server has selected the **NT LAN Manager** dialect, then **WordCount** MUST be 0x11. + +Other dialects can return an [SMB_COM_NEGOTIATE (section 2.2.4.52)](#Section_96ccc2bd67ba463abb73fd6a9265199e) response using different formats. The value of **WordCount** MUST, therefore, be considered variable until the dialect has been determined. All dialects MUST return the **DialectIndex** as the first entry in the **SMB_Parameters.Words** array. That is, the structure returned by the Core Protocol is the common minimum. That structure is as follows. + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT DialectIndex; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +**SMB_Header** + +**CID (2 bytes):** If the underlying transport is connectionless (for example, Direct IPX), the Connection ID (CID) is returned by the server. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| SMB_Data | | | | | | | | | | | | | | | | + +**SMB_Parameters (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ---------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** The value of this field MUST be greater than or equal to 0x01. + +**Words (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------ | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| DialectIndex | | | | | | | | | | | | | | | | + +**DialectIndex (2 bytes):** The index of the dialect selected by the server from the list presented in the request. Dialect entries are numbered starting with 0x0000, so a **DialectIndex** value of 0x0000 indicates that the first entry in the list has been selected. If the server does not support any of the listed dialects, it MUST return a **DialectIndex** of 0XFFFF. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** The value of this field MUST be set to 0x0000. + +If the negotiated dialect is **NT LAN Manager**, the structure of the SMB_COM_NEGOTIATE response is as follows. + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT DialectIndex; +- UCHAR SecurityMode; +- USHORT MaxMpxCount; +- USHORT MaxNumberVcs; +- ULONG MaxBufferSize; +- ULONG MaxRawSize; +- ULONG SessionKey; +- ULONG Capabilities; +- FILETIME SystemTime; +- SHORT ServerTimeZone; +- UCHAR ChallengeLength; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR Challenge\[\]; +- SMB_STRING DomainName\[\]; +- } +- } + +**SMB_Header** + +**CID (2 bytes):** If the underlying transport is connectionless (for example, Direct IPX Transport), the Connection ID (CID) is returned by the server. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| SMB_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ---------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** The value of this field MUST be 0x11. + +**Words (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------ | --- | --- | --- | --- | --- | --- | --- | --------------- | --- | ---------- | --- | --- | --- | --- | --- | ------------ | --- | --- | --- | ---------- | --- | --- | --- | -------------- | --- | --- | --- | --- | --- | ---------- | --- | +| DialectIndex | | | | | | | | | | | | | | | | SecurityMode | | | | | | | | MaxMpxCount | | | | | | | | +| ... | | | | | | | | MaxNumberVcs | | | | | | | | | | | | | | | | MaxBufferSize | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | MaxRawSize | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | SessionKey | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | Capabilities | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | SystemTime | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | ServerTimeZone | | | | | | | | +| ... | | | | | | | | ChallengeLength | | | | | | | | + +**DialectIndex (2 bytes):** The index of the dialect selected by the server from the list presented in the request. Dialect entries are numbered starting with 0x0000, so a **DialectIndex** value of 0x0000 indicates the first entry in the list. If the server does not support any of the listed dialects, it MUST return a **DialectIndex** of 0xFFFF. + +**SecurityMode (1 byte):** An 8-bit field indicating the security modes supported or required by the server, as follows: + +| Name and bitmask | Meaning | +| -------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| NEGOTIATE_USER_SECURITY

0x01 | If clear (0), the server supports only Share Level access control.

If set (1), the server supports only User Level access control. | +| NEGOTIATE_ENCRYPT_PASSWORDS

0x02 | If clear, the server supports only plaintext password authentication.

If set, the server supports challenge/response authentication.[<77>](#Appendix_A_77) | +| NEGOTIATE_SECURITY_SIGNATURES_ENABLED

0x04 | If clear, the server does not support SMB security signatures.

If set, the server supports SMB security signatures for this connection.[<78>](#Appendix_A_78) | +| NEGOTIATE_SECURITY_SIGNATURES_REQUIRED

0x08 | If clear, the security signatures are optional for this connection.

If set, the server requires security signatures.

This bit MUST be clear if the NEGOTIATE_SECURITY_SIGNATURES_ENABLED bit is clear. | +| Reserved

0xF0 | The remaining bits are reserved and MUST be zero. | + +**MaxMpxCount (2 bytes):** The maximum number of outstanding SMB operations that the server supports. This value includes existing OpLocks, the NT_TRANSACT_NOTIFY_CHANGE subcommand, and any other commands that are pending on the server. If the negotiated **MaxMpxCount** is 0x0001, then OpLock support MUST be disabled for this session. The **MaxMpxCount** MUST be greater than 0x0000. This parameter has no specific relationship to the SMB_COM_READ_MPX and SMB_COM_WRITE_MPX commands.[<79>](#Appendix_A_79) + +**MaxNumberVcs (2 bytes):** The maximum number of virtual circuits that can be established between the client and the server as part of the same SMB session.[<80>](#Appendix_A_80) + +**MaxBufferSize (4 bytes):** The maximum size, in bytes, of the largest SMB message that the server can receive. This is the size of the largest SMB message that the client can send to the server. SMB message size includes the size of the SMB header, parameter, and data blocks. This size does not include any transport-layer framing or other transport-layer data. The server SHOULD[<81>](#Appendix_A_81) provide a **MaxBufferSize** of 4356 bytes, and MUST be a multiple of 4 bytes. If CAP_RAW_MODE is negotiated, the SMB_COM_WRITE_RAW command can bypass the **MaxBufferSize** limit. Otherwise, SMB messages sent to the server MUST have a total size less than or equal to the **MaxBufferSize** value. This includes AndX chained messages. + +**MaxRawSize (4 bytes):** This value specifies the maximum message size when the client sends an [SMB_COM_WRITE_RAW Request (section 2.2.4.25.1)](#Section_1ff2a25fefe2470ca780b06ef46c4089), and the maximum message size that the server MUST NOT exceed when sending an [SMB_COM_READ_RAW Response (section 2.2.4.22.2)](#Section_3f3914f6d25148ab89c035349cb6d1c8). This value is significant only if CAP_RAW_MODE is negotiated.[<82>](#Appendix_A_82) + +**SessionKey (4 bytes):** The server SHOULD set the value to a token generated for the connection, as specified in [SessionKey Generation (section 2.2.1.6.6)](#Section_992234e609d845a180ba1973bb8c7335) . + +**Capabilities (4 bytes):** A 32-bit field providing a set of server capability indicators. This bit field is used to indicate to the client which features are supported by the server. Any value not listed in the following table is unused. The server MUST set the unused bits to 0 in a response, and the client MUST ignore these bits. + +| Name and bitmask | Meaning | +| -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| CAP_RAW_MODE

0x00000001 | The server supports SMB_COM_READ_RAW and SMB_COM_WRITE_RAW requests. Raw mode is not supported over connectionless transports. | +| CAP_MPX_MODE

0x00000002 | The server supports SMB_COM_READ_MPX and SMB_COM_WRITE_MPX requests. MPX mode is supported only over connectionless transports. | +| CAP_UNICODE

0x00000004 | The server supports UTF-16LE Unicode strings. | +| CAP_LARGE_FILES

0x00000008 | The server supports 64-bit file offsets. | +| CAP_NT_SMBS

0x00000010 | The server supports SMB commands particular to the **NT LAN Manager** dialect. | +| CAP_RPC_REMOTE_APIS

0x00000020 | The server supports the use of Microsoft remote procedure call (MS-RPC) for remote API calls. Similar functionality would otherwise require use of the legacy Remote Administration Protocol, as specified in [\[MS-RAP\]](%5bMS-RAP%5d.pdf#Section_fb8d5bd1e57c4be1b063ec31330bdd58). | +| CAP_STATUS32

0x00000040 | The server is capable of responding with 32-bit status codes in the Status field of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) (for more information, see 2.2.3.1).

CAP_STATUS32 is also sometimes referred to as CAP_NT_STATUS. | +| CAP_LEVEL_II_OPLOCKS

0x00000080 | The server supports level II opportunistic locks (OpLocks). | +| CAP_LOCK_AND_READ

0x00000100 | The server supports the SMB_COM_LOCK_AND_READ command request. | +| CAP_NT_FIND

0x00000200 | The server supports the TRANS2_FIND_FIRST2, TRANS2_FIND_NEXT2, and FIND_CLOSE2 command requests. This bit SHOULD be set if CAP_NT_SMBS is set.[<83>](#Appendix_A_83) | +| CAP_BULK_TRANSFER

0x00000400 | This value was reserved but not implemented and MUST be zero.[<84>](#Appendix_A_84) | +| CAP_COMPRESSED_DATA

0x00000800 | This value was reserved but not implemented and MUST be zero.[<85>](#Appendix_A_85) | +| CAP_DFS

0x00001000 | The server is aware of the DFS Referral Protocol, as specified in [\[MS-DFSC\]](%5bMS-DFSC%5d.pdf#Section_3109f4be2dbb42c99b8e0b34f7a2135e), and can respond to Microsoft DFS referral requests. For more information, see sections [2.2.6.16.1](#Section_0782a79d7e3149a6b446835d33f89435) and [2.2.6.16.2](#Section_6420c96036be4d55b3ae66e7897e6111). | +| CAP_QUADWORD_ALIGNED

0x00002000 | This value was reserved but not implemented and MUST be zero.[<86>](#Appendix_A_86) | +| CAP_LARGE_READX

0x00004000 | The server supports large read operations.This capability affects the maximum size, in bytes, of the server buffer for sending an SMB_COM_READ_ANDX response to the client. When this capability is set by the server (and set by the client in the SMB_COM_SESSION_SETUP_ANDX request), the maximum server buffer size for sending data can be up to 65,535 bytes rather than the MaxBufferSize field. Therefore, the server can send a single SMB_COM_READ_ANDX response to the client up to this size. | + +**SystemTime (8 bytes):** The number of 100-nanosecond intervals that have elapsed since January 1, 1601, in Coordinated Universal Time (UTC) format.[<87>](#Appendix_A_87) + +**ServerTimeZone (2 bytes): SHORT** A signed 16-bit signed integer that represents the server's time zone, in minutes, from UTC. The time zone of the server MUST be expressed in minutes, plus or minus, from UTC.[<88>](#Appendix_A_88) + +**ChallengeLength (1 byte):** This field MUST be 0x00 or 0x08. The length of the random challenge used in challenge/response authentication. If the server does not support challenge/response authentication, this field MUST be 0x00. This field is often referred to in older documentation as **EncryptionKeyLength**. + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be greater than or equal to 0x0001. If CAP_UNICODE has been negotiated, it MUST be greater than or equal to 0x0002. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Challenge (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| DomainName (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Challenge (variable):** An array of unsigned bytes that MUST be **ChallengeLength** bytes long and MUST represent the server challenge. This array MUST NOT be null-terminated. This field is often referred to in older documentation as **EncryptionKey**. + +**DomainName (variable):** The null-terminated name of the NT domain or workgroup to which the server belongs.[<89>](#Appendix_A_89) + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| --------------- | ----------------- | -------------------------------------- | ---------------- | ----------------------------- | +| ERRSRV (0x02) | ERRerror (0x0001) | STATUS_INVALID_SMB

(0x00010002) | | The command was already sent. | + +#### SMB_COM_SESSION_SETUP_ANDX (0x73) + +This command was introduced in the **LAN Manager 1.0** dialect. The formats of the request and response messages have changed since the command was first defined. The CIFS format, as defined for the [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) dialect, is presented here. This format MUST be used when the NT LAN Manager dialect has been negotiated. + +This command is used to configure an [**SMB session**](#gt_ee1ec898-536f-41c4-9d90-b4f7d981fd67). If the server is operating in user level access control mode, then at least one SMB_COM_SESSION_SETUP_ANDX MUST be sent in order to perform a user logon to the server and to establish a valid UID. + +In [**CIFS**](#gt_fb37399e-d72d-41b6-b073-086da2d96e09), it is a protocol violation to issue an SMB_COM_TREE_CONNECT or SMB_COM_TREE_CONNECT_ANDX request before an SMB_COM_SESSION_SETUP_ANDX command has been successfully executed, even if the server is operating in Share Level Access Control mode. Including an SMB_COM_TREE_CONNECT_ANDX batched request in an AndX chain (section [2.2.3.4](#Section_fc4d19f78040426d91547219c57453c8)) following an SMB_COM_SESSION_SETUP_ANDX request is sufficient to fulfill this requirement.[<90>](#Appendix_A_90) Anonymous authentication is also sufficient to fulfill this requirement. + +Multiple SMB_COM_SESSION_SETUP_ANDX commands are permitted within an [**SMB connection**](#gt_e1d88514-18e6-4e2e-a459-20d5e17e9078), either to establish additional UIDs or to create additional virtual circuits. + +The following are the commands that can follow an SMB_COM_SESSION_SETUP_ANDX with an SMB_COM_TREE_CONNECT_ANDX (section [2.2.4.55](#Section_a105173ad8544950be283d3240529ec3)) in an AndX chain: + +- [SMB_COM_OPEN (section 2.2.4.3)](#Section_ec064de86538401e8c73b37231c36f2b) +- [SMB_COM_OPEN_ANDX (section 2.2.4.41)](#Section_49a0f97dc4a748a3bf5046d816825729) +- [SMB_COM_CREATE (section 2.2.4.4)](#Section_87622f4337584bf9b1fb35109f0e5c15) +- [SMB_COM_CREATE_NEW (section 2.2.4.16)](#Section_161fa213ba9d4bad948329e8b5872dca) +- [SMB_COM_CREATE_DIRECTORY (section 2.2.4.1)](#Section_e6e870ad70374b79ac544a42a1ba4561) +- [SMB_COM_DELETE (section 2.2.4.7)](#Section_e455faa4d99643a587eb9993b0ceb896) +- [SMB_COM_DELETE_DIRECTORY (section 2.2.4.2)](#Section_0bca354c42d946b7a0aed8c6870242ca) +- [SMB_COM_FIND (section 2.2.4.59)](#Section_5df45d03d4e94dfd850f639363b8dffd) +- [SMB_COM_FIND_UNIQUE (section 2.2.4.60)](#Section_828fff83d37b4deb811824c950dca87a) +- [SMB_COM_RENAME (section 2.2.4.8)](#Section_d78c549c9ab84d92bbbc6843bed943f6) +- [SMB_COM_NT_RENAME (section 2.2.4.66)](#Section_014a414742064ab2a167b58a4d11f1a7) +- [SMB_COM_CHECK_DIRECTORY (section 2.2.4.17)](#Section_6a989d5130bf4ceba46e7ae1cee6b516) +- [SMB_COM_QUERY_INFORMATION (section 2.2.4.9)](#Section_d36b4a5cdf1b4255aa5bac6ef5c2fb7c) +- [SMB_COM_SET_INFORMATION (section 2.2.4.10)](#Section_e3cd0acdaa844fbf8c9d3e7d3bb3fd52) +- [SMB_COM_OPEN_PRINT_FILE (section 2.2.4.67)](#Section_4cce0e9fab2740f797cc6f12b4a9afef) +- [SMB_COM_TRANSACTION (section 2.2.4.33)](#Section_0ed1ad9fab964a7ab94a0915f3796781) + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- UCHAR AndXCommand; +- UCHAR AndXReserved; +- USHORT AndXOffset; +- USHORT MaxBufferSize; +- USHORT MaxMpxCount; +- USHORT VcNumber; +- ULONG SessionKey; +- USHORT OEMPasswordLen; +- USHORT UnicodePasswordLen; +- ULONG Reserved; +- ULONG Capabilities; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR OEMPassword\[\]; +- UCHAR UnicodePassword\[\]; +- UCHAR Pad\[\]; +- SMB_STRING AccountName\[\]; +- SMB_STRING PrimaryDomain\[\]; +- SMB_STRING NativeOS\[\]; +- SMB_STRING NativeLanMan\[\]; +- } +- } + +**SMB_Header:** + +**TID (2 bytes):** This field is ignored in this request. + +**UID (2 bytes):** This field is ignored in this request. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ------------------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters (27 bytes) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data (variable) | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (27 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ---------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words (26 bytes) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** The value of this field MUST be 0x0D. + +**Words (26 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------ | --- | --- | --- | --- | --- | --- | --- | ------------ | --- | ---------- | --- | --- | --- | --- | --- | -------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| AndXCommand | | | | | | | | AndXReserved | | | | | | | | AndXOffset | | | | | | | | | | | | | | | | +| MaxBufferSize | | | | | | | | | | | | | | | | MaxMpxCount | | | | | | | | | | | | | | | | +| VcNumber | | | | | | | | | | | | | | | | SessionKey | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | OEMPasswordLen | | | | | | | | | | | | | | | | +| UnicodePasswordLen | | | | | | | | | | | | | | | | Reserved | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | Capabilities | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | + +**AndXCommand (1 byte):** This field MUST be either the command code for the next SMB command in the packet or 0xFF. + +**AndXReserved (1 byte):** A reserved field. This MUST be set to 0x00 when this request is sent, and the server MUST ignore this value. + +**AndXOffset (2 bytes):** This field MUST be set to the offset in bytes from the start of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) to the start of the **WordCount** field in the next SMB command in this packet. This field is valid only if the **AndXCommand** field is not set to 0xFF. If **AndXCommand** is 0xFF, this field MUST be ignored by the server. + +**MaxBufferSize (2 bytes):** The maximum size, in bytes, of the largest SMB message that the client can receive. This is the size of the largest SMB message that the server can send to the client. SMB message size includes the size of the SMB header, parameter, and data blocks.[<91>](#Appendix_A_91) This size MUST NOT include any transport-layer framing or other transport-layer data. + +There are two exceptions to the limit imposed by the client's **MaxBufferSize** value. + +- If the CAP_RAW_MODE capability is negotiated, then the maximum size of an SMB_COM_READ_RAW command response from the server MUST be limited by the **MaxRawSize** value previously returned by the server in the [SMB_COM_NEGOTIATE Response (section 2.2.4.52.2)](#Section_a4229e1a8a4e489aa2eb11b7f360e60c) message. +- If the CAP_LARGE_READX capability is negotiated, the [SMB_COM_READ_ANDX (section 2.2.4.42)](#Section_129aa093574b483ea55ddf334606a622) command response MAY bypass the client's **MaxBufferSize** limit. There is no field in any CIFS message that indicates the maximum size of an SMB_COM_READ_ANDX if CAP_LARGE_READX is negotiated.[<92>](#Appendix_A_92) + +**MaxMpxCount (2 bytes):** The maximum number of pending requests supported by the client. This value MUST be less than or equal to the **MaxMpxCount** field value provided by the server in the SMB_COM_NEGOTIATE Response. + +**VcNumber (2 bytes):** The number of this VC (virtual circuit) between the client and the server. This field SHOULD be set to a value of 0x0000 for the first virtual circuit between the client and the server and it SHOULD be set to a unique nonzero value for each additional virtual circuit.[<93>](#Appendix_A_93) + +**SessionKey (4 bytes):** The client MUST set this field to be equal to the **SessionKey** field in the SMB_COM_NEGOTIATE Response for this SMB connection.[<94>](#Appendix_A_94) + +**OEMPasswordLen (2 bytes):** The length, in bytes, of the contents of the **SMB_Data.OEMPassword** field. + +**UnicodePasswordLen (2 bytes):** The length, in bytes, of the contents of the **SMB_Data.UnicodePassword** field. + +**Reserved (4 bytes):** Reserved. This field MUST be 0x00000000. The server MUST ignore the contents of this field. + +**Capabilities (4 bytes):** A 32-bit field providing a set of client capability indicators. The client uses this field to report its own set of capabilities to the server. The client capabilities are a subset of the server capabilities.[<95>](#Appendix_A_95) + +| Name and bitmask | Meaning | +| -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| CAP_RAW_MODE

0x00000001 | The client supports SMB_COM_READ_RAW and SMB_COM_WRITE_RAW requests. Raw mode is not supported over connectionless transports. | +| CAP_MPX_MODE

0x00000002 | The client supports SMB_COM_READ_MPX and SMB_COM_WRITE_MPX requests. MPX mode is supported only over connectionless transports. | +| CAP_UNICODE

0x00000004 | The client supports UTF-16LE Unicode strings. | +| CAP_LARGE_FILES

0x00000008 | The client supports 64-bit file offsets.[<96>](#Appendix_A_96) | +| CAP_NT_SMBS

0x00000010 | The client supports SMB commands particular to the NT LAN Manager dialect.[<97>](#Appendix_A_97) | +| CAP_RPC_REMOTE_APIS

0x00000020 | The client supports the use of Microsoft remote procedure call (MS-RPC) for remote API calls. | +| CAP_STATUS32

0x00000040 | The client supports 32-bit status codes, received in the **Status** field of the SMB Header.

CAP_STATUS32 is also sometimes referred to as CAP_NT_STATUS. | +| CAP_LEVEL_II_OPLOCKS

0x00000080 | The client supports level II opportunistic locks (OpLocks). | +| CAP_LOCK_AND_READ

0x00000100 | The client supports the SMB_COM_LOCK_AND_READ command. | +| CAP_NT_FIND

0x00000200 | The client supports the TRANS2_FIND_FIRST2, TRANS2_FIND_NEXT2, and FIND_CLOSE2 command requests.[<98>](#Appendix_A_98) | +| CAP_DFS

0x00001000 | The client supports the DFS Referral Protocol, as specified in [\[MS-DFSC\]](%5bMS-DFSC%5d.pdf#Section_3109f4be2dbb42c99b8e0b34f7a2135e). | +| CAP_LARGE_READX

0x00004000 | The client supports large read operations.

This capability affects the maximum size, in bytes, of the client buffer for receiving an SMB_COM_READ_ANDX response from the server.

When this capability is set by the client, the maximum client buffer size for receiving an SMB_COM_READ_ANDX can be up to 65,535 bytes, rather than the **MaxBufferSize** field. | + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** The number of bytes in the **SMB_Data.Bytes** array, which follows. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| OEMPassword (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| UnicodePassword (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Pad (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| AccountName (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| PrimaryDomain (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| NativeOS (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| NativeLanMan (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**OEMPassword (variable):** The contents of this field depends upon the authentication methods in use: + +- If Unicode has not been negotiated and the client sends a plaintext password, this field MUST contain the password represented in the OEM character set. +- If the client uses challenge/response authentication, this field can contain a cryptographic response. +- This field MAY be empty. + +The **OEMPassword** value is an array of bytes, not a null-terminated string. + +**UnicodePassword (variable):** The contents of this field depends upon the authentication methods in use: + +- If Unicode has been negotiated and the client sends a plaintext password, this field MUST contain the password represented in UTF-16LE Unicode.[<99>](#Appendix_A_99) +- If the client uses challenge/response authentication, this field can contain a cryptographic response. +- This field MAY be empty. + +See section [3.2.4.2.4](#Section_3a3cdd475b43427691f5645b82b0938f) for a description of authentication mechanisms used with CIFS. + +If the client sends a plaintext password, then the password MUST be encoded in either OEM or Unicode characters, but not both. The value of the SMB_FLAGS2_UNICODE bit of the **SMB_Header.Flags2** indicates the character encoding of the password. If a plaintext password is sent, then: + +- If SMB_FLAGS2_UNICODE is clear (0), the value of **UnicodePasswordLen** MUST be 0x0000, and the password MUST be encoded using the 8-bit OEM character set (extended ASCII). +- If SMB_FLAGS2_UNICODE is set (1), the value of **OEMPasswordLen** MUST be 0x0000 and the password MUST be encoded using UTF-16LE Unicode. Padding MUST NOT be added to align this plaintext Unicode string to a word boundary. + +**Pad (variable):** Padding bytes. If Unicode support has been enabled and SMB_FLAGS2_UNICODE is set in **SMB_Header.Flags2**, this field MUST contain zero (0x00) or one null padding byte as needed to ensure that the **AccountName** string is aligned on a 16-bit boundary. This also forces alignment of subsequent strings without additional padding. + +**AccountName (variable):** The name of the account (username) with which the user authenticates. + +**PrimaryDomain (variable):** A string representing the desired authentication domain. This MAY be the empty string. If SMB_FLAGS2_UNICODE is set in the **Flags2** field of the SMB header of the request, this string MUST be a null-terminated array of 16-bit Unicode characters. Otherwise, this string MUST be a null-terminated array of OEM characters. If this string consists of Unicode characters, this field MUST be aligned to start on a 2-byte boundary from the start of the SMB header. + +**NativeOS (variable):** A string representing the native operating system of the CIFS client. If SMB_FLAGS2_UNICODE is set in the **Flags2** field of the SMB header of the request, this string MUST be a null-terminated array of 16-bit Unicode characters. Otherwise, this string MUST be a null-terminated array of OEM characters. If this string consists of Unicode characters, this field MUST be aligned to start on a 2-byte boundary from the start of the SMB header.[<100>](#Appendix_A_100) + +**NativeLanMan (variable):** A string that represents the native LAN manager type of the client. If SMB_FLAGS2_UNICODE is set in the **Flags2** field of the SMB header of the request, this string MUST be a null-terminated array of 16-bit Unicode characters. Otherwise, this string MUST be a null-terminated array of OEM characters. If this string consists of Unicode characters, this field MUST be aligned to start on a 2-byte boundary from the start of the SMB header.[<101>](#Appendix_A_101) + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- UCHAR AndXCommand; +- UCHAR AndXReserved; +- USHORT AndXOffset; +- USHORT Action; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR Pad\[\]; +- SMB_STRING NativeOS\[\]; +- SMB_STRING NativeLanMan\[\]; +- SMB_STRING PrimaryDomain\[\]; +- } +- } + +**SMB_Header:** + +**UID (2 bytes):** The UID returned in the response to a successful SMB_COM_SESSION_SETUP_ANDX request represents an authenticated session. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ------------------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data (variable) | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (7 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** The value of this field MUST be 0x03. + +**Words (6 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------- | --- | --- | --- | --- | --- | --- | --- | ------------ | --- | ---------- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| AndXCommand | | | | | | | | AndXReserved | | | | | | | | AndXOffset | | | | | | | | | | | | | | | | +| Action | | | | | | | | | | | | | | | | + +**AndXCommand (1 byte):** The command code for the next SMB command in the packet. This value MUST be set to 0xFF if there are no additional SMB command responses in the server response packet. + +**AndXReserved (1 byte):** A reserved field. This MUST be set to 0x00 when this response is sent, and the client MUST ignore this field. + +**AndXOffset (2 bytes):** This field MUST be set to the offset in bytes from the start of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) to the start of the **WordCount** field in the next SMB command response in this packet. This field is valid only if the **AndXCommand** field is not set to 0xFF. If **AndXCommand** is 0xFF, this field MUST be ignored by the client. + +**Action (2 bytes):** A 16-bit field. The two lowest-order bits have been defined: + +| Name and Bitmask | Meaning | +| -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| SMB_SETUP_GUEST

0x0001 | If clear (0), the user successfully authenticated and is logged in.

if set (1), authentication failed but the server has granted guest access. The user is logged in as Guest. | +| SMB_SETUP_USE_LANMAN_KEY

0x0002 | If clear, the NTLM user session key will be used for message signing (if enabled).

If set, the LM session key will be used for message signing. | + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** The sum of the lengths, in bytes, of the **Pad**, **NativeOS**, **NativeLanMan**, and **PrimaryDomain** fields. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------ | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Pad (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| NativeOS (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| NativeLanMan (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| PrimaryDomain (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Pad (variable):** Padding bytes. If Unicode support has been enabled, this field MUST contain zero or one null padding byte as needed to ensure that the NativeOS field, which follows, is aligned on a 16-bit boundary. + +**NativeOS (variable):** A string that represents the native operating system of the server. If SMB_FLAGS2_UNICODE is set in the Flags2 field of the SMB header of the response, the string MUST be a null-terminated array of 16-bit Unicode characters. Otherwise, the string MUST be a null-terminated array of OEM characters. If the string consists of Unicode characters, this field MUST be aligned to start on a 2-byte boundary from the start of the SMB header.[<102>](#Appendix_A_102) + +**NativeLanMan (variable):** A string that represents the native LAN Manager type of the server. If SMB_FLAGS2_UNICODE is set in the **Flags2** field of the SMB header of the response, the string MUST be a null-terminated array of 16-bit Unicode characters. Otherwise, the string MUST be a null-terminated array of OEM characters. If the string consists of Unicode characters, this field MUST be aligned to start on a 2-byte boundary from the start of the SMB header.[<103>](#Appendix_A_103) + +**PrimaryDomain (variable):** A string representing the primary domain or workgroup name of the server. If SMB_FLAGS2_UNICODE is set in the **Flags2** field of the SMB header of the response, the string MUST be a null-terminated array of 16-bit Unicode characters. Otherwise, the string MUST be a null-terminated array of OEM characters. If the string consists of Unicode characters, this field MUST be aligned to start on a 2-byte boundary from the start of the SMB header.[<104>](#Appendix_A_104)[<105>](#Appendix_A_105) + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| --------------- | ------------------------------ | -------------------------------------------------- | ---------------- | ---------------------------------------------------------------------- | +| ERRDOS (0x01) | ERRnoaccess

(0x0005) | STATUS_LOGON_FAILURE

(0xC000006D) | EPERM | Authentication failure. | +| ERRSRV (0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | A corrupt or invalid SMB request was received. | +| ERRSRV (0x02) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRSRV (0x02) | ERRtoomanyuids

(0x005A) | STATUS_TOO_MANY_SESSIONS

(0xC00000CE) | | The maximum number of active UIDs per SMB connection has been reached. | + +#### SMB_COM_LOGOFF_ANDX (0x74) + +The user connection represented by **UID** in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) is logged off. The server releases all locks and closes all files currently open by this user, disconnects all tree connects, cancels any outstanding requests for this **UID**, and invalidates the **UID**. + +The following are the commands that can follow an SMB_COM_LOGOFF_ANDX in an AndX chain: + +- SMB_COM_SESSION_SETUP_ANDX. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- UCHAR AndXCommand; +- UCHAR AndXReserved; +- USHORT AndXOffset; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +**SMB_Header:** + +**UID (2 bytes):** The User ID to be logged off. The value of this field MUST have been previously generated by an SMB_COM_SESSION_SETUP_ANDX command. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | -------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | SMB_Data | | | | | | | | | | | | | | | | + +**SMB_Parameters (5 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | + +**WordCount (1 byte):** The value of this field MUST be 0x02. + +**Words (4 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------- | --- | --- | --- | --- | --- | --- | --- | ------------ | --- | ---------- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| AndXCommand | | | | | | | | AndXReserved | | | | | | | | AndXOffset | | | | | | | | | | | | | | | | + +**AndXCommand (1 byte):** The secondary SMB command request in the packet. This value MUST be set to 0xFF if there are no additional SMB command requests in the client request packet. + +**AndXReserved (1 byte):** A reserved field. This MUST be set to 0x00 when this request is sent, and the server MUST ignore this value when the message is received. + +**AndXOffset (2 bytes):** This field MUST be set to the offset in bytes from the start of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) to the start of the **WordCount** field in the next SMB command in this packet. This field is valid only if the AndXCommand field is not set to 0xFF. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- UCHAR AndXCommand; +- UCHAR AndXReserved; +- USHORT AndXOffset; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | -------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | SMB_Data | | | | | | | | | | | | | | | | + +**SMB_Parameters (5 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | + +**WordCount (1 byte):** The value of this field MUST be 0x02. + +**Words (4 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------- | --- | --- | --- | --- | --- | --- | --- | ------------ | --- | ---------- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| AndXCommand | | | | | | | | AndXReserved | | | | | | | | AndXOffset | | | | | | | | | | | | | | | | + +**AndXCommand (1 byte):** The secondary SMB command response in the packet. This value MUST be set to 0xFF if there are no additional SMB command responses in the server response packet. + +**AndXReserved (1 byte):** A reserved field. This MUST be set to 0x00 when this response is sent, and the client MUST ignore this value when the message is received. + +**AndXOffset (2 bytes):** This field MUST be set to the offset in bytes from the start of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) to the start of the **WordCount** field in the next SMB command in this packet. This field is valid only if the AndXCommand field is not set to 0xFF. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| --------------- | ------------------------- | -------------------------------------- | ---------------- | ---------------------------------------------------------------------------------------- | +| ERRSRV (0x02) | ERRerror (0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB or ANDX command is not valid with this command. | +| ERRSRV (0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** specified in the request is not defined as a valid **UID** for this session. | + +#### SMB_COM_TREE_CONNECT_ANDX (0x75) + +This command was introduced in the **LAN Manager 1.0** dialect. + +This command is used to establish a client connection to a server share. The share is identified by name, and the connection, once established, is identified by a **TID** that is returned to the client. + +The following are the commands that can follow an SMB_COM_TREE_CONNECT_ANDX in an AndX chain: + +- [SMB_COM_OPEN (section 2.2.4.3)](#Section_ec064de86538401e8c73b37231c36f2b) +- [SMB_COM_OPEN_ANDX (section 2.2.4.41)](#Section_49a0f97dc4a748a3bf5046d816825729) +- [SMB_COM_CREATE (section 2.2.4.4)](#Section_87622f4337584bf9b1fb35109f0e5c15) +- [SMB_COM_CREATE_NEW (section 2.2.4.16)](#Section_161fa213ba9d4bad948329e8b5872dca) +- [SMB_COM_CREATE_DIRECTORY (section 2.2.4.1)](#Section_e6e870ad70374b79ac544a42a1ba4561) +- [SMB_COM_DELETE (section 2.2.4.7)](#Section_e455faa4d99643a587eb9993b0ceb896) +- [SMB_COM_DELETE_DIRECTORY (section 2.2.4.2)](#Section_0bca354c42d946b7a0aed8c6870242ca) +- [SMB_COM_SEARCH (section 2.2.4.58)](#Section_d33e84721356406d88edbd9fc10b060b) +- [SMB_COM_FIND (section 2.2.4.59)](#Section_5df45d03d4e94dfd850f639363b8dffd) +- [SMB_COM_FIND_UNIQUE (section 2.2.4.60)](#Section_828fff83d37b4deb811824c950dca87a) +- [SMB_COM_RENAME (section 2.2.4.8)](#Section_d78c549c9ab84d92bbbc6843bed943f6) +- [SMB_COM_NT_RENAME (section 2.2.4.66)](#Section_014a414742064ab2a167b58a4d11f1a7) +- [SMB_COM_CHECK_DIRECTORY (section 2.2.4.17)](#Section_6a989d5130bf4ceba46e7ae1cee6b516) +- [SMB_COM_QUERY_INFORMATION (section 2.2.4.9)](#Section_d36b4a5cdf1b4255aa5bac6ef5c2fb7c) +- [SMB_COM_SET_INFORMATION (section 2.2.4.10)](#Section_e3cd0acdaa844fbf8c9d3e7d3bb3fd52) +- [SMB_COM_OPEN_PRINT_FILE (section 2.2.4.67)](#Section_4cce0e9fab2740f797cc6f12b4a9afef) +- [SMB_COM_TRANSACTION (section 2.2.4.33)](#Section_0ed1ad9fab964a7ab94a0915f3796781) + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- UCHAR AndXCommand; +- UCHAR AndXReserved; +- USHORT AndXOffset; +- USHORT Flags; +- USHORT PasswordLength; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR Password\[PasswordLength\]; +- UCHAR Pad\[\]; +- SMB_STRING Path; +- OEM_STRING Service; +- } +- } + +**SMB_Header:** + +**TID (2 bytes):** This field MAY contain a valid TID. If the **SMB_Header.TID** is valid and the lowest-order bit of the **SMB_Parameters.Words.Flags** field is set, the **SMB_Header.TID** MUST be disconnected. + +**UID (2 bytes):** This field MUST contain a UID returned in a previously successful [SMB_COM_SESSION_SETUP_ANDX Response (section 2.2.4.53.2)](#Section_e7514918a0f649329f00ced094445537). If the server is operating in share level access control mode, then the UID represents anonymous, or "null session" authentication. If the server is operating in user level access control mode, then the server MUST validate the UID. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | ------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | SMB_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (9 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | + +**WordCount (1 byte):** The value of this field MUST be 0x04. + +**Words (8 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------- | --- | --- | --- | --- | --- | --- | --- | ------------ | --- | ---------- | --- | --- | --- | --- | --- | -------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| AndXCommand | | | | | | | | AndXReserved | | | | | | | | AndXOffset | | | | | | | | | | | | | | | | +| Flags | | | | | | | | | | | | | | | | PasswordLength | | | | | | | | | | | | | | | | + +**AndXCommand (1 byte):** The command code for the next SMB command in the packet. This value MUST be set to 0xFF if there are no additional SMB command requests in the request packet. + +**AndXReserved (1 byte):** A reserved field. This MUST be set to 0x00 when this request is sent, and the server MUST ignore this value. + +**AndXOffset (2 bytes):** This field MUST be set to the offset in bytes from the start of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) to the start of the **WordCount** field of the next SMB command request in this packet. This field is valid only if the **AndXCommand** field is not set to 0xFF. If **AndXCommand** is 0xFF, this field MUST be ignored by the server. + +**Flags (2 bytes):** A 16-bit field used to modify the SMB_COM_TREE_CONNECT_ANDX Request (section 2.2.4.55.1). The client MUST set reserved values to 0, and the server MUST ignore them. + +| Bitmask | Meaning | +| ---------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| TREE_CONNECT_ANDX_DISCONNECT_TID

0x0001 | If this bit is set and the **SMB_Header.TID** field of the request is valid, the [**tree connect**](#gt_c65d1989-3473-4fa9-ac45-6522573823e3) specified by the **SMB_Header.TID** field of the request SHOULD be disconnected when the server sends the response. If this tree disconnect fails, the error SHOULD be ignored. If this bit is set and the **SMB_Header.TID** field of the request is invalid, the server MUST ignore this bit. | +| 0x0002 | Reserved. SHOULD be zero.[<106>](#Appendix_A_106) | +| 0xFFFC | Reserved. MUST be zero. | + +**PasswordLength (2 bytes):** This field MUST be the length, in bytes, of the **SMB_Data.Bytes.Password** field. + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** The value of this field MUST be 0x0003 or greater. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Password (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Pad (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Path (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Service (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Password (variable):** An array of bytes. + +- If the server is operating in share level access control mode and plaintext passwords have been negotiated, then the **Password** MUST be an OEM_STRING representing the user's password in plaintext. +- If the server is operating in share level access control mode and challenge/response authentication has been negotiated, then the **Password** MUST be an authentication response. +- If authentication is not used, then the **Password** SHOULD be a single null padding byte (which takes the place of the Pad\[\] byte). + +The **SMB_Parameters.Bytes.PasswordLength** MUST be the full length of the **Password** field. If the **Password** is the null padding byte, the password length is 1. + +**Pad (variable):** Padding bytes. If Unicode support has been enabled and SMB_FLAGS2_UNICODE is set in **SMB_Header.Flags2**, this field MUST contain zero or one null padding bytes as needed to ensure that the **Path** string is aligned on a 16-bit boundary. + +**Path (variable):** A null-terminated string that represents the server and share name of the resource to which the client attempts to connect. This field MUST be encoded using Universal Naming Convention (UNC) syntax. If SMB_FLAGS2_UNICODE is set in the **Flags2** field of the SMB Header of the request, the string MUST be a null-terminated array of 16-bit Unicode characters. Otherwise, the string MUST be a null-terminated array of OEM characters. If the string consists of Unicode characters, this field MUST be aligned to start on a 2-byte boundary from the start of the SMB Header. A path in UNC syntax would be represented by a string in the following form: + +- \\\\server\\share + +**Service (variable):** The type of resource that the client attempts to access. This field MUST be a null-terminated array of OEM characters even if the client and server have negotiated to use Unicode strings. The valid values for this field are as follows: + +| Service String | Description | +| -------------- | -------------------------------------- | +| "A:" | Disk Share | +| "LPT1:" | Printer Share | +| "IPC" | Named Pipe | +| "COMM" | Serial Communications device | +| "?????" | Matches any type of device or resource | + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- UCHAR AndXCommand; +- UCHAR AndXReserved; +- USHORT AndXOffset; +- USHORT OptionalSupport; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- OEM_STRING Service; +- SMB_STRING NativeFileSystem; +- } + +**SMB_Header:** + +**TID (2 bytes):** If the command is successful, the **TID** field in the response header MUST contain the TID identifying the newly created connection. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ------------------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data (variable) | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (7 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** The value of this field MUST be 0x03. + +**Words (6 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------------- | --- | --- | --- | --- | --- | --- | --- | ------------ | --- | ---------- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| AndXCommand | | | | | | | | AndXReserved | | | | | | | | AndXOffset | | | | | | | | | | | | | | | | +| OptionalSupport | | | | | | | | | | | | | | | | + +**AndXCommand (1 byte):** The command code for the next SMB command in the packet. This value MUST be set to 0xFF if there are no additional SMB command responses in the server response packet. + +**AndXReserved (1 byte):** A reserved field. This MUST be set to 0x00 when this response is sent, and the client MUST ignore this field. + +**AndXOffset (2 bytes):** This field MUST be set to the offset in bytes from the start of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) to the start of the **WordCount** field in the next SMB command response in this packet. This field is valid only if the **AndXCommand** field is not set to 0xFF. If **AndXCommand** is 0xFF, this field MUST be ignored by the client. + +**OptionalSupport (2 bytes):** A 16-bit field. The following **OptionalSupport** field flags are defined. Any combination of the following flags MUST be supported. All undefined values are considered reserved. The server SHOULD set them to 0, and the client MUST ignore them. + +| Value | Meaning | +| ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| SMB_SUPPORT_SEARCH_BITS

0x0001 | If set, the server supports the use of SMB_FILE_ATTRIBUTES (section [2.2.1.2.4](#Section_2198f480e0474df0ba64f28eadef00b9)) exclusive search attributes in client requests. | +| SMB_SHARE_IS_IN_DFS

0x0002 | If set, this share is managed by DFS, as specified in [\[MS-DFSC\]](%5bMS-DFSC%5d.pdf#Section_3109f4be2dbb42c99b8e0b34f7a2135e). | + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** The value of this field MUST be greater than or equal to 0x0002. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Service (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| NativeFileSystem (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Service (variable):** The type of the shared resource to which the **TID** is connected. The Service field MUST be encoded as a null-terminated array of OEM characters, even if the client and server have negotiated to use Unicode strings. The valid values for this field are as follows. + +| Service string | Description | +| -------------- | ---------------------------- | +| "A:" | Disk Share | +| "LPT1:" | Printer Share | +| "IPC" | Named Pipe | +| "COMM" | Serial Communications device | + +**NativeFileSystem (variable):** The name of the file system on the local resource to which the returned **TID** is connected. If SMB_FLAGS2_UNICODE is set in the **Flags2** field of the SMB Header of the response, this value MUST be a null-terminated string of Unicode characters. Otherwise, this field MUST be a null-terminated string of OEM characters. For resources that are not backed by a file system, such as the IPC\$ share used for named pipes, this field MUST be set to the empty string.[<107>](#Appendix_A_107) + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ------------------------------ | -------------------------------------------------- | ---------------- | ----------------------------------------------------------------------------- | +| ERRDOS (0x01) | ERRbadpath

(0x0003) | STATUS_OBJECT_PATH_NOT_FOUND

(0xC000003A) | ENOENT | The share path does not reference a valid resource. | +| ERRDOS (0x01) | ERRnoaccess

(0x0005) | STATUS_LOGON_FAILURE

(0xC000006D) | EPERM | The server rejected the client logon attempt. | +| ERRDOS (0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources. Out of memory or TIDs. | +| ERRDOS (0x01) | ERRpaused

(0x0046) | STATUS_SHARING_PAUSED

(0xC00000CF) | | The server is temporarily paused. | +| ERRDOS (0x01) | ERRreqnotaccep

(0x0047) | STATUS_REQUEST_NOT_ACCEPTED

(0xC00000D0) | | The server has no more connections available. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. Not enough parameter bytes were sent. | +| ERRSRV

(0x02) | ERRbadpw

(0x0002) | STATUS_LOGON_FAILURE

(0xC000006D) | | Incorrect password during logon attempt. | +| ERRSRV

(0x02) | ERRaccess

(0x0004) | STATUS_ACCESS_DENIED

(0xC0000022) | | The user is not authorized to access the resource. | +| ERRSRV

(0x02) | ERRinvnetname

(0x0006) | STATUS_BAD_NETWORK_NAME

(0xC00000CC) | | The share path is not valid. | +| ERRSRV

(0x02) | ERRinvdevice

(0x0007) | STATUS_BAD_DEVICE_TYPE

(0xC00000CB) | | Resource type invalid. Value of **Service** field in the request was invalid. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** supplied is not defined to the session. | + +#### SMB_COM_SECURITY_PACKAGE_ANDX (0x7E) + +This command was introduced in the **LAN Manager 1.0** dialect. It is now [**obsolete**](#gt_73fb9153-adab-4f17-b472-426f982e360c). + +This command was used to negotiate security packages and related information, but is no longer used. Documentation describing the implementation of this command can be found in [\[XOPEN-SMB\]](https://go.microsoft.com/fwlink/?linkid=2297696) section 11.2. Clients SHOULD NOT send requests using this command code. Servers receiving requests with this command code SHOULD return STATUS_NOT_IMPLEMENTED (ERRDOS/ERRbadfunc).[<108>](#Appendix_A_108) + +#### SMB_COM_QUERY_INFORMATION_DISK (0x80) + +This is an original **Core Protocol** command. **This command is deprecated.** New client implementations SHOULD use the SMB_COM_TRANSACTION2 command along with a subcommand of TRANS2_QUERY_FS_INFORMATION. + +This command MAY be sent by a client to obtain the capacity and remaining free space on the volume hosting the subtree indicated by the **TID** in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f). The client MUST provide a valid **TID** in the SMB Header. The **TID** SHOULD have been acquired through a previously successful use of one of the SMB commands for connecting to a subtree. + +The block or allocation units used in the response MAY be independent of the actual physical or logical allocation algorithm(s) used internally by the server. However, they MUST accurately reflect the amount of space on the server. + +The response returns only 16 bits of information for each field. It is possible that some system require more than this amount of information. **TotalUnits** is commonly much larger than 65,535. However, the typical client relies on total disk size in bytes, and the free space in bytes. Hence the server SHOULD adjust the relative values of **BlocksPerUnit** and **BlockSize** to achieve the most accurate representation possible, given the 16-bit restriction. If after all adjustment, the values still exceed a 16-bit representation, the largest possible values for **TotalUnits** or **FreeUnits** (0xFFFF) SHOULD be returned. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | -------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | SMB_Data | | | | | | | | | | | | | | | | + +**SMB_Parameters (1 byte):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x00. No parameters are sent by this command. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this command. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT TotalUnits; +- USHORT BlocksPerUnit; +- USHORT BlockSize; +- USHORT FreeUnits; +- USHORT Reserved; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | -------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data | | | | | | | | +| ... | | | | | | | | + +**SMB_Parameters (11 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x05. + +**Words (10 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ------------ | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| TotalUnits | | | | | | | | | | | | | | | | BlockPerUnit | | | | | | | | | | | | | | | | +| BlockSize | | | | | | | | | | | | | | | | FreeUnits | | | | | | | | | | | | | | | | +| Reserved | | | | | | | | | | | | | | | | + +**TotalUnits (2 bytes):** This field is a 16-bit unsigned value that represents the total count of logical allocation units available on the volume. + +**BlockPerUnit (2 bytes):** This field is a 16-bit unsigned value that represents the number of blocks per allocation unit for the volume. + +**BlockSize (2 bytes):** This field is a 16-bit unsigned value that represents the size in bytes of each allocation unit for the volume. + +**FreeUnits (2 bytes):** This field is a 16-bit unsigned value that represents the total number of free allocation units available on the volume. + +**Reserved (2 bytes):** This field is a 16-bit unsigned field and is reserved. The client SHOULD ignore this field. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | --------------------------- | -------------------------------------------------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | | Permissions denied request on the file system. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Unspecified internal server error. | +| ERRSRV

(0x02) | ERRaccess

(0x0004) | STATUS_NETWORK_ACCESS_DENIED

(0xC00000CA) | EACCES | Client does not have the required read permissions on the share. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | ENOTDIR | The **TID** specified in the command was invalid OR The directory referenced by the **TID** has been removed from the system. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** specified is not defined as a valid ID on this server session, or the user identified by the **UID** does not have sufficient privileges. | +| ERRHRD (0x03) | ERRnotready

(0x0015) | STATUS_NO_MEDIA_IN_DEVICE

(0xC0000013) | ENOENT | The file system has been removed from the system. | +| ERRHRD (0x03) | ERRdata

(0x0017) | | EIO | Physical I/O error while reading disk resource. | + +#### SMB_COM_SEARCH (0x81) + +This is an original **Core Protocol** command. **This command is deprecated.** New client implementations SHOULD use the TRANS2_FIND_FIRST2 subcommand (section [2.2.6.2](#Section_a782468b56f14066bb6ee2630f0e8695)) instead. + +The SMB_COM_SEARCH command searches a directory for files or other objects that have names matching a given wildcard template. The response message contains as many of the found names as can fit, given the maximum buffer size. The response message also contains a continuation key that MAY be used in subsequent SMB_COM_SEARCH command messages to return the next set of matching names. + +This command returns only [**8.3 name**](#gt_d2302116-d3d3-4465-a72e-c07a7737b7ae) format file names, and the base set of file attributes. [**Unicode**](#gt_c305d0ab-8b94-461a-bd76-13b40cb8c4d8) is not supported; names are returned in the extended **ASCII (OEM) character set** only. There is no close operation associated with SMB_COM_SEARCH. The server MUST maintain search state until the end of the search is reached, the **PID** or **TID** associated with the search is closed, the **UID** associated with the search is invalidated (logged off), or the session is closed. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT MaxCount; +- SMB_FILE_ATTRIBUTES SearchAttributes; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR BufferFormat1; +- SMB_STRING FileName; +- UCHAR BufferFormat2; +- USHORT ResumeKeyLength; +- SMB_Resume_Key ResumeKey\[ResumeKeyLength\]; +- } +- } + +**SMB_Header** + +**TID (2 bytes):** A valid TID MUST be provided. The TID MUST refer to a file system subtree. + +**UID (2 bytes):** A valid UID MUST be provided and MUST have, at a minimum, read permission on all directories in the **FileName** path. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | ------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | SMB_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (5 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x02. + +**Words (4 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| MaxCount | | | | | | | | | | | | | | | | SearchAttributes | | | | | | | | | | | | | | | | + +**MaxCount (2 bytes):** The maximum number of directory entries to return. This value represents the maximum number of entries across the entirety of the search, not just the initial response. + +**SearchAttributes (2 bytes):** An attribute mask used to specify the standard attributes a file MUST have in order to match the search. If the value of this field is 0x0000, then only normal files are returned. If the Volume Label attribute is set, the server MUST return only the volume label (the Volume Label attribute is exclusive). If the Directory, System, or Hidden attributes are specified, then those entries are returned in addition to the normal files. Exclusive search attributes (see section [2.2.1.2.4](#Section_2198f480e0474df0ba64f28eadef00b9)) can also be set. + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0005 or greater. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------- | --- | --- | --- | --- | --- | --- | --- | ------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | -------------------- | --- | --- | --- | --- | --- | ---------- | --- | +| BufferFormat1 | | | | | | | | FileName (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| BufferFormat2 | | | | | | | | ResumeKeyLength | | | | | | | | | | | | | | | | ResumeKey (variable) | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**BufferFormat1 (1 byte):** This field MUST be 0x04, which indicates that a null-terminated SMB_STRING is to follow. + +**FileName (variable):** A null-terminated SMB_STRING. This is the full directory path (relative to the TID) of the file(s) being sought. Only the final component of the path MAY contain wildcards. This string MAY be the empty string. + +**BufferFormat2 (1 byte):** This field MUST be 0x05, which indicates a variable block is to follow. + +**ResumeKeyLength (2 bytes):** This field MUST be either 0x0000 or 21 (0x0015). If the value of this field is 0x0000, this is an initial search request. The server MUST allocate resources to maintain search state so that subsequent requests MAY be processed. If the value of this field is 21 (0x0015), this request MUST be the continuation of a previous search, and the next field MUST contain a **ResumeKey** previously returned by the server. + +**ResumeKey (variable): SMB_Resume_Key** If the value of **ResumeKeyLength** is 21 (0x0015), this field MUST contain a **ResumeKey** returned by the server in response to a previous SMB_COM_SEARCH request. The **ResumeKey** contains data used by both the client and the server to maintain the state of the search. The structure of the **ResumeKey** follows: + +- SMB_Resume_Key +- { +- UCHAR Reserved; +- UCHAR ServerState\[16\]; +- UCHAR ClientState\[4\]; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------- | --- | --- | --- | --- | --- | --- | --- | ---------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Reserved | | | | | | | | ServerState (16 bytes) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | ClientState | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | + +**Reserved (1 byte):** This field is reserved and MUST NOT be modified by the client. Older documentation is contradictory as to whether this field is reserved for client side or server side use. New server implementations SHOULD avoid using or modifying the content of this field.[<109>](#Appendix_A_109) + +**ServerState (16 bytes):** This field is maintained by the server and MUST NOT be modified by the client. The contents of this field are server-specific.[<110>](#Appendix_A_110) + +**ClientState (4 bytes):** This field MAY be used by the client to maintain state across a series of SMB_COM_SEARCH calls. The value provided by the client MUST be returned in each **ResumeKey** provided in the response. The contents of this field are client-specific. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT Count; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR BufferFormat; +- USHORT DataLength; +- SMB_Directory_Information DirectoryInformationData\[DataLength\]; +- } +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ------------------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data (variable) | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (3 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x01. + +**Words (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Count | | | | | | | | | | | | | | | | + +**Count (2 bytes):** The number of directory entries returned in this response message. This value MUST be less than or equal to the value of **MaxCount** in the initial request. + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be greater than or equal to 0x0003. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------ | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ----------------------------------- | --- | --- | --- | --- | --- | ---------- | --- | +| BufferFormat | | | | | | | | DataLength | | | | | | | | | | | | | | | | DirectoryInformationData (variable) | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**BufferFormat (1 byte):** This field MUST be 0x05, which indicates that a variable-size block is to follow. + +**DataLength (2 bytes):** The size, in bytes, of the DirectoryInformationData array, which follows. This field MUST be equal to 43 times the value of **SMB_Parameters.Count**. + +**DirectoryInformationData (variable): Array of SMB_Directory_Information** An array of zero or more SMB_Directory_Information records. The structure and contents of these records is specified below. Note that the SMB_Directory_Information record structure is a fixed 43 bytes in length. + +- SMB_Directory_Information +- { +- SMB_Resume_Key ResumeKey; +- UCHAR FileAttributes; +- SMB_TIME LastWriteTime; +- SMB_DATE LastWriteDate; +- ULONG FileSize; +- OEM_STRING FileName; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------------- | --- | --- | --- | --- | --- | --- | --- | -------------- | --- | ---------- | --- | --- | --- | --- | --- | ------------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ResumeKey (21 bytes) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | FileAttributes | | | | | | | | LastWriteTime | | | | | | | | | | | | | | | | +| LastWriteDate | | | | | | | | | | | | | | | | FileSize | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | FileName (13 bytes) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | + +**ResumeKey (21 bytes): SMB_Resume_Key** While each **DirectoryInformationData** entry has a **ResumeKey** field, the client MUST use only the **ResumeKey** value from the last **DirectoryInformationData** entry when continuing the search with a subsequent SMB_COM_SEARCH command. + +**FileAttributes (1 byte):** These are the file system attributes of the file. + +**LastWriteTime (2 bytes):** The time when the file was last modified. The SMB_TIME structure contains a set of bit fields indicating hours, minutes, and seconds (with a 2 second resolution). + +**LastWriteDate (2 bytes):** The date when the file was last modified. The SMB_DATE structure contains a set of bit fields indicating the year, month, and date. + +**FileSize (4 bytes):** The size of the file, in bytes. If the file is larger than (2 \*\* 32 - 1) bytes in size, the server SHOULD return the least significant 32 bits of the file size. + +**FileName (13 bytes):** The null-terminated 8.3 name format file name. The file name and extension, including the '.' delimiter MUST be left-justified in the field. The character string MUST be padded with " " (space) characters, as necessary, to reach 12 bytes in length. The final byte of the field MUST contain the terminating null character. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | -------------------------------------------- | --------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRbadpath (0x0003) | STATUS_OBJECT_PATH_NOT_FOUND

(0xC000003A)

STATUS_OBJECT_PATH_SYNTAX_BAD

(0xC000003B) | ENOTDIR | A non-terminal component of the specified path was not a directory OR the path syntax is invalid. | +| ERRDOS

(0x01) | ERRnoaccess (0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | EACCES | No file system permission on the specified pathname. | +| ERRDOS

(0x01) | ERRbadfid (0x0006) | STATUS_INVALID_HANDLE

(0xC0000008)

STATUS_SMB_BAD_FID

(0x00060001) | ENFILE | Attempt to resume a search that was not active on the server. | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | | The server is out of resources. | +| ERRDOS

(0x01) | ERRnofiles (0x0012) | STATUS_NO_MORE_FILES

(0x80000006) | EOF | No more matching files found on the server. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB request. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** is no longer valid. | +| ERRDOS

(0x01) | ERROR_NO_MORE_SEARCH_HANDLES

(0x0071) | STATUS_OS2_NO_MORE_SIDS

(0x00710001) | EMFILE

ENFILE | Maximum number of searches has been exhausted. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B00002) | | The **UID** in the header is not valid for this session. | +| ERRHRD (0x03) | ERRdata

(0x0017) | STATUS_CRC_ERROR

(0xC000003F) | EIO | Data I/O error (incorrect CRC on device). | + +In [\[XOPEN-SMB\]](https://go.microsoft.com/fwlink/?linkid=2297696) it is noted that POSIX-style servers MAY also generate ENOENT while searching for files. ENOENT errors MUST be handled on the server side and MUST NOT be returned to the client. + +#### SMB_COM_FIND (0x82) + +This command was introduced in the **LAN Manager 1.0** dialect. **This command is deprecated**. New client implementations SHOULD use the SMB_COM_TRANSACTION2 subcommand TRANS2_FIND_FIRST2 (section [2.2.6.2](#Section_a782468b56f14066bb6ee2630f0e8695)) instead. + +This command is identical in structure and purpose to SMB_COM_SEARCH. The only difference is that SMB_COM_FIND is paired with the SMB_COM_FIND_CLOSE command, which allows the client to explicitly close a search operation. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT MaxCount; +- SMB_FILE_ATTRIBUTES SearchAttributes; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR BufferFormat1; +- SMB_STRING FileName; +- UCHAR BufferFormat2; +- USHORT ResumeKeyLength; +- SMB_Resume_Key ResumeKey\[ResumeKeyLength\]; +- } +- } + +**SMB_Header:** + +**TID (2 bytes):** A valid **TID** MUST be provided. The **TID** MUST refer to a file system subtree. + +**UID (2 bytes):** A valid **UID** MUST be provided and MUST have, at a minimum, read permission on all directories in the **FileName** path. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | ------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | SMB_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (5 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x02. + +**Words (4 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| MaxCount | | | | | | | | | | | | | | | | SearchAttributes | | | | | | | | | | | | | | | | + +**MaxCount (2 bytes):** The maximum number of directory entries to return. This value represents the maximum number of entries across the entirety of the search, not just the initial response. + +**SearchAttributes (2 bytes):** An attribute mask used to specify the standard attributes that a file MUST have to match the search. If the value of this field is 0x0000, then only normal files MUST be returned. If the Volume Label attribute is set, the server MUST return only the volume label (the Volume Label attribute is exclusive). If the Directory, System, or Hidden attributes are specified, then those entries MUST be returned in addition to the normal files. Exclusive search attributes (see section [2.2.1.2.4](#Section_2198f480e0474df0ba64f28eadef00b9)) can also be set. + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0005 or greater. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------- | --- | --- | --- | --- | --- | --- | --- | ------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | -------------------- | --- | --- | --- | --- | --- | ---------- | --- | +| BufferFormat1 | | | | | | | | FileName (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| BufferFormat2 | | | | | | | | ResumeKeyLength | | | | | | | | | | | | | | | | ResumeKey (variable) | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**BufferFormat1 (1 byte):** This field MUST be 0x04, which indicates that a null-terminated ASCII string is to follow. + +**FileName (variable):** A null-terminated character string. This is the full directory path (relative to the **TID**) of the file(s) being sought. Only the final component of the path MAY contain wildcards. This string MAY be the empty string. + +**BufferFormat2 (1 byte):** This field MUST be 0x05, which indicates that a variable block is to follow. + +**ResumeKeyLength (2 bytes):** This field MUST be either 0x0000 or 21 (0x0015). If the value of this field is 0x0000, then this is an initial search request. The server MUST allocate resources to maintain search state so that subsequent requests can be processed. If the value of this field is 21 (0x0015) then this request MUST be the continuation of a previous search, and the next field MUST contain a **ResumeKey** previously returned by the server. + +**ResumeKey (variable):** If the value of the **ResumeKeyLength** field is 21 (0x0015), this field MUST contain a **ResumeKey** returned by the server in response to a previous SMB_COM_SEARCH request. The **ResumeKey** contains data used by both the client and the server to maintain the state of the search. The structure of the **ResumeKey** follows. + +- SMB_Resume_Key +- { +- UCHAR Reserved; +- UCHAR ServerState\[16\]; +- UCHAR ClientState\[4\]; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------- | --- | --- | --- | --- | --- | --- | --- | ---------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Reserved | | | | | | | | ServerState (16 bytes) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | ClientState | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | + +**Reserved (1 byte):** This field is reserved and MUST NOT be modified by the client. Older documentation is contradictory as to whether this field is reserved for client-side or server-side use. New server implementations SHOULD avoid using or modifying the content of this field. + +**ServerState (16 bytes):** This field is maintained by the server and MUST NOT be modified by the client. The contents of this field are server-specific. + +**ClientState (4 bytes): Array of UCHAR** This field MAY be used by the client to maintain state across a series of SMB_COM_SEARCH calls. The value provided by the client MUST be returned in each **ResumeKey** provided in the response. The contents of this field are client-specific. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT Count; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR BufferFormat; +- USHORT DataLength; +- SMB_Directory_Information DirectoryInformationData\[DataLength\]; +- } +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ------------------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data (variable) | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (3 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x01. + +**Words (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Count | | | | | | | | | | | | | | | | + +**Count (2 bytes):** The number of directory entries returned in this response message. This value MUST be less than or equal to the value of **MaxCount** in the initial request. + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be greater than or equal to 0x0003. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------ | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ----------------------------------- | --- | --- | --- | --- | --- | ---------- | --- | +| BufferFormat | | | | | | | | DataLength | | | | | | | | | | | | | | | | DirectoryInformationData (variable) | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**BufferFormat (1 byte):** This field MUST be 0x05, which indicates that a variable-size block is to follow. + +**DataLength (2 bytes):** The size, in bytes, of the **DirectoryInformationData** array, which follows. This field MUST be equal to 43 times the value of **SMB_Parameters.Words.Count**. + +**DirectoryInformationData (variable):** An array of zero or more SMB_Directory_Information records. The structure and contents of these records is specified below. Note that the SMB_Directory_Information record structure is a fixed 43 bytes in length. + +- SMB_Directory_Information +- { +- SMB_Resume_Key ResumeKey; +- UCHAR FileAttributes; +- SMB_TIME LastWriteTime; +- SMB_DATE LastWriteDate; +- ULONG FileSize; +- OEM_STRING FileName\[13\]; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------------- | --- | --- | --- | --- | --- | --- | --- | -------------- | --- | ---------- | --- | --- | --- | --- | --- | ------------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ResumeKey (21 bytes) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | FileAttributes | | | | | | | | LastWriteTime | | | | | | | | | | | | | | | | +| LastWriteDate | | | | | | | | | | | | | | | | FileSize | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | FileName (13 bytes) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | + +**ResumeKey (21 bytes): SMB_Resume_Key** While each **DirectoryInformationData** entry has a **ResumeKey** field, the client MUST use only the **ResumeKey** value from the last **DirectoryInformationData** entry when continuing the search with a subsequent SMB_COM_SEARCH command. + +**FileAttributes (1 byte):** These are the file system attributes of the file. + +**LastWriteTime (2 bytes):** The time at which the file was last modified. + +**LastWriteDate (2 bytes):** The date when the file was last modified. + +**FileSize (4 bytes):** The size of the file, in bytes. If the file is larger than (2 \*\* 32 - 1) bytes in size, the server SHOULD return the least-significant 32 bits of the file size. + +**FileName (13 bytes):** The null-terminated **8.3 name** format file name. The file name and extension, including the '.' delimiter MUST be left-justified in the field. The character string MUST be padded with " " (space) characters, as necessary, to reach 12 bytes in length. The final byte of the field MUST contain the terminating null character. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | -------------------------------------------- | --------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRbadpath (0x0003) | STATUS_OBJECT_PATH_NOT_FOUND

(0xC000003A)

STATUS_OBJECT_PATH_SYNTAX_BAD

(0xC000003B) | ENOTDIR | A non-terminal component of the specified path was not a directory OR the path syntax is invalid. | +| ERRDOS

(0x01) | ERRnoaccess (0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | EACCES | No file system permission on the specified pathname. | +| ERRDOS

(0x01) | ERRbadfid (0x0006) | STATUS_INVALID_HANDLE

(0xC0000008)

STATUS_SMB_BAD_FID

(0x00060001) | ENFILE | Attempt to resume a search that was not active on the server. | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | | The server is out of resources. | +| ERRDOS

(0x01) | ERRnofiles (0x0012) | STATUS_NO_MORE_FILES

(0x80000006) | EOF | No more matching files found on the server. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB request. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** is no longer valid. | +| ERRDOS

(0x01) | ERROR_NO_MORE_SEARCH_HANDLES

(0x0071) | STATUS_OS2_NO_MORE_SIDS

(0x00710001) | EMFILE

ENFILE | Maximum number of searchs has been exhausted. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** in the header is not valid for this session. | +| ERRHRD (0x03) | ERRdata

(0x0017) | STATUS_CRC_ERROR

(0xC000003F) | EIO | Data I/O error (incorrect CRC on device). | + +In [\[XOPEN-SMB\]](https://go.microsoft.com/fwlink/?linkid=2297696) it is noted that POSIX-style servers MAY also generate ENOENT while searching for files. ENOENT errors MUST be handled on the server side and MUST NOT be returned to the client. + +#### SMB_COM_FIND_UNIQUE (0x83) + +This command was introduced in the **LAN Manager 1.0** dialect. **This command is deprecated**. New client implementations SHOULD use the SMB_COM_TRANSACTION2 subcommand TRANS2_FIND_FIRST2 (section [2.2.6.2](#Section_a782468b56f14066bb6ee2630f0e8695)) instead. + +SMB_COM_FIND_UNIQUE has nearly the same format as SMB_COM_SEARCH and SMB_COM_FIND, with the exception that the Request Field **SMB_Data.ResumeKey** in never present. The use of this command, as opposed to SMB_COM_SEARCH or SMB_COM_FIND, indicates to the server that it need not maintain a search context or any other state. The SMB_COM_FIND_UNIQUE command is single-use. No follow-up commands are permitted. + +As with the other search commands in this family, the request MAY include wildcard characters. The server MAY return as many matching file names as can fit in a single response. If there are any matching names, the server MUST return at least one matching name. After the SMB_COM_FIND_UNIQUE response has been returned, the search is closed. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT MaxCount; +- SMB_FILE_ATTRIBUTES SearchAttributes; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR BufferFormat1; +- SMB_STRING FileName; +- UCHAR BufferFormat2; +- USHORT ResumeKeyLength; +- SMB_Resume_Key ResumeKey\[ResumeKeyLength\]; +- } +- } + +**SMB_Header:** + +**TID (2 bytes):** A valid **TID** MUST be provided. The **TID** MUST refer to a file system subtree. + +**UID (2 bytes):** A valid **UID** MUST be provided and MUST have, at a minimum, read permission on all directories in the **FileName** path. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | ------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | SMB_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (5 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x02. + +**Words (4 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| MaxCount | | | | | | | | | | | | | | | | SearchAttributes | | | | | | | | | | | | | | | | + +**MaxCount (2 bytes):** The maximum number of directory entries to return. + +**SearchAttributes (2 bytes):** An attribute mask used to specify the standard attributes that a file MUST have in order to match the search. If the value of this field is 0, then only normal files MUST be returned. If the Volume Label attribute is set, then the server MUST only return the volume label. If the Directory, System, or Hidden attributes are specified, then those entries MUST be returned in addition to the normal files. Exclusive search attributes (see section [2.2.1.2.4](#Section_2198f480e0474df0ba64f28eadef00b9)) can also be set. + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0005 or greater. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------- | --- | --- | --- | --- | --- | --- | --- | ------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| BufferFormat1 | | | | | | | | FileName (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| BufferFormat2 | | | | | | | | ResumeKeyLength | | | | | | | | | | | | | | | | + +**BufferFormat1 (1 byte):** This field MUST be 0x04, which indicates that a null-terminated ASCII string is to follow. + +**FileName (variable):** A null-terminated SMB_STRING. This is the full directory path (relative to the TID) of the file(s) being sought. Only the final component of the path MAY contain wildcards. This string MAY be the empty string. + +**BufferFormat2 (1 byte):** This field MUST be 0x05, which indicates that a variable block is to follow. + +**ResumeKeyLength (2 bytes):** This field MUST be 0x0000. No Resume Key is permitted in the SMB_COM_FIND_UNIQUE request. If the server receives an SMB_COM_FIND_UNIQUE request with a nonzero **ResumeKeyLength**, it MUST ignore this field. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT Count; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR BufferFormat; +- USHORT DataLength; +- SMB_Directory_Information DirectoryInformationData\[DataLength\]; +- } +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ------------------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data (variable) | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (3 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x01. + +**Words (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Count | | | | | | | | | | | | | | | | + +**Count (2 bytes):** The number of directory entries returned in this response message. This value MUST be less than or equal to the value of **MaxCount** in the initial request. + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be greater than or equal to 0x0003. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------ | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ----------------------------------- | --- | --- | --- | --- | --- | ---------- | --- | +| BufferFormat | | | | | | | | DataLength | | | | | | | | | | | | | | | | DirectoryInformationData (variable) | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**BufferFormat (1 byte):** This field MUST be 0x05, which indicates that a variable-size block is to follow. + +**DataLength (2 bytes):** The size in bytes of the **DirectoryInformationData** array that follows. This field MUST be equal to 43 times the value of **SMB_Parameters.Words.Count**. + +**DirectoryInformationData (variable): Array of SMB_Directory_Information** An array of zero or more SMB_Directory_Information records. The structure and contents of these records is specified following. Note that the SMB_Directory_Information record structure is a fixed 43 bytes in length. + +- SMB_Directory_Information +- { +- SMB_Resume_Key ResumeKey; +- UCHAR FileAttributes; +- SMB_TIME LastWriteTime; +- SMB_DATE LastWriteDate; +- ULONG FileSize; +- OEM_STRING FileName\[13\]; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------------- | --- | --- | --- | --- | --- | --- | --- | -------------- | --- | ---------- | --- | --- | --- | --- | --- | ------------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ResumeKey (21 bytes) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | FileAttributes | | | | | | | | LastWriteTime | | | | | | | | | | | | | | | | +| LastWriteDate | | | | | | | | | | | | | | | | FileSize | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | FileName (13 bytes) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | + +**ResumeKey (21 bytes):** This field is structured as described in SMB_COM_FIND. The client MUST ignore the contents of this field in an SMB_COM_FIND_UNIQUE response. + +**FileAttributes (1 byte):** These are the file system attributes of the file. + +**LastWriteTime (2 bytes):** The time when the file was last modified. The SMB_TIME structure contains a set of bit fields indicating hours, minutes, and seconds (with a 2 second resolution). + +**LastWriteDate (2 bytes):** The date when the file was last modified. The SMB_DATE structure contains a set of bit fields indicating the year, month, and date. + +**FileSize (4 bytes):** The size of the file, in bytes. If the file is larger than (2 \*\* 32 - 1) bytes in size, the server SHOULD return the least significant 32 bits of the file size. + +**FileName (13 bytes):** The null-terminated [**8.3 name**](#gt_d2302116-d3d3-4465-a72e-c07a7737b7ae) format file name. The file name and extension, including the '.' delimiter MUST be left-justified in the field. The character string MUST be padded with " " (space) characters, as necessary, to reach 12 bytes in length. The final byte of the field MUST contain the terminating null character. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | --------------------------- | --------------------------------------------------------------------------------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRbadpath

(0x0003) | STATUS_OBJECT_PATH_NOT_FOUND

(0xC000003A)

STATUS_OBJECT_PATH_SYNTAX_BAD

(0xC000003B) | ENOTDIR | A non-terminal component of the specified path was not a directory OR the path syntax is invalid. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | EACCES | No file system permission on the specified pathname. | +| ERRDOS

(0x01) | ERRbadfid

(0x0006) | STATUS_INVALID_HANDLE

(0xC0000008)

STATUS_SMB_BAD_FID

(0x00060001) | ENFILE | Attempt to resume a search that was not active on the server. | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | | The server is out of resources. | +| ERRDOS

(0x01) | ERRnofiles

(0x0012) | STATUS_NO_MORE_FILES

(0x80000006) | EOF | No more matching files found on the server. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB request. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** is no longer valid. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMD_BAD_UID

(0x005B0002) | | The **UID** in the header is not valid for this session. | +| ERRHRD

(0x03) | ERRdata

(0x0017) | STATUS_CRC_ERROR

(0xC000003F) | EIO | Data I/O error (incorrect CRC on device). | + +In [\[XOPEN-SMB\]](https://go.microsoft.com/fwlink/?linkid=2297696) it is noted that POSIX-style servers MAY also generate ENOENT while searching for files. ENOENT errors MUST be handled on the server side and MUST NOT be returned to the client. + +#### SMB_COM_FIND_CLOSE (0x84) + +This command was introduced in the **LAN Manager 1.0** dialect. **This command is deprecated**. New client implementations SHOULD use the SMB_COM_TRANSACTION2 subcommand TRANS2_FIND_FIRST2 (section [2.2.6.2](#Section_a782468b56f14066bb6ee2630f0e8695)) instead. + +This command is used to close a directory search opened by SMB_COM_FIND. The initial SMB_COM_FIND request logically opens and initiates the search. Subsequent SMB_COM_FIND requests that present a valid **ResumeKey** continue the search. The SMB_COM_FIND_CLOSE closes the search, allowing the server to free any resources used to maintain the search context. + +If the initial SMB_COM_FIND fails (returns an error), the search is not open, and this command SHOULD NOT be called to close it. This command SHOULD NOT be used to close a directory search opened by SMB_COM_SEARCH. + +The format of this command is nearly identical to that of SMB_COM_SEARCH and SMB_COM_FIND, with the exception that the Reply field **SMB_Data.DirectoryInformationData** is never present. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT MaxCount; +- USHORT SearchAttributes; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR BufferFormat1; +- SMB_STRING FileName; +- UCHAR BufferFormat2; +- USHORT ResumeKeyLength; +- SMB_Resume_Key ResumeKey; +- } +- } + +**SMB_Header:** + +**TID (2 bytes):** A valid **TID** MUST be provided. The **TID** MUST refer to a connected server share and MUST match the **TID** in the corresponding SMB_COM_FIND commands. + +**UID (2 bytes):** A valid **UID** MUST be provided and MUST match the **UID** specified in the corresponding SMB_COM_FIND commands. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | ------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | SMB_Data (28 bytes) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | + +**SMB_Parameters (5 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x02. + +**Words (4 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| MaxCount | | | | | | | | | | | | | | | | SearchAttributes | | | | | | | | | | | | | | | | + +**MaxCount (2 bytes):** This field has no meaning in this context. It SHOULD[<111>](#Appendix_A_111) be set to 0x0000 by the client and MUST be ignored by the server. + +**SearchAttributes (2 bytes):** This field has no meaning in this context. It SHOULD be set to 0x0000 by the client and MUST be ignored by the server. + +**SMB_Data (28 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (26 bytes) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 26 (0x001A). + +**Bytes (26 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------- | --- | --- | --- | --- | --- | --- | --- | -------------------- | --- | ---------- | --- | --- | --- | --- | --- | ------------- | --- | --- | --- | ---------- | --- | --- | --- | --------------- | --- | --- | --- | --- | --- | ---------- | --- | +| BufferFormat1 | | | | | | | | FileName | | | | | | | | BufferFormat2 | | | | | | | | ResumeKeyLength | | | | | | | | +| ... | | | | | | | | ResumeKey (21 bytes) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | + +**BufferFormat1 (1 byte):** This field MUST be 0x04, which indicates that a null-terminated ASCII string follows. + +**FileName (1 byte): SMB_STRING** A null-terminated SMB_STRING. This MUST be the empty string. + +**BufferFormat2 (1 byte):** This field MUST be 0x05, which indicates that a variable block follows. + +**ResumeKeyLength (2 bytes):** This field MUST be 21 (0x0015). + +**ResumeKey (21 bytes): SMB_Resume_Key** This MUST be the last **ResumeKey** returned by the server in the search being closed. See SMB_COM_FIND for a description of the SMB_Resume_Key data structure. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT Count; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR BufferFormat; +- USHORT DataLength; +- } +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | -------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (3 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x01. + +**Words (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Count | | | | | | | | | | | | | | | | + +**Count (2 bytes):** The server SHOULD set this field to 0x0000, and the client MUST ignore the value of this field. No entries are returned in the response. + +**SMB_Data (5 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ----- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes | | | | | | | | | | | | | | | | +| ... | | | | | | | | + +**ByteCount (2 bytes):** This field SHOULD[<112>](#Appendix_A_112) be 0x0003. + +**Bytes (3 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------ | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| BufferFormat | | | | | | | | DataLength | | | | | | | | | | | | | | | | + +**BufferFormat (1 byte):** If sent, this field MUST be 0x05, which indicates that a variable-size block follows. + +**DataLength (2 bytes):** If sent, this field MUST be 0x0000. No **DirectoryInformationData** records are returned. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ------------------------- | --------------------------------------------------------------------------------------------------------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRbadpath (0x0003) | STATUS_OBJECT_PATH_NOT_FOUND

(0xC000003A)

STATUS_OBJECT_PATH_SYNTAX_BAD

(0xC000003B) | ENOTDIR | A non-terminal component of the specified path was not a directory OR the path syntax is invalid. | +| ERRDOS

(0x01) | ERRnoaccess (0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | EACCES | No file system permission on the specified pathname. | +| ERRDOS

(0x01) | ERRbadfid (0x0006) | STATUS_INVALID_HANDLE

(0xC0000008)

STATUS_SMB_BAD_FID

(0x00060001) | ENFILE | Attempt to resume a search that was not active on the server. | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | | The server is out of resources. | +| ERRDOS

(0x01) | ERRnofiles (0x0012) | STATUS_NO_MORE_FILES

(0x80000006) | EOF | No more matching files found on the server. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB request. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** is no longer valid. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** in the header is not valid for this session, or the user identified by the **UID** does not have sufficient privileges. | +| ERRHRD (0x03) | ERRdata

(0x0017) | STATUS_CRC_ERROR

(0xC000003F) | EIO | Data I/O error (incorrect CRC on device). | + +#### SMB_COM_NT_TRANSACT (0xA0) + +This command was introduced in the [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) dialect. + +SMB_COM_NT_TRANSACT subcommands extend the file system feature access offered by [SMB_COM_TRANSACTION2 (section 2.2.4.46)](#Section_3d9d8f3edc70410da3fc6f4a881e8cab), and also allow for the transfer of very large parameter and data blocks. + +SMB_COM_NT_TRANSACT messages MAY exceed the maximum size of a single SMB message (as determined by the value of the **MaxBufferSize** session parameter). In this case, the client will use one or more SMB_COM_NT_TRANSACT_SECONDARY messages to transfer transaction **Data** and **Parameter** bytes that did not fit in the initial message. + +The client indicates that it has not sent all of the **Data** bytes by setting **DataCount** to a value less than **TotalDataCount**. Similarly, if **ParameterCount** is less than **TotalParameterCount**, then the client has more **Parameter** bytes to send. **Parameter** bytes SHOULD be sent before **Data** bytes, and clients SHOULD attempt to send as many bytes as possible in each message. Servers SHOULD be prepared, however, to accept **Parameters** and **Data** in any order, in large or small amounts. + +For both the request and the response, the positions and lengths of the **SMB_Data.NT_Trans_Parameters** and **SMB_Data.NT_Trans_Data** fields are determined by the values of the **SMB_Parameters.ParameterOffset**, **SMB_Parameters.ParameterCount**, **SMB_Parameters.DataOffset**, and **SMB_Parameters.DataCount** fields. In addition, the **SMB_Parameters.ParameterDisplacement** and **SMB_Parameters.DataDisplacement** fields MAY be used to change the order in which subranges of bytes are transferred. Servers SHOULD transfer bytes in order and give precedence to **SMB_Data.NT_Trans_Parameters** bytes. Clients SHOULD be prepared to reconstruct transaction **SMB_Data.NT_Trans_Parameters** and **SMB_Data.NT_Trans_Data**, regardless of the order or locations in which they are delivered. + +##### Request + +The SMB_COM_NT_TRANSACT request differs in structure from the other two transaction request types. Although there are several common fields, the SMB_COM_NT_TRANSACT message rearranges fields to provide better byte alignment. The other transaction types use 16-bit fields to provide the size and offset of parameters and data; SMB_COM_NT_TRANSACT uses 32-bit fields, allowing for much larger data transfers. Finally, SMB_COM_NT_TRANSACT includes a **Function** field, which carries the subcommand code. + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- UCHAR MaxSetupCount; +- USHORT Reserved1; +- ULONG TotalParameterCount; +- ULONG TotalDataCount; +- ULONG MaxParameterCount; +- ULONG MaxDataCount; +- ULONG ParameterCount; +- ULONG ParameterOffset; +- ULONG DataCount; +- ULONG DataOffset; +- UCHAR SetupCount; +- USHORT Function; +- USHORT Setup\[SetupCount\]; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR Pad1\[\]; +- UCHAR NT_Trans_Parameters\[ParameterCount\]; +- UCHAR Pad2\[\]; +- UCHAR NT_Trans_Data\[DataCount\]; +- } +- } + +**SMB_Header:** + +The **Command** for the initial request and for all responses MUST be SMB_COM_NT_TRANSACT (0xA0). The **Command** for secondary request messages that are part of the same transaction MUST be SMB_COM_NT_TRANSACT_SECONDARY (0xA1). The **PID**, **MID**, **TID**, and **UID** MUST be the same for all requests and responses that are part of the same transaction. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| SMB_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (variable):** + +The SMB_Parameters section of the SMB_COM_NT_TRANSACT request contains the information used to manage the transaction itself. It also contains flags and setup information that provide context for the execution of the operation on the server side. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ---------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be greater than or equal to 0x13. + +**Words (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------- | --- | --- | --- | --- | --- | --- | --- | --------- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | ------------------- | --- | --- | --- | --- | --- | ---------- | --- | +| MaxSetupCount | | | | | | | | Reserved1 | | | | | | | | | | | | | | | | TotalParameterCount | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | TotalDataCount | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | MaxParameterCount | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | MaxDataCount | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | ParameterCount | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | ParameterOffset | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | DataCount | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | DataOffset | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | SetupCount | | | | | | | | +| Function | | | | | | | | | | | | | | | | Setup (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**MaxSetupCount (1 byte):** Maximum number of setup bytes that the client will accept in the transaction reply. This field MUST be set as specified in the subsections of [Transaction Subcommands (section 2.2.5)](#Section_227cb1473c094c4bb1456c94b04c8231). The server MUST NOT return more than this number of setup bytes. + +**Reserved1 (2 bytes):** Two padding bytes. This field MUST be 0x0000. This field is used to align the next field to a 32-bit boundary. + +**TotalParameterCount (4 bytes):** The total number of SMB_COM_NT_TRANSACT parameter bytes to be sent in this transaction request. This value MAY be reduced in any or all subsequent SMB_COM_NT_TRANSACT_SECONDARY requests that are part of the same transaction. This value represents transaction parameter bytes, not SMB parameter words. Transaction parameter bytes are carried in the SMB_Data block of the SMB_COM_NT_TRANSACT request or in subsequent SMB_COM_NT_TRANSACT_SECONDARY requests. + +**TotalDataCount (4 bytes):** The total number of SMB_COM_NT_TRANSACT data bytes to be sent in this transaction request. This value MAY be reduced in any or all subsequent SMB_COM_NT_TRANSACT_SECONDARY requests that are part of the same transaction. This value represents transaction data bytes, not SMB data bytes. + +**MaxParameterCount (4 bytes):** The maximum number of parameter bytes that the client will accept in the transaction reply. This field MUST be set as specified in the subsections of Transaction Subcommands. The server MUST NOT return more than this number of parameter bytes. + +**MaxDataCount (4 bytes):** The maximum number of data bytes that the client will accept in the transaction reply. This field MUST be set as specified in the subsections of Transaction Subcommands. The server MUST NOT return more than this number of data bytes. + +**ParameterCount (4 bytes):** The number of transaction parameter bytes being sent in this SMB message. If the transaction fits within a single SMB_COM_NT_TRANSACT request, this value MUST be equal to **TotalParameterCount**. Otherwise, the sum of the **ParameterCount** values in the primary and secondary transaction request messages MUST be equal to the smallest **TotalParameterCount** value reported to the server. If the value of this field is less than the value of **TotalParameterCount**, then at least one SMB_COM_NT_TRANSACT_SECONDARY message MUST be used to transfer the remaining parameter bytes. + +**ParameterOffset (4 bytes):** The offset, in bytes, from the start of the SMB_Header to the transaction parameter bytes. This MUST be the number of bytes from the start of the SMB message to the start of the **SMB_Data.Bytes.Parameters** field. Server implementations MUST use this value to locate the transaction parameter block within the SMB message. If **ParameterCount** is zero, the client/server MAY set this field to zero.[<113>](#Appendix_A_113) + +**DataCount (4 bytes):** The number of transaction data bytes being sent in this SMB message. If the transaction fits within a single SMB_COM_NT_TRANSACT request, then this value MUST be equal to **TotalDataCount**. Otherwise, the sum of the **DataCount** values in the primary and secondary transaction request messages MUST be equal to the smallest **TotalDataCount** value reported to the server. If the value of this field is less than the value of **TotalDataCount**, then at least one SMB_COM_NT_TRANSACT_SECONDARY message MUST be used to transfer the remaining data bytes. + +**DataOffset (4 bytes):** The offset, in bytes, from the start of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) to the transaction data bytes. This MUST be the number of bytes from the start of the SMB message to the start of the **SMB_Data.Bytes.Data** field. Server implementations MUST use this value to locate the transaction data block within the SMB message. If **DataCount** is zero, the client/server MAY set this field to zero.[<114>](#Appendix_A_114) + +**SetupCount (1 byte):** The number of setup words that are included in the transaction request. + +**Function (2 bytes):** The transaction subcommand code, which is used to identify the operation to be performed by the server. + +**Setup (variable):** An array of two-byte words that provides transaction context to the server. The size and content of the array are specific to the individual subcommands. + +**SMB_Data (variable):** + +The SMB_Data section of the SMB_COM_NT_TRANSACT request contains the parameters and data that are the input to the transaction operation on the server. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** The number of bytes in the **SMB_Data.Bytes** array, which follows. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------------ | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Pad1 (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| NT_Trans_Parameters (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Pad2 (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| NT_Trans_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Pad1 (variable):** This field SHOULD be used as an array of padding bytes to align the following field to a 4-byte boundary relative to the start of the SMB Header. This constraint can cause this field to be a zero-length field. This field SHOULD be set to zero by the client/server and MUST be ignored by the server/client. + +**NT_Trans_Parameters (variable):** Transaction parameter bytes. See the individual SMB_COM_NT_TRANSACT subcommand descriptions for information on parameters sent for each subcommand. + +**Pad2 (variable):** This field SHOULD be used as an array of padding bytes to align the following field to a 4-byte boundary relative to the start of the SMB Header. This constraint can cause this field to be a zero-length field. This field SHOULD be set to zero by the client/server, and MUST be ignored by the server/client. + +**NT_Trans_Data (variable):** Transaction data bytes. See the individual SMB_COM_NT_TRANSACT subcommand descriptions for information on data sent for each subcommand. + +##### Response + +The SMB_COM_NT_TRANSACT response has two possible formats. The standard format is used to return the results of the completed transaction. A shortened interim response message is sent following the initial SMB_COM_NT_TRANSACT request if secondary request messages (SMB_COM_NT_TRANSACT_SECONDARY) are pending. + +Whenever a transaction request is split across multiple SMB requests, the server evaluates the initial SMB_COM_NT_TRANSACT request to determine whether or not it has the resources necessary to process the transaction. It also checks for any other errors that it can detect based upon the initial request and then sends back an interim response. The interim response indicates to the client as to whether it can send the rest of the transaction to the server. + +The format of the SMB_COM_NT_TRANSACT Interim Server Response message is simply an [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) with an empty **Parameter** and **Data** section (**WordCount** and **ByteCount** are zero). + +- SMB_Parameters +- { +- UCHAR WordCount; +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +If no error (that is, SUCCESS) is returned in the SMB_COM_NT_TRANSACT Interim Server Response, the transaction MAY proceed. The client sends as many SMB_COM_NT_TRANSACT_SECONDARY messages as needed to transfer the remainder of the transaction subcommand. The server processes the transaction and replies with one or more SMB_COM_NT_TRANSACT response messages. + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- UCHAR Reserved1\[3\]; +- ULONG TotalParameterCount; +- ULONG TotalDataCount; +- ULONG ParameterCount; +- ULONG ParameterOffset; +- ULONG ParameterDisplacement; +- ULONG DataCount; +- ULONG DataOffset; +- ULONG DataDisplacement; +- UCHAR SetupCount; +- USHORT Setup\[SetupCount\]; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR Pad1\[\]; +- UCHAR Parameters\[ParameterCount\]; +- UCHAR Pad2\[\]; +- UCHAR Data\[DataCount\]; +- } +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| SMB_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (variable):** + +The SMB_Parameters section of the SMB_COM_NT_TRANSACT response contains information used to manage the transfer of the complete transaction response. It also contains setup information that can include subcommand return codes or state information returned by the server. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ---------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** The value of **Words.SetupCount** plus 18 (0x12). This value represents the total number of SMB parameter words and MUST be greater than or equal to 18 (0x12). + +**Words (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ---------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --------------------- | --- | --- | --- | --- | --- | ---------- | --- | +| Reserved1 | | | | | | | | | | | | | | | | | | | | | | | | TotalParameterCount | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | TotalDataCount | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | ParameterCount | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | ParameterOffset | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | ParameterDisplacement | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | DataCount | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | DataOffset | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | DataDisplacement | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | SetupCount | | | | | | | | +| Setup (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Reserved1 (3 bytes):** Reserved. This field MUST be 0x000000 in the server response. The client MUST ignore the contents of this field. + +**TotalParameterCount (4 bytes):** The total number of SMB_COM_NT_TRANSACT parameter bytes to be sent in this transaction response. This value MAY be reduced in any or all subsequent SMB_COM_NT_TRANSACT responses that are part of the same transaction. This value represents transaction parameter bytes, not SMB parameter words. Transaction parameter bytes are carried within in the SMB_data block. + +**TotalDataCount (4 bytes):** The total number of SMB_COM_NT_TRANSACT data bytes to be sent in this transaction response. This value MAY be reduced in any or all subsequent SMB_COM_NT_TRANSACT responses that are part of the same transaction. This value represents transaction data bytes, not SMB data bytes. + +**ParameterCount (4 bytes):** The number of transaction parameter bytes being sent in this SMB message. If the transaction fits within a single SMB_COM_NT_TRANSACT response, then this value MUST be equal to **TotalParameterCount**. Otherwise, the sum of the **ParameterCount** values in the transaction response messages MUST be equal to the smallest **TotalParameterCount** value reported by the server. + +**ParameterOffset (4 bytes):** The offset, in bytes, from the start of the SMB_Header to the transaction parameter bytes. This MUST be the number of bytes from the start of the SMB message to the start of the **SMB_Data.Bytes.Parameters** field. Server implementations MUST use this value to locate the transaction parameter block within the SMB message. If **ParameterCount** is zero, the client/server MAY set this field to zero.[<115>](#Appendix_A_115) + +**ParameterDisplacement (4 bytes):** The offset, relative to all of the transaction parameter bytes in this transaction response, at which this block of parameter bytes MUST be placed. This value can be used by the client to correctly reassemble the transaction parameters even if the SMB response messages are received out of order. + +**DataCount (4 bytes):** The number of transaction data bytes being sent in this SMB message. If the transaction fits within a single SMB_COM_NT_TRANSACT response, then this value MUST be equal to **TotalDataCount**. Otherwise, the sum of the **DataCount** values in the transaction response messages MUST be equal to the smallest **TotalDataCount** value reported by the server. + +**DataOffset (4 bytes):** The offset, in bytes, from the start of the SMB_Header to the transaction data bytes. This MUST be the number of bytes from the start of the SMB message to the start of the **SMB_Data.Bytes.Data** field. Server implementations MUST use this value to locate the transaction data block within the SMB message. If **DataCount** is zero, the client/server MAY set this field to zero.[<116>](#Appendix_A_116) + +**DataDisplacement (4 bytes):** The offset, relative to all of the transaction data bytes in this transaction response, at which this block of data bytes MUST be placed. This value can be used by the client to correctly reassemble the transaction data even if the SMB response messages are received out of order. + +**SetupCount (1 byte):** The number of **Setup** words that are included in the transaction response. + +**Setup (variable):** An array of two-byte words that provides transaction results from the server. The size and content of the array are specific to individual subcommand. + +**SMB_Data (variable):** + +The SMB_Data section of the SMB_COM_NT_TRANSACT response contains the parameters and data generated by the transaction subcommand. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be greater than or equal to 0x0000. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Pad1 (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Parameters (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Pad2 (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Pad1 (variable):** This field SHOULD be used as an array of padding bytes to align the following field to a 4-byte boundary relative to the start of the SMB Header (section 2.2.3.1). This constraint can cause this field to be a zero-length field. This field SHOULD be set to zero by the client/server and MUST be ignored by the server/client. + +**Parameters (variable):** Transaction parameter bytes. See the individual SMB_COM_NT_TRANSACT subcommand descriptions for information on parameters returned by the server for each subcommand. + +**Pad2 (variable):** This field SHOULD be used as an array of padding bytes to align the following field to a 4-byte boundary relative to the start of the SMB Header. This constraint can cause this field to be a zero-length field. This field SHOULD be set to zero by the client/server and MUST be ignored by the server/client. + +**Data (variable):** Transaction data bytes. See the individual SMB_COM_NT_TRANSACT subcommand descriptions for information on data returned by the server for each subcommand. + +As with the request message, the positions and lengths of the **Parameters** and **Data** fields are determined by the values of the **ParameterOffset**, **ParameterCount**, **DataOffset**, and **DataCount** fields. In addition, the **ParameterDisplacement** and **DataDisplacement** fields MAY be used to change the order in which subranges of bytes are transferred. Servers SHOULD transfer byte blocks in order and SHOULD give precedence to **Parameter** bytes. Clients SHOULD be prepared to reconstruct transaction **Parameters** and **Data** regardless of the orders or locations in which they are delivered. + +**Error Codes** + +The errors returned from calls to SMB_COM_NT_TRANSACT are specific to the subcommand being executed. See the documentation for the individual subcommands for more detailed error information. + +#### SMB_COM_NT_TRANSACT_SECONDARY (0xA1) + +The SMB_COM_NT_TRANSACT_SECONDARY command is used to complete a data transfer initiated by an SMB_COM_NT_TRANSACT request. + +##### Request + +The SMB_COM_NT_TRANSACT_SECONDARY request message has the same purpose as the other secondary transaction messages used in SMB. The fields are in a different order to provide better alignment, and the **Count**, **Offset**, and **Displacement** fields are 32 bits wide instead of 16. + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- UCHAR Reserved1\[3\]; +- ULONG TotalParameterCount; +- ULONG TotalDataCount; +- ULONG ParameterCount; +- ULONG ParameterOffset; +- ULONG ParameterDisplacement; +- ULONG DataCount; +- ULONG DataOffset; +- ULONG DataDisplacement; +- UCHAR Reserved2; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR Pad1\[\]; +- UCHAR Parameters\[ParameterCount\]; +- UCHAR Pad2\[\]; +- UCHAR Data\[DataCount\]; +- } +- } + +**SMB_Header:** + +This command MUST be sent following a successful SMB_COM_NT_TRANSACT Intermediate Response from the server. The [**PID**](#gt_38a420dd-6f31-456e-ae5c-63ec6905380d), **MID**, **TID**, and **UID** MUST be the same for all requests and responses that are part of the same transaction. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | ------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters (37 bytes) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | SMB_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (37 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ---------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words (36 bytes) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | + +**WordCount (1 byte):** This value represents the total number of SMB parameter words and MUST be 0x12. + +**Words (36 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --------------------- | --- | --- | --- | --- | --- | ---------- | --- | +| Reserved1 | | | | | | | | | | | | | | | | | | | | | | | | TotalParameterCount | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | TotalDataCount | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | ParameterCount | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | ParameterOffset | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | ParameterDisplacement | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | DataCount | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | DataOffset | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | DataDisplacement | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | Reserved2 | | | | | | | | + +**Reserved1 (3 bytes):** Reserved. Used to align the following fields to a 32-bit boundary. This field MUST contain null padding bytes in the server response. The client MUST ignore the contents of this field. + +**TotalParameterCount (4 bytes):** The total number of transaction parameter bytes to be sent to the server over the course of this transaction. This value MAY be less than or equal to the **TotalParameterCount** in preceding request messages that are part of the same transaction. This value represents transaction parameter bytes, not SMB parameter words. + +**TotalDataCount (4 bytes):** The total number of transaction data bytes to be sent to the server over the course of this transaction. This value MAY be less than or equal to the **TotalDataCount** in preceding request messages that are part of the same transaction. This value represents transaction data bytes, not SMB data bytes. + +**ParameterCount (4 bytes):** The number of transaction parameter bytes being sent in the SMB message. This value MUST be less than **TotalParameterCount**. The sum of the **ParameterCount** values across all of the request messages in a transaction MUST be equal to the **TotalParameterCount** reported in the last request message of the transaction. + +**ParameterOffset (4 bytes):** The offset, in bytes, from the start of the SMB_Header to the transaction parameter bytes contained in this SMB message. This MUST be the number of bytes from the start of the SMB message to the start of the **SMB_Data.Bytes.Parameters** field. Server implementations MUST use this value to locate the transaction parameter block within the SMB message. If **ParameterCount** is zero, the client/server MAY set this field to zero.[<117>](#Appendix_A_117) + +**ParameterDisplacement (4 bytes):** The offset, relative to all of the transaction parameter bytes sent to the server in this transaction, at which this block of parameter bytes MUST be placed. This value can be used by the server to correctly reassemble the transaction parameters even if the SMB request messages are received out of order. + +**DataCount (4 bytes):** The number of transaction data bytes being sent in this SMB message. This value MUST be less than the value of **TotalDataCount**. The sum of the **DataCount** values across all of the request messages in a transaction MUST be equal to the smallest **TotalDataCount** value reported to the server. + +**DataOffset (4 bytes):** The offset, in bytes, from the start of the SMB_Header to the transaction data bytes contained in this SMB message. This MUST be the number of bytes from the start of the SMB message to the start of the **SMB_Data.Bytes.Data** field. Server implementations MUST use this value to locate the transaction data block within the SMB message. If **DataCount** is zero, the client/server MAY set this field to zero.[<118>](#Appendix_A_118) + +**DataDisplacement (4 bytes):** The offset, relative to all of the transaction data bytes sent to the server in this transaction, at which this block of parameter bytes MUST be placed. This value can be used by the server to correctly reassemble the transaction data block even if the SMB request messages are received out of order. + +**Reserved2 (1 byte):** Reserved. MUST be 0x00. The server MUST ignore the contents of this field. + +**SMB_Data (variable):** + +The SMB_Data section of the SMB_COM_NT_TRANSACT_SECONDARY request contains parameters and data bytes being sent to the server. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** The number of bytes in the **SMB_Data.Bytes** array, which follows. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Pad1 (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Parameters (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Pad2 (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Pad1 (variable):** This field SHOULD be used as an array of padding bytes to align the following field to a 4-byte boundary relative to the start of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f). This constraint can cause this field to be a zero-length field. This field SHOULD be set to zero by the client/server and MUST be ignored by the server/client. + +**Parameters (variable):** Transaction parameter bytes. + +**Pad2 (variable):** This field SHOULD be used as an array of padding bytes to align the following field to a 4-byte boundary relative to the start of the SMB Header. This constraint can cause this field to be a zero-length field. This field SHOULD be set to zero by the client/server and MUST be ignored by the server/client. + +**Data (variable):** Transaction data bytes. + +##### Response + +There is no response message defined for the SMB_COM_NT_TRANSACT_SECONDARY command. + +**Error Codes** + +Because there is no response to an SMB_COM_NT_TRANSACT_SECONDARY request, no error codes are defined. + +#### SMB_COM_NT_CREATE_ANDX (0xA2) + +This command was introduced in the **NT LAN Manager** dialect. + +This command is used to create and open a new file, or to open an existing file, or to open and truncate an existing file to zero length, or to create a directory, or to create a connection to a named pipe. The **FID** returned MAY be used in subsequent requests. + +The message includes the pathname of the file, directory, or named pipe, and **RootDirectoryFID** (see following) that the client attempts to create or open. If the message is successful, the server response MUST include a **FID** value identifying the opened resource. The client MUST supply the **FID** in subsequent operations on the resource. The client MUST have write permission on the resource parent directory to create a new file or directory, or write permissions on the file itself to truncate the file. + +The following are the commands that MAY follow an SMB_COM_NT_CREATE_ANDX in an AndX chain: + +- [SMB_COM_READ (section 2.2.4.11)](#Section_b88922ddb18e46e09f7408eaace9a95c) +- [SMB_COM_READ_ANDX (section 2.2.4.42)](#Section_129aa093574b483ea55ddf334606a622) +- [SMB_COM_IOCTL (section 2.2.4.35)](#Section_0d8f5f1716af499da192a5fd85fbb7e1) + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- UCHAR AndXCommand; +- UCHAR AndXReserved; +- USHORT AndXOffset; +- UCHAR Reserved; +- USHORT NameLength; +- ULONG Flags; +- ULONG RootDirectoryFID; +- ULONG DesiredAccess; +- LARGE_INTEGER AllocationSize; +- SMB_EXT_FILE_ATTR ExtFileAttributes; +- ULONG ShareAccess; +- ULONG CreateDisposition; +- ULONG CreateOptions; +- ULONG ImpersonationLevel; +- UCHAR SecurityFlags; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- SMB_STRING FileName; +- } +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters (49 bytes) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | + +**SMB_Parameters (49 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words (48 bytes) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | SMB_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x18. + +**Words (48 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------- | --- | --- | --- | --- | --- | --- | --- | ------------ | --- | ---------- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ---------- | --- | --- | --- | ------------------ | --- | --- | --- | --- | --- | ---------- | --- | +| AndXCommand | | | | | | | | AndXReserved | | | | | | | | AndXOffset | | | | | | | | | | | | | | | | +| Reserved | | | | | | | | NameLength | | | | | | | | | | | | | | | | Flags | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | RootDirectoryFID | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | DesiredAccess | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | AllocationSize | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | ExtFileAttributes | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | ShareAccess | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | CreateDisposition | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | CreateOptions | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | ImpersonationLevel | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | SecurityFlags | | | | | | | | + +**AndXCommand (1 byte):** The command code for the next SMB command in the packet. This value MUST be set to 0xFF if there are no additional SMB commands in the client request packet. + +**AndXReserved (1 byte):** A reserved field. This MUST be set to 0x00 when this request is sent, and the server MUST ignore this value when the message is received. + +**AndXOffset (2 bytes):** This field MUST be set to the offset in bytes from the start of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) to the start of the WordCount field in the next SMB command in this packet. This field is valid only if the AndXCommand field is not set to 0xFF. If AndXCommand is 0xFF, this field MUST be ignored by the server. + +**Reserved (1 byte):** An unused value that SHOULD be set to 0x00 when sent and MUST be ignored on receipt. + +**NameLength (2 bytes):** This field MUST be the length of the FileName field (see following) in bytes. + +**Flags (4 bytes):** A 32-bit field containing a set of flags that modify the client request. Unused bit fields SHOULD be set to 0 when sent and MUST be ignored on receipt. + +| Name and bitmask | Meaning | +| ------------------------------------------- | ------------------------------------------------------------------------------------- | +| NT_CREATE_REQUEST_OPLOCK

0x00000002 | If set, the client requests an exclusive OpLock. | +| NT_CREATE_REQUEST_OPBATCH

0x00000004 | If set, the client requests an exclusive batch OpLock. | +| NT_CREATE_OPEN_TARGET_DIR

0x00000008 | If set, the client indicates that the parent directory of the target is to be opened. | + +**RootDirectoryFID (4 bytes):** If nonzero, this value is the File ID of an opened root directory, and the FileName field MUST be handled as relative to the directory specified by this RootDirectoryFID. If this value is 0x00000000, the FileName field MUST be handled as relative to the root of the share (the TID). The RootDirectoryFID MUST have been acquired in a previous message exchange. + +**DesiredAccess (4 bytes):** A 32-bit field of flags that indicate standard, specific, and generic access rights. These rights are used in access-control entries (ACEs) and are the primary means of specifying the requested or granted access to an object. If this value is 0x00000000, it represents a request to query the attributes without accessing the file. + +| Name and bitmask | Meaning | +| ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| FILE_READ_DATA

0x00000001 | Indicates the right to read data from the file. | +| FILE_WRITE_DATA

0x00000002 | Indicates the right to write data into the file beyond the end of the file. | +| FILE_APPEND_DATA

0x00000004 | Indicates the right to append data to the file beyond the end of the file only. | +| FILE_READ_EA

0x00000008 | Indicates the right to read the extended attributes (EAs) of the file. | +| FILE_WRITE_EA

0x00000010 | Indicates the right to write or change the extended attributes (EAs) of the file. | +| FILE_EXECUTE

0x00000020 | Indicates the right to execute the file. | +| FILE_READ_ATTRIBUTES

0x00000080 | Indicates the right to read the attributes of the file. | +| FILE_WRITE_ATTRIBUTES

0x00000100 | Indicates the right to change the attributes of the file. | +| DELETE

0x00010000 | Indicates the right to delete or to rename the file. | +| READ_CONTROL

0x00020000 | Indicates the right to read the [**security descriptor**](#gt_e5213722-75a9-44e7-b026-8e4833f0d350) of the file. | +| WRITE_DAC

0x00040000 | Indicates the right to change the [**discretionary access control list (DACL)**](#gt_d727f612-7a45-48e4-9d87-71735d62b321) in the security descriptor of the file. | +| WRITE_OWNER

0x00080000 | Indicates the right to change the owner in the security descriptor of the file. | +| SYNCHRONIZE

0x00100000 | SHOULD NOT be used by the sender and MUST be ignored by the receiver. | +| ACCESS_SYSTEM_SECURITY

0x01000000 | Indicates the right to read or change the [**system access control list (SACL)**](#gt_c189801e-3752-4715-88f4-17804dad5782) in the security descriptor for the file. If the SE_SECURITY_NAME privilege is not set in the access token, the server MUST fail the open request and return STATUS_PRIVILEGE_NOT_HELD. | +| MAXIMUM_ALLOWED

0x02000000 | Indicates that the client requests an open to the file with the highest level of access that the client has on this file. If no access is granted for the client on this file, the server MUST fail the open and return a STATUS_ACCESS_DENIED. | +| GENERIC_ALL

0x10000000 | Indicates a request for all of the access flags that are previously listed except MAXIMUM_ALLOWED and ACCESS_SYSTEM_SECURITY. | +| GENERIC_EXECUTE

0x20000000 | Indicates a request for the following combination of access flags listed previously in this table: FILE_READ_ATTRIBUTES, FILE_EXECUTE, SYNCHRONIZE, and READ_CONTROL. | +| GENERIC_WRITE

0x40000000 | Indicates a request for the following combination of access flags listed previously in this table: FILE_WRITE_DATA, FILE_APPEND_DATA, SYNCHRONIZE, FILE_WRITE_ATTRIBUTES, and FILE_WRITE_EA. | +| GENERIC_READ

0x80000000 | Indicates a request for the following combination of access flags listed previously in this table: FILE_READ_DATA, FILE_READ_ATTRIBUTES, FILE_READ_EA, and SYNCHRONIZE. | + +**AllocationSize (8 bytes):** The client MUST set this value to the initial allocation size of the file in bytes. The server MUST ignore this field if this request is to open an existing file. This field MUST be used only if the file is created or overwritten. The value MUST be set to 0x0000000000000000 in all other cases. This does not apply to directory-related requests. This is the number of bytes to be allocated, represented as a 64-bit integer value. + +**ExtFileAttributes (4 bytes):** This field contains the extended file attributes of the file being requested, encoded as an SMB_EXT_FILE_ATTR (section [2.2.1.2.3](#Section_6008aa8fd2d84366b775b81aece05bb1)) data type. + +**ShareAccess (4 bytes):** A 32-bit field that specifies how the file SHOULD be shared with other processes. The names in the table below are provided for reference use only. If **ShareAccess** values of FILE_SHARE_READ, FILE_SHARE_WRITE, or FILE_SHARE_DELETE are set for a printer file or a named pipe, the server SHOULD ignore these values. The value MUST be FILE_SHARE_NONE or some combination of the other values: + +| Name and bitmask | Meaning | +| ----------------------------------- | --------------------------------------------------------------------- | +| FILE_SHARE_NONE

0x00000000 | (No bits set.)Prevents the file from being shared. | +| FILE_SHARE_READ

0x00000001 | Other open operations can be performed on the file for read access. | +| FILE_SHARE_WRITE

0x00000002 | Other open operations can be performed on the file for write access. | +| FILE_SHARE_DELETE

0x00000004 | Other open operations can be performed on the file for delete access. | + +**CreateDisposition (4 bytes):** A 32-bit value that represents the action to take if the file already exists or if the file is a new file and does not already exist.[<119>](#Appendix_A_119) + +| Name and value | Meaning | +| ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| FILE_SUPERSEDE

0x00000000 | (No bits set.)If the file already exists, it SHOULD be superseded (overwritten). If it does not already exist, then it SHOULD be created. | +| FILE_OPEN

0x00000001 | If the file already exists, it SHOULD be opened rather than created. If the file does not already exist, the operation MUST fail. | +| FILE_CREATE

0x00000002 | If the file already exists, the operation MUST fail. If the file does not already exist, it SHOULD be created. | +| FILE_OPEN_IF

0x00000003 | If the file already exists, it SHOULD be opened. If the file does not already exist, then it SHOULD be created. This value is equivalent to (FILE_OPEN \| FILE_CREATE). | +| FILE_OVERWRITE

0x00000004 | If the file already exists, it SHOULD be opened and truncated. If the file does not already exist, the operation MUST fail. | +| FILE_OVERWRITE_IF

0x00000005 | If the file already exists, it SHOULD be opened and truncated. If the file does not already exist, it SHOULD be created. | + +**CreateOptions (4 bytes):** A 32-bit field containing flag options to use if creating the file or directory. This field MUST be set to 0x00000000 or a combination of the following possible values. Unused bit fields SHOULD be set to 0 when sent and MUST be ignored on receipt. The following is a list of the valid values and their associated behaviors. Server implementations SHOULD reserve all bits not specified in the following definitions. + +| Name and bitmask | Meaning | +| ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| FILE_DIRECTORY_FILE

0x00000001 | The file being created or opened is a directory file. With this option, the **CreateDisposition** field MUST be set to FILE_CREATE, FILE_OPEN, or FILE_OPEN_IF. When this bit field is set, other compatible CreateOptions include only the following: FILE_WRITE_THROUGH, FILE_OPEN_FOR_BACKUP_INTENT, and FILE_OPEN_BY_FILE_ID. | +| FILE_WRITE_THROUGH

0x00000002 | Applications that write data to the file MUST actually transfer the data into the file before any write request is considered complete. If FILE_NO_INTERMEDIATE_BUFFERING is set, the server MUST perform as if FILE_WRITE_THROUGH is set in the create request. | +| FILE_SEQUENTIAL_ONLY

0x00000004 | This option indicates that access to the file can be sequential. The server can use this information to influence its caching and read-ahead strategy for this file. The file MAY in fact be accessed randomly, but the server can optimize its caching and read-ahead policy for sequential access. | +| FILE_NO_INTERMEDIATE_BUFFERING

0x00000008 | The file SHOULD NOT be cached or buffered in an internal buffer by the server. This option is incompatible when the FILE_APPEND_DATA bit field is set in the **DesiredAccess** field. | +| FILE_SYNCHRONOUS_IO_ALERT

0x00000010 | This flag MUST be ignored by the server, and clients SHOULD set this to 0. | +| FILE_SYNCHRONOUS_IO_NONALERT

0x00000020 | This flag MUST be ignored by the server, and clients SHOULD set this to 0. | +| FILE_NON_DIRECTORY_FILE

0x00000040 | If the file being opened is a directory, the server MUST fail the request with STATUS_FILE_IS_A_DIRECTORY in the Status field of the SMB Header in the server response. | +| FILE_CREATE_TREE_CONNECTION

0x00000080 | This option SHOULD NOT be sent by the clients, and this option MUST be ignored by the server. | +| FILE_COMPLETE_IF_OPLOCKED

0x00000100 | This option SHOULD NOT be sent by the clients, and this option MUST be ignored by the server. | +| FILE_NO_EA_KNOWLEDGE

0x00000200 | The application that initiated the client's request does not support extended attributes (EAs). If the EAs on an existing file being opened indicate that the caller SHOULD support EAs to correctly interpret the file, the server SHOULD fail this request with STATUS_ACCESS_DENIED (ERRDOS/ERRnoaccess) in the **Status** field of the SMB Header in the server response. | +| FILE_OPEN_FOR_RECOVERY

0x00000400 | This option SHOULD NOT be sent by the clients, and this option MUST be ignored if received by the server. | +| FILE_RANDOM_ACCESS

0x00000800 | Indicates that access to the file can be random. The server MAY use this information to influence its caching and read-ahead strategy for this file. This is a hint to the server that sequential read-ahead operations might not be appropriate on the file. | +| FILE_DELETE_ON_CLOSE

0x00001000 | The file SHOULD be automatically deleted when the last open request on this file is closed. When this option is set, the **DesiredAccess** field MUST include the DELETE flag. This option is often used for temporary files. | +| FILE_OPEN_BY_FILE_ID

0x00002000 | Opens a file based on the FID. If this option is set, the server MUST fail the request with STATUS_NOT_SUPPORTED in the **Status** field of the SMB Header in the server response. | +| FILE_OPEN_FOR_BACKUP_INTENT

0x00004000 | The file is being opened or created for the purposes of either a backup or a restore operation. Thus, the server can make appropriate checks to ensure that the caller is capable of overriding whatever security checks have been placed on the file to allow a backup or restore operation to occur. The server can check for certain access rights to the file before checking the **DesiredAccess** field. | +| FILE_NO_COMPRESSION

0x00008000 | When a new file is created, the file MUST NOT be compressed, even if it is on a compressed volume. The flag MUST be ignored when opening an existing file. | +| FILE_RESERVE_OPFILTER

0x00100000 | This option SHOULD NOT be sent by the clients, and this option MUST be ignored if received by the server. | +| FILE_OPEN_NO_RECALL

0x00400000 | In a hierarchical storage management environment, this option requests that the file SHOULD NOT be recalled from tertiary storage such as tape. A file recall can take up to several minutes in a hierarchical storage management environment. The clients can specify this option to avoid such delays. | +| FILE_OPEN_FOR_FREE_SPACE_QUERY

0x00800000 | This option SHOULD NOT be sent by the clients, and this option MUST be ignored if received by the server. | + +**ImpersonationLevel (4 bytes):** This field specifies the impersonation level requested by the application that is issuing the create request, and MUST contain one of the following values. + +Impersonation is described in [\[MS-WPO\]](%5bMS-WPO%5d.pdf#Section_c5f54a7765be40a0bb829e4181d8ab67) section 8.5.1; for more information about impersonation, see [\[MSDN-IMPERS\]](https://go.microsoft.com/fwlink/?LinkId=106009). + +| Name and value | Meaning | +| --------------------------------- | ---------------------------------------------------------------- | +| SEC_ANONYMOUS

0x00000000 | The application-requested impersonation level is Anonymous. | +| SEC_IDENTIFY

0x00000001 | The application-requested impersonation level is Identification. | +| SEC_IMPERSONATE

0x00000002 | The application-requested impersonation level is Impersonation. | + +**SecurityFlags (1 byte):** An 8-bit field containing a set of options that specify the security tracking mode. These options specify whether the server is to be given a snapshot of the client's [**security context**](#gt_88d49f20-6c95-4b64-a52c-c3eca2fe5709) (called static tracking) or is to be continually updated to track changes to the client's security context (called dynamic tracking). When bit 0 of the **SecurityFlags** field is clear, static tracking is requested. When bit 0 of the **SecurityFlags** field is set, dynamic tracking is requested. Unused bit fields SHOULD be set to 0 when sent and MUST be ignored on receipt. This field MUST be set to 0x00 or a combination of the following possible values. Value names are provided for convenience only. Supported values are: + +| Name and value | Meaning | +| ----------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| SMB_SECURITY_CONTEXT_TRACKING

0x01 | When set, dynamic tracking is requested. When this bit field is not set, static tracking is requested. | +| SMB_SECURITY_EFFECTIVE_ONLY

0x02 | Specifies that only the enabled aspects of the client's security context are available to the server. If this flag is not specified, all aspects of the client's security context are available. This flag allows the client to limit the groups and privileges that a server can use while impersonating the client. | + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** The length in bytes of the remaining SMB_Data. If SMB_FLAGS2_UNICODE is set in the Flags2 field of the SMB Header of the request, this field has a minimum value of 0x0003. If SMB_FLAGS2_UNICODE is not set, this field has a minimum value of 0x0002. This field MUST be the total length of the Name field, plus any padding added for alignment. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| FileName (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**FileName (variable):** A string that represents the fully qualified name of the file relative to the supplied TID to create or truncate on the server. If SMB_FLAGS2_UNICODE is set in the Flags2 field of the SMB Header of the request, the FileName string MUST be a null-terminated array of 16-bit Unicode characters. Otherwise, the FileName string MUST be a null-terminated array of extended ASCII (OEM) characters. If the FileName string consists of Unicode characters, this field MUST be aligned to start on a 2-byte boundary from the start of the SMB Header. When opening a named pipe, the FileName field MUST contain only the relative name of the pipe, that is, the "\\PIPE\\" prefix MUST NOT be present. This is in contrast with other commands, such as SMB_COM_OPEN_ANDX and TRANS2_OPEN2, which require that the "\\PIPE" prefix be present in the pathname. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- UCHAR AndXCommand; +- UCHAR AndXReserved; +- USHORT AndXOffset; +- UCHAR OpLockLevel; +- USHORT FID; +- ULONG CreateDisposition; +- FILETIME CreateTime; +- FILETIME LastAccessTime; +- FILETIME LastWriteTime; +- FILETIME LastChangeTime; +- SMB_EXT_FILE_ATTR ExtFileAttributes; +- LARGE_INTEGER AllocationSize; +- LARGE_INTEGER EndOfFile; +- USHORT ResourceType; +- SMB_NMPIPE_STATUS NMPipeStatus; +- UCHAR Directory; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | -------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters (69 bytes) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | SMB_Data | | | | | | | | | | | | | | | | + +**SMB_Parameters (69 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ---------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words (68 bytes) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x22. + +**Words (68 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------- | --- | --- | --- | --- | --- | --- | --- | ------------ | --- | ---------- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ---------- | --- | --- | --- | ----------------- | --- | --- | --- | --- | --- | ---------- | --- | +| AndXCommand | | | | | | | | AndXReserved | | | | | | | | AndXOffset | | | | | | | | | | | | | | | | +| OpLockLevel | | | | | | | | FID | | | | | | | | | | | | | | | | CreateDisposition | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | CreateTime | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | LastAccessTime | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | LastWriteTime | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | LastChangeTime | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | ExtFileAttributes | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | AllocationSize | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | EndOfFile | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | ResourceType | | | | | | | | +| ... | | | | | | | | NMPipeStatus | | | | | | | | | | | | | | | | Directory | | | | | | | | + +**AndXCommand (1 byte):** The command code for the next SMB command in the packet. This value MUST be set to 0xFF if there are no additional SMB command responses in the server response packet. + +**AndXReserved (1 byte):** A reserved field. The server MUST set this field to 0x00 when this response is sent, and the client MUST ignore this field. + +**AndXOffset (2 bytes):** This field MUST be set to the offset in bytes from the start of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) to the start of the WordCount field in the next SMB command response in this packet. This field is valid only if the AndXCommand field is not set to 0xFF. If AndXCommand is 0xFF, this field MUST be ignored by the client. + +**OpLockLevel (1 byte):** The OpLock level granted to the client process. + +| Value | Meaning | +| ----- | ------------------------- | +| 0x00 | No OpLock granted. | +| 0x01 | Exclusive OpLock granted. | +| 0x02 | Batch OpLock granted. | +| 0x03 | Level II OpLock granted. | + +**FID (2 bytes):** A FID representing the file or directory that was created or opened. + +**CreateDisposition (4 bytes):** A 32-bit value that represents the action to take if the file already exists or if the file is a new file and does not already exist. + +| Name and bitmask | Meaning | +| ----------------------------------- | --------------------------------------- | +| FILE_SUPERSEDE

0x00000000 | The file has been superseded. | +| FILE_OPEN

0x00000001 | The file or directory has been opened. | +| FILE_CREATE

0x00000002 | The file or directory has been created. | +| FILE_OPEN_IF

0x00000003 | The file has been overwritten. | +| FILE_OVERWRITE

0x00000004 | The file already exists. | +| FILE_OVERWRITE_IF

0x00000005 | The file does not exist. | + +**CreateTime (8 bytes):** A 64-bit integer value representing the time that the file was created. The time value is a signed 64-bit integer representing either an absolute time or a time interval. Times are specified in units of 100ns. A positive value expresses an absolute time, where the base time (the 64- bit integer with value 0x0000000000000000) is the beginning of the year 1601 AD in the Gregorian calendar. A negative value expresses a time interval relative to some base time, usually the current time. + +**LastAccessTime (8 bytes):** The time that the file was last accessed encoded in the same format as **CreateTime**. + +**LastWriteTime (8 bytes):** The time that the file was last written, encoded in the same format as **CreateTime**. + +**LastChangeTime (8 bytes):** The time that the file was last changed, encoded in the same format as **CreateTime**. + +**ExtFileAttributes (4 bytes):** This field contains the extended file attributes that the server assigned to the file or directory as a result of the command, encoded as an SMB_EXT_FILE_ATTR (section [2.2.1.2.3](#Section_6008aa8fd2d84366b775b81aece05bb1)) data type. + +**AllocationSize (8 bytes):** The number of bytes allocated to the file by the server. + +**EndOfFile (8 bytes):** The end of file offset value. + +**ResourceType (2 bytes):** The file type. This field MUST be interpreted as follows. + +| Name and value | Meaning | +| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| FileTypeDisk

0x0000 | File or directory | +| FileTypeByteModePipe

0x0001 | [**Byte mode**](#gt_8586fe9a-1cfa-458a-a145-8db64d69c69c) named pipe | +| FileTypeMessageModePipe

0x0002 | [**Message mode**](#gt_c49a48e8-f1ac-4568-bc87-0672eb08868b) named pipe | +| FileTypePrinter

0x0003 | Printer device | +| FileTypeCommDevice

0x0004 | Character mode device. When an extended protocol has been negotiated, this value allows a device to be opened for driver-level I/O. This provides direct access to devices such as modems, scanners, and so forth. | + +**NMPipeStatus (2 bytes):** A 16-bit field that shows the status of the named pipe if the resource type opened is a named pipe. This field is formatted as an SMB_NMPIPE_STATUS (section [2.2.1.3](#Section_6911a7095dfb4ffbb0903e8ef872f85c)). + +**Directory (1 byte):** If the returned **FID** represents a directory, the server MUST set this value to a nonzero value (0x01 is commonly used). If the **FID** is not a directory, the server MUST set this value to 0x00 (FALSE). + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------- | ---------------------------------------------------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRbadfile

(0x0002) | STATUS_NO_SUCH_FILE

(0xC000000F) | ENOENT | The file does not exist. | +| ERRDOS

(0x01) | ERRbadpath

(0x0003) | STATUS_OBJECT_PATH_SYNTAX_BAD

(0xC000003B) | ENOENT | The file path syntax is invalid. | +| ERRDOS

(0x01) | ERRnofids

(0x0004) | STATUS_OS2_TOO_MANY_OPEN_FILES

(0x00040001)

STATUS_TOO_MANY_OPENED_FILES

(0xC000011F) | EMFILE | Too many open files; no more FIDs available. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | EPERM | Access denied. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_FILE_IS_A_DIRECTORY

(0xC00000BA) | EISDIR | Named file is an existing directory and **CreateOptions** in the request contains FILE_NON_DIRECTORY_FILE. | +| ERRDOS

(0x01) | ERRbadfid

(0x0006) | STATUS_INVALID_HANDLE

(0xC0000008)

STATUS_SMB_BAD_FID

(0x00060001) | ENFILE | Invalid **FID**; **RootDirectoryFID** is not valid. | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRDOS

(0x01) | ERRbadaccess

(0x000C) | STATUS_ACCESS_DENIED

(0xC0000022) | | Invalid open mode. | +| ERRDOS

(0x01) | ERRbadshare

(0x0020) | STATUS_SHARING_VIOLATION

(0xC0000043) | ETXTBSY | Sharing violation. | +| ERRDOS

(0x01) | ERRunsup

(0x0032) | STATUS_NOT_SUPPORTED

(0xC00000BB) | | This command is not supported by the server. | +| ERRDOS

(0x01) | ERRfilexists

(0x0050) | STATUS_OBJECT_NAME_COLLISION

(0xC0000035) | EEXIST | The file already exists. | +| ERRDOS

(0x01) | ERRinvalidparam

(0x0057) | STATUS_INVALID_PARAMETER

(0xC000000D) | | One of the request values is out of range. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. Not enough parameter bytes were sent or the path extends beyond the end of the message. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | The TID is no longer valid. | +| ERRSRV

(0x02) | ERRinvdevice

(0x0007) | STATUS_INVALID_DEVICE_TYPE

(0xC00000CB) | | Device type and request are inconsistent. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The UID supplied is not defined to the session. | +| ERRHRD

(0x03) | ERRdata

(0x0017) | STATUS_DATA_ERROR

(0xC000003E) | EIO | A problem has occurred in the physical I/O. | + +#### SMB_COM_NT_CANCEL (0xA4) + +This command was introduced in the [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) dialect. + +This command allows a client to request that a currently pending request be canceled. The server uses the identifiers supplied in **SMB_Header** to identify the client request that the client requests to cancel. The server can attempt to cancel the request or to process it immediately. The server MUST NOT send a corresponding response for this request. The client SHOULD rely on the server's response to the request that the client requests to cancel to determine the result of the request. If the server cannot identify the client's request that is to be canceled, the server SHOULD NOT send a response.[<120>](#Appendix_A_120) + +This command is used primarily to cancel outstanding notify change operations initiated with the SMB_COM_NT_TRANSACT command and NT_TRANSACT_NOTIFY_CHANGE subcommand. Clients typically use NT_TRANSACT_NOTIFY_CHANGE to avoid polling for changes to directories. Other uses include canceling commands that are waiting indefinitely on a busy resource to become available or commands that retry several times for a busy resource to become available. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +**SMB_Header:** + +**CID (2 bytes):** If the transport is connectionless, this field MUST contain the CID of the connection. + +**TID (2 bytes):** This field MUST contain the TID of the pending request(s) to be canceled. + +**UID (2 bytes):** This field MUST contain the UID of the pending request(s) to be canceled. + +**MID (2 bytes):** This field MUST contain the MID of the pending request(s) to be canceled. + +**PID (4 bytes):** This field MUST contain the PID of the pending request(s) to be canceled. The PID is calculated by combining the PIDHigh and PIDLow values as described in section [2.2.3.1](#Section_69a29f73de0c45a6a1aa8ceeea42217f). + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | -------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | SMB_Data | | | | | | | | | | | | | | | | + +**SMB_Parameters (1 byte):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x00. No parameters are sent by this request. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this request. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ------------------------- | -------------------------------------- | ---------------- | -------------------------------------------------- | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. Not enough parameter bytes were sent. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** is no longer valid. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** supplied is not known to the session. | + +#### SMB_COM_NT_RENAME (0xA5) + +This command was introduced in the [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) dialect and is obsolescent.[<121>](#Appendix_A_121) + +This command allows a client to create hard links on the remote server, to perform an in-place file rename, and to move a file within its existing path hierarchy.[<122>](#Appendix_A_122) See the **InformationLevel** field in the request for details. This command does not support wild card characters in the path or the file names. The command manipulates a single file per request. Existing files MUST NOT be overwritten. However, an in-place rename is supported. If the **NewFileName** field in the request has a zero length, the destination path for the new file MUST be the root directory of the share represented by the **TID** in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f). For in-place renames, the paths to the file MUST be identical or the request MUST fail with an appropriate error code. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- SMB_FILE_ATTRIBUTES SearchAttributes; +- USHORT InformationLevel; +- ULONG Reserved; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR BufferFormat1; +- SMB_STRING OldFileName; +- UCHAR BufferFormat2; +- SMB_STRING NewFileName; +- } +- } + +**SMB_Header:** + +**TID (2 bytes):** USHORT This field MUST contain a valid TID. + +**UID (2 bytes): USHORT** This field MUST contain a valid UID. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ---------------------- | --- | --- | --- | --- | --- | --- | --- | ---------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ---------------- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | SearchAttributes | | | | | | | | | | | | | | | | InformationLevel | | | | | | | | +| ... | | | | | | | | Reserved | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | ByteCount | | | | | | | | | | | | | | | | BufferFormat1 | | | | | | | | +| OldFileName (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| BufferFormat2 | | | | | | | | NewFileName (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x04. + +**SearchAttributes (2 bytes):** This field indicates the attributes that the target file(s) MUST have. If the attribute is 0x0000, then only normal files are renamed or linked. If the system file or hidden attributes are specified, then the rename is inclusive of both special types. + +**InformationLevel (2 bytes):** This field MUST be one of the three values shown in the following table. + +| Value | Meaning | +| ----------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| SMB_NT_RENAME_SET_LINK_INFO

0x0103 | Create a hard link to the original file. | +| SMB_NT_RENAME_RENAME_FILE

0x0104 | An in-place rename of the file.[<123>](#Appendix_A_123) | +| SMB_NT_RENAME_MOVE_FILE

0x0105 | Move the file within the path hierarchy. This information level is [**obsolete**](#gt_73fb9153-adab-4f17-b472-426f982e360c). Clients MUST NOT use this value in a request.[<124>](#Appendix_A_124) | + +**Reserved (4 bytes):** This field SHOULD be set to 0x00000000 by the client and MUST be ignored by the server.[<125>](#Appendix_A_125) + +**ByteCount (2 bytes):** This field MUST be greater than or equal to 0x0004. + +**BufferFormat1 (1 byte):** This field MUST be 0x04. + +**OldFileName (variable):** A null-terminated string containing the full path name of the file to be manipulated. Wildcards are not supported. + +**BufferFormat2 (1 byte):** This field MUST be 0x04. + +**NewFileName (variable):** A null-terminated string containing the new full path name to be assigned to the file provided in **OldFileName** or the full path into which the file is to be moved. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | ByteCount | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be set to 0x00. No parameters are sent by this message. + +**ByteCount (2 bytes):** This field MUST be set to 0x0000. No data is sent by this message. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ----------------------------- | -------------------------------------------------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRbadfile

(0x0002) | STATUS_NO_SUCH_FILE

(0xC000000F) | ENOENT | The specified file does not exist. | +| ERRDOS

(0x01) | ERRbadpath

(0x0003) | STATUS_OBJECT_PATH_SYNTAX_BAD

(0xC000003B) | ENOENT | A component in the path prefix is not a directory or the pathname contained wildcard characters. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | EPERM | The new file already exists. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | \- | \- | There are too many links to the old file. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | \- | \- | The directory is full. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | \- | \- | The old path is the last link to an executing program. | +| ERRDOS

(0x01) | ERRdiffdevice

(0x0011) | STATUS_NOT_SAME_DEVICE

(0xC00000D4) | EXDEV | The new path is on a different file system. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | \- | Invalid SMB. Request contains a packaging or value error. | +| ERRSRV

(0x02) | ERRaccess

(0x0004) | STATUS_NETWORK_ACCESS_DENIED

(0xC00000CA) | EACCES | Access denied. The given **UID** does not have permission to execute the requested command within the current context (**TID**). | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | \- | The **TID** specified in the command was invalid. | +| ERRSRV

(0x02) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRSRV

(0x02) | ERRbaduid)

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | \- | The **UID** given is not known as a valid ID on this server session. | +| ERRHRD

(0x03) | ERRnowrite

(0x0013) | STATUS_MEDIA_WRITE_PROTECTED

(0x0C00000A2) | EROFS | Attempt to modify a read-only file system. | + +#### SMB_COM_OPEN_PRINT_FILE (0xC0) + +This is an original **Core Protocol** command. + +This command is used to create a print queue spool file. The file will be queued to the printer when closed. The server SHOULD delete the file once it has been printed. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT SetupLength; +- USHORT Mode; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR BufferFormat; +- SMB_STRING Identifier\[\]; +- } +- } + +**SMB_Header:** + +**TID** (1 byte): This field MUST represent a printer share (print queue). + +**UID** (1 byte): This field MUST be valid within the SMB session, and the **UID** MUST have the appropriate permissions to create new print jobs. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | ------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | SMB_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (5 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x02. + +**Words (4 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SetupLength | | | | | | | | | | | | | | | | Mode | | | | | | | | | | | | | | | | + +**SetupLength (2 bytes):** Length, in bytes, of the printer-specific control data that is to be included as the first part of the spool file. The server MUST pass this initial portion of the spool file to the printer unmodified. + +**Mode (2 bytes):** A 16-bit field that contains a flag that specifies the print file mode. + +| Value | Meaning | +| ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| 0 | **Text mode**. Starting **SetupLength** bytes into the spool file, the server MAY modify character sequences to normalize them for printer output. For example, the printer can convert tab characters in the spool file to sequences of spaces, or normalize end-of-line sequences. | +| 1 | **Binary mode**. The server MUST NOT modify the contents of the spool file before sending it to the printer. | + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be greater than or equal to 0x0002. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------ | --- | --- | --- | --- | --- | --- | --- | --------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| BufferFormat | | | | | | | | Identifier (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**BufferFormat (1 byte):** This field MUST be 0x04, representing an ASCII string. + +**Identifier (variable):** A null-terminated string containing a suggested name for the spool file. The server can ignore, modify, or use this information to identify the [**print job**](#gt_12a6e569-e97c-4761-92f0-e397f8d5125f).[<126>](#Appendix_A_126) + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT FID; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | -------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data | | | | | | | | +| ... | | | | | | | | + +**SMB_Parameters (3 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x01. + +**Words (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| FID | | | | | | | | | | | | | | | | + +**FID (2 bytes):** The returned file handle that MUST be used by subsequent write and close operations on the spool file. When the spool file is closed, the file is queued and printed. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| ----------------------------- | ---------------------------- | -------------------------------------------------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| ERRDOS

(0x01) | (0x0001) | STATUS_INVALID_DEVICE_REQUEST

(0xC0000010) | EACCES | The device rejected the request. | +| ERRDOS

(0x01) | ERRnofids

(0x0004) | | EMFILE | This connection has reached the maximum number open file descriptors. | +| ERRDOS

(0x01) | ERRnofids

(0x0004) | | ENFILE | The server's system file table is full. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | EACCES | The client does not have permission to create the spool file. | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | | EINTR | A signal was caught during a system call. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | | EROFS | The spool file or spool queue resides on a read-only file system. | +| ERRerror

ERRSRV (0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Malformed or invalid SMB request. | +| ERRSRV (0x02) | ERRerror

(0x0001) | | | The server cannot find the spool queue for this file. | +| ERRSRV

(0x02) | ERRinvtid

0x0005 | STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** specified in the command was invalid. | +| ERRSRV

(0x02) | ERRinvdevice

(0x0007) | STATUS_BAD_DEVICE_TYPE

(0xC00000CB) | | The **TID** does not refer to a printer resource. | +| ERRSRV

(0x02) | ERRqfull

(0x0031) | STATUS_PRINT_QUEUE_FULL

(0xC00000C6) | | Insufficient resources to create the print job; the queue is full. | +| ERRSRV

(0x02) | ERRqtoobig

(0x0032) | STATUS_NO_SPOOL_SPACE

(0xC00000C7) | | The queue is full; no entry is available to create the job. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** is not defined as a valid ID for this SMB session, or the user identified by the **UID** does not have sufficient privileges. | + +#### SMB_COM_WRITE_PRINT_FILE (0xC1) + +This is an original **Core Protocol** command. This **command is deprecated**. Use the SMB_COM_WRITE_ANDX command to write to an open spool file. + +This command is used to write data to an open print queue spool file. + +The first data written to the print file MUST be printer-specific control data, the length of the control data block is specified in the **SMB_Parameters.Words.SetupLength** field in the SMB_COM_OPEN_PRINT_FILE request that is used to create the print file. A single SMB_COM_WRITE_PRINT_FILE command can contain both printer-specific control data and print file data, as long as the control data is completely written first. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT FID; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR BufferFormat; +- USHORT DataLength; +- UCHAR Data\[DataLength\]; +- } +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ------------------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data (variable) | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (3 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x01. + +**Words (2 bytes):** + +**FID:** This field MUST be a valid **FID** that is created using the SMB_COM_OPEN_PRINT_FILE command. + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be greater than or equal to 0x0003. + +**Bytes (variable): Array of UCHAR** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------ | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --------------- | --- | --- | --- | --- | --- | ---------- | --- | +| BufferFormat | | | | | | | | DataLength | | | | | | | | | | | | | | | | Data (variable) | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**BufferFormat (1 byte):** This field MUST be 0x01. + +**DataLength (2 bytes):** Length, in bytes, of the following data block. + +**Data (variable): STRING** Bytes to be written to the spool file indicated by **FID**. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | -------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | SMB_Data | | | | | | | | | | | | | | | | + +**SMB_Parameters (1 byte):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x00. No parameters are sent by this message. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ---------------------------- | --------------------------------------------------------------------------------------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | | EAGAIN | A temporary resource limitation prevented this data from being written. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED

(0xC00000CA) | | Client does not have write permission for the file. | +| ERRDOS

(0x01) | ERRbadfid

(0x0006) | STATUS_INVALID_HANDLE

(0xC0000008)

STATUS_SMB_BAD_FID

(0x00060001) | ENFILE | **FID** is invalid to the system. | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Malformed or invalid SMB request. | +| ERRSRV

(0x02) | ERRinvtid

0x0005 | STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** specified in the command was invalid. | +| ERRSRV

(0x02) | ERRinvdevice

(0x0007) | STATUS_BAD_DEVICE_TYPE

(0xC00000CB) | | The **TID** does not refer to a printer resource. | +| ERRSRV

(0x02) | ERRqfull

(0x0031) | STATUS_PRINT_QUEUE_FULL

(0xC00000C6) | | Insufficient resources to create the print job; the queue is full. | +| ERRSRV

(0x02) | ERRqtoobig

(0x0032) | STATUS_NO_SPOOL_SPACE

(0xC00000C7) | | The queue is full; no entry is available to create the job. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** is not defined as a valid ID for this SMB session, or the user identified by the **UID** does not have sufficient privileges. | +| ERRHRD

(0x03) | ERRwrite

(0x001D) | | EIO | A physical I/O error has occurred. | + +#### SMB_COM_CLOSE_PRINT_FILE (0xC2) + +This is an original **Core Protocol** command. **This command is deprecated**. Client implementations SHOULD make use of SMB_COM_CLOSE to close a spool file opened by SMB_COM_OPEN_PRINT_FILE. + +This command closes the specified print queue spool file, causing the server to queue the file for printing. + +##### Request + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT FID; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | -------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data | | | | | | | | +| ... | | | | | | | | + +**SMB_Parameters (3 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x01. + +**Words (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| FID | | | | | | | | | | | | | | | | + +**FID (2 bytes):** This field MUST be a valid FID created using the SMB_COM_OPEN_PRINT_FILE command. Following successful execution of this command, this FID MUST be invalidated. + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +##### Response + +- SMB_Parameters +- { +- UCHAR WordCount; +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | -------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | SMB_Data | | | | | | | | | | | | | | | | + +**SMB_Parameters (1 byte):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | + +**WordCount (1 byte):** This field MUST be 0x00. No parameters are sent by this message + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be 0x0000. No data is sent by this message. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ------------------------- | --------------------------------------------------------------------------------------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRbadfid (0x0006) | STATUS_INVALID_HANDLE

(0xC0000008)

STATUS_SMB_BAD_FID

(0x00060001) | ENFILE | The **FID** is invalid. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | The **TID** specified in the command is invalid. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** specified in the command is invalid. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** specified is not defined as a valid ID on this server session, or the user identified by the **UID** does not have sufficient privileges. | + +#### SMB_COM_GET_PRINT_QUEUE (0xC3) + +This is an original **Core Protocol** command (see [\[SMB-CORE\]](https://go.microsoft.com/fwlink/?LinkId=164301) section 5.26). It was rendered [**obsolete**](#gt_73fb9153-adab-4f17-b472-426f982e360c) in the **NT LAN Manager** dialect. This command was designated optional in [\[CIFS\]](https://go.microsoft.com/fwlink/?linkid=2109334).[<127>](#Appendix_A_127) + +This command was used to generate a list of items currently in a print queue associated with the specified **TID**. Clients SHOULD NOT send requests using this command code. Servers receiving requests with this command code MUST return STATUS_NOT_IMPLEMENTED (ERRDOS/ERRbadfunc). + +#### SMB_COM_READ_BULK (0xD8) + +This command was **reserved but not implemented**. It is listed in earlier documentation from Microsoft and third parties; however, no formal definition of the command was ever provided, and the command itself was never implemented. Two related commands--SMB_COM_WRITE_BULK and SMB_COM_WRITE_BULK_DATA--were also never implemented. + +Clients SHOULD NOT send requests using this command code. Servers receiving requests with this command code SHOULD[<128>](#Appendix_A_128) return STATUS_NOT_IMPLEMENTED (ERRDOS/ERRbadfunc). + +#### SMB_COM_WRITE_BULK (0xD9) + +This command was **reserved but not implemented**. It is listed in earlier documentation from Microsoft and third parties; however, no formal definition of the command was ever provided, and the command itself was never implemented. Two related commands--SMB_COM_READ_BULK and SMB_COM_WRITE_BULK_DATA--were also never implemented. + +Clients SHOULD NOT send requests using this command code. Servers receiving requests with this command code SHOULD[<129>](#Appendix_A_129) return STATUS_NOT_IMPLEMENTED (ERRDOX/ERRbadfunc). + +#### SMB_COM_WRITE_BULK_DATA (0xDA) + +This command was **reserved but not implemented**. It is listed in earlier documentation from Microsoft and third parties; however, no formal definition of the command was ever provided, and the command itself was never implemented. Two related commands--SMB_COM_READ_BULK and SMB_COM_WRITE_BULK--were also never implemented. + +Clients SHOULD NOT send requests using this command code. Servers receiving requests with this command code SHOULD[<130>](#Appendix_A_130) return STATUS_NOT_IMPLEMENTED (ERRDOS/ERRbadfunc). + +#### SMB_COM_INVALID (0xFE) + +This command was introduced in the **LAN Manager 1.0** dialect. It is a reserved value that specifically indicates an invalid command. + +Clients SHOULD NOT send requests using this command code. Servers receiving requests with this command code MUST return STATUS_SMB_BAD_COMMAND (ERRSRV/ERRbadcmd). + +#### SMB_COM_NO_ANDX_COMMAND (0xFF) + +This command was introduced in the **LAN Manager 1.0** dialect. This command code was designated as the AndX Chain terminator. + +Clients SHOULD NOT use this command code in a primary command. Servers receiving this command code in a primary command MUST return STATUS_SMB_BAD_COMMAND (ERRSRV/ERRbadcmd). + +In the earliest SMB Protocol specifications (see \[IBM-SMB\]), this command code was reserved for proprietary protocol extensions. That usage is obsolete. Core Protocol documentation from Microsoft, including [\[SMB-CORE\]](https://go.microsoft.com/fwlink/?LinkId=164301) and [\[MSFT-XEXTNP\]](https://go.microsoft.com/fwlink/?LinkId=162042), does not include any reference to the use of this command code for protocol extensions or any other purpose. + +### Transaction Subcommands + +Transaction subcommands are used to communicate with [**mailslots**](#gt_f53fe4b9-8e1d-4366-9254-3c4f73269e78) and [**named pipes**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca). Mailslots are used for one-way inter-process communication. Named pipes are bidirectional. + +#### TRANS_SET_NMPIPE_STATE (0x0001) + +This Transaction subcommand was introduced in the **LAN Manager 1.0** dialect.[<131>](#Appendix_A_131) + +The TRANS_SET_NMPIPE_STATE subcommand of the [SMB_COM_TRANSACTION](#Section_0ed1ad9fab964a7ab94a0915f3796781) allows a client to set the read mode and the [**non-blocking mode**](#gt_dcf90453-4055-4474-8357-2523ddfdb63d) of a specified named pipe. + +This section covers the specific details of the TRANS_SET_NMPIPE_STATE subcommand ONLY. Request and response fields with values specific to this transaction are covered in this section. For general information see SMB_COM_TRANSACTION. + +##### Request + +- Trans_Parameters +- { +- USHORT PipeState; +- } + +**SMB_Parameters:** + +**WordCount (1 byte):** This field value is the total number of SMB parameter words and MUST be 0x10. + +**Words (32 bytes):** + +**TotalParameterCount (2 bytes):** This field MUST be set to 0x0002 for this request. + +**TotalDataCount (2 bytes):** This field MUST be set to 0x0000 for this request. + +**MaxParameterCount (2 bytes):** This field MUST be set to 0x0000 for this request. + +**MaxDataCount (2 bytes):** This field MUST be set to 0x0000 for this request. + +**MaxSetupCount (1 byte):** This field MUST be set to 0x00 for this request. + +**Flags (2 bytes):** This field SHOULD be set to 0x0000 for this request. + +**Timeout (4 bytes):** This field SHOULD be set to 0x00000000 for this request. + +**ParameterCount (2 bytes):** This field SHOULD be set to 0x0002 for this request. + +**DataCount (2 bytes):** This field MUST be set to 0x0000 for this request. + +**SetupCount (1 byte):** This field MUST be set to 0x02 for this request. + +**Setup (4 bytes):** + +**Subcommand (2 bytes):** This field MUST be set to the transaction subcommand value of TRANS_SET_NMPIPE_STATE (0x0001) for this request. + +**FID (2 bytes):** This field MUST be set to the **FID** for the named pipe to read. This field MUST be set to a valid **FID** from a server response for a previous SMB command to open or create a named pipe. These commands include SMB_COM_OPEN, SMB_COM_CREATE, SMB_COM_CREATE_TEMPORARY, SMB_COM_CREATE_NEW, SMB_COM_OPEN_ANDX, SMB_COM_NT_CREATE_ANDX, and SMB_COM_NT_TRANSACT with subcommand NT_TRANSACT_CREATE. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ---------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Trans_Parameters | | | | | | | | | | | | | | | | + +**Trans_Parameters (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| PipeState | | | | | | | | | | | | | | | | + +**PipeState (2 bytes):** This field contains the value that defines the state being set on the pipe. Any combination of the following flags MUST be valid for the set operation. All other flags are considered unused and SHOULD be set to 0 when this message is sent. The server MUST ignore the unused bits when the message is received. + +| Name and bitmask | Meaning | +| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Nonblocking

0x8000 | If set, a read or a raw read request returns all data available to be read from the named pipe, up to the maximum read size set in the request. A write request returns after writing data to the named pipe without waiting for the data to be consumed. Named pipe non-blocking raw writes are not allowed. Raw writes MUST be performed in blocking mode.

If not set, a read or a raw read request will wait (block) until sufficient data to satisfy the read request becomes available, or until the request is canceled. A write request blocks until its data is consumed, if the write request length is greater than zero. | +| ReadMode

0x0100 | If set, the named pipe is operating in [**message mode**](#gt_c49a48e8-f1ac-4568-bc87-0672eb08868b). If not set, the named pipe is operating in [**byte mode**](#gt_8586fe9a-1cfa-458a-a145-8db64d69c69c). In message mode, the system treats the bytes read or written in each I/O operation to the pipe as a message unit. The system MUST perform write operations on message-type pipes as if write-through mode were enabled. | + +##### Response + +This message MUST be sent by a server to respond to a client sending the TRANS_SET_NMPIPE_STATE subcommand request when the request is successful. The server MUST set an error code in the **Status** field of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) of the response to indicate whether the request to set the read mode and [**non-blocking mode**](#gt_dcf90453-4055-4474-8357-2523ddfdb63d) succeeded or failed. + +**SMB_Parameters:** + +The SMB_Parameters section contains the relevant fields for the TRANS_QUERY_NMPIPE_STATE subcommand of the SMB_COM_TRANSACTION response. + +**WordCount (1 byte):** This field value is the total number of SMB parameter words and MUST be 0x0A. + +**Words (20 bytes):** + +**TotalParameterCount (2 bytes):** This field MUST be set to 0x0000 for this request. + +**TotalDataCount (2 bytes):** This field MUST be set to 0x0000 for this request. + +**ParameterCount (2 bytes):** This field MUST be set to 0x0000 for this request. + +**DataCount (2 bytes):** This field MUST be set to 0x0000 for this request. + +**DataDisplacement (2 bytes):** This field MUST be set to 0x0000 for this request. + +**SetupCount (1 byte):** This field MUST be set to 0x00 for this request. + +**Reserved2 (1 byte):** An unused value that SHOULD be set to 0x00 when sending this response. The client MUST ignore this field when receiving this message. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ------------------------- | ---------------------------------------------------------------------------------------- | ---------------- | --------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRbadfid

(0x0006) | STATUS_INVALID_HANDLE

(0xC0000008L)

STATUS_SMB_BAD_FID

(0x00060001) | EBADF | Invalid **FID**. | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources required to process the request. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. Not enough parameter bytes were sent. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_INVALID_HANDLE

(0xC0000008L)

STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** is no longer valid. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_INVALID_HANDLE

(0xC0000008L)

STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** supplied is not defined to the session. | + +#### TRANS_RAW_READ_NMPIPE (0x0011) + +This Transaction subcommand was introduced in the **LAN Manager 1.0** dialect. This subcommand is [**deprecated**](#gt_129acedf-ccf1-4e13-8df7-3bc59eff6f6d) in favor of TRANS_READ_NMPIPE. + +The TRANS_RAW_READ_NMPIPE subcommand of the [SMB_COM_TRANSACTION](#Section_0ed1ad9fab964a7ab94a0915f3796781) allows for a raw read of data from a name pipe. This method of reading data from a named pipe ignores message boundaries even if the pipe was set up as a [**message mode**](#gt_c49a48e8-f1ac-4568-bc87-0672eb08868b) pipe. When the named pipe is not set to [**non-blocking mode**](#gt_dcf90453-4055-4474-8357-2523ddfdb63d), and there is no data in the named pipe, the read operation on the server MUST wait indefinitely for data to become available. This section covers the specific details of using the TRANS_RAW_READ_NMPIPE subcommand. For general information see SMB_COM_TRANSACTION.[<132>](#Appendix_A_132) + +##### Request + +**SMB_Parameters:** + +The SMB_Parameters section contains the relevant field values for the TRANS_RAW_READ_NMPIPE subcommand of the SMB_COM_TRANSACTION request. + +**WordCount (1 byte):** The value of (0x0E) plus **Words.SetupCount**. This value represents the total number of SMB parameter words and MUST be 0x10. + +**Words (32 bytes):** + +**TotalParameterCount (2 bytes):** This field MUST be set to 0x0000 for this request. + +**TotalDataCount (2 bytes):** This field MUST be set to 0x0000 for this request. + +**MaxParameterCount (2 bytes):** This field MUST be set to 0x0000 for this request. + +**MaxDataCount (2 bytes):** The value MUST be the number of bytes that the client is requesting to read from the named pipe. + +**MaxSetupCount (1 byte):** This field MUST be set to 0x00 for this request. + +**Flags (2 bytes):** This field SHOULD be set to 0x0000 for this request. + +**Timeout (4 bytes):** This field SHOULD be set to 0x00000000 for this request. + +**ParameterCount (2 bytes):** This field MUST be set to 0x0000 for this request. + +**DataCount (2 bytes):** This field MUST be set to 0x0000 for this request. + +**SetupCount (1 byte):** This field MUST be set to 0x02 for this request. + +**Setup (4 bytes):** + +**Subcommand (2 bytes):** This field MUST be set to the transaction subcommand value of TRANS_RAW_READ_NMPIPE (0x0011). + +**FID (2 bytes):** This field is the FID for the named pipe to read. This field MUST be set to a valid FID from a server response for a previous SMB command to open or create a named pipe. These commands include SMB_COM_OPEN, SMB_COM_CREATE, SMB_COM_CREATE_TEMPORARY, SMB_COM_CREATE_NEW, SMB_COM_OPEN_ANDX, SMB_COM_NT_CREATE_ANDX, and SMB_COM_NT_TRANSACT with subcommand NT_TRANSACT_CREATE. + +##### Response + +This message MUST be sent by a server to respond to a client [TRANS_RAW_READ_NMPIPE Request (section 2.2.5.2.1)](#Section_edc3c03af96e44c0b6c59bddd9cc6f01). The server MUST set an error code in the **Status** field of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) of the response to indicate whether the read from the named pipe was successful or failed. + +- Trans_Data +- { +- UCHAR BytesRead\[TotalDataCount\] (variable); +- } + +**SMB_Parameters:** The SMB_Parameters section contains the relevant fields for the [TRANS_RAW_READ_NMPIPE (section 2.2.5.2)](#Section_cfcebfaeed1345ee9117fdc6da5a4060) subcommand of the [SMB_COM_TRANSACTION Response (section 2.2.4.33.2)](#Section_c9303b42897841449c18a813c0033ca5). + +**WordCount (1 byte):** The count of 16-bit words in the response structure. For this response, this MUST be 0x0A, which is 0x0A plus the **SetupCount** of 0x00. + +**Words (20 bytes):** + +**TotalParameterCount (2 bytes):** This field MUST be set to 0x0000 for this request. + +**TotalDataCount (2 bytes):** This value MUST be the number of bytes read from the named pipe in raw format. + +**ParameterCount (2 bytes):** This field MUST be set to 0x0000 for this request. + +**ParameterDisplacement (2 bytes):** This field MUST be set to 0x0000 for this request. + +**DataCount (2 bytes):** The number of bytes in the **Trans_Data** buffer contained in this packet. For this response, it MUST be set to less than or equal to the value of the **TotalDataCount** field. + +**DataDisplacement (2 bytes):** An offset in bytes into the final **Trans_Data** buffer assembled from all responses. For a single buffer transaction (whose **Trans_Data** buffer fits in a single response), this value MUST be set to 0x0000. + +**SetupCount (1 byte):** This field MUST be set to 0x00 for this request. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Trans_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Trans_Data (variable):** + +The SMB_Data section of the SMB_COM_TRANSACTION Response contains the parameters and data generated by the transaction subcommand. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| BytesRead (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**BytesRead (variable):** The data buffer that MUST contain the bytes read from the named pipe in raw mode. The size of the buffer MUST be equal to the value in **TotalDataCount**. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ------------------------- | ---------------------------------------------------------------------------------------- | ---------------- | --------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRbadfid

(0x0006) | STATUS_INVALID_HANDLE

(0xC0000008L)

STATUS_SMB_BAD_FID

(0x00060001) | EBADF | Invalid **FID**. | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources required to process the request. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. Not enough parameter bytes were sent. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_INVALID_HANDLE

(0xC0000008L)

STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** is no longer valid. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_INVALID_HANDLE

(0xC0000008L)

STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** supplied is not defined to the session. | + +#### TRANS_QUERY_NMPIPE_STATE (0x0021) + +This Transaction subcommand was introduced in the **LAN Manager 1.0** dialect.[<133>](#Appendix_A_133) + +The TRANS_QUERY_NMPIPE_STATE subcommand of the [SMB_COM_TRANSACTION](#Section_0ed1ad9fab964a7ab94a0915f3796781) allows a client to retrieve information about a specified named pipe. This section covers the specific details of using the TRANS_QUERY_NMPIPE_STATE subcommand. For general information see SMB_COM_TRANSACTION. + +##### Request + +**SMB_Parameters:** The SMB_Parameters section contains the relevant fields for the TRANS_QUERY_NMPIPE_STATE subcommand of the SMB_COM_TRANSACTION request. + +**WordCount (1 byte):** This field value is the total number of SMB parameter words and MUST be 0x10. + +**Words (32 bytes):** + +**TotalParameterCount (2 bytes):** This field MUST be set to 0x0000. + +**TotalDataCount (2 bytes):** This field MUST be set to 0x0000. + +**MaxParameterCount (2 bytes):** This field SHOULD be set to 0x0002. + +**MaxDataCount (2 bytes):** This field SHOULD be set to 0x0000 for this transaction. + +**MaxSetupCount (1 byte):** This field SHOULD be set to 0x00. + +**Flags (2 bytes):** This field SHOULD be set to 0x0000 for this request. + +**Timeout (4 bytes):** This field SHOULD be set to 0x00000000 for this request. + +**ParameterCount (2 bytes):** This field MUST be set to 0x0000. + +**DataCount (2 bytes):** This field MUST be set to 0x0000. + +**SetupCount (1 byte):** This field MUST be set to 0x02. + +**Setup (4 bytes):** + +**Subcommand (2 bytes):** This field MUST be set to the transaction subcommand value TRANS_QUERY_NMPIPE_STATE (0x0021). + +**FID (2 bytes):** This field MUST be set to a valid FID of a named pipe received in a server response for a previous SMB command to open or create a named pipe. These commands include SMB_COM_OPEN, SMB_COM_CREATE, SMB_COM_CREATE_TEMPORARY, SMB_COM_CREATE_NEW, SMB_COM_OPEN_ANDX, SMB_COM_NT_CREATE_ANDX, and SMB_COM_NT_TRANSACT with subcommand NT_TRANSACT_CREATE. + +##### Response + +This message MUST be sent by a server to respond to a client sending the TRANS_QUERY_NMPIPE_STATE subcommand request when the request is successful. The server MUST set an error code in the **Status** field of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) of the response to indicate whether the read from the named pipe succeeded or failed. + +- Trans_Parameters +- { +- SMB_NMPIPE_STATUS NMPipeStatus; +- } + +**SMB_Parameters:** The SMB_Parameters section contains the relevant fields for the TRANS_QUERY_NMPIPE_STATE subcommand of the SMB_COM_TRANSACTION response. + +**WordCount (1 byte):** This field MUST be set to 0x0A. + +**Words (20 bytes):** + +**TotalParameterCount (2 bytes):** This field MUST be set to 0x0002. + +**TotalDataCount (2 bytes):** This field MUST be set to 0x0000. + +**ParameterCount (2 bytes):** This field SHOULD be set to 0x0002. + +**ParameterDisplacement (2 bytes):** This field SHOULD be set to 0x0000. + +**DataCount (2 bytes):** This field MUST be set to 0x0000. + +**SetupCount (1 byte):** This field MUST be set to 0x00. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ---------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Trans_Parameters | | | | | | | | | | | | | | | | + +**Trans_Parameters (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------ | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| NMPipeStatus | | | | | | | | | | | | | | | | + +**NMPipeStatus (2 bytes):** A 16-bit field that shows the status of the named pipe. This field is formatted as an SMB_NMPIPE_STATUS (section [2.2.1.3](#Section_6911a7095dfb4ffbb0903e8ef872f85c)). + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ------------------------- | ---------------------------------------------------------------------------------------- | ---------------- | --------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRbadfid

(0x0006) | STATUS_INVALID_HANDLE

(0xC0000008L)

STATUS_SMB_BAD_FID

(0x00060001) | EBADF | Invalid **FID**. | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources required to process the request. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. Not enough parameter bytes were sent. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_INVALID_HANDLE

(0xC0000008L)

STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** is no longer valid. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_INVALID_HANDLE

(0xC0000008L)

STATUS_SMB_BAD_UID

(0x005B0002) | | The UID supplied is not defined to the session. | + +#### TRANS_QUERY_NMPIPE_INFO (0x0022) + +This Transaction subcommand was introduced in the **LAN Manager 1.0** dialect.[<134>](#Appendix_A_134) + +The TRANS_QUERY_NMPIPE_INFO subcommand of the [SMB_COM_TRANSACTION](#Section_0ed1ad9fab964a7ab94a0915f3796781) allows for a client to retrieve information about a specified named pipe. + +##### Request + +- Trans_Parameters +- { +- USHORT Level; +- } + +**SMB_Parameters:** The SMB_Parameters section contains the relevant fields for the TRANS_QUERY_NMPIPE_INFO subcommand of the SMB_COM_TRANSACTION request. + +**WordCount (1 byte):** This field value is the total number of SMB parameter words and MUST be 0x10. + +**Words (32 bytes):** + +**TotalParameterCount (2 bytes):** This field MUST be set to 0x0002. + +**TotalDataCount (2 bytes):** This field MUST be set to 0x0000. + +**MaxParameterCount (2 bytes):** This field SHOULD be set to 0x0000. + +**MaxDataCount (2 bytes):** This field SHOULD be greater than or equal to 0x00040. + +**MaxSetupCount (1 byte):** This field SHOULD be set to 0x0000. + +**Flags (2 bytes):** This field SHOULD be set to 0x0000 for this request. + +**Timeout (4 bytes):** This field SHOULD be set to 0x00000000 for this request. + +**ParameterCount (2 bytes) USHORT:** This field SHOULD be set to 0x0002. + +**DataCount (2 bytes):** This field MUST be set to 0x0000. + +**SetupCount (1 byte):** This field MUST be set to 0x02. + +**Setup (4 bytes):** + +**Subcommand (2 bytes):** This field MUST be set to the transaction subcommand value of TRANS_QUERY_NMPIPE_INFO (0x0022). + +**FID (2 bytes):** This field is the FID for the named pipe to read. This field MUST be set to a valid FID from a server response for a previous SMB command to open or create a named pipe. These commands include SMB_COM_OPEN, SMB_COM_CREATE, SMB_COM_CREATE_TEMPORARY, SMB_COM_CREATE_NEW, SMB_COM_OPEN_ANDX, SMB_COM_NT_CREATE_ANDX, and SMB_COM_NT_TRANSACT with subcommand NT_TRANSACT_CREATE. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ---------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Trans_Parameters | | | | | | | | | | | | | | | | + +**Trans_Parameters (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Level | | | | | | | | | | | | | | | | + +**Level (2 bytes):** This field MUST be set to 0x0001. This value (as specified in [\[MS-DTYP\]](%5bMS-DTYP%5d.pdf#Section_cca2742956894a16b2b49325d93e4ba2) section 2.2.59) describes the information level being queried for the pipe. If the server receives any other value, it MUST fail the request with a status of STATUS_INVALID_PARAMETER (ERRDOS/ERRinvalidparam). + +##### Response + +**SMB_Parameters** + +- Trans_Data +- { +- USHORT OutputBufferSize; +- USHORT InputBufferSize; +- UCHAR MaximumInstances; +- UCHAR CurrentInstances; +- UCHAR PipeNameLength; +- SMB_STRING PipeName; +- } + +The SMB_Parameters section contains the relevant fields for the TRANS_QUERY_NMPIPE_INFO subcommand of the SMB_COM_TRANSACTION response. + +**WordCount (1 byte):** This field value is the total number of SMB parameter words and MUST be 0x0A. + +**Words (20 bytes):** + +**TotalParameterCount (2 bytes):** This field MUST be set to 0x0000 for this request. + +**TotalDataCount (2 bytes):** This field MUST be greater than or equal to 0x0007. + +**ParameterCount (2 bytes):** This field MUST be set to 0x0000. + +**DataCount (2 bytes):** This field MUST be set to less than or equal to the value of the **TotalDataCount** field. + +**SetupCount (1 byte):** This field MUST be set to 0x00. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Trans_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Trans_Data (variable):** + +The Trans_Data section of the SMB_COM_TRANSACTION response contains the parameters and data generated by the transaction TRANS_QUERY_NMPIPE_INFO subcommand. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ---------------- | --- | --- | --- | --- | --- | --- | --- | ---------------- | --- | ---------- | --- | --- | --- | --- | --- | --------------- | --- | --- | --- | ---------- | --- | --- | --- | ------------------- | --- | --- | --- | --- | --- | ---------- | --- | +| OutputBufferSize | | | | | | | | | | | | | | | | InputBufferSize | | | | | | | | | | | | | | | | +| MaximumInstances | | | | | | | | CurrentInstances | | | | | | | | PipeNameLength | | | | | | | | PipeName (variable) | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**OutputBufferSize (2 bytes):** This field MUST be the actual size of the buffer for outgoing (server) I/O. + +**InputBufferSize (2 bytes):** This field MUST be the actual size of the buffer for incoming (client) I/O. + +**MaximumInstances (1 byte):** This field MUST be the maximum number of allowed instances of the named pipe. + +**CurrentInstances (1 byte):** This field MUST be the current number of named pipe instances. The count increments when the server creates a named pipe and decrements when the server closes the named pipe for an unconnected pipe, or when both the server and the client close the named pipe for a connected pipe. + +**PipeNameLength (1 byte):** This field MUST be the length in bytes of the pipe name, including the terminating null character. + +**PipeName (variable):** This field MUST be a null-terminated string containing the name of the named pipe, not including the initial \\\\NodeName string (that is, of the form \\PIPE\\pipename). If SMB_FLAGS2_UNICODE is set in the **Flags2** field of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) of the response, the name string MUST be in a null-terminated array of 16-bit Unicode characters. Otherwise, the name string MUST be a null-terminated array of OEM characters. If the **PipeName** field consists of Unicode characters, this field MUST be aligned to start on a 2-byte boundary from the start of the SMB Header. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ------------------------------- | ---------------------------------------------------------------------------------------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRbadfid

(0x0006) | STATUS_INVALID_HANDLE

(0xC0000008L)

STATUS_SMB_BAD_FID

(0x00060001) | EBADF | Invalid FID. | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources required to process the request. | +| ERRDOS

(0x01) | ERRinvalidparam

(0x0057) | STATUS_INVALID_PARAMETER

(0xC000000D) | | Invalid value in **Level** field. | +| ERRDOS

(0x01) | ERRbufftosmall

(0x007A) | STATUS_BUFFER_TOO_SMALL

(0xC0000023) | | The **MaxDataCount** is too small to accept the request information. | +| ERRDOS

(0x01) | ERRmoredata

(0x00EA) | STATUS_BUFFER_OVERFLOW

(0x80000005L) | | There is more data available than can fit based on the **MaxDataCount** sent by the client. The pipe name has been requested and cannot fit in within the **MaxDataCount** buffer. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid or corrupt SMB. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_INVALID_HANDLE

(0xC0000008L)

STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** is no longer valid. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_INVALID_HANDLE

(0xC0000008L)

STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** supplied is not defined to the session. | + +#### TRANS_PEEK_NMPIPE (0x0023) + +This Transaction subcommand was introduced in the **LAN Manager 1.0** dialect.[<135>](#Appendix_A_135) + +The TRANS_PEEK_NMPIPE subcommand of the [SMB_COM_TRANSACTION](#Section_0ed1ad9fab964a7ab94a0915f3796781) is used to copy data out of a named pipe without removing it and to retrieve information about data in a named pipe. This section covers the specific details of using the TRANS_PEEK_NMPIPE subcommand. For general information see SMB_COM_TRANSACTION.[<136>](#Appendix_A_136) + +##### Request + +**SMB_Parameters:** The SMB_Parameters section contains the relevant fields for the TRANS_RAW_READ_NMPIPE subcommand of the SMB_COM_TRANSACTION request. + +**WordCount (1 byte):** This field MUST be set to 0x10. + +**Words (32 bytes):** + +**TotalParameterCount (2 bytes):** This field MUST be set to 0x0000. + +**TotalDataCount (2 bytes):** This field MUST be set to 0x0000. + +**MaxParameterCount (2 bytes):** This field SHOULD be set to 0x0006. + +**MaxDataCount (2 bytes):** This field SHOULD be set to the number of bytes that the client attempts to peek from the named pipe. + +**MaxSetupCount (1 byte):** This field SHOULD be 0x00. + +**Flags (2 bytes):** This field SHOULD be set to 0x0000 for this request. + +**Timeout (4 bytes):** This field SHOULD be set to 0x00000000 for this request. + +**ParameterCount (2 bytes):** This field MUST be set to 0x0000. + +**DataCount (2 bytes):** This field MUST be set to 0x0000. + +**SetupCount (1 byte):** This field MUST be set to 0x02. + +**Setup (4 bytes):** + +**Subcommand (2 bytes):** This field MUST be set to the transaction subcommand of TRANS_PEEK_NMPIPE (0x0023). + +**FID (2 bytes):** This field is the FID for the named pipe to read. This field MUST be set to a valid FID from a server response for a previous SMB command to open or create a named pipe. These commands include SMB_COM_OPEN, SMB_COM_CREATE, SMB_COM_CREATE_TEMPORARY, SMB_COM_CREATE_NEW, SMB_COM_OPEN_ANDX, SMB_COM_NT_CREATE_ANDX, and SMB_COM_NT_TRANSACT with subcommand NT_TRANSACT_CREATE. + +##### Response + +- Trans_Parameters +- { +- USHORT ReadDataAvailable; +- USHORT MessageBytesLength; +- USHORT NamedPipeState; +- } +- Trans_Data +- { +- UCHAR ReadData\[TotalDataCount\] (variable); +- } + +The server MUST set an error code in the **Status** field of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) of the response to indicate whether the operation on the named pipe succeeded or failed. + +**SMB_Parameters:** The SMB_Parameters section contains the relevant fields for the TRANS_PEEK_NMPIPE subcommand of the SMB_COM_TRANSACTION response. + +**WordCount (1 byte):** This field MUST be set to 0x0A. + +**Words (20 bytes):** + +**TotalParameterCount (2 bytes):** This field MUST be set to 0x0006. + +**TotalDataCount (2 bytes):** This field MUST be set to the number of bytes read from the named pipe in a peek fashion and in raw format. + +**ParameterCount (2 bytes):** This field MUST be set to 0x0006. + +**DataCount (2 bytes):** This field MUST be set to less than or equal to the value of the **TotalDataCount** field. + +**SetupCount (1 byte):** The number of setup words. For this response, it MUST be set to 0x00. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ---------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --------------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Trans_Parameters | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | Trans_Data (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Trans_Parameters (6 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ------------------ | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ReadDataAvailable | | | | | | | | | | | | | | | | MessageBytesLength | | | | | | | | | | | | | | | | +| NamedPipeState | | | | | | | | | | | | | | | | + +**ReadDataAvailable (2 bytes):** This field contains the total number of bytes available to be read from the pipe. + +**MessageBytesLength (2 bytes):** If the named pipe is a [**message mode**](#gt_c49a48e8-f1ac-4568-bc87-0672eb08868b) pipe, this MUST be set to the number of bytes remaining in the message that was peeked (the number of bytes in the message minus the number of bytes read). If the entire message was read, this value is 0x0000. If the named pipe is a [**byte mode**](#gt_8586fe9a-1cfa-458a-a145-8db64d69c69c) pipe, this value MUST be set to 0x0000. + +**NamedPipeState (2 bytes):** The status of the named pipe. + +| Value | Meaning | +| ------ | -------------------------------------------- | +| 0x0001 | Named pipe was disconnected by server. | +| 0x0002 | Named pipe is listening. | +| 0x0003 | Named pipe connection to the server is okay. | +| 0x0004 | Server end of named pipe is closed. | + +**Trans_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ReadData (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ReadData (variable):** This field contains the data read from the named pipe. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | --------------------------- | ---------------------------------------------------------------------------------------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRbadfid

(0x0006) | STATUS_INVALID_HANDLE

(0xC0000008L)

STATUS_SMB_BAD_FID

(0x00060001) | EBADF | Invalid FID. | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources required to process the request. | +| ERRDOS

(0x01) | ERRmoredata

(0x00EA) | STATUS_BUFFER_OVERFLOW

(0x80000005L) | | There is more data available than can fit in the response buffer based on the **MaxDataCount** field value in the client request. None of the data was returned in the response. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. Not enough parameter bytes were sent. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_INVALID_HANDLE

(0xC0000008L)

STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** is no longer valid. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_INVALID_HANDLE

(0xC0000008L)

STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** supplied is not defined to the session. | + +#### TRANS_TRANSACT_NMPIPE (0x0026) + +This Transaction subcommand was introduced in the **LAN Manager 1.0** dialect.[<137>](#Appendix_A_137) + +The TRANS_TRANSACT_NMPIPE subcommand of the [SMB_COM_TRANSACTION](#Section_0ed1ad9fab964a7ab94a0915f3796781) is used to execute a transacted exchange against a named pipe. This transaction MUST only be used for named pipes of the duplex message type. This section covers the specific details of using the TRANS_TRANSACT_NMPIPE subcommand. For general information see SMB_COM_TRANSACTION. + +##### Request + +- Trans_Data +- { +- UCHAR WriteData\[TotalDataCount\]; +- } + +**SMB_Parameters:** The SMB_Parameters section contains the relevant fields for the TRANS_TRANSACT_NMPIPE subcommand of the SMB_COM_TRANSACTION request. + +**WordCount (1 byte):** This field MUST be set to 0x10. + +**Words (32 bytes):** + +**TotalParameterCount (2 bytes):** This field MUST be set to 0x0000. + +**TotalDataCount (2 bytes):** This field MUST be set to the number of bytes that the client requests to write to the named pipe as part of the transaction. + +**MaxParameterCount (2 bytes):** This field MUST be set to 0x0000. + +**MaxDataCount (2 bytes):** This field MUST be the number of bytes that the client requests to read from the named pipe as part of the transacted operation. + +**MaxSetupCount (1 byte):** This field MUST be set to 0x00. + +**Flags (2 bytes):** This field SHOULD be set to 0x0000 for this request. + +**Timeout (4 bytes):** This field SHOULD be set to 0x00000000 for this request. + +**ParameterCount (2 bytes):** This field MUST be set to 0x0000. + +**DataCount (2 bytes):** This field MUST be set to the number of data bytes in this request to be written to the named pipe during the transaction. For a single-request transaction, this MUST be equal to the **TotalDataCount**. + +**SetupCount (1 byte):** This field MUST be set to 0x02. + +**Setup (4 bytes):** + +**Subcommand (2 bytes):** This field MUST be set to the transaction subcommand of TRANS_TRANSACT_NMPIPE (0x0026). + +**FID (2 bytes):** This field is the FID for the named pipe that is being transacted. This field MUST be set to a valid FID from a server response for a previous SMB command to open or create a named pipe. These commands include SMB_COM_OPEN, SMB_COM_CREATE, SMB_COM_CREATE_TEMPORARY, SMB_COM_CREATE_NEW, SMB_COM_OPEN_ANDX, SMB_COM_NT_CREATE_ANDX, and SMB_COM_NT_TRANSACT with subcommand NT_TRANSACT_CREATE. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Trans_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Trans_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WriteData (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**WriteData (variable):** This field MUST contain the bytes to be written to the named pipe as part of the transacted operation. + +##### Response + +The server MUST set an error code in the **Status** field of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) of the response to indicate whether the transaction against the named pipe succeeded or failed.[<138>](#Appendix_A_138) + +- Trans_Data +- { +- UCHAR ReadData\[TotalDataCount\]; +- } + +**SMB_Parameters:** The SMB_Parameters section contains the relevant fields for the [TRANS_TRANSACT_NMPIPE (section 2.2.5.6)](#Section_f599d0f080b148869657944f36a44138) subcommand of the [SMB_COM_TRANSACTION (section 2.2.4.33)](#Section_0ed1ad9fab964a7ab94a0915f3796781) response. + +**WordCount (1 byte):** This field MUST be set to 0x0A. + +**Words (20 bytes):** + +**TotalParameterCount (2 bytes):** This field MUST be set to 0x0000. + +**TotalDataCount (2 bytes):** This field MUST be the total number of bytes read from the named pipe in raw format. + +**ParameterCount (2 bytes):** This field MUST be set to 0x0000. + +**DataCount (2 bytes):** This field MUST be set to the number of bytes read from the named pipe that are returned in this response. This field MUST be less than or equal to the value of the **TotalDataCount** field. + +**SetupCount (1 byte):** This field MUST be set to 0x00. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Trans_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Trans_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ReadData (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ReadData (variable):** This field MUST contain data read from the named pipe. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ------------------------------- | --------------------------------------------------------------------------------------- | ---------------- | --------------------------------------------------------------------------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRbadfid

(0x0006) | STATUS_INVALID_HANDLE

(0xC0000008)

STATUS_SMB_BAD_FID

(0x00060001) | EBADF | Invalid **FID**. | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources required to process the request. | +| ERRDOS

(0x01) | ERRinvalidparam

(0x0057) | STATUS_INVALID_PARAMETER

(0xC000000D) | | The named pipe indicated by the **FID** is not in [**message mode**](#gt_c49a48e8-f1ac-4568-bc87-0672eb08868b). | +| ERRDOS

(0x01) | ERRmoredata

(0x00EA) | STATUS_BUFFER_OVERFLOW

(0x80000005) | | There is more data available than can fit in the response buffer based on the **MaxDataCount** field value in the client request. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. Not enough parameter bytes were sent. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_INVALID_HANDLE

(0xC0000008)

STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** is no longer valid. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_INVALID_HANDLE

(0xC0000008)

STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** supplied is not defined to the session. | + +#### TRANS_RAW_WRITE_NMPIPE (0x0031) + +This Transaction subcommand was introduced in the **LAN Manager 1.0** dialect. This subcommand is [**deprecated**](#gt_129acedf-ccf1-4e13-8df7-3bc59eff6f6d). Clients can use either TRANS_WRITE_NMPIPE or TRANS_TRANSACT_NMPIPE. + +The TRANS_RAW_WRITE_NMPIPE subcommand of the [SMB_COM_TRANSACTION](#Section_0ed1ad9fab964a7ab94a0915f3796781) allows for a raw write of data to a named pipe. Raw writes to named pipes put bytes directly into a pipe in [**byte mode**](#gt_8586fe9a-1cfa-458a-a145-8db64d69c69c), regardless of whether it is a [**message mode**](#gt_c49a48e8-f1ac-4568-bc87-0672eb08868b) pipe or byte mode pipe. + +This method of writing data into a named pipe assumes that the data itself contains the message boundaries if the pipe is a message mode pipe. The operation can allow a single write to insert multiple messages. + +This section covers the specific details of using the TRANS_RAW_WRITE_NMPIPE subcommand. For general information, see SMB_COM_TRANSACTION.[<139>](#Appendix_A_139) + +##### Request + +- Trans_Data +- { +- UCHAR WriteData\[TotalDataCount\]; +- } + +**SMB_Parameters:** + +**WordCount (1 byte):** This field MUST be set to 0x10. + +**Words (32 bytes):** + +**TotalParameterCount (2 bytes):** This field MUST be set to 0x0000. + +**TotalDataCount (2 bytes):** This field MUST be set to the total number of bytes that the client attempts to write to the named pipe in raw format. + +**MaxParameterCount (2 bytes):** This field MUST be set to 0x0002. + +**MaxDataCount (2 bytes):** This field MUST be set to 0x0000. + +**MaxSetupCount (1 byte):** This field MUST be set to 0x00. + +**ParameterCount (2 bytes):** This field MUST be set to 0x0000. + +**DataCount (2 bytes):** This field MUST be set to the number of bytes being written to the named pipe in raw format contained in this request. If this is the only request of this transaction, the **TotalDataCount** field MUST equal the **DataCount** field. + +**SetupCount (1 byte):** This field MUST be set to 0x02. + +**Setup (4 bytes):** + +**Subcommand (2 bytes):** This field MUST be set to the transaction subcommand of TRANS_RAW_WRITE_NMPIPE (0x0031). + +**FID (2 bytes):** This field is the FID for the named pipe to read. This field MUST be set to a valid FID from a server response for a previous SMB command to open or create a named pipe. These commands include SMB_COM_OPEN, SMB_COM_CREATE, SMB_COM_CREATE_TEMPORARY, SMB_COM_CREATE_NEW, SMB_COM_OPEN_ANDX, SMB_COM_NT_CREATE_ANDX, and SMB_COM_NT_TRANSACT with subcommand NT_TRANSACT_CREATE. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Trans_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Trans_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WriteData (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**WriteData (variable):** This field MUST contain the bytes to write to the named pipe in raw format. The size of the buffer MUST be equal to the value in **TotalDataCount**. + +##### Response + +The server MUST set an error code in the SMB_Header.Status field of the response to indicate whether the read from the named pipe succeeded or failed. + +- Trans_Parameters +- { +- USHORT BytesWritten; +- } + +**SMB_Parameters:** The SMB_Parameters section contains the relevant fields for the TRANS_RAW_WRITE_NMPIPE subcommand of the SMB_COM_TRANSACTION response. + +**WordCount (1 byte):** This field MUST be set to 0x0A. + +**Words (20 bytes):** + +**TotalParameterCount (2 bytes):** This field MUST be set to 0x0002. + +**TotalDataCount (2 bytes):** This field MUST be set to 0x0000. + +**ParameterCount (2 bytes):** This field MUST be set to 0x0002. + +**DataCount (2 bytes):** This field MUST be set to 0x0000. + +**SetupCount (1 byte):** This field MUST be set to 0x00. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ---------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Trans_Parameters | | | | | | | | | | | | | | | | + +**Trans_Parameters (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------ | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| BytesWritten | | | | | | | | | | | | | | | | + +**BytesWritten (2 bytes):** This field MUST be set to the number of bytes written to the pipe. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ------------------------------- | ---------------------------------------------------------------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| ERRDOS

(0x01) | ERRbadfid

(0x0006) | STATUS_INVALID_HANDLE

(0xC0000008L)

STATUS_SMB_BAD_FID

(0x00060001) | EBADF | Invalid FID. | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources required to process the request. | +| ERRDOS

(0x01) | ERRinvalidparam

(0x0057) | STATUS_INVALID_PARAMETER

(0xC000000D) | | The named pipe indicated by the **FID** is not in [**message mode**](#gt_c49a48e8-f1ac-4568-bc87-0672eb08868b) or this is not a 2-byte write request that contains two null padding bytes. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. Not enough parameter bytes were sent. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_INVALID_HANDLE

(0xC0000008L)

STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** is no longer valid. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_INVALID_HANDLE

(0xC0000008L)

STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** supplied is not defined to the session. | + +#### TRANS_READ_NMPIPE (0x0036) + +This Transaction subcommand was introduced in the [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) dialect. + +The TRANS_READ_NMPIPE subcommand of the [SMB_COM_TRANSACTION](#Section_0ed1ad9fab964a7ab94a0915f3796781) allows a client to read data from a named pipe. This section covers the specific details of using the TRANS_READ_NMPIPE subcommand. For general information, see SMB_COM_TRANSACTION. + +##### Request + +**SMB_Parameters:** The SMB_Parameters section contains the relevant fields for the TRANS_READ_NMPIPE subcommand of the SMB_COM_TRANSACTION request. + +**WordCount (1 byte):** This field MUST be set to 0x10. + +**Words (32 bytes):** + +**TotalParameterCount (2 bytes):** This field MUST be set to 0x0000. + +**TotalDataCount (2 bytes):** This field MUST be set to 0x0000. + +**MaxParameterCount (2 bytes):** This field MUST be set to 0x0000. + +**MaxDataCount (2 bytes):** This field MUST be set to the maximum number of bytes that the client attempts to read from the named pipe. + +**MaxSetupCount (1 byte):** This field MUST be 0x00. + +**ParameterCount (2 bytes):** This field MUST be set to 0x0000. + +**DataCount (2 bytes):** This field MUST be set to 0x0000. + +**SetupCount (1 byte):** This field MUST be set to 0x02. + +**Setup (4 bytes):** + +**Subcommand (2 bytes):** This field MUST be set to the transaction subcommand of TRANS_READ_NMPIPE (0x0036). + +**FID (2 bytes):** This field is the FID for the named pipe to read. This field MUST be set to a valid FID from a server response for a previous SMB command to open or create a named pipe. These commands include SMB_COM_OPEN, SMB_COM_CREATE, SMB_COM_CREATE_TEMPORARY, SMB_COM_CREATE_NEW, SMB_COM_OPEN_ANDX, SMB_COM_NT_CREATE_ANDX, and SMB_COM_NT_TRANSACT with subcommand NT_TRANSACT_CREATE. + +##### Response + +The server MUST set an error code in the **Status** field of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) of the response to indicate whether the read from the named pipe succeeded or failed. + +If the named pipe specified in the **Request.SMB_Parameters.Setup.FID** field is not set to [**non-blocking mode**](#gt_dcf90453-4055-4474-8357-2523ddfdb63d), and there is no data in the named pipe, the read operation will wait indefinitely. + +- Trans_Data +- { +- UCHAR ReadData\[TotalDataCount\]; +- } + +**SMB_Parameters:** The SMB_Parameters section contains the relevant fields for the TRANS_READ_NMPIPE subcommand of the SMB_COM_TRANSACTION response. + +**WordCount (1 byte):** This field MUST be set to 0x0A. + +**Words (20 bytes):** + +**TotalParameterCount (2 bytes):** This field MUST be set to 0x0000. + +**TotalDataCount (2 bytes):** This field MUST be set to the total number of bytes read from the named pipe. + +**ParameterCount (2 bytes):** This field MUST be set to 0x0000. + +**DataCount (2 bytes):** This field MUST be set to the number of bytes that the **ReadData** field contained in the **Trans_Data** of this response. For this response, it MUST be set to less than or equal to the value of the **TotalDataCount** field. + +**SetupCount (1 byte):** This field MUST be set to 0x00. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Trans_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Trans_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ReadData (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ReadData (variable):** This field MUST contain the bytes read from the named pipe. The size of the buffer MUST be equal to the value in **TotalDataCount**. If the named pipe is a [**message mode**](#gt_c49a48e8-f1ac-4568-bc87-0672eb08868b) pipe, and the entire message was not read, the **Status** field in the SMB Header MUST be set to STATUS_BUFFER_OVERFLOW. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | --------------------------- | ---------------------------------------------------------------------------------------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRbadfid

(0x0006) | STATUS_INVALID_HANDLE

(0xC0000008L)

STATUS_SMB_BAD_FID

(0x00060001) | EBADF | Invalid FID. | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources required to process the request. | +| ERRDOS

(0x01) | ERRmoredata

(0x00EA) | STATUS_BUFFER_OVERFLOW

(0x80000005L) | | There is more data available than can fit in the response buffer based on the **MaxDataCount** field value in the client request. **MaxDataCount** bytes of data were returned in the response. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. Not enough parameter bytes were sent. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_INVALID_HANDLE

(0xC0000008L)

STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** is no longer valid. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_INVALID_HANDLE

(0xC0000008L)

STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** supplied is not known to the session. | + +#### TRANS_WRITE_NMPIPE (0x0037) + +This Transaction subcommand was introduced in the [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) dialect. + +The TRANS_WRITE_NMPIPE subcommand of SMB_COM_TRANSACTION allows a client to write data to a named pipe. This section covers the specific details of using the TRANS_WRITE_NMPIPE subcommand. For general information see SMB_COM_TRANSACTION. + +##### Request + +- Trans_Data +- { +- UCHAR WriteData\[TotalDataCount\]; +- } + +**SMB_Parameters:** The SMB_Parameters section contains the relevant fields for the TRANS_WRITE_NMPIPE subcommand of the SMB_COM_TRANSACTION request. + +**WordCount (1 byte):** This field MUST be set to 0x10. + +**Words (32 bytes):** + +**TotalParameterCount (2 bytes):** This field MUST be set to 0x0000. + +**TotalDataCount (2 bytes):** This field MUST be the total number of bytes that the client requests to write to the named pipe. + +**MaxParameterCount (2 bytes):** This field MUST be set to 0x0002. + +**MaxDataCount (2 bytes):** This field MUST be 0x0000. + +**MaxSetupCount (1 byte):** This field MUST be 0x00. + +**Flags (2 bytes):** This field SHOULD be set to 0x0000 for this request. + +**Timeout (4 bytes):** This field SHOULD be set to 0x00000000 for this request. + +**ParameterCount (2 bytes):** This field MUST be set to 0x0000. + +**DataCount (2 bytes):** This field MUST be set to the number of bytes being written to the named pipe in this request. + +**SetupCount (1 byte):** This field MUST be set to 0x0002. + +**Setup (4 bytes):** + +**Subcommand (2 bytes):** This field MUST be set to the transaction subcommand value of TRANS_WRITE_NMPIPE (0x0037). + +**FID (2 bytes):** This field is the FID for the named pipe to write. This field MUST be set to a valid FID from a server response for a previous SMB command to open or create a named pipe. These commands include SMB_COM_OPEN, SMB_COM_CREATE, SMB_COM_CREATE_TEMPORARY, SMB_COM_CREATE_NEW, SMB_COM_OPEN_ANDX, SMB_COM_NT_CREATE_ANDX, and SMB_COM_NT_TRANSACT with subcommand NT_TRANSACT_CREATE. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Trans_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Trans_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WriteData (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**WriteData (variable):** This field MUST contain the bytes to write to the named pipe. The size of the buffer MUST be equal to the value in **TotalDataCount**. + +##### Response + +- Trans_Parameters +- { +- USHORT BytesWritten; +- } + +The server MUST set an error code in the **Status** field of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) of the response to indicate whether the read from the named pipe succeeded or failed. + +**SMB_Parameters:** The SMB_Parameters section contains the relevant fields for the TRANS_WRITE_NMPIPE subcommand of the SMB_COM_TRANSACTION response. + +**WordCount (1 byte):** This field MUST be set to 0x0A. + +**Words (20 bytes):** + +**TotalParameterCount (2 bytes):** This field MUST be set to 0x0002. + +**TotalDataCount (2 bytes):** This field MUST be set to 0x0000. + +**ParameterCount (2 bytes):** This field SHOULD be set to 0x0002. + +**DataCount (2 bytes):** This field MUST be set to 0x0000. + +**SetupCount (1 byte):** This field MUST be set to 0x00. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ---------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Trans_Parameters | | | | | | | | | | | | | | | | + +**Trans_Parameters (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------ | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| BytesWritten | | | | | | | | | | | | | | | | + +**BytesWritten (2 bytes):** This field MUST be set to the number of bytes written to the pipe. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ------------------------- | ---------------------------------------------------------------------------------------- | ---------------- | --------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRbadfid

(0x0006) | STATUS_INVALID_HANDLE

(0xC0000008L)

STATUS_SMB_BAD_FID

(0x00060001) | EBADF | Invalid FID. | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources required to process the request. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. Not enough parameter bytes were sent. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_INVALID_HANDLE

(0xC0000008L)

STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** is no longer valid. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_INVALID_HANDLE

(0xC0000008L)

STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** supplied is not defined to the session. | + +#### TRANS_WAIT_NMPIPE (0x0053) + +This Transaction subcommand was introduced in the **LAN Manager 1.0** dialect.[<140>](#Appendix_A_140) + +The TRANS_WAIT_NMPIPE subcommand of the [SMB_COM_TRANSACTION](#Section_0ed1ad9fab964a7ab94a0915f3796781) allows a client to be notified when the specified named pipe is available to be connected to. This section covers the specific details of using the TRANS_WAIT_NMPIPE subcommand. For general information, see SMB_COM_TRANSACTION. + +##### Request + +**SMB_Parameters:** The SMB_Parameters section contains the relevant fields for the TRANS_WAIT_NMPIPE subcommand of the SMB_COM_TRANSACTION request. + +**WordCount (1 byte):** This field MUST be set to 0x10. + +**Words (32 bytes):** + +**TotalParameterCount (2 bytes):** This field MUST be set to 0x0000. + +**TotalDataCount (2 bytes):** This field MUST be set to 0x0000. + +**MaxParameterCount (2 bytes):** This field MUST be set to 0x0000. + +**MaxDataCount (2 bytes):** This field MUST be set to 0x0000. + +**MaxSetupCount (1 byte):** This field MUST be set to 0x00. + +**Flags (2 bytes):** This field SHOULD be set to 0x0000 for this request. + +**Timeout (4 bytes):** This field MUST be set to the maximum number of milliseconds that the server SHOULD wait for the named pipe to become available.[<141>](#Appendix_A_141) + +**ParameterCount (2 bytes):** This field MUST be set to 0x0000. + +**DataCount (2 bytes):** This field MUST be set to 0x0000. + +**SetupCount (1 byte):** This field MUST be set to 0x02. + +**Setup (4 bytes):** + +**Subcommand (2 bytes):** This field MUST be set to the transaction subcommand TRANS_WAIT_NMPIPE (0x0053). + +**Priority (2 bytes):** This field SHOULD be in the range of 0x0000 to 0x03FF, where 0x0000 indicates that the server SHOULD use a default value. Larger values indicate higher priority.[<142>](#Appendix_A_142) + +**SMB_Data:** The SMB_Data section contains the relevant fields for the TRANS_WAIT_NMPIPE subcommand of the SMB_COM_TRANSACTION request. + +**ByteCount (2 bytes):** This field MUST be greater than or equal to 0x0001. + +**Name (variable):** The name field MUST be set to the name of the pipe being waited for, in the format \\PIPE\\<pipename> where <pipename> is the name of the pipe to wait to connect to. To wait on the pipe PipeA, the name field is set to \\PIPE\\PipeA. If SMB_FLAGS2_UNICODE is set in the **Flags2** field of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) of the request, the name string MUST be a null-terminated array of 16-bit Unicode characters. Otherwise, the name string MUST be a null-terminated array of OEM characters. If the name string consists of Unicode characters, this field MUST be aligned to start on a 2-byte boundary from the start of the SMB header. + +##### Response + +The server MUST set an error code in the **Status** field of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) of the response to indicate whether the transact operation on the named pipe succeeded or failed. The server returns a response when either the named pipe is available to be connected to or the **Timeout** field specified in the client request has been exceeded. If the **Timeout** value is exceeded, the server MUST return STATUS_IO_TIMEOUT in the **Status** field of the SMB Header. If the named pipe is available to be connected to, and the **Timeout** is not exceeded, the server MUST return STATUS_SUCCESS in the **Status** field of the SMB Header. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | -------------------------- | ---------------------------------------------------------------------------------------- | ---------------- | ---------------------------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRbadfid

(0x0006) | STATUS_INVALID_HANDLE

(0xC0000008L)

STATUS_SMB_BAD_FID

(0x00060001) | EBADF | Invalid **FID**. | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources required to process the request. | +| ERRDOS

(0x01) | ERRtimeout

(0x0058) | STATUS_IO_TIMEOUT | | The request timed out. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. Pipe name might not be valid or request is not internally consistent. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_INVALID_HANDLE

(0xC0000008L)

STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** is no longer valid. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_INVALID_HANDLE

(0xC0000008L)

STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** supplied is not defined to the session. | + +#### TRANS_CALL_NMPIPE (0x0054) + +This Transaction subcommand was introduced in the **LAN Manager 1.0** dialect.[<143>](#Appendix_A_143) + +The TRANS_CALL_NMPIPE subcommand allows a client to open a named pipe, issue a write to the named pipe, issue a read from the named pipe, and close the named pipe. The named pipe is opened in message mode. This section covers the specific details of using the TRANS_CALL_NMPIPE subcommand. For general information, see [SMB_COM_TRANSACTION (section 2.2.4.34)](#Section_a4c643871dc445fbb01f9ad8b69e83e1). + +##### Request + +- Trans_Data +- { +- UCHAR WriteData\[TotalDataCount\]; +- } + +**SMB_Parameters:** The SMB_Parameters section contains the relevant fields for the TRANS_CALL_NMPIPE subcommand of the [SMB_COM_TRANSACTION Request (section 2.2.4.33.1)](#Section_57bfc115fe294482a0fea935757e0a4f). + +**WordCount (1 byte):** This field MUST be set to 0x10. + +**Words (32 bytes):** + +**TotalParameterCount (2 bytes):** This field MUST be set to 0x0000. + +**TotalDataCount (2 bytes):** This field MUST be set to the total number of bytes that the client attempts to write to the named pipe. + +**MaxParameterCount (2 bytes):** This field MUST be set to 0x0000. + +**MaxDataCount (2 bytes):** This field MUST be set to the number of bytes that the client attempts to read from the named pipe. + +**MaxSetupCount (1 byte):** This field MUST be 0x00. + +**Flags (2 bytes):** This field SHOULD be set to 0x0000 for this request. + +**Timeout (4 bytes):** This field SHOULD be set to 0x00000000 for this request. + +**ParameterCount (2 bytes):** This field MUST be set to 0x0000. + +**DataCount (2 bytes):** This field MUST be set to the count of bytes in the **Trans_Data.WriteData** buffer field. If this field is less than the value of **TotalDataCount** then the client MUST send at least one more request to send the remaining (TotalDataCount - DataCount) bytes to write to the named pipe. + +**SetupCount (1 byte):** This field MUST be set to 0x02. + +**Setup (4 bytes):** + +**Subcommand (2 bytes):** This field MUST be set to the transaction subcommand TRANS_CALL_NMPIPE 0x0054. + +**Priority (2 bytes):** This field MUST be in the range of 0x0000 to 0x0009. The larger value is the higher priority. + +**SMB_Data:** The SMB_Data section contains the relevant fields for the TRANS_READ_NMPIPE subcommand of the SMB_COM_TRANSACTION request. + +**ByteCount (2 bytes):** The value of this field MUST be the count of bytes that follows the **ByteCount** field. + +**Name (variable):** The name field MUST be set to the name of the pipe, in the format \\PIPE\\<pipename> where <pipename> is the name of the pipe to open. To open the pipe PipeA, the name field is set to \\PIPE\\PipeA. If SMB_FLAGS2_UNICODE is set in the **Flags2** field of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) of the request, the name string MUST be a null-terminated array of 16-bit Unicode characters. Otherwise, the name string MUST be a null-terminated array of OEM characters. If the name string consists of Unicode characters, this field MUST be aligned to start on a 2-byte boundary from the start of the SMB Header. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Trans_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Trans_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WriteData (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**WriteData (variable):** This field MUST contain the bytes to write to the named pipe. The size of the buffer MUST be equal to the value in **TotalDataCount**. + +##### Response + +The server MUST set an error code in the **Status** field of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) of the response to indicate whether the transaction succeeded or failed. + +- Trans_Data +- { +- UCHAR ReadData\[TotalDataCount\]; +- } + +**SMB_Parameters:** + +The SMB_Parameters section contains the relevant fields for the [TRANS_READ_NMPIPE (section 2.2.5.8)](#Section_d9004cc94b844d4ca522ec559f53c1a7) subcommand of the [SMB_COM_TRANSACTION Response (section 2.2.4.33.2)](#Section_c9303b42897841449c18a813c0033ca5). + +**WordCount (1 byte):** This field MUST be set to 0x0A. + +**Words (20 bytes):** + +**TotalParameterCount (2 bytes):** This field MUST be set to 0x0000. + +**TotalDataCount (2 bytes):** This field MUST be set to the total number of bytes read from the [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca). + +**ParameterCount (2 bytes):** This field MUST be set to 0x0000. + +**DataCount (2 bytes):** This field MUST be set to the number of bytes contained in the **Trans_Data.ReadData** field. The value MUST be less than or equal to **TotalDataCount**. If the value is less than **TotalDataCount**, the server MUST send the remaining bytes in one or more additional response messages.[<144>](#Appendix_A_144) + +**SetupCount (1 byte):** This field SHOULD[<145>](#Appendix_A_145) be set to 0x00. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Trans_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Trans_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ReadData (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ReadData (variable):** This field MUST contain the bytes read from the named pipe. The size of the buffer MUST be equal to the value in the **TotalDataCount** field of the response. If the named pipe is a [**message mode**](#gt_c49a48e8-f1ac-4568-bc87-0672eb08868b) pipe, and the entire message was not read, the **Status** field in the SMB Header MUST be set to STATUS_BUFFER_OVERFLOW. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ---------------------------- | ---------------------------------------------------------------------------------------- | ---------------- | --------------------------------------------------------------------------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources required to process the request. | +| ERRDOS

(0x01) | ERRbadaccess

(0x000C) | STATUS_ACCESS_DENIED

(0xC0000022) | | Write permission required. | +| ERRDOS

(0x01) | ERRmoredata

(0x00EA) | STATUS_BUFFER_OVERFLOW

(0x80000005L) | | There is more data available than can fit in the response buffer based on the **MaxDataCount** field value in the client request. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. Not enough parameter bytes were sent. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_INVALID_HANDLE

(0xC0000008L)

STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** is no longer valid. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_INVALID_HANDLE

(0xC0000008L)

STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** supplied is not defined to the session. | + +#### TRANS_MAILSLOT_WRITE (0x0001) + +The TRANS_MAILSLOT_WRITE transaction subcommand was introduced in the **LAN Manager 1.0 dialect**. It is used to write a message to a mailslot. + +The subcommand code for a TRANS_MAILSLOT_WRITE is 0x0001, which is identical to the subcommand code for TRANS_SET_NMPIPE_STATE. This is permitted because transaction subcommand codes are not global; they are interpreted relative to the resource being accessed. + +There are no mailslot operations that are defined as part of the CIFS protocol. Mailslots are not accessed over SMB sessions (although the Mailslot sub-protocol defines a mechanism for doing so). As a result, mailslot operations are documented separately. For more information on the Remote Mailslot Protocol, see [\[MS-MAIL\]](%5bMS-MAIL%5d.pdf#Section_8ea19aa46e5a4aedb6280b5cd75a1ab9) and [\[MSLOT\]](https://go.microsoft.com/fwlink/?LinkId=90218). + +Windows clients do not send TRANS_MAILSLOT_WRITE commands via CIFS sessions. Related protocols, such as [\[MS-BRWS\]](%5bMS-BRWS%5d.pdf#Section_d2d83b294b62479eb4279b750303387b), send Class 2 mailslot messages as NetBIOS datagrams. TRANS_MAILSLOT_WRITE commands carrying Class 2 messages do not require responses. See \[MS-MAIL\]. + +### Transaction2 Subcommands + +#### TRANS2_OPEN2 (0x0000) + +This Transaction2 subcommand was introduced in the [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) dialect. + +This transaction is used to open or create a file and set extended attributes on the file. + +##### Request + +The TRANS2_OPEN2 request and response formats are a special case of [SMB_COM_TRANSACTION2 (section 2.2.4.46)](#Section_3d9d8f3edc70410da3fc6f4a881e8cab) [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625). Only the TRANS2_OPEN2 request specifics are described here. + +**SMB_Parameters** + +**WordCount (1 byte):** This field MUST be0x0F. + +**Words (30 bytes):** + +**TotalDataCount (2 bytes):** This field MUST be zero (0x0000) if no **Trans2_Data** is being supplied. This field MUST be the total size of the **Trans2_Data** if extended attributes are being provided. + +**SetupCount (1 byte):** This field MUST be 0x01. + +**Setup (2 bytes):** This field MUST be TRANS2_OPEN2 (0x0000). + +**Trans2_Parameters** + +- Trans2_Parameters +- { +- USHORT Flags; +- USHORT AccessMode; +- USHORT Reserved1; +- SMB_FILE_ATTRIBUTES FileAttributes; +- UTIME CreationTime; +- USHORT OpenMode; +- ULONG AllocationSize; +- USHORT Reserved\[5\]; +- SMB_STRING FileName; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | -------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Flags | | | | | | | | | | | | | | | | AccessMode | | | | | | | | | | | | | | | | +| Reserved1 | | | | | | | | | | | | | | | | FileAttributes | | | | | | | | | | | | | | | | +| CreationTime | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| OpenMode | | | | | | | | | | | | | | | | AllocationSize | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | Reserved | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| FileName (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Flags (2 bytes):** This 16-bit field of flags is used to request that the server take certain actions. + +| Bitmask | Meaning | +| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| REQ_ATTRIB

0x0001 | Return additional information in the response; populate the **CreationTime**, **FileDataSize**, **AccessMode**, **ResourceType**, and **NMPipeStatus** fields in the response. | +| REQ_OPLOCK

0x0002 | Exclusive OpLock requested. | +| REQ_OPBATCH

0x0004 | Batch OpLock requested. | +| REQ_EASIZE

0x0008 | Return total length of Extended Attributes (EAs); populate the **ExtendedAttributeLength** field in the response. | + +**AccessMode (2 bytes):** A 16-bit field for encoding the requested access mode. See section [3.2.4.5.1](#Section_9a45e9e773774da199d6d66d97532550) for a discussion on sharing modes. + +| Name and bitmask | Values | Meaning | +| ------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| AccessMode

0x0007 | 0 | Open for reading. | +| 1 | Open for writing. | +| 2 | Open for reading and writing. | +| 3 | Open for execution. | +| 0x0008 | **Reserved** | | +| SharingMode

0x0070 | 0 | Compatibility mode | +| 1 | Deny read/write/execute to others (exclusive use requested). | +| 2 | Deny write to others. | +| 3 | Deny read/execute to others. | +| 4 | Deny nothing to others. | +| 0x0080 | **Reserved** | | +| ReferenceLocality

0x0700 | 0 | Unknown locality of reference | +| 1 | Mainly sequential access | +| 2 | Mainly random access | +| 3 | Random access with some locality | +| 4 - 7 | **Undefined** | +| 0x0800 | **Reserved** | | +| CacheMode

0x1000 | 0 | Perform caching on file. | +| 1 | Do not cache the file. | +| 0x2000 | **Reserved** | | +| WritethroughMode

0x4000 | 0 | Write-through mode. If this flag is set, then no read ahead or write behind is allowed on this file or device. When the response is returned, data is expected to be on the disk or device. | +| 1 | +| 0x8000 | **Reserved** | | + +**Reserved1 (2 bytes):** This field MUST be set to zero (0x0000) and MUST be ignored by the server. + +**FileAttributes (2 bytes):** Attributes to apply to the file if it needs to be created. + +**CreationTime (4 bytes):** A 32-bit integer time value to be assigned to the file as the time of creation if the file is to be created. + +**OpenMode (2 bytes):** A 16-bit field that controls the way that a file SHOULD be treated when it is opened for use by certain extended SMB requests. + +| Name and bitmask | Values | Meaning | +| ---------------------------- | ----------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| FileExistsOpts

0x0003 | 0 | The request SHOULD fail and an error SHOULD be returned indicating the prior existence of the file. | +| 1 | The file is to be appended. | +| 2 | The file is to be truncated to zero (0) length. | +| 3 | **Reserved** | +| CreateFile

0x0010 | 0 | If the file does not exist, return error. | +| 1 | If the file does not exist, create it. | + +All other bits are reserved; they SHOULD NOT be used by the client and MUST be ignored by the server. + +**AllocationSize (4 bytes):** The number of bytes to reserve for the file if the file is being created or truncated. + +**Reserved (10 bytes):** All entries in this field MUST be set to zero (0x0000). + +**FileName (variable):** A buffer containing the name of the file to be opened, created, or truncated. The string MUST be null terminated. + +**Trans2_Data** + +- Trans2_Data +- { + +- SMB_FEA_LIST ExtendedAttributeList; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ExtendedAttributeList (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ExtendedAttributeList (variable):** A list of extended attribute (EA) name/value pairs that are to be assigned to the file. + +##### Response + +**Trans2_Parameters** + +- Trans2_Parameters +- { +- USHORT FID; +- SMB_FILE_ATTRIBUTES FileAttributes; +- UTIME CreationTime; +- ULONG FileDataSize; +- USHORT AccessMode; +- USHORT ResourceType; +- SMB_NMPIPE_STATUS NMPipeStatus; +- USHORT ActionTaken; +- ULONG Reserved; +- USHORT ExtendedAttributeErrorOffset; +- ULONG ExtendedAttributeLength; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ---------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ----------------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| FID | | | | | | | | | | | | | | | | FileAttributes | | | | | | | | | | | | | | | | +| CreationTime | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| FileDataSize | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| AccessMode | | | | | | | | | | | | | | | | ResourceType | | | | | | | | | | | | | | | | +| NMPipeStatus | | | | | | | | | | | | | | | | ActionTaken | | | | | | | | | | | | | | | | +| Reserved | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ExtendedAttributeErrorOffset | | | | | | | | | | | | | | | | ExtendedAttributeLength | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | + +**FID (2 bytes):** This field contains the [FID](#Section_39a29276cadf41d3b5f174facea48607) of the opened file. + +**FileAttributes (2 bytes):** The file attributes assigned to the file after the open or create has occurred. + +**CreationTime (4 bytes):** A 32-bit integer time value to be assigned to the file as the time of creation if the file is to be created. + +**FileDataSize (4 bytes):** The current size of the file in bytes. + +**AccessMode (2 bytes):** A 16-bit field for encoding the granted access mode. This field is formatted in the same way as the equivalent field in the request. + +**ResourceType (2 bytes):** The file type. This field MUST be interpreted as follows: + +| Name and value | Meaning | +| ------------------------------------- | ----------------------------------------------------------------------- | +| FileTypeDisk

0x0000 | File or directory | +| FileTypeByteModePipe

0x0001 | [**Byte mode**](#gt_8586fe9a-1cfa-458a-a145-8db64d69c69c) named pipe | +| FileTypeMessageModePipe

0x0002 | [**Message mode**](#gt_c49a48e8-f1ac-4568-bc87-0672eb08868b) named pipe | +| FileTypePrinter

0x0003 | Printer device | +| FileTypeUnknown

0xFFFF | Unknown file type | + +**NMPipeStatus (2 bytes):** A 16-bit field that contains the status of the named pipe if the resource type opened is a named [**pipe instance**](#gt_10cdea2b-f767-4276-a91e-5f4d06b31617). This field is formatted as an SMB_NMPIPE_STATUS (section [2.2.1.3](#Section_6911a7095dfb4ffbb0903e8ef872f85c)). + +**ActionTaken (2 bytes):** A 16-bit field that shows the results of the open operation. + +| Name and bitmask | Values | Meaning | +| ------------------------ | ------ | ------------------------------------------------------------------------------------------------- | +| OpenResult

0x0003 | 0 | Reserved. | +| | 1 | The file existed and was opened. | +| | 2 | The file did not exist and was therefore created. | +| | 3 | The file existed and was truncated. | +| LockStatus

0x8000 | 0 | No OpLock was requested, the OpLock could not be granted, or the server does not support OpLocks. | +| | 1 | An OpLock was requested by the client and was granted by the server. | + +All other bits are reserved, SHOULD NOT be used by the client and MUST be ignored by the server. + +**Reserved (4 bytes):** This field SHOULD be set to zero (0x00000000) and MUST be ignored by the server. + +**ExtendedAttributeErrorOffset (2 bytes):** If an error was detected while applying the entries in the **ExtendedAttributeList**, this field contains the offset in bytes to the specific **ExtendedAttributeList.FEAList** entry in the request that caused the error. + +**ExtendedAttributeLength (4 bytes):** The total size of the extended attributes for the opened file. + +**Trans2_Data** + +No data is sent by this message. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRbadpath

(0x0003) | STATUS_NO_SUCH_FILE

(0xC000000F) | ENOENT | The file path syntax is invalid. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | EPERM | Access denied. | +| ERRDOS

(0x01) | ERRbadaccess

(0x000C) | STATUS_ACCESS_DENIED

(0xC0000022) | | Invalid open mode. | +| ERRDOS

(0x01) | ERRbadshare

(0x0020) | STATUS_SHARING_VIOLATION

(0xC0000043) | ETXTBSY | Sharing violation. | +| ERRDOS

(0x01) | ERRgeneral

(0x001F) | STATUS_UNSUCCESSFUL

(0xC0000001) | | The size of the extended attribute list is not correct. Check the **EaErrorOffset** field for the address of the EA at which the error was detected. | +| ERRDOS

(0x01) | ERRfilexists

(0x0050) | STATUS_OBJECT_NAME_COLLISION

(0xC0000035) | EEXIST | The file already exists. | +| ERRDOS

(0x01) | ERRinvalidparam

(0x0057) | STATUS_INVALID_PARAMETER

(0xC000000D) | | One of the extended attributes had an invalid **Flag** bit value. | +| ERRDOS

(0x01) | ERRunknownlevel

(0x007C) | STATUS_OS2_INVALID_LEVEL

(0x007C0001) | | The **InformationLevel** supplied is invalid. | +| ERRDOS

(0x01) | ERRbadealist

(0x00FF) | STATUS_OS2_EA_LIST_INCONSISTENT

(0x00FF0001)

STATUS_EA_LIST_INCONSISTENT

(0x80000014) | | Inconsistent extended attribute list. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. Not enough parameter bytes were sent. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** is no longer valid. | +| ERRSRV

(0x02) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** supplied is not defined to the session. | + +#### TRANS2_FIND_FIRST2 (0x0001) + +TRANS2_FIND_FIRST2 (0x0001) + +This Transaction2 subcommand was introduced in the NT LAN Manager dialect, replacing the [**obsolete**](#gt_73fb9153-adab-4f17-b472-426f982e360c) TRANS2_FIND_FIRST subcommand introduced in the **LAN Manager 1.2** dialect. + +This transaction is used to begin a search for file(s) within a directory or for a directory. The search can be continued if necessary with the TRANS2_FIND_NEXT2 command. There are several levels of information that can be queried for the returned files or directories. The information level is specified in the **InformationLevel** field of the Trans2_Parameters (see following), and each information level has a unique response format. + +##### Request + +The TRANS2_FIND_FIRST2 request and response formats are special cases of the [SMB_COM_TRANSACTION2 (section 2.2.4.46)](#Section_3d9d8f3edc70410da3fc6f4a881e8cab) [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625). Only the TRANS2_FIND_FIRST2 specifics are described here. + +**SMB_Parameters** + +**WordCount (1 byte):** This field MUST be 0x0F. + +**Words (30 bytes):** + +**TotalDataCount (2 bytes):** If no **Trans2_Data** is supplied, this field MUST be 0x0000. If **Trans2_Parameters.InformationLevel** is SMB_INFO_QUERY_EAS_FROM_LIST (see following), this field MUST be the total size of the extended attribute list. + +**SetupCount (1 byte):** This field MUST be 0x01. + +**Setup (2 bytes):** This field MUST be TRANS2_FIND_FIRST2 (0x0001). + +**Trans2_Parameters** + +- Trans2_Parameters +- { +- SMB_FILE_ATTRIBUTES SearchAttributes; +- USHORT SearchCount; +- USHORT Flags; +- USHORT InformationLevel; +- ULONG SearchStorageType; +- SMB_STRING FileName; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SearchAttributes | | | | | | | | | | | | | | | | SearchCount | | | | | | | | | | | | | | | | +| Flags | | | | | | | | | | | | | | | | InformationLevel | | | | | | | | | | | | | | | | +| SearchStorageType | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| FileName (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SearchAttributes (2 bytes):** File attributes to apply as a constraint to the file search. Exclusive search attributes (see section [2.2.1.2.4](#Section_2198f480e0474df0ba64f28eadef00b9)) can also be set. + +**SearchCount (2 bytes):** The server MUST NOT return more entries than indicated by the value of this field. + +**Flags (2 bytes):** This bit field contains flags used to request that the server manage the state of the transaction based on how the client attempts to traverse the results. + +| Name and bitmask | Description | +| ------------------------------------------ | ------------------------------------------- | +| SMB_FIND_CLOSE_AFTER_REQUEST

0x0001 | Close the search after this request. | +| SMB_FIND_CLOSE_AT_EOS

0x0002 | Close search when end of search is reached. | +| SMB_FIND_RETURN_RESUME_KEYS

0x0004 | Return resume keys for each entry found. | +| SMB_FIND_CONTINUE_FROM_LAST

0x0008 | Continue search from previous ending place. | +| SMB_FIND_WITH_BACKUP_INTENT

0x0010 | Find with backup intent. | + +**InformationLevel (2 bytes):** This field contains an [**information level**](#gt_b01da706-86d0-4ee2-9461-2d9fb1060543) code, which determines the information contained in the response. The list of valid information level codes is specified in section [2.2.2.3.1](#Section_f5dcd5941c464bc6963f581a4c78ea99). A client that has not negotiated long names support MUST request only SMB_INFO_STANDARD. If a client that has not negotiated long names support requests an **InformationLevel** other than SMB_INFO_STANDARD, the server MUST return a status of STATUS_INVALID_PARAMETER (ERRDOS/ERRinvalidparam). + +**SearchStorageType (4 bytes):** The client MUST set this field to zero and the server MUST ignore it on receipt. + +**FileName (variable):** The file pattern to search for. This field MAY contain wildcard characters. + +**Trans2_Data** + +The following **Trans2_Data** structure MUST be included if the **Trans2_Parameters.InformationLevel** field is set to SMB_INFO_QUERY_EAS_FROM_LIST; otherwise, it MUST NOT be included. + +- Trans2_Data +- { + +- SMB_GEA_LIST GetExtendedAttributeList; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| GetExtendedAttributeList (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**GetExtendedAttributeList (variable):** A list of extended attribute (EA) names. The value of the **AttributeName** fields MUST be used by the server to query the set of extended attributes that match the set of **AttributeName** values provided in this list. + +##### Response + +**Trans2_Parameters** + +- Trans2_Parameters +- { +- USHORT SID; +- USHORT SearchCount; +- USHORT EndOfSearch; +- USHORT EaErrorOffset; +- USHORT LastNameOffset; +- } + +**SID (2 bytes):** The server-generated search identifier for this transaction. It MUST be provided in TRANS2_FIND_NEXT2 transactions. + +**SearchCount (2 bytes):** The number of entries returned by the search. + +**EndOfSearch (2 bytes):** This field MUST be zero (0x0000) if the search can be continued using the TRANS2_FIND_NEXT2 transaction. This field MUST be nonzero if this response is the last and the find has reached the end of the search results. + +**EaErrorOffset (2 bytes):** If **Request.Trans2_Parameters.InformationLevel** is not SMB_INFO_QUERY_EAS_FROM_LIST, this field MUST be zero (0x0000). If InformationLevel is SMB_INFO_QUERY_EAS_FROM_LIST, this field marks the offset to an extended attribute name, the retrieval of which caused an error. This field MUST contain the offset in bytes to the SMB_GEA entry in the **Trans2_Data.GetExtendedAttributesList** that identifies the extended attribute that caused the error, or zero (0x0000) if no error was encountered. + +**LastNameOffset (2 bytes):** If the server cannot resume the search, this field MUST be zero (0x0000). If the server can resume the search, this field contains the offset in bytes into the **Trans2_Data** structure at which the file name of the last entry returned by the server is located. This value can be used in the **Trans2_Parameters** structure of the request to continue a search. See [TRANS2_FIND_NEXT2 (section 2.2.6.3)](#Section_8f2e9ab5a6be4540a8fdf62492b34d24) for more information. + +**Trans2_Data** + +The **Trans2_Data** block carries the structure of the **information level** specified by the request's **Trans2_Parameters.InformationLevel** field. Each **information level's** corresponding structure is specified in section [2.2.8.1](#Section_635a88d2435241f28b9a1ed7c1997f7f). + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| ERRDOS (0x01) | ERRbadfile

(0x0002) | STATUS_NO_SUCH_FILE

(0xC000000F) | ENOENT | The named file was not found. | +| ERRDOS (0x01) | ERRbadpath

(0x0003) | STATUS_OBJECT_PATH_SYNTAX_BAD

(0xC000003B) | ENOTDIR | The file path syntax is invalid. | +| ERRDOS (0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | EPERM | Access denied. | +| ERRDOS (0x01) | ERRbadaccess

(0x000C) | STATUS_ACCESS_DENIED

(0xC0000022) | | Invalid open mode. | +| ERRDOS (0x01) | ERRbadshare

(0x0020) | STATUS_SHARING_VIOLATION

(0xC0000043) | ETXTBSY | Sharing violation. | +| ERRDOS (0x01) | ERRgeneral

(0x001F) | STATUS_UNSUCCESSFUL

(0xC0000001) | | The size of the extended attribute list is not correct. Check the EaErrorOffset field for address of the [SMB_GEA](#Section_e40c0bee37894b24869448b796a2d4fc) structure at which the error was detected. | +| ERRDOS (0x01) | ERRinvalidparam

(0x0057) | STATUS_INVALID_PARAMETER

(0xC000000D) | | One of the extended attributes had an invalid Flag bit value. | +| ERRDOS (0x01) | ERRunknownlevel

(0x007C) | STATUS_OS2_INVALID_LEVEL

(0x007C0001) | | The InformationLevel supplied is invalid. | +| ERRDOS (0x01) | ERRbadealist

(0x00FF) | STATUS_OS2_EA_LIST_INCONSISTENT

(0x00FF0001)

STATUS_EA_LIST_INCONSISTENT

(0x80000014) | | Inconsistent extended attribute list. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. Not enough parameter bytes were sent. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | The TID is no longer valid. | +| ERRSRV

(0x02) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The UID supplied is not defined to the session. | +| ERRSRV

(0x02) | ERRmoredata

(0x00EA) | STATUS_BUFFER_OVERFLOW

(0x80000005) | | The number of bytes read from the named pipe exceeds the MaxDataCount field in the client request. | + +#### TRANS2_FIND_NEXT2 (0x0002) + +This Transaction2 subcommand was introduced in the [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) dialect, replacing the [**obsolete**](#gt_73fb9153-adab-4f17-b472-426f982e360c) TRANS2_FIND_NEXT subcommand introduced in the **LAN Manager 1.2** dialect. + +This transaction is used to continue a search for file(s) within a directory or for a directory. The search MUST have been initiated using TRANS2_FIND_FIRST2. There are several **information levels** that can be queried for the returned files or directories. The **information level** is specified in the **Trans2_Parameters.InformationLevel** field, and each **information level** has a unique response format. See TRANS2_FIND_FIRST2 for the specification of each **information level's** response data. If the client attempts to terminate a search prior to reaching the end of the search results, as indicated by the server's response, the client MUST use the SMB_COM_FIND_CLOSE2 command and MUST provide the **SID** from the search. + +##### Request + +The TRANS2_FIND_NEXT2 request and response formats are special cases of [SMB_COM_TRANSACTION2 (section 2.2.4.46)](#Section_3d9d8f3edc70410da3fc6f4a881e8cab) [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625). Only the TRANS2_FIND_NEXT2 specifics are described here. + +**SMB_Parameters** + +**WordCount (1 byte):** This field MUST be 0x0F. + +**Words (30 bytes):** + +**TotalDataCount (2 bytes):** If no **Trans2_Data** is supplied, this field MUST be 0x0000. If **Trans2_Parameters.InformationLevel** is SMB_INFO_QUERY_EAS_FROM_LIST (see TRANS2_FIND_FIRST2), this field MUST be the total size of the extended attribute list. + +**SetupCount (1 byte):** This field MUST be 0x01. + +**Setup (2 bytes):** This field MUST be TRANS2_FIND_NEXT2 (0x0002). + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ---------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Trans2_Parameters (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Trans2_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Trans2_Parameters (variable):** + +- Trans2_Parameters +- { +- USHORT SID; +- USHORT SearchCount; +- USHORT InformationLevel; +- ULONG ResumeKey; +- USHORT Flags; +- SMB_STRING FileName; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ----------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SID | | | | | | | | | | | | | | | | SearchCount | | | | | | | | | | | | | | | | +| InformationLevel | | | | | | | | | | | | | | | | ResumeKey | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | Flags | | | | | | | | | | | | | | | | +| FileName (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SID (2 bytes):** This field MUST be the search identifier (SID) returned in TRANS2_FIND_FIRST2 response. + +**SearchCount (2 bytes):** This field MUST be the maximum number of entries to return in the response. + +**InformationLevel (2 bytes):** This field contains an information level code, which determines the information contained in the response. The list of valid information level codes is specified in section [2.2.2.3.1](#Section_f5dcd5941c464bc6963f581a4c78ea99). A client that has not negotiated long names support MUST request only SMB_INFO_STANDARD. If a client that has not negotiated long names support requests an [**InformationLevel**](#gt_b01da706-86d0-4ee2-9461-2d9fb1060543) other than SMB_INFO_STANDARD, the server MUST return a status of STATUS_INVALID_PARAMETER (ERRDOS/ERRinvalidparam). + +**ResumeKey (4 bytes):** This field MUST be the value of a **ResumeKey** field returned in the response from a TRANS2_FIND_FIRST2 or TRANS2_FIND_NEXT2 that is part of the same search (same **SID**). + +**Flags (2 bytes):** This bit mask field is used to request that the server manage the state of the transaction based on how the client attempts to traverse the results. + +| Name and bitmask | Description | +| ------------------------------------------ | ------------------------------------------- | +| SMB_FIND_CLOSE_AFTER_REQUEST

0x0001 | Close the search after this request. | +| SMB_FIND_CLOSE_AT_EOS

0x0002 | Close search when end of search is reached. | +| SMB_FIND_RETURN_RESUME_KEYS

0x0004 | Return resume keys for each entry found. | +| SMB_FIND_CONTINUE_FROM_LAST

0x0008 | Continue search from previous ending place. | +| SMB_FIND_WITH_BACKUP_INTENT

0x0010 | Find with backup intent. | + +**FileName (variable):** A filename pattern. The server re-runs the search based on the search criteria defined by the **FileName** field in the [TRANS2_FIND_FIRST2 Request (section 2.2.6.2.1)](#Section_b2b2a73094994f05884ed5bb7b9caf90), and the file names are returned starting after the first file that matches the filename pattern. This field can contain wildcard characters.[<146>](#Appendix_A_146) + +**Trans2_Data (variable):** The **Trans2_Data** MUST be included if the **Trans2_Parameters.InformationLevel** field is set to SMB_INFO_QUERY_EAS_FROM_LIST; else, it MUST NOT be included. + +- Trans2_Data +- { + +- SMB_GEA_LIST GetExtendedAttributeList; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| GetExtendedAttributeList (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**GetExtendedAttributeList (variable):** A list of extended attribute (EA) names. The value of the **AttributeName** field MUST be used by the server to further constrain the find query to files having the set of extended attributes that match the set of **AttributeName** values provided in this list. + +##### Response + +**Trans2_Parameters** + +- Trans2_Parameters +- { +- USHORT SearchCount; +- USHORT EndOfSearch; +- USHORT EaErrorOffset; +- USHORT LastNameOffset; +- } + +**Trans2_Parameters:** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | -------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SearchCount | | | | | | | | | | | | | | | | EndOfSearch | | | | | | | | | | | | | | | | +| EaErrorOffset | | | | | | | | | | | | | | | | LastNameOffset | | | | | | | | | | | | | | | | + +**SearchCount (2 bytes):** The number of entries returned by the search. + +**EndOfSearch (2 bytes):** This field MUST be zero (0x0000) if the search can be continued using the [TRANS2_FIND_NEXT2 (section 2.2.6.3)](#Section_8f2e9ab5a6be4540a8fdf62492b34d24) transaction. This field MUST be nonzero if this response is the last and the find has reached the end of the search results. + +**EaErrorOffset (2 bytes):** If the **Request.Trans2_Parameters.InformationLevel** field is not SMB_INFO_QUERY_EAS_FROM_LIST, this field MUST be zero (0x0000). If the **InformationLevel** field is SMB_INFO_QUERY_EAS_FROM_LIST, this field marks the offset to an extended attribute name, the retrieval of which caused an error. This field MUST contain the offset in bytes to the [SMB_GEA (section 2.2.1.2.1)](#Section_e40c0bee37894b24869448b796a2d4fc) entry in the **Trans2_Data.GetExtendedAttributesList** field that identifies the extended attribute that caused the error, or zero (0x0000) if no error was encountered. + +**LastNameOffset (2 bytes):** If the server cannot resume the search, this field MUST be zero (0x0000). If the server can resume the search, this field contains the offset in bytes into the **Trans2_Data** structure at which the file name of the last entry returned by the server is located. This value can be used in the **Trans2_Parameters** structure of the request to continue a search. + +The **Trans2_Data** block carries the structure of the [**Information Level**](#gt_b01da706-86d0-4ee2-9461-2d9fb1060543) specified by the request's **Trans2_Parameters.InformationLevel** field. Each Information Level's corresponding structure is specified in section [2.2.8.1](#Section_635a88d2435241f28b9a1ed7c1997f7f). + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| ERRDOS (0x01) | ERRbadpath

(0x0003) | STATUS_OBJECT_PATH_SYNTAX_BAD

(0xC000003B) | ENOTDIR | The file path syntax is invalid. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | EPERM | Access denied. | +| ERRDOS

(0x01) | ERRbadfid

(0x0006) | STATUS_INVALID_HANDLE

(0xC0000008) | EPERM | Represents that an invalid **SID** was supplied. | +| ERRDOS

(0x01) | ERRbadaccess

(0x000C) | STATUS_ACCESS_DENIED

(0xC0000022) | | Invalid open mode. | +| ERRDOS

(0x01) | ERRbadshare

(0x0020) | STATUS_SHARING_VIOLATION

(0xC0000043) | ETXTBSY | Sharing violation. | +| ERRDOS

(0x01) | ERRgeneral

(0x001F) | STATUS_UNSUCCESSFUL

(0xC0000001) | | The size of the extended attribute list is not correct. Check the **EaErrorOffset** field for the address of the **SMB_GEA** structure at which the error was detected. | +| ERRDOS

(0x01) | ERRinvalidparam

(0x0057) | STATUS_INVALID_PARAMETER

(0xC000000D) | | One of the extended attributes had an invalid **Flags** bit value. | +| ERRDOS

(0x01) | ERRunknownlevel

(0x007C) | STATUS_OS2_INVALID_LEVEL

(0x007C0001) | | The **InformationLevel** supplied is invalid. | +| ERRDOS

(0x01) | ERRbadealist

(0x00FF) | STATUS_OS2_EA_LIST_INCONSISTENT

(0x00FF0001)

STATUS_EA_LIST_INCONSISTENT

(0x80000014) | | Inconsistent extended attribute list. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. Not enough parameter bytes were sent. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** is no longer valid. | +| ERRSRV

(0x02) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRSRV

(0x02) | ERRbaduid

(0x0058) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** supplied is not known to the session. | + +#### TRANS2_QUERY_FS_INFORMATION (0x0003) + +This Transaction2 subcommand was introduced in the **LAN Manager 2.0** dialect. + +This transaction is used to request information about the object store underlying a share on the server. The share being queried is identified by the **TID** supplied in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) of the request. There are several levels of information that can be queried for the returned files or directories. The information level is specified in the **InformationLevel** field of the **Trans2_Parameters** data block, and each information level has a unique response format. + +##### Request + +The TRANS2_QUERY_FS_INFORMATION request and response formats are special cases of [SMB_COM_TRANSACTION2 (section 2.2.4.46)](#Section_3d9d8f3edc70410da3fc6f4a881e8cab) [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625). Only the TRANS2_QUERY_FS_INFORMATION specifics are described here. + +**SMB_Parameters:** + +**WordCount (1 byte):** This field MUST be 0x0F. + +**Words (30 bytes):** + +**TotalDataCount (2 bytes):** This field MUST be zero (0x0000). + +**SetupCount (1 byte):** This field MUST be 0x01. + +**Setup(2 bytes):** This field MUST be TRANS2_QUERY_FS_INFORMATION (0x0003). + +**Trans2_Parameters:** + +- Trans2_Parameters +- { +- USHORT InformationLevel; +- } + +**InformationLevel (2 bytes):** This field contains an information level code, which determines the information contained in the response. The list of valid information level codes is specified in section [2.2.2.3.2](#Section_55217a2687ef489fa1593ed6cc6412e9) + +**Trans2_Data:** No data is sent by this message. + +##### Response + +**Trans2_Parameters** + +No parameters are sent by this message + +**Trans2_Data** + +The **Trans2_Data** block carries the structure of the **information level** specified by the request's **Trans2_Parameters.InformationLevel** field. Each information level's corresponding structure is specified in section [2.2.8.2](#Section_2c7707b4afcd4dbfa0f335abebe68fac). + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ------------------------------- | -------------------------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------ | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRSRV

(0x02) | ERRunknownlevel

(0x007C) | STATUS_OS2_INVALID_LEVEL

(0x007C0001) | | The **InformationLevel** supplied is invalid. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. Not enough parameter bytes were sent. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** is no longer valid. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** supplied is not defined to the session. | +| ERRSRV

(0x02) | ERRmoredata

(0x00EA) | STATUS_BUFFER_OVERFLOW

(0x80000005) | | The number of bytes read from the named pipe exceeds the **MaxDataCount** field in the client request. | +| ERRHRD

(0x03) | ERRnotready

(0x0015) | STATUS_NO_MEDIA_IN_DEVICE

(0x0xC0000013) | | Share represents a removable device and there is no media present in the device. | +| ERRHRD

(0x03) | ERRdata

(0x0017) | STATUS_DATA_ERROR

(0xC000003E) | EIO | Disk I/O error. | + +#### TRANS2_SET_FS_INFORMATION (0x0004) + +This Transaction2 subcommand was introduced in the **LAN Manager 2.0** dialect. This subcommand is **reserved but not implemented.** + +Clients SHOULD NOT send requests using this command code. Servers receiving requests with this command code MUST return STATUS_SMB_NO_SUPPORT (ERRSRV/ERRnosupport). + +#### TRANS2_QUERY_PATH_INFORMATION (0x0005) + +This Transaction2 subcommand was introduced in the **LAN Manager 2.0** dialect. + +This transaction is used to get information about a specific file or directory. There are several **information levels** that can be queried. The **information level** is specified in the **Request.Trans2_Parameters.InformationLevel** field (see following) and each **information level** has a unique response format. See the individual response formats for the specification of the data returned by each **information level**. + +##### Request + +The TRANS2_QUERY_PATH_INFORMATION request and response formats are special cases of [SMB_COM_TRANSACTION2 (section 2.2.4.46)](#Section_3d9d8f3edc70410da3fc6f4a881e8cab) SMB. Only the TRANS2_QUERY_PATH_INFORMATION specifics are described here. + +**SMB_Parameters:** + +**WordCount (1 byte):** This field MUST be 0x0F. + +**Words (30 bytes):** + +**TotalDataCount (2 bytes):** If no **Trans2_Data** is supplied, this field MUST be 0x0000. If **Trans2_Parameters.InformationLevel** is SMB_INFO_QUERY_EAS_FROM_LIST (see following), this field MUST be the total size of the extended attribute list. + +**SetupCount (1 byte):** This field MUST be 0x01. + +**Setup\[0\] (2 bytes):** This field MUST be TRANS2_QUERY_PATH_INFORMATION (0x0005). + +**Trans2_Parameters:** + +- Trans2_Parameters +- { +- USHORT InformationLevel; +- ULONG Reserved; +- SMB_STRING FileName; +- } + +**InformationLevel (2 bytes):** This field contains an information level code, which determines the information contained in the response. The list of valid information level codes is specified in section [2.2.2.3.3](#Section_794afe2e7c114a8cb9090a397966f6a9). A client that has not negotiated long names support MUST request only SMB_INFO_STANDARD. If a client that has not negotiated long names support requests an **InformationLevel** other than SMB_INFO_STANDARD, the server MUST return a status of STATUS_INVALID_PARAMETER of (ERRDOS/ERRinvalidparam). + +**Reserved (4 bytes):** This field is reserved and MUST be zero (0x0000). + +**FileName (variable):** The file name or directory name for which to retrieve the information. + +**Trans2_Data:** The **Trans2_Data** field MUST be included if the **Trans2_Parameters.InformationLevel** field is set to SMB_INFO_QUERY_EAS_FROM_LIST; else, it MUST NOT be included. + +- Trans2_Data +- { +- SMB_GEA_LIST GetExtendedAttributeList; +- } + +**GetExtendedAttributeList (variable):** A list of extended attribute (EA) names. The server MUST return only those extended attributes that have an **AttributeName** matching one of the **AttributeName** values in the list. + +##### Response + +For the information levels greater than 0x100, the transaction response has 1 parameter word that SHOULD be ignored by the client. + +**Trans2_Parameters:** + +- Trans2_Parameters +- { +- USHORT EaErrorOffset; +- } + +**EaErrorOffset (2 bytes):** If **Request.Trans2_Parameters.InformationLevel** is not SMB_INFO_QUERY_EAS_FROM_LIST, this field MUST be zero (0x0000). If **InformationLevel** is SMB_INFO_QUERY_EAS_FROM_LIST, this field marks the offset to an extended attribute, the retrieval of which caused an error. This field MUST contain the offset in bytes to the SMB_GEA entry in **Trans2_Data.GetExtendedAttributesList** that caused the error or zero (0x0000) if no error was encountered. + +**Trans2_Data:** + +The **Trans2_Data** block carries the structure of the information level specified by the request's Trans2_Parameters. **InformationLevel** field. Each **information level**'s corresponding structure is specified in section [2.2.8.3](#Section_b9dcb99ce8104df8ae29cdf37e8c5a23). + +**Error Codes:** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| ERRDOS

(0x01) | ERRbadfile

(0x0002) | STATUS_NO_SUCH_FILE

(0xC000000F) | ENOENT | The named file was not found. | +| ERRDOS

(0x01) | ERRbadpath

(0x0003) | STATUS_OBJECT_PATH_SYNTAX_BAD

(0xC000003B) | ENOTDIR | The file path syntax is invalid. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | EPERM | Access denied. | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRDOS

(0x01) | ERRbadlength

(0x0018) | STATUS_INFO_LENGTH_MISMATCH

(0xC0000004) | | The client's **MaxDataCount** is too small to accommodate the results. | +| ERRDOS

(0x01) | ERRgeneral

(0x001F) | STATUS_UNSUCCESSFUL

(0xC0000001) | | The size of the extended attribute list is not correct. Check the **EaErrorOffset** field for the address of [SMB_GEA](#Section_e40c0bee37894b24869448b796a2d4fc) structure at which the error was detected. | +| ERRDOS

(0x01) | ERRunknownlevel

(0x007C) | STATUS_OS2_INVALID_LEVEL

(0x007C0001) | | The **InformationLevel** supplied is invalid. | +| ERRDOS

(0x01) | ERRbadealist

(0x00FF) | STATUS_OS2_EA_LIST_INCONSISTENT

(0x00FF0001)

STATUS_EA_LIST_INCONSISTENT

(0x80000014) | | Inconsistent extended attribute list. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. Not enough parameter bytes were sent. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** is no longer valid. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** supplied is not defined to the session. | +| ERRHRD

(0x03) | ERRnotready

(0x0015) | STATUS_NO_MEDIA_IN_DEVICE

(0x0xC0000013) | | Share represents a removable device and there is no media present in the device. | +| ERRHRD

(0x03) | ERRdata

(0x0017) | STATUS_DATA_ERROR

(0xC000003E) | EIO | Disk I/O error. | + +#### TRANS2_SET_PATH_INFORMATION (0x0006) + +This Transaction2 subcommand was introduced in the **LAN Manager 2.0** dialect. + +This transaction is used to set the standard and extended attribute information of a specific file or directory on the server. The file or directory is specified by a path relative to the **TID** supplied in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f). The file or directory does not need to be opened by the client before sending the transaction request. The set of standard and extended attribute information included in the request is determined by the **InformationLevel** field (see following). The setting of attribute information for the root directory of the share, as identified by the **TID**, MUST NOT be supported. + +##### Request + +The TRANS2_SET_PATH_INFORMATION request and response formats are special cases of [SMB_COM_TRANSACTION2 (section 2.2.4.46)](#Section_3d9d8f3edc70410da3fc6f4a881e8cab) [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625). Only the TRANS2_SET_PATH_INFORMATION specifics are described here. + +**SMB_Parameters:** + +**WordCount (1 byte):** This field MUST be 0x0F. + +**Words (30 bytes):** + +**TotalDataCount (2 bytes):** This field MUST be zero (0x0000). + +**SetupCount (1 byte):** This field MUST be 0x01. + +**Setup (2 bytes):** This field MUST be TRANS2_SET_PATH_INFORMATION (0x0006). + +**Trans2_Parameters:** + +- Trans2_Parameters +- { +- USHORT InformationLevel; +- ULONG Reserved; +- SMB_STRING FileName; +- } + +**InformationLevel (2 bytes):** This field contains an information level code, which determines the information contained in the **Trans2_Data** block. The list of valid information level codes is specified in section [2.2.2.3.4](#Section_0321265e312a472190facd40a443ed86). A client that has not negotiated long names support MUST use only SMB_INFO_STANDARD. If a client that has not negotiated long names support uses an **InformationLevel** other than SMB_INFO_STANDARD, the server MUST return a status of STATUS_INVALID_PARAMETER (ERRDOS/ERRinvalidparam). + +**Reserved (4 bytes):** This field is reserved and MUST be zero (0x00000000). + +**FileName (variable):** The file name or directory name for which to retrieve the information. + +**Trans2_Data:** The **Trans2_Data** block carries the structure of the **information level** specified by the **Trans2_Parameters.InformationLevel** field. Each information level's corresponding structure is specified in section [2.2.8.4](#Section_55b9ec0a219240299e2c150be302278d). + +##### Response + +The response information indicates if there was a problem with the list of extended attributes supplied when the **InformationLevel** field is **SMB \_INFO_SET_EAS**. The outcome of the request is included in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f). + +**Trans2_Parameters** + +- Trans2_Parameters +- { +- USHORT EaErrorOffset; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Trans2_Parameters | | | | | | | | | | | | | | | | + +**Trans2_Parameters (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| EaErrorOffset | | | | | | | | | | | | | | | | + +**EaErrorOffset (2 bytes):** This field contains the offset in bytes into the **ExtendedAttributeList** that identifies the attribute that caused an error. This field is meaningful only when the request's **Trans2_Parameters.InformationLevel** is set to **SMB_INFO_SET_EAS**. + +**Trans2_Data:** + +No data is sent by this message. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRbadfile

(0x0002) | STATUS_NO_SUCH_FILE

(0xC000000F) | ENOENT | The file does not exist. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | EPERM | Access denied. | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRDOS

(0x01) | ERRbadlength

(0x0018) | STATUS_INFO_LENGTH_MISMATCH

(0xC0000004) | | The client's **MaxDataCount** is too small to accommodate the results. | +| ERRDOS

(0x01) | ERRgeneral

(0x001F) | STATUS_UNSUCCESSFUL

(0xC0000001) | | The size of the extended attribute list is not correct. Check the **EaErrorOffset** field for the address of the [SMB_FEA](#Section_53d6fe8e489a4ec6bf98a3040baad686) structure at which the error was detected. | +| ERRDOS

(0x01) | ERRunknownlevel

(0x007C) | STATUS_OS2_INVALID_LEVEL

(0x007C0001) | | The **InformationLevel** supplied is invalid. | +| ERRDOS

(0x01) | ERRbadealist

(0x00FF) | STATUS_OS2_EA_LIST_INCONSISTENT

(0x00FF0001)

STATUS_EA_LIST_INCONSISTENT

(0x80000014) | | Inconsistent extended attribute list. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. Not enough parameter bytes were sent. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_INVALID_HANDLE

(0xC0000008)

STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** is no longer valid. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_INVALID_HANDLE

(0xC0000008)

STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** supplied is not defined to the session. | +| ERRHRD

(0x03) | ERRdata

(0x0017) | STATUS_DATA_ERROR

(0xC000003E) | EIO | Disk I/O error. | + +#### TRANS2_QUERY_FILE_INFORMATION (0x0007) + +This Transaction2 subcommand was introduced in the **LAN Manager 2.0** dialect. + +This transaction is an alternative to **TRANS2_QUERY_PATH_INFORMATION**. The **Trans2_Parameters** of this request contain a **FID** while the **Trans2_Parameters** of the TRANS2_QUERY_PATH_INFORMATION request contain a path string. + +##### Request + +The TRANS2_QUERY_FILE_INFORMATION request and response formats are special cases of [SMB_COM_TRANSACTION2 (section 2.2.4.46)](#Section_3d9d8f3edc70410da3fc6f4a881e8cab) SMB. Only the TRANS2_QUERY_FILE_INFORMATION Request specifics are described here. + +**SMB_Parameters:** + +**WordCount (1 byte):** This field MUST be 0x0F. + +**Words (30 bytes):** + +**TotalDataCount (2 bytes):** This field MUST be zero (0x0000) if no Trans2_Data is supplied. This field MUST be the total size of the extended attribute list if **InformationLevel** is SMB_INFO_QUERY_EAS_FROM_LIST (see TRANS2_QUERY_PATH_INFORMATION). + +**SetupCount (1 byte):** This field MUST be 0x01. + +**Setup (2 bytes):** This field MUST be TRANS2_QUERY_FILE_INFORMATION (0x0007). + +**Trans2_Parameters:** + +- Trans2_Parameters +- { +- USHORT FID +- USHORT InformationLevel; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| FID | | | | | | | | | | | | | | | | InformationLevel | | | | | | | | | | | | | | | | + +**FID (2 bytes):** This field MUST contain a valid FID returned from a previously successful SMB open command. + +**InformationLevel (2 bytes):** This field contains an information level code, which determines the information contained in the response. The list of valid information level codes is specified in section [2.2.2.3.3](#Section_794afe2e7c114a8cb9090a397966f6a9). A client that has not negotiated long names support MUST request only SMB_INFO_STANDARD. If a client that has not negotiated long names support requests an **InformationLevel** other than SMB_INFO_STANDARD, the server MUST return a status of STATUS_INVALID_PARAMETER (ERRDOS/ERRinvalidparam). + +**Trans2_Data:** The **Trans2_Data** field MUST be included if the **Trans2_Parameters.InformationLevel** field is set to SMB_INFO_QUERY_EAS_FROM_LIST; else, it MUST NOT be included. + +- Trans2_Data +- { +- SMB_GEA_LIST GetExtendedAttributeList; +- } + +**GetExtendedAttributeList (variable):** A list of extended attribute (EA) names. The server MUST return only those extended attributes that have an **AttributeName** matching one of the **AttributeName** values in the list. + +##### Response + +For [**information levels**](#gt_b01da706-86d0-4ee2-9461-2d9fb1060543) greater than 0x100, the transaction response has one parameter word that SHOULD be ignored by the client. + +**Trans2_Parameters:** + +- Trans2_Parameters +- { +- USHORT EaErrorOffset; +- } + +**EaErrorOffset (2 bytes):** If **Request.Trans2_Parameters.InformationLevel** is not SMB_INFO_QUERY_EAS_FROM_LIST, this field MUST be zero (0x0000). If **InformationLevel** is SMB_INFO_QUERY_EAS_FROM_LIST, this field marks the offset to an extended attribute, the retrieval of which caused an error. This field MUST contain the offset, in bytes, to the [SMB_GEA (section 2.2.1.2.1)](#Section_e40c0bee37894b24869448b796a2d4fc) entry in **Trans2_Data.ExtendedAttributesList** that caused the error, or zero (0x0000) if no error was encountered. + +**Trans2_Data:** + +The **Trans2_Data** block carries the structure of the information level specified by the request's **Trans2_Parameters.InformationLevel** field. Each information level's corresponding structure is specified in section [2.2.8.3](#Section_b9dcb99ce8104df8ae29cdf37e8c5a23).[<147>](#Appendix_A_147) + +**Error Codes:** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | EPERM | Access denied. | +| ERRDOS

(0x01) | ERRbadfid

(0x0006) | STATUS_INVALID_HANDLE

(0xC0000008) | ENOENT | The FID supplied is invalid. | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRDOS

(0x01) | ERRgeneral

(0x001F) | STATUS_UNSUCCESSFUL

(0xC0000001) | | The size of the extended attribute list is not correct. Check the **EaErrorOffset** field for the address of the **SMB_GEA** structure at which the error was detected. | +| ERRDOS

(0x01) | ERRinvalidparam

(0x0057) | STATUS_INVALID_PARAMETER

(0xC000000D) | | One of the extended attributes had an invalid Flag bit value. | +| ERRDOS

(0x01) | ERRunknownlevel

(0x007C) | STATUS_OS2_INVALID_LEVEL

(0x007C0001) | | The **InformationLevel** supplied is invalid, or the **DataCount** failed validation for the requested **InformationLevel** because not enough information was supplied by the client. | +| ERRDOS

(0x01) | ERRbadealist

(0x00FF) | STATUS_OS2_EA_LIST_INCONSISTENT

(0x00FF0001)

STATUS_EA_LIST_INCONSISTENT

(0x80000014) | | Inconsistent extended attribute list. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. Not enough parameter bytes were sent. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_INVALID_HANDLE

(0xC0000008)

STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** is no longer valid. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_INVALID_HANDLE

(0xC0000008)

STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** supplied is not defined to the session. | +| ERRHRD

(0x03) | ERRdata

(0x0017) | STATUS_DATA_ERROR

(0xC000003E) | EIO | Disk I/O error. | + +#### TRANS2_SET_FILE_INFORMATION (0x0008) + +This Transaction2 subcommand was introduced in the **LAN Manager 2.0** dialect. + +This transaction is an alternative to **TRANS2_SET_PATH_INFORMATION**. The **Trans2_Parameters** block of this request contains a **FID**, while the **Trans2_Parameters** block of the TRANS2_SET_PATH_INFORMATION request contains a path string. + +##### Request + +The [TRANS2_SET_FILE_INFORMATION (section 2.2.6.9)](#Section_cb2b7f2138774bc5adf4b78c8aa2a717) request and response formats are special cases of [SMB_COM_TRANSACTION2 (section 2.2.4.46)](#Section_3d9d8f3edc70410da3fc6f4a881e8cab) [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625). Only the TRANS2_SET_FILE_INFORMATION specifics are described here. + +**SMB_Parameters:** + +**WordCount (1 byte):** This field MUST be 0x0F. + +**Words (30 bytes):** + +**TotalDataCount (2 bytes):** This field MUST be 0x0000. + +**SetupCount (1 byte):** This field MUST be 0x01. + +**Setup (2 bytes):** This field MUST be TRANS2_SET_FILE_INFORMATION (0x0008). + +**Trans2_Parameters:** + +- Trans2_Parameters +- { +- USHORT FID; +- USHORT InformationLevel; +- USHORT Reserved; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| FID | | | | | | | | | | | | | | | | InformationLevel | | | | | | | | | | | | | | | | +| Reserved | | | | | | | | | | | | | | | | Trans2_Data (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**FID (2 bytes):** This field MUST contain a valid FID returned from a previously successful SMB open command. + +**InformationLevel (2 bytes):** This field determines the information contained in the response. See [TRANS2_SET_PATH_INFORMATION (section 2.2.6.7)](#Section_a23483d965434aaaa996e7c9506f8b94) for complete details. + +**Reserved (2 bytes):** MUST be set to zero when sent and MUST be ignored on receipt. + +**Trans2_Data (variable):** The **Trans2_Data** block carries the structure of the information level specified by the **Trans2_Parameters.InformationLevel** field. Each information level's corresponding structure is specified in section [2.2.8.4](#Section_55b9ec0a219240299e2c150be302278d). + +##### Response + +The response information indicates if there was a problem with the list of extended attributes supplied when the **InformationLevel** field is SMB_INFO_SET_EAS. The outcome of the request is included in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f). + +**Trans2_Parameters:** + +- Trans2_Parameters +- { +- USHORT EaErrorOffset; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Trans2_Parameters | | | | | | | | | | | | | | | | + +**Trans2_Parameters (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| EaErrorOffset | | | | | | | | | | | | | | | | + +**EaErrorOffset (2 bytes):** This field contains the offset, in bytes, into the **ExtendedAttributeList** that identifies the attribute that caused an error. This field is meaningful only when the request's **Trans2_Parameters.InformationLevel** is set to SMB_INFO_SET_EAS. + +**Trans2_Data:** + +No data is sent by this message. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | EPERM | Access denied. | +| ERRDOS

(0x01) | ERRbadfid

(0x0006) | STATUS_INVALID_HANDLE

(0xC0000008) | ENOENT | The **FID** supplied is invalid. | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRDOS

(0x01) | ERRgeneral

(0x001F) | **STATUS_UNSUCCESSFUL**

(0xC0000001) | | The size of the extended attribute list is not correct. Check the **EaErrorOffset** field for the address of the SMB_FEA structure at which the error was detected. | +| ERRDOS

(0x01) | ERRinvalidparam

(0x0057) | STATUS_INVALID_PARAMETER

(0xC000000D) | | One of the extended attributes had an invalid Flag bit value. | +| ERRDOS

(0x01) | ERRunknownlevel

(0x007C) | STATUS_OS2_INVALID_LEVEL

(0x007C0001) | | The **InformationLevel** supplied is invalid or the **DataCount** failed validation for the requested **InformationLevel** because not enough information was supplied by the client. | +| ERRDOS

(0x01) | ERRbadealist

(0x00FF) | STATUS_OS2_EA_LIST_INCONSISTENT

(0x00FF0001)

STATUS_EA_LIST_INCONSISTENT

(0x80000014) | | Inconsistent extended attribute list. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. Not enough parameter bytes were sent. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_INVALID_HANDLE

(0xC0000008)

STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** is no longer valid. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_INVALID_HANDLE

(0xC0000008)

STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** supplied is not defined to the session. | +| ERRHRD

(0x03) | ERRnowrite

(0x0013) | STATUS_MEDIA_WRITE_PROTECTED

(0xC00000A2) | | The **FID** supplied is on write- protected media. | +| ERRHRD

(0x03) | ERRdata

(0x0017) | STATUS_DATA_ERROR

(0xC000003E) | EIO | Disk I/O error. | + +#### TRANS2_FSCTL (0x0009) + +This Transaction2 subcommand was introduced in the **LAN Manager 2.0** dialect. This subcommand is reserved but not implemented. + +Clients SHOULD NOT send requests using this command code. Servers receiving requests with this command code MUST return STATUS_NOT_IMPLEMENTED (ERRDOS/ERRbadfunc). + +#### TRANS2_IOCTL2 (0x000A) + +This Transaction2 subcommand was introduced in the [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) dialect. This subcommand is reserved but not implemented. + +Clients SHOULD NOT send requests using this command code. Servers receiving requests with this command code MUST return STATUS_NOT_IMPLEMENTED (ERRDOS/ERRbadfunc). + +#### TRANS2_FIND_NOTIFY_FIRST (0x000B) + +This Transaction2 subcommand was introduced in the **LAN Manager 2.0** dialect. It was rendered [**obsolete**](#gt_73fb9153-adab-4f17-b472-426f982e360c) in the [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) dialect. + +Clients SHOULD NOT send requests using this command code. Servers receiving requests with this command code MUST return STATUS_NOT_IMPLEMENTED (ERRDOS/ERRbadfunc). + +#### TRANS2_FIND_NOTIFY_NEXT (0x000C) + +This Transaction2 subcommand was introduced in the **LAN Manager 2.0** dialect. It was rendered [**obsolete**](#gt_73fb9153-adab-4f17-b472-426f982e360c) in the [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) dialect. + +Clients SHOULD NOT send requests using this command code. Servers receiving requests with this command code MUST return STATUS_NOT_IMPLEMENTED (ERRDOS/ERRbadfunc). + +#### TRANS2_CREATE_DIRECTORY (0x000D) + +This Transaction2 subcommand was introduced in the **LAN Manager 2.0** dialect. + +This transaction is used to create a new directory and can be used to set extended attribute information. The directory is specified by a path relative to the **TID** supplied in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f). The directory MUST NOT exist. If the directory does exist, the request MUST fail and the server MUST return STATUS_OBJECT_NAME_COLLISION (ERRDOS/ERRfilexists). + +##### Request + +The TRANS2_CREATE_DIRECTORY request and response formats are special cases of [SMB_COM_TRANSACTION2 (section 2.2.4.46)](#Section_3d9d8f3edc70410da3fc6f4a881e8cab) [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625). Only the TRANS2_CREATE_DIRECTORY specifics are described here. + +**SMB_Parameters** + +**WordCount (1 byte):** This field MUST be 0x0F. + +**Words (30 bytes):** + +**TotalDataCount (2 bytes):** This field MUST be zero (0x0000). + +**SetupCount (1 byte):** This field MUST be 0x01. + +**Setup (2 bytes):** This field MUST be TRANS2_CREATE_DIRECTORY (0x000D). + +**Trans2_Parameters** + +- Trans2_Parameters +- { +- ULONG Reserved; +- SMB_STRING DirectoryName; +- } + +**Reserved (4 bytes):** This field is reserved and MUST be zero (0x00000000). + +**DirectoryName (variable):** The directory name to assign to the new directory. + +**Trans2_Data** + +This Trans2_Data is used to set extended attribute information for the new directory. The data element is as follows. + +- Trans2_Data +- { +- SMB_FEA_LIST ExtendedAttributeList; +- } + +**ExtendedAttributeList (variable):** A list of extended attribute name/value pairs. + +##### Response + +The response information indicates if there was a problem with the list of extended attributes, if they were supplied. The outcome of the request is included in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f). + +- Trans2_Parameters +- { +- USHORT EaErrorOffset; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Trans2_Parameters | | | | | | | | | | | | | | | | + +**Trans2_Parameters (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| EaErrorOffset | | | | | | | | | | | | | | | | + +**EaErrorOffset (2 bytes):** This field contains the offset in bytes into the **ExtendedAttributeList**.FEAList that identifies the attribute that caused an error. This field is meaningful only when the request included Trans2_Data. + +**Trans2_Data** + +No data is sent by this message. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRbadpath

(0x0003) | STATUS_OBJECT_PATH_SYNTAX_BAD

(0xC000003B) | ENOENT | The path syntax is invalid. | +| ERRDOS

(0x01) | ERRbadpath

(0x0003) | STATUS_OBJECT_PATH_INVALID

(0xC0000039) | ENOTDIR | A component of the path-prefix was not a directory. | +| ERRDOS

(0x01) | ERRbadpath

(0x0003) | STATUS_OBJECT_PATH_NOT_FOUND

(0xC000003A) | ENOENT | The path does not exist. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | EACCESS | A component of the path-prefix denied search permission. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | | ENOSPC | The parent directory is full. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | | EMLINK | Too many links to the parent directory. | +| ERRDOS

(0x01) | ERRgeneral

(0x001F) | STATUS_UNSUCCESSFUL

(0xC0000001) | | The size of the extended attribute list is not correct. Check the **EaErrorOffset** field for the address of the [SMB_FEA](#Section_53d6fe8e489a4ec6bf98a3040baad686) structure at which the error was detected. | +| ERRDOS

(0x01) | ERRfilexists

(0x0050) | STATUS_OBJECT_NAME_COLLISION

(0xC0000035) | EEXIST | The specified path already exists. | +| ERRDOS

(0x01) | ERRinvalidparam

(0x0057) | STATUS_INVALID_PARAMETER

(0xC000000D)

STATUS_INVALID_EA_FLAG

(0x80000015) | | One of the extended attributes had an invalid **Flag** bit value. | +| ERRDOS

(0x01) | ERRunknownlevel

(0x007C) | STATUS_OS2_INVALID_LEVEL

(0x007C0001) | | The **InformationLevel** supplied is invalid. | +| ERRDOS

(0x01) | ERRinvalidparam

(0x0057) | STATUS_INVALID_EA_NAME

(0x80000013) | | Invalid value for extended attribute name. Check the **EaErrorOffset** field for the location. | +| ERRDOS

(0x01) | ERRbadealist

(0x00FF) | STATUS_EA_LIST_INCONSISTENT

(0x80000014)

STATUS_OS2_EA_LIST_INCONSISTENT

(0x00FF0001) | | Inconsistent extended attribute list detected during system validation. **EaErrorOffset** indicates the incorrect entry. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. Not enough parameter bytes were sent. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** is no longer valid. | +| ERRSRV

(0x02) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** supplied is not defined to the session. | +| ERRHRD

(0x03) | ERRnowrite

(0x0013) | STATUS_MEDIA_WRITE_PROTECTED

(0xC00000A2) | EROFS | Attempt to write to a read-only file system. | +| ERRHRD

(0x03) | ERRdata

(0x0017) | STATUS_DATA_ERROR

(0xC000003E) | EIO | Disk I/O error. | + +#### TRANS2_SESSION_SETUP (0x000E) + +This Transaction2 subcommand was introduced in the [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) dialect. This subcommand is reserved but not implemented. + +Clients SHOULD NOT send requests using this command code. Servers receiving requests with this command code SHOULD return STATUS_NOT_IMPLEMENTED (ERRDOS/ERRbadfunc). + +#### TRANS2_GET_DFS_REFERRAL (0x0010) + +This Transaction2 subcommand was introduced in the [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) dialect. + +This transaction subcommand is used to request a referral for a disk object in DFS. + +##### Request + +The TRANS2_GET_DFS_REFERRAL request and response formats are special cases of [SMB_COM_TRANSACTION2 (section 2.2.4.46)](#Section_3d9d8f3edc70410da3fc6f4a881e8cab) [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625). Only the TRANS2_GET_DFS_REFERRAL specifics are described here. + +**SMB_Parameters:** + +**WordCount (1 byte):** This field MUST be 0x0F. + +**Words (30 bytes):** + +**TotalDataCount (2 bytes):** This field MUST be zero (0x0000). + +**Flags (2 bytes):** This field SHOULD be zero (0x0000). + +**Timeout (4 bytes):** This field SHOULD be zero (0x00000000). + +**MaxSetupCount (1 byte):** This field MUST be zero (0x00). + +**MaxParameterCount (4 bytes):** This field MUST be zero (0x00000000). + +**SetupCount (1 byte):** This field MUST be 0x01. + +**Setup (2 bytes):** This field MUST be TRANS2_GET_DFS_REFERRAL (0x0010). + +**Trans2_Parameters:** + +- Trans2_Parameters +- { +- REQ_GET_DFS_REFERRAL ReferralRequest; +- } + +**ReferralRequest (variable): REQ_GET_DFS_REFERRAL** This field MUST be a properly formatted [**DFS referral request**](#gt_04b0cb20-df63-44f7-9855-3ca702d25813), as specified in [\[MS-DFSC\]](%5bMS-DFSC%5d.pdf#Section_3109f4be2dbb42c99b8e0b34f7a2135e) section 2.2.2. + +**Trans2_Data:** No data is sent by this message. + +##### Response + +The TRANS2_GET_DFS_REFERRAL request and response formats are special cases of [SMB_COM_TRANSACTION2 (section 2.2.4.46)](#Section_3d9d8f3edc70410da3fc6f4a881e8cab) [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625). Only the TRANS2_GET_DFS_REFERRAL specifics are described here. + +**SMB_Parameters:** + +**WordCount (1 byte):** This field MUST be 0x0F. + +**Words (30 bytes):** + +**TotalParameterCount (2 bytes):** This field MUST be zero (0x0000). + +**SetupCount (1 byte):** This field MUST be 0x01. + +**Setup (2 bytes):** This field MUST be TRANS2_GET_DFS_REFERRAL (0x0010). + +**Trans2_Parameters:** No parameters are sent by this message. + +**Trans2_Data:** + +- Trans2_Data +- { +- RESP_GET_DFS_REFERRAL ReferralResponse; +- } + +**ReferralResponse: RESP_GET_DFS_REFERRAL** This field MUST be a properly formatted [**DFS referral response**](#gt_2a06d5c0-030e-4b0c-96f0-c707e24130e1), as specified in [\[MS-DFSC\]](%5bMS-DFSC%5d.pdf#Section_3109f4be2dbb42c99b8e0b34f7a2135e) section 2.2.4. + +#### TRANS2_REPORT_DFS_INCONSISTENCY (0x0011) + +This Transaction2 subcommand was introduced in the [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) dialect. This subcommand is reserved but not implemented. + +Clients SHOULD NOT send requests using this command code. Servers receiving requests with this command code SHOULD return STATUS_NOT_IMPLEMENTED (ERRDOS/ERRbadfunc). + +### NT Transact Subcommands + +#### NT_TRANSACT_CREATE (0x0001) + +This NT Transaction subcommand was introduced in the [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) dialect. + +This transaction subcommand is used to create or open a file or directory when extended attributes (EAs) or a [**security descriptor (SD)**](#gt_e5213722-75a9-44e7-b026-8e4833f0d350) need to be applied. + +Parameters and Data for the subcommand are encoded as shown following. The information required in order to perform the create or open operation is passed in the Parameters section of the transaction request. Extended attributes and/or the security descriptors are provided in the Data portion of the transaction request. + +##### Request + +The NT_TRANSACT_CREATE requestFILE_SEQUENTIAL_ONLY format is a special case of [SMB_COM_NT_TRANSACT (section 2.2.4.62)](#Section_55db04d6105f45d184ac6972c0a1ddc8) [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625). The NT_TRANSACT_CREATE request specifics are described here. + +- NT_Trans_Parameters +- { +- ULONG Flags; +- ULONG RootDirectoryFID; +- ULONG DesiredAccess; +- LARGE_INTEGER AllocationSize; +- SMB_EXT_FILE_ATTR ExtFileAttributes; +- ULONG ShareAccess; +- ULONG CreateDisposition; +- ULONG CreateOptions; +- ULONG SecurityDescriptorLength; +- ULONG EALength; +- ULONG NameLength; +- ULONG ImpersonationLevel; +- UCHAR SecurityFlags; +- UCHAR Name\[NameLength\]; +- } +- NT_Trans_Data +- { +- SECURITY_DESCRIPTOR SecurityDescriptor; +- FILE_FULL_EA_INFORMATION ExtendedAttributes\[\]; +- } + +**SMB_Parameters:** + +**WordCount (1 byte):** This field MUST be 0x13. + +**Words (38 bytes): Array of USHORT** + +**Function (2 bytes): USHORT** This field MUST be NT_TRANSACT_CREATE (0x0001). + +**SetupCount (1 byte):** This field MUST be 0x00. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------------ | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| NT_Trans_Parameters (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| NT_Trans_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**NT_Trans_Parameters (variable):** The format of the parameters is very similar to the SMB_COM_NT_CREATE_ANDX command. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------ | --- | --- | --- | --- | --- | --- | --- | --------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Flags | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| RootDirectoryFID | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| DesiredAccess | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| AllocationSize | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ExtFileAttributes | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ShareAccess | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| CreateDisposition | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| CreateOptions | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| SecurityDescriptorLength | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| EALength | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| NameLength | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ImpersonationLevel | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| SecurityFlags | | | | | | | | Name (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Flags (4 bytes):** ULONG A 32-bit field containing a set of flags that modify the client request. Unused bits SHOULD be set to 0 by the client when sending a message and MUST be ignored when received by the server. + +| Name and bitmask | Meaning | +| ------------------------------------------- | --------------------------------------------------- | +| NT_CREATE_REQUEST_OPLOCK

0x00000002 | Level I (exclusive) OpLock requested. | +| NT_CREATE_REQUEST_OPBATCH

0x00000004 | Batch OpLock requested. | +| NT_CREATE_OPEN_TARGET_DIR

0x00000008 | The parent directory of the target is to be opened. | + +**RootDirectoryFID (4 bytes):** ULONG If nonzero, this value is the **FID** of an opened root directory, and the **Name** field MUST be handled as relative to the directory specified by this **FID**. If this value is zero (0x00000000), the **Name** field MUST be handled as relative to the root of the share (the **TID**). The **FID** MUST have been acquired in a previous message exchange. + +**DesiredAccess (4 bytes):** ULONG A 32-bit field containing standard, specific, and generic access rights. These rights are used in access-control entries (ACEs) and are the primary means of specifying the requested or granted access to an object. If this value is 0x00000000, it represents a request to query the attributes without accessing the file. If the value is not 0x00000000, the bits represent requests for the following types of access: + +| Name and bitmask | Meaning | +| ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| FILE_READ_DATA

0x00000001 | Indicates the right to read data from the file. | +| FILE_WRITE_DATA

0x00000002 | Indicates the right to write data into the file beyond the end of the file. | +| FILE_APPEND_DATA

0x00000004 | Indicates the right to append data to the file beyond the end of the file only. | +| FILE_READ_EA

0x00000008 | Indicates the right to read the extended attributes of the file. | +| FILE_WRITE_EA

0x00000010 | Indicates the right to write or change the extended attributes of the file. | +| FILE_EXECUTE

0x00000020 | Indicates the right to execute the file. | +| FILE_READ_ATTRIBUTES

0x00000080 | Indicates the right to read the attributes of the file. | +| FILE_WRITE_ATTRIBUTES

0x00000100 | Indicates the right to change the attributes of the file. | +| DELETE

0x00010000 | Indicates the right to delete or to rename the file. | +| READ_CONTROL

0x00020000 | Indicates the right to read the [**security descriptor**](#gt_e5213722-75a9-44e7-b026-8e4833f0d350) of the file. | +| WRITE_DAC

0x00040000 | Indicates the right to change the [**discretionary access control list (DACL)**](#gt_d727f612-7a45-48e4-9d87-71735d62b321) in the security descriptor of the file. | +| WRITE_OWNER

0x00080000 | Indicates the right to change the owner in the security descriptor of the file. | +| SYNCHRONIZE

0x00100000 | SHOULD NOT be used by the sender and MUST be ignored by the receiver. | +| ACCESS_SYSTEM_SECURITY

0x01000000 | Indicates the right to read or change the [**system access control list (SACL)**](#gt_c189801e-3752-4715-88f4-17804dad5782) in the security descriptor for the file. If the SE_SECURITY_NAME privilege ([\[MS-LSAD\]](%5bMS-LSAD%5d.pdf#Section_1b5471ef4c334a91b079dfcbb82f05cc) section 3.1.1.2.1) is not set in the access token, the server MUST fail the open request and return STATUS_PRIVILEGE_NOT_HELD. | +| MAXIMUM_ALLOWED

0x02000000 | Indicates that the client requests an open to the file with the highest level of access that the client has on this file. If no access is granted for the client on this file, the server MUST fail the open and return a STATUS_ACCESS_DENIED. | +| GENERIC_ALL

0x10000000 | Indicates a request for all of the access flags that are previously listed, except MAXIMUM_ALLOWED and ACCESS_SYSTEM_SECURITY. | +| GENERIC_EXECUTE

0x20000000 | Indicates a request for the following combination of access flags listed previously in this table:

FILE_READ_ATTRIBUTES, FILE_EXECUTE, SYNCHRONIZE, and READ_CONTROL. | +| GENERIC_WRITE

0x40000000 | Indicates a request for the following combination of access flags listed previously in this table:

FILE_WRITE_DATA, FILE_APPEND_DATA, SYNCHRONIZE, FILE_WRITE_ATTRIBUTES, FILE_WRITE_EA, and READ_CONTROL. | +| GENERIC_READ

0x80000000 | Indicates a request for the following combination of access flags listed previously in this table:

FILE_WRITE_DATA, FILE_APPEND_DATA, SYNCHRONIZE, FILE_WRITE_ATTRIBUTES, FILE_WRITE_EA, and READ_CONTROL. | + +**AllocationSize (8 bytes):** LARGE_INTEGER The client MUST set this value to the initial allocation size of the file in bytes. The server MUST ignore this field if this request is to open an existing file. This field MUST be used only if the file is created or overwritten. The value MUST be set to 0x0000000000000000 in all other cases. This does not apply to directory-related requests. This is the number of bytes to be allocated, represented as a 64-bit integer value. + +**ExtFileAttributes (4 bytes):** This field contains the extended file attributes of the file being requested, encoded as an SMB_EXT_FILE_ATTR (section [2.2.1.2.3](#Section_6008aa8fd2d84366b775b81aece05bb1)) data type. + +**ShareAccess (4 bytes):** ULONG A 32-bit field that specifies how the file SHOULD be shared with other processes. The names in the table below are provided for reference use only. The value MUST be FILE_SHARE_NONE or some combination of the other values: + +| Name and bitmask | Meaning | +| ----------------------------------- | --------------------------------------------------------------------- | +| FILE_SHARE_NONE

0x00000000 | (No bits set.)

Prevents the file from being shared. | +| FILE_SHARE_READ

0x00000001 | Other open operations can be performed on the file for read access. | +| FILE_SHARE_WRITE

0x00000002 | Other open operations can be performed on the file for write access. | +| FILE_SHARE_DELETE

0x00000004 | Other open operations can be performed on the file for delete access. | + +**CreateDisposition (4 bytes):** ULONG A 32-bit value that represents the action to take if the file already exists or if the file is a new file and does not already exist. + +| Name and Value | Meaning | +| ----------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| FILE_SUPERSEDE

0x00000000 | (No bits set.)

If the file already exists, it SHOULD be superseded (overwritten). If it does not already exist, it SHOULD be created. | +| FILE_OPEN

0x00000001 | If the file already exists, it SHOULD be opened rather than creating a new file. If the file does not already exist, the operation MUST fail. | +| FILE_CREATE

0x00000002 | If the file already exists, the operation MUST fail. If the file does not already exist, it SHOULD be created. | +| FILE_OPEN_IF

0x00000003 | If the file already exists, it SHOULD be opened. If the file does not already exist, it SHOULD be created. | +| FILE_OVERWRITE

0x00000004 | If the file already exists, it SHOULD be opened and truncated. If the file does not already exist, the operation MUST fail. | +| FILE_OVERWRITE_IF

0x00000005 | If the file already exists, it SHOULD be opened and truncated. If the file does not already exist, it SHOULD be created. | + +**CreateOptions (4 bytes):** ULONG A 32-bit field containing flag options to use if creating the file or directory. This field MUST be set to 0x00000000 or a combination of the following possible values. Unused bit fields SHOULD be set to 0 by the client when sending a request and SHOULD be ignored when received by the server. Below is a list of the valid values and their associated behaviors. + +| Name and bitmask | Meaning | +| ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| FILE_DIRECTORY_FILE

0x00000001 | The file being created or opened is a directory file. With this option, the **CreateDisposition** field MUST be set to FILE_CREATE, FILE_OPEN, or FILE_OPEN_IF. When this bit field is set, other compatible **CreateOptions** include only the following: FILE_WRITE_THROUGH, FILE_OPEN_FOR_BACKUP_INTENT, and FILE_OPEN_BY_FILE_ID. | +| FILE_WRITE_THROUGH

0x00000002 | Applications that write data to the file MUST actually transfer the data into the file before any write request qualifies as semantically complete. If FILE_NO_INTERMEDIATE_BUFFERING is set, the server MUST process the request as if FILE_WRITE_THROUGH is set in the create request, even if not set by the client. | +| FILE_SEQUENTIAL_ONLY

0x00000004 | This option indicates that access to the file MAY be sequential. The server can use this information to influence its caching and read-ahead strategy for this file. The file MAY in fact be accessed randomly, but the server can optimize its caching and read-ahead policy for sequential access. | +| FILE_NO_INTERMEDIATE_BUFFERING

0x00000008 | The file SHOULD NOT be cached or buffered in an internal buffer by the server. This option is incompatible when the FILE_APPEND_DATA bit field is set in the **DesiredAccess** field. | +| FILE_SYNCHRONOUS_IO_ALERT

0x00000010 | This flag MUST be ignored by the server, and clients SHOULD set it to 0. | +| FILE_SYNCHRONOUS_IO_NONALERT

0x00000020 | This flag MUST be ignored by the server, and clients SHOULD set it to 0. | +| FILE_NON_DIRECTORY_FILE

0x00000040 | If the file being opened is a directory, the server MUST fail the request with STATUS_FILE_IS_A_DIRECTORY in the **Status** field of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) in the server response. | +| FILE_CREATE_TREE_CONNECTION

0x00000080 | This option SHOULD NOT be sent by the clients, and this option MUST be ignored by the server. | +| FILE_COMPLETE_IF_OPLOCKED

0x00000100 | This option SHOULD NOT be sent by the clients, and this option MUST be ignored by the server. | +| FILE_NO_EA_KNOWLEDGE

0x00000200 | The application that initiated the client's request does not support extended attributes (EAs). If the EAs on an existing file being opened indicate that the caller SHOULD support EAs to correctly interpret the file, the server SHOULD fail this request with STATUS_ACCESS_DENIED (ERRDOS/ERRnoaccess) in the **Status** field of the SMB Header in the server response. | +| FILE_OPEN_FOR_RECOVERY

0x00000400 | This option SHOULD NOT be sent by the clients, and this option MUST be ignored if received by the server. | +| FILE_RANDOM_ACCESS

0x00000800 | Indicates that access to the file MAY be random. The server MAY use this information to influence its caching and read-ahead strategy for this file. This is a hint to the server that sequential read-ahead operations might not be appropriate on the file. | +| FILE_DELETE_ON_CLOSE

0x00001000 | The file SHOULD be automatically deleted when the last open request on this file is closed. When this option is set, the **DesiredAccess** field MUST include the DELETE flag. This option is often used for temporary files. | +| FILE_OPEN_BY_FILE_ID

0x00002000 | Opens a file based on the FID. If this option is set, the server MUST fail the request with STATUS_NOT_SUPPORTED in the **Status** field of the SMB Header in the server response. | +| FILE_OPEN_FOR_BACKUP_INTENT

0x00004000 | The file is opened or created for the purposes of either a backup or a restore operation. Thus, the server can check to ensure that the caller is capable of overriding whatever security checks have been placed on the file to allow a backup or restore operation to occur. The server can check for access rights to the file before checking the **DesiredAccess** field. | +| FILE_NO_COMPRESSION

0x00008000 | When a new file is created, the file MUST NOT be compressed, even if it is on a compressed volume. The flag MUST be ignored when opening an existing file. | +| FILE_RESERVE_OPFILTER

0x00100000 | This option SHOULD NOT be sent by the clients, and this option MUST be ignored if received by the server. | +| FILE_OPEN_NO_RECALL

0x00400000 | In a hierarchical storage management environment, this option requests that the file SHOULD NOT be recalled from tertiary storage such as tape. A file recall can take up to several minutes in a hierarchical storage management environment. The clients can specify this option to avoid such delays. | +| FILE_OPEN_FOR_FREE_SPACE_QUERY

0x00800000 | This option SHOULD NOT be sent by the clients, and this option MUST be ignored if received by the server. | + +**SecurityDescriptorLength (4 bytes):** ULONG Length of the **NT_Trans_Data.SecurityDescriptor** field, in bytes. + +**EALength (4 bytes):** ULONG Length of the **NT_Trans_Data.ExtendedAttributes** field, in bytes. + +**NameLength (4 bytes):** ULONG Length of the **Name** field in characters. + +**ImpersonationLevel (4 bytes):** ULONG This field specifies the impersonation level requested by the application that is issuing the create request, and MUST contain one of the following values. + +Impersonation is described in [\[MS-WPO\]](%5bMS-WPO%5d.pdf#Section_c5f54a7765be40a0bb829e4181d8ab67) section 8.5.1; for more information about impersonation, see [\[MSDN-IMPERS\]](https://go.microsoft.com/fwlink/?LinkId=106009). + +| Name and value | Meaning | +| --------------------------------- | ---------------------------------------------------------------- | +| SEC_ANONYMOUS

0x00000000 | The application-requested impersonation level is Anonymous. | +| SEC_IDENTIFY

0x00000001 | The application-requested impersonation level is Identification. | +| SEC_IMPERSONATE

0x00000002 | The application-requested impersonation level is Impersonation. | + +**SecurityFlags (1 byte):** UCHAR An 8-bit field containing a set of options that specify the security tracking mode. These options specify whether the server is to be given a snapshot of the client's [**security context**](#gt_88d49f20-6c95-4b64-a52c-c3eca2fe5709) (called static tracking) or is to be continually updated to track changes to the client's security context (called dynamic tracking). When bit 0 of the **SecurityFlags** field is set to 0, static tracking is requested. When bit 0 the **SecurityFlags** field is set to 1, dynamic tracking is requested. Unused bit fields SHOULD be set to 0 by the client when sending a request and MUST be ignored when received by the server. This field MUST be set to 0x00 or a combination of the following possible values. Value names are provided for convenience only. Supported values are: + +| Name and value | Meaning | +| ----------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| SMB_SECURITY_CONTEXT_TRACKING

0x01 | When set, dynamic tracking is requested. When this bit field is not set, static tracking is requested. | +| SMB_SECURITY_EFFECTIVE_ONLY

0x02 | Specifies that only the enabled aspects of the client's security context are available to the server. If this flag is not specified, all aspects of the client's security context are available. This flag allows the client to limit the groups and privileges that a server can use while impersonating the client. | + +**Name (variable):** The name of the file; not null-terminated. If SMB_FLAGS2_UNICODE is set in the **Flags2** field of the SMB Header of the request, this field MUST be an array of 16-bit Unicode characters. Otherwise, it MUST be an array of extended ASCII (OEM) characters. If the **Name** consists of Unicode characters, this field MUST be aligned to start on a 2-byte boundary from the start of the **NT_Trans_Parameters**. + +**NT_Trans_Data (variable):** The NT_Trans_Data provides the Security Descriptor and Extended Attributes data, if any. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SecurityDescriptor (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ExtendedAttributes (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SecurityDescriptor (variable): SECURITY_DESCRIPTOR** The security descriptor to use when requesting access to the file. The self-relative form of a SECURITY_DESCRIPTOR MUST be used. See SECURITY_DESCRIPTOR ([\[MS-DTYP\]](%5bMS-DTYP%5d.pdf#Section_cca2742956894a16b2b49325d93e4ba2) section 2.4.6) for details. This field MUST be **NT_Trans_Parameters.SecurityDescriptorLength** in bytes. + +**ExtendedAttributes (variable):** The extended attributes that SHOULD be applied to the new file MUST be in the format that is specified for **FILE_FULL_EA_INFORMATION** in ([\[MS-FSCC\]](%5bMS-FSCC%5d.pdf#Section_efbfe12773ad41409967ec6500e66d5e) section 2.4.16).[<148>](#Appendix_A_148) + +##### Response + +The NT_TRANSACT_CREATE response format is a special case of [SMB_COM_NT_TRANSACT (section 2.2.4.62)](#Section_55db04d6105f45d184ac6972c0a1ddc8) [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625). The NT_TRANSACT_CREATE response specifics are described here. The outcome of the request is returned in the **Status** field of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f). + +- NT_Trans_Parameters +- { +- UCHAR OpLockLevel; +- UCHAR Reserved; +- USHORT FID; +- ULONG CreateAction; +- ULONG EAErrorOffset; +- FILETIME CreationTime; +- FILETIME LastAccessTime; +- FILETIME LastWriteTime; +- FILETIME LastChangeTime; +- SMB_EXT_FILE_ATTR ExtFileAttributes; +- LARGE_INTEGER AllocationSize; +- LARGE_INTEGER EndOfFile; +- USHORT ResourceType; +- SMB_NMPIPE_STATUS NMPipeStatus; +- UCHAR Directory; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------------ | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| NT_Trans_Parameters (69 bytes) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | + +**NT_Trans_Parameters (69 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------------- | --- | --- | --- | --- | --- | --- | --- | -------- | --- | ---------- | --- | --- | --- | --- | --- | ------------ | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| OpLockLevel | | | | | | | | Reserved | | | | | | | | FID | | | | | | | | | | | | | | | | +| CreateAction | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| EAErrorOffset | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| CreationTime | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| LastAccessTime | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| LastWriteTime | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| LastChangeTime | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ExtFileAttributes | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| AllocationSize | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| EndOfFile | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ResourceType | | | | | | | | | | | | | | | | NMPipeStatus | | | | | | | | | | | | | | | | +| Directory | | | | | | | | + +**OpLockLevel (1 byte):** UCHAR The OpLock level granted to the client process. + +| Value | Meaning | +| ----- | ------------------------- | +| 0x00 | No OpLock granted. | +| 0x01 | Exclusive OpLock granted. | +| 0x02 | Batch OpLock granted. | +| 0x03 | Level II OpLock granted. | + +**Reserved (1 byte):** UCHAR Reserved and MUST be zero (0x00). + +**FID (2 bytes):** USHORT The file ID value representing the file or directory that was created or opened. + +**CreateAction (4 bytes):** ULONG The action taken in establishing the open. This field MUST contain one of the following values: + +| Value | Meaning | +| ---------------------------------- | --------------------------------------------------------------------- | +| FILE_SUPERSEDED

0x00000000 | An existing file was deleted and a new file was created in its place. | +| FILE_OPENED

0x00000001 | An existing file was opened. | +| FILE_CREATED

0x00000002 | A new file was created. | +| FILE_OVERWRITTEN

0x00000003 | An existing file was overwritten. | + +**EAErrorOffset (4 bytes):** ULONG Offset of the extended attribute that caused an error if an error occurred with an extended attribute. + +**CreationTime (8 bytes):** FILETIME A 64-bit integer value representing the time that the file was created. The time value is a signed 64-bit integer representing either an absolute time or a time interval. Times are specified in units of 100ns. A positive value expresses an absolute time, where the base time (the 64- bit integer with value 0) is the beginning of the year 1601 AD in the Gregorian calendar. A negative value expresses a time interval relative to some base time, usually the current time. + +**LastAccessTime (8 bytes):** FILETIME The time that the file was last accessed, encoded in the same format as **CreationTime**. + +**LastWriteTime (8 bytes):** FILETIME The time that the file was last written, encoded in the same format as **CreationTime**. + +**LastChangeTime (8 bytes):** FILETIME The time that the file was last changed, encoded in the same format as **CreationTime**. + +**ExtFileAttributes (4 bytes):** This field contains the extended file attributes the file, encoded as an SMB_EXT_FILE_ATTR (section [2.2.1.2.3](#Section_6008aa8fd2d84366b775b81aece05bb1)) data type. + +**AllocationSize (8 bytes):** LARGE_INTEGER The number of bytes allocated to the file by the server. + +**EndOfFile (8 bytes):** LARGE_INTEGER The end of file offset value. + +**ResourceType (2 bytes):** The file type. This field MUST be interpreted as follows. + +| Name and value | Meaning | +| ------------------------------------- | ----------------------------------------------------------------------- | +| FileTypeDisk

0x0000 | File or directory | +| FileTypeByteModePipe

0x0001 | [**Byte mode**](#gt_8586fe9a-1cfa-458a-a145-8db64d69c69c) named pipe | +| FileTypeMessageModePipe

0x0002 | [**Message mode**](#gt_c49a48e8-f1ac-4568-bc87-0672eb08868b) named pipe | +| FileTypePrinter

0x0003 | Printer device | +| FileTypeUnknown

0xFFFF | Unknown file type | + +**NMPipeStatus (2 bytes):** A 16-bit field that shows the status of the named pipe if the resource type created is a named pipe. This field is formatted as an SMB_NMPIPE_STATUS (section [2.2.1.3](#Section_6911a7095dfb4ffbb0903e8ef872f85c)). + +**Directory (1 byte):** UCHAR If the returned **FID** represents a directory, the server MUST set this value to a nonzero (0x00) value. If the **FID** is not a directory, the server MUST set this value to 0x00 (FALSE). + +**NT_Trans_Data** + +The server does not return any NT_Trans data. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRbadpath

(0x0003) | STATUS_OBJECT_PATH_SYNTAX_BAD

(0xC000003B) | ENOENT | The file path syntax is invalid. | +| ERRDOS

(0x01) | ERRnofids

(0x0004) | STATUS_OS2_TOO_MANY_OPEN_FILES

(0x00040001)

STATUS_TOO_MANY_OPENED_FILES

(0xC000011F) | EMFILE | Too many open files; no more FIDs available. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | EPERM | Access denied. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_FILE_IS_A_DIRECTORY

(0xC00000BA) | EISDIR | Named file is an existing directory and CreateOptions in the request contains FILE_NON_DIRECTORY_FILE. | +| ERRDOS

(0x01) | ERRbadfid

(0x0006) | STATUS_INVALID_HANDLE

(0xC0000008) | EBADF | Invalid **FID**; **RootDirectoryFID** is not valid. | +| ERRDOS

(0x01) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRDOS

(0x01) | ERRbadaccess

(0x000C) | STATUS_ACCESS_DENIED

(0xC0000022) | | Invalid open mode. | +| ERRDOS

(0x01) | ERRbadshare

(0x0020) | STATUS_SHARING_VIOLATION

(0xC0000043) | ETXTBSY | Sharing violation. | +| ERRDOS

(0x01) | ERRgeneral

(0x001F) | STATUS_UNSUCCESSFUL

(0xC0000001)

STATUS_INVALID_EA_NAME

(0x80000013) | | The size of the extended attribute list is not correct. Check the **EAErrorOffset** field for the address of the EA at which the error was detected.

EA name was invalid. | +| ERRDOS

(0x01) | ERRfilexists

(0x0050) | STATUS_OBJECT_NAME_COLLISION

(0xC0000035) | EEXIST | The file already exists. | +| ERRDOS

(0x01) | ERRinvalidparam

(0x0057) | STATUS_INVALID_PARAMETER

(0xC000000D) | | One of the extended attributes had an invalid **Flags** bit value. | +| ERRDOS

(0x01) | ERRbadealist

(0x00FF) | STATUS_OS2_EA_LIST_INCONSISTENT

(0x00FF0001)

STATUS_EA_LIST_INCONSISTENT

(0x80000014) | | Inconsistent extended attribute list. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. Not enough parameter bytes were sent, or the path extends beyond the end of the message. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** is no longer valid. | +| ERRSRV

(0x02) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID**supplied is not defined to the session. | +| ERRSRV

(0x02) | ERRgeneral

(0x001F) | STATUS_INVALID_SECURITY_DESCR

(0xC0000079) | | Invalid security descriptor. | +| ERRHRD

(0x03) | ERRgeneral

(0x001F) | STATUS_INVALID_SECURITY_DESCR

(0xC0000079) | | Invalid security descriptor. | + +#### NT_TRANSACT_IOCTL (0x0002) + +This NT Transaction subcommand was introduced in the [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) dialect. + +This transaction subcommand allows IOCTL and FSCTL functions to be transferred transparently from client to server. This command is useful for sending platform-specific or implementation-specific information to the server.[<149>](#Appendix_A_149) + +##### Request + +The NT_TRANSACT_IOCTL request format is a special case of [SMB_COM_NT_TRANSACT (section 2.2.4.62)](#Section_55db04d6105f45d184ac6972c0a1ddc8) [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625). Only the NT_TRANSACT_IOCTL request specifics are described here. + +- NT_Trans_Parameters +- { +- } +- NT_Trans_Data +- { +- UCHAR Data\[TotalDataCount\]; +- } + +**SMB_Parameters:** + +**WordCount (1 byte):** UCHAR This field MUST be 0x17. + +**Words (46 bytes):** Array of USHORT. + +**TotalParameterCount (2 bytes): USHORT** This field MUST be set to 0x0000. + +**MaxParameterCount (2 bytes): USHORT** This field MUST be set to 0x0000. + +**ParameterCount (2 bytes): USHORT** This field MUST be set to 0x0000. + +**SetupCount (1 byte): UCHAR** This field MUST be 0x04. + +**Function (2 bytes): USHORT** This field MUST be NT_TRANSACT_IOCTL (0x0002). + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------------ | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Setup | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| NT_Trans_Parameters (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| NT_Trans_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Setup (8 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------ | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ------- | --- | --- | --- | ---------- | --- | --- | --- | ------- | --- | --- | --- | --- | --- | ---------- | --- | +| FunctionCode | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| FID | | | | | | | | | | | | | | | | IsFsctl | | | | | | | | IsFlags | | | | | | | | + +**FunctionCode (4 bytes):** ULONG The control code of the [**file system control**](#gt_4ffb96a7-5fad-488e-9438-b7707d2e4226) or device control (FSCTL/IOCTL) method. The values are defined in [\[MS-FSCC\]](%5bMS-FSCC%5d.pdf#Section_efbfe12773ad41409967ec6500e66d5e) section 2.3. + +**FID (2 bytes):** USHORT MUST contain a valid **FID** obtained from a previously successful SMB open command. The **FID** MUST be for either an I/O device or for a file system control device. The type of **FID** being supplied is specified by **IsFsctl**. + +**IsFsctl (1 byte):** BOOLEAN This field is TRUE if the command is a file system control command and the **FID** is a file system control device. Otherwise, the command is a device control command and **FID** is an I/O device. + +**IsFlags (1 byte):** BOOLEAN If bit 0 is set, the command is to be applied to a share root handle. The share MUST be a [**Distributed File System (DFS)**](#gt_0b8086c9-d025-45b8-bf09-6b5eca72713e) type. + +**NT_Trans_Parameters (variable):** (0 bytes): No NT_Trans parameters are sent in this request. + +**NT_Trans_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Data (variable):** The raw bytes that are passed to the **fsctl** or **ioctl** function as the input buffer. + +##### Response + +The NT_TRANSACT_IOCTL response formats are special cases of [SMB_COM_NT_TRANSACT (section 2.2.4.62)](#Section_55db04d6105f45d184ac6972c0a1ddc8) [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625). Only the NT_TRANSACT_IOCTL response specifics are described here. The outcome of the request is encoded in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f). + +- NT_Trans_Data +- { +- UCHAR Data\[TotalDataCount\]; +- } + +**SMB_Parameters:** + +**WordCount (1 byte): UCHAR** This field MUST be 0x13. + +**Words (38 bytes): Array of USHORT** + +**SetupWordCount (1 byte): UCHAR** Count of setup words. The value is 0x01. + +**SetupWords (2 bytes): USHORT** The size of the transaction data, in bytes, returned by the server for the file system control command. The client MUST ignore this field value. + +**DataCount (2 bytes): USHORT** Count of data bytes returned by either an I/O device or a file system control command. + +**NT_Trans_Parameters:** The server does not return any NT_Trans parameters. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------ | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| NT_Trans_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**NT_Trans_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Data (variable):** Results returned by either an I/O device or a file system control command. The results are the raw bytes returned from the command if the command was successful. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ------------------------------- | -------------------------------------------------- | ---------------- | --------------------------------------------------- | +| ERRDOS

(0x01) | ERRbadfid

(0x0006) | STATUS_INVALID_HANDLE

(0xC0000008) | EBADF | The **FID** is invalid. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | EPERM | Access denied. | +| ERRDOS

(0x01) | ERRinvalidparam

(0x0057) | STATUS_INVALID_PARAMETER

(0xC000000D) | | A parameter is invalid. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. Not enough parameter bytes were sent. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** is no longer valid. | +| ERRSRV

(0x02) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** supplied is not defined to the session. | +| ERRHRD

(0x03) | ERRdata

(0x0017) | STATUS_DATA_ERROR

(0xC000003E) | EIO | Disk I/O error. | + +#### NT_TRANSACT_SET_SECURITY_DESC (0x0003) + +This NT Transaction subcommand was introduced in the [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) dialect. + +This transaction subcommand allows a client to set the [**security descriptors**](#gt_e5213722-75a9-44e7-b026-8e4833f0d350) for a file.[<150>](#Appendix_A_150) The client MUST provide the [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) of the file for which the security descriptors are to be set. The server MUST set the security descriptor for the file referred to in FID. The security descriptor is provided in the **Data** portion of the transaction request. + +##### Request + +The NT_TRANSACT_SET_SECURITY_DESC request format is a special case of [SMB_COM_NT_TRANSACT (section 2.2.4.62)](#Section_55db04d6105f45d184ac6972c0a1ddc8) [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625). Only the NT_TRANSACT_SET_SECURITY_DESC request specifics are described here. + +- NT_Trans_Parameters +- { +- USHORT FID; +- USHORT Reserved; +- ULONG SecurityInformation; +- } +- NT_Trans_Data +- { +- SECURITY_DESCRIPTOR SecurityDescriptor (variable); +- } + +**SMB_Parameters:** + +**WordCount (1 byte): UCHAR** This field MUST be 0x13. + +**Words (38 bytes): Array of USHORT** + +**Function (2 bytes): USHORT** This field MUST be NT_TRANSACT_SET_SECURITY_DESC (0x0003). + +**MaxSetupCount (1 byte):** This field MUST be 0x00. + +**MaxDataCount (4 bytes):** This field MUST be 0x00000000. + +**MaxParameterCount (4 bytes):** This field MUST be 0x00000000. + +**SetupCount (1 byte): UCHAR** This field MUST be 0x00. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------ | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| NT_Trans_Parameters | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| NT_Trans_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**NT_Trans_Parameters (8 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | -------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| FID | | | | | | | | | | | | | | | | Reserved | | | | | | | | | | | | | | | | +| SecurityInformation | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**FID (2 bytes):** USHORT File identifier or handle of the target file. + +**Reserved (2 bytes):** USHORT Reserved. This value MUST be 0x0000. + +**SecurityInformation (4 bytes):** ULONG Fields of [**security descriptor**](#gt_e5213722-75a9-44e7-b026-8e4833f0d350) to be set. This is a bit field. These values can be logically OR-ed together to set several descriptors in one request. The server MUST set only the descriptors requested by **SecurityInformation**. + +| Name and bitmask | Meaning | +| -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | +| OWNER_SECURITY_INFORMATION

0x00000001 | Owner of the object or resource. | +| GROUP_SECURITY_INFORMATION

0x00000002 | Group associated with the object or resource. | +| DACL_SECURITY_INFORMATION

0x00000004 | [**Discretionary access control list (DACL)**](#gt_d727f612-7a45-48e4-9d87-71735d62b321) associated with the object or resource. | +| SACL_SECURITY_INFORMATION

0x00000008 | [**System access control list (SACL)**](#gt_c189801e-3752-4715-88f4-17804dad5782) associated with the object or resource. | + +**NT_Trans_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SecurityDescriptor (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SecurityDescriptor (variable):** SECURITY_DESCRIPTOR The requested security descriptor structure. The self-relative form of a SECURITY_DESCRIPTOR is required. For details, see [\[MS-DTYP\]](%5bMS-DTYP%5d.pdf#Section_cca2742956894a16b2b49325d93e4ba2) SECURITY_DESCRIPTOR (section 2.4.6). + +##### Response + +The NT_TRANSACT_SET_SECURITY_DESC response format is a special case of [SMB_COM_NT_TRANSACT (section 2.2.4.62)](#Section_55db04d6105f45d184ac6972c0a1ddc8) [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625). Only the NT_TRANSACT_SET_SECURITY_DESC response specifics are described here. The outcome of the request is encoded in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f). + +**NT_Trans_Parameters:** The server does not return any NT_Trans parameters. + +**NT_Trans_Data:** The server does not return any NT_Trans data. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ------------------------------- | --------------------------------------------------------------------------------------- | ---------------- | ---------------------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRbadfid

(0x0006) | STATUS_INVALID_HANDLE

(0xC0000008)

STATUS_SMB_BAD_FID

(0x00060001) | EBADF | The **FID** is invalid. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | EPERM | Access denied. | +| ERRDOS

(0x01) | ERRinvalidparam

(0x0057) | STATUS_INVALID_PARAMETER

(0xC000000D) | | A parameter is invalid. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. Not enough parameter bytes were sent. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** is no longer valid. | +| ERRSRV

(0x02) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** supplied is not defined to the session. | +| ERRHRD

(0x03) | ERRdata

(0x0017) | STATUS_DATA_ERROR

(0xC000003E) | EIO | Disk I/O error. | +| ERRHRD

(0x03) | ERRgeneral

(0x001F) | STATUS_INVALID_SECURITY_DESCR

(0xC0000079) | | Invalid [**security descriptor**](#gt_e5213722-75a9-44e7-b026-8e4833f0d350). | + +#### NT_TRANSACT_NOTIFY_CHANGE (0x0004) + +This NT Transaction subcommand was introduced in the [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) dialect. + +This command notifies the client when the directory, specified by [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766), is modified. It also returns the names of all file system objects that changed, and the ways in which they were modified. The command completes once the directory has been modified based on the supplied **CompletionFilter**. The command is a "single shot" and therefore needs to be reissued to watch for more directory changes. + +The **TotalParameterCount** field of the server response indicates the number of bytes that are being returned. If too many files (that is, more entries than will fit in the response buffer) have changed since the last time that the command was issued, then zero bytes are returned and STATUS_NOTIFY_ENUM_DIR (ERRDOS/ERROR_NOTIFY_ENUM_DIR) is returned in the **Status** field of the server response header. + +A directory file MUST be opened before this command can be used. After the directory is open, this command is used to watch files and subdirectories in the specified directory for changes. When the command is issued, the server creates a buffer that is used to collect directory changes between NT_TRANSACT_NOTIFY_CHANGE calls. The **SMB_Parameters.Words.MaxParameterCount** field in the [SMB_COM_NT_TRANSACT Request (section 2.2.4.62.1)](#Section_1e62725cbb9e470499a48db520a6f2da) determines the size of the buffer that the server uses to store directory change information. + +##### Request + +The NT_TRANSACT_NOTIFY_CHANGE request and response formats are special cases of [SMB_COM_NT_TRANSACT (section 2.2.4.62)](#Section_55db04d6105f45d184ac6972c0a1ddc8) [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625). Only the NT_TRANSACT_NOTIFY_CHANGE request specifics are described here. + +- Setup +- { +- ULONG CompletionFilter; +- USHORT FID; +- BOOLEAN WatchTree; +- UCHAR Reserved; +- } + +**SMB_Parameters:** + +**WordCount (1 byte):** This field MUST be 0x17. + +**Words (46 bytes):** Array of USHORT. + +**MaxSetupCount (1 byte):** This field MUST be 0x00. + +**MaxDataCount (4 bytes):** This field MUST be 0x00000000. + +**Function (2 bytes):** This field MUST be NT_TRANSACT_NOTIFY_CHANGE (0x0004). + +**SetupCount (1 byte):** This field MUST be 04, indicating that 4 words (8 bytes) are used for Setup information. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Setup | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Setup (8 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ---------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --------- | --- | --- | --- | ---------- | --- | --- | --- | -------- | --- | --- | --- | --- | --- | ---------- | --- | +| CompletionFilter | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| FID | | | | | | | | | | | | | | | | WatchTree | | | | | | | | Reserved | | | | | | | | + +**CompletionFilter (4 bytes):** A 32-bit field of flags that specify the types of operations to monitor. + +| Name | Value | +| ------------------------------- | ---------- | +| FILE_NOTIFY_CHANGE_FILE_NAME | 0x00000001 | +| FILE_NOTIFY_CHANGE_DIR_NAME | 0x00000002 | +| FILE_NOTIFY_CHANGE_NAME | 0x00000003 | +| FILE_NOTIFY_CHANGE_ATTRIBUTES | 0x00000004 | +| FILE_NOTIFY_CHANGE_SIZE | 0x00000008 | +| FILE_NOTIFY_CHANGE_LAST_WRITE | 0x00000010 | +| FILE_NOTIFY_CHANGE_LAST_ACCESS | 0x00000020 | +| FILE_NOTIFY_CHANGE_CREATION | 0x00000040 | +| FILE_NOTIFY_CHANGE_EA | 0x00000080 | +| FILE_NOTIFY_CHANGE_SECURITY | 0x00000100 | +| FILE_NOTIFY_CHANGE_STREAM_NAME | 0x00000200 | +| FILE_NOTIFY_CHANGE_STREAM_SIZE | 0x00000400 | +| FILE_NOTIFY_CHANGE_STREAM_WRITE | 0x00000800 | + +**FID (2 bytes):** The **FID** of the directory to monitor. + +**WatchTree (1 byte):** If all subdirectories are to be watched, then this field MUST be set to TRUE; otherwise, it MUST be set to FALSE. + +**Reserved (1 byte):** Reserved. This value MUST be 0x00. + +**NT_Trans_Parameters** + +The client does not provide any NT_Trans_Parameters in the request. + +**NT_Trans_Data** + +The client does not provide any NT_Trans_Data in the request. + +##### Response + +- NT_Trans_Parameters +- { +- FILE_NOTIFY_INFORMATION FileNotifyInformation\[\]; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------------ | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| NT_Trans_Parameters (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**NT_Trans_Parameters (variable):** + +**FileNotifyInformation:** An array of FILE_NOTIFY_INFORMATION structures, as specified in [\[MS-FSCC\]](%5bMS-FSCC%5d.pdf#Section_efbfe12773ad41409967ec6500e66d5e) section 2.4.35.[<151>](#Appendix_A_151) + +**NT_Trans_Data** + +The server does not return any data. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ----------------------------------- | -------------------------------------------------- | ---------------- | -------------------------------------------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRbadfid

(0x0006) | STATUS_INVALID_HANDLE

(0xC0000008) | EBADF | The **FID** is invalid. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | EPERM | Access denied. | +| ERRDOS

(0x01) | ERRinvalidparam

(0x0057) | STATUS_INVALID_PARAMETER

(0xC000000D) | | A parameter is invalid. | +| ERRSRV

(0x02) | ERR_NOTIFY_ENUM_DIR

(0x03FE) | STATUS_NOTIFY_ENUM_DIR

(0x0000010C) | | The number of bytes of changed data exceeds the **MaxParameterCount** field in the client request. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. Byte count and sizes are inconsistent. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** is no longer valid. | +| ERRSRV

(0x02) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** supplied is not defined to the session. | +| ERRHRD

(0x03) | ERRdata

(0x0017) | STATUS_DATA_ERROR

(0xC000003E) | EIO | Disk I/O error. | + +#### NT_TRANSACT_RENAME (0x0005) + +This is NT Transaction subcommand was introduced in the [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) dialect. This subcommand was **reserved but not implemented**. + +Clients SHOULD NOT send requests using this subcommand code. Servers receiving requests with this subcommand code MUST return STATUS_SMB_BAD_COMMAND (ERRSRV/ERRbadcmd). + +#### NT_TRANSACT_QUERY_SECURITY_DESC (0x0006) + +This NT Transaction subcommand was introduced in the [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) dialect. + +This transaction subcommand allows a client to retrieve the [**security descriptor**](#gt_e5213722-75a9-44e7-b026-8e4833f0d350) for a file.[<152>](#Appendix_A_152) The client MUST provide the [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) of the file that is the target of the query. The server MUST query the security descriptor from the file system for the file referred to in FID. The security descriptor is returned in the NT_Trans_Data portion of the transaction response. + +##### Request + +The NT_TRANSACT_QUERY_SECURITY_DESC request format is a special case of [SMB_COM_NT_TRANSACT (section 2.2.4.62)](#Section_55db04d6105f45d184ac6972c0a1ddc8) [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625). Only the NT_TRANSACT_QUERY_SECURITY_DESC request specifics are described here. + +- NT_Trans_Parameters +- { +- USHORT FID; +- USHORT Reserved; +- ULONG SecurityInfoFields; +- } + +**SMB_Parameters:** + +**WordCount (1 byte): UCHAR** This field MUST be 0x13. + +**Words (38 bytes):** Array of USHORT. + +**MaxSetupCount (1 byte):** This field MUST be 0x00. + +**MaxParameterCount (4 bytes):** This field MUST be 0x00000004. + +**Function (2 bytes): USHORT** This field MUST be NT_TRANSACT_QUERY_SECURITY_DESC (0x0006). + +**SetupCount (1 byte): UCHAR** This field MUST be 0x00. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| NT_Trans_Parameters | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**NT_Trans_Parameters (8 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------ | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | -------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| FID | | | | | | | | | | | | | | | | Reserved | | | | | | | | | | | | | | | | +| SecurityInfoFields | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**FID (2 bytes):** USHORT **FID** of the target file. The FID MUST have been obtained through a previously successful SMB open request. + +**Reserved (2 bytes):** USHORT Reserved. This value MUST be 0x0000. + +**SecurityInfoFields (4 bytes):** ULONG A 32-bit field representing the requested fields of the [**security descriptor**](#gt_e5213722-75a9-44e7-b026-8e4833f0d350) to be retrieved. These values can be logically OR-ed together to request several descriptors in one request. The descriptor response format contains storage for all of the descriptors. The client MUST ignore the values returned for descriptors corresponding to bits that were not included in this field as part of the request. + +| Name and bitmask | Meaning | +| -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | +| OWNER_SECURITY_INFORMATION

0x00000001 | Owner of the object or resource. | +| GROUP_SECURITY_INFORMATION

0x00000002 | Group associated with the object or resource. | +| DACL_SECURITY_INFORMATION

0x00000004 | [**Discretionary access control list (DACL)**](#gt_d727f612-7a45-48e4-9d87-71735d62b321) associated with the object or resource. | +| SACL_SECURITY_INFORMATION

0x00000008 | [**System access control list (SACL)**](#gt_c189801e-3752-4715-88f4-17804dad5782) associated with the object or resource. | + +**NT_Trans_Data** + +The client does not provide any data in the request. + +##### Response + +The [NT_TRANSACT_QUERY_SECURITY_DESC (section 2.2.7.6)](#Section_a4cb863952e14115b2f10c3b179a0479) response format is a special case of [SMB_COM_NT_TRANSACT (section 2.2.4.62)](#Section_55db04d6105f45d184ac6972c0a1ddc8) [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625). Only the NT_TRANSACT_QUERY_SECURITY_DESC response format specifics are described here. + +- NT_Trans_Parameters +- { +- ULONG LengthNeeded; +- } + +- NT_Trans_Data +- { +- SECURITY_DESCRIPTOR SecurityDescriptor (variable); +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------ | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| NT_Trans_Parameters | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| NT_Trans_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**NT_Trans_Parameters (4 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------ | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| LengthNeeded | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**LengthNeeded (4 bytes):** The length of the returned **SecurityDescriptor** field. + +**NT_Trans_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SecurityDescriptor (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SecurityDescriptor (variable):** The requested [**security descriptor**](#gt_e5213722-75a9-44e7-b026-8e4833f0d350) structure. The self-relative form of a **SECURITY_DESCRIPTOR** structure is returned. For details, see **SECURITY_DESCRIPTOR** ([\[MS-DTYP\]](%5bMS-DTYP%5d.pdf#Section_cca2742956894a16b2b49325d93e4ba2) section 2.4.6). + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| -------------------- | ------------------------------- | -------------------------------------------------- | ---------------- | -------------------------------------------------------------------------------------------------- | +| ERRDOS

(0x01) | ERRbadfid

(0x0006) | STATUS_INVALID_HANDLE

(0xC0000008) | EBADF | The **FID** is invalid. | +| ERRDOS

(0x01) | ERRnoaccess

(0x0005) | STATUS_ACCESS_DENIED

(0xC0000022) | EPERM | Access denied. | +| ERRDOS

(0x01) | ERRinvalidparam

(0x0057) | STATUS_INVALID_PARAMETER

(0xC000000D) | | A parameter is invalid. | +| ERRSRV

(0x02) | ERRerror

(0x0001) | STATUS_INVALID_SMB

(0x00010002) | | Invalid SMB. Byte count and sizes are inconsistent. | +| ERRSRV

(0x02) | ERRinvtid

(0x0005) | STATUS_SMB_BAD_TID

(0x00050002) | | The **TID** is no longer valid. | +| ERRSRV

(0x02) | ERRnomem

(0x0008) | STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRSRV

(0x02) | ERRbaduid

(0x005B) | STATUS_SMB_BAD_UID

(0x005B0002) | | The **UID** supplied is not defined to the session. | +| ERRSRV

(0x02) | ERRmoredata

(0x00EA) | STATUS_BUFFER_OVERFLOW

(0x80000005) | | The number of bytes of changed data exceeds the **MaxParameterCount** field in the client request. | +| ERRHRD

(0x03) | ERRdata

(0x0017) | STATUS_DATA_ERROR

(0xC000003E) | EIO | Disk I/O error. | + +### Information Levels + +The client MUST map the application-provided [\[MS-FSCC\]](%5bMS-FSCC%5d.pdf#Section_efbfe12773ad41409967ec6500e66d5e) information levels to SMB information levels as specified in the following tables. For all other \[MS-FSCC\] information levels, the client MUST fail the request with STATUS_NOT_SUPPORTED. + +**FIND Information Levels** + +| FSCC Level | SMB Level | +| --------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| FileDirectoryInformation (\[MS-FSCC\] section 2.4.10) | [SMB_FIND_FILE_DIRECTORY_INFO (section 2.2.8.1.4)](#Section_8be9119ab37e4ff5bee73d7a5997dc88) | +| FileFullDirectoryInformation (\[MS-FSCC\] section 2.4.15) | [SMB_FIND_FILE_FULL_DIRECTORY_INFO (section 2.2.8.1.5)](#Section_64bd690ed3a4458896ef0cb90b065d08) | +| FileNamesInformation (\[MS-FSCC\] section 2.4.33) | [SMB_FIND_FILE_NAMES_INFO (section 2.2.8.1.6)](#Section_88b9968ba36f482abb30c7a51a3e290d) | +| FileBothDirectoryInformation (\[MS-FSCC\] section 2.4.8) | [SMB_FIND_FILE_BOTH_DIRECTORY_INFO (section 2.2.8.1.7)](#Section_2aa849f41bc042bf9c8fd09f11fccc4c) | + +**QUERY_FS Information Levels** + +| FSCC Level | SMB Level | +| ------------------------------------------------------ | -------------------------------------------------------------------------------------------- | +| FileFsVolumeInformation (\[MS-FSCC\] section 2.5.9) | [SMB_QUERY_FS_VOLUME_INFO (section 2.2.8.2.3)](#Section_879f3ae2b0294b3b8043c830fc517b28) | +| FileFsSizeInformation (\[MS-FSCC\] section 2.5.8) | [SMB_QUERY_FS_SIZE_INFO (section 2.2.8.2.4)](#Section_3045d7df775747259ffd20227978cc46) | +| FileFsDeviceInformation (\[MS-FSCC\] section 2.5.10) | [SMB_QUERY_FS_DEVICE_INFO (section 2.2.8.2.5)](#Section_d7ea6e1a65264230b566e9588c7498f1) | +| FileFsAttributeInformation (\[MS-FSCC\] section 2.5.1) | [SMB_QUERY_FS_ATTRIBUTE_INFO (section 2.2.8.2.6)](#Section_1011206a55c54dbfaff0119514136940) | + +**QUERY Information Levels** + +| FSCC Level | SMB Level | +| -------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| FileBasicInformation (\[MS-FSCC\] section 2.4.7) | [SMB_QUERY_FILE_BASIC_INFO (section 2.2.8.3.6)](#Section_3da7df7543ba4498a6b3a68ba57ec922) | +| FileStandardInformation (\[MS-FSCC\] section 2.4.47) | [SMB_QUERY_FILE_STANDARD_INFO (section 2.2.8.3.7)](#Section_3bdd080cf8a44a09acf10f8bd00152e4) | +| FileEaInformation (\[MS-FSCC\] section 2.4.13) | [SMB_QUERY_FILE_EA_INFO (section 2.2.8.3.8)](#Section_3e85d60e696a4436875784233d9f0245) | +| FileNameInformation (\[MS-FSCC\] section 2.4.32) | [SMB_QUERY_FILE_NAME_INFO (section 2.2.8.3.9)](#Section_0cdd9e53bc924f268b22ed11fc06a6d7) | +| FileAllInformation (\[MS-FSCC\] section 2.4.2) | [SMB_QUERY_FILE_ALL_INFO (section 2.2.8.3.10)](#Section_162baf4542014b07a397060e868599d7) | +| FileAlternateNameInformation (\[MS-FSCC\] section 2.4.5) | [SMB_QUERY_FILE_ALT_NAME_INFO (section 2.2.8.3.11)](#Section_3edd12e7f4074b469465c6ed20e24c1a) | +| FileStreamInformation (\[MS-FSCC\] section 2.4.49) | [SMB_QUERY_FILE_STREAM_INFO (section 2.2.8.3.12)](#Section_23f37dcd5b5043d491cdffab868fd65e) | +| FileCompressionInformation (\[MS-FSCC\] section 2.4.9) | [SMB_QUERY_FILE_COMPRESSION_INFO (section 2.2.8.3.13)](#Section_1211daed3d9342aebf22c8554d7bbe97) | + +**SET Information Levels** + +| FSCC Level | SMB Level | +| ------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| FileBasicInformation (\[MS-FSCC\] section 2.4.7) | [SMB_SET_FILE_BASIC_INFO (section 2.2.8.4.3)](#Section_021549daef784282ae937ae93acaba97) | +| FileDispositionInformation (\[MS-FSCC\] section 2.4.11) | [SMB_SET_FILE_DISPOSITION_INFO (section 2.2.8.4.4)](#Section_bb8e952bd2934fc3bc4767ce1a8f8655) | +| FileAllocationInformation (\[MS-FSCC\] section 2.4.4) | [SMB_SET_FILE_ALLOCATION_INFO (section 2.2.8.4.5)](#Section_d362c412dcd0463d93e43e09aa8cacc5) | +| FileEndOfFileInformation (\[MS-FSCC\] section 2.4.14) | [SMB_SET_FILE_END_OF_FILE_INFO (section 2.2.8.4.6)](#Section_4735b3d3cb3b4c9db11c482d7bc48722) | + +#### FIND Information Levels + +##### SMB_INFO_STANDARD + +This information level structure is used in [TRANS2_FIND_FIRST2 (section 2.2.6.2)](#Section_a782468b56f14066bb6ee2630f0e8695) and [TRANS2_FIND_NEXT2 (section 2.2.6.3)](#Section_8f2e9ab5a6be4540a8fdf62492b34d24) responses to return the following information for all files that match the request's search criteria: + +- Creation, access, and last write timestamps +- File size +- File attributes +- File name + +- SMB_INFO_STANDARD\[SearchCount\] +- { +- ULONG ResumeKey (optional); +- SMB_DATE CreationDate; +- SMB_TIME CreationTime; +- SMB_DATE LastAccessDate; +- SMB_TIME LastAccessTime; +- SMB_DATE LastWriteDate; +- SMB_TIME LastWriteTime; +- ULONG FileDataSize; +- ULONG AllocationSize; +- SMB_FILE_ATTRIBUTES Attributes; +- UCHAR FileNameLength; +- SMB_STRING FileName; +- } + +**ResumeKey: (4 bytes):** This field is optional. If the SMB_FIND_RETURN_RESUME_KEYS bit is set in the **Flags** field of the [TRANS2_FIND_FIRST2 Request (section 2.2.6.2.1)](#Section_b2b2a73094994f05884ed5bb7b9caf90) parameters, this field MUST contain the server-generated resume key. The resume key MUST be supplied in subsequent [TRANS2_FIND_NEXT2 Requests](#Section_80dc980efe03455cada67c5dd6c551ba) to continue the search. If the SMB_FIND_RETURN_RESUME_KEYS bit is not set, then the server MUST NOT include this field. + +**CreationDate: (2 bytes):** This field contains the date when the file was created. + +**CreationTime: (2 bytes):** This field contains the time when the file was created. + +**LastAccessDate: (2 bytes):** This field contains the date when the file was last accessed. + +**LastAccessTime: (2 bytes):** This field contains the time when the file was last accessed. + +**LastWriteDate: (2 bytes):** This field contains the date when data was last written to the file. + +**LastWriteTime: (2 bytes):** This field contains the time when data was last written to the file. + +**FileDataSize: (4 bytes):** This field contains the file size, in filesystem allocation units. + +**AllocationSize: (4 bytes):** This field contains the size of the filesystem allocation unit, in bytes. + +**Attributes: (2 bytes):** This field contains the file attributes. + +**FileNameLength: (1 byte):** This field contains the length of the **FileName** field, in bytes. + +**FileName: (variable):** This field contains the name of the file.[<153>](#Appendix_A_153) + +##### SMB_INFO_QUERY_EA_SIZE + +This information level structure is used in [TRANS2_FIND_FIRST2 (section 2.2.6.2)](#Section_a782468b56f14066bb6ee2630f0e8695) and [TRANS2_FIND_NEXT2 (section 2.2.6.3)](#Section_8f2e9ab5a6be4540a8fdf62492b34d24) responses to return the SMB_INFO_STANDARD data along with the size of a file's extended attributes (EAs) list for all files that match the request's search criteria. + +- SMB_INFO_QUERY_EA_SIZE\[SearchCount\] +- { +- ULONG ResumeKey (optional); +- SMB_DATE CreationDate; +- SMB_TIME CreationTime; +- SMB_DATE LastAccessDate; +- SMB_TIME LastAccessTime; +- SMB_DATE LastWriteDate; +- SMB_TIME LastWriteTime; +- ULONG FileDataSize; +- ULONG AllocationSize; +- SMB_FILE_ATTRIBUTES Attributes; +- ULONG EaSize; +- UCHAR FileNameLength; +- UCHAR FileName\[\]; +- } + +**ResumeKey: (4 bytes):** This field is optional. If the SMB_FIND_RETURN_RESUME_KEYS bit is set in the **Flags** field of the [TRANS2_FIND_FIRST2 Request (section 2.2.6.2.1)](#Section_b2b2a73094994f05884ed5bb7b9caf90) parameters, then this field MUST contain the server-generated resume key. The resume key MUST be supplied in subsequent [TRANS2_FIND_NEXT2 Requests (section 2.2.6.3.1)](#Section_80dc980efe03455cada67c5dd6c551ba) to continue the search. If the SMB_FIND_RETURN_RESUME_KEYS bit is not set, then the server MUST NOT include this field. + +**CreationDate: (2 bytes):** This field contains the date when the file was created. + +**CreationTime: (2 bytes):** This field contains the time when the file was created. + +**LastAccessDate: (2 bytes):** This field contains the date when the file was last accessed. + +**LastAccessTime: (2 bytes):** This field contains the time when the file was last accessed. + +**LastWriteDate: (2 bytes):** This field contains the date when data was last written to the file. + +**LastWriteTime: (2 bytes):** This field contains the time when data was last written to the file. + +**FileDataSize: (4 bytes):** This field contains the file size, in filesystem allocation units. + +**AllocationSize: (4 bytes):** This field contains the size of the filesystem allocation unit, in bytes. + +**Attributes: (2 bytes):** This field contains the file attributes. + +**EaSize: (4 bytes):** This field contains the size of the file's extended attribute (EA) information, in bytes. + +**FileNameLength: (1 byte):** This field contains the length of the **FileName** field, in bytes. + +**FileName: (variable):** This field contains the name of the file.[<154>](#Appendix_A_154) + +##### SMB_INFO_QUERY_EAS_FROM_LIST + +This information level structure is used in [TRANS2_FIND_FIRST2 (section 2.2.6.2)](#Section_a782468b56f14066bb6ee2630f0e8695) and [TRANS2_FIND_NEXT2 (section 2.2.6.3)](#Section_8f2e9ab5a6be4540a8fdf62492b34d24) responses to return the SMB_INFO_QUERY_EA_SIZE data along with a specific list of EAs for all files that match the request's search criteria. The requested EAs are provided in the **Trans2_Data** block of the request. + +- SMB_INFO_QUERY_EAS_FROM_LIST\[SearchCount\] +- { +- ULONG ResumeKey (optional); +- SMB_DATE CreationDate; +- SMB_TIME CreationTime; +- SMB_DATE LastAccessDate; +- SMB_TIME LastAccessTime; +- SMB_DATE LastWriteDate; +- SMB_TIME LastWriteTime; +- ULONG FileDataSize; +- ULONG AllocationSize; +- SMB_FILE_ATTRIBUTES Attributes; +- SMB_FEA_LIST ExtendedAttributeList; +- UCHAR FileNameLength; +- UCHAR FileName\[\]; +- } + +**ResumeKey: (4 bytes):** This field is optional. If the SMB_FIND_RETURN_RESUME_KEYS bit is set in the **Flags** field of the [TRANS2_FIND_FIRST2 Request (section 2.2.6.2.1)](#Section_b2b2a73094994f05884ed5bb7b9caf90) parameters, this field MUST contain the server-generated resume key. The resume key MUST be supplied in subsequent [TRANS2_FIND_NEXT2 Requests (section 2.2.6.3.1)](#Section_80dc980efe03455cada67c5dd6c551ba) to continue the search. If the SMB_FIND_RETURN_RESUME_KEYS bit is not set, the server MUST NOT include this field. + +**CreationDate: (2 bytes):** This field contains the date when the file was created. + +**CreationTime: (2 bytes):** This field contains the time when the file was created. + +**LastAccessDate: (2 bytes):** This field contains the date when the file was last accessed. + +**LastAccessTime: (2 bytes):** This field contains the time when the file was last accessed. + +**LastWriteDate: (2 bytes):** This field contains the date when data was last written to the file. + +**LastWriteTime: (2 bytes):** This field contains the time when data was last written to the file. + +**FileDataSize: (4 bytes):** This field contains the file size, in filesystem allocation units. + +**AllocationSize: (4 bytes):** This field contains the size of the filesystem allocation unit, in bytes. + +**Attributes: (2 bytes):** This field contains the file attributes. + +**ExtendedAttributeList: (variable):** A list of all of the extended attribute (EA) name/value pairs assigned to the file. + +**FileNameLength: (1 byte):** This field contains the length of the **FileName** field, in bytes.[<155>](#Appendix_A_155) + +**FileName: (variable):** This field contains the name of the file.[<156>](#Appendix_A_156) + +##### SMB_FIND_FILE_DIRECTORY_INFO + +This information level structure is used in [TRANS2_FIND_FIRST2 (section 2.2.6.2)](#Section_a782468b56f14066bb6ee2630f0e8695) and [TRANS2_FIND_NEXT2 (section 2.2.6.3)](#Section_8f2e9ab5a6be4540a8fdf62492b34d24) responses to return the following information for all files that match the request's search criteria: + +- 64-bit versions of creation, access, and last write timestamps +- 64-bit version of file size +- Extended file attributes +- File name + +- SMB_FIND_FILE_DIRECTORY_INFO\[SearchCount\] +- { +- ULONG NextEntryOffset; +- ULONG FileIndex; +- FILETIME CreationTime; +- FILETIME LastAccessTime; +- FILETIME LastWriteTime; +- FILETIME LastAttrChangeTime; +- LARGE_INTEGER EndOfFile; +- LARGE_INTEGER AllocationSize; +- SMB_EXT_FILE_ATTR ExtFileAttributes; +- ULONG FileNameLength; +- UCHAR FileName\[\]; +- } + +**NextEntryOffset: (4 bytes):** This field contains the offset, in bytes, from this entry in the list to the next entry in the list. If there are no additional entries the value MUST be zero (0x00000000). + +**FileIndex: (4 bytes):** This field SHOULD[<157>](#Appendix_A_157) be set to zero when sent in a response and SHOULD be ignored when received by the client. + +**CreateTime: (8 bytes):** This field contains the date and time when the file was created. + +**LastAccessTime: (8 bytes):** This field contains the date and time when the file was last accessed. + +**LastWriteTime: (8 bytes):** This field contains the date and time when data was last written to the file. + +**LastAttrChangeTime: (8 bytes):** This field contains the date and time when the file attributes where last changed. + +**EndOfFile: (8 bytes):** This field contains the offset, in bytes, to the start of the file to the first byte after the end of the file. + +**AllocationSize: (8 bytes):** This field contains the file allocation size, in bytes. Usually, this value is a multiple of the sector or cluster size of the underlying physical device. + +**ExtFileAttributes: (4 bytes):** This field contains the extended file attributes of the file, encoded as an SMB_EXT_FILE_ATTR (section [2.2.1.2.3](#Section_6008aa8fd2d84366b775b81aece05bb1)) data type. + +**FileNameLength: (4 bytes):** This field contains the length of the **FileName** field, in bytes.[<158>](#Appendix_A_158) + +**FileName: (variable):** This field contains the name of the file.[<159>](#Appendix_A_159) + +##### SMB_FIND_FILE_FULL_DIRECTORY_INFO + +This information level structure is used in [TRANS2_FIND_FIRST2 (section 2.2.6.2)](#Section_a782468b56f14066bb6ee2630f0e8695) and [TRANS2_FIND_NEXT2 (section 2.2.6.3)](#Section_8f2e9ab5a6be4540a8fdf62492b34d24) responses to return the [SMB_FIND_FILE_DIRECTORY_INFO (section 2.2.8.1.4)](#Section_8be9119ab37e4ff5bee73d7a5997dc88) data along with the size of a file's extended attributes (EAs) list for all files that match the request's search criteria. + +- SMB_FIND_FILE_FULL_DIRECTORY_INFO\[SearchCount\] +- { +- ULONG NextEntryOffset; +- ULONG FileIndex; +- FILETIME CreationTime; +- FILETIME LastAccessTime; +- FILETIME LastWriteTime; +- FILETIME LastAttrChangeTime; +- LARGE_INTEGER EndOfFile; +- LARGE_INTEGER AllocationSize; +- SMB_EXT_FILE_ATTR ExtFileAttributes; +- ULONG FileNameLength; +- ULONG EaSize; +- UCHAR FileName\[\]; +- } + +**NextEntryOffset: (4 bytes):** This field contains the offset, in bytes, from this entry in the list to the next entry in the list. If there are no additional entries, the value MUST be zero (0x00000000). + +**FileIndex: (4 bytes):** This field SHOULD[<160>](#Appendix_A_160) be set to zero when sent in a response and SHOULD be ignored when received by the client. + +**CreationTime: (8 bytes):** This field contains the date and time when the file was created. + +**LastAccessTime: (8 bytes):** This field contains the date and time when the file was last accessed. + +**LastWriteTime: (8 bytes):** This field contains the date and time when data was last written to the file. + +**LastAttrChangeTime: (8 bytes):** This field contains the date and time when the file attributes where last changed. + +**EndOfFile: (8 bytes):** This field contains the offset, in bytes, from the start of the file to the first byte after the end of the file. + +**AllocationSize: (8 bytes):** This field contains the file allocation size, in bytes. Usually, this value is a multiple of the sector or cluster size of the underlying physical device. + +**ExtFileAttributes: (4 bytes):** This field contains the extended file attributes of the file, encoded as an SMB_EXT_FILE_ATTR (section [2.2.1.2.3](#Section_6008aa8fd2d84366b775b81aece05bb1)) data type. + +**FileNameLength: (4 bytes):** This field contains the length of the **FileName** field, in bytes.[<161>](#Appendix_A_161) + +**EaSize: (4 bytes):** This field contains the size of the file's extended attribute (EA) information, in bytes. + +**FileName: (variable):** This field contains the name of the file.[<162>](#Appendix_A_162) + +##### SMB_FIND_FILE_NAMES_INFO + +This information level structure is used in [TRANS2_FIND_FIRST2 (section 2.2.6.2)](#Section_a782468b56f14066bb6ee2630f0e8695) and [TRANS2_FIND_NEXT2 (section 2.2.6.3)](#Section_8f2e9ab5a6be4540a8fdf62492b34d24) responses to return the file name for all files that match the request's search criteria. + +- SMB_FIND_FILE_NAMES_INFO\[SearchCount\] +- { +- ULONG NextEntryOffset; +- ULONG FileIndex; +- ULONG FileNameLength; +- UCHAR FileName\[\]; +- } + +**NextEntryOffset: (4 bytes):** This field contains the offset, in bytes, from this entry in the list to the next entry in the list. If there are no additional entries, the value MUST be zero (0x00000000). + +**FileIndex: (4 bytes):** This field SHOULD[<163>](#Appendix_A_163) be set to zero when sent in a response and SHOULD be ignored when received by the client. + +**FileNameLength: (4 bytes):** This field MUST contain the length of the **FileName** field, in bytes.[<164>](#Appendix_A_164) + +**FileName: (variable):** This field contains the name of the file.[<165>](#Appendix_A_165) + +##### SMB_FIND_FILE_BOTH_DIRECTORY_INFO + +This information level structure is used in TRANS2_FIND_FIRST2 (section [2.2.6.2](#Section_a782468b56f14066bb6ee2630f0e8695)) and TRANS2_FIND_NEXT2 (section [2.2.6.3](#Section_8f2e9ab5a6be4540a8fdf62492b34d24)) responses to return a combination of the SMB_FIND_FILE_FULL_DIRECTORY_INFO (section [2.2.8.1.5](#Section_64bd690ed3a4458896ef0cb90b065d08)) and SMB_FIND_FILE_NAMES_INFO (section [2.2.8.1.6](#Section_88b9968ba36f482abb30c7a51a3e290d)) data for all files that match the request's search criteria. + +- SMB_FIND_FILE_BOTH_DIRECTORY_INFO\[SearchCount\] +- { +- ULONG NextEntryOffset; +- ULONG FileIndex; +- FILETIME CreationTime; +- FILETIME LastAccessTime; +- FILETIME LastWriteTime; +- FILETIME LastChangeTime; +- LARGE_INTEGER EndOfFile; +- LARGE_INTEGER AllocationSize; +- SMB_EXT_FILE_ATTR ExtFileAttributes; +- ULONG FileNameLength; +- ULONG EaSize; +- UCHAR ShortNameLength; +- UCHAR Reserved; +- WCHAR ShortName\[12\]; +- UCHAR FileName\[\]; +- } + +**NextEntryOffset: (4 bytes)**: This field contains the offset, in bytes, from this entry in the list to the next entry in the list. If there are no additional entries the value MUST be zero (0x00000000). + +**FileIndex: (4 bytes)**: This field SHOULD[<166>](#Appendix_A_166) be set to zero when sent in a response and SHOULD be ignored when received by the client. + +**CreationTime: (8 bytes)**: This field contains the date and time when the file was created. + +**LastAccessTime: (8 bytes)**: This field contains the date and time when the file was last accessed. + +**LastWriteTime: (8 bytes)**: This field contains the date and time when data was last written to the file. + +**LastChangeTime: (8 bytes)**: This field contains the date and time when the file was last changed. + +**EndOfFile: (8 bytes)**: The absolute new end-of-file position as a byte offset from the start of the file. **EndOfFile** specifies the byte offset to the end of the file. Because this value is zero-based, it actually refers to the first free byte in the file. In other words, **EndOfFile** is the offset to the byte immediately following the last valid byte in the file. + +**AllocationSize: (8 bytes)**: This field contains the file allocation size, in bytes. Usually, this value is a multiple of the sector or cluster size of the underlying physical device. + +**ExtFileAttributes: (4 bytes)**: This field contains the extended file attributes of the file, encoded as an SMB_EXT_FILE_ATTR (section [2.2.1.2.3](#Section_6008aa8fd2d84366b775b81aece05bb1)) data type. + +**FileNameLength: (4 bytes)**: This field MUST contain the length of the **FileName** field, in bytes.[<167>](#Appendix_A_167) + +**EaSize: (4 bytes)**: This field MUST contain the length of the **FEAList**, in bytes. + +**ShortNameLength: (1 byte)**: This field MUST contain the length of the **ShortName**, in bytes, or zero if no 8.3 name is present. + +**Reserved: (1 byte)**: This field is reserved and MUST be zero (0x00). + +**ShortName: (24 bytes)**: This field MUST contain the 8.3 name, if any, of the file in Unicode format. + +**FileName: (variable)**: This field contains the long name of the file.[<168>](#Appendix_A_168) + +#### QUERY_FS Information Levels + +##### SMB_INFO_ALLOCATION + +This information level structure is used in [TRANS2_QUERY_FS_INFORMATION Responses (section 2.2.6.4.2)](#Section_f5c225a2c3d3469b843e1f6225acd9f9) to return allocation and size information of the object store underlying the share specified in the request. + +- SMB_INFO_ALLOCATION +- { +- ULONG idFileSystem; +- ULONG cSectorUnit; +- ULONG cUnit; +- ULONG cUnitAvailable; +- USHORT cbSector; +- } + +**idFileSystem: (4 bytes):** This field contains a file system identifier.[<169>](#Appendix_A_169) + +**cSectorUnit: (4 bytes):** This field contains the number of sectors per allocation unit. + +**cUnit: (4 bytes):** This field contains the total number of allocation units. + +**cUnitAvailable: (4 bytes):** This field contains the total number of available allocation units. + +**cbSector: (2 bytes):** This field contains the number of bytes per sector. + +##### SMB_INFO_VOLUME + +This information level structure is used in [TRANS2_QUERY_FS_INFORMATION Responses (section 2.2.6.4.2)](#Section_f5c225a2c3d3469b843e1f6225acd9f9) to return volume information of the object store underlying the share specified in the request. + +- SMB_INFO_VOLUME +- { +- ULONG ulVolSerialNbr; +- UCHAR cCharCount; +- SMB_STRING VolumeLabel; +- } + +**ulVolSerialNbr: (4 bytes):** This field contains the serial number of the volume. + +**cCharCount: (1 byte):** This field contains the number of characters in the **VolumeLabel** field. + +**VolumeLabel: (variable):** This field contains the volume label.[<170>](#Appendix_A_170) + +##### SMB_QUERY_FS_VOLUME_INFO + +This information level structure is used in [TRANS2_QUERY_FS_INFORMATION Responses (section 2.2.6.4.2)](#Section_f5c225a2c3d3469b843e1f6225acd9f9) to return extended volume information of the object store underlying the share specified in the request.[<171>](#Appendix_A_171) + +- SMB_QUERY_FS_VOLUME_INFO +- { +- FILETIME VolumeCreationTime; +- ULONG SerialNumber; +- ULONG VolumeLabelSize; +- USHORT Reserved; +- WCHAR VolumeLabel\[VolumeLabelSize/2\]; +- } + +**VolumeCreationTime: (8 bytes):** This field contains the date and time when the volume was created. + +**SerialNumber: (4 bytes):** This field contains the serial number of the volume. + +**VolumeLabelSize: (4 bytes):** This field contains the size of the **VolumeLabel** field, in bytes. + +**VolumeLabel: (variable):** This field contains the Unicode-encoded volume label. + +##### SMB_QUERY_FS_SIZE_INFO + +This information level structure is used in [TRANS2_QUERY_FS_INFORMATION Responses (section 2.2.6.4.2)](#Section_f5c225a2c3d3469b843e1f6225acd9f9) to return extended allocation and size information of the object store underlying the share specified in the request.[<172>](#Appendix_A_172) + +- SMB_QUERY_FS_SIZE_INFO +- { +- LARGE_INTEGER TotalAllocationUnits; +- LARGE_INTEGER TotalFreeAllocationUnits; +- ULONG SectorsPerAllocationUnit; +- ULONG BytesPerSector; +- } + +**TotalAllocationUnits: (8 bytes):** This field contains the total number of allocation units assigned to the volume. + +**TotalFreeAllocationUnits: (8 bytes):** This field contains the total number of unallocated or free allocation units for the volume. + +**SectorsPerAllocationUnit: (4 bytes):** This field contains the number of sectors per allocation unit. + +**BytesPerSector: (4 bytes):** This field contains the bytes per sector. + +##### SMB_QUERY_FS_DEVICE_INFO + +This information level structure is used in [TRANS2_QUERY_FS_INFORMATION Responses (section 2.2.6.4.2)](#Section_f5c225a2c3d3469b843e1f6225acd9f9) to return device information of the object store underlying the share specified in the request.[<173>](#Appendix_A_173) + +- SMB_QUERY_FS_DEVICE_INFO +- { +- ULONG DeviceType; +- ULONG DeviceCharacteristics; +- } + +**DeviceType: (4 bytes)**: This field contains the device type on which the volume resides. + +| Name | Value | +| ------------------------------- | ------ | +| FILE_DEVICE_BEEP | 0x0001 | +| FILE_DEVICE_CD_ROM | 0x0002 | +| FILE_DEVICE_CD_ROM_FILE_SYSTEM | 0x0003 | +| FILE_DEVICE_CONTROLLER | 0x0004 | +| FILE_DEVICE_DATALINK | 0x0005 | +| FILE_DEVICE_DFS | 0x0006 | +| FILE_DEVICE_DISK | 0x0007 | +| FILE_DEVICE_DISK_FILE_SYSTEM | 0x0008 | +| FILE_DEVICE_FILE_SYSTEM | 0x0009 | +| FILE_DEVICE_INPORT_PORT | 0x000a | +| FILE_DEVICE_KEYBOARD | 0x000b | +| FILE_DEVICE_MAILSLOT | 0x000c | +| FILE_DEVICE_MIDI_IN | 0x000d | +| FILE_DEVICE_MIDI_OUT | 0x000e | +| FILE_DEVICE_MOUSE | 0x000f | +| FILE_DEVICE_MULTI_UNC_PROVIDER | 0x0010 | +| FILE_DEVICE_NAMED_PIPE | 0x0011 | +| FILE_DEVICE_NETWORK | 0x0012 | +| FILE_DEVICE_NETWORK_BROWSER | 0x0013 | +| FILE_DEVICE_NETWORK_FILE_SYSTEM | 0x0014 | +| FILE_DEVICE_NULL | 0x0015 | +| FILE_DEVICE_PARALLEL_PORT | 0x0016 | +| FILE_DEVICE_PHYSICAL_NETCARD | 0x0017 | +| FILE_DEVICE_PRINTER | 0x0018 | +| FILE_DEVICE_SCANNER | 0x0019 | +| FILE_DEVICE_SERIAL_MOUSE_PORT | 0x001a | +| FILE_DEVICE_SERIAL_PORT | 0x001b | +| FILE_DEVICE_SCREEN | 0x001c | +| FILE_DEVICE_SOUND | 0x001d | +| FILE_DEVICE_STREAMS | 0x001e | +| FILE_DEVICE_TAPE | 0x001f | +| FILE_DEVICE_TAPE_FILE_SYSTEM | 0x0020 | +| FILE_DEVICE_TRANSPORT | 0x0021 | +| FILE_DEVICE_UNKNOWN | 0x0022 | +| FILE_DEVICE_VIDEO | 0x0023 | +| FILE_DEVICE_VIRTUAL_DISK | 0x0024 | +| FILE_DEVICE_WAVE_IN | 0x0025 | +| FILE_DEVICE_WAVE_OUT | 0x0026 | +| FILE_DEVICE_8042_PORT | 0x0027 | +| FILE_DEVICE_NETWORK_REDIRECTOR | 0x0028 | +| FILE_DEVICE_BATTERY | 0x0029 | +| FILE_DEVICE_BUS_EXTENDER | 0x002a | +| FILE_DEVICE_MODEM | 0x002b | +| FILE_DEVICE_VDM | 0x002c | + +**DeviceCharacteristics: (4 bytes)**: This 32-bit field of flags contains the device characteristics. The individual flags are as follows. + +| Name | Bitmask | +| ---------------------- | ------- | +| FILE_REMOVABLE_MEDIA | 0x0001 | +| FILE_READ_ONLY_DEVICE | 0x0002 | +| FILE_FLOPPY_DISKETTE | 0x0004 | +| FILE_WRITE_ONCE_MEDIA | 0x0008 | +| FILE_REMOTE_DEVICE | 0x0010 | +| FILE_DEVICE_IS_MOUNTED | 0x0020 | +| FILE_VIRTUAL_VOLUME | 0x0040 | + +##### SMB_QUERY_FS_ATTRIBUTE_INFO + +This information level is used to query file system attributes.[<174>](#Appendix_A_174) + +**FileSystemAttributes: (4 bytes):** This 32-bit field of flags contains the file system's attributes. The individual flags are as follows. + +| Name | Bitmask | +| -------------------------- | ---------- | +| FILE_CASE_SENSITIVE_SEARCH | 0x00000001 | +| FILE_CASE_PRESERVED_NAMES | 0x00000002 | +| FILE_UNICODE_ON_DISK | 0x00000004 | +| FILE_PERSISTENT_ACLS | 0x00000008 | +| FILE_FILE_COMPRESSION | 0x00000010 | +| FILE_VOLUME_IS_COMPRESSED | 0x00008000 | + +**MaxFileNameLengthInBytes: (4 bytes):** This field contains the maximum size, in bytes, of a file name on the file system. + +**LengthOfFileSystemName: (4 bytes):** This field contains the size, in bytes, of the **FileSystemName** field. + +**FileSystemName: (variable):** This field contains the Unicode-encoded name of the file system. + +#### QUERY Information Levels + +##### SMB_INFO_STANDARD + +This information level structure is used in [TRANS2_QUERY_PATH_INFORMATION (section 2.2.6.6)](#Section_39021262e1624948b4999dfccef77ef6) and [TRANS2_QUERY_FILE_INFORMATION (section 2.2.6.8)](#Section_16c2516fc82c43b79ab732fb1109f9fe) responses to return the following information for the file specified in the request: + +- Creation, access, and last write timestamps +- File size +- File attributes + +- SMB_INFO_STANDARD +- { +- SMB_DATE CreationDate; +- SMB_TIME CreationTime; +- SMB_DATE LastAccessDate; +- SMB_TIME LastAccessTime; +- SMB_DATE LastWriteDate; +- SMB_TIME LastWriteTime; +- ULONG FileDataSize; +- ULONG AllocationSize; +- SMB_FILE_ATTRIBUTES Attributes; +- } + +**CreationDate: (2 bytes)**: This field contains the date when the file was created. + +**CreationTime: (2 bytes)**: This field contains the time when the file was created. + +**LastAccessDate: (2 bytes)**: This field contains the date when the file was last accessed. + +**LastAccessTime: (2 bytes)**: This field contains the time when the file was last accessed. + +**LastWriteDate: (2 bytes)**: This field contains the date when data was last written to the file. + +**LastWriteTime: (2 bytes)**: This field contains the time when data was last written to the file. + +**FileDataSize: (4 bytes)**: This field contains the file size, in filesystem allocation units. + +**AllocationSize: (4 bytes)**: This field contains the size of the filesystem allocation unit, in bytes. + +**Attributes: (2 bytes)**: This field contains the file attributes. + +##### SMB_INFO_QUERY_EA_SIZE + +This information level structure is used in [TRANS2_QUERY_PATH_INFORMATION (section 2.2.6.6)](#Section_39021262e1624948b4999dfccef77ef6) and [TRANS2_QUERY_FILE_INFORMATION (section 2.2.6.8)](#Section_16c2516fc82c43b79ab732fb1109f9fe) responses to return the [SMB_INFO_STANDARD (section 2.2.8.3.1)](#Section_a6ec7008abfc43229ed930ba50839a7c) data along with the size of a file's extended attributes (EAs) list for the file specified in the request. + +- SMB_INFO_QUERY_EA_SIZE +- { +- SMB_DATE CreationDate; +- SMB_TIME CreationTime; +- SMB_DATE LastAccessDate; +- SMB_TIME LastAccessTime; +- SMB_DATE LastWriteDate; +- SMB_TIME LastWriteTime; +- ULONG FileDataSize; +- ULONG AllocationSize; +- SMB_FILE_ATTRIBUTES Attributes; +- ULONG EaSize; +- } + +**CreationDate: (2 bytes):** This field contains the date when the file was created. + +**CreationTime: (2 bytes):** This field contains the time when the file was created. + +**LastAccessDate: (2 bytes):** This field contains the date when the file was last accessed. + +**LastAccessTime: (2 bytes):** This field contains the time when the file was last accessed. + +**LastWriteDate : (2 bytes):** This field contains the date when data was last written to the file. + +**LastWriteTime: (2 bytes):** This field contains the time when data was last written to the file. + +**FileDataSize: (4 bytes):** This field contains the file size, in filesystem allocation units. + +**AllocationSize: (4 bytes):** This field contains the size of the filesystem allocation unit, in bytes. + +**Attributes: (2 bytes):** This field contains the file attributes. + +**EaSize: (4 bytes):** This field contains the size of the file's extended attribute (EA) information in bytes. + +##### SMB_INFO_QUERY_EAS_FROM_LIST + +This information level structure is used in [TRANS2_QUERY_PATH_INFORMATION (section 2.2.6.6)](#Section_39021262e1624948b4999dfccef77ef6) and [TRANS2_QUERY_FILE_INFORMATION (section 2.2.6.8)](#Section_16c2516fc82c43b79ab732fb1109f9fe) responses to return a list of specificl extended attributes (EAs) on the file specified in the request. The requested EAs are provided in the **Trans2_Data** block of the request. + +- SMB_INFO_QUERY_EAS_FROM_LIST +- { +- SMB_FEA_LIST ExtendedAttributeList; +- } + +**ExtendedAttributeList: (variable):** A list of extended attribute (EA) name/value pairs where the **AttributeName** field values match those that were provided in the request. + +##### SMB_INFO_QUERY_ALL_EAS + +This information level structure is used in [TRANS2_QUERY_PATH_INFORMATION (section 2.2.6.6)](#Section_39021262e1624948b4999dfccef77ef6) and [TRANS2_QUERY_FILE_INFORMATION (section 2.2.6.8)](#Section_16c2516fc82c43b79ab732fb1109f9fe) responses to return a list of specific extended attributes (EAs) on the file specified in the request. + +- SMB_INFO_QUERY_ALL_EAS +- { +- SMB_FEA_LIST ExtendedAttributeList; +- } + +**ExtendedAttributeList: (variable):** A list of all of the extended attribute (EA) name/value pairs assigned to the file. + +##### SMB_INFO_IS_NAME_VALID + +This **information level** enables a server test as to whether the name of the file contained in the **Request.Trans2_Parameters.FileName** field has valid path syntax. This information level is valid only for the TRANS2_QUERY_PATH_INFORMATION subcommand. No parameters or data are returned on this **InformationLevel** request. An error is returned if the syntax of the name is incorrect. Success indicates that the server accepts the path syntax, but it does not ensure that the file or directory actually exists. + +##### SMB_QUERY_FILE_BASIC_INFO + +This information level structure is used in [TRANS2_QUERY_PATH_INFORMATION (section 2.2.6.6)](#Section_39021262e1624948b4999dfccef77ef6) and [TRANS2_QUERY_FILE_INFORMATION (section 2.2.6.8)](#Section_16c2516fc82c43b79ab732fb1109f9fe) responses to return the following information for the file specified in the request:[<175>](#Appendix_A_175) + +- 64-bit versions of creation, access, and last write timestamps +- Extended file attributes + +- SMB_QUERY_FILE_BASIC_INFO +- { +- FILETIME CreationTime; +- FILETIME LastAccessTime; +- FILETIME LastWriteTime; +- FILETIME LastChangeTime; +- SMB_EXT_FILE_ATTR ExtFileAttributes; +- ULONG Reserved; +- } + +**CreationTime: (8 bytes):** This field contains the date and time when the file was created. + +**LastAccessTime: (8 bytes):** This field contains the date and time when the file was last accessed. + +**LastWriteTime: (8 bytes):** This field contains the date and time when data was last written to the file. + +**LastChangeTime: (8 bytes):** This field contains the date and time when the file was last changed. + +**ExtFileAttributes: (4 bytes):** This field contains the extended file attributes of the file, encoded as an SMB_EXT_FILE_ATTR (section [2.2.1.2.3](#Section_6008aa8fd2d84366b775b81aece05bb1)) data type. + +**Reserved: (4 bytes):** MUST be set to zero when sent and MUST be ignored on receipt. + +##### SMB_QUERY_FILE_STANDARD_INFO + +This information level structure is used in [TRANS2_QUERY_PATH_INFORMATION (section 2.2.6.6)](#Section_39021262e1624948b4999dfccef77ef6) and [TRANS2_QUERY_FILE_INFORMATION (section 2.2.6.8)](#Section_16c2516fc82c43b79ab732fb1109f9fe) responses to return the following information for the file specified in the request.[<176>](#Appendix_A_176) + +- 64-bit version of file size +- Number of hard links on the file +- Deletion status +- Whether the **FID** field in the request points to a directory + +- SMB_QUERY_FILE_STANDARD_INFO +- { +- LARGE_INTEGER AllocationSize; +- LARGE_INTEGER EndOfFile; +- ULONG NumberOfLinks; +- UCHAR DeletePending; +- UCHAR Directory; +- } + +**Allocation Size: (8 bytes):** This field contains the number of bytes that are allocated to the file. + +**EndOfFile: (8 bytes):** This field contains the offset, in bytes, from the start of the file to the first byte after the end of the file. + +**NumberOfLinks: (4 bytes):** This field contains the number of hard links to the file. + +**DeletePending: (1 byte):** This field indicates whether there is a delete action pending for the file. + +**Directory: (1 byte):** This field indicates whether the file is a directory. + +##### SMB_QUERY_FILE_EA_INFO + +This information level structure is used in [TRANS2_QUERY_PATH_INFORMATION (section 2.2.6.6)](#Section_39021262e1624948b4999dfccef77ef6) and [TRANS2_QUERY_FILE_INFORMATION (section 2.2.6.8)](#Section_16c2516fc82c43b79ab732fb1109f9fe) responses to return the size of a file's extended attributes (EAs) list for the file specified in the request.[<177>](#Appendix_A_177) + +- SMB_QUERY_FILE_EA_INFO +- { +- ULONG EaSize; +- } + +**EaSize: (4 bytes):** This field MUST contain the length of a file's list of extended attributes in bytes. + +##### SMB_QUERY_FILE_NAME_INFO + +This information level structure is used in [TRANS2_QUERY_PATH_INFORMATION (section 2.2.6.6)](#Section_39021262e1624948b4999dfccef77ef6) and [TRANS2_QUERY_FILE_INFORMATION (section 2.2.6.8)](#Section_16c2516fc82c43b79ab732fb1109f9fe) responses to return the Unicode-formatted long file name of the file specified in the request.[<178>](#Appendix_A_178) + +- SMB_QUERY_FILE_NAME_INFO +- { +- ULONG FileNameLength; +- WCHAR FileName\[FileNameLength/2\]; +- } + +**FileNameLength: (4 bytes):** This field MUST contain the length of the **FileName** field in bytes. + +**FileName: (variable):** This field contains the name of the file in [**Unicode**](#gt_c305d0ab-8b94-461a-bd76-13b40cb8c4d8). + +##### SMB_QUERY_FILE_ALL_INFO + +This information level structure is used in TRANS2_QUERY_PATH_INFORMATION (section [2.2.6.6](#Section_39021262e1624948b4999dfccef77ef6)) and TRANS2_QUERY_FILE_INFORMATION (section [2.2.6.8](#Section_16c2516fc82c43b79ab732fb1109f9fe)) responses to return the [SMB_QUERY_FILE_BASIC_INFO](#Section_3da7df7543ba4498a6b3a68ba57ec922), [SMB_QUERY_FILE_STANDARD_INFO](#Section_3bdd080cf8a44a09acf10f8bd00152e4), [SMB_QUERY_FILE_EA_INFO](#Section_3e85d60e696a4436875784233d9f0245), and [SMB_QUERY_FILE_NAME_INFO](#Section_0cdd9e53bc924f268b22ed11fc06a6d7) data as well as access flags, access mode, and alignment information in a single request for the file specified in the request. + +- SMB_QUERY_FILE_ALL_INFO +- { +- FILETIME CreationTime; +- FILETIME LastAccessTime; +- FILETIME LastWriteTime; +- FILETIME LastChangeTime; +- SMB_EXT_FILE_ATTR ExtFileAttributes; +- ULONG Reserved1; +- LARGE_INTEGER AllocationSize +- LARGE_INTEGER EndOfFile; +- ULONG NumberOfLinks; +- UCHAR DeletePending; +- UCHAR Directory; +- USHORT Reserved2; +- ULONG EaSize; +- ULONG FileNameLength; +- WCHAR FileName\[FileNameLength/2\]; +- } + +**CreationTime: (8 bytes):** This field contains the date and time when the file was created. + +**LastAccessTime: (8 bytes):** This field contains the date and time when the file was last accessed. + +**LastWriteTime: (8 bytes):** This field contains the date and time when data was last written to the file. + +**LastChangeTime: (8 bytes):** This field contains the date and time when the file was last changed. + +**ExtFileAttributes: (4 bytes):** This field contains the extended file attributes of the file, encoded as an SMB_EXT_FILE_ATTR (section [2.2.1.2.3](#Section_6008aa8fd2d84366b775b81aece05bb1)) data type. + +**Reserved1: (4 bytes):** Reserved. This field SHOULD be set to 0x00000000 by the server and MUST be ignored by the client. + +**AllocationSize: (8 bytes):** This field contains the number of bytes that are allocated to the file. + +**EndOfFile: (8 bytes):** This field contains the offset, in bytes, from the start of the file to the first byte after the end of the file. + +**NumberOfLinks: (4 bytes):** This field contains the number of hard links to the file. + +**DeletePending: (1 byte):** This field indicates whether there is a delete action pending for the file. + +**Directory: (1 byte):** This field indicates whether the file is a directory. + +**Reserved2: (2 bytes):** Reserved. This field SHOULD be set to 0x0000 by the server and MUST be ignored by the client. + +**EaSize: (4 bytes):** This field MUST contain the length of a file's list of extended attributes in bytes. + +**FileNameLength: (4 bytes):** This field MUST contain the length, in bytes, of the **FileName** field. + +**FileName: (variable):** This field contains the name of the file in [**Unicode**](#gt_c305d0ab-8b94-461a-bd76-13b40cb8c4d8). + +##### SMB_QUERY_FILE_ALT_NAME_INFO + +This information level structure is used in [TRANS2_QUERY_PATH_INFORMATION (section 2.2.6.6)](#Section_39021262e1624948b4999dfccef77ef6) and [TRANS2_QUERY_FILE_INFORMATION (section 2.2.6.8)](#Section_16c2516fc82c43b79ab732fb1109f9fe) responses to return the 8.3 format file name of the file in the request.[<179>](#Appendix_A_179) + +- SMB_QUERY_FILE_ALT_NAME_INFO +- { +- ULONG FileNameLength; +- WCHAR FileName\[FileNameLength/2\]; +- } + +**FileNameLength: (4 bytes):** This field contains the length, in bytes, of the **FileName** field. + +**FileName: (variable):** This field contains the [**8.3 name**](#gt_d2302116-d3d3-4465-a72e-c07a7737b7ae) of the file in [**Unicode**](#gt_c305d0ab-8b94-461a-bd76-13b40cb8c4d8). The string is not null-terminated. + +##### SMB_QUERY_FILE_STREAM_INFO + +This information level structure is used in [TRANS2_QUERY_PATH_INFORMATION (section 2.2.6.6)](#Section_39021262e1624948b4999dfccef77ef6) and [TRANS2_QUERY_FILE_INFORMATION (section 2.2.6.8)](#Section_16c2516fc82c43b79ab732fb1109f9fe) responses to return the stream information for the file in the request.[<180>](#Appendix_A_180) + +- SMB_QUERY_FILE_STREAM_INFO +- { +- ULONG NextEntryOffset; +- ULONG StreamNameLength; +- LARGE_INTEGER StreamSize; +- LARGE_INTEGER StreamAllocationSize; +- WCHAR StreamName\[StreamNameLength/2\]; +- } + +**NextEntryOffset: (4 bytes)**: A 32-bit unsigned integer that contains the byte offset from the beginning of this entry, at which the next FILE\_ STREAM \_INFORMATION entry is located, if multiple entries are present in a buffer. This member is 0x00000000 if no other entries follow this one. An implementation MUST use this value to determine the location of the next entry (if multiple entries are present in a buffer) and MUST NOT assume that the value of **NextEntryOffset** is the same as the size of the current entry. + +**StreamNameLength: (4 bytes)**: A 32-bit unsigned integer that contains the length, in bytes, of the stream name string. + +**StreamSize: (8 bytes)**: A 64-bit signed integer that contains the size, in bytes, of the stream. The value of this field MUST be greater than or equal to 0x0000000000000000. + +**StreamAllocationSize: (8 bytes)**: A 64-bit signed integer that contains the file stream allocation size in bytes. Usually, this value is a multiple of the sector or cluster size of the underlying physical device. The value of this field MUST be greater than or equal to 0x0000000000000000. + +**StreamName: (variable)**: A sequence of Unicode characters containing the name of the stream using the form ":streamname:\$DATA", or "::\$DATA" for the default stream. The :\$DATA string that follows **streamname** is an internal data type tag that is unintentionally exposed. The leading ':' and trailing ':\$DATA' characters are not part of the stream name and MUST be stripped from this field to derive the actual stream name. A resulting empty string for the stream name denotes the default stream. Because this field might not be null-terminated, it MUST be handled as a sequence of **StreamNameLength** bytes. + +##### SMB_QUERY_FILE_COMRESSION_INFO + +This information level structure is used in [TRANS2_QUERY_PATH_INFORMATION (section 2.2.6.6)](#Section_39021262e1624948b4999dfccef77ef6) and [TRANS2_QUERY_FILE_INFORMATION (section 2.2.6.8)](#Section_16c2516fc82c43b79ab732fb1109f9fe) responses to return the compression information for the file in the request.[<181>](#Appendix_A_181) + +- SMB_QUERY_FILE_COMRESSION_INFO +- { +- LARGE_INTEGER CompressedFileSize; +- USHORT CompressionFormat; +- UCHAR CompressionUnitShift; +- UCHAR ChunkShift; +- UCHAR ClusterShift; +- UCHAR Reserved\[3\]; +- } + +**CompressedFileSize: (8 bytes):** A 64-bit signed integer that contains the size, in bytes, of the compressed file. This value MUST be greater than or equal to 0x0000000000000000. + +**CompressionFormat: (2 bytes):** A 16-bit unsigned integer that contains the compression format. The actual compression operation associated with each of these compression format values is implementation-dependent. An implementation can associate any local compression algorithm with the values described in the following table, because the compressed data does not travel across the wire in the context of this transaction. The following compression formats are valid only for [**NTFS**](#gt_86f79a17-c0be-4937-8660-0cf6ce5ddc1a). + +| Name and bitmask | Meaning | +| ---------------------------------------- | ------------------------------------------------------------------------------- | +| COMPRESSION_FORMAT_NONE

0x0000 | The file or directory is not compressed. | +| COMPRESSION_FORMAT_DEFAULT

0x0001 | The file or directory is compressed by using the default compression algorithm. | +| COMPRESSION_FORMAT_LZNT1

0x0002 | The file or directory is compressed by using the LZNT1 compression algorithm. | +| All other values | Reserved for future use. | + +**CompressionUnitShift: (1 byte):** An 8-bit unsigned integer that contains the compression unit shift that is the number of bits by which to left-shift a 1 bit to arrive at the compression unit size. The compression unit size is the number of bytes in a compression unit, that is, the number of bytes to be compressed. This value is implementation-defined. + +**ChunkShift: (1 byte):** An 8-bit unsigned integer that contains the compression chunk size in bytes in log 2 format. The chunk size is the number of bytes that the operating system's implementation of the Lempel-Ziv compression algorithm tries to compress at one time. This value is implementation-defined. + +**ClusterShift:** (1 byte): An 8-bit unsigned integer that specifies, in log 2 format, the amount of space that MUST be saved by compression to successfully compress a compression unit. If that amount of space is not saved by compression, the data in that compression unit MUST be stored uncompressed. Each successfully compressed compression unit MUST occupy at least one cluster that is less in bytes than an uncompressed compression unit. Therefore, the cluster shift is the number of bits by which to left shift a 1 bit to arrive at the size of a cluster. This value is implementation-defined. + +**Reserved: (3 bytes):** A 24-bit reserved value. This field SHOULD be set to 0x000000 and MUST be ignored. + +#### SET Information levels + +##### SMB_INFO_STANDARD + +This information level structure is used in [TRANS2_SET_PATH_INFORMATION (section 2.2.6.7)](#Section_a23483d965434aaaa996e7c9506f8b94) and [TRANS2_SET_FILE_INFORMATION (section 2.2.6.9)](#Section_cb2b7f2138774bc5adf4b78c8aa2a717) requests to set timestamp information for the file specified in the request + +- SMB_INFO_STANDARD +- { +- SMB_DATE CreationDate; +- SMB_TIME CreationTime; +- SMB_DATE LastAccessDate; +- SMB_TIME LastAccessTime; +- SMB_DATE LastWriteDate; +- SMB_TIME LastWriteTime; +- UCHAR Reserved\[10\]; +- } + +**CreationDate: (2 bytes):** This field contains the date when the file was created. + +**CreationTime: (2 bytes):** This field contains the time when the file was created. + +**LastAccessDate: (2 bytes):** This field contains the date when the file was last accessed. + +**LastAccessTime: (2 bytes):** This field contains the time when the file was last accessed. + +**LastWriteDate: (2 bytes):** This field contains the date when data was last written to the file. + +**LastWriteTime: (2 bytes):** This field contains the time when data was last written to the file. + +**Reserved: (10 bytes):** MUST be set to zero when sent and MUST be ignored on receipt. + +##### SMB_INFO_SET_EAS + +This information level structure is used in [TRANS2_SET_PATH_INFORMATION (section 2.2.6.7)](#Section_a23483d965434aaaa996e7c9506f8b94) and [TRANS2_SET_FILE_INFORMATION (section 2.2.6.9)](#Section_cb2b7f2138774bc5adf4b78c8aa2a717) requests to set specific extended attribute (EA) information for the file specified in the request. + +- SMB_INFO_SET_EAS +- { +- SMB_FEA_LIST ExtendedAttributeList; +- } + +**ExtendedAttributeList: (variable):** A list of EA name/value pairs. + +##### SMB_SET_FILE_BASIC_INFO + +This information level structure is used in [TRANS2_SET_PATH_INFORMATION (section 2.2.6.7)](#Section_a23483d965434aaaa996e7c9506f8b94) and [TRANS2_SET_FILE_INFORMATION (section 2.2.6.9)](#Section_cb2b7f2138774bc5adf4b78c8aa2a717) requests to set the following information for the file specified in the request.[<182>](#Appendix_A_182) + +- 64-bit versions of creation, access, and last write timestamps +- Extended file attributes + +- SMB_SET_FILE_BASIC_INFO +- { +- FILETIME CreationTime; +- FILETIME LastAccessTime; +- FILETIME LastWriteTime; +- FILETIME ChangeTime; +- SMB_EXT_FILE_ATTR ExtFileAttributes; +- ULONG Reserved; +- } + +**CreationTime: (8 bytes):** A 64-bit unsigned integer that contains the time when the file was created. A valid time for this field is an integer greater than 0x0000000000000000. When setting file attributes, a value of 0x0000000000000000 indicates to the server that it MUST NOT change this attribute. When setting file attributes, a value of -1 (0xFFFFFFFFFFFFFFFF) indicates to the server that it MUST NOT change this attribute for all subsequent operations on the same file handle. This field MUST NOT be set to a value less than -1 (0xFFFFFFFFFFFFFFFF). + +**LastAccessTime: (8 bytes):** A 64-bit unsigned integer that contains the last time that the file was accessed, in the format of a **FILETIME** structure. A valid time for this field is an integer greater than 0x0000000000000000. When setting file attributes, a value of 0x0000000000000000 indicates to the server that it MUST NOT change this attribute. When setting file attributes, a value of -1 (0xFFFFFFFFFFFFFFFF) indicates to the server that it MUST NOT change this attribute for all subsequent operations on the same file handle. This field MUST NOT be set to a value less than -1 (0xFFFFFFFFFFFFFFFF). + +**LastWriteTime: (8 bytes):** A 64-bit unsigned integer that contains the last time that information was written to the file, in the format of a **FILETIME** structure. A valid time for this field is an integer greater than 0x0000000000000000. When setting file attributes, a value of 0x0000000000000000 indicates to the server that it MUST NOT change this attribute. When setting file attributes, a value of -1 (0xFFFFFFFFFFFFFFFF) indicates to the server that it MUST NOT change this attribute for all subsequent operations on the same file handle. This field MUST NOT be set to a value less than -1 (0xFFFFFFFFFFFFFFFF). + +**ChangeTime: (8 bytes):** A 64-bit unsigned integer that contains the last time that the file was changed, in the format of a **FILETIME** structure. A valid time for this field is an integer greater than 0x0000000000000000. When setting file attributes, a value of 0x0000000000000000 indicates to the server that it MUST NOT change this attribute. When setting file attributes, a value of -1 (0xFFFFFFFFFFFFFFFF) indicates to the server that it MUST NOT change this attribute for all subsequent operations on the same file handle. This field MUST NOT be set to a value less than -1 (0xFFFFFFFFFFFFFFFF). + +**ExtFileAttributes: (4 bytes):** This field contains the extended file attributes of the file, encoded as an SMB_EXT_FILE_ATTR data type (section [2.2.1.2.3](#Section_6008aa8fd2d84366b775b81aece05bb1)). + +**Reserved: (4 bytes):** A 32-bit reserved field that can be set to any value and MUST be ignored. + +##### SMB_SET_FILE_DISPOSITION_INFO + +This information level structure is used in [TRANS2_SET_PATH_INFORMATION (section 2.2.6.7)](#Section_a23483d965434aaaa996e7c9506f8b94) and [TRANS2_SET_FILE_INFORMATION (section 2.2.6.9)](#Section_cb2b7f2138774bc5adf4b78c8aa2a717) requests to mark or unmark the file specified in the request for deletion.[<183>](#Appendix_A_183) + +- SMB_SET_FILE_DISPOSITION_INFO +- { +- UCHAR DeletePending; +- } + +**DeletePending: (1 byte):** An 8-bit field that is set to 0x01 to indicate that a file SHOULD be deleted when it is closed; otherwise, to 0x00. + +##### SMB_SET_FILE_ALLOCATION_INFO + +This information level structure is used in [TRANS2_SET_PATH_INFORMATION (section 2.2.6.7)](#Section_a23483d965434aaaa996e7c9506f8b94) and [TRANS2_SET_FILE_INFORMATION (section 2.2.6.9)](#Section_cb2b7f2138774bc5adf4b78c8aa2a717) requests to set allocation size information for the file specified in the request.[<184>](#Appendix_A_184) + +- SMB_SET_FILE_ALLOCATION_INFO +- { +- LARGE_INTEGER AllocationSize; +- } + +**AllocationSize: (8 bytes):** A 64-bit signed integer containing the file allocation size, in bytes. Usually, this value is a multiple of the sector or cluster size of the underlying physical device. This value MUST be greater than or equal to 0x0000000000000000. All unused allocation (beyond EOF) is freed. + +##### SMB_SET_FILE_END_OF_FILE_INFO + +This information level structure is used in [TRANS2_SET_PATH_INFORMATION (section 2.2.6.7)](#Section_a23483d965434aaaa996e7c9506f8b94) and [TRANS2_SET_FILE_INFORMATION (section 2.2.6.9)](#Section_cb2b7f2138774bc5adf4b78c8aa2a717) requests to set end-of-file information for the file specified in the request.[<185>](#Appendix_A_185) + +- SMB_SET_FILE_END_OF_FILE_INFO +- { +- LARGE_INTEGER EndOfFile; +- } + +**EndOfFile: (8 bytes):** A 64-bit signed integer that contains the absolute new end-of-file position as a byte offset from the start of the file. **EndOfFile** specifies the offset from the beginning of the file to the byte following the last byte in the file. It is the offset from the beginning of the file at which new bytes appended to the file are to be written. The value of this field MUST be greater than or equal to 0x0000000000000000. + +# Protocol Details + +## Common Details + +In the sections that follow, if an ADM element is not prepended with either Client. or Server., it represents each entity's respective ADM element of the same name. Only ADM elements that share a common name and scope between both Client and Server ADMs are presented in this way. + +### Abstract Data Model + +This section specifies a conceptual model of possible data organization that an implementation maintains to participate in this protocol. The described organization is provided to explain how the protocol behaves. This document does not mandate that implementations adhere to this model as long as their external behavior is consistent with what is described in this document. + +#### Global + +There are no global parameters defined as common to both client and server. + +### Timers + +No timers are shared between the client and the server. + +### Initialization + +No initialization is shared between the client and the server. + +### Higher-Layer Triggered Events + +#### Sending Any Message + +Unless otherwise stated, all SMB messages sent by the client and the server MUST comply with the following rules: + +- SMB messages MUST be composed of three parts: + - An **SMB_Header**, as specified in section [2.2.3.1](#Section_69a29f73de0c45a6a1aa8ceeea42217f). + - An **SMB_Parameters** block, as specified in section [2.2.3.2](#Section_c87a9a6ee31844d385e182398f8dc9f5). + - An **SMB_Data** block, as specified in section [2.2.3.3](#Section_48b4bd5d72064002bde1c34cf614b138). +- The **SMB_Header** MUST be included in full. +- At minimum, the **WordCount** field of the SMB Parameters block MUST be included. The remainder of the SMB_Parameters block MUST be two times **WordCount** bytes in length. If **WordCount** is 0x00, then zero parameter bytes MUST be included in the **SMB_Parameters** block. +- At minimum, the **ByteCount** field of the SMB_Data block MUST be included. The remainder of the SMB_Data block MUST be **ByteCount** bytes in length. If **ByteCount** is 0x0000, then zero data bytes MUST be included in the **SMB_Data** block. Unless otherwise noted, when a Unicode string is passed in the **SMB_Data** block, the string MUST be aligned to a 16-bit boundary with respect to the beginning of the SMB Header (section 2.2.3.1). In the case where the string does not naturally fall on a 16-bit boundary, a null padding byte MUST be inserted before the **SMB_Data.Bytes** field. For Core Protocol messages in which a buffer format byte precedes a Unicode string, the padding byte is found after the **BufferFormat** byte. + +Thus, the minimum size of an SMB message is 35 bytes. Section 2.2.3.1 lists required values for some SMB Header fields. See the individual command descriptions for specific per-message requirements. + +If a message is sent and **IsSigningActive** is TRUE, the message MUST be signed. + +This logic MUST be applied for messages sent in response to any of the higher-layer actions and in compliance with the message sequencing rules. + +- The client or server that sends the message MUST provide the 32-bit sequence number for this message, as specified in sections [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd) and [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). +- The SMB_FLAGS2_SMB_SECURITY_SIGNATURE flag in the header MUST be set. +- To generate the signature, a 32-bit sequence number is copied into the least significant 32 bits of the **SecuritySignature** field and the remaining 4 bytes are set to 0x00. +- The MD5 algorithm, as specified in [\[RFC1321\]](https://go.microsoft.com/fwlink/?LinkId=90275), MUST be used to generate a hash of the SMB message from the start of the SMB Header, which is defined as follows. + +- CALL MD5Init( md5context ) +- CALL MD5Update( md5context, Connection.SigningSessionKey ) +- CALL MD5Update( md5context, Connection.SigningChallengeResponse ) +- CALL MD5Update( md5context, SMB message ) +- CALL MD5Final( digest, md5context ) +- SET signature TO the first 8 bytes of the digest + +The resulting 8-byte signature MUST be copied into the **SecuritySignature** field of the SMB Header, after which the message can be transmitted. + +##### Command Sequence Requirements + +An [**SMB connection**](#gt_e1d88514-18e6-4e2e-a459-20d5e17e9078), a Protocol Negotiation, and an [**SMB session**](#gt_ee1ec898-536f-41c4-9d90-b4f7d981fd67) MUST be established before a message can be sent. That is: + +- An SMB connection MUST be established before any messages can be sent. +- Following SMB connection establishment, an [SMB_COM_NEGOTIATE (section 2.2.4.52)](#Section_96ccc2bd67ba463abb73fd6a9265199e) command MUST be used to establish the [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) dialect to be used before any other SMB command can be sent. Once a dialect has been negotiated, further SMB_COM_NEGOTIATE commands MUST NOT be executed on the connection. Any subsequent [SMB_COM_NEGOTIATE Request (section 2.2.4.52.1)](#Section_25c8c3c958fc4bb8aa8f0272dede84c5) sent to the server on the same connection MUST be failed with an error code of STATUS_INVALID_SMB (ERRSRV/ERRerror). +- Unless otherwise noted, following a successful Protocol Negotiation an [SMB_COM_SESSION_SETUP_ANDX (section 2.2.4.53)](#Section_d902407ce73b46f58f9ea2de2b6085a2) command MUST be used to establish an SMB session before any other SMB commands are sent. Multiple SMB sessions can be set up per SMB connection. + +### Processing Events and Sequencing Rules + +#### Receiving Any Message + +If a message is received and **IsSigningActive** is TRUE, unless otherwise specified, the signature of the message MUST be verified by the client or the server receiving the message. See section [3.2.5.1](#Section_4702ded4cd2f4d2187c97664fb637e5d) and [3.3.5.2](#Section_b09b63d73882458b9c8ec821c706ebdf), respectively. + +This logic MUST be applied for any messages received, as defined in the message sequencing rules: + +- The client or server that receives the message MUST save a temporary copy of the **SMB_Header.SecuritySignature** field of the received message. +- To test the signature, the expected 32-bit sequence number for the received message is copied into the least significant 32 bits of the **SecuritySignature** field, and the remaining 4 bytes of the **SecuritySignature** field are set to 0x00. +- The MD5 algorithm, as specified in [\[RFC1321\]](https://go.microsoft.com/fwlink/?LinkId=90275), MUST be used to generate a hash of the SMB message (from the start of the SMB header), which is defined as follows. + +- CALL MD5Init( md5context ) +- CALL MD5Update( md5context, Connection.SigningSessionKey ) +- CALL MD5Update( md5context, Connection.SigningChallengeResponse ) +- CALL MD5Update( md5context, SMB message ) +- CALL MD5Final( digest, md5context ) +- SET signature TO first 8 bytes of digest + +The resulting 8-byte signature is compared with the original value of the **SecuritySignature** field from the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f). If the signature received with the message does not match the signature calculated, the message MUST be discarded, and no further processing is done on it. The receiver MAY also terminate the connection by disconnecting the underlying transport connection and cleaning up any state associated with the connection. + +#### Algorithms for Challenge/Response Authentication + +There are several challenge/response algorithms supported by [**CIFS**](#gt_fb37399e-d72d-41b6-b073-086da2d96e09) for use with user authentication. Note that CIFS does not support the full protocol defined in [\[MS-NLMP\]](%5bMS-NLMP%5d.pdf#Section_b38c36ed28044868a9ff8dd3182128e4); it makes use of the challenge/response algorithms only. CIFS does not support Extended Session Security because there is no mechanism in CIFS to negotiate Extended Session Security. + +- **The LAN Manager (LM) Response** +- The LAN Manager (LM) response is computed using the DESL() operation defined in \[MS-NLMP\] Appendix A. Specifically: + +- LM_Hash = LMOWFv1( password ); +- LM_Response = DESL( LM_Hash, Challenge ); + +If the client is configured to send the LM response, it MUST be sent in the **OEMPassword field** of the SMB_COM_SESSION_SETUP_ANDX request. The LM response algorithm is described in \[MS-NLMP\] section 3.3.1. + +- **The NT LAN Manager (NTLM) Response** +- The NT LAN Manager (NTLM) response is also computed using the DESL() operation defined in \[MS-NLMP\] Appendix A. Specifically: + +- NTLM_Hash = NTOWFv1( password ); +- NTLM_Response = DESL( NTLM_Hash, Challenge ); + +If the client is configured to send the NTLM response, it MUST be sent in the **UnicodePassword** field of the SMB_COM_SESSION_SETUP_ANDX request. The NTLM response algorithm is described in \[MS-NLMP\] section 3.3.1. + +- **LM v2 Authentication** +- When the client is configured to use LM v2 authentication, the LM responses are replaced with the LMv2 responses:[<186>](#Appendix_A_186) + - The LMv2 response is specified in the calculation of LmChallengeResponse in \[MS-NLMP\] section 3.3.2. +- **NTLM v2 Authentication** +- When the client is configured to use NTLM v2 authentication, the NTLM responses are replaced with the NTLMv2 responses: + - The NTLMv2 response is specified in the calculation of NtChallengeResponse in \[MS-NLMP\] section 3.3.2. + +### Timer Events + +There are no timers common to both client and server. + +### Other Local Events + +There are no local events common to both client and server. + +## Client Details + +### Abstract Data Model + +This section specifies a conceptual model of possible data organization that an implementation maintains to participate in this protocol. The described organization is provided to explain how the protocol behaves. This document does not mandate that implementations adhere to this model as long as their external behavior is consistent with what is described in this document. + +All ADM elements maintained by the client are prefixed with "**Client**". + +#### Global + +The following ADM elements are globally maintained for an individual client: + +**Client.SupportDialects:** A list of client-supported dialect identifiers in order of preference from least to most preferred. + +**Client.ConnectionTable:** A list of SMB [**connections**](#gt_866b0055-ceba-4acf-a692-98452943b981) to servers, as defined in section [3.2.1.2](#Section_0b33fdf6ea2e4f6298c952adf88796f8). The list MUST allow lookups based on **Client.Connection.ServerName**. + +**Client.LMAuthenticationPolicy:** A state that determines the LAN Manager challenge/response authentication mechanism to be used. The following options are available: + +- **Disabled:** LAN Manager challenge/response authentication (LM) is disabled. + +The client MUST NOT return either an LM or LMv2 response. + +- **V1-Enabled:** LAN Manager challenge/response authentication (LM) is enabled. + +If the server supports challenge/response authentication, the client MUST calculate and send the LM response. + +- **V2-Enabled:** LAN Manager v2 challenge/response authentication (LMv2) is enabled. + +If the server supports challenge/response authentication, the client MUST calculate and send the LMv2 response. + +**Client.MaxBufferSize:** The size, in bytes, of the largest SMB message that the client can receive. + +**Client.MessageSigningPolicy:** A state that determines whether this node signs messages. This parameter has three possible values: + +- - **Required:** Message signing is required. Any connection to a server node that does not use signing MUST be disconnected. + - **Enabled:** Message signing is enabled. If the server enables or requires signing, signing MUST be used.[<187>](#Appendix_A_187) + - **Disabled:** Message signing is disabled. Message signing MUST NOT be used. + +**Client.NTLMAuthenticationPolicy:** A state that determines the NT LAN Manager challenge/response authentication mechanism to be used. The following options are available: + +- **Disabled:** NT LAN Manager challenge/response authentication (NTLM) is disabled. + +The client MUST NOT return either an NTLM or NTLMv2 response. + +- **V1-Enabled:** NT LAN Manager challenge/response authentication (NTLM) is enabled. + +If the server supports challenge/response authentication, the client MUST calculate and send the NTLM response. + +- **V2-Enabled:** NT LAN Manager v2 challenge/response authentication (NTLMv2) is enabled. + +If the server supports challenge/response authentication, the client MUST calculate and send the NTLMv2 response. + +If **Client.LMAuthenticationPolicy** and **Client.NTLMAuthenticationPolicy** are both disabled, and **Client.PlaintextAuthenticationPolicy** is enabled, then the client MAY attempt plaintext authentication even if the server supports challenge/response authentication. + +There is no protocol mechanism to allow the client and server to negotiate the challenge/response algorithm to be used. If none of the selected authentication mechanisms matches, authentication MUST fail. + +**Client.PlaintextAuthenticationPolicy:** A state that determines whether plaintext authentication is permitted. The following options are available: + +- **Enabled:** Plaintext authentication enabled. + +If the server does not support challenge/response authentication, the client MUST authenticate using plaintext passwords. The server indicates support for challenge/response authentication using the 0x02 flag bit of the **SecurityMode** field that is returned in the SMB_COM_NEGOTIATE response. + +- **Disabled:** Plaintext authentication disabled. + +If the server does not support challenge/response authentication, the client MUST disconnect from the server. + +**Client.SessionTimeoutValue:** The maximum amount of time, in seconds, that the client will wait for the server to respond to an [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) message. + +**Client.Capabilities:** The set of capabilities, as described in section [1.7](#Section_80850595e3014464974558e4945eb99b) and specified in section [2.2.4.53.1](#Section_81e15dee8fb6410286447eaa7ded63f7), supported by the client. + +#### Per SMB Connection + +**Client.Connection:** An established [**SMB connection**](#gt_e1d88514-18e6-4e2e-a459-20d5e17e9078) between the client and the server. The following ADM elements are maintained for each SMB connection established by a client. + +**Client.Connection.ClientNextSendSequenceNumber:** A sequence number for the next signed request being sent. + +**Client.Connection.ClientResponseSequenceNumber:** A list of the expected sequence numbers for the responses of outstanding signed requests, indexed by [**process identifier (PID)**](#gt_38a420dd-6f31-456e-ae5c-63ec6905380d) value and Multiplex ID (**MID** value). + +**Client.Connection.ConnectionlessSessionID:** Only used if the underlying transport is connectionless. This is an SMB Connection identifier: a server-unique identifier for the connection between the client and the server. + +**Client.Connection.IsSigningActive:** A Boolean that indicates whether or not message signing is active for this SMB connection. + +**Client.Connection.NegotiateSent:** A Boolean that indicates whether an SMB_COM_NEGOTIATE request has been sent for this connection. + +**Client.Connection.NTLMChallenge:** A byte array containing the cryptographic challenge received from the server during protocol negotiation. The challenge is returned in the SMB_COM_NEGOTIATE response. + +**Client.Connection.OpenTable:** A list of Opens, as specified in section [3.2.1.5](#Section_9b04bf6b664e41d5aec17ddc7c92d9ff). This list MUST allow lookups based upon the **Open.FID**. + +**Client.Connection.PIDMIDList:** A list of currently outstanding SMB commands. Each entry MUST include the PID and Multiplex IDs (**MIDs**) assigned to the request and MUST include a time-out time stamp of when the request was sent. For transaction requests (see section [3.2.4.1.5](#Section_9d877a4ac60c40e98520849c5a94fc1d)), each entry MUST include a state variable **TransactionState** to describe the state of the transaction. Each transaction has three states: TransmittedPrimaryRequest, ReceivedInterimResponse, and TransmittedAllRequests. + +The maximum number of entries in the **Client.Connection.PIDMIDList** is limited to the **Client.Connection.MaxMpxCount** value. More than **Client.Connection.MaxMpxCount** commands MUST NOT be outstanding at any given time. + +**Client.Connection.SearchOpenTable:** A list of **SearchOpen**s, as specified in section [3.2.1.6](#Section_19172733fcff46c19ef6fe95d0cfd159), representing currently open file searches on the server associated with the SMB connection. + +**Client.Connection.SelectedDialect:** A variable that stores the SMB Protocol dialect selected for use on this connection. Details of dialects prior to [**NT LAN Manager (NTLM)**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) ("NT LM 0.12") are described in other documents. See the table in section [1.7](#Section_80850595e3014464974558e4945eb99b) for a list of dialects and implementation references. + +**Client.Connection.ServerCapabilities:** The capabilities of the server, as specified in the description of the SMB_COM_NEGOTIATE response, section [2.2.4.52.2](#Section_a4229e1a8a4e489aa2eb11b7f360e60c). The capabilities indirectly reflect the negotiated dialect for this connection. + +**Client.Connection.ServerChallengeResponse:** A Boolean value that indicates whether or not the server supports challenge/response authentication. + +**Client.Connection.ServerSessionKey:** The [**session key**](#gt_4f67a585-fb00-4166-93e8-cf4abca8226d) value returned by the server in the negotiate response. + +**Client.Connection.ServerMaxBufferSize:** The negotiated maximum size, in bytes, for SMB messages sent to the server. This limit applies to all SMB messages sent to the server unless otherwise specified for particular message types. + +**Client.Connection.MaxMpxCount:** The negotiated maximum number of commands that are permitted to be outstanding on a given SMB connection. This value is negotiated between the server and client, and limits the maximum number of entries in the **Client.Connection.PIDMIDList**. + +**Client.Connection.ServerName:** The name of the server. For [**NetBIOS**](#gt_b86c44e6-57df-4c48-8163-5e3fa7bdcff4)\-based transports, this is the NetBIOS name of the server. For other transports, this is a transport-specific identifier that provides a unique name or address for the server. + +**Client.Connection.ServerSigningState:** A value that indicates the signing policy of the server. This value is one of **Disabled**, **Enabled**, or **Required**. + +**Client.Connection.SessionTable:** A list of authenticated sessions that have been established on this SMB connection as defined in section [3.2.1.3](#Section_c42729fbc655424f8d9a44825d609b86). It MUST be possible to look up entries by either the UID or the [**security context**](#gt_88d49f20-6c95-4b64-a52c-c3eca2fe5709) of the user that established the session. + +**Client.Connection.ShareLevelAccessControl:** A Boolean that determines whether the target server requires share passwords (share level access control) instead of user accounts (user level access control). Share level and user level access control are mutually exclusive. The server MUST support one or the other, but not both. + +**Client.Connection.SigningChallengeResponse:** A variable-length byte array that contains the challenge response to use for signing, if signing is active. If SMB signing is activated on the connection (**Client.Connection.IsSigningActive** becomes TRUE), the client response to the server challenge from the first non-null, non-guest session is used for signing all traffic on the SMB connection. The **Client.Connection.SigningChallengeResponse** is set to one of several possible values: + +- **Empty** -- If **Client.Connection.IsSigningActive** is FALSE, no connection signing challenge response is used. +- **LM or LMv2 response** -- The response passed from client to server in the **OEMPassword** field of the SMB_COM_SESSION_SETUP_ANDX request. +- **NTLM or NTLMv2 response** -- The response passed from client to server in the **UnicodePassword** field of the SMB_COM_SESSION_SETUP_ANDX request. + +**Client.Connection.SigningSessionKey:** A variable-length byte array that contains the session key that is used for signing packets, if signing is active. + +If SMB signing is activated on the connection (**Client.Connection.IsSigningActive** becomes TRUE), the session key from the first non-null, non-guest session is used for signing all traffic on the SMB connection. The **Client.Connection.SigningSessionKey** is set to one of three values: + +- **Empty** - If **Client.Connection.IsSigningActive** is FALSE, no connection signing session key is used. +- **LM Session Key** - The LM hash, generated from the user's password using the LMOWFv1() function defined in [\[MS-NLMP\]](%5bMS-NLMP%5d.pdf#Section_b38c36ed28044868a9ff8dd3182128e4) section 3.3.1. +- **NT Session Key** - The NTLM hash, generated from the user's password using the NTOWFv1() function defined in \[MS-NLMP\] section 3.3.1. + +**Client.Connection.TreeConnectTable:** A list of the tree connects over this SMB connection established to shares on the target server, containing the TID for each of the tree connects. It MUST be possible to look up entries either by TID or by share name. + +#### Per SMB Session + +**Client.Session:** An established [**session**](#gt_0cd96b80-a737-4f06-bca4-cf9efb449d12) between the client and server. The following ADM elements are maintained for each [**SMB session**](#gt_ee1ec898-536f-41c4-9d90-b4f7d981fd67) established by a client: + +**Client.Session.Connection:** The [**SMB connection**](#gt_e1d88514-18e6-4e2e-a459-20d5e17e9078) associated with this session. + +**Client.Session.SessionKey:** The cryptographic session key associated with this session, as obtained from the authentication subsystem after successful authentication. + +**Client.Session.SessionUID:** The 2-byte **UID** for this session, representing the user that established the session. The **UID** is returned by the server in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) of the session setup response. All subsequent SMB requests for this user on this connection MUST use this **UID**. + +**Client.Session.UserCredentials:** An opaque implementation-specific entity that identifies the credentials that were used for establishing the session. + +#### Per Tree Connect + +**Client.TreeConnect**: An established [**tree connect**](#gt_c65d1989-3473-4fa9-ac45-6522573823e3) between the client and share on the server. The following ADM elements are maintained for each tree connect established by a client: + +**Client.TreeConnect.Connection**: The [**SMB connection**](#gt_e1d88514-18e6-4e2e-a459-20d5e17e9078) associated with this tree connect. + +**Client.TreeConnect.ShareName**: The share name corresponding to this tree connect. + +**Client.TreeConnect.TreeID**: The TreeID (**TID**) that identifies this tree connect as returned by the server in the header of the [SMB_COM_TREE_CONNECT Response (section 2.2.4.50.2)](#Section_f9a8a7131c534fb0908e625389840cf8) or the [SMB_COM_TREE_CONNECT_ANDX Response (section 2.2.4.55.2)](#Section_3286744b5b584ad5b62ec4f29a2492f1). + +**Client.TreeConnect.Session**: A reference to the session on which this tree connect was established. + +**Client.TreeConnect.IsDfsShare**: A Boolean that, if set, indicates that the tree connect was established to a [**DFS**](#gt_0b8086c9-d025-45b8-bf09-6b5eca72713e) share. + +#### Per Unique Open + +**Client.Open:** A file or [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca) on the server opened through the established **Client.TreeConnect**. The following ADM elements are maintained for each **open** held by a client: + +**Client.Open.Connection:** The SMB connection associated with this **open**. + +**Client.Open.FID:** The **FID** associated with the **open**, as returned by the server in the response to an open or create request. + +**Client.Open.NamedPipeMessageMode**: A Boolean indicating whether the named pipe is in raw or [**byte mode**](#gt_8586fe9a-1cfa-458a-a145-8db64d69c69c) (FALSE) or in [**message mode**](#gt_c49a48e8-f1ac-4568-bc87-0672eb08868b) (TRUE). This ADM element is used only for named pipe **opens**. + +**Client.Open.OpLock:** An element indicating the type of OpLock, if any, that has been granted on this **open**. This value MUST be one of **None, Exclusive**, **Batch**, or **Level II**.[<188>](#Appendix_A_188) + +**Client.Open.Session:** The SMB session associated with this **open**. + +**Client.Open.TreeConnect:** The tree connect associated with this **open**. + +#### Per Unique Open Search + +**Client.SearchOpen:** A search operation that is being performed through the established **Client.TreeConnect**. The following ADM elements are maintained for each **SearchID** open search held by a client: + +**Client.SearchOpen.FindSID:** The search ID (**SID**) that identifies a search opened using the [TRANS2_FIND_FIRST2 (section 2.2.6.2)](#Section_a782468b56f14066bb6ee2630f0e8695) subcommand. + +**Client.SearchOpen.TreeConnect:** The [**tree connect**](#gt_c65d1989-3473-4fa9-ac45-6522573823e3) associated with this open search. + +### Timers + +#### Request Expiration Timer + +This optional timer regulates the amount of time that the client SHOULD[<189>](#Appendix_A_189) wait for the server to respond to an SMB request; see section [3.2.6.1](#Section_048f3f3f243f46cd99c2e2e2853a6cb4). + +### Initialization + +When the CIFS client is started, the following values MUST be initialized: + +- Values for **Client.PlaintextAuthenticationPolicy**, **Client.LMAuthenticationPolicy**, and **Client.NTLMAuthenticationPolicy** MUST be set based on system policy and implementation capabilities, and MUST be one of the possible values listed in section [3.2.1.1](#Section_4a242e20b3ca426b8727c04e0cfbbd5a).[<190>](#Appendix_A_190) +- Values for **Client.MessageSigningPolicy** MUST be set based on system policy and MUST be one of the possible values listed in section 3.2.1.1. The value of this element is not constrained by the values of any other policies.[<191>](#Appendix_A_191) +- **Client.ConnectionTable** MUST be empty. +- **Client.SessionTimeoutValue** MUST be set based on system policy.[<192>](#Appendix_A_192) +- **Client.MaxBufferSize** MUST be set based on system resource allocation policy.[<193>](#Appendix_A_193) +- **Client.SupportDialects** MUST be set to the list of dialect identifiers that the client supports, presented in section [1.7](#Section_80850595e3014464974558e4945eb99b).[<194>](#Appendix_A_194) +- **Client.Capabilities** MUST be set based on the capabilities of the local implementation. The specific bits to set in this ADM element are specified in section [2.2.4.53.1](#Section_81e15dee8fb6410286447eaa7ded63f7). + +When an SMB connection is established, the following values MUST be initialized: + +- **Client.Connection.ClientNextSendSequenceNumber** MUST be set to 2. +- **Client.Connection.ClientResponseSequenceNumber** MUST be an empty list. +- **Client.Connection.ConnectionlessSessionID** MUST be set to zero. +- **Client.Connection.IsSigningActive** is set to FALSE. +- **Client.Connection.NegotiateSent** MUST be set to FALSE. +- **Client.Connection.NTLMChallenge** MUST be set to zero. +- **Client.Connection.OpenTable** MUST be empty. +- **Client.Connection.PIDMIDList** MUST be empty. +- **Client.Connection.SearchOpenTable** MUST be empty. +- **Client.Connection.SelectedDialect** MUST be empty. +- **Client.Connection.ServerCapabilities** MUST be set to zero. +- **Client.Connection.ServerChallengeResponse** MUST be set to FALSE. +- **Client.Connection.ServerMaxBufferSize** MUST be set to zero. +- **Client.Connection.MaxMpxCount** MUST be set based on system policy.[<195>](#Appendix_A_195) +- **Client.Connection.ServerName** MUST be set to the name of the server to which the connection is being established. +- **Client.Connection.ServerSigningState** MUST be **Disabled**. +- **Client.Connection.SessionTable** MUST be empty. +- **Client.Connection.ShareLevelAccessControl** MUST be set to FALSE. +- **Client.Connection.SigningChallengeResponse** MUST be a zero-length array. +- **Client.Connection.SigningSessionKey** MUST be set to zero. +- **Client.Connection.TreeConnectTable** MUST be empty. + +When a new SMB session is established, the following values MUST be initialized: + +- **Client.Session.Connection** MUST be the SMB connection associated with this SMB session. +- **Client.Session.SessionKey** MUST be zero. +- **Client.Session.SessionUID** MUST be the server-supplied UID for this SMB session. +- **Client.Session.UserCredentials** MUST be set to empty. + +When a new tree connect is established, the following values MUST be initialized: + +- **Client.TreeConnect.Connection** MUST be the SMB connection associated with this tree connect. +- **Client.TreeConnect.ShareName** MUST be the name of the share to which the client is connecting. +- **Client.TreeConnect.TreeID** MUST be the server-supplied TID for this tree connect. + +### Higher-Layer Triggered Events + +#### Sending Any Message + +Messages sent by the client MUST conform to the rules specified in section [3.1.4.1](#Section_68c3d17ae48e4eb4b97e3246bfe0262f), with the following additional requirements: + +- The **SMB_Header.Status** field MUST be set to zero (0x00000000). +- The SMB_FLAGS_REPLY bit in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) MUST be clear. +- The client MUST allocate or assign buffers to receive any parameters and/or data to be returned in the response message. + +The caller MUST provide the following: + +- A buffer containing the message to be sent. +- Exactly one of the following: + - The [**SMB connection**](#gt_e1d88514-18e6-4e2e-a459-20d5e17e9078) (**Client.Connection**) identifying the transport connection on which to send the request. + +OR + +- - One or both of the **Client.Session** and **Client.TreeConnect** identifying the authenticated user and share respectively. + +If both the **Client.Session** and **Client.TreeConnect**, are supplied by the caller, **Client.Session.Connection** MUST match **Client.TreeConnect.Connection**. + +If the Connection was supplied by the caller, the same MUST be used to send the request. Otherwise, the connection identified by **Client.Session.Connection** (or, equivalently, **Client.TreeConnect.Connection**) MUST be used to send the request. + +If a **Client.Session** is supplied by the caller, the **SMB_Header.UID** field MUST be set to **Client.Session.SessionUID**. Otherwise, the client MUST set the **SMB_Header.UID** field to 0x0000. + +If a **Client.TreeConnect** is supplied by the caller, the **SMB_Header.TID** MUST be set to **Client.TreeConnect.TreeID**. Otherwise, the client MUST set the **SMB_Header.TID** field to 0xFFFF. + +The value of **SMB_Header.PID** MUST be assigned as specified in section [2.2.1.6.3](#Section_86ccac531189492799720ff92a1409b2), and the value of **SMB_Header.MID** MUST be assigned as specified in section [2.2.1.6.2](#Section_9ab1f759689d481ab160b8f0eb09f5fb). + +##### Command Processing + +SMB Commands are made up of one or more messages exchanged between the client and the server. Several command requests MAY be sent together in a single message (see sections [3.2.4.1.4](#Section_7f1d40344b1f4602bfd5394c56b9de46) and [3.2.5.1.3](#Section_bf78ccc13b3d475d8124eeebe780b569)) or, at the other extreme, a single command MAY require several messages to complete (for example, Write MPX or any of the Transaction requests). + +When a command is initiated by an application on the client, the **PID** and **MID** values of the command MUST be entered into the **Client.Connection.PIDMIDList** table. A single command MAY consist of several messages exchanged between the client and server. All messages that are part of the same command exchange MUST have the same **PID** and **MID** values. If a [Request Expiration Timer (section 3.2.2.1)](#Section_e81016e6ef9146b0bd19cf959eb7cc31) is supported, the client MUST set the Request Expiration Timer to signal at the configured time-out interval for this command, and each **PIDMIDList** entry MUST include the time-out time stamp of the command. If the command is sent to the server in multiple messages, the time-out time stamp MUST be updated when each part of the message is sent. The client MUST NOT allow another command with the same **PID** and **MID** values to start execution until the pending command has completed. + +The SMB_COM_NT_CANCEL command is the only exception. SMB_COM_NT_CANCEL is used to cancel a pending command, and MUST use the same **PID** and **MID** as the command to be canceled. The **UID** and **TID** of the SMB_COM_NT_CANCEL command MUST also match those of the command to be canceled. The **PID** and **MID** values of the SMB_COM_NT_CANCEL command MUST NOT be entered into the **Client.Connection.PIDMIDList** table. No response to SMB_COM_NT_CANCEL is sent by the server (as specified in section [2.2.4.65](#Section_bf04c12be5ee41079b760e5ffda9cc3f)), and the client MUST NOT perform reply processing or maintenance of session timeouts, or invoke retry or session disconnection for this command. + +Once a command has completed processing, its **Client.Connection.PIDMIDList** entry MUST be removed from the list and discarded. + +##### Processing Options + +The client keeps track of which optional processing features (Unicode, DFS, and so on) a server provides in the **Client.Connection.ServerCapabilities** state variable. Many of these features require that the client indicate that it uses them on a per-message basis. This is achieved by setting a flag corresponding to a feature in the **Flags2** field of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f). + +##### Message Signing + +If signing is active for the connection on which a message is sent, the message MUST be signed, as specified in section [3.1.4.1](#Section_68c3d17ae48e4eb4b97e3246bfe0262f), by providing the sequence number that is stored in **Client.Connection.ClientNextSendSequenceNumber**. The client MUST maintain the appropriate sequence number for a response. It does so by inserting the number into the **Client.Connection.ClientResponseSequenceNumber** table with the **PID**/**MID** pair that identifies the request/response pair. (**PID** and **MID** are specified in section [2.2.3.1](#Section_69a29f73de0c45a6a1aa8ceeea42217f). **PID** is the result of combining the **PIDLow** and **PIDHigh** fields of the SMB Header (section 2.2.3.1).) + +After signing the message with **Client.Connection.ClientNextSendSequenceNumber**, the following steps MUST be taken: + +- IF request command EQUALS SMB_COM_NT_CANCEL THEN +- INCREMENT Client.Connection.ClientNextSendSequenceNumber +- ELSE IF request has no response THEN +- INCREMENT Client.Connection.ClientNextSendSequenceNumber BY 2 +- ELSE +- SET Client.Connection.ClientResponseSequenceNumber\[PID,MID\] TO +- Client.Connection.ClientNextSendSequenceNumber + 1 +- INCREMENT Client.Connection.ClientNextSendSequenceNumber BY 2 +- END IF + +The [SMB_COM_NT_CANCEL](#Section_bf04c12be5ee41079b760e5ffda9cc3f) command is defined in section 2.2.4.65. + +To guarantee that the sequence numbers match during server validation, the client MUST ensure that packets are sent to the server in the same order in which they are signed. + +##### Sending Any Batched ("AndX") Request + +When sending a Batched request, the client MUST construct the message as follows: + +The first request to be batched MUST be an AndX SMB command request, and MUST be included in full. That is, the **SMB_Header**, **SMB_Parameters**, and **SMB_Data** blocks of the request MUST be constructed, as specified in the corresponding subsection of Higher-Layer Triggered Events (section [3.2.4](#Section_84050b9dc2224a0cb7f87ee839a98b21)), with the following additional constraints: + +- The SMB_Header of the first command MUST be the only header in the message. Follow-on commands are appended to the message without the header. +- The **SMB_Parameters.AndXCommand** field MUST contain either the command code of a valid follow-on command request to be batched, or SMB_COM_NO_ANDX_COMMAND (0xFF). + - If **SMB_Parameters.AndXCommand** contains SMB_COM_NO_ANDX_COMMAND, the chain is terminated. If **SMB_Parameters.AndXOffset** is set to 0, no further command requests can be added to the AndX Chain. + - If **SMB_Parameters.AndXCommand** is a valid follow-on command code, the **SMB_Parameters.AndXOffset** field MUST be set to the offset, in bytes, from the start of the SMB_Header block, of the follow-on command request's **Parameters** block. +- If **SMB_Parameters.AndXCommand** is a valid follow-on command code: + - The **SMB_Parameters** and **SMB_Data** block pair of the follow-on command request MUST be constructed as specified in the corresponding subsection of Higher-Layer Triggered Events (section 3.2.4). The block pair MUST be appended to the end of the message, and the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) of the follow-on message MUST NOT be included. + - If the follow-on command is NOT an AndX command, the chain is terminated and no further command requests can be added to the chain. +- If the follow-on command is an AndX command, the process repeats starting at step 2.[<196>](#Appendix_A_196) + +The total size of the AndX message MUST NOT exceed the negotiated **Client.Connection.ServerMaxBufferSize**. + +If signing is active for the connection on which a message is sent, the AndX message MUST be signed as a single message. + +##### Sending Any Transaction + +The Transaction SMB Commands are generic operations. They provide transport for extended sets of subcommands which, in turn, allow the CIFS client to access advanced features on the server. CIFS supports three different transaction messages, which differ only slightly in their construction: + +- [SMB_COM_TRANSACTION (section 2.2.4.33)](#Section_0ed1ad9fab964a7ab94a0915f3796781) +- [SMB_COM_TRANSACTION2 (section 2.2.4.46)](#Section_3d9d8f3edc70410da3fc6f4a881e8cab) +- [SMB_COM_NT_TRANSACT (section 2.2.4.62)](#Section_55db04d6105f45d184ac6972c0a1ddc8) + +Transactions messages MAY exceed the maximum size of a single SMB message (as determined by the value of the **Client.Connection.ServerMaxBufferSize** parameter). Transaction messages that do not fit within a single SMB message MUST be split across multiple transaction SMBs. Each SMB transaction request has an associated secondary request message for this purpose: + +- [SMB_COM_TRANSACTION_SECONDARY (section 2.2.4.34)](#Section_a4c643871dc445fbb01f9ad8b69e83e1) +- [SMB_COM_TRANSACTION2_SECONDARY (section 2.2.4.47)](#Section_80207e036cd64bbe863fdb52f4d2cb1a) +- [SMB_COM_NT_TRANSACT_SECONDARY (section 2.2.4.63)](#Section_0941c749cbf34c1b91b2b013a7473827) + +There are no secondary response messages. The client MUST send as many secondary requests as are needed to complete the transfer of the transaction request. The server MUST respond to the transaction request as a whole. If the server's transaction response exceeds the maximum size of a single SMB message, then the server MUST send multiple SMB responses to the request. + +Like SMB messages, transactions are a rudimentary form of remote procedure call. Transaction subcommands identify operations to be performed, the parameters to pass to the operation, and raw data upon which to operate. The response also includes parameters and data. + +Transactions are made up of four SMB message types. The set of all messages sent and received in order to perform a particular operation is referred to as a transaction. + +- A "primary request" MUST be sent by the client to initiate the transaction. This message also includes the total size of the transaction, which might not fit into a single request. If the primary request is sent as part of a batched message, the size of the entire batch message including the primary request MUST NOT exceed the negotiated **Client.Connection.ServerMaxBufferSize**. +- If all of the parameters and data for the transaction request do not fit within the primary request, a single "interim response" MUST be sent by the server. +- If an interim response is sent, and no error is returned in the interim response, then a "secondary request" MUST be used to continue a transaction started with a primary request. This message is sent by the client only. The client sends as many secondary requests as are necessary to complete the transaction. The server MUST NOT process the transaction until the entire transaction request has been transferred. +- A "final response" MUST be sent by the CIFS server when the transaction has been processed. If the results of the transaction (the transaction response) do not fit within a single SMB response message, multiple final response messages MUST be sent. +- Transaction response messages MUST NOT be sent in response to transaction requests sent as class 2 mailslot messages. See [\[MS-MAIL\]](%5bMS-MAIL%5d.pdf#Section_8ea19aa46e5a4aedb6280b5cd75a1ab9) for more information on mailslot protocols. + +In its simplest form, a transaction consists of a single primary request to the server followed by a single final response. + +![Simple Transaction](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVIAAADOCAYAAABsBopjAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAACw4AAAsPAVml0AAAABSPSURBVHhe7Z0vlFNHG4eRSGRlBeITFSsqKioQFRUILKKiElGBQCAqkUgkAoGpqEAgKlZUIBArKhCIFRVIBAKb7zzb/XFehptssrkTZpPnOWdO7p3/d+6dJ2+yLbn2/v37xe+//26aMbGmIiPy8ePHxaNHjyafW9Pl0unp6eIaB7du3ZqsYNo8ZS1FRuTp06eLo6OjL55b0+XSnTt3Fr/++ut/IiXJPLieMjKIlI0v85D1VKQz43rKyCjSeVGknXA9ZWQU6bwo0k64njIyinReFGknXE8ZGUU6L4q0E66njIwinRdF2gnXU0ZGkc6LIu2E6ykjo0jnRZF2wvWUkVGk86JIO+F6ysgo0nlRpJ1wPWVkFOm8KNJOuJ4yMop0XhRpJ1xPGRlFOi+KtBOup4yMIp0XRdoJ11NGRpHOiyLthOspI6NI50WRdsL1lJFRpPOiSDvhesrIKNJ5UaSdcD1lZBTpvC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05OThbHx8fnZyKyz7x582bx8uXL87PRWSz+D7CiPzwgOooyAAAAAElFTkSuQmCC) + +Figure 3: Simple Transaction + +The client MUST set the **TransactionState** for the request (in **Client.Connection.PIDMIDList**) to "TransmittedAllRequests". + +If a transaction request does not fit within a single SMB message, the following messages are exchanged: + +- The CIFS client MUST send a primary request that indicates that more messages are to follow. The client indicates that the transaction request is incomplete by setting the **ParameterCount** value less than the **TotalParameterCount**, or by setting the **DataCount** value less than the **TotalDataCount**, or both. After sending the primary request, the client MUST set the **TransactionState** for the request (in **Client.Connection.PIDMIDList**) to "TransmittedPrimaryRequest".[<197>](#Appendix_A_197) +- Upon receiving a primary request containing an incomplete transaction, the server MUST check for any initial errors and MUST return a single interim response. +- The response received from the server MUST be processed as described in section [3.2.5.1.4](#Section_1180dedb2c564b3a84ceaa8e4a51cdad). + +![Transaction with secondary messages to complete the message transfer](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVIAAAFeCAYAAADXF5eUAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAACw4AAAsQAZT/3p4AACpRSURBVHhe7Z0tmBRJ1kaRLZFIxAjECsQKxAokYgQWMWLFCsQKBAKBWIFEIlYgEJgRCAQSsaIlEoFAjkQgEGvq+05Nv+wlyPrJrozurM5znieeyp8bkZFZEaduZjXUtS9fvqyePn1qmbBwTUXmyLdv31bPnj0bHLeW85XPnz+vrrFw9+7dwQDL+JJrKTJHXr58ubp9+/ZP49ZyvnL//v3V3//+9z9FSpFp8HrKnEGkTHyZhlxPRToxXk+ZM4p0WhRpJ7yeMmcU6bQo0k54PWXOKNJpUaSd8HrKnFGk06JIO+H1lDmjSKdFkXbC6ylzRpFOiyLthNdT5owinRZF2gmvp8wZRTotirQTXk+ZM4p0WhRpJ7yeMmcU6bQo0k54PWXOKNJpUaSd8HrKnFGk06JIO+H1lDmjSKdFkXbC6ylzRpFOiyLthNdT5owinRZF2gmvp8wZRTotirQTXk+ZM4p0WhRp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hX56Gy5LQJF2Yl8xhl3xVaApDx8+PNu7Heoiy6dPn67r3L17d3Xjxo11G3fu3Fndu3dv9fLly7PoP/9kqH5xky+Psg05tl9GgRmnLBVF2ompRDok0BQEGIhDdMjy0aNHa1nevHlzHXf79u11LPsQIHG5BR8CIdIX3mgKx69iFZEfUaSdOFSk2wSacnJy8oMskSeyfP78+Vp8nz9/PmtNRHqiSDtxXpHuI9BavJ0WuXwUaSfOI9Jbt26tM8shYW4qHz9+PGtBRC4LRdqJ84i0xvNtOl8APXnyZH3Lfv369UGR8iWSiFwuirQTh4p0CL4gyhdKDx48WGevPA8VkctFkXaih0hFZJ4o0k4oUpHloEg7oUhFloMi7YQiFVkOirQTilRkOSjSTihSkeWgSDuhSEWWgyLthCIVWQ6KtBOKVGQ5IEb+9SH/WGafwj+mUaR7oEhFlsN//vOf1W+//faTMH/99de1NNvt//znP2f5rxIVqYjMDv6/DLLVY0GRiogciCIVkdlhRnogilREFOmBKFIROTYUqYjMDjPSA1GkIqJID0SRisixoUhFZHaYkR6IIhURRXogilREjg1FKiKzw4z0QBSpiCjSA1GkInJsKFIRmR1mpAeiSEVEkR6IIhWRY0ORisjsMCM9EEUqIor0QBSpiBwbilREZocZ6YEoUhFRpAeCFG/evPnTz7BuKsQqUhG5TGYn0t9//331j3/84ydhJvNstxNLHRG5OpiRdiLiFJGrjyIVEVkYZqQiMjvMSDuhSEWWgyIVEVkYZqQiMjvMSDuhSEWWgyIVEVkYZqQiMjvMSDuhSEWWgyIVEVkYZqQiMjvMSDuhSEWWgyIVEVkYZqQiMjvMSDuhSEWWgyIVEVkYZqQiMjvMSDuhSEWWgyIVEVkYZqQiMjvMSDuhSEWWgyIVEVkYZqQiMjvMSDuhSEWWgyIVEVkYZqQiMjvMSDvx4cOH1fv378/WROQq8/Hjx9W7d+/O1ubOavV/b7CN3BdTuCkAAAAASUVORK5CYII=) + +Figure 4: Transaction with secondary messages to complete the message transfer + +Once it has received the entire request, the server MUST process the transaction and MUST finish with a transaction response. If the transaction response does not fit within a single SMB message, the following messages are exchanged: + +- The server MUST send a final response that indicates that additional response messages are to follow. +- The server MUST send as many final response messages as are needed to complete the transfer of transaction parameters and data. + +![Transaction response with multiple SMB response messages](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVIAAAEuCAYAAADcNZpVAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAACw4AAAsQAZT/3p4AACOhSURBVHhe7Z0tlBzH2UYFDAQFDQUMBAwEAgwCDD4QEGASYBgQYGggYCAQIGhoaCBgEiAgYChoKGggIBAgYGAgIBCy37mTfZzX5Z6f3umaqZm+95w6011/3dtVdeftnt2de7/++uvN06dPTQsmrqnIiHz48OHm2bNnk/PWdLf09u3bm3tsfP7555MVTPNTrqXIiHz//fc3jx8//sO8Nd0tffHFFzd///vf/ytSkiyD11NGBpGy8GUZcj0V6cJ4PWVkFOmyKNJOeD1lZBTpsijSTng9ZWQU6bIo0k54PWVkFOmyKNJOeD1lZBTpsijSTng9ZWQU6bIo0k54PWVkFOmyKNJOeD1lZBTpsijSTng9ZWQU6bIo0k54PWVkFOmyKNJOeD1lZBTpsijSTng9ZWQU6bIo0k54PWVkFOmyKNJOeD1lZBTpsijSTng9ZWQU6bIo0k54PWVkFOmyKNJOeD1lZBTpsijSTng9ZWQU6bIo0k54PWVkFOmyDCfS169f325dNopURkaRLsvJRfrdd9/d/PnPf/4tPXny5ObNmze3pTc3n3zyyW8y5cSWHOxXr15tjn8KFKmMTC+Rvnz58nfrm2/XfP78+W3p9XJSkebicmGRJWLj4OSFKlKkt6T4+B7veqyeKFIZmR4iZa2yfrO+SQRK5F07JxPpLolFnFBF+v79+99Fq/Du3btNXyREXKEubcinvJUwg8o5ZJB7okhlZHqIlLXFujsEZDu1RiFrk/XM9pQHoF3Dh7gB0ueSnEykCPKQi1xFSv0qXy5++iG1fVKXPF7zTsitBXAh2U958nuhSGVkeon0kD5Tj7XLK2sysPazbrNWkWKtA23eIW4gpc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HrR5GKiKwMI1IRGQ4j0k4oUpH1oEhFRFaGEamIDIcRaScUqch6UKQiIivDiFREhsOItBOKVGQ9KFIRkZVhRCoiw2FE2glFKrIeFKmIyMowIhWR4TAi7YQiFVkPilREZGUYkYrIcBiRdkKRiqwHRSoisjKMSEVkOIxIO6FIRdaDIhURWRlGpCIyHEaknVCkIutBkYqIrAwjUhEZDiPSTihSkfWgSEVEVoYRqYgMhxFpJxSpyHpQpCIiK8OIVESGw4i0E4pUZD0oUhGRlWFEKiLDYUTaCUUqsh4UqYjIyjAiFZHhMCLthCIVWQ8///zzzY8//ni7Nz7e2ouIHIkRqYjIkShSEZEj8dZeRORIjEhFRI5EkYqIHIm39iIiR2JEKiJyJIpURORIvLUXETkSI1IRkSO5GJG+fv365tWrV7d7IiKjcHPz/83cwmu8kgtpAAAAAElFTkSuQmCC) + +Figure 5: Transaction response with multiple SMB response messages + +The number of SMB messages needed to transfer a transaction request is independent of the number of messages that can be returned. A single-part request can generate a single response or a multi-part response. Likewise, a multi-part request MAY generate one or more final response SMBs. + +Secondary requests SHOULD NOT be used if the transaction request can fit within a single SMB message. Similarly, multiple final response messages SHOULD NOT be used if the transaction response can fit within a single SMB message. + +Transaction parameters SHOULD take precedence over transaction data; all transaction parameters SHOULD be transferred before any transaction data. + +All messages that are part of the same transaction MUST have the same **UID**, **TID**, [**PID**](#gt_38a420dd-6f31-456e-ae5c-63ec6905380d), and **MID** values. If a connectionless transport is in use, the **CID** MUST also be the same for all transaction messages that are part of the same transaction. The client MUST NOT start a new transaction if it has not completed a previous transaction with the same PID and **MID** values. The client MAY start multiple concurrent transactions as long as at least one of the values of PID or **MID** differs from all other in-process transactions. + +##### Accessing a Share in the DFS Namespace + +If: + +- The server has negotiated the [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) dialect or later (SMB_COM_NEGOTIATE section [2.2.4.51](#Section_31cc172a80844f0baad6d8d69da76a0e)), +- The server has negotiated [**DFS**](#gt_0b8086c9-d025-45b8-bf09-6b5eca72713e) capabilities via the CAP_DFS flag (SMB_COM_NEGOTIATE section 2.2.4.51), +- The server has set the SMB_SHARE_IS_IN_DFS flag in the [SMB_COM_TREE_CONNECT_ANDX response (section 2.2.4.55.2)](#Section_3286744b5b584ad5b62ec4f29a2492f1) for the share, + +Then the share is in the DFS namespace (a "DFS share") and the client MUST set **Client.TreeConnect.IsDfsShare** to TRUE. The client MUST set the SMB_FLAGS2_DFS flag in the header of any message that contains a pathname to an object within the share (a [**DFS path**](#gt_151c87db-05a4-40c3-99bd-4b682530d210)). The pathname MUST have the full file name, including the server name and share name. + +#### Application Requests Connecting to a Share + +The application provides the following: + +- **ServerName**: The name of the server to which to connect. +- **ShareName**: The name of the share to which to connect. +- **UserCredentials**: An opaque implementation-specific entity that identifies the credentials to be used when authenticating to the remote server. +- **IsDFSShare:** A Boolean indicating whether this is a **DFS** share. +- **TransportIdentifier:** An optional implementation-specific identifier for the transport on which the connection is to be established. + +Upon successful completion, the client MUST return an existing or newly constructed [Session (section 3.2.1.3)](#Section_c42729fbc655424f8d9a44825d609b86), an existing or newly constructed [TreeConnect (section 3.2.1.4)](#Section_c3ddee8909f742049ccd842802a6bd8d), and the share type to the caller. + +The client MUST follow the steps as described in the following flowchart. The request to connect to a server can be either explicit (for example, the application requests an SMB connection to \\\\server\\share) or implicit (for example, the application requests to open the file \\\\server\\share\\file.txt, which implies that an SMB connection to \\\\server\\share is being established). In either case, the following steps are followed. The only difference is that for the implicit case, the error returned in the failure case MUST be returned as the error of the operation that caused the implicit connect attempt. + +![Application that connects to a share on a server](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAj8AAAKUCAYAAADrd1kaAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAD+wAAA/tAZ0ndygAAIrMSURBVHhe7Z0tuBU5ura3OAKJRCIQLUYgRiAQIxEtMEe0GDES0QKBaIFo0aIF4oiWLRCYIxAIxIgRR7REtkAgPtESgcDuj3vt/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aFdI5lolS+WG6tcO/eveykmAv8dhT114S5FTBCXI9U5IwVP6XvxjXDIMoQinhda8L1fPz48ekzd/1ygWsa+4ODw9GCbLbEjGCsM65LYFfIz3Fahc6V79BeQPxooUMcTvyUyIkfBkq8cwA9WxJhsHD8FuhyexEkePjVcEHnqCV+aMt4bpabuQ5q43hNuBYyZqTLyJ1ze0WDxzHkjdeQNI4lXWVCTmCtSbwu1IvvQlp6TWNgvzHmW/HDGIp2A2S3o/3OvfRi9ofFzzU58QNMigwEBSYgQkzruptYm5z4yQmeSE3xgyGKbUmIBot6c13SfYiceAxihhDTuE5AGTFdoiiWS3mkx7RU+K5N6bp0CSGLH2OuwHZHWwKM8zjGCRDjhK3czJrlsPjpSbxbEHH1YCtI/JwTPJGa4idSas+uds5dl1wa9L2GpePXps91oa5RCFn8GHOeMbbG7AuLn53BG0F9BE9kK+LHfM3Q64IQ8g/UGmPMeSx+jMXPRvF1McaYZbD4MZ5kN4qvizHGLIPFj/Eku1F8XYwxZhksfown2Y3i62KMMctg8WMuf/jhh9N/hjbbwuLHGGOWweLHnP6LMD/5YbYF/3nb/2/EGGPmx+LHnP4R2E8//XQdM1uB/9XEvy4wxhgzLxY/5vLPP/+8/O67765jZgv88ccfp99pM8YYMz8WP+bE7du3v/nhN1OPp0+fnoIxxpj5sfgxJ3jmh2d/TH1wdbESt5Wf2TDGmL1h8WM+4wdst4EfQDfGmGWx+DGf4dkfBNDHjx+vU8za8Go7r7gbY4xZDosf8xX8KOqDBw8sgCrAqhvi0294GWPMslj8mG/gHx7yppFdYOvx22+/ndrcD50bY8zyWPyYLFqFePTokSfkBXn9+vXndvZqmzHGrIPFj+mEFQleg+ftI/4RIq9f4xrj2RSH4YH2pA3/9a9/nf6JIS5Gr7AZY8y6WPyYXvAwNP8Jmon74cOHp4dyHYYHVnhow99//93P9hhjTBUuL/8/+hA5AHjf10EAAAAASUVORK5CYII=) + +Figure 6: Application that connects to a share on a server + +To complete a successful [**share connect**](#gt_956367c4-c5cb-49a4-bf4b-9bd1596ed5d0), the client MUST have an established SMB connection, an authenticated SMB session for the user initiating the call, and a tree connect to the target share. + +##### Connection Establishment + +The client SHOULD search the **Client.ConnectionTable** and attempt to find an SMB connection where **Client.Connection.ServerName** matches the application-supplied **ServerName**. If a connection is found, the client SHOULD use the existing connection. + +If there is no existing SMB connection, a new SMB connection MUST be established. + +The **ServerName** and the optional **TransportIdentifier** provided by the caller are used to establish the connection. The client SHOULD resolve the **ServerName** as described in [\[MS-WPO\]](%5bMS-WPO%5d.pdf#Section_c5f54a7765be40a0bb829e4181d8ab67) section 6.1.3 and SHOULD attempt connections to one or more of the returned addresses. The client MAY attempt to initiate the SMB connection on all [**SMB transports**](#gt_f8b0f8a6-e412-459a-b8ba-219008e5bcd7) that it supports, most commonly NetBIOS over TCP (NBT, as described in section [2.1.1.2](#Section_45170055a0cd49109228801d5bf7ac84)) and the other transports described in section [2.1](#Section_56df901359444ccf970b67c30ef5c449). The client MAY choose to prioritize the SMB transport order and try each SMB transport sequentially or try to connect on all SMB transports and select one using any implementation-specific heuristic. The client MAY accept the **TransportIdentifier** parameter from the calling application, which specifies what SMB transport to use, and then attempt to use the transport specified.[<198>](#Appendix_A_198) + +If all connection attempts fail, the connection establishment is failed and an appropriate error is returned, which is passed back to the calling application, as described earlier. + +If the connect attempt succeeds, the client MUST create a new SMB connection as described in [3.2.1.2](#Section_0b33fdf6ea2e4f6298c952adf88796f8) and insert it into the global **Client.ConnectionTable**. **Client.Connection.ServerName** MUST be set to the caller-supplied **ServerName**. + +##### Dialect Negotiation + +If **Client.Connection.NegotiateSent** is FALSE, the client MUST set **SMB_Dialect.DialectString** to **Client.SupportDialects** and negotiate a protocol dialect using the [SMB_COM_NEGOTIATE](#Section_96ccc2bd67ba463abb73fd6a9265199e) command, as specified in section 2.2.4.52. This step MUST be completed before progressing to any other operations on the connection. + +Upon receipt of the server response the client MUST complete the following steps: + +- The client MUST set **Client.Connection.NegotiateSent** to TRUE. +- The CIFS client MUST examine the **DialectIndex** field in the SMB_COM_NEGOTIATE Server response to determine the negotiated dialect. If an error was returned, or no dialect was selected, then the Negotiate Protocol operation has failed. Otherwise, the selected dialect is stored in **Client.Connection.SelectedDialect**. +- The CIFS client examines the **SecurityMode** bit field in the SMB_COM_NEGOTIATE Server response and performs the following steps in sequence: + - If the 0x01 bit is zero, **Client.Connection.ShareLevelAccessControl** MUST be set to TRUE. + - If the 0x02 bit is set (1), **Client.Connection.ServerChallengeResponse** MUST be set to TRUE. + - If **Client.Connection.ServerChallengeResponse** is TRUE and the 0x04 bit is set (1), **Client.Connection.ServerSigningState** MUST be set to **Enabled**. + - If **Client.Connection.ServerSigningState** is **Enabled** and the 0x08 bit is set (1), **Client.Connection.ServerSigningState** MUST be set to **Required**. +- The server capabilities, as returned in the **Capabilities** field of the SMB_COM_NEGOTIATE Server response, MUST be stored in **Client.Connection.ServerCapabilities**. +- The server's maximum buffer size (which is, with specific exceptions, the maximum size of an SMB message that can be sent to the server) MUST be stored in **Client.Connection.ServerMaxBufferSize**. + +If the Negotiate Protocol operation fails, then the connection MUST be closed and an appropriate error message MUST be passed back to the calling application. + +##### Capabilities Negotiation + +Following a successful dialect negotiation, the client MUST perform a logical AND of **Client.Connection.ServerCapabilities** and **Client.Capabilities**. + +The client MUST communicate these capabilities to the server in the **SMB_Parameters.Capabilities** field of an [SMB_COM_SESSION_SETUP_ANDX Request (section 2.2.4.53.1)](#Section_81e15dee8fb6410286447eaa7ded63f7). + +The client MUST set the **MaxMpxCount** field in the SMB_COM_SESSION_SETUP_ANDX Request to the value of **Client.Connection.MaxMpxCount**. + +The client SHOULD set the **SessionKey** field in the SMB_COM_SESSION_SETUP_ANDX Request (section 2.2.4.53.1) to the value of **Client.Connection.ServerSessionKey**. + +##### User Authentication + +If **Client.Connection.ShareLevelAccessControl** is TRUE:[<199>](#Appendix_A_199) + +- Share level access control is required by the server. If no authentication has been performed on the SMB connection, (**Client**.**Connection**.**SessionTable** is empty), the client MUST use anonymous authentication to create a "null session". Application-provided credentials MUST NOT be used.[<200>](#Appendix_A_200) + +The client MUST send only one session setup request. An [SMB_COM_SESSION_SETUP_ANDX Request](#Section_81e15dee8fb6410286447eaa7ded63f7) MUST be constructed as specified in section 2.2.4.53.1, with the following additional requirements. In the **SMB_Parameters** block of the SMB_COM_SESSION_SETUP_ANDX Request: + +- - The **AccountName** field MUST be the empty string. + - The **OEMPassword** and **UnicodePassword** fields MUST be empty (zero length). +- If the establishment of a null session fails, no further processing is possible. The connection MUST be closed and an implementation-specific error message MUST be returned. + +The use of share level access control is deprecated.[<201>](#Appendix_A_201) + +If **Client.Connection.ShareLevelAccessControl** is FALSE: + +- User level access control is required by the server. The client MUST look up **Session** from **Client.Connection.SessionTable** where **Session.UserCredentials** matches the application-supplied **UserCredentials**. If a session is found, it MUST be reused. Otherwise, the client MUST create an SMB_COM_SESSION_SETUP_ANDX Request (section 2.2.4.53.1) and MUST attempt to establish an authenticated session for the user with the application-supplied **UserCredentials**. +- **Authentication:** + +If **Client.Connection.ServerChallengeResponse** is FALSE and **Client.PlaintextAuthenticationPolicy** is Disabled, the client SHOULD fail the request with an implementation-dependent error. + +If **Client.Connection.ServerChallengeResponse** is FALSE and **Client.PlaintextAuthenticationPolicy** is **Enabled**, the client MUST use plaintext authentication. + +- - If the server supports Unicode (as indicated in **Client.Connection.ServerCapabilities**) the client MAY send the plaintext password in Unicode. The Unicode password is placed into the **UnicodePassword** field of the SMB_COM_SESSION_SETUP_ANDX Request as an array of bytes (not a null-terminated string). No alignment padding is used. The **UnicodePasswordLen** field is set to the length, in bytes, of the Unicode password. + - If neither the client nor the server supports Unicode, or the client sends the password in OEM character set format, the password is placed into the **OEMPassword** field of the SMB_COM_SESSION_SETUP_ANDX Request as an array of bytes (not a null-terminated string). The **OEMPasswordLen** field is set to the length, in bytes, of the password. + +If **Client.Connection.ServerChallengeResponse** is TRUE, the server can accept challenge/response authentication. The server MAY also accept plaintext authentication. The client MUST determine the authentication type that it uses based upon local configuration (the **Client.PlaintextAuthenticationPolicy**, **Client.LMAuthenticationPolicy**, and **Client.NTLMAuthenticationPolicy** values) in an implementation-specific manner.[<202>](#Appendix_A_202) + +The LAN Manager (LM) response and the LAN Manager version 2 (LMv2) response are mutually exclusive. The implementation MUST select either the LM or the LMv2 response and send it in the **OEMPassword** field of the SMB_COM_SESSION_SETUP_ANDX Request as an array of bytes (not a null-terminated string). The **OEMPasswordLen** field MUST be set to the length in bytes of the LM or LMv2 response. + +The NT LAN Manager (NTLM) response and the NT LAN Manager version 2 (NTLMv2) response are mutually exclusive. The implementation MUST select either the NTLM or the NTLMv2 response and send it in the **UnicodePassword** field of the SMB_COM_SESSION_SETUP_ANDX Request as an array of bytes (not a null-terminated string). The **UnicodePasswordLen** field MUST be set to the length, in bytes of the NTLM or NTLMv2 response. + +If authentication fails, and the local configuration permits, the client MAY attempt authentication again using alternative response calculations (for example, replacing the LMv2 response with an LM response).[<203>](#Appendix_A_203) If all authentication attempts fail, and no authenticated SMB session exists, the underlying transport connection MUST be closed, and an implementation-specific error MUST be returned to the application. + +- **Guest Authentication** + +Guest access occurs in one of two ways: + +- 1. The client logs on as a guest using the normal authentication process. + - The client attempts to log on as some other user, but authentication fails. In this case, the server MAY choose to permit access via the guest user account. The Session Setup succeeds, but the SMB_SETUP_GUEST flag of the **Action** field in the [SMB_COM_SESSION_SETUP_ANDX Response](#Section_e7514918a0f649329f00ced094445537) MUST be set to indicate guest access (see Session Setup in sections 2.2.4.53.2 and [3.3.5.43](#Section_905fbe981fe540e9b17a22ec8b17f7b3)). +- **Signing:** + +If **Client.Connection.IsSigningActive** is FALSE and: + +- - A failed authentication resulted in guest access (as described above under Guest Authentication option #2), or + - Authentication was anonymous (resulting in a null session), + +Then signing MUST NOT be enabled for this authentication. + +If the combination of **Client.MessageSigningPolicy** and **Client.Connection.ServerSigningState** results in "Messages Signed" in the following table, the client MUST set the **Client.Connection.IsSigningActive** variable to TRUE and MUST set SMB_FLAGS2_SMB_SECURITY_SIGNATURE to TRUE in the SMB Header of the SMB_COM_SESSION_SETUP_ANDX Request message. Setting this value indicates to the server that signing is requested. **Client.Connection.ServerSigningState** was initialized during the processing of a negotiation response, as specified in section [3.2.5.2](#Section_8ab141119b414edeac94dbea557451c6). + +Otherwise, if **Client.Connection.IsSigningActive** is FALSE and the result is "Blocked" in the following table, the underlying transport connection MUST be closed and an implementation-specific error MUST be returned to the application. + +![](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAYIAAADCCAYAAABE1cVRAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAACxAAAAsOAXligqoAACGXSURBVHhe7Z0tl1RXFoZbRiAiEC0QCAQiAoGIGIEY0SIiBjEiIgIZEYGIGImIiESO4A9EICJGIEfyAxAjkRH8gZr1VHhhc2af+1W7qu6tfp+19qp7vs/d95z9nrrdNFd//vnn7p///KfNtrfnz5/vLSuz2WyXZ//97393V1w8fvx499NPP9lsu+vra68Hm+2W2N///vfdDz/88JcQkPHu3Tub7ZMIZGU2m+2y7MWLFxYC2/+bhcBmuz1mIbClZiGw2W6PWQhsqVkIbLbbYxYCW2oWApvt9thsIfj3v/89mLZdhk0Rgt9//z3Nt9ls27JJQkCw59eLHj16tLd79+7tnj59ui8jrYBAnUOCA33OFRbGY9ysbKpxP1l+pXFf8tmYLfFDtQ0JwY8//rj3WVwPaz4Q/Pzzz3vLyqZYxRqbYuxBLCtr7RTzsd0emyQEbPRff/31izxtrCgEmc0pG+tLNhZ0/vOf/+wtK8OmBK1eH2N9R4v1uC/uL5Zj2Vx6fpgz9qHWEwLWQXsfr1692r19+/aLvCnPccwOEZcxPw31PdXPvT7mzDuO0xOsrL/e4eUQn9lur40KAflDp48YtOI3AgUM2cuXL/f5LHTqKZ8FzWagvk6ZlGcLmpOo2mHUYbw4P07TsY42FnVUpnHUJm4qrmM9xlRZr+/WGCveo/LoT/Ng3ppHrNfzQ6xHvsY6lvWEgHvWXDMbeu7ct/zAuiId25LPJ76JfegZKJ921M38T/+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McFjSEjGEDMw7b0ENYIPhxaD9FiMI7PjGeg50G+njG0zxFiW9aY8mHrz70nBAgk960fJnIw4h7YPxB9dkwYc0t7picE9ucyRoVgKtlX9wibtH0IejhLyMY7pD/zJTyvQ9ZDpHLzbfW594SAYIGve8QTLH6kLoGOTSsB5v655hsRZdSJPiGfPCwGJ4ltVrZ2ekJgfy6jTAjGwDGnUmNzODyvY66H20ZPCAgwBBuCC6fYGHCAMsG1TrrxGxP7ijK9bqUvBTyCkQIckE8fGO0lrLS5BCGwP5dxMiFoH4hZNxaCWnpCAAQPAgc+JwDFgKLA1b4q02m2vYaY5lNBCSNwKZjFQKXyrdATArA/53MyITDbggXv9VDHkBC0sCEJNqDARVDpBaehwEV7TqvkyfjBKeVbDlxDQtBif45jITApLGyvhzp6QpB9UyZotYFLrzyEfjMGhgIXJ1ZOvxECF0FKY8DWAldPCOzPZVgITAoL3+uhjp4Q8NtPBCQ2IYGDQBODUAxW1KEMi/WGApcCHkFK/fPJqxLl0y/XWwpcPSGwP5dhITApLHyvhzp6QgAEEYINQYzPSJumrurHYNWehNs0rzM4ycZ8+mFMyjjVYluhJwRgf87HQmBSLAS1DAnBVHQKxXg++q2W28iQEEzF/vyMhcCkWAhqqRACTpoKXFzfZiqEwP78jIXApFgIaqkQAvOZCiEwn7EQmBQLQS0WglosBLVYCEyKhaAWC0EtFoJaLAQmxUJQi4WgFgtBLRYCk2IhqMVCUIuFoBYLgUmxENRiIajFQlCLhcCkWAhqsRDUYiGoxUJgUiwEtVgIarEQ1GIhMCkWglosBLVYCGqxEJgUC0EtFoJaLAS1WAhMioWgFgtBLRaCWr4QAi74mxs226NHj7weCu2XX37Z/2nirMw2325ubnZPnjxJy2zzjfW5FwL+DCuOtdmwx48f7y0rs823b7/9di+uWZltvrE27c9a++OPP3b/A1G2qIMB7DnsAAAAAElFTkSuQmCC) + +If **Client.Connection.IsSigningActive** becomes TRUE as a result of the authentication process, **Client.Connection.SigningSessionKey** and **Client.Connection.SigningChallengeResponse** MUST be set as specified in section [3.2.5.3](#Section_ab69487980ac423ead5c3a603c01f9aa). + +If authentication succeeds, the newly created **Client.Session** MUST be inserted into the **Client.Connection.SessionTable**. The client MUST query the authentication subsystem for the cryptographic session key of the newly authenticated user, as specified in [\[MS-NLMP\]](%5bMS-NLMP%5d.pdf#Section_b38c36ed28044868a9ff8dd3182128e4), and store it in **Client.Session.SessionKey**. The client MUST set **Client.Session.UserCredentials** to the application-supplied **UserCredentials**. + +##### Connecting to the Share (Tree Connect) + +In the LAN Manager 1.0 dialect and above, it is a protocol violation to send a tree connect request without completing an [SMB_COM_SESSION_SETUP_ANDX (section 2.2.4.53)](#Section_d902407ce73b46f58f9ea2de2b6085a2) exchange. When using share level access control, the client MUST perform anonymous authentication (empty username and password) in the Session Setup. + +If a tree connect is already established to the target share in Client.Connection.TreeConnectTable, it SHOULD be reused. If not, the client creates an [SMB_COM_TREE_CONNECT_ANDX Request (section 2.2.4.55.1)](#Section_90bf689a85364f039f1b683ee4bdd67c), as specified in section [2.2.4.55](#Section_a105173ad8544950be283d3240529ec3). Alternately, the client MAY use the deprecated [SMB_COM_TREE_CONNECT Request (section 2.2.4.50.1)](#Section_0036eb8174664e1cafb6ea8bc9dd19dc). + +If **Client.Connection ShareLevelAccessControl** is TRUE and a null session has been established (see section [3.2.4.2.4](#Section_3a3cdd475b43427691f5645b82b0938f)), the plaintext password or authentication response MUST be passed in the **Password** field of the SMB_COM_TREE_CONNECT_ANDX.Request or SMB_COM_TREE_CONNECT Request. There is only one **Password** field in the tree connect message, so only one response value can be sent. The client MUST determine the authentication type that it uses based upon **Client.Connection.ServerChallengeResponse** and the local configuration (the **Client.PlaintextAuthenticationPolicy**, **Client.LMAuthenticationPolicy**, and **Client.NTLMAuthenticationPolicy** values), as specified in section 3.2.4.2.4. + +If **Client.Connection.ShareLevelAccessControl** is FALSE, then the **PasswordLength** field in the SMB_COM_TREE_CONNECT_ANDX.Request or SMB_COM_TREE_CONNECT Request MUST be 0x0001, and the **Password** MUST be a single null padding byte. + +#### Application Requests Creating a Directory + +The application provides: + +- A Client.TreeConnect indicating the share within which the new directory is to be created. +- The pathname of the directory to be created, relative to **Client.TreeConnect.ShareName**. +- A valid Client.Session. +- An optional list of extended attributes for [TRANS2_CREATE_DIRECTORY (section 2.2.6.14)](#Section_d77e09845be54aba9f8a8606e48ff7d0). +- An optional timeout value for the [SMB_COM_TRANSACTION2 Request](#Section_f7d148cde3d549ae8b379633822bfeac) command. + +The client SHOULD construct a TRANS2_CREATE_DIRECTORY subcommand request message as specified in section 2.2.6.14. Alternately, the client MAY construct an SMB_COM_CREATE_DIRECTORY request message as specified in section [2.2.4.1](#Section_e6e870ad70374b79ac544a42a1ba4561) or an SMB_COM_NT_CREATE_ANDX request message as specified in section [2.2.4.64](#Section_d3f83a7e493b4d29b21c55768b93e144). The SMB_COM_CREATE_DIRECTORY (section 2.2.4.1) command is deprecated in favor of TRANS2_CREATE_DIRECTORY (section 2.2.6.14). + +The following additional rules MUST be followed for message construction: + +- The **SMB_Header.TID** field MUST match the **Client.TreeConnect.TID** supplied by the application. +- The **SMB_Header.UID** field MUST match the **Client.Session.UID** supplied by the application. +- The **DirectoryName** field MUST contain the pathname supplied by the application. + +The request MUST be sent to the server as described in section [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd). + +#### Application Requests Deleting a Directory + +The application provides: + +- The **Client.TreeConnect** representing the share in which the directory to be deleted exists. +- The pathname of the directory to be deleted, relative to **Client.TreeConnect.ShareName**. +- A valid **Client.Session**. + +The client MUST construct an [SMB_COM_DELETE_DIRECTORY Request (section 2.2.4.2)](#Section_0bca354c42d946b7a0aed8c6870242ca) message,with the following additional requirements: + +- The **SMB_Header.TID** field MUST match the **Client.TreeConnect.TID** supplied by the application. +- The **SMB_Header.UID** field MUST match the **Client.Session.UID** supplied by the application. +- The **SMB_Data.Bytes.DirectoryName** field MUST contain the pathname supplied by the application. + +The request MUST be sent to the server as described in section [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd). + +#### Application Requests Opening an Existing File + +To open a file on a remote share, the application provides the following: + +- The **Client.TreeConnect** representing the share in which the file to be opened exists. +- The pathname of the file being opened, relative to **Client.TreeConnect.ShareName**. +- The **Client.Session** representing the [**security context**](#gt_88d49f20-6c95-4b64-a52c-c3eca2fe5709) of the user opening the file. +- The requested access mode (read, write, and so on). +- The share access for the **open**. +- The create disposition for the **open**. +- An optional set of create options for the **open**. +- An optional Boolean indicating whether the attributes and time stamps of the file are to be returned in the response. +- An optional Boolean indicating whether the total length of the file's extended attributes is to be returned in the response. +- A Boolean indicating whether or not the parent directory of the target is to be opened. +- An optional requested impersonation level. +- The security flags. +- An optional allocation size. +- An optional timeout value. +- An optional [**security descriptor**](#gt_e5213722-75a9-44e7-b026-8e4833f0d350). +- The request for an exclusive or batch OpLock, if any.[<204>](#Appendix_A_204) + +To open the file, the client can issue one of the following command requests: + +- [SMB_COM_OPEN (section 2.2.4.3)](#Section_ec064de86538401e8c73b37231c36f2b) (deprecated) + +The client MUST construct an [SMB_COM_OPEN Request (section 2.2.4.3.1)](#Section_ab9bb87219674088b4446a35d0af305e) message. This command provides basic Open semantics. + +- [SMB_COM_OPEN_ANDX (section 2.2.4.41)](#Section_49a0f97dc4a748a3bf5046d816825729) (deprecated) + +The client MUST construct an [SMB_COM_OPEN_ANDX Request (section 2.2.4.41.1)](#Section_3a760987f60d4012930bfe90328775cc) message. In addition to basic Open semantics, SMB_COM_OPEN_ANDX provides: + +- - AndX chaining. + - The ability to request detailed information regarding the opened file. + - The ability to select the file to be opened based upon the file attributes, as well as the ability to set the file attributes if the file does not exist and needs to be created. + - The ability to set or reset the creation time of the file. + - The disposition action to take based on the existence of the target file. +- [TRANS2_OPEN2 (section 2.2.6.1)](#Section_ee2f11ca7c7e49ac9cb78b1ed1259c2c) + +The client MUST construct an [SMB_COM_TRANSACTION2 (section 2.2.4.46)](#Section_3d9d8f3edc70410da3fc6f4a881e8cab) transaction request, to transport the TRANS2_OPEN2 transaction request. The client MUST construct a [TRANS2_OPEN2 Request (section 2.2.6.1.1)](#Section_59261f5ba49a4013b7772efbb0f46bb9). In addition to basic Open semantics, TRANS2_OPEN2 provides: + +- - The ability to set extended attribute (EA) name/value pairs. + - The ability to set or reset the creation time of the file. + - The ability to specify an initial allocation for newly opened or overwritten files. + - The disposition action to take based on the existence of the target file. +- [NT_TRANSACT_CREATE (section 2.2.7.1)](#Section_f85bb6cf2d3949c9bfe5307ad57d5da5) + +The client MUST construct an [SMB_COM_NT_TRANSACT (section 2.2.4.62)](#Section_55db04d6105f45d184ac6972c0a1ddc8) transaction request,to transport the NT_TRANSACT_CREATE transaction request. The client MUST construct an [NT_TRANSACT_CREATE Request (section 2.2.7.1.1)](#Section_42eef5ff34d74389a4e5812820475686). In addition to basic Open semantics, NT_TRANSACT_CREATE provides: + +- - The ability to specify a [**path**](#gt_2cd71385-2d9c-4ab8-bf4a-7b258816d613) relative to a subdirectory within the share indicated by the **TID**. + - The ability to specify an initial allocation for newly opened or overwritten files. + - The disposition action to take based on the existence of the target file. +- [SMB_COM_NT_CREATE_ANDX (section 2.2.4.64)](#Section_d3f83a7e493b4d29b21c55768b93e144) + +The client MUST construct an [SMB_COM_NT_CREATE_ANDX Request (section 2.2.4.64.1)](#Section_f2a0f032754541c99cebaab39852c11a) message. In addition to basic Open semantics, SMB_COM_NT_CREATE_ANDX provides: + +- - AndX chaining. + - The ability to open or create a directory. + - The ability to specify a path relative to a subdirectory within the share indicated by the **TID**. + - The ability to specify an initial allocation for newly opened or overwritten files. + - The disposition action to take based on the existence of the target file. + +The SMB_COM_NT_CREATE_ANDX is the most comprehensive (and, therefore, the most complex) of the open commands. + +Any of the commands or subcommands listed above can be used to open a file. Directories, named pipes, and devices can also be opened. Most of these commands provide the option to create a file if it does not already exist, or to overwrite or append to the file if it does exist. For SMB_COM_OPEN (section 2.2.4.3), SMB_COM_OPEN_ANDX (section 2.2.4.41), and TRANS2_OPEN2 (section 2.2.6.1) commands, the client MUST construct the **AccessMode** field of the request by translating the input parameters as follows: + +| Input parameter | Value(s) | AccessMode bit field | Value | +| --------------------------------------------- | --------------------------------------------------- | -------------------------------- | ------ | +| Access mode | Only read access | **AccessMode**.AccessMode | 0 | +| Access mode | Only write access | **AccessMode**.AccessMode | 1 | +| Access mode | Read and write access | **AccessMode**.AccessMode | 2 | +| Access mode | execute | **AccessMode**.AccessMode | 3 | +| Share Access | 0 | **AccessMode**.SharingMode | 1 | +| Share Access | FILE_SHARE_READ | **AccessMode**.SharingMode | 2 | +| Share Access | FILE_SHARE_WRITE | **AccessMode**.SharingMode | 3 | +| Share Access | FILE_SHARE_DELETE | **AccessMode**.SharingMode | 4 | +| Create Options | FILE_SEQUENTIAL_ONLY = 0 and FILE_RANDOM_ACCESS = 0 | **AccessMode**.ReferenceLocality | 0 | +| Create Options. FILE_SEQUENTIAL_ONLY | 1 | **AccessMode**.ReferenceLocality | 1 | +| Create Options. FILE_RANDOM_ACCESS | 1 | **AccessMode**.ReferenceLocality | 2 or 3 | +| Create Options.FILE_NO_INTERMEDIATE_BUFFERING | 0 | **AccessMode**.CacheMode | 0 | +| Create Options.FILE_NO_INTERMEDIATE_BUFFERING | 1 | **AccessMode**.CacheMode | 1 | +| Create Options. FILE_WRITE_THROUGH | 0 | **AccessMode**.WritethroughMode | 0 | +| Create Options. FILE_WRITE_THROUGH | 1 | **AccessMode**.WritethroughMode | 1 | + +The request MUST be sent to the server as described in section [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd). + +##### Compatibility Mode + +Compatibility Mode (also referred to as "MS-DOS Compatibility Mode") provides the client with exclusive access to an opened file. + +- A file opened in compatibility mode can be opened (also in compatibility mode) any number of times for any combination of reading and writing (subject to the user's permissions) by any **UID** and **PID** on the same SMB connection. +- If one client has the file open for writing in compatibility mode, the file MUST NOT be opened in any way by any other client. +- As an exception, if the filename has an extension of .EXE, .DLL, .SYM, or .COM (is executable), other clients are permitted to open the file for reading regardless of read/write open modes of other compatibility mode opens. The SMB_FLAGS2_READ_IF_EXECUTE bit (also known as the SMB_FLAGS2_PAGING_IO bit) MUST be set in the open request. +- If the first client has the file open only for reading in compatibility mode, other clients can open the file for reading in compatibility mode. +- Once one or more clients have the file open for reading in compatibility mode, other clients MUST NOT open the file in any mode other than compatibility mode. +- If any client has the file open for reading in compatibility mode, then other clients MUST NOT open the file for writing. + +Because Compatibility Mode provides the client with exclusive access, it is incompatible with other open modes that provide shared access to the file. If the file is opened with sharing enabled, a subsequent Compatibility Mode open from the same client or any other client MUST return STATUS_SHARING_VIOLATION (ERRDOS/ERRbadshare). + +The other file exclusion modes (Deny read/write, Deny write, Deny read, Deny nothing) provide exclusion at the file level. A file opened in any "Deny" mode MAY only be opened again for the accesses allowed by the Deny mode (subject to the user's permissions). + +##### FID Permissions + +If the open operation that created the **FID** specified a Deny mode, any SMB session making use of the **FID** (other than the SMB session within which the **FID** was created) has only the set of access rights determined by performing a logical "and" on the open mode rights and the Deny mode rights. That is, the Deny mode is checked on all file accesses. + +#### Application Requests to Create or Overwrite a File + +To create or overwrite a file on a remote share, the application provides the following: + +- The **Client.TreeConnect** representing the share within which to create the file. +- The pathname of the file being created, relative to **Client.TreeConnect.ShareName**. +- The **Client.Session** representing the [**security context**](#gt_88d49f20-6c95-4b64-a52c-c3eca2fe5709) of the user opening the file. +- The requested access mode (read, write, and so on). +- An optional Boolean indicating whether the attributes and time stamps of the file are to be returned in the response. +- An optional Boolean indicating whether the total length of the file's extended attributes is to be returned in the response. +- The share access for the created file. +- The create disposition for the **open**. +- An optional set of create options for the **open**. +- An optional list of extended attributes. +- An optional list of search attributes. +- The request for an exclusive or batch OpLock, if any. +- A Boolean indicating whether or not the file attribute data is to be returned in the response. +- A Boolean indicating whether or not the parent directory of the target is to be opened. +- An optional requested level of impersonation. +- The security flags. +- An optional allocation size. +- An optional timeout value. +- An optional [**security descriptor**](#gt_e5213722-75a9-44e7-b026-8e4833f0d350). +- The print file mode Boolean. + +To create the file, the client MUST issue one of the following command requests: + +- [SMB_COM_CREATE (section 2.2.4.4)](#Section_87622f4337584bf9b1fb35109f0e5c15) (deprecated) + +The client MUST construct an [SMB_COM_CREATE Request (section 2.2.4.4.1)](#Section_244621046b354fe4aeaa7c30cd727bc9) message as defined in section 2.2.4.4. This command provides basic Create semantics. + +- [SMB_COM_CREATE_TEMPORARY (section 2.2.4.15)](#Section_6ea3a4b22a9b4749a4a441efebdf4015) (obsolescent) + +This command is used to create a temporary file on the server. The client MUST construct an [SMB_COM_CREATE_TEMPORARY Request (section 2.2.4.15.1)](#Section_3dae394e5c4846fc82ea4031995f903c) message. + +- [SMB_COM_CREATE_NEW (section 2.2.4.16)](#Section_161fa213ba9d4bad948329e8b5872dca) (deprecated) + +This command is used to create a new file and MUST fail if the specified file already exists. The client MUST construct an [SMB_COM_CREATE_NEW Request (section 2.2.4.16.1)](#Section_2e4852f086724d62984842f931b91533) message as defined in section 2.2.4.16. + +- [SMB_COM_OPEN_PRINT_FILE (section 2.2.4.67)](#Section_4cce0e9fab2740f797cc6f12b4a9afef) + +This command is used to create a new print spool file. The application provides opaque printer-specific control data that is to be included as the first part of the spool file. The client MUST construct an [SMB_COM_OPEN_PRINT_FILE Request (section 2.2.4.67.1)](#Section_a0199848ec124408981288a5f1c30ceb) message as defined in 2.2.4.67. + +- [SMB_COM_OPEN_ANDX (section 2.2.4.41)](#Section_49a0f97dc4a748a3bf5046d816825729) (deprecated) + +The client MUST construct an [SMB_COM_OPEN_ANDX Request (section 2.2.4.41.1)](#Section_3a760987f60d4012930bfe90328775cc) message as defined in section 2.2.4.41. If the application-provided Boolean value indicates the file attribute data to be returned in the response, the client MUST set REQ_ATTRIB flag in the **SMB_Parameters.Flags** field. In addition to basic Create semantics, SMB_COM_OPEN_ANDX provides: + +- - AndX chaining. + - The ability to set the file attributes when the file is created. + - The ability to set the creation time of the file. + - The disposition action to take based on the existence of the target file. +- [TRANS2_OPEN2 (section 2.2.6.1)](#Section_ee2f11ca7c7e49ac9cb78b1ed1259c2c) + +The client MUST construct an [SMB_COM_TRANSACTION2 (section 2.2.4.46)](#Section_3d9d8f3edc70410da3fc6f4a881e8cab) transaction request, as defined in section 2.2.4.46, to transport the TRANS2_OPEN2 transaction request. The client MUST construct a [TRANS2_OPEN2 Request (section 2.2.6.1.1)](#Section_59261f5ba49a4013b7772efbb0f46bb9) as defined in section 2.2.6.1. If the application-provided Boolean value indicates the file attribute data to be returned in the response, the client MUST set REQ_ATTRIB flag in the **SMB_Parameters.Flags** field. In addition to basic Create semantics, TRANS2_OPEN2 provides: + +- - The ability to set extended attribute (EA) name/value pairs. + - The ability to set or reset the creation time of the file. + - The ability to specify an initial allocation for newly created or overwritten files. + - The disposition action to take based on the existence of the target file. +- [NT_TRANSACT_CREATE (section 2.2.7.1)](#Section_f85bb6cf2d3949c9bfe5307ad57d5da5) + +The client MUST construct an [SMB_COM_NT_TRANSACT (section 2.2.4.62)](#Section_55db04d6105f45d184ac6972c0a1ddc8) transaction request, as defined in section 2.2.4.62 to transport the NT_TRANSACT_CREATE transaction request. The client MUST construct an [NT_TRANSACT_CREATE Request (section 2.2.7.1.1)](#Section_42eef5ff34d74389a4e5812820475686) as defined in section 2.2.7.1. In addition to basic Open semantics, NT_TRANSACT_CREATE provides: + +- - The ability to specify a path relative to a subdirectory within the share indicated by the **TID**. + - The ability to specify an initial allocation for newly opened or overwritten files. + - The disposition action to take based on the existence of the target file. +- [SMB_COM_NT_CREATE_ANDX (section 2.2.4.64)](#Section_d3f83a7e493b4d29b21c55768b93e144) + +The client MUST construct an [SMB_COM_NT_CREATE_ANDX Request (section 2.2.4.64.1)](#Section_f2a0f032754541c99cebaab39852c11a) message as defined in section 2.2.4.64. In addition to basic Open semantics, SMB_COM_NT_CREATE_ANDX provides: + +- - AndX chaining. + - The ability to create a directory. + - The ability to specify a path relative to a subdirectory within the share indicated by the **TID**. + - The ability to specify an initial allocation for newly opened or overwritten files. + - The disposition action to take based on the existence of the target file. + +The SMB_COM_NT_CREATE_ANDX is the most comprehensive (and, therefore, the most complex) of the Create commands. + +When opening a named pipe, the SMB_COM_NT_CREATE_ANDX command requires that the **FileName** field MUST contain only the relative name of the pipe; that is, the "\\PIPE\\" prefix MUST NOT be present. This is in contrast with other commands, such as SMB_COM_OPEN_ANDX and TRANS2_OPEN2, which require that the "\\PIPE\\" prefix be present in the path name. + +Any of the commands or subcommands listed in this section can be used to create a file. Directories can also be created. Most of these commands provide the option to open or overwrite a file if it already exists. For SMB_COM_OPEN_ANDX (section 2.2.4.41) and TRANS2_OPEN2 (section 2.2.6.1) commands, the client MUST construct the **AccessMode** field of the request by translating the input parameters as specified in section [3.2.4.5](#Section_66435b844e2242ffb4e15ff7b07de138). + +In early dialects of the SMB Protocol the Open and Create operations were somewhat separate. In CIFS, there is considerable overlap between the set of commands used to open an existing file, the commands used to overwrite an existing file, and those used to create a new file. + +The request MUST be sent to the server as described in section [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd). + +#### Application Requests Closing a File + +The application provides: + +- A **Client.Open**, representing the file that the application requests to close. +- The requested file creation time, expressed as the number of seconds since January 1, 1970, 00:00:00.0. + +The client MUST construct an [SMB_COM_CLOSE Request (section 2.2.4.5.1)](#Section_eb85efbc9fd543208cd691b53ac49203) message, with the following additional requirements: + +- The **SMB_Parameters.Words.FID** field MUST match what was supplied by the application. + +The request MUST be sent to the server as described in section [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd). + +#### Application Requests Flushing File Data + +The application provides: + +- A **Client.Open**, representing the file that the application requests to have flushed. + +The client MUST construct an [SMB_COM_FLUSH Request (section 2.2.4.6.1)](#Section_e5e1e00c5ec24a5cb825f8cf2f4cda79) message, with the following additional requirements: + +- The **SMB_Parameters.Words.FID** field MUST contain the **FID** that was supplied by the application. + +The request MUST be sent to the server as described in section [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd). + +#### Application Requests Deleting a File or Set of Files + +The application provides: + +- The **Client.TreeConnect** representing the share in which the file(s) to be deleted exist(s). +- The attribute mask of the file(s) to be deleted. +- The pathname of the file(s) to be deleted. +- A valid **Client.Session**. + +The client MUST construct an [SMB_COM_DELETE Request (section 2.2.4.7.1)](#Section_2e57889eca5b4076a86508103b947e59) message, with the following additional requirements: + +- The **SMB_Parameters.Words.SearchAttributes** field MUST contain the attribute mask that was supplied by the application. +- The **SMB_Data.Bytes.FileName** field MUST contain the pathname that was supplied by the application. + +[SMB_COM_DELETE (section 2.2.4.7)](#Section_e455faa4d99643a587eb9993b0ceb896) can be used to delete multiple files if the file name (the final component of the **FileName** field) contains wildcard characters. The **SearchAttributes** are used to modify the set of files that can be included in the delete operation. + +The request MUST be sent to the server as described in section [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd). + +#### Application Requests Renaming a File or Set of Files + +The application provides: + +- The **Client.TreeConnect** representing the share in which the file(s) to be renamed exist(s). +- The attribute mask of the file(s) to be renamed. +- The pathname of the file(s) to be renamed. +- The new desired pathname of the file(s). +- A valid **Client.Session**. + +To rename the file, the client MUST issue one of the following command requests: + +- [SMB_COM_NT_RENAME (section 2.2.4.66.1)](#Section_d777310edeb1490c915726456c0b0116) ([**Obsolescent**](#gt_8377951d-81ca-44a2-af83-2a6d6388c121)) + +The client MUST construct an SMB_COM_NT_RENAME Request (section 2.2.4.66.1) message with the following additional requirements: + +- - The **SMB_Parameters.Words.SearchAttributes** field MUST contain the attribute mask supplied by the application. + - The **SMB_Data.Bytes.OldFileName** field MUST contain the source pathname supplied by the application. + - The **SMB_Data.Bytes.NewFileName** field MUST contain the destination pathname supplied by the application. + - The **SMB_Parameters.Words.InformationLevel** field MUST contain an information level value of SMB_NT_RENAME_RENAME_FILE. + +SMB_COM_NT_RENAME does not support wildcards and does not support renaming multiple files. This command provides support for the creation of hard links (see section [3.2.4.11](#Section_36e5c360fab64557b18ad2b68bbcb84e)). + +- [SMB_COM_RENAME (section 2.2.4.8)](#Section_d78c549c9ab84d92bbbc6843bed943f6) + +The client MUST construct an [SMB_COM_RENAME Request (section 2.2.4.8.1)](#Section_c970f3bf806e43098ea96515605f450d) message with the following additional requirements: + +- - The **SMB_Parameters.Words.SearchAttributes** field MUST contain the attribute mask supplied by the application. + - The **SMB_Data.Bytes.OldFileName** field MUST contain the source pathname supplied by the application. + - The **SMB_Data.Bytes.NewFileName** field MUST contain the destination pathname supplied by the application. + +SMB_COM_RENAME can be used to rename multiple files if the file name (the final component of the **FileName** field) contains wildcard characters. The **SearchAttributes** are used to modify the set of files that MAY be included in the rename operation. + +Either of the preceding commands can be used to rename a file. + +The request MUST be sent to the server as specified in section [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd). + +#### Application Requests Creating a Hard Link to a File + +The application provides: + +- The **Client.TreeConnect** representing the share in which the file to be linked exists. +- The attribute mask of the file to be linked. +- The pathname of the file to be linked. +- The requested pathname of the new hard link. +- A valid **Client.Session**. + +The client MUST construct an [SMB_COM_NT_RENAME Request (section 2.2.4.66.1)](#Section_d777310edeb1490c915726456c0b0116) message with the following additional requirements: + +- The **SMB_Parameters.Words.SearchAttributes** field MUST contain the attribute mask supplied by the application. +- The **SMB_Data.Bytes.OldFileName** field MUST contain the source pathname supplied by the application. +- The **SMB_Data.Bytes.NewFileName** field MUST contain the destination pathname supplied by the application. +- The **SMB_Parameters.Words.InformationLevel** field MUST contain an information level value of SMB_NT_RENAME_SET_LINK_INFO. + +[SMB_COM_NT_RENAME (section 2.2.4.66)](#Section_014a414742064ab2a167b58a4d11f1a7) does not support wildcards and does not support creating hard links for multiple files. + +The request MUST be sent to the server as specified in section [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd). + +#### Application Requests Querying File Attributes + +The application provides: + +- A valid **Client.Session**. +- The **Client.TreeConnect** representing the share in which the file to be queried exists. +- If the file is not already open, the full pathname relative to the **TID**. Otherwise, attributes SHOULD be queried using a valid [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) representing the opened file. +- The [**Information Level**](#gt_b01da706-86d0-4ee2-9461-2d9fb1060543) that defines the format of the data to query, as specified in [\[MS-FSCC\]](%5bMS-FSCC%5d.pdf#Section_efbfe12773ad41409967ec6500e66d5e) section 2.4. +- If the Information Level provided is **SMB_INFO_QUERY_EAS_FROM_LIST**, the application provides a list of extended attributes. + +The client can use any of the following commands to query [**file attributes**](#gt_87cf5b25-96b0-4088-827d-0d8f270c4d84). The [SMB_COM_QUERY_INFORMATION](#Section_d36b4a5cdf1b4255aa5bac6ef5c2fb7c) and [SMB_COM_QUERY_INFORMATION2](#Section_33ebe09e4c9d4adcb23b40e4348c704f) commands are deprecated; the client SHOULD use the TRANS2_QUERY_PATH_INFORMATION or the TRANS2_QUERY_FILE_INFORMATION transaction subcommand instead. The transaction subcommands can also be used to query named pipe attributes. The client MUST map the application-provided Information Level to the Query Information Levels, as specified in section [2.2.8](#Section_2bcf1801eb0d422a9b6d43a6e33fb446). + +- SMB_COM_QUERY_INFORMATION (deprecated) + +The client MUST construct the SMB_COM_QUERY_INFORMATION request as defined in section 2.2.4.9. This command retrieves the following file attributes: + +- - Basic SMB_FILE_ATTRIBUTES, as described in section [2.2.1.2.4](#Section_2198f480e0474df0ba64f28eadef00b9). + - Last write time of the file. + - The size of the file (limited to a 32-bit value). + +The file to be queried MUST be identified by a full pathname, relative to the **TID**. + +- SMB_COM_QUERY_INFORMATION2 (deprecated) + +The client MUST construct the SMB_COM_QUERY_INFORMATION2 request as defined in section 2.2.4.31. This command retrieves the following file attributes: + +- - Basic SMB_FILE_ATTRIBUTES, as described in section 2.2.1.2.4. + - The date and time of file creation, last access, and last write. + - The file size (limited to a 32-bit value). + - The file allocation size (limited to a 32-bit value), which can be larger than the actual number of bytes contained in the file. + +The file to be queried MUST be identified by a FID (an open file handle). + +- TRANS2_QUERY_PATH_INFORMATION + +The client MUST construct a TRANS2_QUERY_PATH_INFORMATION subcommand request as defined in section [2.2.6.6](#Section_39021262e1624948b4999dfccef77ef6). The TRANS2_QUERY_PATH_INFORMATION request MUST be transported to the server using the Transaction2 subprotocol. This transaction subcommand provides access to extended file information, including: + +- - Basic SMB_FILE_ATTRIBUTES, as described in section 2.2.1.2.4. + - The creation time, last access time, and last write time attributes of the file. + - The file size (limited to a 32-bit value). + - The file allocation size (limited to a 32-bit value), which can be larger than the actual number of bytes contained in the file. + - The number of bytes allocated to extended attribute name/value pairs. + - Extended attributes. + - The number of hard links to the file. + - The file name and alternate file name. + - The ability to list alternate file streams. + - Whether or not the file is actually a directory. + - Whether or not the file is marked for delete upon close. + - Whether or not the file is compressed. + +The file to be queried MUST be identified by a full pathname, relative to the **TID**. + +- TRANS2_QUERY_FILE_INFORMATION + +The client MUST construct a TRANS2_QUERY_FILE_INFORMATION subcommand request as defined in section [2.2.6.8](#Section_16c2516fc82c43b79ab732fb1109f9fe). The TRANS2_QUERY_FILE_INFORMATION request MUST be sent to the server using the Transaction2 subprotocol as a transport. This transaction is identical to TRANS2_QUERY_PATH_INFORMATION except that the file to be queried MUST be identified by FID rather than by pathname. + +The request MUST be sent to the server as described in section [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd). + +#### Application Requests Setting File Attributes + +The application provides: + +- A valid **Client.Session**. +- The **Client.TreeConnect** representing the share in which the file to be accessed exists. +- If the file is not open, the full pathname relative to **Client.TreeConnect.ShareName**. Otherwise, attributes SHOULD be set using a valid **Client.Open** representing the opened file. +- The [**Information Level**](#gt_b01da706-86d0-4ee2-9461-2d9fb1060543) that defines the format of the data to set, as specified in [\[MS-FSCC\]](%5bMS-FSCC%5d.pdf#Section_efbfe12773ad41409967ec6500e66d5e) section 2.4. +- When the Information Level is **SMB_INFO_STANDARD**, the application provides the creation date and time, last access date and time and last write date and time of the file, all expressed as the number of seconds from January 1, 1970 00:00:00.0. +- When the Information Level is **SMB_INFO_EAS**, the application provides the extended attribute name/value pairs of the file. +- When the Information Level is **SMB_SET_FILE_BASIC_INFO**, the application provides the creation time, last access time, last write time, change time and extended attribute name/pair of the file. +- When the Information Level is **SMB_SET_FILE_DISPOSITION_INFO**, the application provides a Boolean to indicate if the file is marked for deletion. +- When the Information Level is **SMB_SET_FILE_ALLOCATION_INFO**, the application provides the file allocation size in bytes. +- When the Information Level is **SMB_SET_FILE_END_OF_FILE_INFO**, the application provides the offset from the beginning of the file to the byte following the last byte in the file. + +The client can use any of the following commands to set file attributes. The [SMB_COM_SET_INFORMATION (section 2.2.4.10)](#Section_e3cd0acdaa844fbf8c9d3e7d3bb3fd52) and [SMB_COM_SET_INFORMATION2 (section 2.2.4.30)](#Section_cfcda87d76344902a137c60a1f4a5ae5) commands are deprecated; the client SHOULD use the [TRANS2_SET_PATH_INFORMATION (section 2.2.6.7)](#Section_a23483d965434aaaa996e7c9506f8b94) or the [TRANS2_SET_FILE_INFORMATION (section 2.2.6.9)](#Section_cb2b7f2138774bc5adf4b78c8aa2a717) transaction subcommand. The transaction subcommands can also be used to set named pipe attributes. The client MUST map the application-provided **Information Level** to the **Set Information Levels**, as specified in section [2.2.8](#Section_2bcf1801eb0d422a9b6d43a6e33fb446). + +- SMB_COM_SET_INFORMATION (deprecated) + +The client MUST construct the [SMB_COM_SET_INFORMATION Request (section 2.2.4.10.1)](#Section_76577ee1eb2d4db79bed65c74a952741) as defined in section 2.2.4.10. This command can be used to set basic SMB_FILE_ATTRIBUTES (section [2.2.1.2.4](#Section_2198f480e0474df0ba64f28eadef00b9)), and to set the last write time attribute of the file. The file to be modified MUST be identified by a full pathname, relative to the **TID**. + +- SMB_COM_SET_INFORMATION2 (section 2.2.4.30) (deprecated) + +The client MUST construct the [SMB_COM_SET_INFORMATION2 Request (section 2.2.4.30.1)](#Section_de521278f8004a57b5244811fe9edd8f) as defined in section 2.2.4.30. This command can be used to set the creation time, last access time, and last write time attributes of the file. This command does not support modification of SMB_FILE_ATTRIBUTES. The file to be modified MUST be identified by a [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) (an open file handle). + +- TRANS2_SET_PATH_INFORMATION + +When the **Information Level** is SMB_INFO_STANDARD, the application provides: + +- - The creation date of the file. + - The creation time of the file. + - The last access date of the file. + - The last access time of the file. + - The last write date of the file. + - The last write time of the file. + +When the **Information Level** is SMB_INFO_EAS, the application provides: + +- - The extended attribute name/value pairs of the file. + +When the **Information Level** is SMB_SET_FILE_BASIC_INFO, the application provides: + +- - The creation date and time of the file. + - The last access date and time of the file. + - The last write date and time of the file. + - The change date and time of the file. + - The extended attribute name/value pairs of the file. + +When the **Information Level** is SMB_SET_FILE_DISPOSITION_INFO, the application provides: + +- - A Boolean flag indicating whether the file is to be deleted when closed. + +When the Information Level is SMB_SET_FILE_ALLOCATION_INFO, the application provides: + +- - The allocation size of the file in bytes. + +When the Information Level is SMB_SET_FILE_END_OF_FILE_INFO, the application provides: + +- - The absolute new end-of-file position as a byte offset from the start of the file. + +The client MUST construct the TRANS2_SET_PATH_INFORMATION (section 2.2.6.7) subcommand request as defined in section 2.2.6.7. The [TRANS2_SET_PATH_INFORMATION Request (section 2.2.6.7.1)](#Section_2ca0642a1cd44e72a16f9e804a218262) MUST be transported to the server using the Transaction2 subprotocol. This subcommand can be used to: + +- - Set SMB_FILE_ATTRIBUTES on the file. + - Set the creation time, last access time, and last write time attributes of the file. + - Set extended attribute (EA) name/value pairs. + - Set the delete-on-close state of a file. + - Change the allocated size of the file. + +The file to be modified MUST be identified by a full pathname, relative to the **TID**. + +- TRANS2_SET_FILE_INFORMATION + +This transaction subcommand is identical in behavior to TRANS2_SET_PATH_INFORMATION, except that the file MUST be identified by FID rather than by pathname. + +The request MUST be sent to the server as specified in section [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd). + +#### Application Requests Reading from a File, Named Pipe, or Device + +The application provides: + +- A valid **Client.Open**, representing the file from which the application attempts to read. +- An offset, in bytes and relative to the start of the file, marking the location within the file at which the application attempts to read. +- The number of bytes to be read. +- A minimum number of bytes to be read. +- An optional time-out value, in milliseconds, indicating how long a server is requested to wait. + +The application MAY also provide an estimate of the number of bytes that it attempts to read next. This value MUST represent a sequential read (immediately following the bytes being read in this request), as it is used to allow the server to perform read-ahead caching. + +CIFS provides several commands for reading data from a file, named pipe, or device. These are: + +- SMB_COM_READ (deprecated) + +The client MUST construct an SMB_COM_READ request message as defined in section [2.2.4.11.1](#Section_23704aa0e6d247628dfde8eeaacca71b). This command provides the basic Read operation. + +- SMB_COM_LOCK_AND_READ (deprecated) + +The client MUST construct an SMB_COM_LOCK_AND_READ request as defined in section [2.2.4.20.1](#Section_4652d923dc4e4611b17e9215d8c66f2e). Prior to reading, this command attempts to establish a lock on the specified byte range. + +- SMB_COM_READ_RAW (deprecated) + +The client MUST construct an SMB_COM_READ_RAW request as defined in section [2.2.4.22.1](#Section_1458b62a18ed4fb2b8a9ceabffb2c3b7). The behavior of the SMB_COM_READ_RAW request is described in section [3.2.4.14.1](#Section_e966a2739d5c4963a4ed5a28392a9f56). + +- SMB_COM_READ_MPX (obsolescent) + +The client MUST construct SMB_COM_READ_MPX request messages as defined in section [2.2.4.23.1](#Section_3e066ba09fce43c785fd756e4721f7ee). The behavior of the SMB_COM_READ_MPX request is described in section [3.2.4.14.2](#Section_e307bd7887884a8083cff153e91ef08e). + +- SMB_COM_READ_ANDX + +If the application reads from a named pipe or device specifically, it MUST also provide the minimum number of bytes to be read. + +The client MUST construct an SMB_COM_READ_ANDX request message as defined in section [2.2.4.42.1](#Section_7e6c7cc2c3f143358263d7412f77140e), with the following additional requirements: + +- - If CAP_LARGE_FILES was negotiated during session setup, then the client MAY use a 64-bit **Offset** value. If the client is using a 64-bit **Offset** value, **SMB_Parameters.WordCount** MUST be set to 0x0C and the **SMB_Parameters.Words.Offset** and **SMB_Parameters.Words.OffsetHigh** fields MUST be set to the lower 32 bits and higher 32 bits, respectively, of the supplied offset value. + - If the client is using a 32-bit **Offset** value, **SMB_Parameters.WordCount** MUST be set to 0x0A, the **SMB_Parameters.Words.Offset** field MUST be assigned the offset value supplied by the application, and the **SMB_Parameters.Words.OffsetHigh** field MUST NOT be included in the request. + - The **SMB_Parameters.Words.MaxCountOfBytesToReturn** field MUST be assigned the number of bytes to be returned. This value is supplied by the application. If a value was supplied for a minimum number of bytes to be read, the **SMB_Parameters.Words.MinCountOfBytesToReturn** field MUST be assigned the value that was supplied by the application. Otherwise, it MUST be set to 0x0000. + - If a time-out value was supplied, the **SMB_Parameters.Words.Timeout** field MUST be assigned the value that was supplied by the application. Otherwise, it MUST be set to 0x00000000. + +In addition, if CAP_LARGE_READX was set by the server in the negotiate protocol response and [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) refers to a disk file, then the **MaxCountOfBytesToReturn** field in the client request can exceed the client's **Client.MaxBufferSize**. + +- TRANS_RAW_READ_NMPIPE + +The client MUST construct the TRANS_RAW_READ_NMPIPE subcommand as defined in section [2.2.5.2](#Section_cfcebfaeed1345ee9117fdc6da5a4060). The request MUST be transported to the server using the Transaction subprotocol. TRANS_RAW_READ_NMPIPE allows for a raw read of data from a named pipe. This method of reading data from a named pipe ignores message boundaries even if the pipe is set up as a [**message mode**](#gt_c49a48e8-f1ac-4568-bc87-0672eb08868b) pipe. + +- TRANS_READ_NMPIPE + +The client MUST construct the TRANS_READ_NMPIPE subcommand as defined in section [2.2.5.8](#Section_d9004cc94b844d4ca522ec559f53c1a7). The request MUST be transported to the server using the Transaction subprotocol. TRANS_READ_NMPIPE allows data to be read from a named pipe in the mode set on the named pipe. If the named pipe is in message mode, this subcommand MUST read a message from the pipe. + +The request MUST be sent to the server as described in section [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd). + +##### Client Requests Read Raw + +SMB_COM_READ_RAW is a specialized read command intended to maximize the performance of reading large blocks of data from an open regular file, named pipe, or device. The command permits a server to send a large unformatted data (raw byte stream) message over the [**SMB transport**](#gt_f8b0f8a6-e412-459a-b8ba-219008e5bcd7) without requiring the usual SMB response format. It also permits a server to send messages in excess of the maximum buffer size established during protocol negotiation and session setup. To accomplish this, the client and the server enter into a [**dialog**](#gt_71ad645f-db5b-4e9f-9b3d-887039ada331). For the dialog to begin, the client MUST perform the following steps: + +- The client MUST compose the SMB_COM_READ_RAW request as described in section [2.2.4.22](#Section_a8c3a184272c4168bbb2dcc621c503a0). This request advises the server of the total number of bytes that the client attempts to receive in response to the request. The request MUST be sent to the server as described in section [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd), with the exception that SMB_COM_READ_RAW and message signing are mutually exclusive. Message signing MUST be disabled in order to perform a raw read. +- After sending the SMB_COM_READ_RAW request, the client MUST NOT send any other request to the server until the Read Raw response has been completely received. In addition, the client MUST NOT have any outstanding requests pending on the server. Because the server sends a raw data message that does not include the typical [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f), the SMB Protocol cannot guarantee that the client can associate the server's raw data message with the correct corresponding SMB_COM_READ_RAW command request. Therefore, the client MUST guarantee that there are no other SMB requests from the client to the server for the duration of the SMB_COM_READ_RAW command's dialog processing. It might not be possible for the client to distinguish between the raw data and another message if the response to another operation is sent by the server while the client is waiting for the raw data. +- The client MUST begin waiting for the unformatted data to arrive. +- The server MUST send the unformatted data message to the client. Because the message contains unformatted raw bytes, the client MUST rely on the SMB transport to determine whether the message was received successfully and to determine the size of the message. +- After the client has successfully received the unformatted data message, it MAY respond with another SMB_COM_READ_RAW SMB to continue reading raw bytes from the file. The server MUST then respond with another unformatted data message. This cycle MAY continue until the client has read all of the bytes that it requires, an end of file is reached, or an error occurs. To indicate that the end of the file has been reached on a regular file, the server MUST return fewer bytes than the client has requested in the **MaxCountOfBytesToReturn** field. A Raw Read from a named pipe or device MAY return fewer bytes than the client requested. This does not indicate an end of file on the pipe or device. If a file read error occurs on the server, the server MUST return a zero-length unformatted data message to the client. + +If the server returns fewer bytes than requested by the client in the **MaxCountOfBytesToReturn** field, the client MAY respond with an alternate file I/O SMB (such as another Read operation or an SMB_COM_SEEK to the current position) using the same FID to determine the error. + +- If the client experiences a transport layer error, all bytes of the message MUST be received and discarded. There is no mechanism to inform the server of the transport error. The client is responsible for taking appropriate action to recover from the transport layer error. + +A sample dialog flow is: + +![Read Raw request/response message flow](data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04ftAxZWJ/sf+4T/koIMHY43WwhVgX4nEtT/c1Uh6LobIiXndEQh2ru08sujNhquhYYLWJyUQZWjRQTngdI7OaHATlaFvlYv9j4+H8UJ81aEtyRZRx/ED9GElNGbuIfZfj1fHY/Yv7Gl+kHAt90SfEuhCPa3lD97U8FvRVy+OaYsQoKM8j8ljdfWLRnQlTRQcsqDh5WWQsPLaUZZFwTDktIvZ5nALKMbnjwo+PqKoTF2B8FIt1oTYeJq4mL4uqrCfoW99L6fGzFF1sK1Ibe8kU0en+MQbuYbx/cSxs41g4pq7uD3XJ1+cWH4lpu2xL+xCPdV8ZN9ty3IJ88tjGBBKmPnuIY1PdQ2PRnQk10UkYJZqsJPb1nROLhHMsEs5r0dAO55nULBryOKc8ypOnxQVsVUeLGCSEeK42HrXLudhnBMmpHPVpH1icWqDkx0RbUBt7SeybcpF4LKGoLfUfxwK6zyT1SR+qS1mNETin87GtuA/lMW1Tj3tC20NwXRqLEnVEvEfkxXEp79BYdGdCTXRziNGBOT70jwUQeSGpU8WiOxMsOlNCZEcUpkhMj6OniEV3JmSIzphjwaI7Eyw6c85YdGeCRWfOGYvuTLDozDlj0Z0JFp05Zyy6M8GiM+eMRXcmWHTmnLHozgSLzpwzFt2ZgOT4oPnvUE5O55ZevHhh0Z0D/Nb748ePnZzONh3T+1iXYbX6P8GQBqRIH4GcAAAAAElFTkSuQmCC) + +Figure 7: Read Raw request/response message flow + +The client MUST accept an unformatted data message of up to **MaxCountOfBytesToReturn** bytes in length. **MaxCountOfBytesToReturn** is often set to 65,535 to maximize the transfer size and improve efficiency. + +SMB Protocol SMB_COM_READ_RAW is not supported over connectionless SMB transports. If SMB_COM_READ_RAW is supported by the server, the CAP_RAW_MODE flag MUST be set in the **Capabilities** field in the response to the SMB_COM_NEGOTIATE SMB. If the **Client.Connection.SelectedDialect** is **NT LAN Manager** or later, and the response to the SMB_COM_NEGOTIATE SMB has CAP_LARGE_FILES set in the **Capabilities** field, an additional request format is allowed that accommodates very large files having 64 bit offsets (see the **OffsetHigh** field in the command description in section [2.2.4.22.1](#Section_1458b62a18ed4fb2b8a9ceabffb2c3b7)).[<205>](#Appendix_A_205) + +##### Client Requests Multiplexed Read + +SMB_COM_READ_MPX is a specialized read command intended to maximize performance when reading large blocks of data from a regular file, while allowing for other operations to take place between the client and the server. This command is valid only when using a multiplexed session (that is, a single SMB connection multiplexed across multiple transport connections). The server MUST respond to the command request with one or more response messages until the requested amount of data has been returned or an error occurs. Each server response MUST contain the [**PID**](#gt_38a420dd-6f31-456e-ae5c-63ec6905380d) and **MID** of the original client request and the **Offset** and **Count** describing the returned data. + +If an error occurs, the server MUST send an error response. If any of the one or more responses to the SMB_COM_READ_MPX request contains an error code, the error applies to the command as a whole. + +The client has successfully received all of the data bytes when the sum of the **DataLength** fields received in each response equals the total amount of data bytes expected (smallest **Count** received). This allows the protocol to work even if the responses are received out of sequence. + +As is true in SMB_COM_READ, the total number of bytes returned can be less than the number requested only if a read specifies bytes beyond the current file size and the [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) refers to a disk file. In this case, the server MUST return only the bytes that exist. A read completely beyond the end of file MUST result in a single response with a zero value in **Count**. If the total number of bytes returned is less than the number of bytes requested, this indicates end of file. + +Once started, the Read Block Multiplexed operation is expected to continue until completion. The client MUST receive all of the responses generated by the server. Conflicting commands such as file close MUST NOT be sent to the server while a multiplexed operation is in progress. Server support of this command is optional. + +#### Application Requests Writing to a File, Named Pipe, or Device + +The application provides: + +- A valid **Client.Open**, representing the file to which the application attempts to write. +- An offset, in bytes and relative to the start of the file, marking the location within the file where the application attempts to write. +- The data and the number of bytes to be written. +- Whether or not the write is to be done in write-through mode. +- An optional time-out value, in milliseconds, designating how long to wait for the write to complete. + +CIFS provides several commands for writing data to a file, named pipe, or device. These are: + +- [SMB_COM_WRITE (section 2.2.4.12)](#Section_5f3ebf6a5d0643ee9429c8cc1b58eef5) (deprecated) + +The client MUST construct an [SMB_COM_WRITE Request (section 2.2.4.12.1)](#Section_861c96cfd6b14fb9b6e31783220813ad) message as defined in section 2.2.4.12.1. This command provides the basic Write operation. + +- [SMB_COM_WRITE_AND_UNLOCK (section 2.2.4.21)](#Section_5006049ae39b4dac83f20ec64c731c9c) (deprecated) + +This command is used to write to a locked byte range in the file and then unlock the range. The application MAY provide an indication of the number of additional bytes immediately following the bytes written and unlocked that it attempts to write. The byte range to be written MUST be locked prior to writing. The client MUST construct the [SMB_COM_WRITE_AND_UNLOCK Request (section 2.2.4.21.1)](#Section_c03fec3fd7094e7f96b1de9760766f77) as defined in section 2.2.4.21.1. + +- [SMB_COM_WRITE_RAW (section 2.2.4.25)](#Section_5feebf73e3b34bbda4497aea0a4cf87e) (deprecated) + +The client MUST construct an [SMB_COM_WRITE_RAW Request (section 2.2.4.25.1)](#Section_1ff2a25fefe2470ca780b06ef46c4089). The behavior of the SMB_COM_WRITE_RAW Request (section 2.2.4.25.1) is described in section [3.2.4.15.1](#Section_fdf362a685f54048a8367bbaca6e9eab). + +- [SMB_COM_WRITE_MPX (section 2.2.4.23)](#Section_9688c7181f3543f280c530d8a59ac305) (obsolescent) + +The client MUST construct an [SMB_COM_WRITE_MPX Request (section 2.2.4.23.1)](#Section_3e066ba09fce43c785fd756e4721f7ee) as defined in section [2.2.4.26.1](#Section_c7fa0e9f343b47df8157719a3ca9035c). The behavior of the SMB_COM_WRITE_MPX Request (section 2.2.4.23.1) is described in section [3.2.4.15.2](#Section_abb421393ab94dd1883c9158cb2429a8). + +- [SMB_COM_WRITE_AND_CLOSE (section 2.2.4.40)](#Section_029b038c4d4b42fc8c5199eb23055e9c) (deprecated) + +The client MUST construct an SMB_COM_WRITE_AND_CLOSE (section 2.2.4.40) command as defined in section [2.2.4.40.1](#Section_995268754b5a49cc968668ab49825a65). This command has the effect of writing to a range of bytes and then closing the file associated with the supplied [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766). This command behaves identically to an SMB_COM_WRITE (section 2.2.4.12) command followed by an [SMB_COM_CLOSE (section 2.2.4.5)](#Section_10059dd2ae0a48a2a95ca92505e9145f) command. + +- [SMB_COM_WRITE_ANDX (section 2.2.4.43)](#Section_81aec3770ff44fc4bc568f05b70c3e42) + +The client MUST construct an [SMB_COM_WRITE_ANDX Request (section 2.2.4.43.1)](#Section_a66126d2a1db446b8736b9f5559c49bd) message as defined in section 2.2.4.43.1, with the following additional requirements: + +- - If the client uses a 64-bit offset value, **SMB_Parameters.WordCount** MUST be set to 0x0E and the **SMB_Parameters.Words.Offset** and **SMB_Parameters.Words.OffsetHigh** fields MUST be set to the lower 32 bits and the higher 32 bits, respectively, of the supplied offset value. + - If the client uses a 32-bit offset value, **SMB_Parameters.WordCount** MUST be set to 0x0C, the **SMB_Parameters.Words.Offset** field MUST be assigned the offset value supplied by the application, and the **SMB_Parameters.Words.OffsetHigh** field MUST NOT be included in the request. + - The **SMB_Parameters.Words.WriteMode** field MUST reflect any behavior that the application requests from the server. See the description of the **WriteMode** field in section 2.2.4.25.1. + - The **SMB_Parameters.Words.DataLength** field MUST be set to the length, in bytes, of the data to be written. + - The **SMB_Parameters.Words.DataOffset** field MUST be set to the offset, in bytes and relative to the start of the SMB Header block, of the data to be written to the file. + - The **SMB_Data.Bytes.Pad** field MUST contain padding bytes used to align the **SMB_Data.Bytes.Data** field to an appropriate boundary. + - The **SMB_Data.Bytes.Data** field MUST contain the data to be written. + - If the write is to a named pipe, and if the write spans multiple requests, the client SHOULD set the **SMB_Parameters.Words.Remaining** field to the number of bytes remaining to be written and MUST set the RAW_MODE bit in the **SMB_Parameters.Words.WriteMode** field. For the first write request the client MUST set the MSG_START bit in the **SMB_Parameters.Words.WriteMode** field.[<206>](#Appendix_A_206) + +If the application writes to a named pipe or device and if a time-out value is supplied, the **SMB_Parameters.Words.Timeout** field MUST be assigned the value supplied by the application. Otherwise, it MUST be set to 0x00000000. + +- SMB_COM_WRITE_PRINT_FILE (deprecated) + +This command is used to write data to an open print queue spool file. The first data written to the print file MUST be printer-specific control data. The length of the control data block MUST be specified in the **SMB_Parameters.Words.SetupLength** field. A single SMB_COM_WRITE_PRINT_FILE command can contain both printer-specific control data and print file data, as long as the control data is completely written first. + +The client MUST construct an SMB_COM_WRITE_PRINT_FILE request message as defined in section [2.2.4.68.1](#Section_1f2768bcc9664ca9b43f857efa3b725a). + +- TRANS_RAW_WRITE_NMPIPE + +The client MUST construct the TRANS_RAW_WRITE_NMPIPE subcommand as defined in section [2.2.5.7](#Section_84397ad8d55c4ba7933ca96f2f64167d). The request MUST be transported to the server using the Transaction subprotocol. TRANS_RAW_WRITE_NMPIPE allows for a raw write of data to a named pipe. This method of writing data to a named pipe ignores message boundaries even if the pipe was set up as a [**message mode**](#gt_c49a48e8-f1ac-4568-bc87-0672eb08868b) pipe. + +- TRANS_WRITE_NMPIPE + +The client MUST construct the TRANS_WRITE_NMPIPE subcommand as defined in section [2.2.5.9.1](#Section_29c50bbac4a14001b27e86d925f914d0). The request MUST be transported to the server using the Transaction subprotocol. TRANS_WRITE_NMPIPE allows data to be written to a named pipe in the mode set on the named pipe. If the named pipe is in message mode, this subcommand MUST write a message from the pipe. + +The request MUST be sent to the server as described in section [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd). + +##### Client Requests Raw Write + +SMB_COM_WRITE_RAW is a specialized write command intended to maximize the performance of writing large blocks of data to an open regular file, a named pipe, device, or spooled output (printer). The command permits a client to send a large unformatted data (raw byte) message over the [**SMB transport**](#gt_f8b0f8a6-e412-459a-b8ba-219008e5bcd7) without requiring the usual SMB request format. It also permits a client to send messages in excess of the maximum buffer size (**Client.Connection.ServerMaxBufferSize**) that was established during session setup. To accomplish this, the client and the server enter into a [**dialog**](#gt_71ad645f-db5b-4e9f-9b3d-887039ada331). For the dialog to begin, the client MUST perform the following steps: + +- The client MUST compose the SMB_COM_WRITE_RAW request as described in section [2.2.4.25.1](#Section_1ff2a25fefe2470ca780b06ef46c4089). This request informs the server of the total number of bytes that the client designates to send over the course of the dialog. For the dialog to begin, the request MUST be sent to the server as described in section [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd), with the exception that SMB_COM_WRITE_RAW and message signing are mutually exclusive. Message signing MUST be disabled in order to perform a raw write. When the SMB_COM_WRITE_RAW request is received, the server MUST validate the request and attempt to write the initial data contained within the request. If an error is detected, the server returns a Final Server Response (section [2.2.4.25.3](#Section_f767334e77244f41b5df31b56d3b4328)), which completes the dialog. Otherwise, the server MUST respond with an Interim Server Response (section [2.2.4.25.2](#Section_d115b1d2149242aab37f222bfe272fbd)) to indicate that the message was received and that the server is ready for the unformatted raw data. The server MUST then begin waiting for the unformatted data message to arrive. +- The client MUST send the unformatted data message to the server. Because the message contains unformatted raw bytes, the server MUST rely on the SMB transport to determine whether the message was received successfully, and to determine the message size. + - If the **WritethroughMode** bit was set in the **WriteMode** field of the original request, then the server MUST send a Final Server Response following receipt of the raw data from the client. + - If the **WritethroughMode** bit was clear in the **WriteMode** field of the original request, then the server MUST NOT send a Final Server Response following receipt of the raw data from the client. + +A sample dialog flow is: + +![Write Raw request/response message flow](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAToAAAFSCAYAAABi5RNrAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAACw4AAAsOAUC+4UEAAB4HSURBVHhe7Z0rlBRJFkARI5DIkYgRCARiBGIFYkWLEVjkSiQCgRixAolEIhBjVoxAtByJWNFiBQKBGDFyBAKxpvbcnH7sI6iqzujMV0RX33tOnMrPy8isqIjbL7Kg8saff/65+fnnny0rFtpU5DJ8+vRp8/z58639ynK58uHDh80NFh48eLA1wNJfoi1FLsOrV6829+7d+6pfWS5XHj58uPnHP/7xl+gosg62pywB0TEwZR2iPRXdytiesgRFty6KrgjbU5ag6NZF0RVhe8oSFN26KLoibE9ZgqJbF0VXhO0pS1B066LoirA9ZQmKbl0UXRG2pyxB0a2LoivC9pQlKLp1UXRF2J6yBEW3LoquCNtTlqDo1kXRFWF7yhIU3boouiJsT1mColsXRVeE7SlLUHTrouiKsD1l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vwXgAAAAAElFTkSuQmCC) + +Figure 8: Write Raw request/response message flow + +Because the client sends a raw data message that does not include the typical request data, the SMB Protocol cannot guarantee that the server can associate the client's raw data message with the correct corresponding client's SMB_COM_WRITE_RAW command. Therefore, the client MUST guarantee that there are no other SMB requests from the client to the server for the duration of the SMB_COM_WRITE_RAW command's dialog processing. + +Server support of SMB_COM_WRITE_RAW is optional. This command is not supported over connectionless SMB transports. If SMB_COM_WRITE_RAW is supported by the server, the CAP_RAW_MODE flag MUST be set in the **Capabilities** field in the response to the SMB_COM_NEGOTIATE SMB. If the **Client.Connection.SelectedDialect** is [**NT LAN Manager**](#gt_6e52bc15-d369-45fd-b098-d51fc9baa56a) or later, and the response to the SMB_COM_NEGOTIATE SMB has CAP_LARGE_FILES set in the **Capabilities** field, an additional request format is allowed that accommodates very large files having 64-bit offsets (see the **OffsetHigh** field in the command description in section 2.2.4.25.1).[<207>](#Appendix_A_207) + +##### Client Requests Multiplexed Write + +SMB_COM_WRITE_MPX is used to maximize the performance of large block writes of data from the client to the server. This command is valid only when using a multiplexed session (multiple transport connections bound to a single SMB connection) over a connectionless transport. To perform a multiplexed write, the client MUST send multiple SMB_COM_WRITE_MPX requests (each containing data to be written and the offset, in the **ByteOffsetToBeginWrite** field, at which the packet data is to be written) before the server responds with a single SMB_COM_WRITE_MPX response. + +The client identifies the last request in the write sequence by also setting the **SMB Header SecurityFeatures.SequenceNumber** field to a nonzero value. This indicates to the server that the client indicates that it has completed sending all of the requests that need to be processed. After receiving the nonzero **SMB Header SecurityFeatures.SequenceNumber**, the server MUST respond with a single SMB_COM_WRITE_MPX response. + +The client request **RequestMask** values are saved by the server and bitwise OR-ed into a value that is returned to the client in the **ResponseMask** field of the server's SMB_COM_WRITE_MPX response. If a problem occurred with the [**SMB transport**](#gt_f8b0f8a6-e412-459a-b8ba-219008e5bcd7) and one or more of the client's SMB_COM_WRITE_MPX requests was not successfully received and processed by the server, the bit for that request MUST NOT be set in the server's SMB_COM_WRITE_MPX response **ResponseMask** field. The client MUST use the **ResponseMask** received in the SMB_COM_WRITE_MPX response to determine which client requests, if any, MUST be retransmitted. The client MUST use this behavior to send only the missing parts in the next write sequence when resending the lost requests. + +When all of the request messages have been successfully received by the server, and a final SMB_COM_WRITE_MPX response received, the client MAY perform another write operation using the SMB_COM_WRITE_MPX request. The next SMB_COM_WRITE_MPX sequence sent MUST use a new **SMB Header SecurityFeatures.SequenceNumber** value to uniquely identify the set of requests, or the server can incorrectly respond with the mask from the previous SMB_COM_WRITE_MPX command. The server MUST NOT impose any restrictions on the value of **RequestMask**, nor upon the order or contiguity of the requests being sent. + +The [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) MUST be identical in all requests in a given SMB_COM_WRITE_MPX exchange. The **TID**, [**PID**](#gt_38a420dd-6f31-456e-ae5c-63ec6905380d), **UID**, **MID**, and **CID** MUST be identical in all requests and responses in a given SMB_COM_WRITE_MPX exchange. + +Other requests MAY be issued on the same session while the SMB_COM_WRITE_MPX exchange is in progress. + +An example [**dialog**](#gt_71ad645f-db5b-4e9f-9b3d-887039ada331) flow is: + +![Multiplexed Write request/response message flow](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAXQAAAHuCAYAAACPnvd2AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAACxEAAAsOAbI+UQ8AAD0LSURBVHhe7Z0hlNTI1oCRiCeQIxCIJ1aMQCAQK5CIFZgnVvziFytGPIFAIJBIJHIEArNiBQKJWIF4AvEEAoFYgViBQGD7P1/Tl/9Sk+pJJenppPv7zqnTSeWmkk5Xvrpd3TN97ePHj6snT55YJipPnz5dff36dSUyBO/H6cvnz583V/fwufa///u/qwcPHnReCEt7uX379ur8/HxzeUXa8H6ctty7d2/9eCysha6ApsPrKWOw/0xLiP1YUOgT4/WUMdh/pkWhyyi8njIG+8+0KHQZhddTxmD/mRaFLqPwesoY7D/TotBlFF5PGYP9Z1oUuozC6yljsP9Mi0KXUXg9ZQz2n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/v1kTkX3y5s2b1bt37zZrMg9Wq/8DhF5oOoguBb0AAAAASUVORK5CYII=) + +Figure 9: Multiplexed Write request/response message flow + +At the time of the request, the client designates the number of data bytes to be sent and passes this information to the server in **TotalByteCount** field of the request. The server MAY use this information to reserve buffer space. + +Some systems provide no way for a process to block until the local file cache has actually flushed to the disk, but simply indicate that a flush has been scheduled and MUST complete soon. A server SHOULD nonetheless take steps to maximize the probability that the data is truly on disk before the client is notified. + +Server support of this command is optional. If the server supports this command it MUST set the CAP_MPX_MODE (0x00000002) bit in the **Capabilities** field of the response to SMB Protocol negotiation. Support for MPX mode excludes support for SMB signing and RAW read/write SMBs. + +This command is supported on connectionless transports only; consequently, bit 0x0080 of **WriteMode** in all request messages in the exchange MUST be set. The FID in the request(s) MUST refer to either a regular file or a spooled printer file. This command does not support named pipes or I/O devices. + +#### Application Requests a Byte-Range Lock on a File + +The application provides: + +- The **Client.Open** representing the file to be locked. +- An array of byte ranges to be locked. For each range, the application provides: + - A starting offset, in bytes. + - A length, in bytes. +- The number of byte ranges to be locked. +- The type of lock requested. +- The new oplock level, if this is a request from the server in response to a change. +- The length of time (in milliseconds) that the server is requested to wait for the locks to become available. +- An optional Boolean indicating whether the byte ranges are to be locked or shared. +- An optional Timeout. + +Any of the following commands can be used to explicitly lock a contiguous range of bytes in a regular file: + +- SMB_COM_LOCK_BYTE_RANGE (deprecated) + +The client MUST construct the SMB_COM_LOCK_BYTE_RANGE request as defined in section [2.2.4.13.1](#Section_0828263608764ded82b1973edd255f87). This command is limited to 32-bit offsets, and is considered deprecated. The SMB_COM_LOCKING_ANDX command SHOULD be used instead. + +- SMB_COM_LOCK_AND_READ (deprecated) + +This command combines the byte range lock with a read operation. The bytes locked by the request are also the bytes to be read. The application can provide an indication of the number of additional bytes immediately following the locked bytes that it designates to read. The client MUST construct the SMB_COM_LOCK_AND_READ (section [2.2.4.20.1](#Section_4652d923dc4e4611b17e9215d8c66f2e)) request. + +- SMB_COM_LOCKING_ANDX + +Multiple non-overlapping byte ranges can be locked with this command. The client MUST construct the SMB_COM_LOCKING_ANDX request as defined in section [2.2.4.32.1](#Section_b5c6eae7976b4444b52ec76c68c861ad). This client request is atomic. If the area to be locked is already locked or the lock request otherwise fails, no other ranges specified in the client request are locked. This command is capable of using 64-bit file offsets. If CAP_LARGE_FILES is set in **Client.Connection.ServerCapabilities**, 64-bit offsets SHOULD be used. + +The SMB_COM_LOCKING_ANDX command supports requests for shared locks. The preceding deprecated locking commands do not support shared locks. The application can request a shared lock. If the application does not specify the lock type, an exclusive read/write lock is requested by default. The request for a shared lock is specified by setting the **SHARED_LOCK** bit in the **TypeOfLock** field (see section 2.2.4.32.1). + +Locks prevent attempts by other **PID**s to lock, read, or write the locked portion of the file. Overlapping exclusive locks are not permitted. Offsets beyond the current end of file can be locked. Such locks MUST NOT cause allocation of additional file space. A lock MUST be unlocked only by the **PID** that performed the lock. + +The request MUST be sent to the server as described in section [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd). + +#### Application Requests the Release of a Byte-Range Lock on a File + +The application provides: + +- The **Client.Open** representing the file to be unlocked. +- An array of byte ranges to be unlocked. For each range, the application provides: + - A starting offset, in bytes. + - A length, in bytes. +- The number of byte ranges to be unlocked. +- The type of lock requested. +- The new oplock level, if this is a request from the server in response to a change. +- The length of time (in milliseconds) for the server to wait for the locks to become available. + +Any of the following commands can be used to explicitly unlock a contiguous range of bytes in a regular file: + +- [SMB_COM_UNLOCK_BYTE_RANGE (section 2.2.4.14)](#Section_3cfce68297d8499b8a2cef000f5d6b26) (deprecated) +- This command is used to explicitly unlock a contiguous range of bytes in an open regular file. The byte range specified MUST be exactly the same as that specified in a previous successful lock request from the same CIFS client and process; the [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766), [**PID**](#gt_38a420dd-6f31-456e-ae5c-63ec6905380d), and [**UID**](#gt_3d9dd73b-8923-43cc-ac95-8103f17683d7) MUST be the same as those used in the lock request. The client MUST construct the [SMB_COM_UNLOCK_BYTE_RANGE Request (section 2.2.4.14.1)](#Section_7d3d2faf84214acc885c805162028764), as defined in section 2.2.4.14.1. +- [SMB_COM_WRITE_AND_UNLOCK (section 2.2.4.21)](#Section_5006049ae39b4dac83f20ec64c731c9c) (deprecated) +- This command is used to write to a locked byte range in the file, and then unlock the range. The application MAY provide an indication of the number of additional bytes immediately following the bytes written and unlocked that it designates to write. The client MUST construct the [SMB_COM_WRITE_AND_UNLOCK Request (section 2.2.4.21.1)](#Section_c03fec3fd7094e7f96b1de9760766f77) as defined in section 2.2.4.21.1. +- [SMB_COM_LOCKING_ANDX (section 2.2.4.32)](#Section_df492170a2e840d1b7d5eb29364047e1) +- Multiple non-overlapping byte ranges can be unlocked with this command. The client MUST construct the [SMB_COM_LOCKING_ANDX Request (section 2.2.4.32.1)](#Section_b5c6eae7976b4444b52ec76c68c861ad). The client request is atomic. Failure to unlock or lock a byte range specified results in all ranges in the request being left in their previous state. This command is capable of using 64-bit file offsets. If CAP_LARGE_FILES is set in **Client.Connection.ServerCapabilities**, 64-bit offsets SHOULD be used. + +Closing the file releases all locks associated with the FID. The [SMB_COM_PROCESS_EXIT (section 2.2.4.18)](#Section_233f62a6f565478db9b82b58ff347547) command closes all file handles (FIDs) that were opened by the specified PID, and therefore releases all locks held on those FIDs. + +The request MUST be sent to the server as described in section [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd). + +#### Application Requests an Opportunistic Lock on a File + +The application requests an OpLock when opening or creating a file. See sections [3.2.4.5](#Section_66435b844e2242ffb4e15ff7b07de138) and [3.2.4.6](#Section_ed665df4858c4ad0b65012bdf79e7da6) for information on opening and creating files. The following SMB commands can be used to obtain an OpLock: + +- [SMB_COM_OPEN (section 2.2.4.3)](#Section_ec064de86538401e8c73b37231c36f2b) +- [SMB_COM_CREATE (section 2.2.4.4)](#Section_87622f4337584bf9b1fb35109f0e5c15) +- [SMB_COM_CREATE_NEW (section 2.2.4.16)](#Section_161fa213ba9d4bad948329e8b5872dca) +- [SMB_COM_OPEN_ANDX (section 2.2.4.41)](#Section_49a0f97dc4a748a3bf5046d816825729) +- [SMB_COM_NT_CREATE_ANDX (section 2.2.4.64)](#Section_d3f83a7e493b4d29b21c55768b93e144) +- [TRANS2_OPEN2 (section 2.2.6.1)](#Section_ee2f11ca7c7e49ac9cb78b1ed1259c2c) +- [NT_TRANSACT_CREATE (section 2.2.7.1)](#Section_f85bb6cf2d3949c9bfe5307ad57d5da5) + +The application can request either an exclusive OpLock or a batch exclusive OpLock on a file. The server indicates the type of OpLock granted in the response. The server MUST grant the requested OpLock, a read-only (Level II) OpLock, or no OpLock. If an exclusive OpLock is not available, Level II OpLocks are granted only in response to SMB_COM_NT_CREATE_ANDX (section 2.2.4.64) or [NT_TRANSACT_CREATE Requests (section 2.2.7.1.1)](#Section_42eef5ff34d74389a4e5812820475686). + +- If a Level II OpLock is granted, the server guarantees that no other process is modifying the file and that the client can perform read caching. +- If an exclusive OpLock is granted, read caching, write caching, and byte-range lock caching can be performed on the client side. +- If an exclusive batch OpLock is granted, the client can additionally cache file close operations, delaying sending file close operations to the server indefinitely and thus maintaining the client-side cache. + +An OpLock remains in effect until the server revokes it or the file is closed by the client. For a batch OpLock, the client MAY cache file close operations from the application. The batch OpLock is released when the client performs the close operation. + +Detailed information regarding OpLock semantics is provided in [\[FSBO\]](https://go.microsoft.com/fwlink/?LinkId=140636). + +#### Application Requests Verifying a Directory Path + +The application provides: + +- A **Client.TreeConnect** indicating the share within which the directory resides. +- The pathname of the directory, relative to **Client.TreeConnect.ShareName**. +- A valid **Client.Session**. + +The client MUST construct an [SMB_COM_CHECK_DIRECTORY Request (section 2.2.4.17.1)](#Section_dc566429904b4bf58158d68f2370ae68) message. The **SMB_Data.Bytes DirectoryName field** MUST be set to the value that was supplied by the application. + +The request MUST be sent to the server as described in section [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd). + +#### Client Notifies the Server of a Process Exit + +The SMB_COM_PROCESS_EXIT command MAY be used to indicate to the server that a client process, represented by a [**PID**](#gt_38a420dd-6f31-456e-ae5c-63ec6905380d) value, has failed and that all resources allocated to that PID MUST be freed. The semantics of this command are deprecated, however, and it SHOULD NOT be used by new client implementations. + +The client MUST construct the SMB_COM_PROCESS_EXIT request message as defined in section [2.2.4.18.1](#Section_bb004a1834b647f3a1d1f1dfe441a222). The request MUST be sent to the server as described in section [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd). + +#### Application Requests to Seek to a Location in a File + +The file MUST be held open by the application, and the application MUST provide a **Client.Open** as well as the desired offset and seek mode. + +If the seek mode is 1 (meaning seek from the current position) and the offset is zero, then the application is requesting that the server report the current position of the file pointer (the current offset). Otherwise, the application is attempting to set the current file pointer. SMB_COM_SEEK handles 32-bit offsets only. Also, all Read and Write operations in the protocol set the file pointer, so it is not necessary to use SMB_COM_SEEK for that purpose. SMB_COM_SEEK is listed as obsolescent. + +The client MUST construct the SMB_COM_SEEK request message as defined in section [2.2.4.19.1](#Section_e9dd996cba2b474bae5d5f65c3be1251). The request MUST be sent to the server as described in section [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd). + +#### Application Requests Sending an IOCTL to a File or Device + +The application MUST supply a **Client.Open** representing the open file or device, as well as the [**IOCTL**](#gt_09d6bc87-34ed-48e8-b4d4-962e90543462) category and function. The client MUST use either of the following commands to transfer the IOCTL to the server: + +- [SMB_COM_IOCTL (obsolescent) (section 2.2.4.35)](#Section_0d8f5f1716af499da192a5fd85fbb7e1) + +The client MUST construct the [SMB_COM_IOCTL Request (section 2.2.4.35.1)](#Section_c8f1b5b19ec149d2a0e178ee88f39e71) message. + +- NT_TRANSACT_IOCTL + +The application provides the following: + +- - An input buffer, \_**NT_Trans_Data**, to be passed to the **fsctl** or **ioctl** function. + +The client MUST construct the [NT_TRANSACT_IOCTL Request (section 2.2.7.2.1)](#Section_932020a1bbb04baa8adc9c3c19e6ea67) message, with the following additional requirements: + +- - The **SMB_Parameters.Words.Setup.IsFsctl** flag is set to 0x01. + - The **SMB_Parameters.Words.Setup.IsFlags** flag is set to 0x01 if **Client.TreeConnect.IsDfsShare** is TRUE; otherwise, it is set to 0x00. + - The **SMB_Data.Bytes.NT_Trans_Data** field contains NT_Trans_Data supplied by the application. + +The request MUST be transported to the server using the NT Transaction subprotocol. + +The format of the IOCTL data and parameters are determined by the specific IOCTL function being called. The request MUST be sent to the server as described in section [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd). + +#### Application Requests Testing Transport Layer Connection + +The client MUST have an established SMB connection and MUST have performed an SMB Protocol negotiation. No SMB session is necessary. + +The application MUST provide: + +- The **Client.Connection** that identifies the connection on which to send the request. +- The number of responses that the application designates to receive from the server. This number SHOULD be greater than zero. +- A block of data, which might be random, to be echoed by the server. + +The client MUST construct an SMB_COM_ECHO request message as defined in section [2.2.4.39.1](#Section_5dd916b29c384f0cba55a2c86dd5de10). The data block provided by the application MUST be sent in the **SMB_Data.Bytes.Data** field; otherwise, the field MUST be empty. + +The request MUST be sent to the server as described in section [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd). + +#### Application Requests a Tree Disconnect (Unmount Share) + +The application MUST provide the **Client.TreeConnect** of the tree connect to be closed. The client MUST construct an SMB_COM_TREE_DISCONNECT request as defined in section [2.2.4.51.1](#Section_354844d75d3946d28e6b727fcf53e98d). The request MUST be sent to the server as described in section [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd). All locks associated with open files within the share represented by the **Client.TreeConnect.TID** are released. All open search and file handles that represent objects within the **TID** are closed. + +#### Application Requests an SMB Session Logoff + +The application MUST provide the **Client.Session** of the [**SMB session**](#gt_ee1ec898-536f-41c4-9d90-b4f7d981fd67) to be closed. + +The client MUST traverse the **Client.Connection.TreeConnectTable**, and for each entry in which **Client.TreeConnect.Session** matches the application-provided **Client.Session**, the **TreeConnect** MUST be closed, as specified in section [3.2.4.24](#Section_cbce4d659c874d7ea121730932263936). + +The client MUST construct an [SMB_COM_LOGOFF_ANDX Request (section 2.2.4.54.1)](#Section_efbd2ebb470f4d8abcab1eadb432305e). The request MUST be sent to the server as specified in section [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd). The user represented by the **Client.Session.SessionUID** value, presented in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f), is logged off as follows: + +- The server cancels any outstanding command requests for this **UID**. +- The server releases all locks and closes all files opened by this **UID**; the associated **FID**s are invalidated. +- The server closes all searches currently held open by this **UID**; the associated **SID**s are invalidated. +- The server disconnects all tree connects created by this **UID**; the associated **TID**s are invalidated. +- The server invalidates the **UID**. + +#### Application Requests Querying File System Attributes + +The application provides: + +- A **Client.TreeConnect.TreeID** (**TID**) of the share to be queried. +- The [**information level**](#gt_b01da706-86d0-4ee2-9461-2d9fb1060543) that describes the format of the information being queried, as specified in [\[MS-FSCC\]](%5bMS-FSCC%5d.pdf#Section_efbfe12773ad41409967ec6500e66d5e) section 2.5. + +The client requests the retrieval of attributes from a file system using either of the two following commands. The client MUST map the application-provided information level to the **QUERY_FS Information Levels**, as specified in section [2.2.8](#Section_2bcf1801eb0d422a9b6d43a6e33fb446). + +- [SMB_COM_QUERY_INFORMATION_DISK (section 2.2.4.57)](#Section_c5b02889bcf44ad19bd7014614179107) (deprecated) + +This command MUST be sent by a client to obtain the capacity and remaining free space on the volume hosting the subtree indicated by the **TID** in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f). It MUST be constructed as defined in section [2.2.4.57.1](#Section_711abf8cb5a343e78213ef37b9f9cb00). + +- [TRANS2_QUERY_FS_INFORMATION (section 2.2.6.4)](#Section_a96c1c03cade4a4a81a9b00674d23d93) + +The client MUST construct the [TRANS2_QUERY_FS_INFORMATION Request (section 2.2.6.4.1)](#Section_cfa23a110e8043bdbbd4e9cfb99b5dce) message. The request MUST be transported to the server using the Transaction2 subprotocol. + +The request MUST be sent to the server as described in section [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd). + +#### Application Requests a Directory Enumeration + +The application provides the following: + +- A **Client.TreeConnect** indicating the share within which the directory resides. +- The pathname of the directory to query, relative to **Client.TreeConnect.ShareName**. +- A valid **Client.Session**. +- A wildcard qualifier to select the file names to return. +- A set of attribute flags that further qualify the list of file names to return. +- An [**Information Level**](#gt_b01da706-86d0-4ee2-9461-2d9fb1060543) that defines the format of the data to return. +- The number of results to return. +- A set of flags used to request that the server manage the transaction state based on how the client attempts to traverse results. +- A MASK specifying whether the search is for directories or for files. +- If the Information Level provided is **SMB_INFO_QUERY_EAS_FROM_LIST**, the application provides a list of extended attributes. + +The client can use any of the following commands to enumerate the directory entries matching the application's criteria: + +- [SMB_COM_SEARCH (deprecated) (section 2.2.4.58)](#Section_d33e84721356406d88edbd9fc10b060b) + +The client MUST construct the **SMB_COM_SEARCH** request message as defined in section [2.2.4.58.1](#Section_239b0def83704dc78391ee60952901b1). The **FileName** field is the full directory path (relative to the **TID**) of the file(s) being sought. The final component of the path MAY contain wildcards. This string MAY be the empty string. The **SearchAttributes** field is an attribute mask used to specify the standard attributes that a file MUST have to match the search. If the value of this field is 0x0000, only normal files are returned. If the Volume Label attribute is set, then the volume label MUST be the only name returned (the Volume Label attribute is exclusive). If the Directory, System, or Hidden attributes are specified, those entries are requested in addition to the normal files. + +There is no Close operation associated with the SMB_COM_SEARCH. The client provides the server with no direct indication that the search is complete unless the client continues the search until the last matching entry has been returned. + +An SMB_COM_PROCESS_EXIT request from the client closes an incomplete search. Disconnecting the **Client.TreeConnect** within which the search is active also closes the search. + +- SMB_COM_FIND (deprecated) + +The client MUST construct the SMB_COM_FIND request message as defined in section [2.2.4.59.1](#Section_f2890270ee43427f9e4807420a836457). The format and operation of SMB_COM_FIND is identical to that of SMB_COM_SEARCH, except that the search MAY be closed using the SMB_COM_FIND_CLOSE command, which provides a specific indication to the server that the search has been completed. + +- SMB_COM_FIND_UNIQUE (deprecated) + +The client MUST construct the SMB_COM_FIND_UNIQUE request message as defined in section [2.2.4.60.1](#Section_1120965ef21742a086f0f8285ecbc32a). The format and operation of SMB_COM_FIND_UNIQUE is identical to that of SMB_COM_FIND. The former performs an implicit close on the search operation so that no SMB_COM_FIND_CLOSE is needed. The SMB_COM_FIND_UNIQUE returns only the results that can fit within a single response. + +- TRANS2_FIND_FIRST2 + +The client MUST construct the TRANS2_FIND_FIRST2 request message as defined in section [2.2.6.2.1](#Section_b2b2a73094994f05884ed5bb7b9caf90). If the search is incomplete following the first response from the server, the client MAY continue the search using a TRANS2_FIND_NEXT2 request as defined in section [2.2.6.3.1](#Section_80dc980efe03455cada67c5dd6c551ba). These requests MUST be transported to the server using the Transaction2 subprotocol. If the search finds no names that match the client request, or if the continuation of the search finds no more names that match the client request: + +- - The server returns STATUS_NO_MORE_FILES as a 32-bit error code if the client set SMB_FLAGS2_NT_STATUS in the **Flags2** field of the client request. + - The server returns ERRDOS/ERRnofiles as an SMBSTATUS if SMB_FLAGS2_NT_STATUS is NOT set in the **Flags2** field of the client request. + +Note that these return codes are not considered errors in this case. + +The request MUST be sent to the server as described in section [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd). + +#### Application Requests Canceling Pending Operations + +The application MUST provide the **UID**, **TID**, **PID**, and **MID** of the operation or operations to be canceled. If a connectionless transport is in use, then the application MUST also provide the **CID** (Connection ID) of the SMB connection. + +The client MUST issue the cancel by sending an SMB_COM_NT_CANCEL request message. This message MUST be constructed as defined in section [2.2.4.65.1](#Section_e4f9bcfa982e43dd8db792db9aac13cc). The server MUST attempt to complete pending operations that match the **UID**, **TID**, **PID**, and **MID** (and CID, if required) in the request. Any matching pending operation that cannot be completed successfully MUST fail with an implementation-specific error status. + +In particular, the SMB_COM_NT_CANCEL operation completes any Directory Change Notify operations (NT_TRANSACT_NOTIFY_CHANGE) on the server, causing the server to send an NT_TRANSACT_NOTIFY_CHANGE response message. + +The request MUST be sent to the server as described in section [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd), particularly the special handling required for SMB_COM_NT_CANCEL. + +#### Application Requests to Print a File + +The application MUST provide the **Client.Session** and MUST provide the **Client.TreeConnect** representing a connection to the printer share to which the data will be printed. + +The client MUST create a print spool file using the SMB_COM_OPEN_PRINT_FILE command. The command request MUST be constructed as defined in section [2.2.4.67.1](#Section_a0199848ec124408981288a5f1c30ceb). The application MUST provide any printer-specific control data and the length, in bytes, of that data, which is copied into the **SMB_Parameters.Words.SetupLength** field. The application MUST indicate whether the data to be printed is to be handled in Text or Binary mode. See the description of the **SMB_Parameters.Words.Mode** field in section 2.2.4.67.1. + +The application optionally provides printer-specific control data. If provided, it MUST be written to the spool file first, followed by the print file data itself. + +The request MUST be sent to the server as described in section [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd). If successful, the command MUST return a valid [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) representing the opened spool file. + +Any command capable of writing to an open FID, including SMB_COM_WRITE_PRINT_FILE, can be used to write the data to the print spool file. The file is queued for printing when the FID is closed. The FID can be closed using SMB_COM_CLOSE_PRINT_FILE (deprecated) or SMB_COM_CLOSE. The client can also use SMB_COM_WRITE_AND_CLOSE (deprecated) to write spool file data and close the file. + +#### Application Requests Setting Named Pipe State + +A client requests setting the state of a named pipe by issuing an SMB_COM_TRANSACTION Request with the subcommand TRANS_SET_NMPIPE_STATE. The application MUST provide a **Client.Open** of the named pipe to which the state change is to be applied. The application provides the [**pipe state**](#gt_272df0d4-9c8e-471c-97d0-2d5dcbd4a900) as specified in section [2.2.5.1.1](#Section_4f2f5424814549ecaeeb6f477559e39b). + +The client MUST construct the TRANS_SET_NMPIPE_STATE request message. The request MUST be sent to the server as specified in section [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd). + +If the **ReadMode** bits (see section [2.2.1.3](#Section_6911a7095dfb4ffbb0903e8ef872f85c)) of the **PipeState** field in the TRANS_SET_NMPIPE_STATE Request (section 2.2.5.1.1) are zero, the client MUST set **Client.Open.NamedPipeMessageMode** to FALSE; otherwise, the client MUST set **Client.Open.NamedPipeMessageMode** to TRUE. + +#### Application Requests Querying Named Pipe Handle State + +A client queries named pipe state by issuing an SMB_COM_TRANSACTION request (section [2.2.4.33.1](#Section_57bfc115fe294482a0fea935757e0a4f)) with the subcommand TRANS_QUERY_NMPIPE_STATE. The application MUST provide a [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) indicating the open named pipe for which the state is being queried. + +The client MUST construct the TRANS_QUERY_NMPIPE_STATE request message. The request MUST be sent to the server as specified in section [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd). + +A client queries [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca) state by issuing an SMB_COM_TRANSACTION Request (section 2.2.4.33.1) with the subcommand [TRANS_QUERY_NMPIPE_STATE (section 2.2.5.3)](#Section_905e248a9fc44c09aeae5cf2a6dfd015). The application MUST provide a **Client.Open** identifying the [**open**](#gt_0d572cce-4683-4b21-945a-7f8035bb6469) to the named pipe. + +The client MUST construct the [TRANS_QUERY_NMPIPE_STATE Request](#Section_3d0ff384b14744a6934a4ec138144fb2) message, using the **Client.Open.FID** from the supplied open. The request MUST be sent to the server as specified in section 3.2.4.1. The [TRANS_QUERY_NMPIPE_STATE Response (section 2.2.5.3.2)](#Section_259877b6e0b5485e81ed97c400fc722e) MUST be processed as specified in section [3.2.5.38.3](#Section_a93d518ac2504a419e13ae602e929b5d). If the **ReadMode** bits (see section [2.2.1.3](#Section_6911a7095dfb4ffbb0903e8ef872f85c)) of the **NMPipeStatus** field in the TRANS_QUERY_NMPIPE_STATE Response are zero, the client MUST set **Client.Open.NamedPipeMessageMode** to FALSE; otherwise, the client MUST set **Client.Open.NamedPipeMessageMode** to TRUE. + +#### Application Requests Querying Named Pipe Information + +A client requests querying named pipe information by issuing an SMB_COM_TRANSACTION request (section [2.2.4.33.1](#Section_57bfc115fe294482a0fea935757e0a4f)) with the subcommand TRANS_QUERY_NMPIPE_INFO. The application MUST provide a **Client.Open** indicating the open named pipe from which the information is to be queried. Available information includes: + +- Input and Output buffer sizes. +- Maximum and current number of instances of the named pipe. +- The name and the length of the name of the named pipe. + +The client MUST construct the TRANS_QUERY_NMPIPE_INFO request message as specified in section [2.2.5.4.1](#Section_fc1b3176ad524643b5ee03aba8dec5ce). The request MUST be sent to the server as described in section [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd). + +#### Application Requests Peeking at Named Pipe Data + +A client requests peeking into pipe data on a named pipe by issuing an SMB_COM_TRANSACTION request (section [2.2.4.33.1](#Section_57bfc115fe294482a0fea935757e0a4f)) with the subcommand TRANS_PEEK_NMPIPE. The application MUST provide a **Client.Open** indicating the open named pipe from which data is to be read and the number of bytes to attempt to read. + +The client MUST construct the TRANS_PEEK_NMPIPE request message as specified in section [2.2.5.5.1](#Section_dbafe8f95269472bbff45c2d7f140e34). The request MUST be sent to the server as described in section [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd). + +#### Application Requests Executing a Transaction on a Named Pipe + +A client executes a transaction on a [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca) by issuing an [SMB_COM_TRANSACTION Request (section 2.2.4.33.1)](#Section_57bfc115fe294482a0fea935757e0a4f) with the subcommand [TRANS_TRANSACT_NMPIPE (section 2.2.5.6)](#Section_f599d0f080b148869657944f36a44138). The application MUST provide a **Client.Open** indicating the open named pipe on which to perform the transaction, a buffer of data to write into the pipe, and the maximum number of bytes to read out of the pipe. + +The client MUST construct the [TRANS_TRANSACT_NMPIPE Request (section 2.2.5.6.1)](#Section_7ce2407248694348af7bf66b6f7591e7) message and MUST send it to the server as specified in section [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd). + +#### Application Requests Waiting for Named Pipe Availability + +A client requests to wait for named pipe availability by issuing an SMB_COM_TRANSACTION (section [2.2.4.33.1](#Section_57bfc115fe294482a0fea935757e0a4f)) request with the subcommand TRANS_WAIT_NMPIPE. The application MUST provide the following: + +- A **Client.TreeConnect** indicating the share within which the named pipe resides. +- The pathname of the named pipe, relative to **Client.TreeConnect.ShareName**. +- A valid **Client.Session**. +- A time-out value indicating how long to wait for named pipe availability. + +The client MUST construct the TRANS_WAIT_NMPIPE request message as specified in section [2.2.5.10.1](#Section_343d6fda9a094d7581c4bd5e6ff05932). The request MUST be sent to the server as described in section [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd). + +#### Application Requests Named Pipe Exchange (Call) + +A client executes a call on a named pipe by issuing an SMB_COM_TRANSACTION (section [2.2.4.33.1](#Section_57bfc115fe294482a0fea935757e0a4f)) request with the subcommand TRANS_CALL_NMPIPE. The Call operation is similar to the operation performed by TRANS_TRANSACT_NMPIPE, except that the pipe is opened and closed by the Call operation. + +The application MUST provide: + +- A **Client.TreeConnect** indicating the share within which the named pipe resides. +- The pathname of the named pipe, relative to **Client.TreeConnect.ShareName**. +- A valid **Client.Session**. +- A buffer containing the data to be written into the pipe. +- The number of bytes to be written. +- The maximum number of bytes to read from the pipe. +- A priority value in the range 0..9; higher values indicate higher priority. + +The client MUST construct the TRANS_CALL_NMPIPE request message as specified in section [2.2.5.11.1](#Section_57e182d43dd646a5911c4d714cb1865b). The request MUST be sent to the server as described in section [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd). + +#### Application Requests to Read from a Named Pipe + +A client can request to read from a [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca) by issuing an SMB_COM_TRANSACTION Request with the subcommand TRANS_READ_NMPIPE. The application MUST provide a **Client.Open** indicating the open named pipe from which data is to be read. The application provides the maximum number of bytes that the client attempts to read from the named pipe. + +Named pipes can be in raw mode or [**message mode**](#gt_c49a48e8-f1ac-4568-bc87-0672eb08868b) (see [TRANS_SET_NMPIPE_STATE](#Section_2481644c725944b89b8bae539f7b3eb6)). If the named pipe is in raw mode, as indicated by a **Client.Open.NamedPipeMessageMode** value of FALSE, it can be read by any of several Read operations (see section [3.2.4.14](#Section_18c7441d4b024f738b3e13b78396a1e4)). If the pipe is in message mode, as indicated by a **Client.Open.NamedPipeMessageMode** value of TRUE, [TRANS_READ_NMPIPE](#Section_d9004cc94b844d4ca522ec559f53c1a7) MUST be used to read discrete messages. + +The client MUST construct the TRANS_READ_NMPIPE Request message and MUST send it to the server as specified in section [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd). + +#### Application Requests Writing to a Named Pipe + +A client can write to a [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca) by issuing an SMB_COM_TRANSACTION request with the subcommand TRANS_WRITE_NMPIPE. The application MUST provide a **Client.Open** indicating the open named pipe to which data is to be written. + +Named pipes can be in raw mode or [**message mode**](#gt_c49a48e8-f1ac-4568-bc87-0672eb08868b) (see [TRANS_SET_NMPIPE_STATE](#Section_2481644c725944b89b8bae539f7b3eb6)). If the named pipe is in raw mode, as indicated by a **Client.Open.NamedPipeMessageMode** value of FALSE, it can be written to using any of several Write operations (see section [3.2.4.15](#Section_13ec5da367744618a4a0709002cda9dc)). If the pipe is in message mode, as indicated by a **Client.Open.NamedPipeMessageMode** value of TRUE, TRANS_WRITE_NMPIPE MUST be used to write discrete messages. + +The client MUST construct the TRANS_WRITE_NMPIPE request message and MUST send it to the server as specified in section [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd). + +#### Application Requests Notification of Change in Directory Contents + +A client requests waiting for directory change notification by issuing an SMB_COM_NT_TRANSACT (section [2.2.4.62.1](#Section_1e62725cbb9e470499a48db520a6f2da)) request with the subcommand NT_TRANSACT_NOTIFY_CHANGE. The application provides the following: + +- A **Client.Open** indicating a directory within a connected share. +- A Completion Filter indicating the changes needed in order to complete the command. +- A Boolean indicating whether or not subtrees of the specified directory are also to be monitored for changes. +- The size of the buffer that the server MUST use to collect file change information. + +The command MUST NOT be completed until one of the following events occurs: + +- A change matching one of the change events in the Completion Filter occurs. +- An SMB_COM_NT_CANCEL with matching **UID**, **TID**, **PID**, **MID**, and (depending upon the transport type) **CID** is received. See section [3.2.4.28](#Section_54301b60971f42a4b6c1d70dd06a8a45). + +The **SMB_Parameters.Words.MaxParameterCount** field in the SMB_COM_NT_TRANSACT request determines the size of the buffer that is used by the server to buffer directory change information. The **SMB_Parameters.Words.MaxParameterCount** field in the SMB_COM_NT_TRANSACT request is set to the size supplied by the application. + +The client MUST construct the NT_TRANSACT_NOTIFY_CHANGE request message as specified in section [2.2.7.4.1](#Section_ecf3b6004b0945d684c2d3fd8bb2e2c4). The request MUST be sent to the server as described in section [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd). + +#### Application Requests Querying Security Descriptors + +A client requests to query [**security descriptors**](#gt_e5213722-75a9-44e7-b026-8e4833f0d350) by issuing an SMB_COM_NT_TRANSACT (section [2.2.4.62.1](#Section_1e62725cbb9e470499a48db520a6f2da)) request with the subcommand NT_TRANSACT_QUERY_SECURITY_DESC. The application MUST provide the **Client.Open** of the file that is the target of the query, the maximum number of data bytes the client accepts in the response, and a list of the security information fields being requested. + +The client MUST construct the NT_TRANSACT_QUERY_SECURITY_DESC request message as specified in section [2.2.7.6.1](#Section_6cd8638ea4f446d59e9aefa64008d3d5). The request MUST be sent to the server as described in section [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd). + +#### Application Requests Setting Security Descriptors + +A client requests to set [**security descriptors**](#gt_e5213722-75a9-44e7-b026-8e4833f0d350) by issuing an SMB_COM_NT_TRANSACT (section [2.2.4.62.1](#Section_1e62725cbb9e470499a48db520a6f2da)) request with the subcommand NT_TRANSACT_SET_SECURITY_DESC. The application MUST provide the **Client.Open** of the target file. The application MUST also provide a list of the security descriptor fields to be set and the security descriptors to be updated. + +The client MUST construct the NT_TRANSACT_SET_SECURITY_DESC request message as specified in section [2.2.7.3.1](#Section_41fa05e3a01e48bfa53373b62b758a77). The request MUST be sent to the server as described in section [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd). + +#### Application Requests a Named RAP Transaction + +An application can perform Remote Administration Protocol (RAP) operations from CIFS. The application MUST provide **Client.Session** and **Client.TreeConnect**. **Client.TreeConnect.ShareName** MUST indicate the IPC\$ interprocess communications share. + +The SMB Transaction subprotocol (SMB_COM_TRANSACTION and SMB_COM_TRANSACTION_SECONDARY) is used to transfer RAP operations. RAP uses the \\PIPE\\LANMAN named pipe in the IPC\$ share. RAP has its own set of function codes and does not use the Transaction subcommands listed in section [2.2.5](#Section_227cb1473c094c4bb1456c94b04c8231). For a full decryption, see [\[MS-RAP\]](%5bMS-RAP%5d.pdf#Section_fb8d5bd1e57c4be1b063ec31330bdd58). + +#### DFS Subsystem Notifies That It Is Active + +If the DFS subsystem is available to the CIFS client, it MUST notify the client. After this event, the client is able to set the CAP_DFS flag in the **Capabilities** field of an SMB_COM_SESSION_SETUP_ANDX request.[<208>](#Appendix_A_208) + +#### Application Requests Querying DFS Referrals + +The application provides the following: + +- **ServerName**: The name of the server from which to query referrals. +- **UserCredentials**: An opaque implementation-specific entity that identifies the credentials to be used when authenticating to the remote server. +- The maximum response size, in bytes. +- An input buffer containing the application-provided **REQ_GET_DFS_REFERRAL** structure specified in [\[MS-DFSC\]](%5bMS-DFSC%5d.pdf#Section_3109f4be2dbb42c99b8e0b34f7a2135e) section 2.2.2. + +The client MUST search for an existing **Session** and **TreeConnect** to any share on the server identified by **ServerName** for the user identified by **UserCredentials**. If no **Session** and **TreeConnect** are found, the client MUST establish a new **Session** and **TreeConnect** to IPC\$ on the target server, as specified in section [3.2.4.2](#Section_96d90ccb9f7f47159d21987b93304f74) using the supplied **ServerName** and **UserCredentials**. + +The client MUST construct a [TRANS2_GET_DFS_REFERRAL Request](#Section_0782a79d7e3149a6b446835d33f89435) and MUST set ReferralRequest to the application-provided input buffer. + +The client MUST construct a TRANS2_GET_DFS_REFERRAL Request (section 2.2.6.16.1) and MUST set ReferralRequest to the application-provided input buffer. The **MaxDataCount** field of the [SMB_COM_TRANSACTION2 Request (section 2.2.4.46.1)](#Section_f7d148cde3d549ae8b379633822bfeac) MUST be set to the maximum response size supplied by the caller. The client MUST issue the TRANS2_GET_DFS_REFERRAL Request using the **Client.TreeConnect.TreeID** of the IPC\$ share. + +#### Application Requests Querying Cryptographic Session Key + +The application MUST provide: + +- **Open:** A valid **Open** identifying an open instance of a file or pipe. + +The client MUST find the application-supplied **Open** in **Client.Connection.OpenTable**. It MUST then return **Client.Open.Session.SessionKey** to the calling application. + +#### Application Requests Number of Opens on a Tree Connect + +The application provides: + +- **Client.TreeConnect**: A valid tree connect to be queried. + +The client MUST query the total number of opens on **Client.TreeConnect** by looking up the **Client.Connection.OpenTable** where **Client.Open.TreeConnect** matches the application-supplied **Client.TreeConnect**, and return the matching count to the calling application. + +### Processing Events and Sequencing Rules + +#### Receiving Any Message + +Upon receiving any SMB message, the client MUST associate the message received with the correct client process and thread, as identified by the [**PID**](#gt_38a420dd-6f31-456e-ae5c-63ec6905380d) and **MID** values in the **Client.Connection.PIDMIDList**. If the **MID** value is the reserved value 0xFFFF ((USHORT)(-1)), the message can be an OpLock break sent by the server. Otherwise, if the PID and **MID** values of the received message are not found in the **Client.Connection.PIDMIDList**, the message MUST be discarded. + +If an SMB_COM_READ_RAW is in progress and the message is a raw data transfer, the message MUST be handled as described in section [3.2.5.16](#Section_e3fc8016c3da4350a0c1b82a8ab4ec6f). + +Unless otherwise noted, the client MUST return the status received in the **SMB_Header.Status** field of a response message to the application that issued the corresponding request. + +For the response messages of the following commands, there are no other processing rules required on the client: + +- [SMB_COM_CREATE_DIRECTORY (section 2.2.4.1)](#Section_e6e870ad70374b79ac544a42a1ba4561) +- [SMB_COM_DELETE_DIRECTORY (section 2.2.4.2)](#Section_0bca354c42d946b7a0aed8c6870242ca) +- [SMB_COM_FLUSH (section 2.2.4.6)](#Section_32acdf03011d4e93b169a787f21dc13d) +- [SMB_COM_DELETE (section 2.2.4.7)](#Section_e455faa4d99643a587eb9993b0ceb896) +- [SMB_COM_RENAME (section 2.2.4.8)](#Section_d78c549c9ab84d92bbbc6843bed943f6) +- [SMB_COM_SET_INFORMATION (section 2.2.4.10)](#Section_e3cd0acdaa844fbf8c9d3e7d3bb3fd52) +- [SMB_COM_LOCK_BYTE_RANGE (section 2.2.4.13)](#Section_21f7b95a56c6482d80d6881ec0e6db69) +- [SMB_COM_UNLOCK_BYTE_RANGE (section 2.2.4.14)](#Section_3cfce68297d8499b8a2cef000f5d6b26) +- [SMB_COM_CHECK_DIRECTORY (section 2.2.4.17)](#Section_6a989d5130bf4ceba46e7ae1cee6b516) +- [SMB_COM_PROCESS_EXIT (section 2.2.4.18)](#Section_233f62a6f565478db9b82b58ff347547) +- [SMB_COM_SET_INFORMATION2 (section 2.2.4.30)](#Section_cfcda87d76344902a137c60a1f4a5ae5) +- [SMB_COM_LOCKING_ANDX (section 2.2.4.32)](#Section_df492170a2e840d1b7d5eb29364047e1) +- [SMB_COM_TREE_DISCONNECT (section 2.2.4.51)](#Section_31cc172a80844f0baad6d8d69da76a0e) +- [SMB_COM_FIND_CLOSE (section 2.2.4.61)](#Section_3ffcd296c7cc43938ab06c902a928eec) +- [SMB_COM_NT_RENAME (section 2.2.4.66)](#Section_014a414742064ab2a167b58a4d11f1a7) +- [SMB_COM_WRITE_PRINT_FILE (section 2.2.4.68)](#Section_1b14601f89a54e21b2ac0bf1d2374957) +- [SMB_COM_CLOSE_PRINT_FILE (section 2.2.4.69)](#Section_c4993aeed13b4a6e87bdefdaf7506906) +- [Transaction Subcommands (section 2.2.5)](#Section_227cb1473c094c4bb1456c94b04c8231) + - [TRANS_SET_NMPIPE_STATE (section 2.2.5.1)](#Section_2481644c725944b89b8bae539f7b3eb6) + - [TRANS_WAIT_NMPIPE (section 2.2.5.10)](#Section_385ce4de217048a1910053f3c4aad60d) +- [Transaction2 Subcommands (section 2.2.6)](#Section_1cc40e02aaea4f33b7b73a6b63906516) + - [TRANS2_SET_PATH_INFORMATION (section 2.2.6.7)](#Section_a23483d965434aaaa996e7c9506f8b94) + - [TRANS2_SET_FILE_INFORMATION (section 2.2.6.9)](#Section_cb2b7f2138774bc5adf4b78c8aa2a717) +- [NT Transact Subcommands (section 2.2.7)](#Section_c2bf4e09c0e242bd8f7b6432f1f44d91) + - [NT_TRANSACT_SET_SECURITY_DESC (section 2.2.7.3)](#Section_ee4287977c94413fa19ee2176f66501d) + +A client that has outstanding OpLocks can receive an OpLock Break Notification at any time from the server. This is the only unsolicited message that the server is permitted to send. + +##### Command Processing + +Upon receiving a message, the client MUST determine whether the message is the final step in the processing of a command. If so, the **Client.Connection.PIDMIDList** entry for the command MUST be removed and discarded. Unless otherwise stated, the processing of an SMB command is complete when the results are returned to the application. + +##### Message Signing + +If a message is received and **Client.Connection.IsSigningActive** is TRUE for the connection, the signature MUST be verified, as specified in section [3.1.5.1](#Section_35839d070f694d20af2f2c45aa7522b3), unless the message is an OpLock Break Notification. OpLock Break Notification messages are exempt from signing. + +The client is responsible for providing the expected sequence number for signature verification. The sequence number for the incoming response is determined by what was stored in the **Client.Connection.ClientResponseSequenceNumber** table. The client MUST look up the expected sequence number in that table based on the PID and MID of the response. The client uses **Client.Connection.ClientResponseSequenceNumber** \[PID, MID\] as the sequence number in signature verification, as specified in section 3.1.5.1. If signature verification fails, the message MUST be discarded and not processed. The client SHOULD choose to disconnect the underlying connection and tear down all state associated with this connection.[<209>](#Appendix_A_209) + +##### Receiving any Batched ("AndX") Response + +When a client receives an AndX Response, the client MUST process the batched responses sequentially. Each individual response is processed as specified in its respective Message Processing subsection. + +The client MUST use the information in the AndX Response header as the header information for each response, with the exception of the **SMB_Header.Status** field. The status field indicates only the error status of the last response in the chain. All other responses in the chain MUST be interpreted as having completed successfully. If processing a response in the AndX Chain causes a change in state that would affect the information in the header, the updated header information MUST be used when the client processes the subsequent response in the chain. + +##### Receiving Any Transaction Response + +When a client receives an SMB transaction response, it MUST first determine whether it is an interim response or a final response by looking up the **TransactionState** for this request in **Client.Connection.PIDMIDList**. If the **TransactionState** is "TransmittedPrimaryRequest", and if the **SMB_Parameters.WordCount** and **SMB_Data.ByteCount** values are 0 in the transaction response, the client MUST consider the received response an interim response. + +- If the interim response indicates an error, then the transaction is canceled. The client MUST NOT send any secondary transaction request messages. +- If the interim response indicates success, then the client MUST set the **TransactionState** for this request (in **Client.Connection.PIDMIDList**) to "ReceivedInterimResponse" and send as many secondary requests as are needed to complete the transfer of transaction parameters and data. After transmitting all the secondary requests, the client MUST set the **TransactionState** for this request to "TransmittedAllRequests". + +If the **TransactionState** is not "TransmittedPrimaryRequest", or if the **SMB_Parameters.WordCount** and **SMB_Data.ByteCount** values are not both 0 in the transaction response, the client MUST consider the received response as a final transaction response. The server can send multiple final SMB transaction response messages in order to transfer the entire transaction response. If multiple final SMB transaction response messages are needed, the client MUST reconstruct the transaction response parameters and transaction response data from the contents of the SMB response messages before processing the completed transaction response. + +#### Receiving an SMB_COM_NEGOTIATE Response + +If the **Status** field of the response does not contain STATUS_SUCCESS, or if the server refused the SMB dialects offered by the client, the client MUST propagate the error to the application that initiated the SMB connection. In either case, protocol negotiation has failed and the SMB connection SHOULD be closed. + +Otherwise, protocol negotiation has succeeded and the SMB connection has been established. Processing of the [SMB_COM_NEGOTIATE Response (section 2.2.4.52.2)](#Section_a4229e1a8a4e489aa2eb11b7f360e60c) proceeds as follows: + +**Storing the selected dialect** + +The selected dialect MUST be retrieved and stored as described in section [3.2.4.2.2](#Section_0509a819389642948fb20f299770a8e4). + +**Storing authentication settings** + +The server's access control level is indicated by the NEGOTIATE_USER_SECURITY (0x01) bit of the **SecurityMode** field in the SMB_COM_NEGOTIATE Response. If this bit is clear (0), **Client.Connection.ShareLevelAccessControl** (which was initialized to FALSE in section [3.2.3](#Section_2067fd35c8b84cb9a5dc404743069bc6)) MUST be set to TRUE. + +Support for challenge/response authentication is indicated by the NEGOTIATE_ENCRYPT_PASSWORDS (0x02) bit of the **SecurityMode** field in the SMB_COM_NEGOTIATE Response. If this bit is set (1), **Client.Connection.ServerChallengeResponse** (which was initialized to FALSE in section 3.2.3) MUST be set to TRUE. + +**Determining the server signing mode** + +The server response indicates whether the server has message signing enabled and, if so, whether or not message signing is expected: + +- If the server supports only Share Level Access Control or plaintext passwords, signing is not available and **Client.Connection.ServerSigningState** MUST be **Disabled**. +- If NEGOTIATE_SECURITY_SIGNATURES_ENABLED bit in the **SecurityMode** field of the SMB_COM_NEGOTIATE response is not set, **Client.Connection.ServerSigningState** MUST be **Disabled**. +- If the NEGOTIATE_SECURITY_SIGNATURES_ENABLED bit in the **SecurityMode** field of the SMB_COM_NEGOTIATE Response is set, but NEGOTIATE_SECURITY_SIGNATURES_REQUIRED is not set, the client MUST set **Client.Connection.ServerSigningState** to **Enabled**. +- If both the NEGOTIATE_SECURITY_SIGNATURES_ENABLED and NEGOTIATE_SECURITY_SIGNATURES_REQUIRED bits in the **SecurityMode** field of the SMB_COM_NEGOTIATE response are set, the client MUST set **Client.Connection.ServerSigningState** to **Required**. + +Once **Client.Connection.ServerSigningState** is set, the client MUST consult the table under "Signing" in [User Authentication (section 3.2.4.2.4)](#Section_3a3cdd475b43427691f5645b82b0938f) to determine whether or not signing is blocked. If signing is blocked, the connection SHOULD be terminated by disconnecting the underlying transport and tearing down any state associated with the connection. + +**Storing server parameters** + +The client MUST store the **Capabilities** returned in the SMB_COM_NEGOTIATE Response in **Client.Connection.ServerCapabilities**. + +The client MUST set **Client.Connection.ServerSessionKey** to the value received in the **SessionKey** field of the SMB_COM_NEGOTIATE Response. + +The client MUST set the **Client.Connection.NTLMChallenge** to the value returned in the **Challenge** field of the SMB_COM_NEGOTIATE server response. This value is used for all future challenge/response authentication operations performed on the connection. + +The client MUST set **Client.Connection.ServerMaxBufferSize** to the value received in the **MaxBufferSize** field of the negotiate response. + +The client MUST assign the minimum of **Client.Connection.MaxMpxCount** and the **MaxMpxCount** field to **Client.Connection.MaxMpxCount**. + +If the SMB_COM_NEGOTIATE Response is being processed as part of a connect attempt, the client continues to user authentication, as specified in section 3.2.4.2.4. The only other options are [SMB_COM_ECHO (section 2.2.4.39)](#Section_8c85435267c647f7a60da6c87b6b3aac) or termination of the connection. + +#### Receiving an SMB_COM_SESSION_SETUP_ANDX Response + +If the **Status** field of the response does not contain STATUS_SUCCESS, the client MUST propagate the error to the application that initiated the authentication. The connection MUST remain open for the client to attempt another authentication. + +If the **Status** field of the response contains STATUS_SUCCESS, then authentication was successful, and a new **Client.Session** MUST be initialized and stored in **Client.Connection.SessionTable**. + +The client MUST retain the **UID** returned in the SMB Header (section [2.2.3.1](#Section_69a29f73de0c45a6a1aa8ceeea42217f)) of the response in **Client.Session.SessionUID**. The client MUST also set the value of the **Client.Session.SessionKey** based upon the SMB_SETUP_USE_LANMAN_KEY (0x02) bit of the Action field in the SMB_COM_SESSION_SETUP_ANDX response. If the bit is set, and if LM challenge/response was used instead of LMv2 challenge/response, the server indicates that LM challenge/response succeeded and the LM Session Key MUST be used to set **Client.Session.SessionKey**. If the bit is clear or if the LMv2 response was sent, the NT Session Key MUST be used to set **Client.Session.SessionKey**. If the LM Session Key or NT Session Key is equal to or greater than 16 bytes, only the least significant 16 bytes MUST be stored in **Client.Session.SessionKey**. Otherwise, the session key MUST be stored in **Client.Session.SessionKey** and MUST be padded with zeros up to 16 bytes. + +**Activating Signing** + +If authentication has just completed successfully, **Client.Connection.IsSigningActive** is FALSE, and the targeted behavior for this connection is **Signed** based on the description in section [3.2.4.2.4](#Section_3a3cdd475b43427691f5645b82b0938f), then the client MUST determine whether signing needs to be activated. This is done by determining the user's [**security context**](#gt_88d49f20-6c95-4b64-a52c-c3eca2fe5709) that completed authentication: + +- If the user authenticated as a guest (the SMB_SETUP_GUEST flag is set in the **Action** field of the SMB_COM_SESSION_SETUP_ANDX response) or is anonymous (did not provide credentials), signing MUST NOT be activated. +- If the user authenticated as a regular user, the client MUST activate signing. If **Client.Connection.SigningSessionKey** is **Empty**: + - The client MUST copy the entire cryptographic session key obtained from authentication subsystem, as specified in [\[MS-NLMP\]](%5bMS-NLMP%5d.pdf#Section_b38c36ed28044868a9ff8dd3182128e4), and store it as **Client.Connection.SigningSessionKey**. If the length of **Client.Connection.SigningSessionKey** is less than 16, the client SHOULD pad it with zeros up to 16 bytes. + - The value of **Client.Connection.SigningChallengeResponse** MUST be set based upon the SMB_SETUP_USE_LANMAN_KEY (0x02) bit of the **Action** field in the SMB_COM_SESSION_SETUP_ANDX response sent from the server to the client. If the bit is set, the server indicates that the LM or LMv2 challenge/response succeeded and the challenge response sent in the **OEMPassword** field MUST be used. Otherwise, the challenge response sent in the **UnicodePassword** field MUST be used. + +Once these steps are done, the client MUST verify the signature of this response. The client follows the steps specified in section [3.1.5.1](#Section_35839d070f694d20af2f2c45aa7522b3), passing in a sequence number of 1 because this is the first signed packet. + +#### Receiving an SMB_COM_TREE_CONNECT or SMB_COM_TREE_CONNECT_ANDX Response + +The response MUST be received as specified in section [3.2.5.1](#Section_4702ded4cd2f4d2187c97664fb637e5d). + +If the [**tree connect**](#gt_c65d1989-3473-4fa9-ac45-6522573823e3) was successful, a new **Client.TreeConnect** entry is initialized and stored in **Client.Connection.TreeConnectTable**. The **TID** returned in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) of the response can now be used for other operations. The client MUST set **Client.TreeConnect.Session** to **Client.Session**, where **Client.Session.SessionUID** matches the **UID** field in the response. The client MUST return the new **Client.TreeConnect** and the **Client.Session** to the application that invoked the [Application Requests Connecting to a Share (section 3.2.4.2)](#Section_96d90ccb9f7f47159d21987b93304f74) event to connect to the share. The client sets the share type based on the **Service** string in the response. + +| Share type | Service string | +| ---------------------------- | ----------------- | +| Disk Share | "A:" | +| Printer Share | "LPT1:" | +| Named Pipe | "IPC" | +| Serial Communications Device | "COMM" | +| unknown | None of the above | + +#### Receiving an SMB_COM_OPEN Response + +The [SMB_COM_OPEN Response (section 2.2.4.3.2)](#Section_20829E08C77A42F3B4272EF87D3CF212) MUST be processed as specified in section [3.2.5.1](#Section_4702ded4cd2f4d2187c97664fb637e5d). + +If the [SMB_COM_OPEN (section 2.2.4.3)](#Section_ec064de86538401e8c73b37231c36f2b) command was successful, a new **Client.Open** MUST be entered into the **Client.Connection.OpenTable**. **Client.Open.FID** is set to the returned **FID**, and **Client.Open.OpLock** is set based on the **SMB_Header.Flags SMB_FLAGS_OPLOCK** and **SMB_FLAGS_OPBATCH** flags. **Client.Open.TreeConnect** MUST be set to a **Client.TreeConnect** where **Client.TreeConnect.TreeID** matches the **TID** sent by the server in the [SMB Header](#Section_69a29f73de0c45a6a1aa8ceeea42217f) of the SMB_COM_OPEN Response. **Client.Open.Session** MUST be set to a **Client.Session** where **Client.Session.SessionUID** matches the **UID** sent by the server in the SMB Header of the SMB_COM_OPEN Response. **Client.Open.Connection** MUST be set to **Client.Open.Session.Connection**. + +The **FID** returned in the SMB_COM_OPEN response MUST be returned to the application along with the access mode granted by the server. The **Client.Open** that matches the **FID** in the response MUST be returned to the application. The additional metadata returned in the command MUST be returned to the application, if requested. + +#### Receiving an SMB_COM_CREATE Response + +The [SMB_COM_CREATE Response (section 2.2.4.4.2)](#Section_c11c97aee5ea48c0aeec2d3012b440e2) MUST be processed as specified in section [3.2.5.1](#Section_4702ded4cd2f4d2187c97664fb637e5d). + +If the [SMB_COM_CREATE](#Section_87622f4337584bf9b1fb35109f0e5c15) was successful, a new **Client.Open** MUST be entered into the **Client.Connection.OpenTable**. **Client.Open.FID** is set to the returned **FID**, and **Client.Open.OpLock** is set based on the **SMB_Header.Flags** SMB_FLAGS_OPLOCK and SMB_FLAGS_OPBATCH flags. **Client.Open.TreeConnect** MUST be set to a **Client.TreeConnect** where **Client.TreeConnect.TreeID** matches the **TID** sent by the server in the [SMB Header](#Section_69a29f73de0c45a6a1aa8ceeea42217f) of the SMB_COM_CREATE Response. **Client.Open.Session** MUST be set to a **Client.Session** where **Client.Session.SessionUID** matches the **UID** sent by the server in the SMB Header of the SMB_COM_CREATE Response. **Client.Open.Connection** MUST be set to **Client.Open.Session.Connection**. + +The **Client.Open** matching the **FID** provided in the response MUST be returned to the application. + +#### Receiving an SMB_COM_CLOSE Response + +The SMB_COM_CLOSE response MUST be processed as specified in section [3.2.5.1](#Section_4702ded4cd2f4d2187c97664fb637e5d). + +If the request was successful, then the [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) sent in the request is no longer valid and the client MUST discard the FID. The matching **Client.Open** entry in the **Client.Connection.OpenTable** MUST be removed and discarded. + +#### Receiving an SMB_COM_QUERY_INFORMATION Response + +The SMB_COM_QUERY_INFORMATION response MUST be processed as specified in section [3.2.5.1](#Section_4702ded4cd2f4d2187c97664fb637e5d). + +If the request was successful, the requested metadata MUST be returned to the application. The metadata returned by this command is also returned in the SMB_COM_OPEN response. + +#### Receiving an SMB_COM_READ Response + +The SMB_COM_READ response MUST be processed as specified in section [3.2.5.1](#Section_4702ded4cd2f4d2187c97664fb637e5d). + +If the request is successful, the number of bytes returned is specified in the **CountOfBytesReturned** field. The data read from the file are returned in a Data Buffer (see section [2.2.2.5](#Section_9189a82fc1c04af9818c85050f7e5e66)), which also specifies the number of bytes returned. Both the count of bytes returned and the read bytes themselves MUST be passed to the application. An end-of-file condition is indicated if the number of bytes returned is less than the number of bytes requested. + +In the event of a STATUS_BUFFER_OVERFLOW (ERRDOS/ERRmoredata) error, the server MUST return a complete SMB_COM_READ response (not an error response). The **CountOfBytesReturned** field indicates the number of bytes successfully read. + +#### Receiving an SMB_COM_WRITE Response + +The SMB_COM_WRITE response MUST be processed as specified in section [3.2.5.1](#Section_4702ded4cd2f4d2187c97664fb637e5d). + +If the request is successful, the number of bytes written to the file is returned. This number MUST be reported to the application. + +#### Receiving an SMB_COM_CREATE_TEMPORARY Response + +The [SMB_COM_CREATE_TEMPORARY Response (section 2.2.4.15.2)](#Section_763af5c574bf43c6b410e48c79b08f57) MUST be processed as specified in section [3.2.5.1](#Section_4702ded4cd2f4d2187c97664fb637e5d). + +If the [SMB_COM_CREATE_TEMPORARY](#Section_6ea3a4b22a9b4749a4a441efebdf4015) was successful, a new **Client.Open** must be entered into the **Client.Connection.OpenTable**. **Client.Open.FID** is set to the returned **FID**, and **Client.Open.OpLock** is set based on the **SMB_Header.Flags** SMB_FLAGS_OPLOCK and SMB_FLAGS_OPBATCH flags. **Client.Open.TreeConnect** MUST be set to a **Client.TreeConnect** where **Client.TreeConnect.TreeID** matches the **TID** sent by the server in the [SMB Header](#Section_69a29f73de0c45a6a1aa8ceeea42217f) of the SMB_COM_CREATE_TEMPORARY Response. **Client.Open.Session** MUST be set to a **Client.Session** where **Client.Session.SessionUID** matches the **UID** sent by the server in the SMB Header of the SMB_COM_CREATE_TEMPORARY Response. **Client.Open.Connection** MUST be set to **Client.Open.Session.Connection**. + +The **Client.Open** matching the **FID** provided in the response MUST be returned to the application. In addition, the name of the temporary file created by the server can be returned to the application, if requested. + +#### Receiving an SMB_COM_CREATE_NEW Response + +The SMB_COM_CREATE_NEW response MUST be processed as specified in section [3.2.5.1](#Section_4702ded4cd2f4d2187c97664fb637e5d). + +If the SMB_COM_CREATE_NEW was successful, a new **Client.Open** must be entered into the **Client.Connection.OpenTable**. **Client.Open.FID** is set to the retuned **FID**, and **Client.Open.OpLock** is set based on the **SMB_Header.Flags** SMB_FLAGS_OPLOCK and SMB_FLAGS_OPBATCH flags. + +The **Client.Open** matching the **FID** provided in the response MUST be returned to the application. + +#### Receiving an SMB_COM_SEEK Response + +The SMB_COM_SEEK response MUST be processed as specified in section [3.2.5.1](#Section_4702ded4cd2f4d2187c97664fb637e5d). + +If the request was successful, the current offset within the specified file is returned. The offset value MUST be passed to the application. If an error status is returned (see section [2.2.4.19.2](#Section_089b214b85014bcba9bd9b2aa80b0042) for a list of possible errors and their causes), the error status MUST be passed to the application. + +If the CAP_LARGE_FILES capability has been negotiated, then the client and server support 64-bit file offsets. The SMB_COM_SEEK command, however, supports only 32-bit offset values. The server MUST return only the lower order 32 bits of the actual 64-bit offset. If the file is larger than 2 \*\* 32 - 1 bytes in size, the offset returned by the server MAY be an invalid value.[<210>](#Appendix_A_210) + +#### Receiving an SMB_COM_LOCK_AND_READ Response + +The SMB_COM_LOCK_AND_READ response MUST be processed as specified in section [3.2.5.1](#Section_4702ded4cd2f4d2187c97664fb637e5d). + +If the request is successful, the number of bytes returned is specified in the **CountOfBytesReturned** field. The data read from the file are returned in a Data Buffer (see section [2.2.2.5](#Section_9189a82fc1c04af9818c85050f7e5e66)), which also specifies the number of bytes returned. Both the count of bytes returned and the read bytes themselves MUST be passed to the application. An end-of-file condition is indicated if the number of bytes returned is less than the number of bytes requested. + +The range of bytes indicated in the corresponding request message is also locked by the application. + +#### Receiving an SMB_COM_WRITE_AND_UNLOCK Response + +The SMB_COM_WRITE_AND_UNLOCK response MUST be processed as specified in section [3.2.5.1](#Section_4702ded4cd2f4d2187c97664fb637e5d). + +If the request is successful, the number of bytes written to the file is returned and the byte range is unlocked. The number of bytes written MUST be reported to the application. + +#### Receiving an SMB_COM_READ_RAW Response + +The SMB_COM_READ_RAW response is a transfer of raw bytes from the server to the client. There is no SMB header, parameter block, or data block. Therefore, the SMB_COM_READ_RAW response MUST NOT be processed as specified in section [3.2.5.1](#Section_4702ded4cd2f4d2187c97664fb637e5d). Instead, the client MUST query the [**SMB transport**](#gt_f8b0f8a6-e412-459a-b8ba-219008e5bcd7) to determine the number of bytes received: + +- If the request was made to read from a regular file and the number of bytes received is less than the number requested, then the end of file has been reached. +- If the number of bytes returned is zero, then the read began at or beyond the end of file (for a regular file) or an error occurred. + +It is possible that an OpLock break event on the server can cause the server to send an OpLock Break Notification request to the client at approximately the same time that the client sends an SMB_COM_READ_RAW request. If this happens, the OpLock Break Notification request can arrive before the Raw Read response from the server. In order to avoid confusing the OpLock break with the Raw Read response, the client MUST perform the following tests: + +- If the client currently holds an OpLock on an open file on the server, and +- If the message received is the size of an OpLock Break Notification request (51 bytes), and +- If the first four bytes of the data received are equal to '\\x0', 'S', 'M', 'B', and +- If the fifth byte in the data received is equal to the value of SMB_COM_LOCKING_ANDX (0x24), and +- If the value at the correct offsets for MID is 0xFFFF ((USHORT)(-1)), then + +The likelihood that the message received is an OpLock Break Notification request is very high. The client MAY apply these further tests to minimize the chance of a false positive: + +- The SMB_FLAGS_REPLY bit in an OpLock break MUST be clear in the appropriate location for the **SMB_Header.Flags** field. +- The **NumberOfRequestedUnlocks** and **NumberOfRequestedLocks** fields MUST both be zero in an OpLock break. + +If these conditions are met, the client MUST perform as if it has received an OpLock Break Notification and MUST process the message accordingly. The server, having received the Raw Read request while an OpLock break is still outstanding, responds to the Raw Read request by sending a zero-length response. + +After responding to the OpLock break, the client SHOULD use a different READ command to retry the failed Raw Read request. + +#### Receiving an SMB_COM_READ_MPX Response + +A single SMB_COM_READ_MPX request can generate multiple response messages. If there is one SMB_COM_READ_MPX response, it either contains all of the data read from the [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766), or it indicates an error return. + +The SMB_COM_READ_MPX response MUST be processed as specified in section [3.2.5.1](#Section_4702ded4cd2f4d2187c97664fb637e5d), with the exception that the SMB_COM_READ_MPX command is supported only over connectionless transports, and signing is supported only over connection-oriented transports. Therefore, SMB_COM_READ_MPX messages are not signed. + +The client MUST verify that all of the replies have the same **MID**, [**PID**](#gt_38a420dd-6f31-456e-ae5c-63ec6905380d), and FID values, indicating that they are all responses to the same request. The response messages MAY be received in any order, so the client MUST use the **Offset** and **DataLength** fields to reorder the read data correctly. The client MUST check the **Count** field in every response. The lowest **Count** value received indicates the total number of bytes that the server returns to the client. When the sum of all **DataLength** fields is equal to the lowest **Count** value received, all replies have been received. + +#### Receiving an SMB_COM_WRITE_RAW Response + +After sending an SMB_COM_WRITE_RAW request, the client expects one of two possible responses: an Initial Server Response or a Final Server Response. + +- If the client receives a [Final Server Response (section 2.2.4.25.3)](#Section_f767334e77244f41b5df31b56d3b4328), the command has completed, possibly with an error. The client MUST extract the **Status** and **Count** fields. The client MUST return the status information and the number of bytes successfully written by the command to the application. Response processing is then complete. +- If the client receives an [Interim Server Response (section 2.2.4.25.2)](#Section_d115b1d2149242aab37f222bfe272fbd), the command is has been processed successfully and the server is waiting for the remainder of the data to be sent in raw mode. The client MUST transfer the remaining data in raw mode (no SMB header, parameters, or data block) via the [**SMB transport**](#gt_f8b0f8a6-e412-459a-b8ba-219008e5bcd7). +- If **WritethroughMode** was set in the **WriteMode** field of the original request, the client MUST expect a Final Server Response following the Initial Server Response and the transfer of raw data. The Final Server Response can indicate an error. The client MUST return the status information and the number of bytes successfully written by the command to the application. Response processing is then complete. +- If **WritethroughMode** was not set in the **WriteMode** field of the original request, then the client MUST NOT expect a Final Server Response. The client MUST return a status value of Success to the application, and indicate that all bytes sent were successfully written. +- If an error occurred on the server while writing the raw data, the error MUST be returned on the next client command request that makes use of the same [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766). The client MAY retrieve a pending error code by sending, for example, a Seek request that seeks to the current file position (effectively, a null operation). + +#### Receiving an SMB_COM_WRITE_MPX Response + +Upon receipt of an SMB_COM_WRITE_MPX response, the client MUST compare the **ResponseMask** against the **RequestMask** of each SMB_COM_WRITE_MPX request that was sent as part of the same exchange. Any request that is not indicated as having been received in the **ResponseMask** MUST be resent. The last request to be resent MUST include the same nonzero **SequenceNumber** that was previously used in this exchange. + +The server MUST send another SMB_COM_WRITE_MPX response upon receipt of the resent request with the nonzero **SequenceNumber**. The client MUST compare the **ResponseMask** against the **RequestMask** of each resent SMB_COM_WRITE_MPX request. Again, any request that is not indicated as having been received in the **ResponseMask** MUST be resent, and the last resent request MUST include the nonzero **SequenceNumber** that was previously used in this exchange. This cycle continues until an error return is received, or until all of the requests are successfully acknowledged. + +If **WritethroughMode** was not set in the **WriteMode** field of the request(s), then an error in processing the command MAY occur after the final SMB_COM_WRITE_MPX response has been sent by the server. The server MUST return the error on the next client command request that makes use of the same [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766). + +If an error response is received in an SMB_COM_WRITE_MPX response, the Write MPX exchange is concluded and the client MUST inform the application of the error received. + +The SMB_COM_WRITE_MPX response(s) MUST be processed as specified in section [3.2.5.1](#Section_4702ded4cd2f4d2187c97664fb637e5d) with the exception that the SMB_COM_WRITE_MPX command is supported only over connectionless transports, and signing is supported only over connection-oriented transports. Therefore, SMB_COM_WRITE_MPX messages are not signed. + +#### Receiving an SMB_COM_QUERY_INFORMATION2 Response + +The SMB_COM_QUERY_INFORMATION2 response MUST be processed as specified in section [3.2.5.1](#Section_4702ded4cd2f4d2187c97664fb637e5d). + +If the request is successful, the file attribute information MUST be reported to the application. + +#### Receiving an SMB_COM_TRANSACTION Response + +The SMB_COM_TRANSACTION Response is processed as described in section [3.2.5.1.4](#Section_1180dedb2c564b3a84ceaa8e4a51cdad). + +#### Receiving an SMB_COM_IOCTL Response + +The SMB_COM_IOCTL response MUST be processed as described in section [3.2.5.1](#Section_4702ded4cd2f4d2187c97664fb637e5d). + +If the **Status** field indicates an error, the error MUST be passed to the application. Otherwise, the SMB_COM_IOCTL MUST be unpacked as described in section [2.2.4.35.2](#Section_27cb85fe071a41aa9068317720909892), and the results MUST be returned to the application. The format of the results of the IOCTL are specific to the platform, device type, and function called. + +#### Receiving an SMB_COM_ECHO Response + +The SMB_COM_ECHO response MUST be processed as described in section [3.2.5.1](#Section_4702ded4cd2f4d2187c97664fb637e5d). If no SMB session has yet been established (no SMB_COM_SESSION_SETUP_ANDX command has been executed) then **Client.Connection.IsSigningActive** MUST be FALSE, and the SMB_COM_ECHO response is not signed. + +Any error received as a result of this command MUST be returned to the application (Note, however, that an error response is a response from the server, which verifies that the connection is still active.) + +Multiple responses can be received, each of which MUST be made available to the application. The application can discard the responses, or count them, or verify that the data returned matches the data originally transmitted. + +#### Receiving an SMB_COM_WRITE_AND_CLOSE Response + +The [SMB_COM_WRITE_AND_CLOSE Response (section 2.2.4.40.2)](#Section_fcf13ef6ce164143a926e7cafabaeea3) MUST be processed as specified in section [3.2.5.1](#Section_4702ded4cd2f4d2187c97664fb637e5d). + +If the request succeeds, the [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) sent in the request is no longer valid, and the client MUST discard the FID. The matching **Client.Open** entry in the **Client.Connection.OpenTable** MUST be removed and discarded. + +#### Receiving an SMB_COM_OPEN_ANDX Response + +The [SMB_COM_OPEN_ANDX Response (section 2.2.4.41.2)](#Section_dbce00e768a141c6982d9483c902ad9b) MUST be processed as specified in section [3.2.5.1](#Section_4702ded4cd2f4d2187c97664fb637e5d). + +If the command fails, the error status MUST be passed to the application. + +If the request succeeds, the **FID** field returned in the SMB_COM_OPEN_ANDX Response MUST be returned to the application, along with the access mode granted by the server. If an OpLock was requested, the OpLock status MUST be returned to the application. If the REQ_ATTRIB flag was set in the **SMB_Parameters.Flags** field of the request, the following values MUST be returned to the application: + +- FileAttrs +- LastWriteTime +- FileDataSize +- AccessRights +- ResourceType +- NMPipeStatus +- OpenResult + +Other attributes returned in the command can be passed to the application, if requested. + +In addition, the **FID** MUST be used to create new **Open** entry in the **Client.Connection.OpenTable**. If an OpLock was requested, the value of **Client.Open.OpLock** MUST be set to indicate the type of OpLock that was granted, if any. The newly-created **Client.Open** MUST be returned to the application. **Client.Open.TreeConnect** MUST be set to **Client.Connection.TreeConnectTable\[TID\]**, where the **TID** matches the **TID** field sent by the server in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) of the SMB_COM_OPEN_ANDX Response. **Client.Open.Session** MUST be set to a **Client.Session** where **Client.Session.SessionUID** matches the **UID** sent by the server in the SMB Header of the SMB_COM_OPEN_ANDX Response. **Client.Open.Connection** MUST be set to **Client.Open.Session.Connection**. + +#### Receiving an SMB_COM_READ_ANDX Response + +The SMB_COM_READ_ANDX response MUST be processed as specified in section [3.2.5.1](#Section_4702ded4cd2f4d2187c97664fb637e5d). + +If the **Status** of the response indicates either success or that a time-out occurred, the client MUST forward any available data returned in the **Data** field to the application, along with the number of bytes returned, as indicated in the **DataLength** field. + +If the application requested it, the client MUST forward the information in the **Available** field to the calling application. + +In the event of a STATUS_BUFFER_OVERFLOW (ERRDOS/ERRmoredata) error, the server MUST return a complete SMB_COM_READ_ANDX response (not an error response). The **DataLength** field indicates the number of bytes successfully read. + +#### Receiving an SMB_COM_WRITE_ANDX Response + +The SMB_COM_WRITE_ANDX response MUST be processed as specified in section [3.2.5.1](#Section_4702ded4cd2f4d2187c97664fb637e5d). + +If the **Status** of the response indicates either success or that a time-out occurred, the client MUST return the **Status** and the number of bytes written to the application. + +If the application requested it, the client MUST also forward the information in the **Available** field to the calling application. + +#### Receiving an SMB_COM_TRANSACTION2 Response + +The SMB_COM_TRANSACTION Response MUST be processed as specified in section [3.2.5.1.4](#Section_1180dedb2c564b3a84ceaa8e4a51cdad). + +#### Receiving an SMB_COM_FIND_CLOSE2 Response + +The SMB_COM_FIND_CLOSE2 response MUST be processed as specified in section [3.2.5.1](#Section_4702ded4cd2f4d2187c97664fb637e5d). + +If the SMB_COM_FIND_CLOSE2 request succeeds, the **SID** that was indicated in the **SearchHandle** field of the initial request is closed and MUST be discarded. The **Client.Connection.SearchOpenTable** entry with a **SearchOpen.FindSID** matching the closed SID MUST be removed from **Connection.SearchOpenTable** and discarded. + +#### Receiving an SMB_COM_TREE_DISCONNECT Response + +The SMB_COM_TREE_DISCONNECT response MUST be processed as specified in section [3.2.5.1](#Section_4702ded4cd2f4d2187c97664fb637e5d). + +If the SMB_COM_TREE_DISCONNECT succeeds, the **TID** that was indicated in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) of the initial request is no longer valid and MUST be discarded. + +The **Client** MUST traverse the **Client.Connection.OpenTable** and remove all **Opens** for which the **Client.Open.TreeConnect** matches the **TID** in the request. The client MUST also traverse the **Client.Connection.SearchOpenTable** and release all **SearchOpens** for which the **Client.SearchOpen.TreeConnect** matches the **TID** in the request. The client MUST also traverse the **Client.Connection.TreeConnectTable** and remove the **TreeConnect** for which the **Client.TreeConnect** matches the TID in the request. + +#### Receiving an SMB_COM_LOGOFF_ANDX Response + +The [SMB_COM_LOGOFF_ANDX Response (section 2.2.4.54.2)](#Section_0e94351308f54e5fa5067acb1d8f1c9c) MUST be processed as specified in section [3.2.5.1](#Section_4702ded4cd2f4d2187c97664fb637e5d). + +If the [SMB_COM_LOGOFF_ANDX (section 2.2.4.54)](#Section_53800b5cf0c64b9cbaeb1ad6b08ecb6b) succeeds, the **UID** that was indicated in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) of the initial request is no longer valid and MUST be discarded. The **Client.Session** entry for the **UID** in the **Client.Connection.SessionTable** MUST be removed. + +#### Receiving an SMB_COM_QUERY_INFORMATION_DISK Response + +The SMB_COM_QUERY_INFORMATION_DISK response MUST be processed as specified in section [3.2.5.1](#Section_4702ded4cd2f4d2187c97664fb637e5d). + +If the command succeeds, the file system attributes in the response MUST be returned to the application. + +#### Receiving an SMB_COM_SEARCH or SMB_COM_FIND Response + +The SMB_COM_SEARCH and SMB_COM_FIND response messages MUST be processed as specified in section [3.2.5.1](#Section_4702ded4cd2f4d2187c97664fb637e5d). + +Upon receiving an SMB_COM_SEARCH or SMB_COM_FIND response from the server, the client MUST determine whether the response indicates success or an error. If an error **Status** is returned, it MUST be passed to the application. Otherwise, the client MUST return the number of entries retrieved, as well as the array of entries. + +The application MUST determine whether to issue another request for the next set of entries, if any. If so, the client MUST create a new **Client.SearchOpen** and store it in **Client.Connection.SearchOpenTable**. If the command is SMB_COM_FIND, the application MUST determine when to send the SMB_COM_FIND_CLOSE to free the search context. + +#### Receiving an SMB_COM_FIND_UNIQUE Response + +The handling of this response is identical to the handling of an SMB_COM_FIND, except that the search is completed after a single response. It is not possible to continue to search, because no search context is stored on the server. No SMB_COM_FIND_CLOSE is needed, because it is implied in the request. + +#### Receiving an SMB_COM_NT_TRANSACT Response + +The SMB_COM_NT_TRANSACT response MUST be processed as specified in section [3.2.5.1.4](#Section_1180dedb2c564b3a84ceaa8e4a51cdad). + +#### Receiving an SMB_COM_NT_CREATE_ANDX Response + +The [SMB_COM_NT_CREATE_ANDX Response (section 2.2.4.64.2)](#Section_32085986b516486cabbb0abbdf9f1909) MUST be processed as specified in section [3.2.5.1](#Section_4702ded4cd2f4d2187c97664fb637e5d). + +If the command fails, the error status MUST be passed to the application. + +If the request succeeds, the **FID** returned in the SMB_COM_NT_CREATE_ANDX Response MUST be returned to the application, along with the access mode granted by the server. If an OpLock was requested, the OpLock status, including the OpLock level granted, MUST be returned to the application. + +Other attributes returned in the command can be passed to the application, if requested. + +In addition, the **FID** MUST be used to create new **Open** entry in the **Client.Connection.OpenTable**. If an OpLock was requested, the value of **Client.Open.OpLock** MUST be set to indicate the type of OpLock that was granted, if any. The newly-created **Client.Open** MUST be returned to the application. **Client.Open.TreeConnect** MUST be set to **Client.Connection.TreeConnectTable\[TID\]**, where the **TID** matches the **TID** field sent by the server in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) of the SMB_COM_NT_CREATE_ANDX Response. **Client.Open.Session** MUST be set to a **Client.Session** where **Client.Session.SessionUID** matches the **UID** sent by the server in the SMB Header of the SMB_COM_NT_CREATE_ANDX Response. **Client.Open.Connection** MUST be set to **Client.Open.Session.Connection**. + +If the open is to a [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca), **Client.Open.NamedPipeMessageMode** MUST be initialized to TRUE, indicating a [**message mode**](#gt_c49a48e8-f1ac-4568-bc87-0672eb08868b) named pipe. + +#### Receiving an SMB_COM_OPEN_PRINT_FILE Response + +The [SMB_COM_OPEN_PRINT_FILE Response (section 2.2.4.62.2)](#Section_dd00c8422398412fb21dbf5074a9a1c4) MUST be processed as specified in section [3.2.5.1](#Section_4702ded4cd2f4d2187c97664fb637e5d). + +If the [SMB_COM_OPEN_PRINT_FILE (section 2.2.4.67)](#Section_4cce0e9fab2740f797cc6f12b4a9afef) command fails, the error status MUST be passed to the application. + +If the request succeeds, the **FID** returned in the SMB_COM_OPEN_PRINT_FILE Response MUST be returned to the application. The **FID** MUST also be used to create a new entry in **Client.Connection.OpenTable**. If an OpLock was requested, the value of **Client.Open.OpLock** MUST be set to indicate the type of OpLock that was granted, if any. **Client.Open.TreeConnect** MUST be set to **Client.Connection.TreeConnectTable\[TID\]**, where the **TID** matches the **TID** field sent by the server in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) of the SMB_COM_OPEN_PRINT_FILE Response. **Client.Open.Session** MUST be set to a **Client.Session** where **Client.Session.SessionUID** matches the **UID** sent by the server in the SMB Header of the SMB_COM_OPEN_PRINT_FILE Response. **Client.Open.Connection** MUST be set to **Client.Open.Session.Connection**. + +The **Client.Open** matching the **FID** provided in the response MUST be returned to the application. + +#### Receiving any SMB_COM_TRANSACTION Subcommand Response + +SMB_COM_TRANSACTION and SMB_COM_TRANSACTION_SECONDARY provide a transport mechanism for extended sets of commands, known as subcommands. Transaction subcommand responses MUST be extracted from the SMB_COM_TRANSACTION final response message or from messages returned by the server. The use of transactions to transport subcommands is described in sections [3.2.4.1.4](#Section_7f1d40344b1f4602bfd5394c56b9de46) and [3.2.5.1.4](#Section_1180dedb2c564b3a84ceaa8e4a51cdad). + +The client MUST propagate the success or failure code in the SMB_COM_TRANSACTION response to the application that initiated the call. If additional information is returned by the subcommand, the handling of that information is described below. + +##### Receiving a RAP Transaction Response + +If the RAP request succeeds, the parameters and data returned in the RAP response MUST be passed to the application. See [\[MS-RAP\]](%5bMS-RAP%5d.pdf#Section_fb8d5bd1e57c4be1b063ec31330bdd58) for RAP request and response information. + +##### Receiving a TRANS_RAW_READ_NMPIPE Response + +Upon receipt of a TRANS_RAW_READ_NMPIPE subcommand response, the client MUST forward the **BytesRead** buffer and the number of bytes read from the named pipe to the application. The number of bytes read (the size of **BytesRead**) is returned in the **TotalDataCount** field. + +##### Receiving a TRANS_QUERY_NMPIPE_STATE Response + +If the response indicates that the operation is successful, the client MUST return the information received in the **NMPipeStatus** field in the **Trans_Parameters** block of the response to the application that initiated the call. + +##### Receiving a TRANS_QUERY_NMPIPE_INFO Response + +If the response indicates that the operation is successful, the client MUST return the information received in the **Trans_Data** block of the response to the application that initiated the call. + +##### Receiving a TRANS_PEEK_NMPIPE Response + +Upon receipt of a TRANS_PEEK_NMPIPE subcommand response, the client MUST forward the **ReadData** buffer from within the **Trans_Data** block, along with the number of bytes read from the named pipe, to the application. The number of bytes read (the size of **ReadData**) is returned in the **TotalDataCount** field. + +If the response indicates that the operation is successful, the client MUST return the information received in the **Trans_Parameters** block of the response to the application that initiated the call. + +##### Receiving a TRANS_TRASACT_NMPIPE Response + +Upon receipt of a TRANS_TRANSACT_NMPIPE subcommand response, the client MUST forward the **ReadData** buffer from within the **Trans_Data** block, along with the number of bytes read from the named pipe, to the application. The number of bytes read (the size of **ReadData** ) is returned in the **TotalDataCount** field. + +In the event of a STATUS_BUFFER_OVERFLOW (ERRDOS/ERRmoredata) error, the server MUST return a complete SMB_COM_TRANSACTION response (not an error response). The **TotalDataCount** in the TRANS_TRANSACT_NMPIPE contained in the SMB_COM_TRANSACTION response indicates the number of bytes successfully read. + +##### Receiving a TRANS_RAW_WRITE_NMPIPE Response + +Upon receipt of a TRANS_RAW_WRITE_NMPIPE subcommand response, the client MUST return the number of bytes successfully written to the calling application. The number of bytes written is returned in the **BytesWritten** field in the **Trans_Parameters** block of the response. + +##### Receiving a TRANS_READ_NMPIPE Response + +Upon receipt of a TRANS_READ_NMPIPE subcommand response, the client MUST forward the **ReadData** buffer and the number of bytes read from the named pipe to the application. The number of bytes read (the size of **ReadData** ) is returned in the **TotalDataCount** field. + +In the event of a STATUS_BUFFER_OVERFLOW (ERRDOS/ERRmoredata) error, the server MUST return a complete SMB_COM_TRANSACTION response (not an error response) indicating that a message was incompletely read. The **TotalDataCount** in the TRANS_READ_NMPIPE contained in the SMB_COM_TRANSACTION response indicates the number of bytes successfully read. + +##### Receiving a TRANS_WRITE_NMPIPE Response + +Upon receipt of a TRANS_WRITE_NMPIPE subcommand response, the client MUST return the number of bytes successfully written to the calling application. The number bytes written is returned in the **BytesWritten** field in the **Trans_Parameters** block of the response. + +##### Receiving a TRANS_CALL_NMPIPE Response + +Upon receipt of a TRANS_CALL_NMPIPE subcommand response, the client MUST forward the **ReadData** buffer from within the **Trans_Data** block, along with the number of bytes read from the named pipe, to the application. The number of bytes read (the size of **ReadData** ) is returned in the **TotalDataCount** field. + +In the event of a STATUS_BUFFER_OVERFLOW (ERRDOS/ERRmoredata) error, the server MUST return a complete SMB_COM_TRANSACTION response (not an error response). The **TotalDataCount** in the TRANS_CALL_NMPIPE contained in the SMB_COM_TRANSACTION response indicates the number of bytes successfully read. + +#### Receiving any SMB_COM_TRANSACTION2 Subcommand Response + +##### Receiving a TRANS2_OPEN2 Response + +If the TRANS2_OPEN2 subcommand response indicates an error, the **Status** MUST be passed to the application. If the error was caused by an attempt to set extended attribute name/value pairs, the client MUST also return the **ExtendedAttributeErrorOffset** returned in the TRANS2_OPEN2 response. + +If the Open portion of the request succeeds, the **FID** returned in the TRANS2_OPEN2 subcommand response MUST be passed to the application, along with the access modes granted by the server. If an OpLock was requested, the OpLock level granted MUST be returned to the application. + +Other attributes returned in the command can be passed to the application, if requested. + +In addition, the **FID** MUST be used to create new **Open** entry in the **Client.Connection.OpenTable**. If an OpLock was requested, the value of **Client.Open.OpLock** MUST be set to indicate the type of OpLock that was granted, if any. The newly-created **Client.Open** MUST be returned to the application. **Client.Open.TreeConnect** MUST be set to **Client.Connection.TreeConnectTable\[TID\]**, where the **TID** matches the **TID** field sent by the server in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) of the [SMB_COM_TRANSACTION2 Response (section 2.2.4.46.2)](#Section_216e606aeee14c3fb88e0eb14dc380b2). **Client.Open.Session** MUST be set to a **Client.Session** where **Client.Session.SessionUID** matches the **UID** sent by the server in the SMB Header of the SMB_COM_TRANSACTION2 Response. **Client.Open.Connection** MUST be set to **Client.Open.Session.Connection**. + +##### Receiving a TRANS2_FIND_FIRST2 or TRANS2_FIND_NEXT2 Response + +Upon receipt of a TRANS2_FIND_FIRST2 or TRANS2_FIND_NEXT2 subcommand response, the client MUST forward any errors to the application. If the search succeeds, or if the **Status** indicates an error in the processing of the **GetExtendedAttributeList** in the request, the client MUST determine whether the search has been closed by the server or is still active. + +If the search is still active, the client MUST forward the **SID**, **EndOfSearch**, and **LastNameOffset** values to the application. Otherwise, the client MUST notify the application that the search has been closed. + +If the search is still active, and the message is a TRANS2_FIND_FIRST2 subcommand response, the client MUST create a new **SearchOpen** entry in the **Server.Connection.SearchOpenTable** to store the returned **SID** and the associated **TreeConnect**. + +Whether the search is closed or not, the client MUST also pass the **SearchCount** value to the application, along with the list of search entries returned in the **Trans2_Data** block of the response. If the value of **EaErrorOffset** is nonzero and the **Status** field indicates an error in the processing of the **GetExtendedAttributeList** in the request, the client MUST pass the value of **EaErrorOffset** to the application. + +##### Receiving a TRANS2_QUERY_FS_INFORMATION Response + +If the response indicates that an error occurred, the client MUST propagate the error to the application that initiated the call. + +If the response indicates that the operation was successful, the client MUST return the information received in the **Trans2_Data** block of the response to the application that initiated the call. + +##### Receiving a TRANS2_QUERY_PATH_INFORMATION or TRANS2_QUERY_FILE_INFORMATION Response + +If the response indicates that an error occurred, the client MUST propagate the error to the application that initiated the call. + +If the response indicates that the operation was successful, the client MUST return the information received in the **Trans2_Data** block of the response to the application that initiated the call. + +##### Receiving a TRANS2_CREATE_DIRECTORY Response + +The client MUST propagate the success or failure of the operation to the application that initiated the call. + +If the **Status** field indicates that an error was generated when setting Extended Attributes on the directory, and the response message is not an error response, then the creation of the directory was successful, and MUST be reported as such to the application. In addition, the application MUST be informed of the failure to set EAs, and the EaErrorOffset MUST be passed back to the application. + +##### Receiving a TRANS2_GET_DFS_REFERRAL Response + +If the **Status** field indicates success, the contents of the Trans2_Data data block MUST be forwarded to the DFS subsystem for processing. + +#### Receiving any SMB_COM_NT_TRANSACT Subcommand Response + +##### Receiving an NT_TRANSACT_CREATE Response + +If the [NT_TRANSACT_CREATE (section 2.2.7.1)](#Section_f85bb6cf2d3949c9bfe5307ad57d5da5) subcommand response indicates an error, the **Status** MUST be passed to the application. If the error was caused by an attempt to set extended attribute name/value pairs, the client MUST also return the **EAErrorOffset** returned in the [NT_TRANSACT_CREATE Response](#Section_ab2b6ac6161e4826885a45b4d4834f18). + +If the request succeeds, the **FID** returned in the NT_TRANSACT_CREATE subcommand response MUST be passed to the application, along with the access modes granted by the server. If an OpLock was requested, the OpLock level granted MUST be returned to the application. + +Other attributes returned in the command can be passed to the application, if requested. + +In addition, the **FID** MUST be used to create new **Open** entry in the **Client.Connection.OpenTable**. If an OpLock was requested, the value of **Client.Open.OpLock** MUST be set to indicate the type of OpLock that was granted, if any. The newly-created **Client.Open** MUST be returned to the application. **Client.Open.TreeConnect** MUST be set to **Client.Connection.TreeConnectTable\[TID\]**, where the **TID** matches the **TID** field sent by the server in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) of the [SMB_COM_NT_TRANSACT Response (section 2.2.4.62.2)](#Section_dd00c8422398412fb21dbf5074a9a1c4). **Client.Open.Session** MUST be set to a **Client.Session** where **Client.Session.SessionUID** matches the **UID** sent by the server in the SMB Header of the SMB_COM_NT_TRANSACT Response. **Client.Open.Connection** MUST be set to **Client.Open.Session.Connection**. + +##### Receiving an NT_TRANSACT_IOCTL Response + +If the response indicates that an error occurred, the client MUST propagate the error to the application that initiated the call. The response MAY be a complete NT_TRANSACT_IOCTL response, including the results of the IOCTL call that generated the error. + +In any case, the client MUST return the information received in the **NT_Trans_Data.Data** block of the response to the application that initiated the call. The application MUST interpret the results of the IOCTL call. CIFS does not specify IOCTL functions; IOCTLs are platform-, device-, and implementation-specific. + +##### Receiving an NT_TRANSACT_NOTIFY_CHANGE Response + +If the response to an NT_TRANSACT_NOTIFY_CHANGE request is either a status of STATUS_NOTIFY_ENUM_DIR (ERRDOS/ERR_NOTIFY_ENUM_DIR) or success with no changed files listed, the server indicates that it is unable to report changes that MAY have occurred within the directory. If the client requires knowledge of the state of the directory, it MUST enumerate the directory entries to re-establish that knowledge. + +Any other error response MUST be passed to the application that initiated the call. If the subcommand is successful, the list of changed directory entries MUST be returned to the application. + +##### Receiving an NT_TRANSACT_QUERY_SECURITY_DESC Response + +If the response indicates success, the [**security descriptors**](#gt_e5213722-75a9-44e7-b026-8e4833f0d350) returned MUST be passed to the application that initiated the call. If the response indicates that an error occurred, the client MUST propagate the error to the application. + +#### Receiving any OpLock Grant + +If an open or create command response is received that indicates that an OpLock has been granted, the client MUST update the **Client.Open.OpLock** state variable to indicate the type of OpLock granted. The client can then cache file operations on the [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766), as described in [\[FSBO\]](https://go.microsoft.com/fwlink/?LinkId=140636). + +#### Receiving an OpLock Break Notification + +If an SMB_COM_LOCKING_ANDX request is received from the server, this indicates that the server has sent an OpLock Break Notification. This is the only event in which a client receives a request from the server. This message MUST be processed as specified in section [3.2.5.1](#Section_4702ded4cd2f4d2187c97664fb637e5d), except that OpLock Break Notification messages are never signed. + +If no entry in the **Client.Connection.OpenTable** state variable matches the [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) supplied in the request, the request is ignored by the client. Otherwise: + +- The client MUST use the **SMB_Parameters.NewOpLockLevel** field to determine the type of OpLock now in effect: + - If **NewOpLockLevel** is 0x00, the client no longer possesses an OpLock on the file and the value of **Client.Open.OpLock** MUST be set to None. + - If **NewOpLockLevel** is 0x01, a Level II OpLock is now in effect and the value of **Client.Open.OpLock** MUST be set to Level II. +- If the client previously held an exclusive or batch OpLock on the file, the client MUST flush any dirty buffers by sending write requests to the server to write changed data to the file. +- If the client no longer requires access to the file, the client MAY close the file. (This is common if a batch OpLock is held on the file, the application has closed the file, and the client has cached the application's file close request.) Closing the file is sufficient to acknowledge the OpLock break. +- If the client requires continued access to the file, it MUST obtain any cached byte-range locks. This is done by sending a lock request to the server. +- The client MUST acknowledge the OpLock Break by sending an OpLock Break Request message to the server. This is done by constructing an SMB_COM_LOCKING_ANDX request with the OPLOCK_RELEASE flag set in the **TypeOfLock** field. The **NumberofRequestedUnlocks** field MUST be set to 0x0000. The client MAY use the OpLock Break Request message to request byte-range locks, thus combining this step with the previous step. The OpLock Break Request message is a special case of an SMB_COM_LOCKING_ANDX request used to acknowledge the OpLock Break Notification sent by the server. + +In summary, upon receipt of an OpLock Break Notification from the server, the client MUST either: + +- Close the file, or +- Write any unwritten data to the file, obtain any required byte-range locks, and acknowledge the OpLock Break by sending an OpLock Break Request message, which is an SMB_COM_LOCKING_ANDX request with the OPLOCK_RELEASE flag set. + +All messages sent to the server in response to the OpLock Break Notification MUST be sent as described in the appropriate section. For example, the OpLock Break Request message must be sent as described in section [3.2.4.16](#Section_0a200d604cfb47fdb15d6c55fc155a6f). + +#### Receiving a STATUS_PATH_NOT_COVERED (ERRSRV/ERRbadpath) Error for an Object in DFS + +In response to any command request that uses a pathname, the receipt of this error indicates that the server's DFS subsystem does not cover the part of the DFS namespace needed to resolve a DFS path in the request. + +If a DFS subsystem is present, on receiving this error the client MUST report the error to the DFS subsystem. + +If no DFS subsystem is present, the client MUST report the error to the calling application that initiated the request. + +### Timer Events + +#### Request Expiration Timer Event + +When the [Request Expiration Timer (section 3.2.2.1)](#Section_e81016e6ef9146b0bd19cf959eb7cc31) expires, the client MUST walk the outstanding commands in **Client.Connection.PIDMIDList** for any pending commands that have exceeded **Client.SessionTimeoutValue**. If a command has exceeded **Client.SessionTimeoutValue**,[<211>](#Appendix_A_211) the client SHOULD[<212>](#Appendix_A_212) close the connection to the server, and all resources associated with the connection MUST be freed, as specified in section [3.2.7.1](#Section_fb0ae8852794480e8b7a897ee33d46ea). + +The [NT_TRANSACT_NOTIFY_CHANGE (section 2.2.7.4)](#Section_2a65e0f460e041ef8184ae9bc2430316) subcommand MUST be exempt. + +The following commands are exempt from the Request Expiration Timer: + +- The NT_TRANSACT_NOTIFY_CHANGE (section 2.2.7.4) subcommand +- Read and write commands issued on an **Open** to a [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca) via the following commands: + - [SMB_COM_READ (section 2.2.4.11)](#Section_b88922ddb18e46e09f7408eaace9a95c) + - [SMB_COM_WRITE (section 2.2.4.12)](#Section_5f3ebf6a5d0643ee9429c8cc1b58eef5) + - [SMB_COM_READ_ANDX (section 2.2.4.42)](#Section_129aa093574b483ea55ddf334606a622) + - [SMB_COM_WRITE_ANDX (section 2.2.4.43)](#Section_81aec3770ff44fc4bc568f05b70c3e42) + - [SMB_COM_WRITE_AND_CLOSE (section 2.2.4.40)](#Section_029b038c4d4b42fc8c5199eb23055e9c) + - [TRANS_READ_NMPIPE (section 2.2.5.8)](#Section_d9004cc94b844d4ca522ec559f53c1a7) subcommand + - [TRANS_WRITE_NMPIPE (section 2.2.5.9)](#Section_de6ca9e1b30f426ebc072198375b1bd7) subcommand + - [TRANS_RAW_READ_NMPIPE (section 2.2.5.2)](#Section_cfcebfaeed1345ee9117fdc6da5a4060) subcommand + - [TRANS_TRANSACT_NMPIPE (section 2.2.5.6)](#Section_f599d0f080b148869657944f36a44138) subcommand + - [TRANS_RAW_WRITE_NMPIPE (section 2.2.5.7)](#Section_84397ad8d55c4ba7933ca96f2f64167d) subcommand + - [TRANS_CALL_NMPIPE (section 2.2.5.11)](#Section_a600138d46b741b49d9380a3bd5096de) subcommand +- [TRANS_WAIT_NMPIPE (section 2.2.5.10)](#Section_385ce4de217048a1910053f3c4aad60d) subcommand +- [SMB_COM_LOCKING_ANDX Request (section 2.2.4.32.1)](#Section_b5c6eae7976b4444b52ec76c68c861ad) with the **Timeout** field set to a nonzero value + +### Other Local Events + +#### Handling a Transport Disconnect + +When the transport indicates a disconnection, the client MUST walk through the **PIDMIDList** and return an error for each outstanding command to the calling application. All resources associated with the connection in **Client.ConnectionTable** MUST be freed. Finally, the connection MUST be freed. + +## Server Details + +### Abstract Data Model + +This section specifies a conceptual model of possible data organization that an implementation maintains to participate in this protocol. The described organization is provided to explain how the protocol behaves. This document does not mandate that implementations adhere to this model as long as their external behavior is consistent with what is described in this document. This data model requires elements to be synchronized with the Server Service Remote Protocol [\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9). An implementation that uses this data model has to observe atomicity requirements in order that the protocols always maintain an identical view of the common data. + +All ADM elements maintained by the server are prefixed with "**Server**". + +#### Global + +The following ADM elements are globally maintained for an individual server: + +**Server.Enabled**: A Boolean that indicates whether the CIFS server is accepting incoming connections or requests. + +**Server.Paused**: A Boolean that indicates whether the CIFS server is in a paused state. + +**Server.Statistics**: Server statistical information. This contains all the members of the **STAT_SERVER_0** ([\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 2.2.4.39) structure. + +**Server.AutodisconnectTimeout**: The idle session disconnect time-out in minutes. + +**Server.SupportDialects**: A list of server-supported dialect identifiers in order of preference from least to most preferred. + +**Server.Capabilities**: The set of Capabilities (as described in section [1.7](#Section_80850595e3014464974558e4945eb99b) and defined in section [2.2.4.52.2](#Section_a4229e1a8a4e489aa2eb11b7f360e60c)) supported by the server. + +**Server.ConnectionTable**: A list of SMB connections, as defined in section [3.3.1.3](#Section_592b9143f8594ece82442353c78a04cb). The list MUST allow lookups based upon **Server.Connection.ClientName**. + +**Server.EnableOplock**: A Boolean value that indicates whether a server supports [**OpLocks**](#gt_7b8c743e-84b1-4c7e-83ea-cfb818cdb394). + +**Server.GuestOkay**: A Boolean value that indicates whether or not a guest authentication is allowed if user-level authentication fails. If **Server.ShareLevelAuthentication** is TRUE, **Server.GuestOkay** MUST be FALSE. + +**Server.LMAuthenticationPolicy**: A state that determines the LAN Manager challenge/response authentication mechanism to be used. The following options are available: + +- **Disabled**: LAN Manager and LAN Manager v2 challenge/response authentication (LM & LMv2) are disabled. + +The server MUST NOT test the LM or LMv2 response, if any, sent by the client. + +- **V1-Enabled**: LAN Manager challenge/response authentication (LM) is enabled. + +The server MUST use the LM response algorithm to test the response sent in the **OEMPassword** field of the SMB_COM_SESSION_SETUP_ANDX request received from the client. + +- **V2-Enabled**: LAN Manager v2 challenge/response authentication (LMv2) is enabled. + +The server MUST use the LMv2 algorithm to test the response sent in the **OEMPassword** field of the SMB_COM_SESSION_SETUP_ANDX request received from the client. + +- **Enabled**: LAN Manager v1 and v2 challenge/response authentication is enabled. + +The server MUST use the LMv2 algorithm to test the response sent in the **OEMPassword** field of the [SMB_COM_SESSION_SETUP_ANDX Request (section 2.2.4.53.1)](#Section_81e15dee8fb6410286447eaa7ded63f7) received from the client. If the LMv2 response does not match the client response, the server MUST use the LM response algorithm to test the response sent in the **OEMPassword** field of the SMB_COM_SESSION_SETUP_ANDX Request received from the client. + +**Server.MaxBufferSize**: The size, in bytes, of the largest SMB message that the server can receive. + +**Server.MaxMpxCount**: The maximum number of outstanding commands that each client is allowed to have at any given time. + +**Server.MaxVcNumber**: The maximum number of [**virtual circuits**](#gt_cb807fcb-1083-4081-b497-69b81d269a6b) that can be established between the client and the server as part of the same [**session**](#gt_0cd96b80-a737-4f06-bca4-cf9efb449d12). + +**Server.MaxRawSize**: The maximum raw buffer size, in bytes, available on the server. + +**Server.MessageSigningPolicy**: A state that determines whether this node signs messages. This parameter has four possible values: + +- - **Required**: Message signing is required. Any connection to a node that does not use signing MUST be disconnected. + - **Enabled**: Message signing is enabled. If the other node enables or requires signing, it MUST be used.[<213>](#Appendix_A_213) + - **Optional**: Message signing is disabled unless the other party requires it. If the other party requires message signing, it MUST be used. Otherwise, message signing MUST NOT be used. + - **Disabled**: Message signing is disabled. Message signing MUST NOT be used. + +**Server.NTLMAuthenticationPolicy**: A state that determines the NT LAN Manager challenge/response authentication mechanism to be used. The following options are available: + +- **Disabled**: NT LAN Manager and NT LAN Manager v2 challenge/response authentication (NTLM and NTLMv2) are disabled. + +The server MUST NOT test the NTLM or NTLMv2 response, if any, sent by the client. + +- **V1-Enabled**: NT LAN Manager challenge/response authentication (NTLM) is enabled. + +The server MUST use the NTLM response algorithm to test the response sent in the **UnicodePassword** field of the SMB_COM_SESSION_SETUP_ANDX request received from the client. + +- **V2-Enabled**: NT LAN Manager v2 challenge/response authentication (NTLMv2) is enabled. + +The server MUST use the NTLMv2 algorithm to test the response sent in the **UnicodePassword** field of the SMB_COM_SESSION_SETUP_ANDX Request received from the client. + +- **Enabled**: NT LAN Manager v1 and v2 challenge/response authentication is enabled. + +The server MUST use the NTLMv2 algorithm to test the response sent in the **UnicodePassword** field of the SMB_COM_SESSION_SETUP_ANDX request received from the client. If the NTLMv2 response does not match the client response, the server MUST use the NTLM response algorithm to test the response sent in the **OEMPassword** field of the SMB_COM_SESSION_SETUP_ANDX request received from the client. + +**Server.OplockTimeout**: The maximum [**OpLock break**](#gt_5c86b468-90a1-4542-8bde-460c098d2a5a) time-out in seconds. + +If **Server.PlaintextAuthenticationPolicy** is set to **Required**, **Server.LMAuthenticationPolicy** and **Server.NTLMAuthenticationPolicy** MUST be Disabled. + +If **Server.LMAuthenticationPolicy**, **Server.NTLMAuthenticationPolicy**, and **Server.PlaintextAuthenticationPolicy** are all **Disabled**, then no authentication is possible. + +**Server.PlaintextAuthenticationPolicy**: A state that determines whether plaintext authentication is permitted or required. The following options are available: + +- **Disabled**: Plaintext authentication disabled. + +The server does support challenge/response authentication. Plaintext authentication from the client is denied. + +- **Enabled**: Plaintext authentication enabled. + +The server does support challenge/response authentication. Plaintext authentication from the client is permitted. + +- **Required**: Plaintext authentication required. + +The server does not support challenge/response authentication. The server MUST indicate support for challenge/response authentication using the 0x02 flag bit of the **SecurityMode** field sent in the SMB_COM_NEGOTIATE Response (section 2.2.4.52.2). + +**Server.ShareLevelAuthentication**: A Boolean that indicates whether Share-level or User-level authentication is supported. If this is TRUE, Share-level authentication MUST be used. + +**Server.ShareTable**: A list of available shares that are present on this server indexed by the share name, as specified in section [3.3.1.2](#Section_bc0e0b5e43af467a81eda2b55647640f). + +**Server.SrvMaxSessionTableSize**: The maximum size of the session table that maintains the list of all SMB sessions per connection. + +**Server.SrvSearchMaxTimeout**: The unused open search time-out in seconds. + +**Server.MaxSearches**: The maximum number of outstanding open searches allowed on a connection. + +#### Per Share + +**Server.Share**: A share that is available on the server. The following ADM elements are maintained for each share offered by a server: + +**Server.Share.LocalPath**: A path that describes the local resource that is being shared. This MUST be a store that either provides named pipe functionality, or a device or a volume that offers storage and/or retrieval of files. In the case of the latter, it can be a device that accepts a file and then processes it in some format, such as a printer.[<214>](#Appendix_A_214) + +**Server.Share.OptionalSupport**: The optional support bits for the share. See the description of the **OptionalSupport** field in the [SMB_COM_TREE_CONNECT_ANDX Response (section 2.2.4.55.2)](#Section_3286744b5b584ad5b62ec4f29a2492f1) for information on the defined bit flags. + +**Server.Share.ServerName**: A local server name to which a shared resource attaches. + +**Server.Share.Type**: The type of share. The **Service** field in the SMB_COM_TREE_CONNECT_ANDX Response (section 2.2.4.55.2) is matched against this element. The list of possible values is as follows: + +- **Disk** -- Share is a disk share. +- **Named Pipe** -- Share is a named pipe. +- **Printer** -- Share is a printer share. +- **Comm** -- Share is a serial communications device. + +**Server.Share.Name**: A name for the shared resource on this server. + +**Share.FileSecurity**: An authorization policy of type **SECURITY_DESCRIPTOR** ([\[MS-DTYP\]](%5bMS-DTYP%5d.pdf#Section_cca2742956894a16b2b49325d93e4ba2) section 2.4.6), such as an access control list that describes what actions users that connect to this share are allowed to perform on the shared resource.[<215>](#Appendix_A_215) If the value of this ADM element is NULL, no access limits are enforced. + +**Server.Share.Remark**: A pointer to a null-terminated [**Unicode**](#gt_c305d0ab-8b94-461a-bd76-13b40cb8c4d8) UTF-16 string that specifies an optional comment about the shared resource. + +**Server.Share.MaxUses**: The value indicates the maximum number of concurrent connections that the shared resource can accommodate. + +**Server.Share.CurrentUses**: The value indicates the number of current tree connects to the shared resource. + +#### Per SMB Connection + +**Server.Connection**: An established [**SMB connection**](#gt_e1d88514-18e6-4e2e-a459-20d5e17e9078) between the client and the server. The following ADM elements are maintained for each SMB connection established to a server: + +**Server.Connection.ClientCapabilities**: The **Capabilities** flags of the client, as specified in the description of the [SMB_COM_SESSION_SETUP_ANDX Request (section 2.2.4.53.1)](#Section_81e15dee8fb6410286447eaa7ded63f7). + +**Server.Connection.ClientMaxBufferSize**: The negotiated maximum size, in bytes, for SMB messages sent to the client. This limit applies to all [**SMB messages**](#gt_fb37399e-d72d-41b6-b073-086da2d96e09) sent to the client unless otherwise specified for a particular message type. + +**Server.Connection.MaxMpxCount**: The negotiated maximum number of outstanding commands that a given connection can have. This value MUST be less than or equal to **Server.MaxMpxCount**. + +**Server.Connection.ClientName**: A client identifier. For NetBIOS-based transports, this is the [**NetBIOS name**](#gt_0334e0bd-2755-42f6-aeff-2d4a22bf4abf) of the client. For other transports, this is a transport-specific identifier that provides a unique name or address for the client. + +**Server.Connection.ConnectionlessSessionID**: Used only if the underlying transport is connectionless. This is a 16-bit unsigned SMB Connection identifier: a server-unique identifier for the connection between the client and the server. + +**Server.Connection.FileOpenTable**: A list of open files, as specified in section [3.3.1.7](#Section_738e3f3cabff439bbd4f0fe36aee1ce8). This list MUST allow lookup by file handle ([**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766)), and each FID MUST be unique within the connection. + +- Each entry MUST include the [**process identifier (PID)**](#gt_38a420dd-6f31-456e-ae5c-63ec6905380d) of the process that opened or created the FID so that all files opened by a specified PID can be listed. +- Each entry MUST include the Tree Connect ID (**TID**) used to open the file, so that all files opened within a specified **TID** can be listed. +- Each entry MUST include the user ID (**UID**) used to open the file, so that all files opened by a specified UID can be listed. +- If an OpLock has been granted on a particular FID, the entry MUST include the type of OpLock granted. + +**Server.Connection.IdleTime**: The time that the connection received its most recent request. + +**Server.Connection.IsSigningActive**: A Boolean that indicates whether or not message signing is active for this SMB connection. + +**Server.Connection.NativeLanMan**: A string that represents the native LAN manager type of the client, as reported by the client. + +**Server.Connection.NativeOS**: A string that represents the native operating system of the CIFS client, as reported by the client. + +**Server.Connection.NTLMChallenge**: A byte array containing the cryptographic challenge sent to the client during protocol negotiation. The challenge is sent in the [SMB_COM_NEGOTIATE Response (section 2.2.4.52.2)](#Section_a4229e1a8a4e489aa2eb11b7f360e60c). + +**Server.Connection.OpLockSupport**: A Boolean value that indicates whether or not the server supports granting OpLocks on this connection. + +**Server.Connection.PendingRequestTable**: A list of command requests, as specified in section [3.3.1.4](#Section_6047c1ae579a4d2db93257fdc1d2958b), that are currently being processed by the server. This list is indexed on a combination of the **UID**, **TID**, **PID**, and **MID**. If the transport is connectionless, the entry SHOULD[<216>](#Appendix_A_216) include the **Connection.ConnectionlessSessionID** (CID). For each command request that is sent to the [**object store**](#gt_0cc469e1-4b1f-41c4-9f94-d6209fcf468e), the server MUST store **Server.SMBRequest.CancelRequestID** into **Server.Connection.PendingRequestTable**. + +**Server.Connection.SearchOpenTable**: A list of open searches. It MUST be possible to list all searches by: + +- A specified Search ID (SID), +- The **PID** that opened the search, +- The **UID** that opened the search, +- The **TID** within which the search is taking place, +- or by a combination of **UID**, **TID**, **PID**, **MID**, and **ResumeKey**. + +**Server.Connection.SelectedDialect**: A variable that stores the SMB Protocol dialect selected for use on this connection. Details of dialects prior to NT LAN Manager ("NT LM 0.12") are described in other documents. See the table in section [1.7](#Section_80850595e3014464974558e4945eb99b) for a list of dialects and implementation references. + +**Server.Connection.ServerNextReceiveSequenceNumber**: A sequence number for the next signed request being received. + +**Server.Connection.ServerSendSequenceNumber**: A list of the expected sequence numbers for the responses of outstanding signed requests, indexed by **PID/MID** pair. + +**Server.Connection.SessionKey**: A token generated by the server for each SMB connection. + +**Server.Connection.SessionSetupReceived**: A Boolean value that indicates whether the server has received an SMB_COM_SESSION_SETUP_ANDX Request on this SMB connection. + +**Server.Connection.SessionTable**: A table that maintains the list of all SMB sessions. The table MUST allow lookup by either the **UID** of the session or the security context of the user that established the session. + +**Server.Connection.SigningChallengeResponse**: A variable-length byte array containing the challenge response to use for signing, if signing is active. If SMB signing is activated on the connection (**Server.Connection.IsSigningActive** becomes TRUE), the client response to the server challenge from the first non-null, non-guest session is used for signing all traffic on the SMB connection. The **Server.Connection.SigningChallengeResponse** is set to one of several possible values: + +- **Empty** -- If **Server.Connection.IsSigningActive** is FALSE, no connection signing challenge response is used. +- **LM or LMv2 response** -- The response passed from client to server in the **OEMPassword** field of the SMB_COM_SESSION_SETUP_ANDX Request. +- NTLM or NTLMv2 response -- The response passed from client to server in the **UnicodePassword** field of the SMB_COM_SESSION_SETUP_ANDX Request. + +**Server.Connection.SigningSessionKey**: A variable-length byte array containing the session key that is used for signing packets, if signing is active. + +If SMB signing is activated on the connection (**Server.Connection.IsSigningActive** becomes TRUE), the session key from the first non-null, non-guest session is used for signing all traffic on the SMB connection. The **Server.Connection.SigningSessionKey** is set to one of three values: + +- - **Empty** -- If **Server.Connection.IsSigningActive** is FALSE, no connection signing session key is used. + - **LM Session Key** -- The LM hash, generated from the user's password using the LMOWFv1() function defined in [\[MS-NLMP\]](%5bMS-NLMP%5d.pdf#Section_b38c36ed28044868a9ff8dd3182128e4) section 3.3.1. + - NT Session Key -- The NTLM hash, generated from the user's password using the NTOWFv1() function defined in \[MS-NLMP\] section 3.3.1. + +**Server.Connection.TreeConnectTable**: A list of the tree connects over this SMB connection established to shares on the server, containing the **TID** for the tree connect and the **UID** of the user that established the Tree Connect, as well as the share service type returned in the [SMB_COM_TREE_CONNECT Response (section 2.2.4.50.2)](#Section_f9a8a7131c534fb0908e625389840cf8) or the [SMB_COM_TREE_CONNECT_ANDX Response (section 2.2.4.55.2)](#Section_3286744b5b584ad5b62ec4f29a2492f1).See the description of the **Service** field in the SMB_COM_TREE_CONNECT_ANDX Response for information on the permitted values. It MUST be possible to look up entries by either the **TID** or the **UID**. + +**Server.Connection.TransportName**: An implementation-specific name of the transport used by this connection. + +**Server.Connection.CreationTime**: The time at which at the connection was established. + +#### Per Pending SMB Command + +**Server.SMBRequest**: A pending SMB command request on the server. The following ADM elements are maintained for each pending SMB command request on a server: + +**Server.SMBRequest.ConnectionlessSessionID**: If a connectionless transport is in use, this is the value of the **CID** field in the **SecurityFeatures** field from the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) of the client request. + +**Server.SMBRequest.MID**: The value of the **MID** from the **SMB Header** of the client request. + +**Server.SMBRequest.PID**: The value of the **PID** from the **SMB Header** of the client request. + +**Server.SMBRequest.TID**: The value of the **TID** from the **SMB Header** of the client request. + +**Server.SMBRequest.UID**: The value of the **UID** from the **SMB Header** of the client request. + +**Server.SMBRequest.CancelRequestID**: An implementation-dependent identifier of type HANDLE generated by the server to support cancellation of pending requests that are sent to the [**object store**](#gt_0cc469e1-4b1f-41c4-9f94-d6209fcf468e). The identifier MUST uniquely identify this **Server.SMBRequest** ADM element among all requests currently being processed by the server. + +#### Per SMB Session + +**Server.Session**: An established session between the client and server. The following ADM elements are maintained for each SMB session established to a server: + +**Server.Session.Connection**: The SMB connection associated with this session. + +**Server.Session.IsAnonymous**: A Boolean that, if set, indicates that the session is for an anonymous user. + +**Server.Session.SessionKey**: The session key associated with this session, as obtained from the authentication packages after successful authentication. + +**Session.UID**: The 2-byte **UID** for this session, representing the user that established the session. The **UID** is returned by the server in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) of the session setup response. All subsequent SMB requests from the client for this user on this connection MUST use this **UID**. + +There can be multiple **UID**s generated per SMB connection, each representing a unique user. + +**Server.Session.UserSecurityContext**: The security context of the user that established the session, as obtained from the authentication subsystem after successful authentication. + +**Server.Session.SessionGlobalId**: A numeric 32-bit value obtained by registration with the Server Service Remote Protocol. + +**Server.Session.CreationTime**: The time that the session was established. + +**Server.Session.IdleTime**: The time that the session processed its most recent request. + +**Server.Session.UserName**: The name of the user who established the session. + +#### Per Tree Connect + +**Server.TreeConnect**: An established [**tree connect**](#gt_c65d1989-3473-4fa9-ac45-6522573823e3) between the client and the share on the server. The following ADM elements are maintained for each tree connect established to a share on a server: + +**Server.TreeConnect.Share**: A reference to the **Share** (section [3.3.1.2](#Section_bc0e0b5e43af467a81eda2b55647640f)) to which this **TreeConnect** connects. + +**Server.TreeConnect.TID**: A numeric value that uniquely identifies a tree connect represented as a 16-bit **TID** in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f). + +**Server.TreeConnect.Session**: A pointer to the authenticated session that established this tree connect. + +**Server.TreeConnect.OpenCount**: A numeric value that indicates the number of files that are currently opened on **TreeConnect**. + +**Server.TreeConnect.TreeGlobalId**: A numeric value obtained by registration with the Server Service Remote Protocol. + +**Server.TreeConnect.CreationTime**: The time that the tree connect was established. + +#### Per Unique Open + +**Server.Open**: A file or [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca) on the server opened through the established **Server.TreeConnect**. The following ADM elements are maintained for each **open** on a server held by a client: + +**Server.Open.Connection**: The [**SMB connection**](#gt_e1d88514-18e6-4e2e-a459-20d5e17e9078) associated with this **open**. + +**Server.Open.Locks**: A list of byte-range locks on this **open**. Each entry MUST include the **PID** that created the lock. Each entry MUST indicate whether it is a shared (read-only) or an exclusive (read-write) lock. Each entry MUST also indicate if it is using 32- or 64-bit file offsets and MUST be accordingly formatted as either LOCKING_ANDX_RANGE32 or LOCKING_ANDX_RANGE64. + +**Server.Open.OpLock**: An element indicating the type of [**OpLock**](#gt_7b8c743e-84b1-4c7e-83ea-cfb818cdb394), if any, that has been granted on this **open**. This value MUST be one of **None**, **Exclusive**, **Batch**, or **Level II**. + +**Server.Open.OplockState**: The current Oplock state of the **Open**. This value MUST be **Held**, **Breaking**, or **None**. + +**Server.Open.OplockTimeout**: The time value that indicates when an Oplock that is breaking and has not received an acknowledgment from the client will be acknowledged by the server. + +**Server.Open.PathName**: A variable-length string that contains the Unicode path name on which the **open** is performed. + +**Server.Open.Session**: The [**SMB session**](#gt_ee1ec898-536f-41c4-9d90-b4f7d981fd67) associated with this **open**. SMB sessions are identified by **UID**, as described in section [2.2.1.6.8](#Section_a4a70059d26347e0be651f773a9b08be). + +**Server.Open.FID**: The unique (per-connection) 16-bit **FID** identifying this **open**, as described in section [2.2.1.6.1](#Section_c0ef0a4c7509499b9afeca7de0c0938d). The **FID** MUST be unique on this connection. + +**Server.Open.PID**: The unique (per connection) 32-bit **PID** provided in the client request that created this **open**. The **PID** is described in section [2.2.1.6.3](#Section_86ccac531189492799720ff92a1409b2). + +**Server.Open.TreeConnect**: The [**tree connect**](#gt_c65d1989-3473-4fa9-ac45-6522573823e3) associated with this **open**. Tree connects are identified by **TID**, as described in section [2.2.1.6.7](#Section_e626b07dd0344b45867643228a18e30a). + +**Server.Open.FileGlobalId**: A numeric value obtained by registration with the Server Service Remote Protocol. + +**Server.Open.GrantedAccess**: The access granted on this **open**. + +**Server.Open.MpxMask**: The accumulated mask value from all successfully received [SMB_COM_WRITE_MPX Requests (section 2.2.4.26.1)](#Section_c7fa0e9f343b47df8157719a3ca9035c) on this **open**. + +**Server.Open.LastFailedLockOffset**: A 32-bit signed integer indicating the lock offset specified in **SMB_COM_LOCK_BYTE_RANGE** request, which the server failed. + +#### Per Unique Open Search + +**Server.SearchOpen**: A search operation that is being performed through the established **Server.TreeConnect**. The following ADM elements are maintained for each search request to a server held open by a client: + +**Server.SearchOpen.FindSID**: The Search ID (SID) associated with the **SearchOpen**. + +**Server.SearchOpen.PathName**: A variable-length string that contains the full directory path (relative to the share path) being searched. + +**Server.SearchOpen.MID**: The Multiplex ID (**MID**) of the client process that opened the search. + +**Server.SearchOpen.PID**: The Process ID (**PID**) of the client process that opened the search. + +**Server.SearchOpen.TID**: The TreeConnect ID (**TID**) of the tree connect within which the search takes place. + +**Server.SearchOpen.UID**: The Session identified by the User ID (**UID**) that initiated the search. + +### Timers + +#### OpLock Break Acknowledgment Timer + +This timer controls the amount of time that the server waits for an [**OpLock break**](#gt_5c86b468-90a1-4542-8bde-460c098d2a5a) acknowledgment from the client after sending an OpLock break request to the client. The server MUST wait for an interval of time greater than or equal to the OpLock break acknowledgment timer.[<217>](#Appendix_A_217) + +#### Idle Connection Timer + +This timer controls the amount of time that a session can be idle before the server disconnects the session. An idle session is one on which no open handles exist (no open files, directories, search contexts, etc.), and no operations have been issued within an implementation-specific period of time.[<218>](#Appendix_A_218) + +#### Unused Open Search Timer + +This optional timer controls the amount of time that an open search can stay unused before the server closes the open search context. + +#### Unused Connection Timer + +This timer controls the amount of time that a connection can stay unused; that is, without a session ever established, before the server closes it. The server MUST schedule this timer periodically with an implementation-specific interval. + +### Initialization + +When the CIFS server is started, the following values MUST be initialized: + +- **Server.Enabled** MUST be set to FALSE. +- **Server.Paused** MUST be set to FALSE. +- All of the members in the **Server.Statistics** ADM element MUST be set to zero. +- **Server.ShareLevelAuthentication** MUST be set based on system policy and implementation capabilities.[<219>](#Appendix_A_219) +- **Server.SupportDialects** MUST be set to the list of dialects identifiers that the server supports, presented in section [1.7](#Section_80850595e3014464974558e4945eb99b).[<220>](#Appendix_A_220) +- Values for **Server.PlaintextAuthenticationPolicy**, **Server.LMAuthenticationPolicy**, and **Server.NTLMAuthenticationPolicy** MUST be set based on system policy and implementation capabilities, and MUST be one of the possible values listed in Server Global (section [3.3.1.1](#Section_2b4f1d5c442a4ed4a4518a986351c5a9)).[<221>](#Appendix_A_221) +- **Server.ConnectionTable** MUST be initialized to an empty list. +- **Server.ShareTable** SHOULD be initialized to an empty list. +- **Server.MaxBufferSize** MUST be initialized based on local policy or implementation configuration. **Server.MaxBufferSize** MUST have a minimum value of 1024 (0x00000400) bytes (1Kbyte).[<222>](#Appendix_A_222) +- **Server.MaxMpxCount** MUST be initialized based on local policy or implementation configuration.[<223>](#Appendix_A_223) +- **Server.MessageSigningPolicy** MUST be initialized based on local policy or implementation capabilities and configuration.[<224>](#Appendix_A_224) +- **Server.AutodisconnectTimeout** MUST be set to zero. +- **Server.MaxVcNumber** MUST be set to zero. +- **Server.MaxRawSize** MUST be initialized based on local policy or implementation configuration.[<225>](#Appendix_A_225) +- **Server.OplockTimeout** MUST be set to zero. +- **Server.EnableOplock** MUST be set to FALSE. +- **Server.SrvSearchMaxTimeout** MUST be set to zero. +- **Server.SrvMaxSessionTableSize** MUST be set to zero. +- **Server.MaxSearches** MUST be initialized based on local policy or implementation configuration.[<226>](#Appendix_A_226) + +The [**CIFS**](#gt_fb37399e-d72d-41b6-b073-086da2d96e09) server MUST notify the [**server service**](#gt_30c16b9f-63f9-472d-b344-08ba77497806) that initialization is complete by invoking the Server Notifies Completion of Initialization ([\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 3.1.6.14) event, providing the string "CIFS" as the input parameter. + +### Higher-Layer Triggered Events + +#### Sending Any Message + +This event is invoked within the SMB server itself for processing each request. It is not exposed externally. + +The caller provides the following: + +- **Connection**: The [**SMB connection**](#gt_e1d88514-18e6-4e2e-a459-20d5e17e9078) on which the response is to be sent. +- **Payload**: The payload to be sent, including the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f). + +Unless otherwise noted, the server MUST NOT send any message that exceeds the limit set by **Server.Connection.ClientMaxBufferSize**. + +If the message is an error reply or any other message that indicates the completion of a command, the server MUST remove the corresponding entry, if any, from the **Server.Connection.PendingRequestTable**. + +Unless otherwise specified, the server MUST return both the client-supplied [**PID**](#gt_38a420dd-6f31-456e-ae5c-63ec6905380d) and **MID** to the client in any response to a client request. + +The SMB_FLAGS_REPLY bit in the SMB Header MUST be set, unless the message is an OpLock Break Notification request initiated by the server. + +If the server sends a message to the client, and signing is active for the SMB connection, the message MUST be signed, as specified in section [3.1.4.1](#Section_68c3d17ae48e4eb4b97e3246bfe0262f), by providing the sequence number in **Server.Connection.ServerSendSequenceNumber\[PID,MID\]**. The sequence number is calculated and populated into the table **Server.Connection.ServerSendSequenceNumber**, as specified in section [3.3.5.2](#Section_b09b63d73882458b9c8ec821c706ebdf). OpLock Break Notification messages are exempt from signing. + +If signing is not active, the **SecuritySignature** field of the SMB Header for all messages sent, except the [SMB_COM_SESSION_SETUP_ANDX Response (section 2.2.4.53.2)](#Section_e7514918a0f649329f00ced094445537), MUST be set to 0x0000000000000000. For the SMB_COM_SESSION_SETUP_ANDX Response, the **SecuritySignature** field of the SMB Header SHOULD[<227>](#Appendix_A_227) be set to the **SecuritySignature** received in the [SMB_COM_SESSION_SETUP_ANDX Request (section 2.2.4.53.1)](#Section_81e15dee8fb6410286447eaa7ded63f7). + +For every outgoing message, the server MUST calculate the total number of bytes in the message and MUST update the values of **Server.Statistics.sts0_bytessent_low** and **Server.Statistics.sts0_bytessent_high**. + +##### Processing Options + +The server MUST set the **SMB_Header.Flags2** field of the response equal to the **SMB_Header.Flags2** value received in the request. These flags are described in section [2.2.3.1](#Section_69a29f73de0c45a6a1aa8ceeea42217f). + +The server SHOULD set the **SMB_Header.Reserved** field to 0x0000.[<228>](#Appendix_A_228) + +##### Sending Any Error Response Message + +In response to an error in the processing of any [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) request, the **CIFS server** MUST return the correct response message for the request as specified in the command definition in section [2.2.4](#Section_5cd5747ffe0b40a689d0d67f751f8232). The error code MUST be placed into the **SMB_Header.Status** field. If the use of NT Status codes has been negotiated, the error code MUST be a 32-bit NTSTATUS code. Otherwise, the error code MUST be an SMBSTATUS code.[<229>](#Appendix_A_229) + +Unless otherwise specified, all response messages that indicate an error MUST include: + +- The command code of the request that generated the error. +- The **UID**, **TID**, [**PID**](#gt_38a420dd-6f31-456e-ae5c-63ec6905380d), **MID**, and (if a connectionless transport is in use) **CID** of the request. +- No parameters and no data; that is, **SMB_Parameters.WordCount** = 0x00 and **SMB_Data.ByteCount** = 0x0000. + +This format is referred to as an "error response" message. + +The error response message format MUST be used unless otherwise specified. + +If the client request is part of an AndX chain, processing of the AndX request chain terminates with the request that generated the error. The error response MUST be the last response in the returned AndX chain. + +#### Object Store Indicates an OpLock Break + +The underlying [**object store**](#gt_0cc469e1-4b1f-41c4-9f94-d6209fcf468e) indicates an [**OpLock break**](#gt_5c86b468-90a1-4542-8bde-460c098d2a5a) to the SMB server by providing the following (see [\[MS-FSA\]](%5bMS-FSA%5d.pdf#Section_860b1516c45247b4bdbc625d344e2041) and [\[FSBO\]](https://go.microsoft.com/fwlink/?LinkId=140636)): + +- **Server.Open**: The open on which the [**OpLock**](#gt_7b8c743e-84b1-4c7e-83ea-cfb818cdb394) is being broken. +- **NewOpLockLevel**: The level to which the OpLock was broken. +- **AcknowledgementRequired**: A Boolean indicating whether the underlying object store needs an acknowledgement to complete the OpLock break. +- ReturnStatus: The status code indicating the reason for the break. + +If ReturnStatus is STATUS_SUCCESS, the server MUST notify the client identified by **Server.Open.Connection** by sending an asynchronous OpLock Break Notification message to the client as described later in this section. Otherwise, the OpLock break MUST be ignored. + +The server MUST construct an [SMB_COM_LOCKING_ANDX Request (section 2.2.4.32.1)](#Section_b5c6eae7976b4444b52ec76c68c861ad) and initialize the fields as follows: + +- The server MUST set the OPLOCK_RELEASE flag in the **TypeOfLock** field to indicate to the client that the OpLock is being broken. +- The server MUST set the **NewOpLockLevel** field to the value returned by the underlying object store [<230>](#Appendix_A_230) to indicate the type of OpLock now in effect for the **Server.Open**. A value of 0 indicates that no OpLock is now held; 1 indicates that a Level II OpLock is now held. +- The server SHOULD[<231>](#Appendix_A_231) set the **Timeout**, **NumberOfUnlocks**, **NumberofLocks**, and **ByteCount** fields to zero. + +The server MUST send an SMB_COM_LOCKING_ANDX Request to the client. + +If **AcknowledgementRequired** is TRUE, the server MUST start an [OpLock Break Acknowledgment Timer (section 3.3.2.1)](#Section_acb45ee235ad43b5ad6864cc65e927f3) to fire in **Server.OplockTimeout** seconds if the timer is not already active, MUST set **Server.Open.OplockState** to Breaking, and MUST set **Server.Open.OplockTimeout** to the current time plus **Server.OplockTimeout**. + +If **AcknowledgementRequired** is FALSE, the server MUST set **Server.Open.OplockState** to None. + +Refer to section [3.2.5.42](#Section_4b44b6339447458382557e32942bfc86) for details on how the client processes an OpLock break notification. + +Refer to section [3.3.5.30](#Section_709a30abb9f54745bd8e86f7212d4bc4) for details on how a server responds to an OpLock break acknowledgment from the client. + +#### DFS Subsystem Notifies That It Is Active + +If the DFS subsystem is available to the CIFS server, it MUST notify the server. The server SHOULD then set the CAP_DFS flag in **Server.Capabilities**. After this event, the server is able to set the **CAP_DFS** flag in the **Capabilities** field of an [SMB_COM_NEGOTIATE Response (section 2.2.4.52.2)](#Section_a4229e1a8a4e489aa2eb11b7f360e60c).[<232>](#Appendix_A_232) + +#### DFS Subsystem Notifies That a Share Is a DFS Share + +If the DFS subsystem claims a share as part of the DFS namespace, it MUST notify the CIFS server via this event. In response to this event, the CIFS server MUST set the SMB_SHARE_IS_IN_DFS bit in the **Server.Share OptionalSupport** attribute of the share. + +#### DFS Subsystem Notifies That a Share Is Not a DFS Share + +If the DFS subsystem removes its claim for a share as part of the DFS namespace, it MUST notify the CIFS server via this event. In response to this event, the CIFS server MUST clear the SMB_SHARE_IS_IN_DFS bit in the **Server.Share.OptionalSupport** attribute of the share. + +#### Application Requests the Session Key Associated with a Client Session + +The application provides the following: + +- Open -- A **Server.Open** that identifies an open instance of a file or pipe. + +The server MUST provide a 16-byte session key described by **Server.Open.Session.SessionKey** to the caller. An implementation-specific error MUST be returned to the caller if the session key is not available. + +#### Application Requests the Security Context Associated with a Client Session + +The application provides the following: + +- Open - A **Server.Open** that identifies an open instance of a file or pipe. + +The server MUST provide the implementation-specific user security context described by **Server.Open.Session.UserSecurityContext** to the caller. An implementation-specific error MUST be returned to the caller if the security context is not available. + +#### Server Application Requests Closing a Session + +The calling application MUST provide the **GlobalSessionId** of the session to be closed. The server MUST enumerate all **Connections** in **Server.ConnectionTable** and MUST look up **Session** from the **Connection.SessionTable** where **Session.SessionGlobalId** is equal to **GlobalSessionId**. The server MUST remove **Session** from the **Connection.SessionTable**, MUST decrease **Server.Statistics.sts0_sopens** by 1, and MUST release every lock in **Server.Open.Locks**. If there is no matching session, the call MUST return. + +The server MUST deregister the session by invoking the event Server Deregisters a Session ([\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 3.1.6.3), providing **GlobalSessionId** as the input parameter. + +The server MUST close every **Open** in the **Session.Connection.FileOpenTable** as specified in section [3.3.4.13](#Section_9800e30c24fe4abb998eed309a489841) where **Open.Session** matches **Session**. + +For each **TreeConnect** in **Session.Connection.TreeConnectTable** where **TreeConnect.Session** matches **Session**, the server MUST perform the following: + +- Deregister the Treeconnect (\[MS-SRVS\] section 3.1.6.7), providing the tuple **<TreeConnect.Share.ServerName, TreeConnect.Share.Name>** and **TreeConnect.TreeGlobalId** as the input parameters. +- Decrement **TreeConnect.Share.CurrentUses** by 1. +- Disconnect and remove the **TreeConnect** from **Session.Connection.TreeConnectTable**. + +The session MUST be torn down and freed. + +#### Server Application Registers a Share + +The calling application provides a share in a **SHARE_INFO_503_I** structure ([\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 2.2.4.27) to register a share. The server MUST validate the **SHARE_INFO_503_I** structure as specified in \[MS-SRVS\] section 3.1.4.7. If any member in the structure is invalid, the server MUST return STATUS_INVALID_PARAMETER to the calling application. The server MUST look up the **Share** in the **Server.ShareTable**, where **shi503_servername** matches **Share.ServerName** and **shi503_netname** matches **Share.Name**. If a matching **Share** is found, the server MUST fail the call with an implementation-dependent error. Otherwise, the server MUST create a new **Share** with the following values set, insert it into **Server.ShareTable**, and return STATUS_SUCCESS. + +- **Share.Name** MUST be set to **shi503_netname**. +- **Share.Type** MUST be set to **shi503_type**. +- **Share.Remark** MUST be set to **shi503_remark**. +- **Share.LocalPath** MUST be set to **shi503_path**. +- **Share.ServerName** MUST be set to **shi503_servername**. +- **Share.FileSecurity** MUST be set to **shi503_security_descriptor**. +- **Share.MaxUses** MUST be set to **shi503_max_uses**. +- **Share.CurrentUses** MUST be set to zero. + +#### Server Application Updates a Share + +To update an existing **Share**, the calling application provides a share in the **SHARE_INFO_503_I** ([\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 2.2.4.27) and **SHARE_INFO_1005** (\[MS-SRVS\] section 2.2.4.29) structures as input parameters. The server MUST validate the **SHARE_INFO_503_I** and **SHARE_INFO_1005** structures as specified in \[MS-SRVS\] section 3.1.4.11. If any member in the structures is invalid, the server MUST return STATUS_INVALID_PARAMETER to the calling application. The server MUST look up the **Share** in **Server.ShareTable** through the tuple <**shi503_servername**, **shi503_netname**\>. If the matching **Share** is found, the server MUST update the **Share** by setting the following values and MUST return STATUS_SUCCESS to the calling application; otherwise, the server MUST return an implementation-specific error. + +- **Share.Remark** MUST be set to **shi503_remark**. +- **Share.MaxUses** MUST be set to **shi503_max_uses**. +- **Share.FileSecurity** MUST be set to **shi503_security_descriptor**. + +#### Server Application Deregisters a Share + +The calling application MUST provide the tuple <**ServerName**, **ShareName**\> of the share that is being deregistered. The server MUST look up the share in **Server.ShareTable**, MUST remove it from the list if the share is found, and MUST return STATUS_SUCCESS to the calling application; otherwise, the server MUST return an implementation-specific error. + +For each **Connection** in **Server.ConnectionTable**, the server MUST perform the following: + +- For each **Open** in **Connection.FileOpenTable** where **Open.TreeConnect.Share** matches the current share: + - Close the **Open** as specified in section [3.3.4.13](#Section_9800e30c24fe4abb998eed309a489841). +- For each **TreeConnect** in **Connection.TreeConnectTable** where **TreeConnect.Share** matches the current share: + - Deregister the **TreeConnect** by invoking the event specified in [\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 3.1.6.7 with the tuple <**TreeConnect.Share.ServerName**, **TreeConnect.Share.Name**\> and **TreeConnect.TreeGlobalId** as input parameters. + - Remove the **TreeConnect** entry from **Connection.TreeConnectTable**. + +#### Server Application Requests Querying a Share + +The calling application MUST provide the tuple <**ServerName**, **ShareName**\> of the share that is being queried. The server MUST look up the **Share** in **Server.ShareTable**. If the matching **Share** is found, the server MUST return a share in the **SHARE_INFO_503_I** ([\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 2.2.4.27) and **SHARE_INFO_1005** (\[MS-SRVS\] section 2.2.4.29) structures with the following values set and MUST return STATUS_SUCCESS to the calling application; otherwise, the server MUST return an implementation-dependent error. + +| Output parameters | \[MS-CIFS\] share properties | +| ----------------------------------------------- | ---------------------------- | +| **SHARE_INFO_503_I.shi503_netname** | **Server.Share.Name** | +| **SHARE_INFO_503_I.shi503_type** | **Server.Share.Type** | +| **SHARE_INFO_503_I.shi503_remark** | **Server.Share.Remark** | +| **SHARE_INFO_503_I.shi503_permissions** | 0x00000000 | +| **SHARE_INFO_503_I.shi503_max_uses** | **Server.Share.MaxUses** | +| **SHARE_INFO_503_I.shi503_current_uses** | **Server.Share.CurrentUses** | +| **SHARE_INFO_503_I.shi503_path** | **Server.Share.LocalPath** | +| **SHARE_INFO_503_I.shi503_passwd** | Empty string | +| **SHARE_INFO_503_I.shi503_servername** | **Server.Share.ServerName** | +| **SHARE_INFO_503_I.shi503_security_descriptor** | NULL | +| **SHARE_INFO_1005.shi1005_flags** | 0x00000000 | + +#### Server Application Requests Closing an Open + +The calling application MUST provide **GlobalFileId** as an identifier for the **Open**. The server MUST enumerate all connections in **Server.ConnectionTable** and MUST look up **Open** in **Server.Connection.FileOpenTable** where **Server.Open.FileGlobalId** is equal to **GlobalFileId**. If the **Open** is found, the server MUST remove it from **Server.Connection.FileOpenTable**, MUST decrease **Open.TreeConnect.OpenCount** and **Server.Statistics.sts0_fopens** by 1, MUST release every lock in **Server.Open.Locks**, and MUST return STATUS_SUCCESS to the calling application; otherwise, the call MUST return an implementation-dependent error. + +The server MUST provide **GlobalFileId** to deregister the **Open** by invoking the event Server Deregisters an Open ([\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 3.1.6.5). + +The **Open** object MUST be closed. + +#### Server Application Queries a Session + +The calling application MUST provide **GlobalSessionId** as an identifier for the **Session**. The server MUST enumerate all connections in **Server.ConnectionTable** and MUST look up a **Session** in **Server.Connection.SessionTable** where **GlobalSessionId** is equal to **Server.Session.SessionGlobalId**. If a **Session** is found, the server MUST return the **Session** in a **SESSION_INFO_502** structure ([\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 2.2.4.15) with the following values set and MUST return STATUS_SUCCESS to the calling application. + +| SESSION_INFO_502 parameters | \[MS-CIFS\] Session properties | +| --------------------------- | ------------------------------------------------------------------------------------------------------------------- | +| **sesi502_cname** | **Session.Connection.ClientName** | +| **sesi502_username** | **Server.Session.UserName** | +| **sesi502_num_opens** | The count of entries in **Session.Connection.FileOpenTable** where **Open.Session** matches the current session. | +| **sesi502_time** | Current time minus **Session.CreationTime**. | +| **sesi502_idle_time** | Current time minus **Session.IdleTime**. | +| **sesi502_user_flags** | MUST be set to SESS_GUEST if **Session.UserName** represents a Guest account; otherwise, MUST be set to 0x00000000. | +| **sesi502_cltype_name** | An empty string. | +| **sesi502_transport** | **Session.Connection.TransportName** | + +If no **Session** is found, the server MUST return an implementation-dependent error. + +#### Server Application Queries a TreeConnect + +The calling application MUST provide _GlobalTreeConnectId_ as an identifier for the **TreeConnect**. The server MUST enumerate all connection entries in **Server.ConnectionTable** and MUST look up all **TreeConnect** entries in **Server.Connection.TreeConnectTable** where _GlobalTreeConnectId_ is equal to **TreeConnect.TreeGlobalId**. If a **TreeConnect** is found, the server MUST return **ServerName** and a **CONNECTION_INFO_1** structure ([\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 2.2.4.2) with the following values set and MUST return STATUS_SUCCESS to the calling application. + +| Output parameters | \[MS-CIFS\] TreeConnect properties | +| ------------------- | ------------------------------------------------ | +| **coni1_id** | **TreeConnect.TreeGlobalId** | +| **coni1_type** | **TreeConnect.Share.ShareType** | +| **coni1_num_opens** | **TreeConnect.OpenCount** | +| **coni1_num_users** | 0x00000001 | +| **coni1_time** | Current time minus **TreeConnect.CreationTime**. | +| **coni1_username** | **TreeConnect.Session.UserName** | +| **coni1_netname** | **TreeConnect.Share.Name** | +| **ServerName** | **TreeConnect.Share.ServerName** | + +If no **TreeConnect** is found, the server MUST return an implementation-dependent error. + +#### Server Application Queries an Open + +The calling application MUST provide _GlobalFileId_ as an identifier for the **Open**. The server MUST enumerate all connections in **Server.ConnectionTable** and MUST look up the **Open** in **Server.Connection.FileOpenTable** where **Server.Open.FileGlobalId** is equal to _GlobalFileId_. If the **Open** is found, the server MUST return it in a **FILE_INFO_3** structure ([\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 2.2.4.7), with the following values set and MUST return STATUS_SUCCESS to the calling application. + +| FILE_INFO_3 parameters | \[MS-CIFS\] Open properties | +| ---------------------- | ---------------------------------- | +| **fi3_id** | **Open.FileGlobalId** | +| **fi3_permissions** | **Open.GrantedAccess** | +| **fi3_num_locks** | Count of entries in **Open.Locks** | +| **fi3_path_name** | **Open.PathName** | +| **fi3_username** | **Open.Session.UserName** | + +If no **Open** is found, the server MUST return an implementation-dependent error. + +#### Server Application Requests Transport Binding Change + +The application provides: + +- **TransportName**: A string containing an implementation-dependent name of the transport. +- **ServerName**: An optional string containing the name of the server to be used for binding the transport. +- **EnableFlag**: A Boolean flag indicating whether to enable or disable the transport. + +The server MUST use implementation-specific[<233>](#Appendix_A_233) means to determine whether **TransportName** is an eligible transport entry as specified in section [2.1](#Section_56df901359444ccf970b67c30ef5c449), and if not, the server MUST return ERROR_NOT_SUPPORTED to the caller. + +If **EnableFlag** is TRUE, the server SHOULD[<234>](#Appendix_A_234) obtain **ServerName**, SHOULD obtain binding information for the transport from the appropriate standards assignments as specified in section 2.1, and MUST attempt to start listening on the requested transport endpoint.[<235>](#Appendix_A_235) + +If **EnableFlag** is FALSE, the server MUST attempt to stop listening on the transport indicated by **TransportName**. + +If the attempt to start or stop listening on the transport succeeds, the server MUST return STATUS_SUCCESS to the caller; otherwise, it MUST return an implementation-dependent error. + +#### Server Service Enables the CIFS Server + +The server MUST verify in an implementation-specific manner that the caller of this interface is the server service [\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9), and only if so, MUST set the **Server.Enabled** ADM element to TRUE. + +#### Server Services Disables the CIFS Server + +The server MUST verify in an implementation-specific manner that the caller of this interface is the server service [\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9), and only if so, MUST take the following actions: + +- The server MUST set **Server.Enabled** to FALSE to prevent accepting new connections. +- The server MUST disconnect each **Connection** in **Server.ConnectionTable** as specified in section [3.3.7.2](#Section_a363f0bcb07e485f953e16fa5efd1715). +- The server MUST remove and free all the shares in **Server.ShareTable**. + +#### Server Service Pauses the CIFS Server + +The server MUST verify in an implementation-specific manner that the caller of this interface is the server service [\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9), and, only if so, MUST set the **Server.Paused** ADM element to TRUE. + +#### Server Services Resumes (Continues) the CIFS Server + +The server MUST verify in an implementation-specific manner that the caller of this interface is the server service [\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9), and, only if so, MUST set the **Server.Paused** ADM element to FALSE. + +#### Server Application Requests Updating the Server Configuration + +The calling application provides **SERVER_INFO_103** ([\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 2.2.4.43) and **SERVER_INFO_599** (\[MS-SRVS\] section 2.2.4.46) structures as input parameters to update the server configuration. The following values MUST be set by the server: + +- **Server.AutodisconnectTimeout** MUST be set to **sv103_disc**. +- **Server.MaxVcNumber** MUST be set to **sv599_sessvcs**. +- **Server.OplockTimeout** MUST be set to **sv599_oplockbreakresponsewait**. +- **Server.EnableOplock** MUST be set to **sv599_enableoplocks**. +- **Server.MaxMpxCount** MUST be set to **sv599_maxmpxct**. +- **Server.SrvSearchMaxTimeout** MUST be set to **sv599_maxkeepsearch**. +- **Server.SrvMaxSessionTableSize** MUST be set to **sv599_sessusers**. + +#### Server Application Requests Server Statistics + +The server MUST return the **Server.Statistics** ADM element in a **STAT_SERVER_0** ([\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 2.2.4.39) structure to the server application with the following values: + +| STAT_SERVER_0 member | CIFS Server.Statistics Property | +| ----------------------- | ----------------------------------------- | +| **sts0_start** | zero | +| **sts0_fopens** | **Server.Statistics.sts0_fopens** | +| **sts0_devopens** | zero | +| **sts0_jobsqueued** | **Server.Statistics.sts0_jobsqueued** | +| **sts0_sopens** | **Server.Statistics.sts0_sopens** | +| **sts0_stimedout** | **Server.Statistics.sts0_stimedout** | +| **sts0_serrorout** | zero | +| **sts0_pwerrors** | **Server.Statistics.sts0_pwerrors** | +| **sts0_permerrors** | **Server.Statistics.sts0_permerrors** | +| **sts0_syserrors** | zero | +| **sts0_bytessent_low** | **Server.Statistics.sts0_bytessent_low** | +| **sts0_bytessent_high** | **Server.Statistics.sts0_bytessent_high** | +| **sts0_bytesrcvd_low** | **Server.Statistics.sts0_bytesrcvd_low** | +| **sts0_bytesrcvd_high** | **Server.Statistics.sts0_bytesrcvd_high** | +| **sts0_avresponse** | zero | +| **sts0_reqbufneed** | zero | +| **sts0_bigbufneed** | zero | + +### Processing Events and Sequencing Rules + +#### Accepting an Incoming Connection + +When the server accepts an incoming remote client connection as specified in section [3.3.7.3](#Section_009cdc251f3c40198c03588cd57d8d2c), the server MUST allocate a **Server.Connection** ADM element and initialize it as follows: + +- **Server.Connection.ClientCapabilities** is set to zero (0x00000000). +- **Server.Connection.TransportName** is set to the implementation-specific name of the transport provided with the connection.[<236>](#Appendix_A_236) +- **Server.Connection.IsSigningActive** is set to FALSE. +- **Server.Connection.SessionSetupReceived** is FALSE. +- **Server.Connection.SessionTable** is an empty list. +- **Server.Connection.ClientMaxBufferSize** is set to zero (0x00000000). +- **Server.Connection.PendingRequestTable** is empty. +- **Server.Connection.TreeConnectTable** is an empty list. +- **Server.Connection.OpLockSupport** is set to the value of **Server.EnableOplock**. +- **Server.Connection.FileOpenTable** is an empty list. +- **Server.Connection.SearchOpenTable** is an empty list. +- **Server.Connection.ConnectionlessSessionID** is set to zero (0x0000) unless the transport is connectionless, in which case a valid value is assigned. +- **Server.Connection.ServerNextReceiveSequenceNumber** is set to 2. +- **Server.Connection.ServerSendSequenceNumber** is set to an empty list. +- **Server.Connection.SigningChallengeResponse** is a zero-length array. +- **Server.Connection.SigningSessionKey** is zeroed. +- **Server.Connection.SessionKey** SHOULD[<237>](#Appendix_A_237) be set to a token generated by the server for this connection, as specified in [SessionKey Generation (section 2.2.1.6.6)](#Section_992234e609d845a180ba1973bb8c7335). +- **Server.Connection.IdleTime** is set to the current time plus **Server.AutoDisconnectTimeout**. +- **Server.Connection.SelectedDialect** is set to empty. +- **Server.Connection.CreationTime** is set to the current time. + +The server MUST invoke the event specified in [\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 3.1.6.16, providing the input tuple <**Server.Connection.TransportName**,TRUE>, to update the connection count. + +The server MUST start [Idle Connection Timer (section 3.3.2.2)](#Section_01688aa7038d484991ff3b55781a7253) if it has not been started. + +The server MUST start [Unused Connection Timer (section 3.3.2.4)](#Section_d1dbbbc729d045359f00f45aa90e2ffe) if it has not been started. + +#### Receiving Any Message + +For every message received, the server MUST calculate the total number of bytes in the message and MUST update the values of **Server.Statistics.sts0_bytesrcvd_low** and **Server.Statistics.sts0_bytesrcvd_high**. The server MUST update **Server.Connection.IdleTime** as the current time plus **Server.AutoDisconnectTimeout**. + +Upon receiving any client request, the server SHOULD perform basic message validation. The following tests SHOULD be performed on all received messages, with exceptions as noted: + +- Validate the length of the message. + +If the message is a standard SMB message, as opposed to a raw data transfer, the total byte length of the message as reported by the [**SMB transport**](#gt_f8b0f8a6-e412-459a-b8ba-219008e5bcd7) MUST be a minimum of 35 bytes: + +- 35 = 32 + 1 + 2 = sizeof( SMB_Header ) + sizeof( WordCount ) + sizeof( ByteCount ); + +The total byte length of any SMB message MUST be at least: + +- sizeof( SMB_Header ) + sizeof( WordCount ) + (2 x WordCount) + sizeof( ByteCount ) + ByteCount; + +If the total number of bytes transferred by the SMB transport is less than specified by the preceding formula, then the message was either incorrectly formatted by the client, or it was truncated in transit. The client SHOULD send an error response with the Status code set to STATUS_INVALID_SMB (ERRSRV/ERRerror). It is not a protocol error for the client to transfer excess data; however, the excess data MUST be ignored. + +Raw data transfers from client to server are generated by the SMB_COM_WRITE_RAW command. + +- Validate the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) **Protocol** identifier and the command code. + +The four-byte Protocol identifier at the start of the SMB Header MUST contain the octet values '\\xFF', 'S', 'M', 'B'. Otherwise, the server MUST return an error response with the **Status** code set to STATUS_INVALID_SMB (ERRSRV/ERRerror). + +The command code MUST be one of the valid command codes listed in section [2.2.2.1](#Section_32b5d4b7d90b483fad6a003fd110f0ec). + +- - If the command code in the **SMB_Header.Status** field is listed as "Unused" or "Reserved" in the first column of the table in section 2.2.2.1, or if the command code is either [SMB_COM_INVALID (section 2.2.4.74)](#Section_56cd8dd298cb4ef7a0885c53905e0fc0) or [SMB_COM_NO_ANDX_COMMAND (section 2.2.4.75)](#Section_10921e06804f4b5a92a51cc562f43068), the server MUST return an error response with the **Status** code set to STATUS_SMB_BAD_COMMAND (ERRSRV/ERRbadcmd). + - If the command is listed in the table in section 2.2.2.1 as Obsolete (as shown by an X in the Status column) or Not Implemented (as shown by an N in the Status column), the server SHOULD return an error response with a **Status** code of STATUS_NOT_IMPLEMENTED (ERRDOS/ERRbadfunc). See the descriptions of the individual commands in section [2.2.4](#Section_5cd5747ffe0b40a689d0d67f751f8232) for more information.[<238>](#Appendix_A_238) + - If the command code represents a valid command, but the command has not been implemented by the server, the server MUST return STATUS_NOT_IMPLEMENTED (ERRDOS/ERRbadfunc). +- Validate the **UID** and **TID**. + +With three exceptions, all SMB requests sent by the client MUST have valid **UIDs**. The exceptions are: + +- - SMB_COM_NEGOTIATE + - SMB_COM_ECHO + - SMB_COM_SESSION_SETUP_ANDX + +To be valid, a **Server.Connection.SessionTable** entry for the **UID** MUST exist, such that the **Server.Session.UID** matches the **SMB_Header.UID** received in the request. If the **UID** is not valid, the server MUST return STATUS_SMB_BAD_UID (ERRSRV/ERRbaduid). + +If the **UID** is valid, the server MUST enumerate all connections in the **Server.ConnectionTable** and MUST look up **Session** in the **Server.Connection.SessionTable** where **UID** is equal to **Server.Session.UID**. If a session is found, **Server.Session.IdleTime** MUST be set to the current time. If no session is found, no action regarding idle time is taken. + +With five exceptions, all SMB requests sent by the client MUST have valid **TIDs**. The exceptions are: + +- - SMB_COM_NEGOTIATE + - SMB_COM_SESSION_SETUP_ANDX + - SMB_COM_TREE_CONNECT + - SMB_COM_TREE_CONNECT_ANDX + - SMB_COM_LOGOFF_ANDX + +To be valid, a **Server.Connection.TreeConnectTable** entry for the **TID** MUST exist, such that the **Server.TreeConnect.TID** matches the **SMB_Header.TID** received in the request. If the **TID** is not valid, the server MUST return STATUS_SMB_BAD_TID (ERRSRV/ERRinvtid). + +The SMB_COM_ECHO command requires either a valid **TID** or the value 0xFFFF. The latter MAY be used if no tree connect has been established.[<239>](#Appendix_A_239) + +- This list of validation tests is not exhaustive. + +##### Command Processing + +If the message received is a command request that initiates processing of a command, the **UID**, **TID**, **PID**, and **MID** of the command MUST be used to create an entry in the **Server.Connection.PendingRequestTable**. If the [**SMB transport**](#gt_f8b0f8a6-e412-459a-b8ba-219008e5bcd7) is connectionless, the **CID** (Connectionless Connection ID) SHOULD also be used to create the entry. All of these fields are located in the request header. The server MUST assign a **CancelRequestID** for the request and MUST store it in the **Server.Connection.PendingRequestTable**. For a batched request, the entire batched request MUST be registered as a single entry in the **Server.Connection.PendingRequestTable**. + +If the message received represents a further step in processing an existing command (for example, a secondary transaction message), the entry in the **Server.Connection.PendingRequestTable** SHOULD be updated by the request. The key values (**UID**, **TID**, **PID**, **MID**, and **SID**) MUST NOT be altered by the update. + +##### Processing Options + +If the message received is a command request that initiates processing of a command, the server SHOULD use the **SMB_Header.Flags2** field of the message to determine the capabilities from the **Server.Connection.ClientCapabilities** list that the client has requested to use for processing the command. + +##### Message Signing + +If a message is received and **Connection.IsSigningActive** is TRUE for the SMB connection, the signature MUST be verified as specified in section [3.1.5.1](#Section_35839d070f694d20af2f2c45aa7522b3). + +The server is responsible for providing the expected sequence number for signature validation. The sequence number for the next incoming request is stored in **Server.Connection.ServerNextReceiveSequenceNumber**. The server MUST remember the appropriate sequence number for the response to this request and does so by inserting it into the **Server.Connection.ServerSendSequenceNumber** table with the [**PID**](#gt_38a420dd-6f31-456e-ae5c-63ec6905380d) and **MID** that identify the request/response pair. + +If the signature on the received packet is incorrect, the server MUST return STATUS_ACCESS_DENIED (ERRDOS/ERRnoaccess) and MUST increase **Server.Statistics.sts0_permerrors** by 1. After verifying that the signature on the current message is correct, the server MUST take the following steps. + +- IF request command EQUALS SMB_COM_NT_CANCEL THEN +- INCREMENT ServerNextReceiveSequenceNumber +- ELSE IF request has no response THEN +- INCREMENT ServerNextReceiveSequenceNumber BY 2 +- ELSE +- SET ServerSendSequenceNumber\[PID,MID\] TO ServerNextReceiveSequenceNumber + 1 +- INCREMENT ServerNextReceiveSequenceNumber BY 2 +- END IF + +##### Receiving any Batched ("AndX") Request + +When a server receives an AndX Request message, the server MUST process the batched requests sequentially. For the first operation, the identifiers for the **FID**, **SID,** and **TID**, if any, MUST be taken from the received operation. For every subsequent operation in the current batch, the values used for **FID**, **SID,** and **TID** MUST be either those in first operation or those generated by the previous operation. Each request is processed as specified in its respective Message Processing subsection, with the exception that if a response is generated, it MUST NOT be sent immediately. Instead, the server MUST batch the response into an AndX Response chain. + +The server MUST use the information in the request header as the header information for each batched request. If processing a batched request causes a change in state that would affect the information in the header, the updated header information MUST be used when the server processes the subsequent request in the chain. If any of the requests in the AndX Request chain generate an error, the error MUST be stored in the **SMB_Header.Status** field of the response, the AndX Response chain MUST be terminated at that response, and any further requests in the AndX Request chain (if any) MUST NOT be processed. + +Once the AndX Response chain is terminated, an AndX Response message MUST be constructed as follows: + +- The server MUST construct the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) using the header information as it was at the termination of the AndX Request chain. +- The AndX Response chain of Parameter and Data block pairs MUST be sequentially appended to the response message. +- If **Connection.IsSigningActive** is TRUE, the entire batched message is signed as specified in section [3.1.4.1](#Section_68c3d17ae48e4eb4b97e3246bfe0262f). + +The server MUST send the completed batch response to the client. + +##### Receiving Any Transaction Request + +Upon receipt of an [SMB_COM_TRANSACTION Request (section 2.2.4.33.1)](#Section_57bfc115fe294482a0fea935757e0a4f), [SMB_COM_TRANSACTION2 Request (section 2.2.4.46.1)](#Section_f7d148cde3d549ae8b379633822bfeac), or [SMB_COM_NT_TRANSACT Request (section 2.2.4.62.1)](#Section_1e62725cbb9e470499a48db520a6f2da), the server MUST verify that it can process the transaction. In particular, the server MUST allocate sufficient space to accept the transaction subcommand parameters and data. The server MUST also be able to allocate **MaxParameterCount** plus **MaxDataCount** bytes for the results of the transaction. If the server is unable to allocate these resources, it SHOULD[<240>](#Appendix_A_240) return STATUS_INSUFF_SERVER_RESOURCES (ERRDOS/ERRnomem). + +The server SHOULD perform initial validation of the transaction itself and return an error response if an error is detected. An error response terminates the transaction. + +If no initial errors are detected, the server MUST determine whether the entire transaction is contained within the initial request message. If the value of the **ParameterCount** field is less than that of the **TotalParameterCount** and/or the value of the **DataCount** field is less than that of the **TotalDataCount**, then the server MUST send an Interim Response message, setting the **SMB_Parameters.WordCount** and **SMB_Data.ByteCount** fields to 0, and prepare to receive one or more secondary requests from the client in order to complete the transfer of the transaction. + +The transaction is completely transferred to the server when: + +- The total number of transaction parameter bytes received equals the smallest value of **TotalParameterCount** reported by the client across all of the transaction request messages sent, and +- The total number of transaction data bytes received equals the smallest value of **TotalDataCount** reported by the client across all of the transaction request messages sent. + +When these conditions are met, the transaction can be processed. + +If the processing of the transaction results in an error, the server MUST return an error response, which cancels the transaction. + +If the transaction response, which includes the response parameters and data, is greater than permitted by **Server.Connection.ClientMaxBufferSize**, the server MUST send multiple final response messages in order to transfer the entire transaction response. + +##### Supporting Shares in the DFS Namespace + +If the DFS subsystem has indicated that it is active (section [3.3.4.3](#Section_1430eeb382ce47deb4bbfefd88a537fb)) and that a particular share is a DFS share (section 3.3.4.3), message processing MUST include the following: + +If a request: + +- Has the SMB_FLAGS2_DFS flag set; +- Contains a pathname field. + +All pathname fields in the message MUST be DFS paths. The server MUST forward the DFS paths to the DFS subsystem for name resolution as specified in [\[MS-DFSC\]](%5bMS-DFSC%5d.pdf#Section_3109f4be2dbb42c99b8e0b34f7a2135e) section 3.1.4.1. + +If the DFS subsystem can resolve the DFS path to local storage, the local storage MUST be accessed and message processing continues. If the DFS subsystem returns an error, the error MUST be sent to the client in an error response. + +##### Granting OpLocks + +If the message received is an open or create and includes a request for an OpLock, the following additional steps MUST be taken: + +- If the **Server.Connection.OpLockSupport** state variable is FALSE, then an OpLock MUST NOT be granted. +- If the open or create is on a directory file, then an Oplock MUST NOT be granted. +- If the file is not open by any other process and **Server.Connection.OpLockSupport** is TRUE, then the requested OpLock type MUST be granted. +- If the file is open for read-only access by one or more other processes, and: + - The open or create command specifies read-only access to the file; + - The open or create command supports Level II OpLocks; + - **Server.Connection.OpLockSupport** is true; + +Then a Level II OpLock MUST be granted. + +- Otherwise, an OpLock MUST NOT be granted. + +See [\[FSBO\]](https://go.microsoft.com/fwlink/?LinkId=140636) section 2.2, Granting OpLocks. For more information, see [\[MS-FSA\]](%5bMS-FSA%5d.pdf#Section_860b1516c45247b4bdbc625d344e2041), Server Requests an OpLock. + +The server MUST also request that the underlying file system notify the server when the granted OpLock is broken. See \[FSBO\] section 2.3, Breaking OpLocks. For more information, see \[MS-FSA\], Server Acknowledges an OpLock Break. + +#### Receiving an SMB_COM_CREATE_DIRECTORY Request + +Upon receipt of an [SMB_COM_CREATE_DIRECTORY Request (section 2.2.4.1.1)](#Section_06cc0c53355a4042ae24794aadb412f3) from the client, the server MUST verify the following: + +- The **TID** in the **SMB_Header.TID** field MUST be a valid **TID** for this [**SMB connection**](#gt_e1d88514-18e6-4e2e-a459-20d5e17e9078), as defined in section [3.3.5.2](#Section_b09b63d73882458b9c8ec821c706ebdf). +- If the last element of the pathname in the **SMB_Data.Bytes.DirectoryName** field is removed, the remaining pathname MUST represent a valid directory within the share indicated by the **TID**. +- The full pathname from the **SMB_Data.Bytes.DirectoryName** field MUST NOT resolve to an existing file or directory or other file system object. +- The **UID** in the **SMB_Header.UID** field MUST be valid, as defined in section 3.3.5.2, and MUST represent the [**security context**](#gt_88d49f20-6c95-4b64-a52c-c3eca2fe5709) of a user with permission to create the directory. If the user does not have permission to create the directory, the server MUST return an error response with STATUS_ACCESS_DENIED (ERRDOS/ERRnoaccess) and MUST increase **Server.Statistics.sts0**\_permerrors by 1. +- If the designated directory already exists, the server MUST return an error response with STATUS_OBJECT_NAME_COLLISION (ERRDOS/ ERRfilexists). + +If these conditions are met, the server MUST attempt to create the directory.[<241>](#Appendix_A_241) If directory creation fails, the server MUST provide an error response to the client (see section [2.2.4.1.2](#Section_90dee34694114e9790224d2caf02562e) for the list of expected error codes). Otherwise, the server MUST return **Success** in the **Status** field. + +The response MUST be sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). + +#### Receiving an SMB_COM_DELETE_DIRECTORY Request + +Upon receipt of an [SMB_COM_DELETE_DIRECTORY Request (section 2.2.4.2.1)](#Section_f944f5bb06684cdfb6ffbec3f6ea8667) from the client, the server MUST verify the following: + +- The **TID** in the **SMB_Header.TID** field MUST be a valid **TID** for this SMB connection, as defined in section [3.3.5.2](#Section_b09b63d73882458b9c8ec821c706ebdf). +- The pathname in the **SMB_Data.Bytes.DirectoryName** field MUST represent a valid directory within the share indicated by the **TID**. +- The UID in the **SMB_Header.TID** field MUST be valid, as defined in section 3.3.5.2 and MUST represent the [**security context**](#gt_88d49f20-6c95-4b64-a52c-c3eca2fe5709) of a user with permission to delete the directory. If the user does not have permission to delete the directory, the server MUST return an error response with STATUS_ACCESS_DENIED (ERRDOS/ERRnoaccess) and MUST increase **Server.Statistics.sts0_permerrors** by 1. +- The specified directory MUST NOT be the root directory of the share (which cannot be deleted by the client). +- The specified directory MUST be empty. + +If any of the preceding conditions is not met, the server MUST return an error message with the appropriate status code, as listed in section [2.2.4.2.2](#Section_6e183cd33f3b48a8be709dd75183da8b). Otherwise, the server MUST attempt to delete the directory. If the deletion fails, the server MUST return an error message with a status code indicating the cause of the failure.[<242>](#Appendix_A_242) If the directory is not empty, deletion MUST fail with STATUS_DIRECTORY_NOT_EMPTY (ERRDOS/ERRnoaccess). + +If the deletion succeeds, the server MUST perform a lookup in **Server.Connection.SearchOpenTable** for **Server.SearchOpen**s with **Server.SearchOpen.TID**s that match **SMB_Header.TID** and SHOULD[<243>](#Appendix_A_243) close any such **Server.SearchOpen** that represents a search on the deleted directory, as determined by a comparison of **Server.SearchOpen.PathName** and **SMB_Data.Bytes.DirectoryName**. The server MUST construct an SMB_COM_DELETE_DIRECTORY Response (section 2.2.4.2.2) message and MUST set **SMB_Header.Status** to indicate success. + +The response MUST be sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). + +#### Receiving an SMB_COM_OPEN Request + +Upon receipt of an [SMB_COM_OPEN Request](#Section_ab9bb87219674088b4446a35d0af305e), the server MUST validate the **TID** field and the **UID** field, as specified in section [3.3.5.2](#Section_b09b63d73882458b9c8ec821c706ebdf). + +If the **ShareType** property of the **Server.Share** specified by the **SMB_Header.TID** is equal to **Named Pipe** and if **Server.Session.IsAnonymous** is TRUE, the server MUST invoke the event specified in [\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 3.1.6.17 by providing the **SMB_Data.Bytes.FileName** field with the "\\PIPE\\" prefix removed as input parameter. If the event returns FALSE, indicating that no matching named pipe is found that allows an anonymous user, the server MUST fail the request with STATUS_ACCESS_DENIED and MUST increase **Server.Statistics.sts0_permerrors** by 1. Otherwise, the server MUST continue the open processing. + +The server MUST search for a file with a name matching the name given in the request's **SMB_Data.Bytes FileName** field and SHOULD search based on **SearchAttributes**.[<244>](#Appendix_A_244) If no matching file is found, or if the file is found but cannot be opened, the server MUST return an error response with a **Status** indicating the error as listed in the error code table in section [2.2.4.3.2](#Section_20829e08c77a42f3b4272ef87d3cf212).[<245>](#Appendix_A_245) If the underlying object store returns STATUS_ACCESS_DENIED, the server MUST increase **Server.Statistics.sts0_permerrors** by 1. Otherwise, the server MUST allocate a new **FID**, format an SMB_COM_OPEN response message as specified in section [2.2.4.3](#Section_ec064de86538401e8c73b37231c36f2b), and set **SMB_Header.Status** to indicate success. If the command is successful, the server MUST increase **Server.Statistics.sts0_fopens** by 1 and MUST allocate an **Open** object and insert it into **Server.Connection.FileOpenTable** with the following default values: + +- A new **FID** MUST be created to uniquely identify this **Open** in **Server.Connection.FileOpenTable**. +- If **Server.EnableOplock** is TRUE and a requested OpLock was granted, the type of OpLock MUST be set in **Server.Open.OpLock** and **Server.Open.OplockState** MUST be set to **Held**; otherwise, **Server.Open.OpLock** MUST be set to **None** and **Server.Open.OplockState** MUST be set to **None**. +- **Server.Open.TreeConnect** MUST be set to the **TreeConnect** on which the open request was performed, and **Server.Open.TreeConnect.OpenCount** MUST be increased by 1. +- **Server.Open.Session** MUST be set to **Server.Open.TreeConnect.Session**. +- **Server.Open.Connection** MUST be set to the **Server.Open.Session.Connection**. +- **Server.Open.Locks** MUST be set to an empty list. +- **Server.Open.PID** MUST be set to the **PID** provided in the request. +- **Server.Open.PathName** MUST be set to the **FileName** field of the request. +- **Server.Open.GrantedAccess** MUST be set to the **AccessMode** field of the request. + +The server MUST register the **Open** by invoking the event Server Registers a New Open (\[MS-SRVS\] section 3.1.6.4) and MUST assign the return value to **Server.Open.FileGlobalId**. + +The response MUST be sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). + +#### Receiving an SMB_COM_CREATE Request + +Upon receipt of an [SMB_COM_CREATE Request (section 2.2.4.4.1)](#Section_244621046b354fe4aeaa7c30cd727bc9), the server MUST attempt to create or overwrite the file named in the **FileName** field of the request. If the file does not already exist (is being created), the server MUST also attempt to set the attributes of the file to those provided in the **FileAttributes** field. The server MAY[<246>](#Appendix_A_246) set the creation time of the file from the **CreationTime** field. + +- The user indicated by the **UID** MUST have write permission on the file's parent directory in order to create a new file; otherwise, the server MUST increase **Server.Statistics.sts0_permerrors** by 1, fail the request, and return an error response with STATUS_ACCESS_DENIED (ERRDOS/ERRnoaccess). +- The user indicated by the **UID** MUST have write permission on the file itself in order to truncate it; otherwise, the server MUST increase **Server.Statistics.sts0_permerrors** by 1, fail the request, and return an error response with STATUS_ACCESS_DENIED (ERRDOS/ERRnoaccess). +- The server MUST grant read/write permission for the creator if the file is created. Access permissions for truncated files are not modified. The newly created or truncated file is opened for read/write in Compatibility Mode (see section [3.2.4.5.1](#Section_9a45e9e773774da199d6d66d97532550)). + +If the Create operation fails, the server MUST return an error response with a **Status** code from the list provided in section [2.2.4.4.2](#Section_c11c97aee5ea48c0aeec2d3012b440e2). Otherwise, the server MUST allocate a new [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766), format an SMB_COM_CREATE response message as defined in section 2.2.4.4.2, and set **SMB_Header.Status** to indicate success. **Server.Statistics.sts0_fopens** MUST be increased by 1, and an **Open** containing the new FID MUST be created, initialized, and entered into the **Server.Connection.FileOpenTable**.[<247>](#Appendix_A_247) If **Server.EnableOplock** is TRUE and a requested OpLock was granted, the type of OpLock MUST be set in **Server.Open.OpLock** and **Server.Open.OplockState** MUST be set to **Held**; otherwise, **Server.Open.OpLock** MUST be set to **None** and **Server.Open.OplockState** MUST be set to **None**. **Server.Open.TreeConnect** MUST be set to the **TreeConnect** on which the request was performed, and **Server.Open.TreeConnect.OpenCount** MUST be increased by 1. **.Server.Open.Session** MUST be set to the **Server.Open.TreeConnect.Session**. **Server.Open.Connection** MUST be set to the **Server.Open.Session.Connection**. **Server.Open.Locks** MUST be set to an empty list. **Server.Open.PID** MUST be set to the **PID** provided in the request. **Server.Open.PathName** MUST be set to the **FileName** field of the request. **Server.Open.GrantedAccess** MUST be set to (GENERIC_READ | GENERIC_WRITE).[<248>](#Appendix_A_248) + +The server MUST register the **Open** by invoking the Server Registers a New Open event ([\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 3.1.6.4), and it MUST assign the return value to **Server.Open.FileGlobalId**. + +The response MUST be sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). + +#### Receiving an SMB_COM_CLOSE Request + +Upon receipt of an [SMB_COM_CLOSE Request (section 2.2.4.5.1)](#Section_eb85efbc9fd543208cd691b53ac49203), the server MUST confirm that the supplied **FID** is valid and that it represents a file system object held open by the client. This is done by looking up the **FID** in **Server.Connection.FileOpenTable** to find the corresponding **Open**. + +If the **Open** is not found, the **FID** is not valid, and the server MUST return an error response to the client with a **Status** of STATUS_INVALID_HANDLE (ERRDOS/ERRbadfid). The server SHOULD[<249>](#Appendix_A_249) update the last modification time for the file if the value of the **SMB_Parameters.Word.LastTimeModified** field is neither 0x00000000 nor 0xFFFFFFFF, and the client has write/append access to the file. Then the server MUST decrease **Open.TreeConnect.OpenCount** and **Server.Statistics.sts0_fopens** by 1, release the [**OpLocks**](#gt_7b8c743e-84b1-4c7e-83ea-cfb818cdb394) by closing the **Open** indicated by the **FID**,[<250>](#Appendix_A_250) release every lock in **Server.Open.Locks**,[<251>](#Appendix_A_251) and invalidate the **FID** by removing the **Open** entry from **Server.Connection.FileOpenTable**. The server MUST provide **Open.FileGlobalId** as an input parameter and MUST deregister the **Open** by invoking the Server Deregisters an Open event ([\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 3.1.6.5). + +Once the **FID** has been invalidated, it is available to be reused by future open or create operations. + +The response MUST be sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). + +#### Receiving an SMB_COM_FLUSH Request + +Upon receipt of an [SMB_COM_FLUSH Request (section 2.2.4.6.1)](#Section_e5e1e00c5ec24a5cb825f8cf2f4cda79), the server MUST confirm that the supplied **FID** is either the value 0xFFFF ((USHORT)(-1)) or a valid **FID** representing a file system object held open by the client. The **FID** is validated by performing a look-up in the **Server.Connection.FileOpenTable** to find the corresponding **Open**. If the **FID** is 0xFFFF, the **Server.Connection.FileOpenTable** MUST be scanned for all files that were opened by the **PID** listed in the request header. The server MUST attempt to flush each **Server.Open** so listed. If the **FID** is invalid, the server MUST return STATUS_INVALID_HANDLE (ERRDOS/ERRbadfid) to the client. + +If the **FID** is valid, the server MUST ensure that all written data and additional file allocations are committed to each referenced file by the underlying [**object store**](#gt_0cc469e1-4b1f-41c4-9f94-d6209fcf468e). The server MUST NOT respond to the flush request prior to committing all written data and ensuring that additional file allocations have been committed. At minimum, the server MUST ensure that all other clients or local processes that are reading from the file can read the same information as the process performing the flush operation. + +The server MUST then attempt to flush each referenced file by invoking the underlying object store using implementation-dependent[<252>](#Appendix_A_252) functionality. If an error Status is generated by any flush operation, the Status is returned in an error response message, and no further processing occurs (no more files are flushed). + +The response MUST be sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). + +#### Receiving an SMB_COM_DELETE Request + +Upon receipt of an [SMB_COM_DELETE Request (section 2.2.4.7.1)](#Section_2e57889eca5b4076a86508103b947e59), the server MUST attempt to delete all files that match both the **FileName** and **SearchAttributes** fields from the request. The final component of the **FileName** field can contain wildcard characters, allowing multiple files to be deleted. + +The precise effect of the SMB_COM_DELETE command is server implementation-dependent. The following criteria SHOULD be observed: + +- If **Server.Connection.OpLockSupport** is TRUE, and another client has been granted a batch OpLock on the file, then the server MUST send an OpLock break notification request via [SMB_COM_LOCKING_ANDX Request (section 2.2.4.32.1)](#Section_b5c6eae7976b4444b52ec76c68c861ad) to the client that owns the batch OpLock, as specified in section [3.3.4.2](#Section_b50b9ddaf3744427a93edf9c55c043a6). The server MUST have the OPLOCK_RELEASE flag set on the TypeOfLock. The server MUST set the **NewOpLockLevel** field to 0x00. The SMB_COM_DELETE command request being processed MUST block until the OpLock is either acknowledged by the client or the OpLock Break Acknowledgement Timer has expired.[<253>](#Appendix_A_253) +- The user initiating the request MUST have write permission in the target file's parent directory for the operation to succeed. + +If a wildcard pathname matches more than one file, the server SHOULD search for and delete all files matching the search criteria. The server SHOULD delete matching files sequentially and, if an error occurs, immediately return an error response with the **Status** field set to indicate the error. In this case, some files that match the search criteria and can be deleted will not be deleted.[<254>](#Appendix_A_254) + +The **SearchAttributes** field specifies the types of files that are to be deleted: + +- If **SearchAttributes** is 0x0000 (SMB_FILE_ATTRIBUTE_NORMAL), the server MUST match only normal files. +- If the SMB_FILE_ATTRIBUTE_HIDDEN or SMB_FILE_ATTRIBUTE_SYSTEM are specified, the delete operation MUST include the type or types specified in addition to normal files. +- Read-only files MUST NOT be deleted. +- All other search attributes are ignored by the server. + - This command cannot delete directories or volumes. + - The archive bit is not considered when selecting files. + +The following conditions MUST generate an error response (see the error code list in section [2.2.4.7.2](#Section_69122f4692f34c1a87e1bc137fda0861) for additional error conditions): + +- Within the share indicated by the **TID**, no files are found that match both the **SearchAttributes** and the pathname specified by **FileName** (STATUS_NO_SUCH_FILE (ERRDOS/ERRbadfile)). +- The **TID** is invalid (STATUS_SMB_BAD_TID (ERRSRV/ERRinvtid)). +- The user represented by the **UID** does not have permission to delete any of the selected files (STATUS_ACCESS_DENIED (ERRDOS/ERRnoaccess)) and the server MUST increase **Server.Statistics.sts0_permerrors** by 1. +- The pathname specified by **FileName** is an invalid path (STATUS_OBJECT_PATH_SYNTAX_BAD (ERRDOS/ERRbadpath)). + +Another process has the file open in a sharing mode that does not permit the file to be deleted.[<255>](#Appendix_A_255) + +If any of the above conditions is true, or any other error is generated that prevents completion of the operation, the server MUST return an error response message to the client. Otherwise, the server MUST format an SMB_COM_DELETE response message as defined in section [2.2.4.7](#Section_e455faa4d99643a587eb9993b0ceb896) and MUST set **SMB_Header.Status** to indicate success.[<256>](#Appendix_A_256) + +The response MUST be sent to the client as described in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). + +#### Receiving an SMB_COM_RENAME Request + +Upon receipt of an [SMB_COM_RENAME Request (section 2.2.4.8.1)](#Section_c970f3bf806e43098ea96515605f450d), the server MUST enumerate the set of files that matches both the **OldFileName** pathname and the **SearchAttributes** field in the request. Each matching file name MUST be renamed according to the format of the **NewFileName** pathname. If the target name already exists, the Rename operation MUST fail with a **Status** of STATUS_OBJECT_NAME_COLLISION (ERRDOS/ERRfilexists).[<257>](#Appendix_A_257) + +Other considerations: + +- Only a single **TID** is supplied, so the **OldFileName** and **NewFileName** pathnames MUST be within the same share on the server. +- If **SearchAttributes** is 0x0000 (SMB_FILE_ATTRIBUTE_NORMAL), the server MUST match only normal files. +- For each enumerated file, if any of the following attributes are present in file attributes but not specified in **SearchAttributes**, the rename operation MUST fail with a Status of STATUS_NO_SUCH_FILE (ERRDOS/ERRbadfile). Otherwise, the rename operation MUST include the type or types specified in addition to normal files. + - SMB_FILE_ATTRIBUTE_HIDDEN + - SMB_FILE_ATTRIBUTE_SYSTEM +- This command MUST NOT rename volume labels. + +A file to be renamed might currently be open. If it is opened by the requesting process, it MUST be open in compatibility mode (see section [3.2.4.5.1](#Section_9a45e9e773774da199d6d66d97532550)). If it is not open in compatibility mode, the rename MUST fail with STATUS_ACCESS_DENIED (ERRDOS/ERRnoaccess) and **Server.Statistics.sts0_permerrors** MUST be increased by 1.[<258>](#Appendix_A_258) + +- If another process has the file open, and that process has an OpLock on the file, and the process has asked for extended notification (Batch OpLock), the rename request MUST block until the server has sent an OpLock break request to the owner of the OpLock, as specified in section [3.3.4.2](#Section_b50b9ddaf3744427a93edf9c55c043a6), and either received a response or the OpLock break time-out has expired.[<259>](#Appendix_A_259) The server MUST have the OPLOCK_RELEASE flag set in the **TypeOfLock** field of the request. The server MUST set the **NewOpLockLevel** field of the request to 0x00. If the process holding the OpLock closes the file (thus freeing the OpLock) the rename takes place. If not, the rename MUST fail with STATUS_SHARING_VIOLATION. +- If there is an existing file with the new name, the rename MUST fail with STATUS_OBJECT_NAME_COLLISION. If wildcards are used in a rename operation, and only some of the renames fail for any reason, the request MUST fail silently; that is, an error MUST NOT be returned if at least one of the rename operations was successful. + +A server can be processing multiple requests on the same resource concurrently. As a result, there can be interactions between the execution of the Rename operation and other operations such as ongoing searches (SMB_COM_SEARCH, SMB_COM_FIND, TRANS2_FIND_FIRST2, and so on). Although renaming a directory or files within a directory that is actively being searched is not prohibited, the interaction can disrupt the search, causing it to complete before all directory entries have been returned. + +Renaming files using wildcards is supported. Only the final path element of each of the provided pathnames is permitted to contain wildcard characters. Wildcard characters MUST NOT be used in the rest of the path. When wildcard characters are in use, the translation from the old name to the new name proceeds as described in [\[FSBO\]](https://go.microsoft.com/fwlink/?LinkId=140636). + +If a directory is renamed, it MUST NOT have a destination located within itself or any subdirectory within the source directory. The source and destination MUST be at or below the current **TID** within the file system namespace. If these conditions are not met, the server MUST return STATUS_OBJECT_PATH_SYNTAX_BAD (ERRDOS/ERRbadpath). + +If the operation is successful, the server MUST construct an [SMB_COM_RENAME Response (section 2.2.4.8.2)](#Section_eda3174f448e44b6bfe00a2f3fc3f0f4) message. The response MUST be sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). + +#### Receiving an SMB_COM_QUERY_INFORMATION Request + +When the server receives an [SMB_COM_QUERY_INFORMATION Request (section 2.2.4.9.1)](#Section_fc708fd3b133415c9659b0acf5f596c7), it MUST query the file system metadata of the file identified in the **FileName** field of the request. The **FileName** field MUST be the full path, relative to the supplied **TID**, of the file being queried. The server MUST query the file information through the FILE_NETWORK_OPEN_INFORMATION **OutputBuffer** from the underlying [**object store**](#gt_0cc469e1-4b1f-41c4-9f94-d6209fcf468e) with information level FileNetworkOpenInformation ([\[MS-FSCC\]](%5bMS-FSCC%5d.pdf#Section_efbfe12773ad41409967ec6500e66d5e) section 2.4.34).[<260>](#Appendix_A_260) + +If the file exists and the operation is successful, the server MUST construct an SMB_COM_QUERY_INFORMATION response message as specified in section [2.2.4.9.2](#Section_847573c9cbe64dcba0db9b5af815759b). The server MUST return the following information: + +- **FileAttributes** in **SMB_FILE_ATTRIBUTES** format, as specified in section [2.2.1.2.4](#Section_2198f480e0474df0ba64f28eadef00b9). +- The **LastWriteTime** of the file, presented in UTIME format. +- **FileSize**, which is the size of the file in bytes. **FileSize** is a 32-bit value. If the file is larger than 2 \*\* 32 - 1 bytes in size, only the lower 32 bits of the file size are returned. No error message is sent to indicate this condition. +- If the query fails, the **Status** is set to the error code received from the object store and is returned in an Error Response, and processing is complete. Otherwise, the response message fields are populated as follows: + - **SMB_Parameters.Words.FileAttributes** is set to **OutputBuffer.FileAttributes**. + - **SMB_Parameters.Words.LastWriteTime** is set to **OutputBuffer.LastWriteTime**. + - **SMB_Parameters.Words.FileSize** is set to **OutputBuffer.EndOfFile**. + +The response MUST be sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). + +#### Receiving an SMB_COM_SET_INFORMATION Request + +When the server receives an [SMB_COM_SET_INFORMATION Request (section 2.2.4.10.1)](#Section_76577ee1eb2d4db79bed65c74a952741), it MUST verify that the file indicated by the **FileName** field in the request exists. If the file does not exist, the server MUST fail the request with STATUS_OBJECT_NAME_NOT_FOUND (ERRDOS/ERRbadfile). If the file exists and the user indicated by the **UID** field in the request header does not have permission to modify file metadata, the server MUST fail the request with STATUS_ACCESS_DENIED (ERRDOS/ERRnoaccess) and MUST increase **Server.Statistics.sts0_permerrors** by 1. + +Otherwise, the server MUST attempt to set the file attributes provided in the request: + +- **FileAttributes**, in [SMB_FILE_ATTRIBUTES (section 2.2.1.2.4)](#Section_2198f480e0474df0ba64f28eadef00b9) format. +- **LastWriteTime**: the time of the last write to the file, in [UTIME (section 2.2.1.4.3)](#Section_94ef49b8648c47f19c64def4ad0a63a0) format. If this field contains 0x00000000, the last write time of the file MUST NOT be changed.[<261>](#Appendix_A_261) + +The response MUST be sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). + +#### Receiving an SMB_COM_READ Request + +When the server receives an SMB_COM_READ request, it MUST perform the following actions: + +- Verify the [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766), which represents an **Open** of a file. If the **Open** is not found in **Server.Connection.FileOpenTable**, the server MUST return an error response with a **Status** of STATUS_INVALID_HANDLE (ERRDOS/ERRbadfid). +- Verify the **UID** as described in section [3.3.5.2](#Section_b09b63d73882458b9c8ec821c706ebdf), and ensure that the user has permission to read from the file. If the user does not have permission to read the file, the server MUST send an error response with a **Status** of STATUS_ACCESS_DENIED (ERRDOS/ERRnoaccess) and MUST increase **Server.Statistics.sts0_permerrors** by 1. +- If the UID presented is different from the UID that opened the file, the server MUST send the error response with a **Status** of STATUS_INVALID_HANDLE (ERRDOS/ERRbaduid). +- The server MUST attempt to read data from the underlying object store for the file identified by the FID in the request. It MUST provide the **ReadOffsetInBytes** and **CountOfBytesToRead** fields from the request.[<262>](#Appendix_A_262) +- If the **EstimateOfRemainingBytesToBeRead** field is nonzero, the server MAY use the **EstimateOfRemainingBytesToBeRead** field as a hint for read ahead. + +If the request is to read from a named pipe in [**message mode**](#gt_c49a48e8-f1ac-4568-bc87-0672eb08868b), the message is larger than **CountOfBytesToRead** bytes, and the underlying object store returned STATUS_BUFFER_OVERFLOW (ERRDOS/ERRmoredata), the server MUST respond with a complete SMB_COM_READ response not an error response. Any other error MUST generate an error response message 2. + +Otherwise, the server MUST construct an [SMB_COM_READ Response (section 2.2.4.22.2)](#Section_3f3914f6d25148ab89c035349cb6d1c8) message. + +The response MUST be sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). + +#### Receiving an SMB_COM_WRITE Request + +Upon receipt of an [SMB_COM_WRITE Request (section 2.2.4.12.1)](#Section_861c96cfd6b14fb9b6e31783220813ad), the server MUST perform the following actions: + +- Verify the [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766), which represents an open regular file. If the **Open** is not found in **Server.Connection.FileOpenTable**, the server MUST return an error response with a **Status** of STATUS_INVALID_HANDLE (ERRDOS/ERRbadfid). +- Verify the **UID** as described in section [3.3.5.2](#Section_b09b63d73882458b9c8ec821c706ebdf), and ensure that the user has permission to write to the file. If the user does not have permission to write to the file, the server MUST send an error response with a status of STATUS_ACCESS_DENIED (ERRDOS/ERRnoaccess) and MUST increase **Server.Statistics.sts0_permerrors** by 1. +- If the **UID** presented is different from the **UID** that opened the file, the server MUST send the error response with a **Status** of STATUS_INVALID_HANDLE (ERRDOS/ERRbaduid). +- In the file identified by the FID, the server MUST perform a seek to the offset specified in the **WriteOffsetInBytes** field in the request. +- The server MUST write **CountOfBytesToWrite** bytes sequentially from the **Data** field in the request to the file. Any failure that causes less than **CountOfBytesToWrite** bytes to be written SHOULD result in an error response to the client.[<263>](#Appendix_A_263) +- If the **EstimateOfRemainingBytesToBeWritten** field is nonzero in the request, the server MAY use the value provided to perform implementation-specific optimizations, such as preallocating disk space or preparing additional buffers to receive the remaining data. + +If FID represents a disk file, and the request specifies a byte range beyond the current end of file, the file MUST be extended. If **Offset** is beyond the end of file, the "gap" between the current end of file and **Offset** is filled with null padding bytes. If **CountOfBytesToWrite** is zero, the file is truncated or extended to the length specified by **Offset**. + +In the event of an error, the server MUST send an error response message. Otherwise, the server MUST construct an [SMB_COM_WRITE Response (section 2.2.4.12.2)](#Section_3f68a73ce6d64383b81ad49c2eb4234b) message. The **CountOfBytesWritten** field MUST contain the number of bytes written to the file. This value SHOULD be equal to **CountOfBytesToWrite**. If the number of bytes actually written (**CountOfBytesWritten**) differs from the number of bytes requested to be written (**CountOfBytesToWrite**), and no error is indicated, the server has no resources available with which to satisfy the complete write. + +The response MUST be sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). + +#### Receiving an SMB_COM_LOCK_BYTE_RANGE Request + +Upon receipt of an [SMB_COM_LOCK_BYTE_RANGE Request (section 2.2.4.20.1)](#Section_4652d923dc4e4611b17e9215d8c66f2e), the server MUST verify the **FID** and the **UID** and MUST verify that the user has, at minimum, read permission on the file. + +- The **FID** is verified by performing a looking up in the **Server.Connection.FileOpenTable** to find the corresponding **Open**. If the **Open** is not found, the **FID** is not valid and the server MUST return an error response to the client with a **Status** of STATUS_INVALID_HANDLE (ERRDOS/ERRbadfid). +- The **UID** is validated as described in section [3.3.5.2](#Section_b09b63d73882458b9c8ec821c706ebdf). +- If the user does not have permission to perform a byte range lock, the server MUST return an error response to the client with a **Status** of STATUS_ACCESS_DENIED (ERRDOS/ERRnoaccess) and MUST increase **Server.Statistics.sts0_permerrors** by 1. +- If the UID that is presented is different from the UID that opened the file, the server MUST send the error response with a **Status** of STATUS_INVALID_HANDLE (ERRDOS/ERRbaduid). + +The server MUST then attempt to obtain a byte-range exclusive lock from the underlying object store on a contiguous range of bytes in the file specified by the **FID** in the request starting at **LockOffsetInBytes** and extending for **CountOfBytesToLock** bytes.[<264>](#Appendix_A_264) + +This command is used to explicitly lock a contiguous range of bytes in an open regular file. Locks prevent attempts to lock, read, or write the locked portion of the file by other clients or [**PIDs**](#gt_38a420dd-6f31-456e-ae5c-63ec6905380d) from the same client. + +- Adjacent locks cannot be combined. +- Locks MUST NOT overlap. +- Offsets beyond the current end of file can be locked. Such locks MUST NOT cause allocation of additional file space. +- Locks can be unlocked only by the PID that obtained the lock. + +See [\[FSBO\]](https://go.microsoft.com/fwlink/?LinkId=140636) section 3 for details of byte range lock semantics. + +If the server cannot immediately grant the lock, the server SHOULD[<265>](#Appendix_A_265) reattempt the lock request for a brief interval. In the event of an error, including failure to grant the lock on the byte range, the server MUST send an error response message. If the underlying object store returns STATUS_CANCELLED, the server MUST set **SMB_Header.Status** field of the response to STATUS_FILE_LOCK_CONFLICT (ERRDOS/ERRlock). For any other error, status returned MUST be copied into **SMB_Header.Status** field of the response. The server MUST set **Server.Open.LastFailedLockOffset** to **LockOffsetInBytes** field of the request. + +If the lock is successful, the server MUST construct an [SMB_COM_LOCK_BYTE_RANGE Response (section 2.2.4.13.2)](#Section_f18f498818da4b0786e6a92ceceb4d82) message. The response MUST be sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). An entry for the newly-granted byte-range lock MUST be added to **Server.Open.Locks**. The type of the lock MUST be exclusive, and the entry MUST be formatted with a 32-bit offset (LOCKING_ANDX_RANGE32). The server MUST set **Server.Open.LastFailedLockOffset** to -1. + +#### Receiving an SMB_COM_UNLOCK_BYTE_RANGE Request + +Upon receipt of an [SMB_COM_UNLOCK_BYTE_RANGE Request (section 2.2.4.14.1)](#Section_7d3d2faf84214acc885c805162028764), the server MUST verify the [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) in the request by looking it up in the **Server.Connection.OpenTable** (see section [3.3.5.2](#Section_b09b63d73882458b9c8ec821c706ebdf)). The **FID** and the byte range being unlocked MUST exactly match a range that was previously locked by the same **PID**, and stored as an entry in **Server.Open.Locks**; otherwise, the server MUST send an error response message with status set to STATUS_RANGE_NOT_LOCKED (ERRDOS/ERROR_NOT_LOCKED). See [\[FSBO\]](https://go.microsoft.com/fwlink/?LinkId=140636) section 3 for details of byte range lock semantics.[<266>](#Appendix_A_266) + +If the unlock is successful, the server MUST construct an SMB_COM_UNLOCK_BYTE_RANGE response message as defined in section [2.2.4.14](#Section_3cfce68297d8499b8a2cef000f5d6b26). The response MUST be sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). The server MUST remove the matching entry from the **Server.Open.Locks** list. + +#### Receiving an SMB_COM_CREATE_TEMPORARY Request + +When the server receives an [SMB_COM_CREATE_TEMPORARY Request (section 2.2.4.15.1)](#Section_3dae394e5c4846fc82ea4031995f903c), it MUST verify that the **DirectoryName** passed in the request identifies a directory within the supplied **TID**, verify the **UID** and ensure that the user has the necessary permissions to create a file in the directory. If the underlying [**object store**](#gt_0cc469e1-4b1f-41c4-9f94-d6209fcf468e) returns STATUS_ACCESS_DENIED, the server MUST increase **Server.Statistics.sts0_permerrors** by 1. + +The server MUST then create the file: + +- The name of the newly created file MUST NOT be the same as the name of any other file in the directory; otherwise, the server MUST return an error response with **Status** set to STATUS_OBJECT_NAME_COLLISION (ERRDOS/ERRfilexists). +- The creation time of the file MAY be set to the value of the **CreationTime** field in the request. +- The file is opened for read/write in Compatibility Mode (see section [3.2.4.5.1](#Section_9a45e9e773774da199d6d66d97532550)). + +If the command is successful, the server MUST increase **Server.Statistics.sts0_fopens** by 1 and MUST allocate an **Open** object and insert it into **Server.Connection.FileOpenTable** with the following default values: + +- A new **FID** MUST be created to uniquely identify this **Open** in **Server.Connection.FileOpenTable**. +- If **Server.EnableOplock** is TRUE and a requested OpLock was granted, the type of OpLock MUST be set in **Server.Open.OpLock** and **Server.Open.OplockState** MUST be set to **Held**; otherwise, **Server.Open.OpLock** MUST be set to **None** and **Server.Open.OplockState** MUST be set to **None**.[<267>](#Appendix_A_267) +- **Server.Open.TreeConnect** MUST be set to the **TreeConnect** on which the open request was performed, and **Server.Open.TreeConnect.OpenCount** MUST be increased by 1. +- The server MUST construct an [SMB_COM_CREATE_TEMPORARY Response (section 2.2.4.15.2)](#Section_763af5c574bf43c6b410e48c79b08f57) message. +- **Server.Open.Session** MUST be set to **Server.Open.TreeConnect.Session**. +- **Server.Open.Connection** MUST be set to the **Server.Open.Session.Connection**. +- **Server.Open.Locks** MUST be set to an empty list. +- **Server.Open.PID** MUST be set to the **PID** provided in the request. +- **Server.Open.PathName** MUST be set to the name of the newly created file. +- **Server.Open.GrantedAccess** MUST be set to (GENERIC_READ | GENERIC_WRITE). + +The server MUST register the **Open** by invoking the event Server Registers a New Open ([\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 3.1.6.4) and MUST assign the return value to **Server.Open.FileGlobalId**. + +If an error occurred, the server MUST send an error response message. + +The response MUST be sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). + +#### Receiving an SMB_COM_CREATE_NEW Request + +This command is used to create a new file. It MUST NOT truncate or overwrite an existing file. If a file with the requested pathname already exists within the share represented by the **TID**, the command MUST fail with STATUS_OBJECT_NAME_COLLISION (ERRDOS/ERRfilexists). This command MUST be used only to create regular files. + +When the server receives an [SMB_COM_CREATE_NEW Request](#Section_2e4852f086724d62984842f931b91533), it MUST verify the **TID** and the directory path portion of the **FileName** field. The server MUST verify the **UID** and ensure that the user has write permission on the file's parent directory in order to create a new file. If the underlying [**object store**](#gt_0cc469e1-4b1f-41c4-9f94-d6209fcf468e) returns STATUS_ACCESS_DENIED, the server MUST increase **Server.Statistics.sts0_permerrors** by 1. If the file is created successfully, it is opened for read/write access in Compatibility Mode (see section [3.2.4.5.1](#Section_9a45e9e773774da199d6d66d97532550)). + +If the command is successful, the server MUST increase **Server.Statistics.sts0_fopens** by 1 and MUST allocate an **Open** object and insert it into **Server.Connection.FileOpenTable** with the following default values: + +- A new [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) MUST be created to uniquely identify this **Open** in **Server.Connection.FileOpenTable**. +- If **Server.EnableOplock** is TRUE and a requested OpLock was granted, the type of OpLock MUST be set in **Server.Open.OpLock** and **Server.Open.OplockState** MUST be set to **Held**; otherwise, **Server.Open.OpLock** MUST be set to **None** and **Server.Open.OplockState** MUST be set to **None**. +- **Server.Open.TreeConnect** MUST be set to the **TreeConnect** on which the open request was performed, and **Server.Open.TreeConnect.OpenCount** MUST be increased by 1. +- **Server.Open.Session** MUST be set to **Server.Open.TreeConnect.Session**. +- **Server.Open.Connection** MUST be set to the **Server.Open.Session.Connection**. +- **Server.Open.Lock**s MUST be set to an empty list. +- **Server.Open.PID** MUST be set to the **PID** provided in the request. +- **Server.Open.PathName** MUST be set to the **FileName** field of the request. +- **Server.Open.GrantedAccess** MUST be set to (GENERIC_READ | GENERIC_WRITE). + +The server MUST register the **Open** by invoking the event Server Registers a New Open ([\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 3.1.6.4) and MUST assign the return value to **Server.Open.FileGlobalId**. + +The server MUST construct an [SMB_COM_CREATE_NEW Response (section 2.2.4.16.2)](#Section_060b7ffa0b944cdd833a9ef3053c5931) message and return the newly-created **FID**.[<268>](#Appendix_A_268) + +If an error occurred, the server MUST send an error response message. + +The response MUST be sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). + +#### Receiving an SMB_COM_CHECK_DIRECTORY Request + +When a server receives an [SMB_COM_CHECK_DIRECTORY Request (section 2.2.4.17.1)](#Section_dc566429904b4bf58158d68f2370ae68), it MUST verify that **DirectoryName** points to a valid directory. The user indicated by the **UID** MUST have read access to the directory path. If the user does not have read access to the directory path, the server MUST return an error response with status of STATUS_ACCESS_DENIED (ERRDOS/ERRnoaccess) and MUST increase **Server.Statistics.sts0_permerrors** by 1. + +If **DirectoryName** points to a valid directory, the server MUST construct an [SMB_COM_CHECK_DIRECTORY Response (section 2.2.4.17.2)](#Section_b99f80c3fbfc4f5b95d567b62244de89) message with a **Status** indicating success. Otherwise, the server MUST send an error response with a **Status** of STATUS_OBJECT_PATH_NOT_FOUND (ERRDOS/ERRbadpath). See the error code list in section 2.2.4.17.2 for additional error conditions.[<269>](#Appendix_A_269) + +The response MUST be sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). + +#### Receiving an SMB_COM_PROCESS_EXIT Request + +When the server receives an [SMB_COM_PROCESS_EXIT Request (section 2.2.4.18.1)](#Section_bb004a1834b647f3a1d1f1dfe441a222), it MUST: + +- Enumerate all of the [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766)s in **Server.Connection.FileOpenTable** that were opened by the **PID** indicated in the request header. For each FID: + - The server MUST release all locks held on the FID. + - The server MUST release OpLocks by closing the **Open** represented by each FID [<270>](#Appendix_A_270) and MUST decrease **Open.TreeConnect.OpenCount** and **Server.Statistics.sts0_fopens** by 1 for each FID. + - The server MUST invalidate the FID by removing the **Open** entry from **Server.Connection.FileOpenTable**. + - The server MUST provide the corresponding **Open.FileGlobalId** as an input parameter and MUST deregister the **Open** by invoking the event Server Deregisters an Open ([\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 3.1.6.5). +- Enumerate all of the Search IDs (SID)s in the **Server.Connection.SearchOpenTable** that were opened by the **PID** indicated in the request header. For each **SID**: + - The server MUST close the search indicated by the **SID**. + - The server MUST invalidate the **SID** by removing the **SearchOpen** entry from **Server.Connection.SearchOpenTable**. + +The server MUST search the **Server.Connection.PendingRequestTable** for any pending commands that have the same **UID**, **TID**, **PID**, and **MID** as presented in the request. If the [**SMB transport**](#gt_f8b0f8a6-e412-459a-b8ba-219008e5bcd7) is connectionless, the header **CID** field value SHOULD[<271>](#Appendix_A_271) also be used. For each matching entry, the server MUST abort the pending operation. The client process that made the aborted command request no longer exists to receive the response. + +If the Process Exit operation completes successfully, the server MUST construct an SMB_COM_PROCESS_EXIT response message as specified in section [2.2.4.18.2](#Section_343fc70452db48a5b999439e134c1c9d). The **Status** returned MUST indicate success. Otherwise, the server MUST send an error response. + +The response MUST be sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). + +#### Receiving an SMB_COM_SEEK Request + +Upon receipt of an [SMB_COM_SEEK command Request (section 2.2.4.19.1)](#Section_e9dd996cba2b474bae5d5f65c3be1251), the server MUST first validate the **FID** in the request. If the **FID** is valid, the server MUST update the file pointer associated with the **FID** according to the instructions in the [SMB_COM_SEEK Request (section 2.2.4.19.2)](#Section_089b214b85014bcba9bd9b2aa80b0042). The new offset is returned in the response. The SMB_COM_SEEK Response message MUST be constructed. If an error was generated by the request, the server MUST send an error response. + +The **Offset** field in the [SMB_COM_SEEK (section 2.2.4.19)](#Section_80846ca98b50418385c601c4e586227e) request and response is a 32-bit value. If the CAP_LARGE_FILES capability has been negotiated, then 64-bit offsets are supported. The server MUST return only the lower order 32 bits of the actual 64-bit offset.[<272>](#Appendix_A_272) + +The response MUST be sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). + +#### Receiving an SMB_COM_LOCK_AND_READ Request + +When the server receives an [SMB_COM_LOCK_AND_READ Request (section 2.2.4.20.1)](#Section_4652d923dc4e4611b17e9215d8c66f2e), if the request is on a [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca), the server MUST fail the request with an NT status code of STATUS_INVALID_DEVICE_REQUEST (0xC0000010); otherwise, the server MUST treat the request as if it is an [SMB_COM_LOCK_BYTE_RANGE Request (section 2.2.4.13.1)](#Section_0828263608764ded82b1973edd255f87) followed by an [SMB_COM_READ Request (section 2.2.4.11.1)](#Section_23704aa0e6d247628dfde8eeaacca71b). Processing MUST proceed as specified in sections [3.3.5.15](#Section_e046e927ee0241b390766fe50ffb417a) and [3.3.5.13](#Section_b4de39e5fda0450589e32bb0f7c4503e), with the following exceptions: + +- Their triggering requests will be the SMB_COM_LOCK_AND_READ Request of this event. +- If processing results in an error during the process specified in section 3.3.5.15, the server MUST construct an SMB_COM_LOCK_AND_READ (section 2.2.4.20.1) error response and MUST NOT continue to the process indicated in section 3.3.5.13. +- If processing results in an error during the process specified in section 3.3.5.13, the server MUST construct an SMB_COM_LOCK_AND_READ Request error response. +- The server MUST construct an [SMB_COM_LOCK_AND_READ Response (section 2.2.4.20.2)](#Section_ac41df92de514d2d935a7eae93ae9bcc) instead of the messages indicated in 3.3.5.15 and 3.3.5.13. +- The response fields MUST be populated with the data that would go in the corresponding fields of both SMB_COM_LOCK_BYTE_RANGE Request (section 2.2.4.13.1) and [SMB_COM_READ Response (section 2.2.4.11.2)](#Section_bc54fec83e8a4c05bbe911ed116d1d67) messages. + +An entry for the newly-granted byte-range lock MUST be added to **Server.Open.Locks**. The type of the lock MUST be exclusive, and the entry MUST be formatted with a 32-bit offset (LOCKING_ANDX_RANGE32).[<273>](#Appendix_A_273) + +The response MUST be sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). + +#### Receiving an SMB_COM_WRITE_AND_UNLOCK Request + +The [SMB_COM_WRITE_AND_UNLOCK (section 2.2.4.21)](#Section_5006049ae39b4dac83f20ec64c731c9c) command combines the behavior of [SMB_COM_WRITE (section 2.2.4.12)](#Section_5f3ebf6a5d0643ee9429c8cc1b58eef5) with that of [SMB_COM_UNLOCK_BYTE_RANGE (section 2.2.4.14)](#Section_3cfce68297d8499b8a2cef000f5d6b26). SMB_COM_WRITE_AND_UNLOCK (section 2.2.4.21) is intended to be paired with [SMB_COM_LOCK_AND_READ (section 2.2.4.20)](#Section_88a423e782324b22904dd9e6cc0a226e) to perform record updates to a file. + +The **FID** provided in the command request MUST indicate a file held open by the client with, at minimum, write access. The server MUST first perform the write operation and then release the lock. The bytes to be written are passed in the **Data** field of the request, and MUST be written starting at the file position indicated by the **WriteOffsetInBytes** field. Once the data has been successfully written, the server MUST attempt to unlock the byte range specified by **WriteOffsetInBytes** (offset) and **CountOfBytesToWrite** (length).[<274>](#Appendix_A_274) + +It is possible that the actual number of bytes available in the request, as indicated by the **DataLength** field, is less than **CountOfBytesToWrite**. If this occurs, the server MUST write **DataLength** bytes from the **Data** field to the file indicated by the [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) starting at the position indicated by **WriteOffsetInBytes**. When the byte range is unlocked, however, the full range as specified by **WriteOffsetInBytes** and **CountOfBytesToWrite** MUST be unlocked. + +In the event of an error, the server MUST send an error response message. If the write and unlock are successful, the server MUST construct an SMB_COM_WRITE_AND_UNLOCK response message as specified in section [2.2.4.21.2](#Section_6d09be2358ea4966b1be86f27c8ea45a). The response MUST be sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697) The server MUST remove the matching entry from the **Server.Open.Locks** list. + +#### Receiving an SMB_COM_READ_RAW Request + +Upon receipt of an [SMB_COM_READ_RAW Request (section 2.2.4.22.1)](#Section_1458b62a18ed4fb2b8a9ceabffb2c3b7) from the client, the server MUST verify that the **Server.Capabilities** include CAP_RAW_MODE, and that **Connection.IsSigningActive** is FALSE (no SMB frame is sent in the response; therefore, this command is not compatible with SMB signing). If those conditions are met, the server MUST also verify the **FID** and the **UID** and MUST verify that the user has, at minimum, read permission on the file, [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca), or device indicated by the **FID**. If any of these conditions is not met, the server MUST send a zero-length reply over the [**SMB transport**](#gt_f8b0f8a6-e412-459a-b8ba-219008e5bcd7) to indicate failure of the request. + +The server response to an SMB_COM_READ_RAW request is not a standard SMB response. Instead, the server sends raw data to the client via the underlying transport. The server relies upon the transport to ensure that the data is transferred in sequence; that the entire message is sent contiguously; that transmission errors are detected; and that the number of bytes transferred is reported to the receiving client. + +Because there is no [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) included in the response, there is no mechanism for reporting specific errors. If an error occurs, the server MUST send a zero-length response to the client via the SMB transport. A zero-length reply can also indicate that the requested offset is at or beyond end of file (EOF) and that no bytes are available to be returned. The client can then use a different [**SMB command**](#gt_dbae2612-173d-4988-9301-86cb559029f9) to perform a Read. The alternate Read request either fails, providing the client with an actionable status code, or it succeeds, allowing the client to read the data that it had originally attempted to read. + +If the server receives an SMB_COM_READ_RAW request after having sent an OpLock Break Notification to the client and is actively waiting for the client's response to the OpLock Break Notification, the server MUST send a zero-length reply. The server might then re-issue the OpLock Break Notification. This is done because the OpLock Break Notification sent by the server can arrive at the client after the client has issued the SMB_COM_READ_RAW request. In this situation, the client could mistake the OpLock Break Notification request for the Raw Read response. See Receiving Any OpLock Break Notification (section [3.2.5.42](#Section_4b44b6339447458382557e32942bfc86)) for steps that the client MUST take to handle this situation. + +If there are no errors and the **FID** indicates a regular file, processing is as follows: + +- The server MUST attempt to read from the underlying object store for the file indicated by the **FID** in the response. It MUST start reading from the file at the offset indicated by the **Offset** field in the request, or by the combination of **Offset** and **OffsetHigh** if CAP_LARGE_FILES was negotiated. The client MUST read **MaxCountOfBytesToReturn** bytes or until EOF, whichever comes first.[<275>](#Appendix_A_275) +- If the offset is at or beyond EOF, the server MUST send a zero-length message to the client via the SMB transport. +- If the client requests to read more bytes than the file contains, or to read beyond EOF, the number of bytes returned by the server message MUST be the number of bytes actually read from the file. A response message containing fewer bytes than were requested from a regular file indicates that EOF was encountered. + +If there are no errors, and the **FID** indicates a named pipe or device, the following additional processing applies: + +- The offset value is used only if it is relevant to the object from which the data is read. +- If the **Timeout** value is -1 (0xFFFFFFFF, "wait forever") or the server does not implement **Timeout** processing,[<276>](#Appendix_A_276) the server SHOULD wait until there are at least **MinCountOfBytesToReturn** bytes of data read from the device before returning a response to the client. +- If the **Timeout** value is -2 (0xFFFFFFFE, "default"), the server SHOULD wait for the default time-out associated with the named pipe or I/O device. +- If the **Timeout** value is zero and no data is currently available, the server SHOULD send a successful response with the **DataLength** field set to zero. +- Otherwise, the server SHOULD wait to send the response until either **MinCountOfBytesToReturn** or more bytes of data become available or the **Timeout** in milliseconds elapses. If **Timeout** elapses before **MinCountOfBytesToReturn** bytes are read, the server SHOULD send a response with an error status indicating that the **Timeout** occurred and SHOULD also respond with any bytes already read. + +The server MUST NOT respond as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). The server MUST add the total number of bytes in the message to the **Server.Statistics.sts0_bytessent_low** and **Server.Statistics.sts0_bytessent_high** abstract data model elements (section [3.3.1.1](#Section_2b4f1d5c442a4ed4a4518a986351c5a9)). The server MUST respond by sending the bytes read to the client via the SMB transport. + +#### Receiving an SMB_COM_READ_MPX Request + +CIFS permits the use of the [SMB_COM_READ_MPX (section 2.2.4.23)](#Section_9688c7181f3543f280c530d8a59ac305) command over connectionless transports only. SMB message signing is not supported over connectionless transports. + +Upon receiving an [SMB_COM_READ_MPX Request (section 2.2.4.23.1)](#Section_3e066ba09fce43c785fd756e4721f7ee), the server MUST validate the **FID** and **UID** to ensure that the client has sufficient privilege to read the file. If no errors occur, the server MUST then attempt to read from the underlying object store for the file indicated by the **FID** of the request.[<277>](#Appendix_A_277) + +As is true in SMB_COM_READ, the total number of bytes returned can be less than the number requested only if a read specifies bytes beyond the current file size, and [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) refers to a disk file. In this case, the server MUST return only the bytes that exist. A read that begins at or beyond the end of file MUST result in a single response with a zero value in **Count**. If the total number of bytes returned is less than the number of bytes requested, this indicates end of file (if reading other than a standard blocked disk file, only zero bytes returned indicates end of file). + +Once started, the Read Block Multiplexed operation MUST run to completion. The client MUST receive all of the responses generated by the server. Conflicting commands (such as file close) MUST NOT be sent to the server while a multiplexed operation is in progress. + +Server support of this command is optional.[<278>](#Appendix_A_278) + +If the read request was made to a named pipe or I/O device, the following additional rules apply: + +- If the **Timeout** value is -1 (0xFFFFFFFF, "wait forever") or the server does not implement **Timeout** processing,[<279>](#Appendix_A_279) the server SHOULD wait until there are at least **MinCountOfBytesToReturn** bytes of data read from the device before returning a response to the client. +- If the **Timeout** value is -2 (0xFFFFFFFE, "default"), the server SHOULD wait for the default time-out associated with the named pipe or I/O device. +- If the **Timeout** value is zero and no data is currently available, the server SHOULD send a successful response with the **DataLength** field set to zero. +- Otherwise, the server SHOULD wait to send the response until either **MinCountOfBytesToReturn** or more bytes of data become available or the **Timeout** in milliseconds elapses. If **Timeout** elapses before **MinCountOfBytesToReturn** bytes are read, the server SHOULD send a response with an error status indicating that the **Timeout** occurred and SHOULD also respond with any bytes already read. + +If an error is detected, the server MUST send a single error response message to the client. Otherwise, the server MUST respond to the request with one or more SMB_COM_READ_MPX response messages (constructed as specified in section [2.2.4.23.2](#Section_4511aa9b411b44f7814339f2ca6dcd5f)) until the requested amount of data has been returned or an error occurs. Each server response MUST contain the **PID** and **MID** of the original client request, as well as the **Offset** and **Count** describing the returned data. The client has received all of the data bytes when the sum of the **DataLength** fields received in each response equals the total amount of data bytes expected (smallest **Count** received). This allows the protocol to work even if the responses are received out of sequence. + +The response MUST be sent to the client as described in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697), with the exception that SMB signing and connectionless protocols are mutually exclusive. + +#### Receiving an SMB_COM_WRITE_RAW Request + +Upon receipt of an [SMB_COM_WRITE_RAW Request (section 2.2.4.25.1)](#Section_1ff2a25fefe2470ca780b06ef46c4089) from the client, the server MUST verify that the **Server.Capabilities** include CAP_RAW_MODE, and that **Connection.IsSigningActive** is FALSE. If those conditions are met, the server MUST also verify the following: + +- [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) MUST be valid. +- **UID** MUST be valid, and the user MUST have, at minimum, write permission on the file, named pipe, or device indicated by the FID. +- **DataLength** MUST be less than or equal to **CountOfBytes**. +- The number of bytes provided in the **SMB_Data.Bytes.Data** field MUST be equal to **DataLength**. + +If an error is detected when verifying any of the fields listed above (or when performing any other basic validation of the message), the Write Raw operation MUST fail and the server MUST return a Final Server Response, as described in section [2.2.4.25.3](#Section_f767334e77244f41b5df31b56d3b4328), with the **Count** field set to zero (0x0000). + +If the **DataOffset** field value is less than the offset of **SMB_Data.Bytes.Data**, or if the **DataOffset** field value is greater than the offset of the **SMB_Data.Bytes.Data** + **SMB_Parameters.Words.DataLength**, the server SHOULD[<280>](#Appendix_A_280) fail the request with STATUS_INVALID_SMB. + +If the server has no resources available to process the Raw Mode portion of the command (implementation-dependent), the server MUST fail the command. The server can first write the initial data provided in the request. Whether or not the initial data is written, the server MUST return a Final Server Response message with a **Status** of STATUS_SMB_USE_STANDARD (ERRSRV/ERRusestd) and a **Count** set to the number of bytes written, which can be zero (0x0000).[<281>](#Appendix_A_281) + +If the write request was made to a named pipe or I/O device, the following additional rules apply: + +- If the **Timeout** value is -1 (0xFFFFFFFF, "wait forever") or the server does not implement **Timeout** processing,[<282>](#Appendix_A_282) then the server SHOULD wait until **DataLength** bytes have been written to the device before returning a response to the client. +- If the **Timeout** value is -2 (0xFFFFFFFE, "default") the server SHOULD wait for the default time-out associated with the named pipe or I/O device. +- If the **Timeout** value is zero, the write SHOULD NOT block. +- Otherwise, the server SHOULD wait to send the response until either **DataLength** bytes are written to the device or the **Timeout** in milliseconds elapses. If **Timeout** is greater than zero and it elapses before **DataLength** bytes are written, the server SHOULD send a response with an error status indicating that the time-out occurred and SHOULD also include the count of bytes written. + +If validation of the request is successful, and there are sufficient resources available to process the request, the server MUST attempt to write the initial data provided in the SMB_COM_WRITE_RAW request. + +If the initial write operation succeeds and there is no additional data to be sent (**CountOfBytes** and **DataLength** are equal in the request), the server MUST send a Final Server Response indicating success, with the **Count** field set to the number of bytes that were written (the same as **CountOfBytes** and **DataLength**).[<283>](#Appendix_A_283) + +If the initial write operation succeeds and additional data is pending (**CountOfBytes** greater than **DataLength)**, the server MUST send an Interim Server Response as shown in section [2.2.4.25.2](#Section_d115b1d2149242aab37f222bfe272fbd). If, however, the initial write operation fails, the server MUST return a Final Server Response. The Final Server Response MUST return a **Status** value indicating the cause of the error and a **Count** field set to the number of bytes successfully written. If the Interim Server Response was sent, the client MUST send any additional data in Raw Mode (meaning, the data to be written to the file MUST be written directly to the [**SMB transport**](#gt_f8b0f8a6-e412-459a-b8ba-219008e5bcd7) for delivery to the server). The server MUST forward the raw data to the file, named pipe, or device indicated by the FID. The client can send less than the number of bytes expected (**CountOfBytes** minus **DataLength**). In that case, the server MUST write only the data sent. The client MUST NOT send more bytes than expected in Raw Mode. + +As described above, if an error is detected prior to sending the Interim Server Response, then a Final Server Response MUST be sent to indicate the error and provide the count of the number of bytes successfully written. Once the Interim Server Response has been sent, the setting of the **WritethroughMode** bit in the **WriteMode** field of the original request determines whether or not a Final Server Response is sent to complete the Write Raw operation. + +- If **WritethroughMode** is set, a Final Server Response is expected following the transfer of raw data from the client. The server MUST complete writing the raw data to its final destination (file, named pipe, or device) and then MUST return the Final Server Response, indicating any errors as well as the total number of bytes written. +- If **WritethroughMode** is clear, the server can perform write-behind. The Final Server Response MUST NOT be sent, even if an error occurs. The server MUST store the error and return it on the next access to the FID. When the client has completed sending the raw write data, it can continue normal operation. + +Raw mode transfers are not supported on connectionless transports. + +The interim and final response messages MUST be sent to the client as described in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697), with the exception that SMB signing is not supported for raw mode commands. + +#### Receiving an SMB_COM_WRITE_MPX Request + +Upon receipt of an [SMB_COM_WRITE_MPX Request (section 2.2.4.26.1)](#Section_c7fa0e9f343b47df8157719a3ca9035c), the server MUST validate the following fields: + +- **TID**: The tree ID MUST indicate a connected disk share. +- **UID**: The user ID MUST indicate an active SMB session. The **UID** MUST be listed in **Server.Connection.SessionTable**. +- **CID**: The [**SMB transport**](#gt_f8b0f8a6-e412-459a-b8ba-219008e5bcd7) MUST be connectionless, and the Connection ID field MUST be valid for the transport. +- [**PID**](#gt_38a420dd-6f31-456e-ae5c-63ec6905380d) and **MID**: These are used to identify a single Write MPX operation that can consist of multiple Write MPX request messages. +- **SequenceNumber**: This field MUST be zero for all but the final Write MPX request sent in the operation. The requests can arrive in any order. +- **SMB_Parameters.Words.FID**: Indicates the file to which the transmitted data is to be written. The **FID** MUST represent a regular file or a printer spool file. + +The **TID**, **UID**, PID, **MID**, and **CID** values MUST be the same for all [SMB_COM_WRITE_MPX (section 2.2.4.26)](#Section_ab9a94409c2249fd859e2fd81c57e9d9) messages sent as part of the same operation. The [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) MUST be the same for all SMB_COM_WRITE_MPX Request messages sent as part of the same operation. + +The server MUST rely on the SMB transport to determine whether each client request was successfully received. If the transport indicates an error on the receipt of the request, the request MUST be discarded. If this SMB command request is received over a connection-oriented transport, the server MUST respond immediately with an error response; the error code MUST be STATUS_SMB_USE_STANDARD (ERRSRV/ERRusestd). + +When the server receives the first SMB_COM_WRITE_MPX in a Write MPX exchange, it MUST initialize the **Server.Open.MpxMask** that it returns to the client to zero (0x00000000). + +For each request received as part of the SMB_COM_WRITE_MPX operation, the server MUST attempt to write the data in the **SMB_Data.Bytes.Buffer** field to the file indicated by FID at the location indicated by **SMB_Parameters.Words.ByteOffsetToBeginWrite**. If the write is successful, the **Server.Open.MpxMask** is updated by performing a bitwise OR with the **RequestMask** in the request. The result is stored in **Server.Open.MpxMask**: + +**Server.Open.MpxMask** |= **RequestMask** + +When the server receives an SMB_COM_WRITE_MPX request that has a nonzero **SequenceNumber** in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f), the server takes one of two actions: + +- If **WritethroughMode** is set, the server writes all of the accumulated data and ensures (if possible) that the data is flushed to disk. **ResponseMask** MUST be set to **Server.Open.MpxMask**. The server then returns the [SMB_COM_WRITE_MPX Response (section 2.2.4.26.2)](#Section_25efbb005ad042a2886199a79c4d63fe). The **ResponseMask** indicates the set of SMB_COM_WRITE_MPX messages in this exchange that were received by the server. +- If **WritethroughMode** is clear, the server responds immediately and sets **ResponseMask** as **Server.Open.MpxMask**; write operations that are in-progress complete asynchronously. + +The client MUST resend any SMB_COM_WRITE_MPX requests that were not indicated as having been received in the **ResponseMask**. The last message resent MUST have the same nonzero **SequenceNumber** in the SMB Header as was previously used in this exchange. The server, once again, responds with an SMB_COM_WRITE_MPX Response containing the cumulative **ResponseMask**. This process continues until all request messages in the exchange have been acknowledged. + +The SMB_COM_WRITE_MPX Response messages MUST be sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697), with the exception that SMB signing is not supported over connectionless transports. + +#### Receiving an SMB_COM_QUERY_INFORMATION2 Request + +Upon receiving an [SMB_COM_QUERY_INFORMATION2 Request (section 2.2.4.31.1)](#Section_7b86f7999dbb407893c5f9041c7f9f47) from the client, the server MUST validate the [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) provided by looking up the **FID** in **Server.Connection.FileOpenTable**. The FID MUST indicate a regular file. If an error occurs, an error response message MUST be generated. If an open is found and **Open.GrantedAccess** does not include FILE_READ_ATTRIBUTES access, the server MUST send an error response with a status of STATUS_ACCESS_DENIED (ERRDOS/ERRnoaccess) and MUST increase **Server.Statistics.sts0_permerrors** by 1. If the UID presented is different from the UID that opened the file, the server MUST send the error response with a **Status** of STATUS_INVALID_HANDLE (ERRDOS/ERRbaduid). Otherwise, the server MUST obtain the required attribute information, as listed in section [2.2.4.31.2](#Section_eed3d7c3759e470a873110583931426f). The SMB_COM_QUERY_INFORMATION2 response MUST be formatted as described in that section, and the response messages MUST be sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697).[<284>](#Appendix_A_284) + +#### Receiving an SMB_COM_SET_INFORMATION2 Request + +Upon receiving an [SMB_COM_SET_INFORMATION2 Request (section 2.2.4.30.1)](#Section_de521278f8004a57b5244811fe9edd8f), the server MUST validate the [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) by looking up the FID in **Server.Connection.FileOpenTable**, which MUST indicate a regular file. The **UID** MUST be used to find the **Server.Session.UserSecurityContext**, which MUST have sufficient privilege to set file attribute information. If the user does not have sufficient privileges, the server MUST send an error response with a status of STATUS_ACCESS_DENIED (ERRDOS/ERRnoaccess) and MUST increase **Server.Statistics.sts0_permerrors** by 1. If the UID presented is different from the UID that opened the file, the server MUST send the error response with a **Status** of STATUS_INVALID_HANDLE (ERRDOS/ERRbaduid). + +The server MUST attempt to set the attribute on the file indicated by the FID. If an error is detected, the **Status** field of the response MUST be set to the error; otherwise, **Status** MUST be set to success. The response messages MUST be sent to the client as described in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697).[<285>](#Appendix_A_285) + +#### Receiving an SMB_COM_LOCKING_ANDX Request + +Upon receiving an [SMB_COM_LOCKING_ANDX Request (section 2.2.4.32.1)](#Section_b5c6eae7976b4444b52ec76c68c861ad), the server MUST validate the **FID** and **PID** by finding a matching **Server.Open** entry in the **Server.Connection.FileOpenTable** and a **Server.SMBRequest** entry in the **Server.Connection.PendingRequestsTable**, respectively. + +SMB_COM_LOCKING_ANDX Request is processed in three parts, all of which are executed: + +- If **NumberOfRequestedUnlocks** is nonzero, the **Unlocks** array contains **NumberOfRequestedUnlocks** entries. Each entry requests that a lock be released.[<286>](#Appendix_A_286) +- If **NumberOfRequestedLocks** is nonzero, the **Locks** array contains **NumberOfRequestedLocks** entries. Each entry requests the acquisition of a lock.[<287>](#Appendix_A_287) +- If the OPLOCK_RELEASE flag is set in the **TypeOfLock** field of the request, the request is an OpLock Break Request sent by the client in response to an OpLock Break Notification from the server. The server MUST release the OpLock on the **Open**, after which it MUST allow pending operations that were waiting for the OpLock release to proceed, in an implementation-specific fashion.[<288>](#Appendix_A_288) The server MUST set **Server.Open.Oplock** to **NONE** and MUST set **Server.Open.OplockState** to **NONE**. + +The release or creation of a byte-range lock MUST follow these rules: + +- Overlapping locks are not allowed. +- Offsets beyond the current end of file can be locked; the server MUST NOT allocate additional file space as a result of such locks. +- The server MUST NOT allow a range to be unlocked by any **PID** other than the **PID** that performed the lock. If the **PID** in the unlock request does not match **Server.Open.Locks** in the **Open**, the server MUST send an error response message with status set to STATUS_RANGE_NOT_LOCKED (ERRDOS/ERROR_NOT_LOCKED). See [\[FSBO\]](https://go.microsoft.com/fwlink/?LinkId=140636) section 3 for details of byte range lock semantics. +- All locks are held based upon the **FID** used to create the lock. That is, any process (**PID**) using the **FID** specified in the creation of the lock has access to the locked bytes. If the lock is an exclusive lock, other **FID**s indicating a separate **Open** of the same file MUST be denied access to the same bytes. If the lock is a shared read lock, other **FID**s indicating a separate **Open** of the same file MUST be denied write access to the same bytes. + +The release of an OpLock follows these rules: + +- If there are no outstanding OpLock breaks, or if the [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) in the request does not match the FID of an outstanding OpLock Break Notification, then no OpLock is released. This does not generate an error. +- If **NumberOfRequestedUnlocks** and **NumberOfRequestedLocks** are both zero (0x0000) in the SMB_COM_LOCKING_ANDX Request, the server MUST NOT send an [SMB_COM_LOCKING_ANDX Response (section 2.2.4.32.2)](#Section_165cd91f1207419ebb62eb305ea9a67a). +- Note that **NumberOfRequestedUnlocks** SHOULD always be zero (0x0000) in an OpLock Break Request, because an OpLock is an exclusive file lock. A client holding an OpLock on a file has no need to request byte-range locks from the server. There SHOULD, therefore, be no existing byte-range locks to be unlocked by the OpLock Break Request message. No error is generated by a nonzero **NumberOfRequestedUnlocks** value in an OpLock Break Request.[<289>](#Appendix_A_289)[<290>](#Appendix_A_290) + +Locking a range of bytes SHOULD[<291>](#Appendix_A_291) fail with STATUS_LOCK_NOT_GRANTED(ERRDOS/ERRlock) if any subranges or overlapping ranges are locked, even if they are currently locked by the **PID** requesting the new lock. + +This client request is atomic. If any of the lock ranges times out because the area to be locked is already locked, or the lock/unlock request otherwise fails, the lock state of the file MUST NOT be changed. + +The server response indicates only success or failure. If failure, the response message is an error response, including the status code indicating the cause of the failure. The response messages MUST be sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). + +For each byte-range lock that is granted, an entry MUST be added to **Server.Open.Locks**. The type of the lock MUST match the type indicated in the **TypeOfLock** field. If the LARGE_FILES bit of the **TypeOfLock** field is set, the entry MUST be formatted as a LOCKING_ANDX_RANGE64; otherwise, it MUST be formatted as a LOCKING_ANDX_RANGE32. + +For each byte-range lock that is released, the corresponding entry in **Server.Open.Locks** MUST be removed. + +#### Receiving an SMB_COM_TRANSACTION Request + +The SMB_COM_TRANSACTION is processed as specified in sections [3.3.5.2.5](#Section_bad91cd11c6345c682578b0ef25269de) and [3.3.5.57](#Section_421617c6f5994041a042d63ab081c354). Additionally, the server MUST validate the contents of the **SMB_DATA.Bytes.Name** field. The subcommand transported by the transaction is interpreted based upon the object receiving the message. + +#### Receiving an SMB_COM_IOCTL Request + +Upon receipt of an SMB_COM_IOCTL request, the server MUST verify that the [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) is valid (by locating an **Open** with a matching **Open.FID** in the **Server.Connection.FileOpenTable**). The **UID** MUST indicate a **Server.Session.UserSecurityContext** with sufficient permission to perform the IOCTL. The IOCTL request MUST be unpacked as specified in section [2.2.4.35.1](#Section_c8f1b5b19ec149d2a0e178ee88f39e71), and the server MUST call the IOCTL function indicated by the **Category** and **Function** fields in the request.[<292>](#Appendix_A_292) + +If the IOCTL is successful, the server MUST construct an SMB_COM_IOCTL response message as specified in section [2.2.4.35.2](#Section_27cb85fe071a41aa9068317720909892). The response MUST be sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). + +#### Receiving an SMB_COM_ECHO Request + +When the server receives an [SMB_COM_ECHO Request (section 2.2.4.39.1)](#Section_5dd916b29c384f0cba55a2c86dd5de10), message handling proceeds as follows: + +The value of the **TID** field MUST be either a valid **TID** (see section [3.3.5.2](#Section_b09b63d73882458b9c8ec821c706ebdf)) or 0xFFFF.[<293>](#Appendix_A_293) + +If **EchoCount** is zero, a response MUST NOT be sent. If **EchoCount** is nonzero, the server SHOULD reply with the requested number of responses. The server MAY enforce any nonzero limit in the number of responses that it returns. + +The server MUST construct an SMB_COM_ECHO response message as specified in section [2.2.4.39](#Section_8c85435267c647f7a60da6c87b6b3aac) and initialize it as follows: + +- The **SMB_Parameters.Words.SequenceNumber** field MUST be set to 1. +- The **SMB_Data.Bytes.Data** field MUST be the same as that received in the request. + +While **SMB_Parameters.Words.SequenceNumber** is less than or equal to **EchoCount**: + +- The response MUST be sent to the client as described in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). +- The **SMB_Parameters.Words.SequenceNumber** field MUST be incremented. + +Note that **SMB_Parameters.Words.SequenceNumber** is not the signing sequence number. If signing is enabled, each outgoing Echo response message is signed individually. The same signing sequence number, provided by the **Server.Connection.ServerSendSequenceNumber** table, is used for all Echo response messages to the same Echo request. + +If the server receives an [SMB_COM_NT_CANCEL Request (section 2.2.4.65.1)](#Section_e4f9bcfa982e43dd8db792db9aac13cc) that matches the SMB_COM_ECHO (section 2.2.4.39) during Processing of the Echo, the Echo operation is canceled and no further responses are sent. + +#### Receiving an SMB_COM_WRITE_AND_CLOSE Request + +Upon receipt of an [SMB_COM_WRITE_AND_CLOSE Request (section 2.2.4.40.1)](#Section_995268754b5a49cc968668ab49825a65), the server MUST perform the following actions: + +- The server MUST verify the **FID**, which MUST represent an open regular file. +- The server MUST verify the **UID** as described in section [3.3.5.2](#Section_b09b63d73882458b9c8ec821c706ebdf) and ensure that the user has permission to write to the file. If the user does not have permission to write to the file, the server MUST send an error response with a status of STATUS_ACCESS_DENIED (ERRDOS/ERRnoaccess) and MUST increase **Server.Statistics.sts0_permerrors** by 1. +- If the **UID** presented is different from the **UID** that opened the file, the server MUST send the error response with a **Status** of STATUS_INVALID_HANDLE (ERRDOS/ERRbaduid). +- In the file identified by the **FID**, the server MUST perform a seek to the offset specified in the **WriteOffsetInBytes** field in the request. +- The server MUST write **CountOfBytesToWrite** bytes sequentially from the **Data** field in the request to the file. Any failure that causes less than **CountOfBytesToWrite** bytes to be written SHOULD result in an error response to the client. +- If the **LastWriteTime** field is nonzero in the request, the server SHOULD set the last write time of the file to this value. + +In the event of an error, the server MUST send an error response message. Otherwise, the server MUST close the file indicated by the **FID**. The server MUST release every lock in **Open.Locks**. The **FID** MUST be invalidated by removing the **Open** entry from **Server.Connection.FileOpenTable**. **Open.TreeConnect.OpenCount** and **Server.Statistics.sts0_fopens** MUST be decreased by 1.[<294>](#Appendix_A_294) The server MUST provide **Open.FileGlobalId** as an input parameter and MUST deregister the **Open** by invoking the event Server Deregisters an Open ([\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 3.1.6.5). + +Again, an error MUST result in an error response message being sent to the client. Otherwise, the server MUST construct an [SMB_COM_WRITE_AND_CLOSE Response (section 2.2.4.40.2)](#Section_fcf13ef6ce164143a926e7cafabaeea3) message. The **CountOfBytesWritten** field MUST contain the number of bytes written to the file. This value SHOULD be the equal to **CountOfBytesToWrite**. If the number of bytes written differs from the number of bytes requested to be written, and no error is indicated, the server has no resources available with which to satisfy the complete write. The response MUST be sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). + +#### Receiving an SMB_COM_OPEN_ANDX Request + +Upon receipt of an [SMB_COM_OPEN_ANDX Request (section 2.2.4.41.1)](#Section_3a760987f60d4012930bfe90328775cc), the server MUST validate the **TID** and **UID**, as defined in section [3.3.5.2](#Section_b09b63d73882458b9c8ec821c706ebdf). + +If the **ShareType** property of the **Server.Share** specified by the **SMB_Header.TID** is equal to **Named Pipe** and if **Server.Session.IsAnonymous** is TRUE, the server MUST invoke the event specified in [\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 3.1.6.17 by providing the **SMB_Parameters.Words.FileName** field with the "\\PIPE\\" prefix removed as input parameter. If the event returns FALSE, indicating that no matching named pipe is found that allows an anonymous user, the server MUST fail the request with STATUS_ACCESS_DENIED and MUST increase **Server.Statistics.sts0_permerrors** by 1. Otherwise, the server MUST continue the open processing. + +The server MUST search within the share indicated by the **Server.Share** identified by the **SMB_Header.TID** for an object with matching **SMB_Parameters.Words.FileName**.[<295>](#Appendix_A_295) + +If a matching file is found and: + +- The user indicated by the **Server.Session.UserSecurityContext** identified by **UID** has sufficient privileges to open the file with **AccessMode** access; +- The file is not currently open in a conflicting mode, and: + - The FileExistsOpts flag in the **OpenMode** field is 0, the server SHOULD fail the request with error code STATUS_OBJECT_NAME_COLLISION. + - The FileExistsOpts flag is 1, the server permits opening the file in append mode. + - The FileExistsOpts flag is 2, the server permits overwriting the file. + +If no matching file is found, but: + +- **Server.Share** represents a disk share; +- **Server.Session.UserSecurityContext** has sufficient privileges to create and open the file with **AccessMode** access; +- The CreateFile flag in the **OpenMode** field is 0, the server SHOULD[<296>](#Appendix_A_296) fail the file creation and return STATUS_OS2_INVALID_ACCESS (ERRDOS/ERRbadaccess). +- The CreateFile flag in the **OpenMode** field is 1, the server permits file creation. + +The server MUST attempt to create the file with the attributes specified in **FileAttrs**. If **CreationTime** is nonzero, then the creation time of the file MUST be set to the value of **CreationTime**. + +If the underlying [**object store**](#gt_0cc469e1-4b1f-41c4-9f94-d6209fcf468e) returns STATUS_ACCESS_DENIED, the server MUST increase **Server.Statistics.sts0_permerrors** by 1. + +If the file cannot be opened, the server MUST return an error response.[<297>](#Appendix_A_297) + +If the command is successful, the server MUST increase **Server.Statistics.sts0_fopens** by 1 and MUST allocate an **Open** object and insert it into **Server.Connection.FileOpenTable** with the following default values: + +- A new [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) MUST be created to uniquely identify this **Open** in **Server.Connection.FileOpenTable**. +- If **Server.EnableOplock** is TRUE and a requested OpLock was granted, the type of OpLock MUST be set in **Server.Open.OpLock** and **Server.Open.OplockState** MUST be set to **Held**; otherwise, **Server.Open.OpLock** MUST be set to **None** and **Server.Open.OplockState** MUST be set to **None**. +- **Server.Open.TreeConnect** MUST be set to the **TreeConnect** on which the open request was performed, and **Server.Open.TreeConnect.OpenCount** MUST be increased by 1. +- **Server.Open.Session** MUST be set to **Server.Open.TreeConnect.Session**. +- **Server.Open.Connection** MUST be set to the **Server.Open.Session.Connection**. +- **Server.Open.Locks** MUST be set to an empty list. +- **Server.Open.PID** MUST be set to the **PID** provided in the request. +- **Server.Open.PathName** MUST be set to the **FileName** field of the request. +- **Server.Open.GrantedAccess** MUST be set to the **AccessMode** field of the request. + +The server MUST register the **Open** by invoking the event Server Registers a New Open (\[MS-SRVS\] section 3.1.6.4) and MUST assign the return value to **Server.Open.FileGlobalId**. + +The server MUST instantiate an [SMB_COM_OPEN_ANDX Response (section 2.2.4.41.2)](#Section_dbce00e768a141c6982d9483c902ad9b) message and MUST set **SMB_Header.Status** to indicate success.[<298>](#Appendix_A_298) + +If the REQ_ATTRIB flag is set in the **SMB_Parameters.Words.Flags** field of the request, the values of the following response fields MUST be filled in by the server; otherwise, they SHOULD be set to zero and MUST be ignored by the client: + +- **FileAttrs** +- **LastWriteTime** +- **FileDataSize** +- **AccessRights** +- **ResourceType** +- **NMPipeStatus** +- **OpenResults** + +If the REQ_OPLOCK flag is set in the **SMB_Parameters.Words.Flags** field of the request, the client requests an exclusive OpLock. If REQ_OPLOCK_BATCH is also set, the client requests a batch OpLock. If the OpLock is granted, the **LockStatus** bit in the **OpenResults** field of the response MUST be set. + +The response MUST be sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). + +#### Receiving an SMB_COM_READ_ANDX Request + +When a server receives an SMB_COM_READ_ANDX request, message handling proceeds as follows: + +The server MUST verify that the [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) represents a valid **Server.Open** (has an entry in the [**SMB connection**](#gt_e1d88514-18e6-4e2e-a459-20d5e17e9078)'s **Server.Connection.FileOpenTable**). If the **FID** is not valid, the server MUST return an error response with a status of STATUS_INVALID_HANDLE (ERRDOS/ERRbadfid). + +The server MUST verify that the user represented by the **UID** in the request has permission to read from the file as described in section 3.3.5.2. If the user does not have sufficient permissions, the server MUST send an error response with a status of STATUS_ACCESS_DENIED (ERRDOS/ERRnoaccess) and MUST increase **Server.Statistics.sts0_permerrors** by 1. If the UID that is presented is different from the UID that opened the file, the server MUST send the error response with a **Status** of STATUS_INVALID_HANDLE (ERRDOS/ERRbaduid). + +The server MUST attempt to read from the underlying object store for the **Server.Open** identified by the **FID** in the request. The server MUST start reading at the offset indicated by either the 32-bit offset in **Offset** or the 64-bit offset formed by combining **OffsetHigh** and **Offset**. If **WordCount** is 10 (0x0A), the client is using 32-bit offsets; if it is 12 (0x0C), the client is using 64-bit offsets. + +The server MUST attempt to read **MaxCountOfBytesToReturn** number of bytes from the file.[<299>](#Appendix_A_299) + +The server might read fewer than **MaxCountOfBytesToReturn** bytes if an end of file (EOF) event is encountered. A read request starting at or beyond the end of the file returns zero bytes. + +If reading the requested number of bytes would lead to a response message size larger than the established **Server.Connection.ClientMaxBufferSize** and **Server.Connection.ClientCapabilities** does not have CAP_LARGE_READX set, the server MUST abort the connection to the client. If **Server.Connection.ClientCapabilities** has CAP_LARGE_READX set, the response message can exceed the negotiated buffer size if the FID refers to a disk file. + +If the read request was made to a named pipe or I/O device, the following additional rules apply: + +- The server MUST NOT read a number of bytes from named pipes or I/O devices greater than can be transmitted in a message less than or equal to **Server.Connection.ClientMaxBufferSize** in size, even if CAP_LARGE_READX was negotiated. +- The server MUST wait to send a response until **MinCountOfBytesToReturn** are read from the named pipe or I/O device. +- If **Timeout** is greater than zero, the server SHOULD[<300>](#Appendix_A_300) wait to send the response until either **MinCountOfBytesToReturn** are read or the **Timeout** (in milliseconds) elapses. If **Timeout** is greater than zero and it elapses before **MinCountOfBytesToReturn** bytes are read, the server SHOULD send a response with an error status indicating that the time-out occurred and SHOULD also respond with any bytes already read. If **Timeout** is zero and no data is currently available, the server SHOULD send a successful response with the **DataLength** field set to zero. +- If the **Timeout** value is -1 (0xFFFFFFFF, "wait forever") then the server MUST wait until there are at least **MinCountOfBytesToReturn** bytes of data read from the device before returning a response to the client. +- If the **Timeout** value is -2 (0xFFFFFFFE, "default") the server MUST wait for the default time-out associated with the named pipe or I/O device. + +If the operation is successful, the server MUST construct an [SMB_COM_READ_ANDX Response (section 2.2.4.42.2)](#Section_89d6b5525406445c85d554c80b94a20f) message with the following additional requirements: + +- If the request was to a named pipe, **Available** MUST be set to the number of bytes remaining to be read from the named pipe, which can be zero. Otherwise, the server MUST set the **Available** field to -1(0xFFFF). +- The **DataLength** field MUST be set to the length, in bytes, of the data read by the server. +- The **DataOffset** field MUST be set to the offset, in bytes and relative to the start of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f), of the data read by the server. +- The **Pad** field MUST pad the **SMB_Data.Data** field to an appropriate boundary. +- The **Data** field MUST contain the data that was read from the requested file. + +If the request is to read from a named pipe in [**message mode**](#gt_c49a48e8-f1ac-4568-bc87-0672eb08868b), and the message is larger than **MaxCountOfBytesToReturn** bytes, the server MUST respond with a complete SMB_COM_READ_ANDX response (not an error response) and the **Status** field of the response MUST contain STATUS_BUFFER_OVERFLOW (ERRDOS/ERRmoredata). Any other error MUST generate an error response message. + +The response MUST be sent to the client as described in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). + +#### Receiving an SMB_COM_WRITE_ANDX Request + +When the server receives an [SMB_COM_WRITE_ANDX Request (section 2.2.4.43.1)](#Section_a66126d2a1db446b8736b9f5559c49bd), message handling proceeds as follows. + +The server MUST verify that the **FID** field represents a valid **Open** (has an entry in the [**SMB connection**](#gt_e1d88514-18e6-4e2e-a459-20d5e17e9078)'s **Server.Connection.FileOpenTable**). + +The server MUST verify the UID as described in section 3.3.5.2, and ensure that the user has permission to write to the file. If the user does not have permission to write to the file, the server MUST send an error response with a **Status** of STATUS_ACCESS_DENIED (ERRDOS/ERRnoaccess) and MUST increase **Server.Statistics.sts0_permerrors** by 1. + +If the UID that is presented is different from the UID that opened the file, the server MUST send the error response with a **Status** of STATUS_INVALID_HANDLE (ERRDOS/ERRbaduid). + +The server MUST attempt to write the data received in the request to the specified file at the offset indicated in the request. If **WordCount** is 12 (0x0C), the server MUST use the offset in the 32-bit **Offset** field. If **WordCount** is 14 (0x0E), the server MUST use the 64-bit offset formed by combining **OffsetHigh** and **Offset**. + +If the **DataOffset** field value is less than the offset of the **SMB_Data.Bytes.Data** field, or if the **DataOffset** field value is greater than the offset of **SMB_Data.Bytes.Data** + **SMB_Parameters.Words.DataLength**, the server SHOULD[<301>](#Appendix_A_301) fail the request with STATUS_INVALID_SMB. + +A write request starting at or beyond the end of the file appends to the end of the file. Any "gaps" caused by writing past the end of file MUST be filled with null (0x00) padding bytes. A request to write zero bytes causes no change to the target file and MUST return a success. If the size of the **SMB_Data.Bytes.Data** field is greater than the value of the **SMB_Parameters.Words.DataLength** field, the server SHOULD[<302>](#Appendix_A_302) fail the request and return ERRSRV/ERRerror. + +If the client has set **WritethroughMode** in **WriteMode**, all written data MUST be flushed to disk before the response is sent. + +If the write request is made to a named pipe or I/O device, the following additional rules apply: + +- If **Timeout** is greater than zero, the server SHOULD[<303>](#Appendix_A_303) wait to send the response until either the number of bytes specified by **DataLength** are written to the device or the **Timeout** in milliseconds elapses. If **Timeout** is greater than zero and it elapses before is the number of **DataLength** bytes are written, the server SHOULD send a response with an error status indicating that the time-out occurred and MUST also include the count of bytes written. This is not a normal error response; it uses the full SMB_COM_WRITE_ANDX response format. If **Timeout** is zero, the write SHOULD NOT block. +- If the **Timeout** value is -1 (0xFFFF, "wait forever"), the server SHOULD wait until the number of **DataLength** bytes have been written to the device before returning a response to the client. +- If the **Timeout** value is -2 (0xFFFE, "default"), the server SHOULD wait for the default time-out associated with the [**name pipes**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca) or I/O device. +- If the **Remaining** field is nonzero, and the pipe is a [**message mode**](#gt_c49a48e8-f1ac-4568-bc87-0672eb08868b) pipe, it indicates that the pipe write spans over multiple requests. The **Remaining** field SHOULD contain the number of bytes remaining to be written.[<304>](#Appendix_A_304) + +If the operation is successful, the server MUST construct an SMB_COM_WRITE_ANDX Response message as specified in section [2.2.4.43.2](#Section_43a10562269f4536b46017b494405cc4), with the following additional requirements: + +- If the request is to a named pipe or an I/O device and **ReadBytesAvailable** is set in the **WriteMode** field, **Available** MUST be set to the number of bytes available to be read from the named pipe or device, which MAY be zero. +- The **Count** field MUST be set to the count, in bytes, of data written.[<305>](#Appendix_A_305) + +The response MUST be sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). + +#### Receiving an SMB_COM_TRANSACTION2 Request + +The SMB_COM_TRANSACTION2 is processed as specified in sections [3.3.5.2.5](#Section_bad91cd11c6345c682578b0ef25269de) and [3.3.5.58](#Section_f1d6e1a8e3504d25b6a72d5cfff98e5a). + +The response MUST be sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). + +#### Receiving an SMB_COM_FIND_CLOSE2 Request + +The SMB_COM_FIND_CLOSE2 command is used to close a directory search handle that was created by a TRANS2_FIND_FIRST2 subcommand. Upon receipt, the server MUST verify the **UID** by performing a lookup in the **Server.Connection.SessionTable**, as described in section [3.3.5.2](#Section_b09b63d73882458b9c8ec821c706ebdf). The server must then locate the Search ID (**SID**) indicated by the **SearchHandle** field in the request in the **Server.Connection.SearchOpenTable**. If the **SID** is not found, the server MUST return an error response with a **Status** of STATUS_INVALID_HANDLE (ERRDOS/ERRbadfid). Otherwise, the **SID** MUST be closed, freeing the associated search context, if any. The **SID** entry MUST then be removed from Server.Connection.SearchOpenTable. + +The response MUST be sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). + +#### Receiving an SMB_COM_TREE_CONNECT Request + +When the server receives an [SMB_COM_TREE_CONNECT Request (section 2.2.4.50.1)](#Section_0036eb8174664e1cafb6ea8bc9dd19dc), it MUST attempt to connect to the share indicated in the **Path** field. To get the updated server name, the server MUST provide <server name, share name> parsed from the **Path** field and MUST invoke the Server Normalizes a ServerName event ([\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 3.1.6.8). The server MUST use <updated server name, share name> to look up the **Share** in **Server.ShareTable**. If the share is not found, the server MUST send an error response with a status of STATUS_OBJECT_PATH_NOT_FOUND (ERRDOS/ERRbadpath). + +**Server.Paused** with a value of TRUE indicates that all shares can only be accessed by an administrator. Under these conditions, if a SMB_COM_TREE_CONNECT Request (section 2.2.4.50.1) is received from a user that is not an administrator, the server MUST send an error response with a status of STATUS_SHARING_PAUSED (ERRDOS/ERRpaused).[<306>](#Appendix_A_306) + +If the server global variable **Server.ShareLevelAuthentication** is FALSE, the **Password** field in the request MUST be ignored, and the **UID** in the header MUST be used to look up the **Server.Session.UserSecurityContext** to determine access rights to the share. + +If **Server.ShareLevelAuthentication** is TRUE, the **Password** field MUST be passed to the Authentication subsystem as a share-level password. + +The server MUST invoke the Server Notifies Current Uses of a Share (\[MS-SRVS\] section 3.1.6.15) event with the tuple <**ServerName**, **ShareName**\> to get the total number of current uses of the share. If the number of current uses is equal to or greater than **Share.MaxUses**, the server MUST fail the request with STATUS_REQUEST_NOT_ACCEPTED. + +The server MUST check the validity of the **SMB_Data.Bytes.Service** field in the request. If the value does not match any of those listed in section 2.2.4.50.1, the server MUST fail the request with a value of STATUS_BAD_DEVICE_TYPE (ERRSRV/ERRinvdevice). + +If the Tree Connect is successful, the server MUST allocate a **TreeConnect** object and MUST insert it into **Server.Connection.TreeConnectTable** with the following default values: + +- A new **TID** MUST be generated to uniquely identify this tree connect in the **Server.Connection.TreeConnectTable**. +- **Session** MUST be set to the session found on the **UID** lookup. +- **Share** MUST be set to the share found on the lookup in the **Server.ShareTable**. +- **OpenCount** MUST be set to zero. +- **CreationTime** MUST be set to current time. +- **Share.CurrentUses** MUST be increased by 1. + +The server MUST register **TreeConnect** by invoking the event Server Registers a New Treeconnect (\[MS-SRVS\] section 3.1.6.6) and MUST assign the return value to **Server.TreeConnect.TreeGlobalId**. + +The **TID** MUST be returned in both the **SMB Header.TID** field and the **SMB_Parameter.Words.TID** field of the response. The default **Server.MaxBufferSize** of the server MUST be returned in the **MaxBufferSize** field. + +The [SMB_COM_TREE_CONNECT Response (section 2.2.4.50.2)](#Section_f9a8a7131c534fb0908e625389840cf8) provides no field for indicating share characteristics such as [**DFS**](#gt_0b8086c9-d025-45b8-bf09-6b5eca72713e) support or access rights. + +If the Tree Connect is successful, a complete SMB_COM_TREE_CONNECT Response is sent. Otherwise, an error response message MUST be sent. + +The response is sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). + +#### Receiving an SMB_COM_TREE_DISCONNECT Request + +When the server receives an [SMB_COM_TREE_DISCONNECT Request](#Section_354844d75d3946d28e6b727fcf53e98d), the server can verify that the user indicated by the **Server.Session.UserSecurityContext** identified by **UID** has sufficient privileges, and it MUST: + +- Validate the **TID** in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) by verifying that it is listed in **Server.Connection.TreeConnectTable**. +- List all **Opens** (by [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766)) in the **Server.Connection.FileOpenTable** that exist within the **TID**. For each file: + - Release every lock in **Open.Locks**. + - Close the file, regardless of the [**OpLock**](#gt_7b8c743e-84b1-4c7e-83ea-cfb818cdb394) states. + - Remove the **Open** entry from the **Server.Connection.FileOpenTable**. + - Decrease **Open.TreeConnect.OpenCount** and **Server.Statistics.sts0_fopens** by 1. + - Deregister the **Open** by invoking the event Server Deregisters an Open ([\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 3.1.6.5), providing **Open.FileGlobalId** as an input parameter. +- List all open searches (by **SID**) in the **Server.Connection.SearchOpenTable** that were opened within the specified **TID**. For each search: + - Close the search. + - Remove the **SID** from the **Server.Connection.SearchOpenTable**. + - **Server.TreeConnect.Share.CurrentUses** MUST be decreased by 1. + +Upon success, the resource sharing connection identified by the **TID** is closed, and the **TID** is invalidated by removing the **TreeConnect** entry from **Server.Connection.TreeConnectTable**. + +The server MUST deregister **TreeConnect** by invoking the event Server Deregisters a Treeconnect (\[MS-SRVS\] section 3.1.6.7) with the tuple **<TreeConnect.Share.ServerName, TreeConnect.Share.Name>** and **Server.TreeConnect.TreeGlobalId** as input parameters. + +The response message indicates success or an error condition. The list of possible error codes is specified in section [2.2.4.51.2](#Section_7a4c41231e5d4c3f8a05dd5e49694a6d). The response MUST be sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). + +#### Receiving an SMB_COM_NEGOTIATE Request + +When the server receives an [SMB_COM_NEGOTIATE Request (section 2.2.4.52.1)](#Section_25c8c3c958fc4bb8aa8f0272dede84c5), it MUST read through the list of dialects offered by the client in the **DialectString** field of the request. If the **Server.SupportDialects** ADM element does not match with any of the dialects listed in the **DialectString** field, the server MUST set the **DialectIndex** value to 0xFFFF and return the Core Protocol form of the [SMB_COM_NEGOTIATE Response (section 2.2.4.52.2)](#Section_a4229e1a8a4e489aa2eb11b7f360e60c). + +If one or more dialects in the **Server.SupportDialects** ADM element match the dialects listed in the **DialectString** field, the index of the last matching dialect in **Server.SupportDialects** MUST be placed into the **DialectIndex** field of the SMB_COM_NEGOTIATE Response. **Server.Connection.SelectedDialect** MUST be set to an identifier, as listed in section [1.7](#Section_80850595e3014464974558e4945eb99b), that corresponds to the **DialectIndex** field set in the response. + +If the dialect selected is "NT LM 0.12" (NT LAN Manager), then: + +- The **Server.Connection.NTLMChallenge** is set to an 8-byte random number. +- The bits of the **SecurityMode** field of the response are set based upon the values of the **Server.ShareLevelAuthentication**, **Server.PlaintextAuthenticationPolicy**, and **Server.MessageSigningPolicy** server ADM elements. +- The **MaxMpxCount** field is set from the **Server.MaxMpxCount** ADM element. +- The **MaxNumberVcs** field is set from the **Server.MaxVcNumber** ADM element. +- The **SessionKey** field is set from the **Server.Connection.SessionKey** ADM element. +- The **MaxRawSize** field is set from the **Server.MaxRawSize** ADM element. +- The **MaxBufferSize** field is set from the **Server.MaxBufferSize** ADM element. +- The **Capabilities** field is set from the **Server.Capabilities** ADM element. +- The **Challenge** field is set from the **Server.Connection.NTLMChallenge** ADM element. +- The **ChallengeLength** field is set to the length of the **Challenge** field. +- Values for the remaining fields are provided as specified in section 2.2.4.52.2. + +The SMB_COM_NEGOTIATE Response MUST be sent as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). + +#### Receiving an SMB_COM_SESSION_SETUP_ANDX Request + +When the server receives an SMB_COM_SESSION_SETUP_ANDX request from the client, it MUST verify the **SessionKey**. If the **SessionKey** received in the request is not equal to **Server.Connection.SessionKey**, the server MAY fail the request with STATUS_INVALID_PARAMETER. + +The server MUST pass the **PrimaryDomain**, **AccountName**, **OEMPassword**, and **UnicodePassword** fields to the authentication subsystem. If authentication fails, the server MUST increase **Server.Statistics.sts0_pwerrors** by 1 and MUST reply to the client with STATUS_LOGON_FAILURE (ERRDOS/ERRnoaccess) in an error response. The possible error codes from the authentication subsystem and their detailed description are specified in [\[RFC2743\]](https://go.microsoft.com/fwlink/?LinkId=90378) and [\[MS-ERREF\]](%5bMS-ERREF%5d.pdf#Section_1bc92ddfb79e413cbbaa99a5281a6c90). + +If **Server.Connection.SessionSetupReceived** is FALSE and: + +- If authentication was successful or **Server.GuestOkay** is TRUE: +- If their corresponding server connection variables are empty, the server MUST save the **MaxBufferSize**, **MaxMpxCount**, and **Capabilities** values reported by the client in the corresponding server connection variables. These values MUST NOT be overridden by values presented in future SMB_COM_SESSION_SETUP_ANDX request messages. +- If **Server.Connection.NativeLanMan** and **Server.Connection.NativeOS** are empty, the server MUST save the **NativeLanMan** and **NativeOS** values reported by the client in the **Server.Connection.NativeLanMan** and **Server.Connection.NativeOS** variables respectively. These values MUST NOT be overridden by values presented in future SMB_COM_SESSION_SETUP_ANDX request messages. +- The server MUST query the authentication subsystem to determine which response value was accepted. + +If the value accepted for authentication was the value passed in the **OEMPassword** field: + +- The server MUST set the 0x02 bit in the **SMB_Parameters.Words.Action** field of the response. +- **Server.ConnectionSigningChallengeResponse** MUST be set to the challenge response received in the **OEMPassword** field in the client request. +- If LM challenge/response was used instead of LMv2 challenge/response, the entire LM Session Key MUST be stored in **Server.Connection.SigningSessionKey**. If LMv2 challenge/response was used, the entire NT Session Key MUST be stored in **Server.Connection.SigningSessionKey**. If the length of **Server.Connection.SigningSessionKey** is less than 16, the server SHOULD pad it with zeros up to 16 bytes. + +If the value accepted for authentication was the value passed in the **UnicodePassword** field: + +- The server MUST clear the 0x02 bit in the **SMB_Parameters.Words.Action** field of the response. +- **Server.ConnectionSigningChallengeResponse** MUST be set to the challenge response received in the **UnicodePassword** field in the client request. + +The entire NT Session Key MUST be stored in **Server.Connection.SigningSessionKey**. If the length of **Server.Connection.SigningSessionKey** is less than 16, the server SHOULD pad it with zeros up to 16 bytes. + +- If authentication was successful and **IsSigningActive** is TRUE, message signing MUST be initialized. +- **Server.Connection.MaxMpxCount** MUST be set to **MaxMpxCount** field in the request. +- If **MaxMpxCount** in the request is less than two, the server MUST set **Server.Connection.OpLockSupport** to FALSE for this connection. Otherwise, a client attempting to break its own OpLock would always time out because there would not be enough outstanding command slots to properly revoke the OpLock. See section [3.2.5.42](#Section_4b44b6339447458382557e32942bfc86) for more information on receiving an OpLock Break Notification. +- The server MUST set **Server.Connection.SessionSetupReceived** to TRUE. +- The server MUST set **CreationTime** and **Server.Connection.IdleTime** to be current time. + +If authentication failed but **Server.GuestOkay** is TRUE (allowing Guest Access), the client MUST set the 0x01 bit in the **Action** field of the response to TRUE and return the response as if authentication had succeeded. + +If authentication succeeded, the **Server.Session.UserSecurityContext** MUST be set to a value representing the user who successfully authenticated on the connection. The security context MUST be obtained from the authentication subsystem. The server MUST invoke the **GSS_Inquire_context** call as specified in \[RFC2743\] section 2.2.6, passing the **Server.Session.UserSecurityContext** as the input parameter, and MUST set **Server.Session.UserName** to the returned "src_name". If the returned "anon_state" is TRUE, the server MUST set **Server.Session.IsAnonymous** to TRUE. Otherwise, **Server.Session.IsAnonymous** MUST be set to FALSE. + +If the **VcNumber** field in the session setup request is 0, the server MUST perform the following processing: + +- Close all sessions in **Server.Connection.SessionTable** in which **UserName** matches **Server.Session.UserName** as specified in section [3.3.4.8](#Section_5b526bffbfdb45aba4bff80a8917980b). +- Disconnect each **Connection** in **Server.ConnectionTable**, except the current **Server.Connection**, in which **ClientName** matches the **Server.Connection.ClientName** as specified in section [3.3.7.2](#Section_a363f0bcb07e485f953e16fa5efd1715). + +If authentication was successful or **Server.GuestOkay** is TRUE, a new **UID** and **GlobalSessionId** MUST be generated and entered into **Server.Connection.SessionTable**. If the size of **Server.Connection.SessionTable** has reached **Server.SrvMaxSessionTableSize**, the server MUST reply to the client with STATUS_TOO_MANY_SESSIONS (ERRSRV/ERRtoomanyuids) in an error response; otherwise, **Server.Statistics.sts0_sopens** MUST be increased by 1. The server MUST register the session by invoking the event Server Registers a New Session ([\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 3.1.6.2) and MUST assign the return value to **Session.SessionGlobalId**. The server MUST fill in the additional response fields as specified in section [2.2.4.53.2](#Section_e7514918a0f649329f00ced094445537). + +If authentication was successful, the server MUST query the session key from the authentication package, as specified in [\[MS-NLMP\]](%5bMS-NLMP%5d.pdf#Section_b38c36ed28044868a9ff8dd3182128e4). If the session key is equal to or longer than 16 bytes, only the least significant 16 bytes MUST be stored in **Server.Session.SessionKey**. Otherwise, the session key MUST be stored in **Server.Session.SessionKey** and MUST be padded with zeros up to 16 bytes. + +The response is sent to the client as specified in section [3.2.4.1](#Section_87ad25ebedcb48dda230ba0d852fbfbd). + +#### Receiving an SMB_COM_LOGOFF_ANDX Request + +When the server receives an [SMB_COM_LOGOFF_ANDX Request (section 2.2.4.54.1)](#Section_efbd2ebb470f4d8abcab1eadb432305e), it MUST first find the **UID** in the **Server.Connection.SessionTable**. If the **UID** is not found in the table, the server MUST return an error response with STATUS_SMB_BAD_UID (ERRSRV/ERRbaduid). If the **UID** is found, the server MUST release all resources that were opened by the **UID** specified in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) of the request. + +The server MUST deregister the session by invoking the event Server Deregisters a Session ([\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 3.1.6.3), providing **Session.SessionGlobalId** as the input parameter. **Server.Statistics.sts0_sopens** MUST be decreased by 1. + +The **Server.Connection.SearchOpenTable**, **Server.Connection.FileOpenTable**, and **Server.Connection.TreeConnectTable** MUST each be traversed in turn. + +For each **Open** in **Connection.FileOpenTable**, where **Open.Session.UID** matches the **UID** field in the request, the server MUST close the **Open**, release every lock in **Open.Locks**, remove the **Open** entry from **Server.Connection.FileOpenTable**, and deregister that **Open**, as specified in \[MS-SRVS\] section 3.1.6.5, providing **Open.FileGlobalId** as the input parameter. For each closed **Open**, the server MUST decrease **Open.TreeConnect.OpenCount** and **Server.Statistics.sts0_fopens** by 1. + +For each **SearchOpen** in **Connection.SearchOpenTable**, where **SearchOpen.UID** matches the **UID** field in the request, the server MUST close the **SearchOpen** by removing it from **Server.Connection.SearchOpenTable** and freeing any resources like the search context. + +For each **TreeConnect** in **Server.Connection.TreeConnectTable**, where **TreeConnect.Session.UID** matches the **UID** field in the request, the server MUST remove the **TreeConnect** entry from **Server.Connection.TreeConnectTable** and MUST deregister the **TreeConnect** by invoking the event specified in \[MS-SRVS\] section 3.1.6.7 with the tuple <**TreeConnect.Share.ServerName, TreeConnect.Share.Name**\> and **TreeConnect.TreeGlobalId** as input parameters. For each deregistered **TreeConnect**, **TreeConnect.Share.CurrentUses** MUST be decreased by 1. + +Resources opened by the specified **UID** MUST be closed, and the resource entry MUST be removed from the table in which it was found. When all search handles, file handles, and [**tree connects**](#gt_c65d1989-3473-4fa9-ac45-6522573823e3) owned by the **UID** have been closed, the **Server.Session** with the matching **UID** is invalidated and removed from the **Server.Connection.SessionTable**. + +#### Receiving an SMB_COM_TREE_CONNECT_ANDX Request + +When the server receives an [SMB_COM_TREE_CONNECT_ANDX Request (section 2.2.4.55.1)](#Section_90bf689a85364f039f1b683ee4bdd67c), it MUST attempt to connect to the share indicated in the **Path** field. The server MUST provide <server name, share name> parsed from the **Path** field to invoke the event Server Normalizes a ServerName ([\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 3.1.6.8) and to get the updated server name. The server MUST use <updated server name, share name> to look up the **Share** in **Server.ShareTable**. If the share is not found, the server MUST send an error response with a status of STATUS_BAD_NETWORK_NAME (ERRSRV/ERRinvnetname). + +**Server.Paused** with a value of TRUE indicates that all shares can only be accessed by an administrator. Under these conditions, if an [SMB_COM_TREE_CONNECT Request (section 2.2.4.50.1)](#Section_0036eb8174664e1cafb6ea8bc9dd19dc) is received from a user that is not an administrator, the server MUST send an error response with a status of STATUS_SHARING_PAUSED (ERRDOS/ERRpaused).[<307>](#Appendix_A_307) + +If the server global variable **Server.ShareLevelAuthentication** is FALSE, the **Password** field in the request MUST be ignored, and the **UID** field in the header MUST be used to look up the **Server.Session.UserSecurityContext** to determine access rights to the share. If the user is not granted access in **Share.FileSecurity**, the server MAY fail the request with STATUS_ACCESS_DENIED.[<308>](#Appendix_A_308) + +If **Server.ShareLevelAuthentication** is TRUE, **PasswordLength** bytes of the **Password** field MUST be passed to the authentication subsystem as a share-level password. If authentication fails, the server MUST send an error response with a status of STATUS_LOGON_FAILURE (ERRDOS/ERRnoaccess). + +The server MUST check the validity of the **SMB_Data.Bytes.Service** field in the request. If the value does not match any of those listed in section 2.2.4.55.1, the server MUST fail the request with a value of STATUS_BAD_DEVICE_TYPE (ERRSRV/ERRinvdevice). + +The server MUST invoke the Server Notifies Current Uses of a Share (\[MS-SRVS\] section 3.1.6.15) event with the tuple <**ServerName**, **ShareName**\> to get the total number of current uses of the share. If the number of current uses is equal to or greater than **Share.MaxUses**, the server MUST fail the request with STATUS_REQUEST_NOT_ACCEPTED. If the Tree Connect is successful, the server MUST allocate a **TreeConnect** object and insert it into **Server.Connection.TreeConnectTable** with the following default values: + +- A new **TID** MUST be generated to uniquely identify this tree connect in **Server.Connection.TreeConnectTable**. +- **Session** MUST be set to the session found on the **UID** lookup. +- **Share** MUST be set to the share found on the lookup in the **Server.ShareTable**. +- **OpenCount** MUST be set to zero. +- **CreationTime** MUST be set to current time. +- **Share.CurrentUses** MUST be increased by 1. + +The server MUST register **TreeConnect** by invoking the Server Registers a New Treeconnect (\[MS-SRVS\] section 3.1.6.6) event and MUST assign the return value to **Server.TreeConnect.TreeGlobalId**. + +The **TID** MUST be returned in the **SMB_Header.TID** field of the response. + +The **SMB_Parameters.Words.OptionalSupport** field of the response MUST be set from **Server.Share.OptionalSupport**: + +- If **Server.Share.OptionalSupport** indicates support for exclusive search attributes in directory search operations, the server MUST set the SMB_SUPPORT_SEARCH_BITS (0x01) bit in the **OptionalSupport** field of the response. +- If **Server.Share.OptionalSupport** indicates that the share is in a DFS namespace, the server MUST set the SMB_SHARE_IS_IN_DFS (0x02) bit in the **OptionalSupport** field of the response. + +The **SMB_Data.Bytes.Service** field of the response MUST be set from **Server.Share.Type**. + +If the TREE_CONNECT_ANDX_DISCONNECT_TID flag is set in the **SMB_Parameter.Words.Flags** field, continue the processing for the **Opens** and open searches, as specified in section [3.3.5.41](#Section_2b0520b264614065bb978ce3427ac5d7). If this operation fails, no error is sent to the client. + +If the Tree Connect is successful, a complete [SMB_COM_TREE_CONNECT_ANDX Response (section 2.2.4.55.2)](#Section_3286744b5b584ad5b62ec4f29a2492f1) is sent. Otherwise, an error response message MUST be sent. + +The response is sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). + +#### Receiving an SMB_COM_QUERY_INFORMATION_DISK Request + +When the server receives an [SMB_COM_QUERY_INFORMATION_DISK Request (section 2.2.4.57.2)](#Section_3d5291fd33f54899b3ad949b0d4d7f93), it MUST look up the **Server.TreeConnect.Share** to find the **Server.Share.LocalPath**. The **Server.Share.Type** MUST be **Disk**; otherwise, the server MUST return STATUS_SMB_BAD_TID (ERRSRV/ERRinvtid). + +The server MUST determine the following: + +- **Blocksize** -- The number of bytes in a block. +- **BlocksPerUnit** -- The number of blocks in a "unit". +- **TotalUnits** -- The total size, in units, of the file system. +- **FreeUnits** -- The number of unused units within the file system. + +[<309>](#Appendix_A_309) + +In the event of an error, an error response is returned. Otherwise, the SMB_COM_QUERY_INFORMATION_DISK response is formatted as specified in section 2.2.4.57.2. The response MUST be sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). + +#### Receiving an SMB_COM_SEARCH or SMB_COM_FIND Request + +The [SMB_COM_SEARCH (section 2.2.4.58)](#Section_d33e84721356406d88edbd9fc10b060b) and [SMB_COM_FIND (section 2.2.4.59)](#Section_5df45d03d4e94dfd850f639363b8dffd) commands are identical in format and behavior, with the exception that SMB_COM_FIND allows the use of [SMB_COM_FIND_CLOSE (section 2.2.4.61)](#Section_3ffcd296c7cc43938ab06c902a928eec) to close the search context. + +Upon receiving either of these commands, the server MUST first determine whether the request is a continuation of a previous search, or a new search. If the **ResumeKeyLength** field is zero, then this is a new search. A new search proceeds as follows: + +- The server MUST perform a directory search using the **FileName** field as the pattern with which to search. If the **FileName** field is an empty string, the server SHOULD[<310>](#Appendix_A_310) return all the files that are present in the directory. The path indicated in the **FileName** field MUST exist within the specified **TID**. +- The **SMB_Parameters.Words.SearchAttributes** field is used to further refine the search. See the tables in section [2.2.1.2.4](#Section_2198f480e0474df0ba64f28eadef00b9) for a list of possible values. + - If the SMB_FILE_ATTRIBUTE_VOLUME attribute is set, the volume label MUST be returned (the Volume Label attribute is exclusive). + - If the value of this field is zero, only "normal" files are returned. Normal files include files with no attributes, the SMB_FILE_ATTRIBUTE_READONLY attribute, and/or the SMB_FILE_ATTRIBUTE_ARCHIVE attribute. + - The "inclusive search attributes" are: + - SMB_FILE_ATTRIBUTE_READONLY + - SMB_FILE_ATTRIBUTE_HIDDEN + - SMB_FILE_ATTRIBUTE_SYSTEM + - SMB_FILE_ATTRIBUTE_DIRECTORY + - SMB_FILE_ATTRIBUTE_ARCHIVE + +If any of these bits is included in the **SearchAttributes** field, files with matching attributes are also included in the results. (Specifying SMB_FILE_ATTRIBUTE_READONLY or SMB_FILE_ATTRIBUTE_ARCHIVE has no effect, because files with those attributes are included in "normal" searches by default.) + +- - The "exclusive search attributes" are: - SMB_SEARCH_ATTRIBUTE_READONLY - SMB_SEARCH_ATTRIBUTE_HIDDEN - SMB_SEARCH_ATTRIBUTE_SYSTEM - SMB_SEARCH_ATTRIBUTE_DIRECTORY - SMB_SEARCH_ATTRIBUTE_ARCHIVE + +These attributes are used in search operations (SMB_COM_SEARCH, SMB_COM_FIND, [SMB_COM_FIND_UNIQUE (section 2.2.4.60)](#Section_828fff83d37b4deb811824c950dca87a), and [TRANS2_FIND_FIRST2 (section 2.2.6.2)](#Section_a782468b56f14066bb6ee2630f0e8695)) to select the specific set of attributes that a file needs to have in order to be included in the results of the search. A file MUST have all of the attributes that match (by name) in order to be listed in the search results. For example: + +- - - If SMB_SEARCH_ATTRIBUTE_HIDDEN is set in the **SearchAttributes** field, then files without the SMB_FILE_ATTRIBUTE_HIDDEN atttribute will be rejected. + - If SMB_SEARCH_ATTRIBUTE_READONLY and SMB_SEARCH_ATTRIBUTE_ARCHIVE are set, files that do not have both the SMB_FILE_ATTRIBUTE_READONLY and the SMB_FILE_ATTRIBUTE_ARCHIVE attributes set will be rejected. + +If no exclusive search attributes are set, then no files are rejected from being listed. + +- The response is formatted as specified in 2.2.4.58. The number of search result entries sent in the response is the minimum of: + - The number of entries found. + - The value of the **MaxCount** field in the request. + - The number of entries that can be fit into the response without exceeding the **Server.Connection.ClientMaxBufferSize** ADM element limit. +- If, after composing the response, there are still additional entries available to be sent, the server MUST create a search context. If the number of entries in the **Server.Connection.SearchOpenTable** ADM element is greater than or equal to the **Server.MaxSearches** ADM element, the server MUST fail the request with STATUS_OS2_NO_MORE_SIDS. Otherwise, the server MUST allocate a **SearchOpen** object and insert it into the **Server.Connection.SearchOpenTable** ADM element. The following values MUST be set by the server: + - **Server.SearchOpen.MID**: The value of the **MID** field from the [SMB Header](#Section_69a29f73de0c45a6a1aa8ceeea42217f) of the client request. + - **Server.SearchOpen.PID**: The value of the **PID** from the SMB Header of the client request. + - **Server.SearchOpen.TID**: The value of the **TID** field from the SMB Header of the client request. + - **Server.SearchOpen.UID**: The value of the **UID** field from the SMB Header of the client request. + - **Server.SearchOpen.FindSID**: A newly generated [Search ID (SID)](#Section_ed5174f407634d6e9960ab9da0b4736f) value, as specified in section 2.2.1.6.5. + - **Server.SearchOpen.PathName**: The **FileName** field from the client request with its final component removed. + +The response MUST be sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). + +If this is the continuation of a previous search: + +- Using the **UID**, **TID**, [**PID**](#gt_38a420dd-6f31-456e-ae5c-63ec6905380d), and **MID**, the **Server.Connection.SearchOpenTable** ADM element is scanned for a matching search context. If no matching search context is found, the server returns an error response with a **Status** value of STATUS_NO_MORE_FILES (ERRDOS/ERRnofiles). This indicates that the end of the search has been reached. +- If the search context is found, then a new response is created containing the next set of entries to be sent to the client. The search is resumed based upon search location indicated by the **ResumeKey** field in the request. The response MUST be sent to the client as specified in section 3.3.4.1. + +Unlike the SMB_COM_FIND command, the SMB_COM_SEARCH command has no matching Close operation to allow the client to explicitly close an incomplete search. Search contexts created by the SMB_COM_SEARCH command MUST be closed and removed from the **Server.Connection.SearchOpenTable** ADM element when the end of the search is reached (no more matching files are found), and whenever the PID that created the context is closed. A PID is closed with an [SMB_COM_PROCESS_EXIT (section 2.2.4.18)](#Section_233f62a6f565478db9b82b58ff347547). If the **TID** in which the search is being performed is closed (with an [SMB_COM_TREE_DISCONNECT (section 2.2.4.51)](#Section_31cc172a80844f0baad6d8d69da76a0e) or a similar command), the search context MUST also be closed. The server SHOULD also periodically purge unused search contexts by using the [Unused Open Search Timer (section 3.3.2.3)](#Section_6a35f88585474d9e9c88f7d36cabe3e4), if implemented, or close the least recently used search context when a new search is received and the server is out of resources to process it.[<311>](#Appendix_A_311) + +If a search continuation request arrives after the search context has been purged, the client receives an error response with a **Status** of STATUS_NO_MORE_FILES (ERRDOS/ERRnofiles), which is the same as the value returned if the end of search has been reached.[<312>](#Appendix_A_312) + +#### Receiving an SMB_COM_FIND_UNIQUE Request + +Processing of the SMB_COM_FIND_UNIQUE (section 3.3.5.48) request is identical to the processing of SMB_COM_FIND, except that the Find Unique operation includes an implicit close. After the response is sent, the search context is not stored, and further requests MUST NOT be made using a **ResumeKey**. + +The response is formatted as specified in [2.2.4.60.2](#Section_eb2614e0ce334a7f847bbcddb97c00a6). The response MUST be sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697).[<313>](#Appendix_A_313) + +#### Receiving an SMB_COM_FIND_CLOSE Request + +The SMB_COM_FIND_CLOSE (section 3.3.5.49) command is used to terminate a search operation. Using the **UID**, **TID**, [**PID**](#gt_38a420dd-6f31-456e-ae5c-63ec6905380d), **MID**, and **ResumeKey** from the request, the **Server.Connection.SearchOpenTable** is scanned for a matching search context. If the matching context is found, it is closed and the entry is removed from **Server.Connection.SearchOpenTable**. + +The response is formatted as specified in [2.2.4.61.2](#Section_4c9f95de365b4a41b4fbfe0233b280eb). The response MUST be sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). + +#### Receiving an SMB_COM_NT_TRANSACT Request + +The SMB_COM_NT_TRANSACT (section 3.3.5.50) is processed as specified in Receiving any Transaction Request (section [3.3.5.2.5](#Section_bad91cd11c6345c682578b0ef25269de)). The processing of NT_Trans subcommands is specified in section [3.3.5.59](#Section_0870fb17651048bcb5b59515b00f6f3c). In addition, the **Function** field of the request MUST be validated. + +If the **Function** code is not defined, the server MUST return STATUS_INVALID_SMB (ERRSRV/ERRerror). If the **Function** code is defined but not implemented, the server MUST return STATUS_SMB_BAD_COMMAND (ERRSRV/ERRbadcmd). + +The response MUST be sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). + +#### Receiving an SMB_COM_NT_CREATE_ANDX Request + +This command can be used by the client to create a new file, open or truncate an existing file, create a directory, or open a named pipe or device. It is similar to other SMB Open and Create commands, except that the variety of options is much greater. + +Upon receipt of an [SMB_COM_NT_CREATE_ANDX Request (section 2.2.4.64.1)](#Section_f2a0f032754541c99cebaab39852c11a), the server MUST follow the steps as specified in section [3.3.5.2](#Section_b09b63d73882458b9c8ec821c706ebdf) and MUST determine the pathname of the object to open or create. This involves the interaction of three fields: + +- If the **RootDirectoryFID** is nonzero, it represents a directory within the share represented by the **TID**. The **FileName** MUST be evaluated relative to the **RootDirectoryFID**, not the **TID**. +- If the **RootDirectoryFID** is zero, the **FileName** MUST be evaluated relative to the **TID**. + +When opening a file, the server MUST strip any trailing backslash characters from the **FileName** field before opening the file from the underlying object store. When opening a named pipe, the **FileName** field MUST contain only the relative name of the pipe. That is, the "\\PIPE\\" prefix MUST NOT be present. This is in contrast with other commands, such as SMB_COM_OPEN_ANDX and TRANS2_OPEN2, which require that the "\\PIPE" prefix be present in the path name. If **Server.Session.IsAnonymous** is TRUE, the server MUST invoke the event specified in [\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 3.1.6.17 by providing the **FileName** field with the "\\PIPE\\" prefix removed as input parameter. If the event returns FALSE, indicating that no matching named pipe is found that allows an anonymous user, the server MUST fail the request with STATUS_ACCESS_DENIED and MUST increase **Server.Statistics.sts0_permerrors** by 1. Otherwise, the server MUST continue the create processing. + +If **Server.EnableOplock** is TRUE, the **Flags** field in the request allows the client to request an exclusive or batch OpLock. The level of OpLock granted (or not) MUST be returned in the **OpLockLevel** field in the response. The **Flags** field also allows the user to request opening a directory. + +If the object opened is a directory, the server MUST set the **Directory** field of the response to a nonzero value (TRUE); a zero value (FALSE) indicates that the object is not a directory. + +The **DesiredAccess** field is used to indicate the access modes that the client requests. If **DesiredAccess** is not granted in **Share.FileSecurity** for the user indicated by the **UID**, the server MUST fail the request with STATUS_ACCESS_DENIED. If the user's [**security context**](#gt_88d49f20-6c95-4b64-a52c-c3eca2fe5709) indicated by the **UID** does not have appropriate privileges, the server SHOULD fail the request with STATUS_PRIVILEGE_NOT_HELD or STATUS_ACCESS_DENIED (ERRDOS/ERRnoaccess).[<314>](#Appendix_A_314) If no access is granted for the client on this file, the server MUST increase **Server.Statistics.sts0_permerrors** by 1 and MUST fail the open with STATUS_ACCESS_DENIED (ERRDOS/ERRnoaccess). + +If the object is a regular file and it is being created or overwritten, the **AllocationSize** indicates the number of bytes to pre-allocate. + +**ShareAccess** provides the set of sharing modes that the client has requested. If any of these sharing modes is unavailable, the server MUST fail the open with STATUS_SHARING_VIOLATION (ERRDOS/ERRbadshare). If **ShareAccess** values of FILE_SHARE_READ, FILE_SHARE_WRITE, or FILE_SHARE_DELETE are set for a printer file or a named pipe, the server SHOULD ignore these values. + +If the object already exists, the action that the server SHOULD attempt is determined by interpreting the **CreateDisposition** field as follows:[<315>](#Appendix_A_315) + +- FILE_SUPERSEDE, FILE_OVERWRITE, FILE_OVERWRITE_IF: Overwrite the file. +- FILE_OPEN, FILE_OPEN_IF: Open the existing file. +- FILE_CREATE: Fail. + +If the object does not already exist, the action the server MUST attempt is determined by interpreting the **CreateDisposition** field as follows: + +- FILE_SUPERSEDE, FILE_CREATE, FILE_OPEN_IF, FILE_OVERWRITE_IF: Create the file. +- FILE_OPEN, FILE_OVERWRITE: Fail. + +If the object is a regular file and it is being created or overwritten, the **AllocationSize** indicates the number of bytes to pre-allocate. + +If the object is being created, **ExtFileAttributes** represents a set of requested attributes to be assigned to the object. The set of attributes actually assigned is returned to the client in the **ExtFileAttributes** field of the response. + +The server MUST include FILE_READ_ATTRIBUTES in the **DesiredAccess** field of the request. + +If the open or create is successful,[<316>](#Appendix_A_316) the server MUST provide additional file attribute information, including: + +- The type of the object that has been opened. +- The creation, last write, last change, and last access times of the object. +- The file size (determined by the **EndOfFile** field) and file allocation size, if the object is a file. +- The named pipe state, if the object is a named pipe. + +If the command is successful, the server MUST increase **Server.Statistics.sts0_fopens** by 1 and MUST allocate an **Open** object and insert it into **Server.Connection.FileOpenTable** with the following default values: + +- A new **FID** MUST be created to uniquely identify this **Open** in **Server.Connection.FileOpenTable**. +- If a requested OpLock was granted, the type of OpLock MUST be set in **Server.Open.OpLock** and **Server.Open.OplockState** MUST be set to **Held**; otherwise, **Server.Open.OpLock** MUST be set to **None** and **Server.Open.OplockState** MUST be set to **None**. +- **Server.Open.TreeConnect** MUST be set to the **TreeConnect** on which the open request was performed, and **Server.Open.TreeConnect.OpenCount** MUST be increased by 1. +- **Server.Open.Session** MUST be set to **Server.Open.TreeConnect.Session**. +- **Server.Open.Connection** MUST be set to the **Server.Open.Session.Connection**. +- **Server.Open.Locks** MUST be set to an empty list. +- **Server.Open.PID** MUST be set to the **PID** provided in the request. +- **Server.Open.PathName** MUST be set to the **FileName** field of the request. +- **Server.Open.GrantedAccess** MUST be set to the **DesiredAccess** field of the request. + +The server MUST register the **Open** by invoking the event Server Registers a New Open (\[MS-SRVS\] section 3.1.6.4) and MUST assign the return value to **Server.Open.FileGlobalId**. + +The **FID** MUST be placed into an [SMB_COM_NT_CREATE_ANDX Response (section 2.2.4.64.2)](#Section_32085986b516486cabbb0abbdf9f1909) message. If an error is generated, an error response MUST be used instead. + +If the SMB_COM_NT_CREATE_ANDX is successful, this information, along with the **FID** generated by the command, MUST be placed into an SMB_COM_NT_CREATE_ANDX Response message. The **PID** and **TID** from the request header and new **FID** MUST be entered into the **Server.Connection.FileOpenTable**. If an error is generated, an error response MUST be used instead. + +The response MUST be sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). + +#### Receiving an SMB_COM_NT_CANCEL Request + +Upon receipt of an [SMB_COM_NT_CANCEL Request (section 2.2.4.65.1)](#Section_e4f9bcfa982e43dd8db792db9aac13cc), the server MUST search the **Server.Connection.PendingRequestTable** for any pending commands that have the same **UID**, **TID**, **PID**, and **MID** as presented in the SMB_COM_NT_CANCEL Request. If the [**SMB transport**](#gt_f8b0f8a6-e412-459a-b8ba-219008e5bcd7) is connectionless, the header **CID** value SHOULD[<317>](#Appendix_A_317) also be used. + +For each matching entry, the server MUST pass the **CancelRequestID** to the [**object store**](#gt_0cc469e1-4b1f-41c4-9f94-d6209fcf468e) to request cancellation of the pending operation, as described in the Server Requests Canceling an Operation section in [\[MS-FSA\]](%5bMS-FSA%5d.pdf#Section_860b1516c45247b4bdbc625d344e2041). The canceled commands MUST return an error result or, if they complete successfully, a response message. The [SMB_COM_NT_CANCEL (section 2.2.4.65)](#Section_bf04c12be5ee41079b760e5ffda9cc3f) command MUST NOT send a response; there is no response message associated with SMB_COM_NT_CANCEL.[<318>](#Appendix_A_318) + +SMB_COM_NT_CANCEL is commonly used to force completion of operations that can potentially wait for an unbounded period of time, such as an [NT_TRANSACT_NOTIFY_CHANGE (section 2.2.7.4)](#Section_2a65e0f460e041ef8184ae9bc2430316). + +#### Receiving an SMB_COM_NT_RENAME Request + +Upon receipt of an [SMB_COM_NT_RENAME Request (section 2.2.4.66.1)](#Section_d777310edeb1490c915726456c0b0116), the server MUST verify that a file exists matching both the **OldFileName** pathname field and the **SearchAttributes** field in the request. OldFileName MUST NOT contain wildcard characters; otherwise, the server MUST return an error response with a Status of STATUS_OBJECT_PATH_SYNTAX_BAD (ERRDOS/ERRbadpath). + +The processing of the request depends on the information level provided in the **InformationLevel** field of the request: + +- If the **InformationLevel** field value is SMB_NT_RENAME_RENAME_FILE (0x0104), the request is treated as if it is an [SMB_COM_RENAME Request (section 2.2.4.8.1)](#Section_c970f3bf806e43098ea96515605f450d). Message processing follows as specified in section [3.3.5.10](#Section_3d30e1e24a1a40de85792143f1574dab), with the exception that the command code returned in the response [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) MUST be SMB_COM_NT_RENAME (0xA5). +- If the **InformationLevel** field value is neither SMB_NT_RENAME_RENAME_FILE (0x104) nor SMB_NT_RENAME_SET_LINK_INFO (0x103), the server SHOULD fail the request with STATUS_INVALID_SMB (ERRSRV/ERRerror).[<319>](#Appendix_A_319) +- If the **InformationLevel** field value is SMB_NT_RENAME_SET_LINK_INFO (0x0103), the original file MUST NOT be renamed. Instead, the server MUST attempt to create a hard link at the target specified in **NewFileName**. The processing information below applies to receiving a request with an information level of SMB_NT_RENAME_SET_LINK.[<320>](#Appendix_A_320) + +If the target name already exists, the hard linking operation MUST fail with STATUS_ACCESS_DENIED(ERRDOS/ERRnoaccess) and **Server.Statistics.sts0_permerrors** MUST be increased by 1. + +Other considerations: + +- Only a single **TID** is supplied, so the **OldFileName** and **NewFileName** pathnames MUST be within the same share on the server. If **OldFileName** is a directory, **NewFileName** MUST NOT be a destination located within **OldFileName** or any of its subdirectories. If these conditions are not met, the server MUST return STATUS_OBJECT_PATH_SYNTAX_BAD (ERRDOS/ERRbadpath). +- The **UID** supplied in the request MUST be used to look up the **Server.Session.UserSecurityContext** of the user. The user MUST have at least read access to the file for the hard linking operation to succeed. If the user does not have read access to the file, the server MUST return STATUS_ACCESS_DENIED (ERRDOS/ERRnoaccess) and MUST increase **Server.Statistics.sts0_permerrors** by 1. +- Only the SMB_FILE_ATTRIBUTE_HIDDEN and SMB_FILE_ATTRIBUTE_SYSTEM attributes are tested against the **SearchAttributes** field. This command can hard link normal, hidden, and/or system files if the appropriate bits are set in **SearchAttributes**. +- This command MUST NOT hard link volume labels. +- If a file to be renamed is currently open: + - If the file is opened by the requesting process, it MUST be open in compatibility mode (see section [3.2.4.5.1](#Section_9a45e9e773774da199d6d66d97532550)). If it is not open in compatibility mode, the hard linking MUST fail with STATUS_ACCESS_DENIED (ERRDOS/ERRnoaccess) and **Server.Statistics.sts0_permerrors** MUST be increased by 1.[<321>](#Appendix_A_321) + - If another process has the file open, and that process has an [**opportunistic lock (OpLock)**](#gt_7b8c743e-84b1-4c7e-83ea-cfb818cdb394) on the file, and the process has asked for extended notification (Batch OpLock), the hard link request MUST block until the server has sent an [**OpLock break**](#gt_5c86b468-90a1-4542-8bde-460c098d2a5a) request to the owner of the OpLock and either received a response or the OpLock break time-out has expired. If the process holding the OpLock closes the file (thus freeing the OpLock), the hard linking takes place. If not, the request MUST fail with STATUS_SHARING_VIOLATION (ERRDOS/ERRbadshare). +- It is possible for a server to be processing multiple requests on the same resource concurrently. As a result, there can be interactions between the execution of the hard link operation and other operations, such as ongoing searches ([SMB_COM_SEARCH (section 2.2.4.58)](#Section_d33e84721356406d88edbd9fc10b060b), [SMB_COM_FIND (section 2.2.4.59)](#Section_5df45d03d4e94dfd850f639363b8dffd), [TRANS2_FIND_FIRST2 (section 2.2.6.2)](#Section_a782468b56f14066bb6ee2630f0e8695), and so on). Although creating a hard link within a directory that is actively being searched is not prohibited, the interaction can disrupt the search, causing it to complete before all directory entries have been returned.[<322>](#Appendix_A_322) + +If the operation is successful, the server MUST construct an [SMB_COM_NT_RENAME Response (section 2.2.4.66.2)](#Section_6a71ba7f66c04460ad52fe31d5a874ef) message. The response MUST be sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). + +#### Receiving an SMB_COM_OPEN_PRINT_FILE Request + +Upon receipt of an [SMB_COM_OPEN_PRINT_FILE Request (section 2.2.4.67.1)](#Section_a0199848ec124408981288a5f1c30ceb), the server MUST perform the following actions: + +- Verify the **TID** as described in section [3.3.5.2](#Section_b09b63d73882458b9c8ec821c706ebdf). +- Verify that the **Server.Share** identified by the **SMB_Header.TID** has a **Server.Share.Type** of **Printer**. If the share is not a printer share, the server MUST return an error response with **Status** set to STATUS_INVALID_DEVICE_REQUEST (ERRDOS/ERRbadfunc). +- Verify the **UID** as described in section 3.3.5.2. +- Verify that the **Server.Session** identified by the **SMB_Header.UID** in the request has a **Server.Session.UserSecurityContext** with sufficient privileges to create a new print spool file. If the underlying [**object store**](#gt_0cc469e1-4b1f-41c4-9f94-d6209fcf468e) returns STATUS_ACCESS_DENIED, the server MUST increase **Server.Statistics.sts0_permerrors** by 1. +- Create a temporary file on the server to receive the spool file data.[<323>](#Appendix_A_323) + +If the spool file cannot be created, an error response MUST be sent to the client. + +Otherwise, **Server.Statistics.sts0_jobsqueued** and **Server.Statistics.sts0_fopens** MUST be incremented by 1, and a new [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) MUST be allocated and assigned to the newly created spool file. A new **Open** object MUST be created with the **TID**, **UID** and [**PID**](#gt_38a420dd-6f31-456e-ae5c-63ec6905380d) fields from the request header and the new FID. This **Open** MUST be entered into the **Server.Connection.FileOpenTable** with the following default values: + +- If **Server.EnableOplock** is TRUE and a requested OpLock was granted, the type of OpLock MUST be set in **Server.Open.OpLock**; otherwise, **Server.Open.OpLock** MUST be set to None. +- **Server.Open.TreeConnect** MUST be set to the **TreeConnect** on which the open request was performed, and **Server.Open.TreeConnect.OpenCount** must be incremented by 1. + +The server MUST register the **Open** by invoking the Server Registers a New Open event ([\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 3.1.6.4) and MUST assign the return value to **Server.Open.FileGlobalId**. + +The FID MUST be returned to the client in the response, which is formatted as specified in section [2.2.4.67.2](#Section_fb4c1ba4426947ff8e4302f3577190db). The response MUST be sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). + +The first **SetupLength** bytes of **Data** written to the spool file MUST be passed to the spool file without modification. If the **Mode** is set to Text Mode in the Open request, the server might perform minimal processing on the data in the file, starting at the offset indicated by **SetupLength**. Several SMB commands, including SMB_COM_WRITE_ANDX, can be used to write data to the file. + +#### Receiving an SMB_COM_WRITE_PRINT_FILE Request + +Upon receipt of an [SMB_COM_WRITE_PRINT_FILE Request (section 2.2.4.68.1)](#Section_1f2768bcc9664ca9b43f857efa3b725a), the **Data** field in the request MUST be written to the file indicated by the **FID** field, which MUST indicate a print spool file. The response MUST be sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697).[<324>](#Appendix_A_324) + +#### Receiving an SMB_COM_CLOSE_PRINT_FILE Request + +Upon receipt of an [SMB_COM_CLOSE_PRINT_FILE Request (section 2.2.4.69.1)](#Section_7712477c4dad481ba82dfa1caff56dc5), the server MUST verify the **UID** as in section [3.3.5.2](#Section_b09b63d73882458b9c8ec821c706ebdf). + +The server MUST perform a lookup of the **FID** in **Server.Connection.FileOpenTable**. If the **FID** is not found, the server MUST return an error response with a **Status** of STATUS_INVALID_HANDLE (ERRDOS/ERRbadfid). Otherwise, the **Open** indicated by the **FID** MUST be closed, every lock in **Open.Locks** MUST be released, and **Open.TreeConnect.OpenCount**, **Server.Statistics.sts0_jobsqueued**, and **Server.Statistics.sts0_fopens** MUST be decreased by 1. The server MUST provide **Open.FileGlobalId** as an input parameter and MUST deregister the **Open** by invoking the event Server Deregisters an Open ([\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 3.1.6.5). Once the file has been closed, the server MUST queue it for printing. The server SHOULD delete the file once it has been printed.[<325>](#Appendix_A_325) + +If the file is successfully closed, the **FID** MUST be invalidated by removing the **Open** entry from **Server.Connection.FileOpenTable**. Once the **FID** has been invalidated, it is available to be reused by future open or create operations. The response MUST be sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). + +#### Receiving any SMB_COM_TRANSACTION Subcommand Request + +SMB_COM_TRANSACTION and SMB_COM_TRANSACTION_SECONDARY implement the original transaction subprotocol created for the **LAN Manager 1.0** dialect. The purpose of these transactions is to transfer requests and associated data to mailslots or to and from named pipes. With respect to CIFS, the operations sent to mailslots and exchanged with named pipes are known as subcommands. + +The subcommands are not defined by the transaction subprotocol itself. Transactions simply provide a means for delivery and retrieval of the results. Support for and interpretation of an SMB_COM_TRANSACTION subcommand are specified by the mailslot or named pipe to which the subcommand is sent. + +For example, the Remote Administration Protocol (RAP, also known as Remote API Protocol) is defined for use with the \\PIPE\\LANMAN named pipe. That is, if the **Name** field passed in the initial SMB_COM_TRANSACTION request contains the string "\\PIPE\\LANMAN", the message is designated to be delivered to the RAP subsystem, which listens on the \\PIPE\\LANMAN named pipe. The RAP subsystem interprets and processes the contents of the transaction request and provides the response. The RAP subsystem is documented in [\[MS-RAP\]](%5bMS-RAP%5d.pdf#Section_fb8d5bd1e57c4be1b063ec31330bdd58). Additional information is provided below. + +Other than the \\PIPE\\LANMAN named pipe used by RAP, all named pipes accessed via the SMB transaction subprotocol support the set of subcommands specified in section [2.2.5](#Section_227cb1473c094c4bb1456c94b04c8231) of this document, and in the following sections. These are commonly known as the SMB Trans subcommands. Each SMB Trans subcommand is identified by a subcommand code, which is specified in the first **Setup** word--**Setup\[0\]**\--of the SMB_COM_TRANSACTION_SECONDARY request. + +Mailslots typically support only the TRANS_MAILSLOT_WRITE subcommand. TRANS_MAILSLOT_WRITE requests are formatted as SMB_COM_TRANSACTION request messages, but they are not sent over an SMB connection. Instead, mailslot transactions are sent as individual datagrams outside of the context of any SMB connection. The transaction subprotocol allows for the reliable transmission of mailslot requests (Class 1 mailslot messages) within the CIFS Protocol, but no operations make use of this type of exchange and no such usage has been specified or implemented. Mailslot subcommands are, therefore, not covered in this document. See [\[MS-MAIL\]](%5bMS-MAIL%5d.pdf#Section_8ea19aa46e5a4aedb6280b5cd75a1ab9) for the mailslot subprotocol specification. + +The transaction processing subsystems can be implemented in a variety of ways: + +- As an integral part of the CIFS server. +- As a loadable library module. +- As a separate process running independently. +- Via some other mechanism not listed here. + +If a transaction processing subsystem is independent of the CIFS server, the CIFS server MUST verify that transaction processing is available. The mechanism for doing so is implementation-dependent. If the transaction processing subsystem (RAP or SMB Trans) is not available, the server MUST return an error response with **Status** set to STATUS_NOT_IMPLEMENTED (ERRDOS/ERRbadfunc). + +Named pipes MUST exist within the IPC\$ share on the server. The **TID** in the SMB_COM_TRANSACTION request MUST represent a connection to the IPC\$ share. + +A named pipe can be opened, just as a file or device can be opened. The resulting [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) is used by some of the SMB Trans subcommands to identify the pipe. + +The SMB_COM_TRANSACTION request, when received by the server, is handled as specified in sections [3.3.5.31](#Section_0c79c58db9384e8e98e1cee43ecc0cd8) and [3.3.5.2.4](#Section_9f98494211544f949578b88ba17bc65f). Transfer of the full transaction request might require one or more SMB_COM_TRANSACTION_SECONDARY messages, as specified in section [3.2.4.1.4](#Section_7f1d40344b1f4602bfd5394c56b9de46). When the transaction is received in full, the **Setup**, **Trans_Parameters**, and **Trans_Data** are passed to the subsystem that supports operations on the named pipe. In the case of a RAP request, the transaction is passed to the RAP subsystem. Otherwise, the transaction is passed to the subsystem that implements the SMB Trans calls specified in section 2.2.5. + +When processing of the transaction has been completed, the subsystem returns the transaction response to the CIFS server, which returns the transaction response to the client. If the transaction response is too large to fit within a single SMB_COM_TRANSACTION response message (based upon the value of **Server.Connection.ClientMaxBufferSize**), the server MUST send multiple SMB_COM_TRANSACTION Final Transaction Response messages, as specified in section 3.2.4.1.4, in order to transport the entire transaction response to the client. + +##### Receiving a RAP Transaction Request + +As described previously, the CIFS server determines that a request is a RAP request by examining the **Name** field in the [SMB_COM_TRANSACTION Request (section 2.2.4.33.1)](#Section_57bfc115fe294482a0fea935757e0a4f) message. If **Name** is "\\PIPE\\LANMAN", the transaction MUST be passed to the RAP processing subsystem. + +RAP subcommands do not make use of the **Setup** field in the SMB_COM_TRANSACTION request, so no **Setup** values are passed to the RAP subsystem: + +The CIFS server MUST pass the following information to the RAP subsystem (see [\[MS-RAP\]](%5bMS-RAP%5d.pdf#Section_fb8d5bd1e57c4be1b063ec31330bdd58)): + +- The final **TotalParameterCount** indicating the number of transaction parameter bytes. +- The transaction parameter block (**Trans_Parameters**). +- The final **TotalDataCount** indicating the number of transaction data bytes. +- The transaction data block (**Trans_Data**). +- The **MaxParameterCount** field from the request, indicating the maximum size, in bytes, of the transaction parameter block permitted in the transaction response. +- The **MaxDataCount** field from the request, indicating the maximum size, in bytes, of the transaction data block permitted in the transaction response. + +The response parameter buffer filled in by the RAP subsystem MUST be returned to the client via the parameter block of the [SMB_COM_TRANSACTION Response (section 2.2.4.33.2)](#Section_c9303b42897841449c18a813c0033ca5). The **TotalParameterCount** of the transaction response MUST be set to the number of bytes in the response parameter buffer. + +The response data buffer filled in by the RAP server MUST be returned to the client via the data block of the SMB_COM_TRANSACTION response. The **TotalDataCount** of the transaction response MUST be set to the number of bytes in the response data buffer. + +##### Receiving a TRANS_SET_NMPIPE_STATE Request + +Upon receipt of a [TRANS_SET_NMPIPE_STATE (section 2.2.5.1)](#Section_2481644c725944b89b8bae539f7b3eb6) subcommand request, the SMB Trans subsystem MUST attempt to apply the state indicated by the **Trans_Parameters.PipeState** field to the named pipe indicated by the **Server.Open** identified by the **SMB_Parameters.Words.Setup.FID** field of the request.[<326>](#Appendix_A_326) + +If the request fails, the status code indicating the error is returned in an [SMB_COM_TRANSACTION (section 2.2.4.33)](#Section_0ed1ad9fab964a7ab94a0915f3796781) error response message. If successful, the server MUST construct a [TRANS_SET_NMPIPE_STATE Response (section 2.2.5.1.2)](#Section_e67eeed628e447bfa084cbd4aa1b9a7e). + +The CIFS server passes the results to the client in the [SMB_COM_TRANSACTION Response (section 2.2.4.33.2)](#Section_c9303b42897841449c18a813c0033ca5). + +##### Receiving a TRANS_RAW_READ_NMPIPE Request + +This method of reading data from a named pipe ignores message boundaries even if the pipe is set up as a [**message mode**](#gt_c49a48e8-f1ac-4568-bc87-0672eb08868b) pipe.[<327>](#Appendix_A_327) + +Upon receipt of a TRANS_RAW_READ_NMPIPE subcommand request, the SMB Trans subsystem MUST read data from the open named pipe specified by the [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766), which is contained in **Setup\[1\]** in the request. The amount of data to be read is specified by the **MaxDataCount** value of the SMB_COM_TRANSACTION request. The data MUST be read without regard to message boundaries (raw mode). If the named pipe is not set to [**non-blocking mode**](#gt_dcf90453-4055-4474-8357-2523ddfdb63d), and there is no data in the named pipe, the read operation on the server MUST wait indefinitely for data to become available (or until it is canceled). + +If the request fails, the status code indicating the error is returned in an SMB_COM_TRANSACTION error response message. If successful, the retrieved data is returned in the **Trans_Data** section of the TRANS_RAW_READ_NMPIPE transaction response. The actual number of bytes read is returned in **TotalDataCount** in the response, and can be less than the **MaxDataCount** value specified in the request. + +The CIFS server passes the results to the client in the SMB_COM_TRANSACTION response. + +##### Receiving a TRANS_QUERY_NMPIPE_STATE Request + +Upon receipt of a TRANS_QUERY_NMPIPE_STATE subcommand request, the SMB Trans subsystem MUST attempt to query the pipe state of the named pipe indicated by the **Server.Open** identified by the **SMB_Parameters.Words.Setup.FID** field of the request.[<328>](#Appendix_A_328) + +If the request fails, the status code indicating the error is returned in an SMB_COM_TRANSACTION error response message. If successful, the server MUST construct a TRANS_QUERY_NMPIPE_STATE response, as specified in section [2.2.5.3.2](#Section_259877b6e0b5485e81ed97c400fc722e). + +The CIFS server passes the results to the client in the SMB_COM_TRANSACTION response. + +##### Receiving a TRANS_QUERY_NMPIPE_INFO Request + +Upon receipt of a [TRANS_QUERY_NMPIPE_INFO (section 2.2.5.4)](#Section_58c3b35b06834035941616c62e941203) subcommand request, the SMB Trans subsystem MUST attempt to query state information for the named pipe indicated by the **Server.Open** identified by the **SMB_Parameters.Words.Setup.FID** field of the request.[<329>](#Appendix_A_329) + +If the request fails, the status code indicating the error is returned in an SMB_COM_TRANSACTION error response message. The CIFS server passes the results to the client in the [SMB_COM_TRANSACTION Response (section 2.2.4.33.2)](#Section_c9303b42897841449c18a813c0033ca5). + +##### Receiving a TRANS_PEEK_NMPIPE Request + +Upon receipt of a [TRANS_PEEK_NMPIPE (section 2.2.5.5)](#Section_80f114bfb3e34b82a0f517c039d70e9e) subcommand request, the SMB Trans subsystem MUST attempt to peek at information from the [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca) indicated by the **Server.Open** identified by the **SMB_Parameters.Words.Setup.FID** field of the request. Data MUST be read from the named pipe without removing the data from the pipe queue. The maximum amount of data to be read is specified by the **SMB_Parameters.Words.MaxDataCount** field of the request.[<330>](#Appendix_A_330) + +If the request fails, the status code indicating the error is returned in an [SMB_COM_TRANSACTION (section 2.2.4.33)](#Section_0ed1ad9fab964a7ab94a0915f3796781) error response message. If successful, the server MUST construct a [TRANS_PEEK_NMPIPE Response (section 2.2.5.5.2)](#Section_8ed256b221184a9e97e5283848f1ff9a). + +The CIFS server passes the results to the client in the [SMB_COM_TRANSACTION Response (section 2.2.4.33.2)](#Section_c9303b42897841449c18a813c0033ca5). + +##### Receiving a TRANS_TRANSACT_NMPIPE Request + +Upon receipt of a [TRANS_TRANSACT_NMPIPE (section 2.2.5.6)](#Section_f599d0f080b148869657944f36a44138) subcommand request, the SMB Trans subsystem MUST attempt to write data to and read data from the named pipe indicated by the **Server.Open** identified by the **SMB_Parameters.Words.Setup.FID** field of the request. The data to be written is contained in the **Trans_Data.WriteData** field of the request. + +The maximum number of bytes to be read is specified by the **SMB_Parameters.Words.MaxDataCount** field of the request. + +If the pipe is not a message mode pipe, the Trans subsystem MUST fail the request with STATUS_INVALID_PARAMETER (ERRDOS/ERRinvalidparam).[<331>](#Appendix_A_331) + +If the operation fails, the status code indicating the error is returned in an [SMB_COM_TRANSACTION (section 2.2.4.33)](#Section_0ed1ad9fab964a7ab94a0915f3796781) error response message. If the operation returns either STATUS_BUFFER_OVERFLOW (ERRDOS/ERRmoredata) or success, the server MUST construct a [TRANS_TRANSACT_NMPIPE Response (section 2.2.5.6.2)](#Section_b5bddf69094247f985a5379a7dcc2959). + +The CIFS server passes the results to the client in the [SMB_COM_TRANSACTION Response (section 2.2.4.46.2)](#Section_216e606aeee14c3fb88e0eb14dc380b2). + +##### Receiving a TRANS_RAW_WRITE_NMPIPE Request + +This method of writing data to a [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca) ignores message boundaries, even if the pipe is set up as a [**message mode**](#gt_c49a48e8-f1ac-4568-bc87-0672eb08868b) pipe. + +Upon receipt of a TRANS_RAW_WRITE_NMPIPE subcommand request, the SMB Trans subsystem MUST write the contents of the **WriteData** field to the open named pipe specified by the [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766), which is contained in **Setup\[1\]** in the request. The write SHOULD[<332>](#Appendix_A_332) be performed in [**blocking mode**](#gt_87fdfb6d-291c-4eb9-8926-f9ff87f03004) and [**byte mode**](#gt_8586fe9a-1cfa-458a-a145-8db64d69c69c), even if these modes are not set on the pipe (see the description of the **PipeState** field of TRANS_SET_NMPIPE_STATE for more information). The amount of data to be written is specified by the **TotalDataCount** value of the SMB_COM_TRANSACTION request. + +If the request fails, the status code indicating the error is returned in an SMB_COM_TRANSACTION error response message. If successful, the number of bytes written MUST be returned in the **BytesWritten** field of the transaction response. The CIFS server passes the results to the client in the SMB_COM_TRANSACTION response.[<333>](#Appendix_A_333) + +##### Receiving a TRANS_READ_NMPIPE Request + +Upon receipt of a [TRANS_READ_NMPIPE (section 2.2.5.8)](#Section_d9004cc94b844d4ca522ec559f53c1a7) subcommand request, the SMB Trans subsystem MUST attempt to read data from the named pipe indicated by the **Server.Open** identified by the **SMB_Parameters.Words.Setup.FID** field of the request. The amount of data to be read is specified by the **SMB_Parameters.Words.MaxDataCount** field of the request. The data MUST be read with respect to the current I/O state of the pipe (see [TRANS_SET_NMPIPE_STATE (section 2.2.5.1)](#Section_2481644c725944b89b8bae539f7b3eb6) and [TRANS_QUERY_NMPIPE_STATE (section 2.2.5.3)](#Section_905e248a9fc44c09aeae5cf2a6dfd015)). If the named pipe is not set to [**non-blocking mode**](#gt_dcf90453-4055-4474-8357-2523ddfdb63d), and there is no data in the named pipe, the read operation on the server MUST wait indefinitely for data to become available (or until it is canceled).[<334>](#Appendix_A_334) + +If the operation fails, the status code indicating the error is returned in an [SMB_COM_TRANSACTION Response (section 2.2.4.33.2)](#Section_c9303b42897841449c18a813c0033ca5) error message. If the operation returns either STATUS_BUFFER_OVERFLOW (ERRDOS/ERRmoredata) or success, the server MUST construct a [TRANS_READ_NMPIPE Response (section 2.2.5.8.2)](#Section_f17528d6126c4092b36ae0a5aeafa5e1). + +The CIFS server passes the results to the client in the SMB_COM_TRANSACTION Response. + +##### Receiving a TRANS_WRITE_NMPIPE Request + +Upon receipt of a [TRANS_WRITE_NMPIPE (section 2.2.5.9)](#Section_de6ca9e1b30f426ebc072198375b1bd7) subcommand request, the SMB Trans subsystem MUST attempt to write data to the underlying [**object store**](#gt_0cc469e1-4b1f-41c4-9f94-d6209fcf468e) for the open [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca) identified by the **SMB_Parameters.Words.Setup.FID** field of the request. The data to be written is contained in the **Trans_Data.WriteData** field of the request. The write MUST be performed with respect to the current I/O state of the pipe (see [TRANS_SET_NMPIPE_STATE (section 2.2.5.1)](#Section_2481644c725944b89b8bae539f7b3eb6) and [TRANS_QUERY_NMPIPE_STATE (section 2.2.5.3)](#Section_905e248a9fc44c09aeae5cf2a6dfd015)).[<335>](#Appendix_A_335) + +If the operation fails, the status code indicating the error is returned in an [SMB_COM_TRANSACTION (section 2.2.4.33)](#Section_0ed1ad9fab964a7ab94a0915f3796781) error response message. If the operation is successful, the server MUST construct a [TRANS_WRITE_NMPIPE Response (section 2.2.5.9.2)](#Section_cec02281cccd4bb78fe33888bd777ce9). + +The CIFS server passes the results to the client in the [SMB_COM_TRANSACTION Response (section 2.2.4.33.2)](#Section_c9303b42897841449c18a813c0033ca5). + +##### Receiving a TRANS_WAIT_NMPIPE Request + +Upon receipt of a [TRANS_WAIT_NMPIPE (section 2.2.5.10)](#Section_385ce4de217048a1910053f3c4aad60d) subcommand request, the SMB Trans subsystem MUST test the underlying object store for availability of the named pipe identified in the **SMB_Data.Bytes.Name** field of the request. If the named pipe cannot be opened, the SMB Trans subsystem MUST NOT respond to the TRANS_WAIT_NMPIPE subcommand request. Instead, it MUST enter an implementation-dependent[<336>](#Appendix_A_336) wait until the named pipe becomes available or **SMB_Parameters.Words.Timeout** milliseconds have passed. + +If the request fails, the status code indicating the error is returned in an [SMB_COM_TRANSACTION (section 2.2.4.33)](#Section_0ed1ad9fab964a7ab94a0915f3796781) error response message. If successful, the server MUST construct a [TRANS_WAIT_NMPIPE Response (section 2.2.5.10.2)](#Section_87711d4b033e49a78c76ce0fc1dd4738). + +The CIFS server passes the results to the client in the [SMB_COM_TRANSACTION Response (section 2.2.4.33.2)](#Section_c9303b42897841449c18a813c0033ca5).[<337>](#Appendix_A_337) + +##### Receiving a TRANS_CALL_NMPIPE Request + +Upon receipt of a [TRANS_CALL_NMPIPE (section 2.2.5.11)](#Section_a600138d46b741b49d9380a3bd5096de) subcommand request, the SMB Trans subsystem MUST attempt to obtain an Open on the named pipe specified by the **SMB_Data.Bytes.Name** field in the request from the underlying object store. If successful, the Trans subsystem MUST attempt to write data to and then read data from the underlying object store as specified in section [3.3.5.57.7](#Section_0b16edf0e2bf4da4b10b33683b54316b), with the following exceptions: + +- The Trans subsystem MUST use the FID of the returned Open to the named pipe. +- The Trans subsystem MUST use the **Trans_Data.WriteData** of the request (using **SMB_Parameters.Words.TotalDataCount** as its length) as the data to be written. + +If the operation returns either STATUS_BUFFER_OVERFLOW (ERRDOS/ERRmoredata) or success, the Trans subsystem MUST NOT construct a TRANS_TRANSACT_NMPIPE response, but instead continue processing as follows. + +If successful, the Trans subsystem MUST then attempt to close the Open on the underlying object store to the named pipe before sending a response. + +If the operation fails, the status code indicating the error is returned in an error response. If the operation returns either STATUS_BUFFER_OVERFLOW (ERRDOS/ERRmoredata) or success, the server MUST construct a TRANS_CALL_NMPIPE response, as specified in section [2.2.5.11.2](#Section_b08561068cd242f18cec3e6d3cac341c). + +The CIFS server passes the results to the client in the SMB_COM_TRANSACTION response. + +#### Receiving Any SMB_COM_TRANSACTION2 Subcommand Request + +[SMB_COM_TRANSACTION2 (section 2.2.4.46)](#Section_3d9d8f3edc70410da3fc6f4a881e8cab) and [SMB_COM_TRANSACTION2_SECONDARY (section 2.2.4.47)](#Section_80207e036cd64bbe863fdb52f4d2cb1a) were introduced in the **LAN Manager 1.2** dialect. They provide a second transaction subprotocol, known as the Trans2 subprotocol, which operates primarily on file system metadata. Unlike the SMB Trans subprotocol, the Trans2 subprotocol defines a specific set of subcommands; the Trans2 subcommands are not defined by the object upon which the subcommand operations are being performed. + +Trans2 subcommands generally perform metadata operations on file systems (accessed via the **TID** representing the connection to the share), directories, and files. The Trans2 subcommands are always identified by a function code that is specified in **Setup\[0\]** (the first entry in the **Setup\[\]** array) in the SMB_COM_TRANSACTION2 request. + +##### Receiving Any Information Level + +Upon receipt of a Trans2 subcommand request with a **Trans2_Parameters.InformationLevel** field, the information level value MUST be passed to the underlying [**object store**](#gt_0cc469e1-4b1f-41c4-9f94-d6209fcf468e) for processing. If the information level includes any request data, the data MUST also be passed to the underlying object store.[<338>](#Appendix_A_338) + +The returned status and response data, if any, are sent to the client in a Trans2 subcommand response message corresponding to the same subcommand that initiated the request. + +##### Receiving a TRANS2_OPEN2 Request + +The [TRANS2_OPEN2 (section 2.2.6.1)](#Section_ee2f11ca7c7e49ac9cb78b1ed1259c2c) subcommand is used to open or create a file and set extended attributes on the file. The parameters for the Open operation are passed in the **Trans2_Parameters** block. The list of extended attribute name/value pairs is passed in the **Trans2_Data** block. + +When opening a named pipe, if **Server.Session.IsAnonymous** is TRUE, the server MUST invoke the event specified in [\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 3.1.6.17 by providing the **FileName** field with the "\\PIPE\\" prefix removed as input parameter. If the event returns FALSE, indicating that no matching named pipe is found that allows an anonymous user, the server MUST fail the request with STATUS_ACCESS_DENIED and MUST increase **Server.Statistics.sts0_permerrors** by 1. Otherwise, the server MUST continue the create processing. + +When the Trans2 subsystem receives a [TRANS2_OPEN2 Request (section 2.2.6.1.1)](#Section_59261f5ba49a4013b7772efbb0f46bb9), it MUST first attempt to open or create the named file. The name of the file to be opened is provided as a null-terminated string in the **FileName** field in the **Trans2_Parameters** block of the transaction. The requested access modes are listed in the **DesiredAccess** field of the request. If **DesiredAccess** is not granted in **Share.FileSecurity** for the user indicated by the **UID**, the server MUST fail the request with STATUS_ACCESS_DENIED. The **OpenMode** field indicates the action to be taken depending on whether the file does or does not already exist. If the underlying [**object store**](#gt_0cc469e1-4b1f-41c4-9f94-d6209fcf468e) returns STATUS_ACCESS_DENIED, **Server.Statistics.sts0_permerrors** MUST be increased by 1. + +If the file is created or overwritten (truncated), the **AllocationSize** field specifies the number of bytes that the server MUST pre-allocate for the file. If the file is created, the **FileAttributes** field provides a set of standard file attributes to be applied. The response also includes a **FileAttributes** field, which indicates the actual attributes of the file (those successfully applied if the file is created, or the existing attributes of the file if it is opened or truncated). + +The **Trans2_Parameters.Flags** field MAY be used by the client to request an exclusive or a batch OpLock on the file. If the Open or Create operation is successful, the server MUST indicate whether the OpLock was granted in the **ActionTaken** field of the response. The **ActionTaken** field also indicates the action taken to open the file (create, open, or truncate). + +The **Trans2_Parameters.Flags** field MAY also be used by the client to request additional information from the server. If the client requests additional information, the server MUST include the requested values, as specified in section 2.2.6.1.1; otherwise, the server SHOULD zero-fill the additional information fields. + +If the file is successfully opened, and a set of extended attributes is included in the request, the server MUST attempt to apply the extended attributes to the file. If an error is generated when the extended attributes are applied, the offset in bytes from the start of the extended attribute list of the attribute that caused the error MUST be returned in the **ExtendedAttributeErrorOffset** field. A full [SMB_COM_TRANSACTION2 Response (section 2.2.4.46.2)](#Section_216e606aeee14c3fb88e0eb14dc380b2) (not an error response) MUST be sent to the client. The error code is returned in the **Status** field of the final SMB_COM_TRANSACTION2 Response.[<339>](#Appendix_A_339) + +If the TRANS2_OPEN2 successfully opens the file, **Server.Statistics.sts0_fopens** MUST be increased by 1, and the **FID** MUST be returned to the client. A new **Server.Open** object with the **PID**, **UID**, **TID** from the request header, and the new **FID** MUST be entered into the **Server.Connection.FileOpenTable**. **Server.Open.TreeConnect** MUST be set to the **TreeConnect** on which the request was performed, and **Server.Open.TreeConnect.OpenCount** MUST be increased by 1. **Server.Open.Session** MUST be set to **Server.Open.TreeConnect.Session**. **Server.Open.Connection** MUST be set to the **Server.Open.Session.Connection**. **Server.Open.Locks** MUST be set to an empty list. **Server.Open.PathName** MUST be set to the **FileName** field of the request. **Server.Open.GrantedAccess** MUST be set to the **AccessMode** field of the request. + +The server MUST register the new **FID** by invoking the Server Registers a New Open event (\[MS-SRVS\] section 3.1.6.4), and it MUST assign the return value to **Server.Open.FileGlobalId**. + +The completed TRANS2_OPEN2 subcommand response MUST be returned to the client via the [SMB_COM_TRANSACTION2 (section 2.2.4.46)](#Section_3d9d8f3edc70410da3fc6f4a881e8cab) transaction mechanism. + +##### Receiving a TRANS2_FIND_FIRST2 Request + +The server MUST perform a directory search using the **FileName** field as the pattern with which to search. If the **FileName** field is an empty string, the server MUST return all the files that are present in the directory. The path indicated in the **FileName** field MUST exist within the specified **TID**, and the **TID** MUST indicate a file system share. + +The **SearchAttributes** and **Flags** fields are used to further refine the search, as specified in section [2.2.6.2.1](#Section_b2b2a73094994f05884ed5bb7b9caf90). + +If the **InformationLevel** parameter field in the request is set to [SMB_INFO_QUERY_EAS_FROM_LIST (section 2.2.8.1.3)](#Section_031d81a90fda4b2fb976f4c15c8a7efa), the server MUST scan the EA list of each matching file and return the EAs that match the **AttributeName** field values specified in the **GetExtendedAttributeList** field of the request. Any errors in reading the list of requested EAs MUST be reported by sending a full response (not an error response) with the **Status** field set to indicate the error. The offset of the EA that caused the error is measured in bytes from the start of the **GetExtendedAttributeList.GEAList** field in the **Trans2_Data** block of the request and is reported in the **EAErrorOffset** field of the response. + +The response format is dependent upon the **InformationLevel** requested, as specified in [2.2.8.1](#Section_635a88d2435241f28b9a1ed7c1997f7f). The number of search result entries sent in the response is the minimum of: + +- The number of entries found. +- The value of the **SearchCount** field in the request. +- The number of entries that can fit into the response without exceeding the **MaxDataCount** field limit sent in the client's [SMB_COM_TRANSACTION2 Request (section 2.2.4.46.1)](#Section_f7d148cde3d549ae8b379633822bfeac). + +If no matching entries are found, the server SHOULD[<340>](#Appendix_A_340) fail the request with STATUS_NO_SUCH_FILE. + +If the entire list of file system objects found by the search fit within a single response and SMB_FIND_CLOSE_AT_EOS is set in the **Flags** field, or if SMB_FIND_CLOSE_AFTER_REQUEST is set in the request, the server SHOULD[<341>](#Appendix_A_341) return a **SID** field value of zero. This indicates that the search has been closed and is no longer active on the server.[<342>](#Appendix_A_342) + +Otherwise, if the number of entries in **Server.Connection.SearchOpenTable** is greater than or equal to **Server.MaxSearches**, the server MUST fail the request with STATUS_OS2_NO_MORE_SIDS. If not, the search remains open and can be continued with a [TRANS2_FIND_NEXT2 Request (section 2.2.6.3.1)](#Section_80dc980efe03455cada67c5dd6c551ba) or closed using an [SMB_COM_FIND_CLOSE2 Request (section 2.2.4.48.1)](#Section_a0ac55c1d2ed4c38b2f66d4af4490d87). + +If the search is to remain open, the server MUST allocate a **SearchOpen** object and insert it into **Server.Connection.SearchOpenTable**. The following values MUST be set by the server: + +- **Server. SearchOpen.MID**: The value of the **MID** from the [SMB Header](#Section_69a29f73de0c45a6a1aa8ceeea42217f) of the client request. +- **Server.SearchOpen.PID**: The value of the **PID** from the SMB Header of the client request. +- **Server.SearchOpen.TID**: The value of the **TID** from the SMB Header of the client request. +- **Server.SearchOpen.UID**: The value of the **UID** from the SMB Header of the client request. +- **Server.SearchOpen.FindSID**: A newly generated [Search ID (SID)](#Section_ed5174f407634d6e9960ab9da0b4736f) value, as specified in section 2.2.1.6.5. +- **Server.SearchOpen.PathName**: The **FileName** in the client request, with its final component removed. + +The search results MUST be returned to the client in a [TRANS2_FIND_FIRST2 Response (section 2.2.6.2.2)](#Section_4e65d94e09af4511a77ab73adf1c52d6), which MUST be sent to the client as specified in section [3.3.4.1](#Section_391c8ce60b83497f9706f7cec50dd697). + +##### Receiving a TRANS2_FIND_NEXT2 Request + +Upon receipt of a [TRANS2_FIND_NEXT2 Request (section 2.2.6.3.1)](#Section_80dc980efe03455cada67c5dd6c551ba), the server MUST continue processing of the search indicated by the **SID** field in the request. + +The **SearchAttributes** field from the original [TRANS2_FIND_FIRST2 (section 2.2.6.2)](#Section_a782468b56f14066bb6ee2630f0e8695) MUST NOT be overridden by the TRANS2_FIND_NEXT2 Request. The **SearchCount**, **Flags**, and **InformationLevel** field values MUST override those used in previous requests that are part of the same search. + +If the SMB_FIND_CONTINUE_FROM_LAST bit is set in the **Flags** field, the search MUST resume from the point immediately following the last entry previously returned. Otherwise, the search MUST be restarted based upon the **ResumeKey** field in the request. + +Other than the modifications described preceding, search results are gathered and returned exactly as is done for the TRANS2_FIND_FIRST2. As specified for TRANS2_FIND_FIRST2 (section 2.2.6.2), if the remaining list of file system objects found by the search fits within the response and SMB_FIND_CLOSE_AT_EOS is set in the **Flags** field, or if SMB_FIND_CLOSE_AFTER_REQUEST is set in the request, the server MUST close the search. + +Otherwise, the search remains open and can be continued with another TRANS2_FIND_NEXT2 Request or closed using an [SMB_COM_FIND_CLOSE2 Request (section 2.2.4.48.1)](#Section_a0ac55c1d2ed4c38b2f66d4af4490d87).[<343>](#Appendix_A_343) + +##### Receiving a TRANS2_QUERY_FS_INFORMATION Request + +Upon receipt of a TRANS2_QUERY_FS_INFORMATION subcommand request, the SMB Trans2 subsystem MUST query the object store underlying the share identified by the **TID** in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) of the request. The Trans2 subsystem MUST use the value in the request's **Trans2_Parameters.InformationLevel** field to determine the type and format of the information that the client requests. Valid information levels are specified in section [2.2.8.2](#Section_2c7707b4afcd4dbfa0f335abebe68fac). + +The [**CIFS**](#gt_fb37399e-d72d-41b6-b073-086da2d96e09) server passes the results to the client in the [SMB_COM_TRANSACTION2 Response (section 2.2.4.46.2)](#Section_216e606aeee14c3fb88e0eb14dc380b2). + +##### Receiving a TRANS2_QUERY_PATH_INFORMATION Request + +Upon receipt of a [TRANS2_QUERY_PATH_INFORMATION (section 2.2.6.6)](#Section_39021262e1624948b4999dfccef77ef6) subcommand request, the SMB Trans2 subsystem MUST query the file or directory identified by the **Trans2_Parameters.FileName** field in the request. The Trans2 subsystem MUST use the value in the request's **Trans2_Parameters.InformationLevel** field to determine the type and format of the information that the client requests. Valid information levels are specified in section [2.2.8.3](#Section_b9dcb99ce8104df8ae29cdf37e8c5a23). + +The [**CIFS**](#gt_fb37399e-d72d-41b6-b073-086da2d96e09) server passes the results to the client in the [SMB_COM_TRANSACTION2 Response (section 2.2.4.46.2)](#Section_216e606aeee14c3fb88e0eb14dc380b2).[<344>](#Appendix_A_344) + +##### Receiving a TRANS2_SET_PATH_INFORMATION Request + +Upon receipt of a [TRANS2_SET_PATH_INFORMATION Request (section 2.2.6.7.1)](#Section_2ca0642a1cd44e72a16f9e804a218262), the Trans2 subsystem MUST validate the path specified in the **FileName** field in the **Trans2_Parameters** block of the request. **FileName** is specified relative to the **TID** supplied in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f). **FileName** MUST be a valid path, and the object identified by **FileName** MUST exist and MUST be a file or directory. The file or directory does not need to be opened by the client before sending the transaction request; no [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) is required. + +The set of file attribute information included in the request is determined by the **InformationLevel** field. Section [2.2.8.4](#Section_55b9ec0a219240299e2c150be302278d) specifies the formats and descriptions of valid information levels. + +The setting of attribute information for the root directory of the share MUST NOT be supported. If the client attempts to set attributes on the root directory of the share, the server MUST return STATUS_ACCESS_DENIED (ERRDOS/ERRnoaccess) and MUST increase **Server.Statistics.sts0_permerrors** by 1. + +##### Receiving a TRANS2_QUERY_FILE_INFORMATION Request + +Upon receipt of a [TRANS2_QUERY_FILE_INFORMATION (section 2.2.6.6)](#Section_39021262e1624948b4999dfccef77ef6) subcommand request, the SMB Trans2 subsystem MUST query the file or directory identified by the **Trans2_Parameters.FID** field in the request. The Trans2 subsystem MUST use the value in the request's **Trans2_Parameters.InformationLevel** field to determine the type and format of information that the client requests, which are specified in section [2.2.8.3](#Section_b9dcb99ce8104df8ae29cdf37e8c5a23). + +The [**CIFS**](#gt_fb37399e-d72d-41b6-b073-086da2d96e09) server passes the results to the client in the [SMB_COM_TRANSACTION2 Response (section 2.2.4.46.2)](#Section_216e606aeee14c3fb88e0eb14dc380b2).[<345>](#Appendix_A_345) + +##### Receiving a TRANS2_SET_FILE_INFORMATION Request + +Upon receipt of a [TRANS2_SET_FILE_INFORMATION Request (section 2.2.6.9.1)](#Section_194935c314c8466798633e2b35e19033), the Trans2 subsystem MUST validate the file handle specified in the [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) field in the **Trans2_Parameters** block of the request. The file indicated by FID MUST be a directory or regular file, and MUST exist within the share indicated by the **TID** supplied in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f). + +The set of standard and extended attribute information included in the request is identical to the set supported by TRANS2_SET_PATH_INFORMATION. The information level to use is specified in the **InformationLevel** field. Section [2.2.8.4](#Section_55b9ec0a219240299e2c150be302278d) provides the formats and descriptions of valid information levels. + +The setting of attribute information for the root directory of the share MUST NOT be supported. If the client attempts to set attributes on the root directory of the share, the server MUST return STATUS_ACCESS_DENIED (ERRDOS/ERRnoaccess) and MUST increase **Server.Statistics.sts0_permerrors** by 1. + +##### Receiving a TRANS2_CREATE_DIRECTORY Request + +Upon receipt of a [TRANS2_CREATE_DIRECTORY (section 2.2.6.14)](#Section_d77e09845be54aba9f8a8606e48ff7d0) subcommand request, the Trans2 subsystem MUST validate the path provided in the **DirectoryName** field of the **Trans2_Parameters** block. All elements of the path indicated by **DirectoryName**, except for the final element of the path, MUST exist within the share indicated by the **TID** in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f). The final element of the path MUST NOT exist, otherwise, the request MUST fail and the server MUST return an error response with **Status** set to STATUS_OBJECT_NAME_COLLISION (ERRDOS/ERRfilexists). If the underlying [**object store**](#gt_0cc469e1-4b1f-41c4-9f94-d6209fcf468e) returns STATUS_ACCESS_DENIED, **Server.Statistics.sts0_permerrors** MUST be increased by 1. + +If the **DirectoryName** is valid, the server MUST attempt to create the directory. Any error in creating the directory MUST be returned in an error response. + +If the directory is successfully created, and if the client provided a list of Extended Attributes (EAs) in the **Trans2_Data** block of the request, the server MUST attempt to set the EAs on the newly created directory. If an error is generated when setting the EAs, the offset of the EA that caused the error relative to the start of the **ExtendedAttributeList.FEAList** MUST be returned in the **EaErrorOffset** of the response. In this case, a full response (not an error response) MUST be sent to the client.[<346>](#Appendix_A_346) + +If the command is successful, **Server.Statistics.sts0_fopens** MUST be increased by 1. + +##### Receiving a TRANS2_GET_DFS_REFERRAL Request + +If the DFS subsystem has not indicated that it is active, the request MUST be failed with a STATUS_NO_SUCH_DEVICE error. If the **TID** in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) does not match with the **TID** of an active connection to the IPC\$ share, the server MUST fail the request with STATUS_ACCESS_DENIED and MUST increase **Server.Statistics.sts0_permerrors** by 1. Otherwise, the CIFS server MUST pass the contents of the Trans2_Parameters data block to the DFS subsystem, as specified in [\[MS-DFSC\]](%5bMS-DFSC%5d.pdf#Section_3109f4be2dbb42c99b8e0b34f7a2135e) section 3.2.5.1. + +The response returned by the DFS subsystem after it processes the request (a **RESP_GET_DFS_REFERRAL** data structure) MUST be copied into the **Trans2_Data** data block of the [TRANS2_GET_DFS_REFERRAL Response (section 2.2.6.16.2)](#Section_6420c96036be4d55b3ae66e7897e6111) and returned to the client. The **TotalDataCount** field of the [SMB_COM_TRANSACTION2 Response (section 2.2.4.46.2)](#Section_216e606aeee14c3fb88e0eb14dc380b2) MUST be set to the size in bytes of the response data block. + +#### Receiving any SMB_COM_NT_TRANSACT Subcommand Request + +The SMB_COM_NT_TRANSACT subprotocol defines a specific set of subcommands that are used to perform actions on files and file attributes. The NT Trans subcommands, as they are known, perform operations on **TID**s and **FID**s. + +The specific NT Trans subcommand to be executed is identified by the code in the **Function** field of the [SMB_COM_NT_TRANSACT Request (section 2.2.4.62.1)](#Section_1e62725cbb9e470499a48db520a6f2da). + +##### Receiving an NT_TRANSACT_CREATE Request + +This subcommand can be used by the client to create a new file, to open or truncate an existing file, or to create a directory. The semantics of this subcommand are similar to those of the [SMB_COM_NT_CREATE_ANDX (section 2.2.4.64)](#Section_d3f83a7e493b4d29b21c55768b93e144) SMB command, with the exception that [NT_TRANSACT_CREATE (section 2.2.7.1)](#Section_f85bb6cf2d3949c9bfe5307ad57d5da5) can be used to set [**security descriptors**](#gt_e5213722-75a9-44e7-b026-8e4833f0d350) and/or extended attribute name/value pairs on the file. + +If the **MaxParameterCount** field of the SMB_COM_NT_TRANSACT request contains a value that is less than the size of the NT_TRANSACT_CREATE Response as specified in section [2.2.7.1.2](#Section_ab2b6ac6161e4826885a45b4d4834f18), the server MUST fail the request with STATUS_INVALID_SMB (ERRSRV/ERRerror). + +Upon receipt of an NT_TRANSACT_CREATE subcommand request, the NT Trans subsystem MUST determine the pathname of the file or directory to open or create. This involves the interaction of three fields: + +- If the **RootDirectoryFID** is nonzero, it represents a directory within the share represented by the **TID** specified in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f). The **Name** MUST be evaluated relative to the directory specified by **RootDirectoryFID**. +- If the **RootDirectoryFID** is zero, then the **Name** MUST be evaluated relative to the root of the share specified by the **TID**. + +If **Server.EnableOplock** is TRUE, the **Flags** field in the subcommand request allows the client to ask for an exclusive or batch OpLock. The level of OpLock granted (if any) MUST be returned in the **OpLockLevel** field in the subcommand response. The **Flags** field also allows the user to request opening a directory. If the object opened is a directory, the **Directory** field of the response MUST be nonzero; a zero value (FALSE) indicates that the object is not a directory. + +The **DesiredAccess** field is used to indicate the access modes that the client requests. If **DesiredAccess** is not granted in **Share.FileSecurity** for the user indicated by the **UID**, the server MUST fail the request with STATUS_ACCESS_DENIED. If the user's [**security context**](#gt_88d49f20-6c95-4b64-a52c-c3eca2fe5709) that is indicated by the **UID** does not have the appropriate privileges, the server SHOULD fail the request with STATUS_PRIVILEGE_NOT_HELD or STATUS_ACCESS_DENIED (ERRDOS/ERRnoaccess).[<347>](#Appendix_A_347) If no access is granted for the client on this file, the server MUST increase **Server.Statistics.sts0_permerrors** by 1 and MUST fail the open with STATUS_ACCESS_DENIED (ERRDOS/ERRnoaccess). + +If the object is a regular file and it is being created or overwritten, the **AllocationSize** indicates the number of bytes to pre-allocate. + +**ShareAccess** provides the set of sharing modes that the client requests. If any of these sharing modes is unavailable, the server MUST fail the open with STATUS_SHARING_VIOLATION (ERRDOS/ERRbadshare). + +The **CreateDisposition** field is used to determine the action the server attempts if the object already exists: + +- FILE_SUPERSEDE, FILE_OVERWRITE, FILE_OVERWRITE_IF: Overwrite the file. +- FILE_OPEN, FILE_OPEN_IF: Open the existing file or directory. +- FILE_CREATE: Fail with STATUS_OBJECT_NAME_COLLISION (ERRDOS/ERRfilexists). + +The **CreateDisposition** field is used to determine the action that the server attempts if the object does not already exist: + +- FILE_SUPERSEDE, FILE_CREATE, FILE_OPEN_IF, FILE_OVERWRITE_IF: Create the file or directory. +- FILE_OPEN, FILE_OVERWRITE: Fail. + +**CreateOptions** specifies the options that are to be used by the server when it attempts to open or create the object. If the object is being created, **ExtFileAttributes** represents a set of requested attributes to be assigned to the object. The set of attributes actually assigned is returned to the client in the **ExtFileAttributes** field of the response. + +The server MUST include FILE_READ_ATTRIBUTES in the **DesiredAccess** field of the request. + +If the open or create is successful, the server MUST apply the **SecurityDescriptor** provided in the **NT_Trans_Data** buffer of the [NT_TRANSACT_CREATE Request (section 2.2.7.1.1)](#Section_42eef5ff34d74389a4e5812820475686). Likewise, the server MUST apply the set of Extended Attribute (EA) name/value pairs provided in the request. If an error is detected while applying the EAs, the server MUST return a complete NT_TRANSACT_CREATE Response (section 2.2.7.1.2) (not an SMB error response) and MUST set the **Status** field in the SMB Header with the implementation-specific error code. + +Once the file has been successfully opened, and the **SecurityDescriptor** and EAs applied, the server MUST collect additional file attribute information, including: + +- The type of the object that has been opened. +- The creation, last write, last change, and last access times of the object. +- The file size and file allocation size, if the object is a file. +- The [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca) state, if the object is a named pipe. + +If the NT_TRANSACT_CREATE is successful, this information, along with the **FID** that is generated by the command, MUST be placed into an NT_TRANSACT_CREATE Response (section 2.2.7.1.2) subcommand message. A new **Server.Open** object with the **PID**, **UID**, **TID** from the request header, and the new **FID** MUST be entered into the **Server.Connection.FileOpenTable**, and **Server.Statistics.sts0_fopens** MUST be increased by 1. **Server.Open.TreeConnect** MUST be set to the **TreeConnect** on which the request was performed, and **Server.Open.TreeConnect.OpenCount** MUST be increased by 1. **Server.Open.Session** MUST be set to **Server.Open.TreeConnect.Session**. **Server.Open.Connection** MUST be set to the **Server.Open.Session.Connection**. **Server.Open.Locks** MUST be set to an empty list. **Server.Open.PathName** MUST be set to the **Name** field of the request. **Server.Open.GrantedAccess** MUST be set to the **DesiredAccess** field of the request. + +The server MUST register the new **FID** by invoking the event Server Registers a New Open ([\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 3.1.6.4) and MUST assign the return value to **FileGlobalId**. + +If an error is generated, other than an Extended Attribute error as specified preceding, an error response MUST be generated. The NT Trans subsystem MUST return the NT transaction response to the CIFS server for transmission to the client.[<348>](#Appendix_A_348) + +##### Receiving an NT_TRANSACT_IOCTL Request + +The **FunctionCode** and [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) are taken from the [NT_TRANSACT_IOCTL (section 2.2.7.2)](#Section_26a843f52fee43ea889100a31cb5d854) subcommand request. The input to the IOCTL is contained in the **NT_Trans_Data.Data** buffer of the request. The server MUST pass the IOCTL or FSCTL request to the underlying file system. If an error is returned from the underlying file system, the server MUST NOT send an error response message. Instead, the server MUST return a complete NT_TRANSACT_IOCTL response and MUST include the error in the **Status** field of the [SMB_COM_NT_TRANSACT Response (section 2.2.4.62.2)](#Section_dd00c8422398412fb21dbf5074a9a1c4). The server MUST return the output buffer in the **NT_Trans_Data.Data** buffer of the NT_TRANSACT_IOCTL response.[<349>](#Appendix_A_349) + +##### Receiving an NT_TRANSACT_SET_SECURITY_DESC Request + +Upon receipt of an [NT_TRANSACT_SET_SECURITY_DESC (section 2.2.7.3)](#Section_ee4287977c94413fa19ee2176f66501d) subcommand request, the NT Trans subsystem MUST attempt to set the [**security descriptors**](#gt_e5213722-75a9-44e7-b026-8e4833f0d350) provided in the request to the file specified by the **FID**. The **SecurityDescriptor** field indicates which security descriptors are to be set. + +The **FID** and **SecurityInformation** fields are passed in the **NT_Trans_Parameters** block of the request. The security descriptors are passed in the **SecurityDescriptor** array in the **NT_Trans_Data** section of the request.[<350>](#Appendix_A_350) + +The response indicates either success or, if the request failed, the error that was generated. + +##### Receiving an NT_TRANSACT_NOTIFY_CHANGE Request + +Upon receipt of an [NT_TRANSACT_NOTIFY_CHANGE Request (section 2.2.7.4.1)](#Section_ecf3b6004b0945d684c2d3fd8bb2e2c4), the NT Trans subsystem MUST verify the **TID** and **UID** as described in section [3.3.5.2](#Section_b09b63d73882458b9c8ec821c706ebdf). The server MUST perform a lookup in the **Server.Connection.FileOpenTable** to verify that the **FID**, which is passed in the **NT_Trans_Parameters** block of the request, represents an opened directory within the **TreeConnect** given by **TID**. + +If the client has not issued any NT_TRANSACT_NOTIFY_CHANGE Requests on this **FID** previously, the server SHOULD allocate an empty change notification buffer and associate it with the open directory. The size of the buffer SHOULD be at least equal to the **MaxParameterCount** field in the [SMB_COM_NT_TRANSACT Request (section 2.2.4.62.1)](#Section_1e62725cbb9e470499a48db520a6f2da) used to transport the NT_TRANSACT_NOTIFY_CHANGE Request. If the client previously issued an NT_TRANSACT_NOTIFY_CHANGE Request on this **FID**, the server SHOULD already have a change notification buffer associated with the **FID**. The change notification buffer is used to collect directory change information in between [NT_TRANSACT_NOTIFY_CHANGE (section 2.2.7.4)](#Section_2a65e0f460e041ef8184ae9bc2430316) calls that reference the same **FID**. + +The **CompletionFilter** indicates the set of change events for which the client requests notification. If **WatchTree** is TRUE, all of the subdirectories below the directory specified by **FID** are also watched. If there is a change notification buffer associated with the **FID**, the changes listed in the buffer are compared against the **CompletionFilter**. If there is a match, the NT_TRANSACT_NOTIFY_CHANGE Request is complete; otherwise, the request MUST wait asynchronously until a change event occurs to complete the request. + +The NT_TRANSACT_NOTIFY_CHANGE Request is entered into the **Server.Connection.PendingRequestTable**, as is any other command that is processed asynchronously by the server. The request is completed when one of the following events occurs: + +- A modification matching the **CompletionFilter** occurs within the directory or directories indicated by **FID**. This is the expected completion of the request. +- The request is canceled by an [SMB_COM_NT_CANCEL Request (section 2.2.4.65.1)](#Section_e4f9bcfa982e43dd8db792db9aac13cc). +- The **FID** is closed, either by an explicit Close operation or another cause, such as an [SMB_COM_PROCESS_EXIT (section 2.2.4.18)](#Section_233f62a6f565478db9b82b58ff347547) or [SMB_COM_TREE_DISCONNECT (section 2.2.4.51)](#Section_31cc172a80844f0baad6d8d69da76a0e) of the **TID** in which the directory indicated by **FID** exists. + +Once the request has completed, it is removed from the **Server.Connection.PendingRequestTable**, and an [NT_TRANSACT_NOTIFY_CHANGE Response (section 2.2.7.4.2)](#Section_258b956ce6514435b4fdfe1cfdad44b2) is composed. The response MUST contain the names of the files that changed, as well as an indication of the type of change that occurred. All changed files within the directory or directories indicated by the **FID** are returned, not just those matching **CompletionFilter**. If the operation completed because the **FID** was closed, or due to an [SMB_COM_NT_CANCEL (section 2.2.4.65)](#Section_bf04c12be5ee41079b760e5ffda9cc3f), there might be no changes listed. + +Any changes that occur within the directory or directories indicated by **FID** following the completion of the NT_TRANSACT_NOTIFY_CHANGE Request are recorded in the change notification buffer on the server. This is done on the assumption that the client will reissue the NT_TRANSACT_NOTIFY_CHANGE Request upon receipt of the response. In the event that the number of changes exceeds the size of the change notify buffer, or the maximum size of the **NT_Trans_Parameter** block in the response (as indicated by the **MaxParameterCount** field in the most recent request), the NT Trans subsystem MUST return an error response with a **Status** value of STATUS_NOTIFY_ENUM_DIR (ERRDOS/ERR_NOTIFY_ENUM_DIR). This indicates to the client that more changes have occurred on the server than the transaction has the capacity to report. + +The server can also send an NT_TRANSACT_NOTIFY_CHANGE Response with a success **Status** and no changes listed (**TotalParameterCount** is zero) to cause the client to enumerate the directory and/or post a new NT_TRANSACT_NOTIFY_CHANGE Request. + +If the server does not support the NT_TRANSACT_NOTIFY_CHANGE subcommand, it can return an error response with STATUS_NOT_IMPLEMENTED (ERRDOS/ERRbadfunc) in response to an NT_TRANSACT_NOTIFY_CHANGE Request. Alternatively, it can send STATUS_NOTIFY_ENUM_DIR (ERRDOS/ERR_NOTIFY_ENUM_DIR) to cause the client to enumerate the directory.[<351>](#Appendix_A_351) + +##### Receiving an NT_TRANSACT_QUERY_SECURITY_DESC Request + +Upon receipt of an [NT_TRANSACT_QUERY_SECURITY_DESC Request (section 2.2.7.6.1)](#Section_6cd8638ea4f446d59e9aefa64008d3d5), the NT Trans subsystem MUST query the underlying file system to retrieve the [**security descriptors**](#gt_e5213722-75a9-44e7-b026-8e4833f0d350) indicated by **SecurityInfoFields** for the file indicated by **FID**. **SecurityInfoFields** and **FID** are passed in the **NT_Trans_Parameters** block of the request.[<352>](#Appendix_A_352) + +If the request fails, the server MUST return an error response indicating the error that caused the failure and perform no further processing. + +If the size of the **NT_Trans_Data.SecurityDescriptor** field is less than the size required by the underlying file system to fit the requested security descriptors, the **NT_Trans_Parameters.LengthNeeded** field MUST be set to the length required as indicated by the underlying file system in an implementation-specific manner, and the **NT_Trans_Data.SecurityDescriptor** field of the response remains empty. The server MUST return an NT_TRANSACT_QUERY_SECURITY_DESC Response (section [2.2.7.6.2](#Section_5ea8d8dd90144d108c2e75587d78a292)). + +Otherwise, the **NT_Trans_Parameters.LengthNeeded** field MUST be set to the length of the security descriptors retrieved, and the **NT_Trans_Data.SecurityDescriptor** field of the response contains the security descriptors retrieved from the file system. The server MUST return an NT_TRANSACT_QUERY_SECURITY_DESC Response (section 2.2.7.6.2). + +### Timer Events + +#### OpLock Break Acknowledgment Timer Event + +When the Oplock Break Acknowledgment timer expires, the server MUST enumerate all connections in **Server.ConnectionTable** and MUST find all **Server.Opens** in each **Server.Connection** where **Server.Open.OplockState** is **Breaking** and **Server.Open.OplockTimeout** is earlier than the current time. For each matching **Server.Open**, the server MUST acknowledge the [**OpLock break**](#gt_5c86b468-90a1-4542-8bde-460c098d2a5a) to the underlying object store. The server MUST set **Server.Open.Oplock** to the type of Oplock that was granted during the Oplock Break Notification, as specified in section [3.3.4.2](#Section_b50b9ddaf3744427a93edf9c55c043a6), and MUST set **Server.Open.OplockState** to **None**. + +If at least one **Server.Open** has a **Server.Open.OplockState** equal to **Breaking**, the [Oplock Break Acknowledgment Timer (section 3.3.2.1)](#Section_acb45ee235ad43b5ad6864cc65e927f3) MUST be restarted to expire again at the time of the next Oplock timeout; otherwise, the Oplock Break Acknowledgment Timer MUST NOT be restarted. + +#### Idle Connection Timer Event + +The [Idle Connection Timer (section 3.3.2.2)](#Section_01688aa7038d484991ff3b55781a7253) SHOULD periodically trigger a scan of existing SMB connections and disconnect, as specified in section 3.3.7.1, those on which no opens exist (**Server.Connection.FileOpenTable** and **Server.Connection.SearchOpenTable** are both empty) and no operations have been issued in the last **Server.AutoDisconnectTimeout** minutes (**Server.Connection.IdleTime** has passed). For each session in the disconnected connection, **Server.Statistics.sts0_stimedout** MUST be increased by 1. + +#### Unused Open Search Timer Event + +The [Unused Open Search Timer (section 3.3.2.3)](#Section_6a35f88585474d9e9c88f7d36cabe3e4), if implemented, SHOULD periodically trigger a scan of all open searches in existing active [**SMB connections**](#gt_e1d88514-18e6-4e2e-a459-20d5e17e9078) and SHOULD close those open searches on which no search operations have been issued in the preceding time period specified by the value of the **Server.SrvSearchMaxTimeout** abstract data model element (section [3.3.1.1](#Section_2b4f1d5c442a4ed4a4518a986351c5a9)). + +#### Unused Connection Timer Event + +When the [Unused Connection Timer (section 3.3.2.4)](#Section_d1dbbbc729d045359f00f45aa90e2ffe) expires, the server MUST look up all connections in global **Server.ConnectionTable**, where **Server.Connection.SessionTable** is empty and current time minus **Server.Connection.CreationTime** is more than an implementation-specific timeout, and SHOULD [<353>](#Appendix_A_353)disconnect them, as specified in section [3.3.7.1](#Section_c7de49528f774c9a8ad1411925af4a13). + +### Other Local Events + +#### Handling a Transport Disconnect + +When the transport indicates a disconnection[<354>](#Appendix_A_354), the server MUST disconnect the **Connection** as specified in section [3.3.7.2](#Section_a363f0bcb07e485f953e16fa5efd1715). + +#### Server Disconnects a Connection + +The caller provides a **Connection** to be disconnected. The server MUST perform the following processing: + +- The server MUST close the associated transport connection.[<355>](#Appendix_A_355) +- For each **Session** in **Connection.SessionTable**, the server MUST close the session as specified in section [3.3.4.8](#Section_5b526bffbfdb45aba4bff80a8917980b), providing **Session.SessionGlobalId** as the input parameter. +- For each **SearchOpen** entry in **Connection.SearchOpenTable**, the server MUST remove the **SearchOpen** entry from the **Connection.SearchOpenTable** and MUST free the **SearchOpen**. +- The server MUST invoke the event specified in [\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 3.1.6.16 to update the connection count by providing the tuple <**Connection.TransportName**, FALSE>. +- The **Connection** object MUST be removed from **Server.ConnectionTable** and MUST be freed. + +#### Handling an Incoming Transport Connection + +When a remote client connects, the transport invokes this event, providing a new connection. If **Server.Enabled** is FALSE, the server MUST reject the incoming connection. Otherwise, the server MUST accept the connection, and if successful, MUST invoke the processing in section [3.3.5.1](#Section_aa0fa406f1664fafa7d98e2a897174ce), passing the new connection as the parameter.[<356>](#Appendix_A_356) + +## Local Interface Details for RPC Client Applications + +The content in this section provides a unified interface for [**RPC client**](#gt_e5a7be6b-98db-4e8d-8116-5893f43ab48b) applications that use [**named pipes**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca) and other local applications that similarly employ the [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) family of protocols. Because such traffic can flow over the protocols specified in \[MS-CIFS\] and [\[MS-SMB2\]](%5bMS-SMB2%5d.pdf#Section_5606ad475ee0437a817e70c366052962), these interfaces are written so that the higher-layer client application is isolated from the specifics of the underlying protocol. Implementations that support such local client applications SHOULD support one or more of the interfaces defined in this section. + +This section provides an abstraction for the necessary connection establishment and negotiation operations and redirects to the equivalent higher-layer events specified in \[MS-CIFS\] and \[MS-SMB2\]. + +To simplify this interface, a composite structure **ClientGenericContext** is defined to encapsulate the underlying protocol and the protocol-specific client side context. The structure has the following fields: + +**ClientGenericContext.ProtocolDialect:** The protocol dialect associated with an open. + +**ClientGenericContext.ProtocolSpecificOpen:** Either the protocol-specific Client.Open, as specified in section [3.2.1.5](#Section_9b04bf6b664e41d5aec17ddc7c92d9ff) and in \[MS-SMB2\] section 3.2.1.6, or the protocol-specific Client.Session, as specified in section [3.2.1.3](#Section_c42729fbc655424f8d9a44825d609b86) and in \[MS-SMB2\] secton 3.2.1.3. + +This structure MUST be considered opaque to the caller. + +### Abstract Data Model + +None. + +### Timers + +None. + +### Initialization + +None. + +### Higher-Layer Triggered Events + +#### An RPC Client Application Opens a Named Pipe + +The [**RPC client**](#gt_e5a7be6b-98db-4e8d-8116-5893f43ab48b) application provides: + +- The name of the server. +- The name of the pipe. +- Credentials to be used to connect to the server. + +The client MUST first connect to the server as specified in section [3.2.4.2.1](#Section_ebb9c893a495422c957a0d63ab1d7c20). + +Next, the client MUST negotiate the protocol by any of the methods specified in [\[MS-SMB2\]](%5bMS-SMB2%5d.pdf#Section_5606ad475ee0437a817e70c366052962) section 3.2.4.2.2, initially offering the highest protocol supported by the local client implementation. + +If the negotiated protocol dialect is covered in \[MS-CIFS\] or in [\[MS-SMB\]](%5bMS-SMB%5d.pdf#Section_f210069c70864dc2885e861d837df688), the client MUST: + +- Authenticate the user by invoking the processing logic specified in section [3.2.4.2.4](#Section_3a3cdd475b43427691f5645b82b0938f), providing the credentials supplied by the caller; next, connect to the IPC\$ share by invoking the processing logic specified in [3.2.4.2.5](#Section_9b2d6574ad2d4c07b5283f8cf05f24c4). +- Open the [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca) by invoking the processing logic specified in section [3.2.4.5](#Section_66435b844e2242ffb4e15ff7b07de138), supplying the following input parameters: + - **Client.TreeConnect**: The **ClientGenericContext.ProtocolSpecificOpen** obtained in a preceding step. + - Pathname: The name of the pipe supplied by the calling application. + - **Client.Session**: The **ClientGenericContext.ProtocolSpecificOpen** obtained after the user authentication in a preceding step. + - Access mode: Allow read and write operations. + - Share Access: Allow read and write sharing. + - Create disposition: If the file exists, open; otherwise, fail. + - Create options: If the file is a directory, fail. + - (Optional): Return the attributes and time stamps of the file in the response: FALSE. + - (Optional): Return the total length of the file's extended attributes in the response: FALSE. + - Open parent directory: FALSE. + - Impersonation level: Impersonate. + - Security flags: zero. + - Optional allocation size: Not provided. + - Timeout: zero. + - Security descriptor: NULL + - Request for an exclusive or batch [**OpLock**](#gt_7b8c743e-84b1-4c7e-83ea-cfb818cdb394): None. + +If the negotiated protocol is that specified by \[MS-SMB2\], the client MUST: + +- Authenticate the user by invoking the processing logic specified in \[MS-SMB2\] section 3.2.4.2.3; next, connect to the IPC\$ share by invoking the processing logic specified in \[MS-SMB2\] section 3.2.4.2.4. +- Open the named pipe by invoking the processing logic specified in \[MS-SMB2\] section 3.2.4.3.1, supplying the following input parameters: + - **Client.TreeConnect**: The **ProtocolSpecificOpen** obtained from **ClientGenericContext** in a preceding step. + - Pathname: The name of the pipe supplied by the caller. + - **Client.Session**: The **ProtocolSpecificOpen** obtained from **ClientGenericContext** in a preceding step. + - Access mode: Allow read and write operations. + - Sharing Mode: Allow read and write sharing. + - Create disposition: If the file exists, open; otherwise, fail. + - Create options: If the file is a directory, fail. + - File attributes and flags: zero. + - Impersonation level: Impersonate. + - Security flags: zero. + - OpLock or Lease state: None. + - Create Contexts: None. + +Any error incurred during the processing of the preceding steps MUST be returned to the caller. + +Upon successful completion, a new **ClientGenericContext** structure MUST be initialized as follows and returned to the caller. + +The **ClientGenericContext.ProtocolDialect** field MUST be set to an implementation-specific identifier indicating the protocol (either that specified by \[MS-CIFS\] or by \[MS-SMB2\]). + +The **ClientGenericContext.ProtocolSpecificOpen** field MUST be set to the protocol-specific **Client.Open** returned from the processing logic specified in section 3.2.4.5 or in \[MS-SMB2\] section 3.2.4.3.1. + +#### An RPC Client Application Writes to a Named Pipe + +The caller supplies the following: + +- The **ClientGenericContext** structure returned by the interface specified in section [3.4.4.1](#Section_4b0b077a46f040a6ad13b5488d3720d0). +- The buffer to be written to the [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca). + +If the **ClientGenericContext.ProtocolDialect** is that specified in \[MS-CIFS\] or in [\[MS-SMB\]](%5bMS-SMB%5d.pdf#Section_f210069c70864dc2885e861d837df688), the request MUST be handled as specified in section [3.2.4.15](#Section_13ec5da367744618a4a0709002cda9dc) with the following as input parameters: + +- **Client.Open**: The **ProtocolSpecificOpen** field from the **ClientGenericContext** structure supplied by the caller. +- Offset: zero. +- A buffer supplied by the caller. +- Write-through mode: TRUE. +- Timeout: zero. + +If the **ClientGenericContext.ProtocolDialect** is that specified in [\[MS-SMB2\]](%5bMS-SMB2%5d.pdf#Section_5606ad475ee0437a817e70c366052962), the request MUST be handled as specified in \[MS-SMB2\] section 3.2.4.7 with the following as input parameters: + +- **Open**: The **ProtocolSpecificOpen** field from the **ClientGenericContext** structure supplied by the caller. +- Offset: zero. +- The size of the caller-supplied buffer, in bytes. +- A buffer supplied by the caller. + +#### An RPC Client Application Reads from a Named Pipe + +The caller supplies the following: + +- The **ClientGenericContext** structure returned by the interface specified in section [3.4.4.1](#Section_4b0b077a46f040a6ad13b5488d3720d0). +- The buffer to be filled with data read from the [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca). + +If the **ClientGenericContext.ProtocolDialect** is that specified in \[MS-CIFS\] or in [\[MS-SMB\]](%5bMS-SMB%5d.pdf#Section_f210069c70864dc2885e861d837df688), the request MUST be handled as specified in section [3.2.4.14](#Section_18c7441d4b024f738b3e13b78396a1e4) with the following as input parameters: + +- **Client.Open**: The **ProtocolSpecificOpen** field from the **ClientGenericContext** structure supplied by the caller. +- Offset: zero. +- The size of the caller-supplied buffer, in bytes. +- The minimum number of bytes to read, which is the same as the size of the caller-supplied buffer. +- Timeout: zero. + +If the **ClientGenericContext.ProtocolDialect** is that specified in [\[MS-SMB2\]](%5bMS-SMB2%5d.pdf#Section_5606ad475ee0437a817e70c366052962), the request MUST be handled as specified in \[MS-SMB2\] section 3.2.4.6 with the following as input parameters: + +- **Open**: The **ProtocolSpecificOpen** field from the **ClientGenericContext** structure supplied by the caller. +- Offset: zero. +- The size of the caller-supplied buffer, in bytes. +- An optional minimum number of bytes to read: Not provided. + +#### An RPC Client Application Issues a Named Pipe Transaction + +The caller supplies the following: + +- The **ClientGenericContext** structure returned by the interface specified in section [3.4.4.1](#Section_4b0b077a46f040a6ad13b5488d3720d0). +- The buffer to be written to the [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca). +- The number of bytes to be read from the named pipe. + +Based on the **ClientGenericContext.ProtocolDialect** field value, the request MUST be handled as specified in section [3.2.4.34](#Section_0e868b83c198491cae21ab5b353ad5d1) or in [\[MS-SMB2\]](%5bMS-SMB2%5d.pdf#Section_5606ad475ee0437a817e70c366052962) section 3.2.4.20.4, providing the following input parameters: + +- **Client.Open**: The **ProtocolSpecificOpen** field from the **ClientGenericContext** structure supplied by the caller. +- The size of the caller-supplied buffer, in bytes. +- A buffer supplied by the caller. +- The number of bytes to read, as supplied by the caller. + +#### An RPC Client Application Closes a Named Pipe + +The caller supplies the **ClientGenericContext** structure returned by the interface specified in section [3.4.4.1](#Section_4b0b077a46f040a6ad13b5488d3720d0). + +If the **ClientGenericContext.ProtocolDialect** is that specified in \[MS-CIFS\] or in [\[MS-SMB\]](%5bMS-SMB%5d.pdf#Section_f210069c70864dc2885e861d837df688), the request MUST be handled as specified in section [3.2.4.7](#Section_5afb8ecf09a14bd49ab67d86890914d6), with the following as input parameters: + +- **Client.Open**: The **ProtocolSpecificOpen** field from the **ClientGenericContext** structure supplied by the caller. +- File creation time: zero. + +If the **ClientGenericContext.ProtocolDialect** is that specified in [\[MS-SMB2\]](%5bMS-SMB2%5d.pdf#Section_5606ad475ee0437a817e70c366052962), the request MUST be handled as specified in \[MS-SMB2\] section 3.2.4.5, with the following as input parameters: + +- **Client.Open**: The **ProtocolSpecificOpen** field from the **ClientGenericContext** structure supplied by the caller. +- File attributes required: FALSE. + +#### An RPC Client Application Requests the Session Key for an Authenticated Context + +The caller supplies the **ClientGenericContext** structure returned by the interface specified in section [3.4.4.1](#Section_4b0b077a46f040a6ad13b5488d3720d0). + +Based on the **ClientGenericContext.ProtocolDialect** field value, the request MUST be handled as specified in section [3.2.4.45](#Section_18d8396c245648d7b338c99e05001012) or in [\[MS-SMB2\]](%5bMS-SMB2%5d.pdf#Section_5606ad475ee0437a817e70c366052962) section 3.2.4.25, providing **ClientGenericContext.ProtocolSpecificOpen** as the input parameter. + +#### A Local Client Application Initiates a Server Session + +The local client application provides: + +- The name of the server. +- Credentials to be used to connect to the server. + +The client MUST first connect to the server as specified in section [3.2.4.2.1](#Section_ebb9c893a495422c957a0d63ab1d7c20). + +Next, the client MUST negotiate the protocol by any of the methods specified in [\[MS-SMB2\]](%5bMS-SMB2%5d.pdf#Section_5606ad475ee0437a817e70c366052962) section 3.2.4.2.2, initially offering the highest protocol supported by the local client implementation. + +If the negotiated protocol dialect is covered in \[MS-CIFS\] or in [\[MS-SMB\]](%5bMS-SMB%5d.pdf#Section_f210069c70864dc2885e861d837df688), the client MUST: + +- Authenticate the user by invoking the processing logic specified in section [3.2.4.2.4](#Section_3a3cdd475b43427691f5645b82b0938f), providing the credentials supplied by the caller; next, the client MUST connect to the IPC\$ share by invoking the processing logic specified in section [3.2.4.2.5](#Section_9b2d6574ad2d4c07b5283f8cf05f24c4) + +Any error incurred during the processing of the preceding steps MUST be returned to the caller. + +Upon successful completion, a new **ClientGenericContext** structure MUST be initialized as follows and returned to the caller. + +The **ClientGenericContext.ProtocolDialect** field MUST be set to an implementation-specific identifier indicating the protocol (either that specified by \[MS-CIFS\] or by \[MS-SMB2\]). + +The **ClientGenericContext.ProtocolSpecificOpen** field MUST be set to the protocol-specific **Client.Session** obtained by the processing logic specified in section 3.2.4.2.4. + +#### A Local Client Application Terminates a Server Session + +The caller supplies the **ClientGenericContext** structure returned by the interface specified in \[MS-CIFS\] section [3.4.4.7](#Section_3c90e44ecc2e4bf599828e3ec7a850db). + +Based on the **ClientGenericContext.ProtocolDialect** field value, the session represented by the **ClientGenericContext.ProtocolSpecificOpen** MUST be closed as specified in section [3.2.4.25](#Section_c23c7dfd8d7f46f593be17e05e333904) or in [\[MS-SMB\]](%5bMS-SMB%5d.pdf#Section_f210069c70864dc2885e861d837df688) section 3.2.4.23. + +#### A Local Client Application Queries DFS Referrals + +The local client application provides: + +- **ClientGenericContext**: An opaque blob encapsulating the underlying protocol and the protocol-specific client side context. +- **ServerName**: The name of the server from which to query referrals. +- **UserCredentials**: An opaque implementation-specific entity that contains the credentials to be used when authenticating to the remote server. +- **MaxOutputSize**: The maximum output buffer response size, in bytes. +- An input buffer containing the application-provided structure **REQ_GET_DFS_REFERRAL** specified in [\[MS-DFSC\]](%5bMS-DFSC%5d.pdf#Section_3109f4be2dbb42c99b8e0b34f7a2135e) section 2.2.2 or **REQ_GET_DFS_REFERRAL_EX** specified in \[MS-DFSC\] section 2.2.3. +- FSCTL Code + +If **ClientGenericContext.ProtocolSpecificOpen.Connection.ServerCapabilities** does not have the CAP_DFS flag set, the client SHOULD[<357>](#Appendix_A_357) return STATUS_DFS_UNAVAILABLE to the caller. + +If **ClientGenericContext.ProtocolDialect** indicates the CIFS or the SMB protocol, the client MUST invoke the [Application Requests Querying DFS Referrals (section 3.2.4.44)](#Section_68f4963e657a4400b4504f5c144fb29e) event, providing **ServerName**, **UserCredentials**, **MaxOutputSize**, and the input buffer as the parameters. + +If the Application Requests Querying DFS Referrals event returns success, the client MUST return the **RESP_GET_DFS_REFERRAL** structure from the **Trans2_Data** block of the [TRANS2_GET_DFS_REFERRAL Response (section 2.2.6.16.2)](#Section_6420c96036be4d55b3ae66e7897e6111) and MUST return success to the calling application; otherwise, the client MUST return the status code received from the event. + +If **ClientGenericContext.ProtocolDialect** indicates the SMB2 protocol, the client MUST invoke the Application Requests DFS Referral Information ([\[MS-SMB2\]](%5bMS-SMB2%5d.pdf#Section_5606ad475ee0437a817e70c366052962) section 3.2.4.20.3) event, providing **ServerName**, **UserCredentials**, **MaxOutputSize**, input buffer, and an FSCTL code as the parameters. + +If the Application Requests DFS Referral Information event returns success, the client MUST return the buffer (\[MS-SMB2\] section 3.2.5.14.4) received from the server and MUST return success to the calling application; otherwise, the client MUST return the status code received from the event. + +#### A Local Client Application Requests a Connection to a Share + +The RPC client application provides: + +- The name of the server. +- The name of the share. +- Credentials to be used to connect to the server. + +The client MUST first connect to the server as specified in section [3.2.4.2.1](#Section_ebb9c893a495422c957a0d63ab1d7c20). + +Next, the client MUST negotiate the protocol by any of the methods specified in [\[MS-SMB2\]](%5bMS-SMB2%5d.pdf#Section_5606ad475ee0437a817e70c366052962) section 3.2.4.2.2, initially offering the highest protocol supported by the local client implementation. + +If the negotiated protocol dialect is covered in \[MS-CIFS\] or in [\[MS-SMB\]](%5bMS-SMB%5d.pdf#Section_f210069c70864dc2885e861d837df688), the client MUST authenticate the user by invoking the processing logic specified in section [3.2.4.2.4](#Section_3a3cdd475b43427691f5645b82b0938f); next, the client MUST connect to the application-supplied share by invoking the processing logic specified in section [3.2.4.2.5](#Section_9b2d6574ad2d4c07b5283f8cf05f24c4). + +If the negotiated protocol is that specified by \[MS-SMB2\], the client MUST authenticate the user by invoking the processing logic specified in \[MS-SMB2\] section 3.2.4.2.3, providing the credentials supplied by the caller; next, the client MUST connect to the application-supplied share by invoking the processing logic specified in \[MS-SMB2\] section 3.2.4.2.4. + +Any error incurred during the processing of the preceding steps MUST be returned to the caller. + +Upon successful completion, a new **ClientGenericContext** structure and **ShareType** MUST be initialized. + +The **ClientGenericContext.ProtocolDialect** field MUST be set to an implementation-specific identifier indicating the protocol (either that specified by \[MS-CIFS\] or that specified by \[MS-SMB2\]). + +The **ClientGenericContext.ProtocolSpecificOpen** field MUST be set to the protocol-specific **Client.TreeConnect** obtained by the processing logic specified in section [3.2.5.4](#Section_c7cb45aaf9234cd4a9d54a1418e41d42) or in \[MS-SMB\] section 3.2.4.2.4. + +**ShareType** MUST be set to the share type obtained by the processing logic specified in section 3.2.5.4 or in \[MS-SMB2\] section 3.2.4.2.4. + +**ClientGenericContext** and **ShareType** MUST be returned to the caller. + +#### A Local Client Application Requests a Tree Disconnect + +The caller supplies the **ClientGenericContext** structure returned by the interface specified in section [3.4.4.10](#Section_6d776ad6fd9940b586553fcef6cb7a02) and the optional _ForceLevel_ to disconnect the connection. + +If the _ForceLevel_ value is 0x00000002, then based on the **ClientGenericContext.ProtocolDialect** field value and the tree connect represented by the **ClientGenericContext.ProtocolSpecificOpen**, the client MUST invoke the event specified in section [3.2.4.24](#Section_cbce4d659c874d7ea121730932263936) or in [\[MS-SMB2\]](%5bMS-SMB2%5d.pdf#Section_5606ad475ee0437a817e70c366052962) section 3.2.4.22 and disconnect the tree connection. + +If the _ForceLevel_ value is 0x00000000 or 0x00000001, then based on the **ClientGenericContext.ProtocolDialect** field value and the tree connect represented by the **ClientGenericContext.ProtocolSpecificOpen**, the client MUST invoke the event specified in section [3.2.4.46](#Section_dd4363b135d043578d096efe08ea0ab9) or in \[MS-SMB2\] section 3.2.4.26 for number of open files on the tree connect. + +- If the number of open files on the connection is equal to zero, based on the **ClientGenericContext.ProtocolDialect** field value and the tree connect represented by the **ClientGenericContext.ProtocolSpecificOpen**, the client MUST invoke the event specified in section 3.2.4.24 or in \[MS-SMB2\] section 3.2.4.22 and disconnect the tree connection. +- Otherwise, the server MUST fail the call with an implementation-specific error code. + +#### A Local Client Application Queries the Extended DFS Referral Capability + +This is an optional interface to be implemented by the client. + +The caller supplies the **ClientGenericContext** structure returned by the interface specified in section [3.4.4.7](#Section_3c90e44ecc2e4bf599828e3ec7a850db). + +If **ClientGenericContext.ProtocolDialect** indicates the CIFS or the SMB protocol, or either of SMB2 dialects 2.002 or 2.100, the client MUST return FALSE; otherwise, it MUST return TRUE. + +### Message Processing Events and Sequencing Rules + +None. + +### Timer Events + +None. + +### Other Local Events + +None. + +## Local Interface Details for RPC Server Applications + +The content in this section provides a unified interface for [**RPC server**](#gt_ae65dac0-cd24-4e83-a946-6d1097b71553) applications that use [**named pipes**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca) over the [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) family of protocols. Because named pipe traffic can flow over the protocols specified in \[MS-CIFS\] or [\[MS-SMB2\]](%5bMS-SMB2%5d.pdf#Section_5606ad475ee0437a817e70c366052962), these interfaces are written so that the higher-layer RPC server application is isolated from the specifics of the underlying protocol. Implementations that support RPC server applications SHOULD support the interfaces defined in this section. + +This section provides a protocol-independent abstraction for RPC servers running over named pipes. It does not introduce any new semantics or state to the protocol specified in \[MS-CIFS\]. + +To simplify this interface, a composite structure **RPCServerGenericNamedPipeOpen** is defined to encapsulate the underlying protocol and the protocol-specific server side [**open**](#gt_0d572cce-4683-4b21-945a-7f8035bb6469) to a named pipe. The structure has the following fields: + +**RPCServerGenericNamedPipeOpen.ProtocolDialect:** The protocol dialect associated with the open. + +**RPCServerGenericNamedPipeOpen.ProtocolSpecificOpen:** The protocol-specific Server.Open, as specified in section [3.3.1.7](#Section_738e3f3cabff439bbd4f0fe36aee1ce8) and in \[MS-SMB2\] section 3.3.1.10. + +This structure MUST be considered opaque to the caller. + +### Abstract Data Model + +None. + +### Timers + +None. + +### Initialization + +None. + +### Higher-Layer Triggered Events + +#### An RPC Server Application Waits for Clients to Open a Named Pipe + +The RPC application provides: + +- The name of the pipe. + +The server MUST wait on the underlying [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca) [**object store**](#gt_0cc469e1-4b1f-41c4-9f94-d6209fcf468e) for clients to open the specified named pipe. When a client opens the pipe as specified in sections [3.3.5.5](#Section_91838c728a744f758a266ae95eb6c5f5), [3.3.5.35](#Section_723c1f8e385b45d583f9a1ceb3a6ba6b) or [3.3.5.51](#Section_d11800d00b444966b951b103bc252ba0), or in [\[MS-SMB2\]](%5bMS-SMB2%5d.pdf#Section_5606ad475ee0437a817e70c366052962) section 3.3.5.9, the server MUST initialize a new **RPCServerGenericNamedPipeOpen** structure as follows: + +The **RPCServerGenericNamedPipeOpen.ProtocolDialect** field MUST be set to an implementation-specific identifier indicating the protocol (either that specified by \[MS-CIFS\] or by \[MS-SMB2\]) on which the client opened the pipe. The value derived from **Connection.NegotiateDialect** specified in \[MS-SMB2\] section 3.3.1.7 or from **Server.Connection.SelectedDialect** specified in section [3.3.1.3](#Section_592b9143f8594ece82442353c78a04cb) can be used as a protocol identifier. + +The **RPCServerGenericNamedPipeOpen.ProtocolSpecificOpen** field MUST be set to the protocol-specific **Server.Open** constructed as specified in sections [3.3.5.6](#Section_782ed034df484e9da0696be5d906382e) or 3.3.5.51, or in \[MS-SMB2\] section 3.3.5.9. + +The server MUST return the newly-constructed **RPCServerGenericNamedPipeOpen** structure to the caller. + +#### An RPC Server Application Closes its Open to a Named Pipe + +The caller supplies the **RPCServerGenericNamedPipeOpen** structure returned by the interface specified in section [3.5.4.1](#Section_f07dfaffa8624747a5a59c7c0ef8a686). + +The server MUST call into the underlying [**object store**](#gt_0cc469e1-4b1f-41c4-9f94-d6209fcf468e) to close the [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca) identified by the **RPCServerGenericNamedPipeOpen.ProtocolSpecificOpen** field. + +#### An RPC Server Application Requests the Security Context of a Client + +The caller supplies the **RPCServerGenericNamedPipeOpen** structure returned by the interface specified in section [3.5.4.1](#Section_f07dfaffa8624747a5a59c7c0ef8a686). + +Based on the value of the **RPCServerGenericNamedPipeOpen.ProtocolDialect** field, the request MUST be handled as specified in section [3.3.4.7](#Section_c0c86a311e3b4e6f8f4bd4006461d093) or in [\[MS-SMB2\]](%5bMS-SMB2%5d.pdf#Section_5606ad475ee0437a817e70c366052962) section 3.3.4.10. + +#### An RPC Server Application Requests the Session Key of a Client + +The caller supplies the **RPCServerGenericNamedPipeOpen** structure returned by the interface specified in section [3.5.4.1](#Section_f07dfaffa8624747a5a59c7c0ef8a686). + +Based on the value of the **RPCServerGenericNamedPipeOpen.ProtocolDialect** field, the request MUST be handled as specified in section [3.3.4.6](#Section_c1401b93b1884a3b9b9851507e0e1cc9) or in [\[MS-SMB2\]](%5bMS-SMB2%5d.pdf#Section_5606ad475ee0437a817e70c366052962) section 3.3.4.5. + +### Message Processing Events and Sequencing Rules + +None. + +### Timer Events + +None. + +### Other Local Events + +None. + +# Protocol Examples + +The following sections describe common scenarios that indicate normal traffic flow on the wire in order to illustrate the function of the [**CIFS**](#gt_fb37399e-d72d-41b6-b073-086da2d96e09) Protocol. + +## Negotiate and Tree Connect Example + +This example illustrates a simple scenario of protocol negotiation and connecting to a share. + +![Protocol negotiation and connecting to a share](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbIAAAE6CAYAAABzkNepAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADAQAAAwJAW6MfOsAADmTSURBVHhe7Z0vmBRJ9rURI5DIkYgRiBFIxAjECMQIzIoRK1asGLECgUAgViB/EolAYEYgEIgRiBWIFYgVCARiBXIEAlvf9/b06T11JzIrsysjqao+7/PEk5kRN278yYh7Kqob+trvv/++efz4cdKCiTkNIYTKly9fNk+ePGnGjaTLpY8fP26ucXP37t2mQdL8pLkMIYTKs2fPNrdv3/5T3Ei6XLp///7mb3/72x9CRgrLkPkMIQyBkBF4wzJoPiNkC5P5DCEMESFblghZJzKfIYQhImTLEiHrROYzhDBEhGxZImSdyHyGEIaIkC1LhKwTmc8QwhARsmWJkHUi8xlCGCJCtiwRsk5kPkMIQ0TIliVC1onMZwhhiAjZskTIOpH5DCEMESFblghZJzKfIYQhImTLEiHrROYzhDBEhGxZImSdyHyGEIaIkC1LhKwTmc8QwhARsmWJkHUi8xlCGCJCtiwRsk5kPkMIQ0TIliVC1onMZwhhiAjZskTIOpH5DCEMESFblghZJzKfIYQhImTLEiHrROYzhDBEhGxZDk7I3r17d3533ETIQghDRMiWZXUhe/r06eaHH364SA8fPtx8+PDhvHSz+e677y7EjI4t+bLfvHlz1v4aRMhCCEP0ErJXr15txdf79+9vnj9/fl56uqwqZJpcJhaxQlhonDzhQoboLCk8T5482WqrJxGy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EELYIieyPYmQhRDC1yVCticRshBCCHOIkIUQQtgiJ7I9iZCFEMLXJUK2J4jSzZs3N48fP56UsI2QhRDC1eXghOzXX3/d/P3vf/+TYOnkVfOxpU4IIYRlyImsExKuEEIIfYmQhRBCCCuSE1kIIYQtciLrRIQshBDWIUIWQgghrEhOZCGEELbIiawTEbIQQliHCFkIIYSwIjmRhRBC2CInsk5EyEIIYR0iZCGEEMKK5EQWQghhi5zIOhEhCyGEdYiQhRBCCCuSE1kIIYQtciLrRIQshBDWIUIWQgghrEhOZCGEELbIiawTEbIQQliHCFkIIYSwIjmRhRBC2CInsk5EyEIIYR0iZCGEEMKK5EQWQghhi5zIOhEhCyGEdYiQhRBCCCuSE1kIIYQtciLrRIQshBDWIUIWQgghrEhOZCGEELbIiawTEbIQQliHCFkIIYSwIjmRhRBC2CInsk5EyEIIYR0iZCGEEMKK5EQWQghhi5zIOhEhCyGEdYiQhRBCCCuSE1kIIYQtciLrxLt37zZv3rw5fwohhNCL9+/fb16/fn3+dOhsNv8PC9NRCKTa7scAAAAASUVORK5CYII=) + +Figure 10: Protocol negotiation and connecting to a share + +This capture was produced by mapping a drive letter on a Windows 98 operating system client to a share served by Windows NT Server 4.0 operating system Service Pack 6a (SP6a). The content was produced by executing the following command at an MS-DOS prompt on a Windows 98 client: + +- C:\\> net use y: \\\\10.9.9.47\\testshare1 + +## Disconnect Example + +This example illustrates a client disconnecting from a share. An [**SMB connection**](#gt_e1d88514-18e6-4e2e-a459-20d5e17e9078) and an [**SMB session**](#gt_ee1ec898-536f-41c4-9d90-b4f7d981fd67) are already assumed to have been successfully completed. + +![Disconnecting from a share](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZoAAACqCAYAAACUC4l6AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAC1oAAAtsAYBqooUAABlsSURBVHhe7Z0hlBRJFkURK0YiRyJGjESOQLRYgRjRdsSKFStWrEAgEEgkEjkCgRmJQCJGrFiB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EIUeayNB4+fPhwfjSP3mOaKna8sbzBEUxe6VPfcI4RScxj7qOriPIUiH1rANAzmtZc6vEx2BG184hJhMyVVyA/57xSmCtw/axV+rNWdWdSIVfyiXyLaDSDQJwOiWvLkvhXr15d/POpS0AMD41BG2LJK7+X5LW+4dS1BUM4xLGdB/OKgFfIXR+d9VhyMyL27TiM3e6mmG9MY8o8piAXY8Q8UzBs/2pKvlU0mkFEhOdyLJ7dC6JY/3nVu3fvnrfOhzF4A3nlzUQAA3WIcQyJdiA+38gTE2JExx4D0Y+8LRFf2hHkwNjUhXbcwNhLzUBErheNZhAIYxXKY0zF88+p/vOf/9zdvn37wmBS7ty5cx61DASbgrAzZgSe42oodTeR+nxTr8wxGvoTx+6H45hZNR9urrobqPR+w6lgNuSiHyW5eHUnIfJl0WgGgYhS5tLGv3jxYnf//v0/mUstf/nLX3aPHz++KDxKS4kxHTOj+jsLb27MpUJ7jAYRxyyI4zhiPgfMKGbA6zFzWgJGwxzd3YjcPDSaQSDOiHw1gkOF2J9++ulMhDluTWWq1ByIf0rvDwUQYfJH4Hllnnl8RhulBTPJzoPX/EhPOSTsCD9lTUMRke2BcfDlt+rVocLPAhrNDH777bfdP/7xjz8tIMJOaetrLDuSnqn0yrt3785HnAdvOOPzJmIg9TcaDOqypkA/cpOzGhHG5C5D5Nvm999/3/3tb3/7TPMoP//885mptPX/+te/dk+fPj3vfXO4cUYzRRZyDgg/sYeMh99wRES2yK+//nr2BXUrbMZorkLPeKgTEZHxfJU7mmNgMksfnYmI3BTc0QxiTaMREdkyGo2IiEjBHY2IyMZwRzMIjUZEZI9GIyIiUnBHIyKyMdzRDEKjERHZo9GIiIgU3NGIiGwMdzSD0GhERPZoNCIiIgV3NCIiG8MdzSD4h8D8Py6LiOz/qfpXr16dn910drv/AyO2snALqpu3AAAAAElFTkSuQmCC) + +Figure 11: Disconnecting from a share + +The share used here was served from Windows NT Server 4.0 SP6a. It was mapped as drive Y: on a Windows 98 client. + +The user operation performed was: + +- C:\\> net use y: /d + +## Message Signing Example + +This example illustrates the use of the [**CIFS**](#gt_fb37399e-d72d-41b6-b073-086da2d96e09) message signing capability when connecting to a share. + +![Message signing when connecting to a share](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbIAAAGaCAYAAABqjMZHAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADAQAAAwNAQrgue8AAFoiSURBVHhe7Z0tlBxHloUFDAwWCAosEBggYNBggMCABgYCA0wGGAxYaLBAwECgwQBDQ0MBA5EBAgYCCwwWCCwwWCBgILDA0MBAtPd85b49t58jf6K7IlVVfb9z4mRmxIsXPxnxbkV1S/3g119/vby4uEjaY2JOQwih8uHDh8tvvvmmGTeSbpfev39/+YCb8/PzpkFSf9JchhBC5eXLl5dnZ2d/iBtJt0tffPHF5X/8x3/8LmSksB8ynyGEKRAyAm/YD5rPCNmeyXyGEKaIkO2XCNkgMp8hhCkiZPslQjaIzGcIYYoI2X6JkA0i8xlCmCJCtl8iZIPIfIYQpoiQ7ZcI2SAynyGEKSJk+yVCNojMZwhhigjZfomQDSLzGUKYIkK2XyJkg8h8hhCmiJDtlwjZIDKfIYQpImT7JUI2iMxnCGGKCNl+iZANIvMZQpgiQrZfImSDyHyGEKaIkO2XCNkgMp8hhCkiZPslQjaIzGcIYYoI2X6JkA0i8xlCmCJCtl8iZIPIfIYQpoiQ7ZcI2SAynyGEKSJk+yVCNojMZwhhigjZfjk4Ifvpp5+u7o6bCFkIYYoI2X7ZXMi+++67y7/85S/X6euvv778+eefr0ovL//0pz9dixkd2+fL/vHHH3ftb0GELIQwxSgh++GHH27E1y+++OLy+++/vyo9XTYVMk0uE4tYISw0Tp5wIUN09ik833zzzY22RhIhCyFMMULIiJXET8VXEgcF8k6dzYRsTkQkXOBC9ttvv904rcEvv/yy80VCCB1sqUM+5VUEean0QS95JBGyEMIUI4SM2EbcWwNi14qRoNhIPOW+FYehxtA1sRnkc59sJmQI1JpJdiHD3sWPyZcfUvWJ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tiJANIkIWQgjbECEbRIQshBC2IUI2iAhZCCFsA8L08OHDy4uLi1Xp7OwsQraGCFkIIWzDf//3f1/+/e9//4Ng/fWvf92JVs3/z//8z8tvv/32qvbhECELIYRwg5cvX+5Oa8dChCyEEMJREyELIYRwg5zI7kiELIQQPi4RsjsSIQshhNBDhCyEEMINciK7IxGyEEL4uETI7kiELIQQQg8RshBCCDfIieyORMhCCOHjEiG7IxGyEEIIPUTIQggh3CAnsjsSIQshhI9LhOyORMhCCCH0ECELIYRwg5zI7kiELIQQPi4RsjsSIQshhNBDhCyEEMINciK7IxGyEEL4uETI7kiELIQQQg8RshBCCDfIieyORMhCCOHjEiG7IxGyEEIIPUTIQggh3CAnsjsSIQshhI9LhOyORMhCCCH0cJBCdnZ2dvnjjz+uSthGyEIIYX/kRHZH/vnPf+7E6fz8/EZ68uTJLtX8P//5z5fffvvtVe0QQgh3JUIWQgghbMjRCNnFxcUuhRBCGEtOZIOIkIUQwjZEyEIIIYQNyYkshBDCDXIiG0SELIQQtiFCFkIIIWxITmQhhBBukBPZICJkIYSwDRGyEEIIYUNyIgshhHCDnMgG8dNPP+3+k+AQQghjeffu3eWbN2+ung6dy8v/B+8FoJ9gdTPyAAAAAElFTkSuQmCC) + +Figure 12: Message signing when connecting to a share + +The example is a result of configuring a server running Windows NT Server 4.0 SP6a both to allow and require message signing (see [\[ENSIGN\]](https://go.microsoft.com/fwlink/?LinkId=161959) for information on configuring the registry for this feature), and likewise configuring a Windows NT Workstation 4.0 operating system Service Pack 6a (SP6a) client for message signing. A share from the server was then mapped to a drive letter on the client machine: + +- C:\\> net use y: \\\\10.9.9.47\\testshare1 + +FRAME 1. The first step is the negotiation request. This is the usual offer of dialects and exchange of the **Flags** and **Flags2** fields in the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f) of the [SMB_COM_NEGOTIATE Request (section 2.2.4.52.1)](#Section_25c8c3c958fc4bb8aa8f0272dede84c5). The SMB_FLAGS2_SMB_SECURITY_SIGNATURE bit in the **Flags2** field is cleared, and the **SecuritySignature** field is set to 0x0000000000000000. No security signature is generated at this stage. + +FRAME 2. The negotiate response has the SMB_FLAGS2_SMB_SECURITY_SIGNATURE bit in the **Flags2** field cleared, and the **SecuritySignature** field is set to 0x0000000000000000. No signature is generated at this stage. + +FRAME 3. The next exchange takes advantage of ANDX message batching. Two requests are sent together; the first [SMB_COM_SESSION_SETUP_ANDX Request (section 2.2.4.53.1)](#Section_81e15dee8fb6410286447eaa7ded63f7) is sent along with an [SMB_COM_TREE_CONNECT_ANDX Request (section 2.2.4.55.1)](#Section_90bf689a85364f039f1b683ee4bdd67c). The SMB_FLAGS2_SMB_SECURITY_SIGNATURE bit in the **Flags2** field is cleared in this request, and the **SecuritySignature** field is set to 0x0000000000000000. The tree connect attempt is to IPC\$. + +FRAME 4. The ANDX response contains a **SecuritySignature** field set to 0x0000000000000000, and the SMB_FLAGS2_SMB_SECURITY_SIGNATURE bit in the **Flags2** field bit is cleared. + +FRAME 5. Next, another ANDX request consisting of an SMB_COM_SESSION_SETUP_ANDX Request and another SMB_COM_TREE_CONNECT_ANDX Request is sent. This is the attempt to connect to the share. + +FRAME 6. Note that this time, the SMB_FLAGS2_SMB_SECURITY_SIGNATURE bit in the **Flags2** field is set, and the **SecuritySignature** field contains a valid signature. From this point on, all messages will be signed. + +## Get File Attributes Example + +This example illustrates the process of getting the attributes information from a file. An [**SMB connection**](#gt_e1d88514-18e6-4e2e-a459-20d5e17e9078) and an [**SMB session**](#gt_ee1ec898-536f-41c4-9d90-b4f7d981fd67) are already assumed to have been successfully completed. + +![Getting file attributes information](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbIAAAHiCAYAAACN/UnrAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADAQAAAwDAZRjlGEAAFQDSURBVHhe7Z0tmBTJmrYRIxArECtGrGhxBALR4gjEiBYjEEdgRoxYsXLECgQCgUSuRCIQmCMQCMQKx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CGEJByky/vkA/7fBpgqxEVkIIeyPrMguyN///vetnPxfZKbcvn17W2r9X//614P893FCCOGyEpGFEEIIK3JpRKZ/oTSEEMJYsiIbREQWQgjrEJGFEEIIK5IVWQghhHNkRTaIiCyEENYhIgshhBBWJCuyEEII58iKbBARWQghrENEFkIIIaxIVmQhhBDOkRXZICKyEEJYh4gshBBCWJGsyEIIIZwjK7JBRGQhhLAOEVkIIYSwIlmRhRBCOEdWZIOIyEIIYR0ishBCCGFFsiILIYRwjqzIBhGRhRDCOkRkIYQQwopkRRZCCOEcWZEN4t27d5s3b96c7oUQQhjF+/fvN69fvz7dO3Q2m/8HOfyo30ogchwAAAAASUVORK5CYII=) + +Figure 13: Getting file attributes information + +The share used here was served from Windows NT Server 4.0 SP6a. It was mapped as drive Y: on a Windows 98 client. The following operation was performed in an MS-DOS window: + +- C:\\> attrib y:\\text.txt + +## Set File Attributes Example + +This example illustrates the process of setting attribute information for a file. An [**SMB connection**](#gt_e1d88514-18e6-4e2e-a459-20d5e17e9078) and an [**SMB session**](#gt_ee1ec898-536f-41c4-9d90-b4f7d981fd67) are already assumed to have been successfully completed. + +![Setting file attribute information](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbIAAAJmCAYAAAA5NAW4AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADaAAAA2ZATr1xIoAAGjRSURBVHhe7b0veNxYmn8f0CBggcGCBgsCBgQ0MPiCgAEGDQIGhAxoMGBhgwUBAQGGgQsDFgQEhCwICAgYELAgYEDAgoCAgAGBDQICltTvd6r98by+I6kku65Sts95nvuUdPXeP1JJ7/GV3Z07v/322+b09NSyx8I1FRFp+fbt2+bZs2eDecNyufL58+fNHTZOTk4GAyzLS66liEjLixcvNsfHx/+UNyyXK48ePdr8+7//++8io8h+8HqKyBiIjMQr+yHXU5HtGa+niIyhyPaLIuuE11NExlBk+0WRdcLrKSJjKLL9osg64fUUkTEU2X5RZJ3weorIGIpsvyiyTng9R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B8R0dHS0OT09nVWOj48V2RwUmYjIOvzP//zP5i9/+cs/CetPf/rTVlpt/X/8x39s/vM///Os9eGgyERE5AIvXrzYrtauC4pMRESuNYpMREQu4IrsiigyEZHviyK7IopMRESWoMhEROQCrsiuiCITEfm+KLIroshERGQJikxERC7giuyKKDIRke+LIrsiikxERJagyERE5AKuyK6IIhMR+b4osiuiyEREZAmKTERELuCK7IooMhGR74siuyKKTERElqDIRETkAq7IrogiExH5viiyK/Lo0aPN0dHR5uTkZFYh9ueffz5rLSIit42DExn89a9/3bx79+5C+ctf/rItbT3lt99+O2spIiJXxRVZJ05PT7dFRET6oshERERWxBWZiIhcwBVZJxSZiMg6KDIREZEVcUUmIiIXcEXWCUUmIrIOikxERGRFXJGJiMgFXJF1QpGJiKyDIhMREVkRV2QiInIBV2SdUGQiIuugyERERFbEFZmIiFzAFVknFJmIyDooMhERkRVxRSYiIhdwRdYJRSYisg6KTEREZEVckYmIyAVckXVCkYmIrIMiExERWRFXZCIicgFXZJ1QZCIi66DIREREVsQVmYiIXMAVWScUmYjIOigyERGRFXFFJiIiF3BF1okPHz5s3r17d7YnIiK9+Pjx4+bt27dne4fOZvP/AakoHiFqIvPTAAAAAElFTkSuQmCC) + +Figure 14: Setting file attribute information + +The share used here was served from Windows NT Server 4.0 SP6a. It was mapped as drive Y: on a Windows 98 client. The operation performed was in an MS-DOS window: + +- C:\\> attrib +r y:\\text.txt + +## Copy File from Share Example + +This example illustrates the process of copying a file from a share to a client (downloading). An [**SMB connection**](#gt_e1d88514-18e6-4e2e-a459-20d5e17e9078) and an [**SMB session**](#gt_ee1ec898-536f-41c4-9d90-b4f7d981fd67) are already assumed to have been successfully completed. + +![Command to copy y:\text.txt to the current directory](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeIAAAKWCAYAAACVsprpAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADqkAAA6pAfESB3UAAJ9KSURBVHhe7Z0tlBxJlqUFBRY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4hBCCDfIo+njMpwQ//zzz1cPHjxYlWgTQghhP+TR9HEZToh7/Prrr7sUQgjhsOTR9HE5GSHmxCCFEEI4LHk0fVxORogvLi52KYQQwmHJo+njkkfTIYQQbpBH08flZISYxyQR4hBCODx5NH1cTkaILy8vr75+/Xq9F0II4VDk0fRxORkhDiGEcBzyaPq4RIhDCCHcII+mj0uEOIQQwg3yaPq4RIhDCCHcII+mj0uEOIQQwg3yaPq4RIhDCCHcII+mj0uEOIQQwg3yaPq4RIhDCCHcII+mj0uEOIQQwg3yaPq4RIhDCCHcII+mj0uEOIQQwg0Q4tevX1/vhUMTIQ4hhHCDvNv/mFxd/X+oMwt4IbrqKgAAAABJRU5ErkJggg==) + +Figure 15: Command to copy y:\\text.txt to the current directory + +The share used here was served from Windows NT Server 4.0 SP6a. It was mapped as drive Y: on a Windows 98 client. The operation performed was in an MS-DOS window. + +- C:\\> copy y:\\text.txt . + +## Copy File to Share Example + +This example illustrates the process of copying a file from the client to a share (uploading). An [**SMB connection**](#gt_e1d88514-18e6-4e2e-a459-20d5e17e9078) and an [**SMB session**](#gt_ee1ec898-536f-41c4-9d90-b4f7d981fd67) are already assumed to have been successfully completed. + +![Copying a file from a client to a share](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbIAAAKWCAYAAAAsphyhAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADq0AAA6pAWqDRWMAAJ6qSURBVHhe7Z0hlBw5lrUbGvzAYIFBA4MFBg0MGhgsMFhgsKDJAoMBCw0NGhg0GDBggOGABQ0GmCwwGGCwYKDhQIMBBgsGLDBoYLCk/vNV13XfepYiQlWpqMyq+52jExHSk/SkiHg3FVkV+c2nT5/Ofvrpp6QDJuY0hBAqnz9/PvvDH/7QjBtJV0sfP348+4adp0+fNg2SxpPmMoQQKj///PPZ48ePv4obSVdLP/zww9l//Md//CpkpHAYMp8hhB4IGYE3HAbNZ4TswGQ+Qwg9ImSHJUI2icxnCKFHhOyw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4XHwJ7FR8E8Jhg5aRVDyJUV1LXER1fEblYbhG7EMLNEiGbxFWEjN/06a2+eolHey4+rExCCOEuESGbxFWEjMQfQfATDPwuUOsH7Go6tlVTCCHsTYRsElcVsgpCxeMt/hCi/sFEhCyEECJk0ziUkFX43zG+u+FP7xGyu/a/ZCGEUImQTWKWkDn8JeAh/howhBBOmQjZJPYQshBCCL8KE38o53/4tpT4a+8I2QYiZCGEsA/89fZ333331b8Z8RUMqeZ///33Z7///e8vah8PEbIQQgiX4OUMrNZOhQhZCCGES7BS44/jToUIWQghhEvw9p8PHz5cHB0/EbIQQgiXyKPFaxIhCyGEmyWPFq9JhCyEEG6WPFq8JhGyEEK4WfJo8ZpEyEII4WbJo8VrEiELIYSbJY8Wr0mELIQQbpY8WrwmEbIQQrhZ8mjxmkTIQgjhZsmjxWsSIQshhJsljxavSYQshBBuljxavCYRshBCuFnyaPGaRMhCCOFmyaPFaxIhCyGEmyWPFq/JDz/8cPbNN98MJeqEEEI4DHm0OImffvrpPIUQQphLHi1OgoklhRBCmEseLU7i48eP5ymEEMJc8mhxEnm0GEII+5BHi5NgmRshCyGE+eTR4iQ+f/589unTp4ujEEIIs8ijxRBCCCdNHi2GEEI4afJoMYQQwkmTR4shhBBOmjxaDCGEcNLk0WIIIYSTJo8WQwghnDR5tBhCCOGkyaPFEEIIJ00eLYYQQjhp8mgxhBDCSYOQvXjx4uLo+ImQhRBCuMRpvdv27Oz/AzFHDQOHIOq3AAAAAElFTkSuQmCC) + +Figure 16: Copying a file from a client to a share + +The share used here was served from Windows NT Server 4.0 SP6a. It was mapped as drive Y: on a Windows 98 client. The operation performed was in an MS-DOS window: + +- C:\\> copy text.txt y:\\text.txt + +# Security + +The following sections specify security considerations for implementers of the CIFS Protocol. + +## Security Considerations for Implementers + +A CIFS server can permit anonymous or [**guest account**](#gt_0377d4d6-d45e-4121-8f20-cba8f7fbb7a4) logons. Such unauthenticated logons can provide access to services that need to be protected, and that can potentially expose vulnerabilities in the implementation.[<358>](#Appendix_A_358) + +Share level access control passwords are transmitted in plaintext. The server can also indicate that it requires plaintext user level authentication. A "man-in-the-middle" attack can be used to clear the bit in the SMB_COM_NEGOTIATE response that indicates that the server supports challenge/response authentication, thus causing the client to assume that plaintext authentication is required.[<359>](#Appendix_A_359) + +Several weaknesses in the LAN Manager (LM) challenge/response authentication scheme have been discovered and published. CIFS usage of LM challenge/response is specified in section [3.1.5.2](#Section_4d1a2cb00951462a8582121fd1afe28e). + +Neither the LM nor the NTLM challenge/response algorithm includes a client nonce. A client nonce is used to protect against dictionary attacks by rogue servers. The LMv2 and NTLMv2 challenge/response algorithms do include a client nonce. + +Message signing is optional. Message signing is used to prevent connection hijacking. + +The protocol does not sign OpLock break requests from the server to the client if message signing is enabled. This can allow an attacker to affect performance but does not allow an attacker to deny access or alter data. + +The algorithm used for message signing has been shown to be subject to collision attacks. For more information, see [\[MD5Collision\]](https://go.microsoft.com/fwlink/?LinkId=89937). + +The protocol does not encrypt the data that is exchanged. To provide stricter data security, the underlying transport provides encryption. Otherwise, a different protocol is more applicable. + +## Index of Security Parameters + +| Security Parameter | Section | +| ---------------------------------------------------- | ------------------------------------------------------ | +| Unauthenticated clients (anonymous and guest access) | [3.2.4.2.3](#Section_ae1903c351c54b8dbf637c9ebd461838) | +| Share versus user access control | [3.2.4.2.4](#Section_3a3cdd475b43427691f5645b82b0938f) | +| Plain Text Authentication | 3.2.4.2.3 | +| Challenge Response | [3.2.4.2.2](#Section_0509a819389642948fb20f299770a8e4) | +| Message Signing | [3.1.4.1](#Section_68c3d17ae48e4eb4b97e3246bfe0262f) | + +# Appendix A: Product Behavior + +The information in this specification is applicable to the following Microsoft products or supplemental software. References to product versions include updates to those products. + +- Windows NT Server 3.51 operating system +- Windows NT Server 4.0 operating system +- Windows NT Workstation 4.0 operating system +- Windows 98 operating system +- Windows 98 operating system Second Edition + +Exceptions, if any, are noted in this section. If an update version, service pack or Knowledge Base (KB) number appears with a product name, the behavior changed in that update. The new behavior also applies to subsequent updates unless otherwise specified. If a product edition appears with the product version, behavior is different in that product edition. + +Unless otherwise specified, any statement of optional behavior in this specification that is prescribed using the terms "SHOULD" or "SHOULD NOT" implies product behavior in accordance with the SHOULD or SHOULD NOT prescription. Unless otherwise specified, the term "MAY" implies that the product does not follow the prescription. + +[<1> Section 2.1](#Appendix_A_Target_1): On Windows, SMB transports are supported as TDI Transport Drivers, as described in [\[MSDN-TrnspDrvIntfc\]](https://go.microsoft.com/fwlink/?LinkId=214278). + +[<2> Section 2.1.1](#Appendix_A_Target_2): On MS-DOS, OS/2, and Windows systems, NetBIOS presents a common API. The [**CIFS**](#gt_fb37399e-d72d-41b6-b073-086da2d96e09) implementations on these platforms are written to use the NetBIOS API, which makes it possible to interchange NetBIOS-based transports without modifying the CIFS implementation itself. Implementation of the NetBIOS API is not necessary for CIFS interoperability. + +[<3> Section 2.1.1](#Appendix_A_Target_3): Windows NT Server operating system drops the transport connection and does not return an error message response with an [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) error class of ERRCMD (0xFF). + +[<4> Section 2.1.1.2](#Appendix_A_Target_4): The Windows NT operating system implementation of the NetBIOS Name Service for NBT is known as the Windows Internet Name Service (WINS). The Windows NT implementation of the NetBIOS Name Server (NBNS) is known as a WINS server. + +Microsoft's implementation of NBT for Windows NT and Windows 98 diverges from the standard specified in [\[RFC1001\]](https://go.microsoft.com/fwlink/?LinkId=90260) and [\[RFC1002\]](https://go.microsoft.com/fwlink/?LinkId=90261). There are several modifications and additions to the prescribed behavior of the name service, and the implementation of the datagram service is incomplete. See \[IMPCIFS\] for a discussion of some of these variations. Windows-specific extensions to NBT are documented in [\[MS-NBTE\]](%5bMS-NBTE%5d.pdf#Section_3461cfa83d284fa38163131bf1046fa3). + +[<5> Section 2.1.2](#Appendix_A_Target_5): Direct TCP Transport is probably the best-known example of direct hosting. Direct TCP Transport is described in [\[MS-SMB\]](%5bMS-SMB%5d.pdf#Section_f210069c70864dc2885e861d837df688). CIFS does not support Direct TCP Transport, because it was developed for Windows 2000 operating system and is not supported on Windows NT or Windows 98. + +[<6> Section 2.1.2.1](#Appendix_A_Target_6): The recommended maximum interval between SMB requests is four (4) minutes. Windows NT Server 4.0 has a default time-out value of 15 minutes. + +[<7> Section 2.1.3](#Appendix_A_Target_7): Windows NT Server 4.0 always sends a zero value for **SessionKey**. + +[<8> Section 2.1.3](#Appendix_A_Target_8): Windows-based CIFS servers set **MaxNumberVcs** in the server's SMB_COM_NEGOTIATE response to 0x0001, but do not enforce this limit. This allows a CIFS client to establish more [**virtual circuits**](#gt_cb807fcb-1083-4081-b497-69b81d269a6b) than allowed by this value. + +[<9> Section 2.1.3](#Appendix_A_Target_9): Windows NT Server does disconnect all existing transport-level connections from a client when it receives a new SMB_COM_SESSION_SETUP_ANDX request from that client with a **VcNumber** value of zero. + +[<10> Section 2.2.1.1.3](#Appendix_A_Target_10): CIFS wildcard characters are based on Windows wildcard characters, as described in [\[MS-FSA\]](%5bMS-FSA%5d.pdf#Section_860b1516c45247b4bdbc625d344e2041) section 2.1.4.4, Algorithm for Determining if a FileName Is in an Expression. For more information on wildcard behavior in Windows, see [\[FSBO\]](https://go.microsoft.com/fwlink/?LinkId=140636) section 7. + +[<11> Section 2.2.1.2.1.1](#Appendix_A_Target_11): Windows clients include both the size of the **SizeOfListInBytes** field and the total size of the **GEAList** field when calculating the value passed in the **SizeOfListInBytes** field for compatibility with dialects less than the LAN Manager 1.2 dialect, as implemented in OS/2 v1.2. See [\[XOPEN-SMB\]](https://go.microsoft.com/fwlink/?linkid=2297696) sections 4.3.7 and 16.1.5 for more information. + +[<12> Section 2.2.1.2.2](#Appendix_A_Target_12): The [SMB_FEA (section 2.2.1.2.2)](#Section_53d6fe8e489a4ec6bf98a3040baad686) structure originated with the LANMAN1.2 dialect and is, therefore, used in Trans2 calls, the majority of which also originated in the LANMAN1.2 dialect. See \[XOPEN-SMB\] section 16.1.5 for a detailed description of the SMB_FEA structure. NT_TRANSACT_CREATE makes use of the FILE_FULL_EA_INFORMATION structure, which is similar to SMB_FEA. See [\[MS-FSCC\]](%5bMS-FSCC%5d.pdf#Section_efbfe12773ad41409967ec6500e66d5e) for information on the FILE_FULL_EA_INFORMATION structure. + +[<13> Section 2.2.1.2.2.1](#Appendix_A_Target_13): Windows clients include both the size of the **SizeOfListInBytes** field and the total size of the **FEAList** field when calculating the value passed in the **SizeOfListInBytes** field. This is required for compatibility with dialects less than the LAN Manager 1.2 dialect, as implemented in OS/2 v1.2. See \[XOPEN-SMB\] sections 4.3.7 and 16.1.5 for more information. + +[<14> Section 2.2.1.2.3](#Appendix_A_Target_14): The file attributes encoded in the [**SMB_EXT_FILE_ATTR (section 2.2.1.2.3)**](#Section_6008aa8fd2d84366b775b81aece05bb1) data type are based on the native Windows file attributes described in \[MS-FSCC\] section 2.6 and listed in [\[MSDN-CreateFile\]](https://go.microsoft.com/fwlink/?LinkId=182698). The following table provides a mapping between the file attributes presented in this document and those in \[MS-FSCC\], as well as unsupported values and values unique to this document. + +| Name or Status in \[MS-CIFS\] | Name or Status in \[MS-FSCC\] | +| ----------------------------- | ---------------------------------- | +| ATTR_READONLY | FILE_ATTRIBUTE_READONLY | +| ATTR_HIDDEN | FILE_ATTRIBUTE_HIDDEN | +| ATTR_SYSTEM | FILE_ATTRIBUTE_SYSTEM | +| ATTR_DIRECTORY | FILE_ATTRIBUTE_DIRECTORY | +| ATTR_ARCHIVE | FILE_ATTRIBUTE_ARCHIVE | +| ATTR_NORMAL | FILE_ATTRIBUTE_NORMAL | +| ATTR_TEMPORARY | FILE_ATTRIBUTE_TEMPORARY | +| Not Supported in CIFS | FILE_ATTRIBUTE_SPARSE_FILE | +| Not Supported in CIFS | FILE_ATTRIBUTE_REPARSE_POINT | +| ATTR_COMPRESSED | FILE_ATTRIBUTE_COMPRESSED | +| Not Supported in CIFS | FILE_ATTRIBUTE_OFFLINE | +| Not Supported in CIFS | FILE_ATTRIBUTE_NOT_CONTENT_INDEXED | +| Not Supported in CIFS | FILE_ATTRIBUTE_ENCRYPTED | +| POSIX_SEMANTICS | Unique to CIFS/SMB | +| BACKUP_SEMANTICS | Unique to CIFS/SMB | +| DELETE_ON_CLOSE | Unique to CIFS/SMB | +| SEQUENTIAL_SCAN | Unique to CIFS/SMB | +| RANDOM_ACCESS | Unique to CIFS/SMB | +| NO_BUFFERING | Unique to CIFS/SMB | +| WRITE_THROUGH | Unique to CIFS/SMB | + +[<15> Section 2.2.1.2.3](#Appendix_A_Target_15): Use care when using this option because files created with this flag might not be accessible by applications written for MS-DOS, Windows 3.0 operating system, Windows NT 3.1 operating system, or Windows NT. + +[<16> Section 2.2.1.2.3](#Appendix_A_Target_16): Windows uses this flag to optimize file caching. If an application moves the file pointer for random access, optimum caching might not occur; however, correct operation is still guaranteed. Specifying this flag can increase performance for applications that read large files using sequential access. Performance gains can be even more noticeable for applications that read large files mostly sequentially, but occasionally skip over small ranges of bytes. + +[<17> Section 2.2.1.4.1](#Appendix_A_Target_17): The maximum value permitted in the **SMB_DATE.YEAR** field is 119, resulting in a year range of 1980 to 2099. + +[<18> Section 2.2.1.5](#Appendix_A_Target_18): Windows NT Server identifies these error codes as 32-bit values by leaving the SMB_FLAGS2_NT_STATUS bit set in the response to a request that also had the SMB_FLAGS2_NT_STATUS bit set. + +[<19> Section 2.2.1.6](#Appendix_A_Target_19): Windows-based clients set the **PID** to the process identifier of the actual calling process for the following commands. For all other commands, Windows-based clients set the **PID** value to 0x0000FEFF. + +- SMB_COM_NT_CREATE_ANDX (0xA2) +- SMB_COM_OPEN_PRINT_FILE (0xC0) +- All subcommands of SMB_COM_TRANSACTION (0x25) and SMB_COM_TRANSACTION_SECONDARY (0x26) except TRANS_MAILSLOT_WRITE, if **Client.Connection.ServerCapabilities** includes CAP_NT_SMBS. +- All subcommands of SMB_COM_TRANSACTION2 (0x32) and SMB_COM_TRANSACTION2_SECONDARY (0x33), if **Client.Connection.ServerCapabilities** includes CAP_NT_SMBS. + +[<20> Section 2.2.1.6.6](#Appendix_A_Target_20): Windows NT Server always returns 0x00000000 and ignores the **SessionKey** when it is sent by the client in an [SMB_COM_SESSION_SETUP_ANDX Request (section 2.2.4.53.1)](#Section_81e15dee8fb6410286447eaa7ded63f7). + +[<21> Section 2.2.1.6.8](#Appendix_A_Target_21): Windows NT Server uses this value internally as part of its list management mechanism. + +[<22> Section 2.2.2.3.3](#Appendix_A_Target_22): Windows NT always returns this string in Unicode-encoded format. + +[<23> Section 2.2.2.4](#Appendix_A_Target_23): Windows NT Server returns this error code if at least one command parameter fails validation tests such as a field value being out of range or fields within a command being internally inconsistent. + +[<24> Section 2.2.2.4](#Appendix_A_Target_24): This error code is defined as ERRinvtid in Windows 98. Windows NT uses a completely different naming style. + +[<25> Section 2.2.2.4](#Appendix_A_Target_25): Windows NT Server defines this class but does not return it. Windows NT client does not test for the ERRCMD class. In many instances, Windows-based servers close transport level connections if the incoming messages cannot be parsed. + +[<26> Section 2.2.3.1](#Appendix_A_Target_26): This bit is ignored by Windows systems, which always handle pathnames as case-insensitive. + +[<27> Section 2.2.3.1](#Appendix_A_Target_27): If CAP_STATUS32 has been negotiated during the [**SMB connection**](#gt_e1d88514-18e6-4e2e-a459-20d5e17e9078), Windows-based servers ignore the value of the SMB_FLAGS2_NT_STATUS bit in client requests. If the **Status** field value to be returned in the header is STATUS_SUCCESS, Windows-based servers copy the value of the SMB_FLAGS2_NT_STATUS bit from the client request into the server response. + +If CAP_STATUS32 has been negotiated and an error is returned and SMB_FLAGS2_NT_STATUS is not set in the request, the value of the SMB_FLAGS2_NT_STATUS bit and the format of the **Status** field in the header in the server response is undefined. + +[<28> Section 2.2.4.3.1](#Appendix_A_Target_28): Windows NT Server always ignores the **SearchAttributes** field on Open and Create operations, and searches for files by name only. + +[<29> Section 2.2.4.15.2](#Appendix_A_Target_29): Windows NT server temporary file names begin with "SRV" and are followed by the character equivalents of five (5) random hexadecimal digits (0-F). There is no extension set for the file name. The client is responsible for deleting the temporary file when it is no longer needed. + +[<30> Section 2.2.4.19.1](#Appendix_A_Target_30): Windows NT server behavior is determined by the negotiated protocol dialect. Clients that negotiate **Core Protocol** can use a negative value in the **Offset** field to position the file pointer to the beginning of the file (BOF). Clients negotiating other protocol dialects receive an error if they supply a negative value in the **Offset** field. + +[<31> Section 2.2.4.19.2](#Appendix_A_Target_31): Windows NT does not check for overflow conditions. It allows the file pointer that is maintained by the server to "wrap around". + +[<32> Section 2.2.4.23](#Appendix_A_Target_32): Windows NT clients and Windows NT servers support this command on connection-oriented transports. This command does not support named pipes or I/O devices. + +Windows does not support the **Timeout** field. + +[<33> Section 2.2.4.24](#Appendix_A_Target_33): Windows NT servers return STATUS_SMB_BAD_COMMAND (ERRSRV/ERRbadcmd). + +[<34> Section 2.2.4.25.2](#Appendix_A_Target_34): Windows NT servers always set **Available** to 0xFFFF. + +[<35> Section 2.2.4.26](#Appendix_A_Target_35): Windows systems support this command only over connectionless transports. Consequently, Windows 98 and Windows NT clients and all clients connected to Windows NT servers set the 0x08 bit of the **WriteMode** field in the request. Windows NT servers support Write MPX only to regular files or spooled printer files. This command does not support writing to [**named pipes**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca) or I/O devices. + +The **Timeout** field is not supported. + +[<36> Section 2.2.4.26.1](#Appendix_A_Target_36): The **Timeout** field was used in earlier dialects. In the NT LAN Manager dialect, Write MPX is not used to write to named pipes or devices, so the **Timeout** field is ignored. + +[<37> Section 2.2.4.27](#Appendix_A_Target_37): Windows NT servers return STATUS_INVALID_SMB (ERRSRV/ERRerror) instead of STATUS_NOT_IMPLEMENTED (ERRDOS/ERRbadfunc). + +[<38> Section 2.2.4.29](#Appendix_A_Target_38): Windows NT Server returns STATUS_SMB_BAD_COMMAND (ERRSRV/ERRbadcmd) instead of STATUS_NOT_IMPLEMENTED (ERRDOS/ERRbadfunc) if the **WordCount** field in the request is set to 1; otherwise, Windows NT Server returns STATUS_INVALID_SMB (ERRSRV/ERRerror). + +[<39> Section 2.2.4.32.1](#Appendix_A_Target_39): Windows NT Server does not support the CHANGE_LOCKTYPE flag of **TypeOfLock**. A client requesting that the server atomically change the lock type from a shared lock to an exclusive lock or vice versa results in an error being returned to the client. + +[<40> Section 2.2.4.32.1](#Appendix_A_Target_40): If the CANCEL_LOCK bit is set, Windows NT servers cancel only the first lock request range listed in the lock array. + +[<41> Section 2.2.4.33.1](#Appendix_A_Target_41): One way transactions are used only when communicating with Mailslots, which means that they never occur within CIFS sessions. + +[<42> Section 2.2.4.33.1](#Appendix_A_Target_42): Windows NT Server honors the **Timeout** field only in transaction subcommands that specifically state that the **Timeout** field is honored. Check the individual subcommands for details. + +[<43> Section 2.2.4.33.1](#Appendix_A_Target_43): Windows always sets **ParameterOffset** to an offset location, relative to the start of the [SMB Header (section 2.2.3.1)](#Section_69a29f73de0c45a6a1aa8ceeea42217f), where the **Trans_Parameters** field is expected to be. This behavior follows even if **ParameterCount** is zero. + +[<44> Section 2.2.4.33.1](#Appendix_A_Target_44): Windows always sets **DataCount** to a value of **ParameterCount** + **ParameterOffset**. This restricts the **Trans_Data** field to follow after the **Trans_Parameters** field, although this is not strictly a protocol requirement. + +[<45> Section 2.2.4.33.2](#Appendix_A_Target_45): Windows always sets **ParameterOffset** to an offset location, relative to the start of the SMB Header (section 2.2.3.1), where the **Trans_Parameters** field is expected to be. This behavior follows even if **ParameterCount** is zero. + +[<46> Section 2.2.4.33.2](#Appendix_A_Target_46): Windows always sets **DataCount** to a value of **ParameterOffset** + **ParameterCount**. This action restricts the **Trans_Data** field to follow after the **Trans_Parameters** field, although this is not strictly a protocol requirement. + +[<47> Section 2.2.4.34.1](#Appendix_A_Target_47): Windows always sets ParameterOffset to an offset location, relative to the start of the SMB Header (section 2.2.3.1), where the **Trans_Parameters** field is expected to be. This behavior follows even if ParameterCount is zero. + +[<48> Section 2.2.4.34.1](#Appendix_A_Target_48): Windows always sets DataCount to a value of ParameterOffset + ParameterCount. This restricts the Trans_Data field to follow after the Trans_Parameters field, although this is not strictly a protocol requirement. + +[<49> Section 2.2.4.35](#Appendix_A_Target_49): Windows NT server does not implement SMB_COM_IOCTL_SECONDARY. Therefore, all of the parameters and data for a request has to fit within the **MaxBufferSize** that was established during session setup. Windows NT server does not honor the value supplied in the **Timeout** field. Windows NT implementation specifics follow. + +| Category | Function | Parameters | Data | Description | +| ---------------------------------- | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------- | ----------------------------------------------- | +| SERIAL_DEVICE

0x0001 | GET_BAUD_RATE

0x0061 | None | USHORT BaudRate | Get the baud rate on the serial device. | +| SET_BAUD_RATE

0x0041 | None | USHORT BaudRate | Set the baud rate on the serial device | +| GET_LINE_CONTROL

0x0062 | UCHAR DataBits;

UCHAR Parity;

UCHAR StopBits;

UCHAR TransBreak; | None. | Get serial device line control information. | +| SET_LINE_CONTROL

0x0042 | UCHAR DataBits;

UCHAR Parity;

UCHAR StopBits;

UCHAR TransBreak; | None. | Set serial device line control information. | +| GET_DCB_INFORMATION

0x0073 | None. | USHORT WriteTimeout;

USHORT ReadTimeout;

UCHAR ControlHandShake;

UCHAR FlowReplace;

UCHAR Timeout;

UCHAR ErrorReplacementChar;

UCHAR BreakReplacementChar;

UCHAR XonChar;

UCHAR XoffChar; | Get serial device device control information. | +| SET_DCB_INFORMATION

0x0053 | None. | USHORT WriteTimeout;

USHORT ReadTimeout;

UCHAR ControlHandShake;

UCHAR FlowReplace;

UCHAR Timeout;

UCHAR ErrorReplacementChar;

UCHAR BreakReplacementChar;

UCHAR XonChar;

UCHAR XoffChar; | Get serial device device control information. | +| GET_COMM_ERROR

0x006D | None. | USHORT Error; | Get serial device device error information. | +| SET_TRANSMIT_TIMEOUT

0x0044 | | | Not implemented. | +| SET_BREAK_OFF

0x0045 | | | Not implemented. | +| SET_MODEM_CONTROL

0x0046 | | | Not implemented. | +| SET_BREAK_ON

0x004B | | | Not implemented. | +| STOP_TRANSMIT

0x0047 | | | Not implemented. | +| START_TRANSMIT

0x0048 | | | Not implemented. | +| GET_COMM_STATUS

0x0064 | | | Not implemented. | +| GET_LINE_STATUS

0x0065 | | | Not implemented. | +| GET_MODEM_OUTPUT

0x0066 | | | Not implemented. | +| GET_MODEM_INPUT

0x0067 | | | Not implemented. | +| GET_INQUEUE_COUNT

0x0068 | | | Not implemented. | +| GET_OUTQUEUE_COUNT

0x0069 | | | Not implemented. | +| GET_COMM_EVENT

0x0072 | | | Not implemented. | +| PRNTER_DEVICE

0x0005 | GET_PRINTER_STATUS

0x0066 | | CHAR Status | Always returns OS2_STATUS_PRINTER_HAPPY (0x90). | +| SPOOLER_DEVICE

0x0053 | GET_PRINTER_ID

0x0060 | | USHORT JobId;

UCHAR Buffer\[1\]; | Print job ID and printer share name. | +| GENERAL_DEVICE

0x000B | | | | Not implemented. | + +[<50> Section 2.2.4.35.2](#Appendix_A_Target_50): \[XOPEN-SMB\], in section 14.3, states that ERRSRV/ERRnosupport can be returned if the server does not support the SMB_COM_IOCTL command. Windows NT servers support this command, although it is deprecated. + +[<51> Section 2.2.4.37](#Appendix_A_Target_51): Windows NT servers attempt to process this command, but the implementation is incomplete and the results are not predictable. + +[<52> Section 2.2.4.38](#Appendix_A_Target_52): Windows NT servers attempt to process this command, but the implementation is incomplete and the results are not predictable. + +[<53> Section 2.2.4.39.1](#Appendix_A_Target_53): Windows 98 accept only an SMB_COM_ECHO request containing a valid **TID** or a **TID** value of 0xFFFF (-1). Windows NT ignores the **TID** in the SMB_COM_ECHO request. + +[<54> Section 2.2.4.39.2](#Appendix_A_Target_54): Windows clients ignore the **SequenceNumber** field in the server response. + +[<55> Section 2.2.4.40](#Appendix_A_Target_55): Windows NT and Windows 98 clients do not send [SMB_COM_WRITE_AND_CLOSE (0x2C) (section 2.2.4.40)](#Section_029b038c4d4b42fc8c5199eb23055e9c) requests. + +[<56> Section 2.2.4.40.2](#Appendix_A_Target_56): Windows NT Server appends three null padding bytes to this message, following the **ByteCount** field. These three bytes are not message data and can safely be discarded. + +[<57> Section 2.2.4.41.1](#Appendix_A_Target_57): Windows NT Server ignores SearchAttrs in open requests. + +[<58> Section 2.2.4.42.2](#Appendix_A_Target_58): An AndX chain can be formed by adding an SMB_COM_CLOSE command as a follow-on to SMB_COM_READ_ANDX. SMB_COM_CLOSE is the only valid follow-on command for SMB_COM_READ_ANDX. Windows NT Server correctly processes AndX chains consisting of SMB_COM_READ_ANDX and SMB_COM_CLOSE, but does not correctly set the AndXCommand field in the response message. Windows NT Server always sets the value of AndXCommand in the SMB_COM_READ_ANDX response to SMB_COM_NO_ANDX_COMMAND (0xFF). + +[<59> Section 2.2.4.42.2](#Appendix_A_Target_59): Windows NT Server always sets this field in this message to zero, even if there is a chained SMB_COM_CLOSE follow-on response connected to the SMB_COM_READ_ANDX response message. If present, the SMB_COM_CLOSE response can be seen as three null padding bytes (representing WordCount==0x00 and ByteCount==0x0000) immediately following the SMB_Parameters of the SMB_COM_READ_ANDX portion of the message. + +[<60> Section 2.2.4.42.2](#Appendix_A_Target_60): Windows-based servers set the **DataLength** field to 0x0000 and return STATUS_SUCCESS. + +[<61> Section 2.2.4.43.1](#Appendix_A_Target_61): Windows NT and Windows 98 clients set this field to zero for non-[**message mode**](#gt_c49a48e8-f1ac-4568-bc87-0672eb08868b) pipe writes. This field is ignored by the server if the [**FID**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) indicates a file. If a pipe write spans multiple requests, for all pipe write requests Windows clients set this field to the total number of bytes to be written. + +[<62> Section 2.2.4.43.2](#Appendix_A_Target_62): Windows NT servers always set **Available** to 0xFFFF. + +[<63> Section 2.2.4.44](#Appendix_A_Target_63): Windows NT Server returns STATUS_SMB_BAD_COMMAND (ERRSRV/ERRbadcmd) if the **WordCount** field in the request is set to 3; otherwise, Windows NT Server returns STATUS_INVALID_SMB (ERRSRV/ERRerror). + +[<64> Section 2.2.4.45](#Appendix_A_Target_64): Windows NT Server has a partial implementation that treats this SMB command as though it were an [SMB_COM_CLOSE (section 2.2.4.5)](#Section_10059dd2ae0a48a2a95ca92505e9145f) followed by an [SMB_COM_TREE_DISCONNECT (section 2.2.4.51)](#Section_31cc172a80844f0baad6d8d69da76a0e); however, the SMB_COM_TREE_DISCONNECT is never called. The format of the command is identical to that of SMB_COM_CLOSE. This command was never documented and is not called by Windows clients. + +[<65> Section 2.2.4.46.1](#Appendix_A_Target_65): One way transactions are used only when communicating with Mailslots, which means that they never occur within CIFS sessions. + +[<66> Section 2.2.4.46.1](#Appendix_A_Target_66): Windows NT Server honors the **Timeout** field only in transaction subcommands that specifically state that the Timeout field is honored. Check the individual subcommands for details. + +[<67> Section 2.2.4.46.1](#Appendix_A_Target_67): Windows always sets **ParameterOffset** to an offset location, relative to the start of the SMB Header (section 2.2.3.1), where the **Trans_Parameters** field is expected to be. This behavior follows even if **ParameterCount** is zero. + +[<68> Section 2.2.4.46.1](#Appendix_A_Target_68): Windows always sets **DataCount** to a value of **ParameterOffset** + **ParameterCount**. This restricts the **Trans_Data** field to follow after the **Trans_Parameters** field, although this is not strictly a protocol requirement. + +[<69> Section 2.2.4.46.2](#Appendix_A_Target_69): Windows always sets **ParameterOffset** to an offset location, relative to the start of the SMB Header (section 2.2.3.1), where the **Trans_Parameters** field is expected to be. This behavior follows even if **ParameterCount** is zero. + +[<70> Section 2.2.4.46.2](#Appendix_A_Target_70): Windows always sets **DataCount** to a value of **ParameterOffset** + **ParameterCount**. This action restricts the **Trans_Data** field to follow after the **Trans_Parameters** field, although this is not strictly a protocol requirement. + +[<71> Section 2.2.4.46.2](#Appendix_A_Target_71): Windows NT Server sends an arbitrary number of additional bytes beyond the end of the SMB response message. These additional bytes can be ignored by the recipient. + +[<72> Section 2.2.4.47.1](#Appendix_A_Target_72): Windows always sets **ParameterOffset** to an offset location, relative to the start of the SMB Header (section 2.2.3.1), where the **Trans_Parameters** field is expected to be. This behavior follows even if **ParameterCount** is zero. + +[<73> Section 2.2.4.47.1](#Appendix_A_Target_73): Windows always sets **DataCount** to a value of **ParameterOffset** + **ParameterCount**. This action restricts the **Trans_Data** field to follow after the **Trans_Parameters** field, although this is not strictly a protocol requirement. + +[<74> Section 2.2.4.50.1](#Appendix_A_Target_74): Windows NT servers do not test to determine whether the strings in this request are 16-bit Unicode or 8-bit extended ASCII. It assumes that they are 8-bit strings. Clients that support Unicode use the [SMB_COM_TREE_CONNECT_ANDX (section 2.2.4.55)](#Section_a105173ad8544950be283d3240529ec3) command. + +[<75> Section 2.2.4.52.1](#Appendix_A_Target_75): Windows 98 and Windows NT clients typically send a **TID** value of zero (0x0000) in the SMB_COM_NEGOTIATE request. This value has no particular significance. + +[<76> Section 2.2.4.52.1](#Appendix_A_Target_76): Windows 98 and Windows NT clients typically send a **UID** value of zero (0x0000) in the SMB_COM_NEGOTIATE request. This value has no particular significance. + +[<77> Section 2.2.4.52.2](#Appendix_A_Target_77): The name of this bit value is misleading. Encrypted passwords are used to generate the response to the challenge, but are not sent across the network. + +[<78> Section 2.2.4.52.2](#Appendix_A_Target_78): In some implementations of earlier dialects, this bit was used to indicate support for the SMB_COM_SECURITY_PACKAGE_ANDX command. That usage is obsolete. + +[<79> Section 2.2.4.52.2](#Appendix_A_Target_79): On Windows NT server the default value is 50 (0x0032). This value can be set using the **MaxMpxCt** registry key. + +[<80> Section 2.2.4.52.2](#Appendix_A_Target_80): Windows-based CIFS servers set this field to 0x0001, but do not enforce this limit. This allows a CIFS client to establish more virtual circuits than allowed by this value. Because this limit is not enforced on Windows, CIFS clients can ignore this limit and attempt to establish more than the number of virtual circuits allowed by this value. The Windows behavior of the CIFS server allows a client to exceed this limit, but other server implementations can enforce this limit and not allow this to occur. Windows clients ignore the **MaxNumberVcs** field in the server response. + +[<81> Section 2.2.4.52.2](#Appendix_A_Target_81): If more than 512 MB of memory is available, by default, Windows NT Server, Windows 2000, Windows Server 2003 operating system, Windows Server 2008 operating system, Windows Server 2008 R2 operating system, Windows Server 2012 operating system, and Windows Server 2012 R2 operating system set the **MaxBufferSize** value to 16644 bytes. The **MaxBufferSize** is configurable as described in [\[MSKB-320829\]](https://go.microsoft.com/fwlink/?LinkId=304224). + +[<82> Section 2.2.4.52.2](#Appendix_A_Target_82): Windows clients ignore the **MaxRawSize** field in the server response and use a default value of 65536 bytes (64K) as the maximum raw buffer size for an [SMB_COM_WRITE_RAW Request (section 2.2.4.25.1)](#Section_1ff2a25fefe2470ca780b06ef46c4089). + +[<83> Section 2.2.4.52.2](#Appendix_A_Target_83): Windows NT clients assume that CAP_NT_FIND is set if CAP_NT_SMBS is set. + +[<84> Section 2.2.4.52.2](#Appendix_A_Target_84): The CAP_BULK_TRANSFER capability was supposed to indicate server support for the SMB_COM_READ_BULK and SMB_COM_WRITE_BULK commands, which were never implemented. The CAP_BULK_TRANSFER capability bit was never used in Windows-based clients or servers. + +[<85> Section 2.2.4.52.2](#Appendix_A_Target_85): The CAP_COMPRESSED_DATA capability bit was supposed to indicate whether a server supported compressed SMB packets. This feature was never specified, implemented, or used. Windows-based clients and servers do not support CAP_COMPRESSED_DATA, so this capability is never set. + +[<86> Section 2.2.4.52.2](#Appendix_A_Target_86): The CAP_QUADWORD_ALIGNED capability bit was intended to indicate that Windows directory **InformationLevel** responses were quadword-aligned. The CAP_QUADWORD_ALIGNED capability bit was never used in released Windows-based clients or servers. + +[<87> Section 2.2.4.52.2](#Appendix_A_Target_87): Windows clients ignore the **SystemTime** field in the server response. + +[<88> Section 2.2.4.52.2](#Appendix_A_Target_88): Windows clients ignore the **ServerTimeZone** field in the server response. + +[<89> Section 2.2.4.52.2](#Appendix_A_Target_89): Windows NT servers always send the **DomainName** field in Unicode characters and never add a padding byte for alignment. Windows clients ignore the **DomainName** field in the server response. + +[<90> Section 2.2.4.53](#Appendix_A_Target_90): Windows clients always issue SMB_COM_SESSION_SETUP_ANDX and SMB_COM_TREE_CONNECT_ANDX as a batched request. + +[<91> Section 2.2.4.53.1](#Appendix_A_Target_91): Windows NT clients and servers always use a **MaxBufferSize** value that is a multiple of four (4). **MaxBufferSize** values, sent or received via SMB, are always rounded down to the nearest multiple of four before they are used. This is done by masking out the two lowest-order bits of the value: **MaxBufferSize** &= ~3; + +The default **MaxBufferSize** on Windows clients is 4356 (0x1104) bytes (4KB + 260Bytes). The **MaxBufferSize** can be configured through the following registry setting: + +- HKLM\\SYSTEM\\CurrentControlSet\\Services\\LanmanServer\\Parameters\\SizReqBuf + +If the client's **MaxBufferSize** value in a session setup request is below a system-specified minimum value, Windows CIFS servers will fail the request and return ERRSRV/ERRerror. The default minimum acceptable **MaxBufferSize** value is 500 (0x1F4) bytes. This value can be modified using the following registry setting: + +- HKEY_Local_Machine\\System\\CurrentControlSet\\Services\\LanManServer\\Parameters\\MinClientBufferSize + +[<92> Section 2.2.4.53.1](#Appendix_A_Target_92): Windows-based servers support a maximum [SMB_COM_READ_ANDX (section 2.2.4.42)](#Section_129aa093574b483ea55ddf334606a622) buffer size of 61440 (0xF000 = 60K) when the CAP_LARGE_READX capability is negotiated. + +[<93> Section 2.2.4.53.1](#Appendix_A_Target_93): Windows-based CIFS servers set a limit for the **MaxNumberVcs** field in the [SMB_COM_NEGOTIATE Response (section 2.2.4.52.2)](#Section_a4229e1a8a4e489aa2eb11b7f360e60c) to 0x01, but do not enforce this limit. This allows a CIFS client to establish more virtual circuits than allowed by the **MaxNumberVcs** field value. Because this limit is not enforced on Windows, CIFS clients can ignore this limit and attempt to establish more than the number of virtual circuits allowed by this value. The Windows behavior of the CIFS server allows a client to exceed this limit, but other server implementations can enforce this limit and not allow this to occur. + +[<94> Section 2.2.4.53.1](#Appendix_A_Target_94): Windows NT Server ignores the client's **SessionKey**. + +[<95> Section 2.2.4.53.1](#Appendix_A_Target_95): The Windows 98 client sends only CAP_RAW_MODE and CAP_UNICODE. Windows NT clients send only CAP_NT_STATUS, CAP_UNICODE, CAP_LEVEL_II_OPLOCKS, and CAP_NT_SMBS (the latter implies CAP_NT_FIND). Windows NT Server checks only for the following capabilities in the client's SMB_COM_SESSION_SETUP_ANDX request: CAP_UNICODE, CAP_LARGE_FILES, CAP_NT_SMBS, CAP_NT_FIND, CAP_NT_STATUS, and CAP_LEVEL_II_OPLOCK. + +For some capabilities, it is not necessary for the client to indicate support for a server capability in order to use that capability. For example, Windows 98 clients do not indicate support for DFS, but still request DFS referrals from the server if the server has indicated support. + +[<96> Section 2.2.4.53.1](#Appendix_A_Target_96): Windows NT and Windows 98 clients do not set the CAP_LARGE_FILES bit. + +[<97> Section 2.2.4.53.1](#Appendix_A_Target_97): Windows client systems that negotiate CAP_NT_SMBS also negotiate CAP_UNICODE. Windows NT servers expect that CAP_NT_SMBS and CAP_UNICODE will be negotiated together. This relationship, however, is not enforced by the server. If the client negotiates one of these capabilities but not the other, the contents of SMB_STRING fields in Windows NT server response messages are undefined and can be malformed. + +[<98> Section 2.2.4.53.1](#Appendix_A_Target_98): Windows 98 and Windows NT clients do not set the CAP_NT_FIND capability bit. Windows NT Server, however, treats CAP_NT_FIND as set if CAP_NT_SMBS is set. + +[<99> Section 2.2.4.53.1](#Appendix_A_Target_99): Windows NT Server does not support plaintext Unicode authentication. + +[<100> Section 2.2.4.53.1](#Appendix_A_Target_100): Windows CIFS clients set this field based on the version and service pack level of the Windows operating system. A list of possible values for this field includes the following: + +| Windows OS version | NativeOS string | +| -------------------------------- | --------------- | +| Windows NT 4.0 operating system | Windows NT 1381 | +| Windows NT 3.51 operating system | Windows NT 1057 | +| Windows 98 Second Edition | Windows 4.0 | + +[<101> Section 2.2.4.53.1](#Appendix_A_Target_101): Windows CIFS clients set this field based on the version of the Windows operating system. A list of possible values for this field includes the following: + +| Windows OS version | NativeLanMan string | +| ------------------------- | ------------------- | +| Windows NT 4.0 | Windows NT 4.0 | +| Windows NT 3.51 | Windows NT 3.51 | +| Windows 98 Second Edition | Windows 4.0 | + +Windows NT clients add an extra string terminator following the NativeOS field, so the **NativeLanMan** string appears to be the empty string. If **ByteCount** indicates that there are more bytes in the **SMB_Data.Data** block, the additional bytes are the **NativeLanMan** string. The **NativeLanMan** string also contains an extra terminating null character. + +[<102> Section 2.2.4.53.2](#Appendix_A_Target_102): Windows-based CIFS servers set this field based on the version and service pack level of the Windows operating system. The following table includes a list of possible values for this field: + +| Windows OS version | NativeOS string | +| ------------------------- | --------------- | +| Windows NT 3.51 | Windows NT 1057 | +| Windows NT 4.0 | Windows NT 1381 | +| Windows 98 Second Edition | Windows 4.0 | + +Windows clients ignore the **NativeOS** field in the server response. + +[<103> Section 2.2.4.53.2](#Appendix_A_Target_103): Windows-based CIFS servers set this field based on the version of the Windows operating system. The following table lists possible values for this field: + +| Windows OS version | NativeLanMan string | +| ------------------------- | ------------------- | +| Windows NT 3.51 | NT LAN Manager 3.51 | +| Windows NT 4.0 | NT LAN Manager 4.0 | +| Windows 98 Second Edition | Windows 4.0 | + +Windows clients ignore the **NativeLanMan** field in the server response. + +[<104> Section 2.2.4.53.2](#Appendix_A_Target_104): Windows clients ignore the **PrimaryDomain** field in the server response. + +[<105> Section 2.2.4.53.2](#Appendix_A_Target_105): Windows-based servers terminate the **PrimaryDomain** string with a single null byte if the **Pad** field in the response is not empty. + +[<106> Section 2.2.4.55.1](#Appendix_A_Target_106): Windows 98 clients set this bit. Windows NT servers ignore the setting. + +[<107> Section 2.2.4.55.2](#Appendix_A_Target_107): Windows clients ignore the **NativeFileSystem** field in the server response. + +[<108> Section 2.2.4.56](#Appendix_A_Target_108): This command is neither reserved nor implemented in Windows. Windows NT servers return STATUS_SMB_BAD_COMMAND (ERRSRV/ERRbadcmd). + +[<109> Section 2.2.4.58.1](#Appendix_A_Target_109): Windows NT systems define this UCHAR field as follows: + +bit 7 (mask 0x80): Reserved for client use. + +bits 5,6 (mask 0x60): Reserved for system use. + +bits 0-4 (mask 0x1F): Reserved for server use. + +The above definition agrees with [\[SMB-CORE\]](https://go.microsoft.com/fwlink/?LinkId=164301) as well as [\[CIFS\]](https://go.microsoft.com/fwlink/?linkid=2109334), and is used in Windows NT server. \[XOPEN-SMB\], however, declares this field as reserved for client use. The safest course for implementers is to avoid modifying the contents of this field, whether set by the client or the server. + +[<110> Section 2.2.4.58.1](#Appendix_A_Target_110): Windows NT server makes use of the **ServerState** field as follows: + +- ServerState +- { +- UCHAR FileName\[8\]; +- UCHAR FileExt\[3\]; +- UCHAR SearchID; +- ULONG FileIndex; +- } + +**FileName (8 bytes):** This is the name portion of the 8.3 format file name. The name is left-justified and space-padded. + +**FileExt (3 bytes):** This is the file extension of the 8.3 format file name. It is left-justified and space-padded. + +This 11-byte representation of the 8.3 format name is known as the "packed" format. + +**SearchID (1 byte) :** This is a one-byte search identifier used by the server to uniquely identify the search operation. The use of a one-byte field implies that the NT server can manage a maximum of 256 concurrent searches per SMB session. + +**FileIndex (4 bytes):** A server-specific index used to continue the search at the correct place in the remote directory. + +[<111> Section 2.2.4.61.1](#Appendix_A_Target_111): Windows clients set **MaxCount** to nonzero values. Windows-based servers fail the request with STATUS_INVALID_SMB if **MaxCount** is 0x0000. + +[<112> Section 2.2.4.61.2](#Appendix_A_Target_112): Windows NT servers set this field to 0x0000 and do not send the **BufferFormat** and **DataLength** fields. + +[<113> Section 2.2.4.62.1](#Appendix_A_Target_113): Windows always sets **ParameterOffset** to an offset location, relative to the start of the SMB Header (section 2.2.3.1), where the **Trans_Parameters** field is expected to be. This behavior follows even if **ParameterCount** is zero. + +[<114> Section 2.2.4.62.1](#Appendix_A_Target_114): Windows always sets **DataCount** to a value of **ParameterOffset** + **ParameterCount**. This action restricts the **Trans_Data** field to follow after the **Trans_Parameters** field, although this is not strictly a protocol requirement. + +[<115> Section 2.2.4.62.2](#Appendix_A_Target_115): Windows always sets **ParameterOffset** to an offset location, relative to the start of the SMB Header (section 2.2.3.1), where the **Trans_Parameters** field is expected to be. This behavior follows even if **ParameterCount** is zero. + +[<116> Section 2.2.4.62.2](#Appendix_A_Target_116): Windows always sets **DataCount** to a value of **ParameterOffset** + **ParameterCount**. This action restricts the **Trans_Data** field to follow after the **Trans_Parameters** field, although this is not strictly a protocol requirement. + +[<117> Section 2.2.4.63.1](#Appendix_A_Target_117): Windows always sets **ParameterOffset** to an offset location, relative to the start of the SMB Header (section 2.2.3.1), where the **Trans_Parameters** field is expected to be. This behavior follows even if **ParameterCount** is zero. + +[<118> Section 2.2.4.63.1](#Appendix_A_Target_118): Windows always sets **DataCount** to a value of **ParameterOffset** + **ParameterCount**. This action restricts the **Trans_Data** field to follow after the **Trans_Parameters** field, although this is not strictly a protocol requirement. + +[<119> Section 2.2.4.64.1](#Appendix_A_Target_119): Windows NT CIFS servers allow only the FILE_OPEN option on a named pipe. All other options are ignored and considered the same as FILE_OPEN. Windows NT CIFS servers do not allow clients to "open" or to "create" a mailslot. + +[<120> Section 2.2.4.65](#Appendix_A_Target_120): Upon receipt of this command, the Windows NT server attempts to complete outstanding commands such as those that are waiting for a thread context or waiting to access a busy resource. If the outstanding command cannot be completed successfully, the server returns an implementation-specific error. + +[<121> Section 2.2.4.66](#Appendix_A_Target_121): Windows NT client and server both support the [SMB_COM_NT_RENAME](#Section_014a414742064ab2a167b58a4d11f1a7) command. However, the design and implementation of this command was never completed. The SMB_COM_NT_RENAME command is not documented in \[CIFS\]; the only prior documentation covering this command is [\[SNIA\]](https://go.microsoft.com/fwlink/?LinkId=90519). + +The request structure for this command includes a **Reserved** field that was originally intended to access a proposed server feature that was never implemented. The SMB_DATA portion of the message also includes **Buffer Format** fields, making this the only non-Core Protocol command to make use of **Buffer Format** fields. + +This command is superseded by newer commands in updated versions of the protocol (see \[MS-SMB\]). + +[<122> Section 2.2.4.66](#Appendix_A_Target_122): The Windows-based server implementation of SMB_COM_NT_RENAME does not support moving a file within its existing path hierarchy. If such a move is requested, the server will copy the file instead. + +[<123> Section 2.2.4.66.1](#Appendix_A_Target_123): Windows clients never send an [SMB_COM_NT_RENAME Request (section 2.2.4.66.1)](#Section_d777310edeb1490c915726456c0b0116) using this information level. Instead, they use [SMB_COM_RENAME (section 2.2.4.8)](#Section_d78c549c9ab84d92bbbc6843bed943f6) to perform rename operations. Windows-based servers process SMB_COM_NT_RENAME Requests with this information level in the same way as an [SMB_COM_RENAME Request (section 2.2.4.8.1)](#Section_c970f3bf806e43098ea96515605f450d), with the exception that they do not allow wildcards in the request. + +[<124> Section 2.2.4.66.1](#Appendix_A_Target_124): Windows clients do not send SMB_COM_NT_RENAME Requests with the SMB_NT_RENAME_MOVE_FILE information level. Windows NT servers do not fully implement this information level, and perform a file copy instead of a rename or move if SMB_NT_RENAME_MOVE_FILE is specified. + +[<125> Section 2.2.4.66.1](#Appendix_A_Target_125): This field was previously designated **ClusterCount** (as listed in \[SNIA\] section 2.4.13). **ClusterCount** is not implemented in Windows. + +[<126> Section 2.2.4.67.1](#Appendix_A_Target_126): Windows NT4.SP6 server ignores the **Identifier**. + +[<127> Section 2.2.4.70](#Appendix_A_Target_127): Support for this command was not implemented in Windows NT Server. Windows 98 and Windows NT clients do not call this command. + +[<128> Section 2.2.4.71](#Appendix_A_Target_128): Windows NT Server returns STATUS*SMB_BAD_COMMAND (ERRSRV/ERRbadcmd) instead of STATUS_NOT_IMPLEMENTED (ERRDOS/ERRbadfunc) if the **WordCount** field in the request is set to 12; otherwise, Windows NT Server returns STATUS* INVALID_SMB (ERRSRV/ERRerror). + +[<129> Section 2.2.4.72](#Appendix_A_Target_129): Windows NT Server returns STATUS_SMB_BAD_COMMAND (ERRSRV/ERRbadcmd) instead of STATUS_NOT_IMPLEMENTED (ERRDOS/ERRbadfunc) if the **WordCount** field in the request is set to 12; otherwise, Windows NT Server returns STATUS_INVALID_SMB (ERRSRV/ERRerror). + +[<130> Section 2.2.4.73](#Appendix_A_Target_130): Windows NT servers return STATUS_SMB_BAD_COMMAND (ERRSRV/ERRbadcmd) instead of STATUS_NOT_IMPLEMENTED (ERRDOS/ERRbadfunc). + +[<131> Section 2.2.5.1](#Appendix_A_Target_131): The [TRANS_SET_NMPIPE_STATE](#Section_2481644c725944b89b8bae539f7b3eb6) subcommand was introduced to provide support for the **SetNamedPipeHandleState()** system call in OS/2 and Win32. For more information, see [\[MSDN-SetNmdPipeHndState\]](https://go.microsoft.com/fwlink/?LinkId=182918). Windows NT servers use the FilePipeInformation Information Class to implement this named pipe transaction subcommand. For more information, see \[MS-FSCC\] section 2.4.37. + +[<132> Section 2.2.5.2](#Appendix_A_Target_132): Windows NT Server does not support this transaction subcommand. It returns a status of STATUS_INVALID_PARAMETER (ERRDOS/ERRinvalidparam). + +[<133> Section 2.2.5.3](#Appendix_A_Target_133): The [TRANS_QUERY_NMPIPE_STATE](#Section_905e248a9fc44c09aeae5cf2a6dfd015) subcommand was introduced to provide support for the GetNamedPipeHandleState() system call in OS/2 and Win32. For more information, see [\[MSDN-GetNmdPipeHndState\]](https://go.microsoft.com/fwlink/?LinkId=182699). Windows NT servers use the FilePipeInformation Information Class to implement this named pipe transaction subcommand. For more information, see \[MS-FSCC\] section 2.4.37. + +[<134> Section 2.2.5.4](#Appendix_A_Target_134): The [TRANS_QUERY_NMPIPE_INFO](#Section_58c3b35b06834035941616c62e941203) subcommand was introduced to provide support for the **GetNamedPipeInfo()** system call in OS/2 and Win32. For more information, see [\[MSDN-GetNmdPipeInfo\]](https://go.microsoft.com/fwlink/?LinkId=182705).Windows NT servers use the FilePipeLocalInformation Information Class to implement this named pipe transaction subcommand. For more information, see \[MS-FSCC\] section 2.4.38. + +[<135> Section 2.2.5.5](#Appendix_A_Target_135): The [TRANS_PEEK_NMPIPE](#Section_80f114bfb3e34b82a0f517c039d70e9e) subcommand was introduced to provide support for the **PeekNamedPipe()** system call in OS/2 and Win32. For more information, see [\[MSDN-PkNmdPipe\]](https://go.microsoft.com/fwlink/?LinkId=121801). Windows NT servers use FSCTL_PIPE_PEEK to implement this subcommand. For more information, see \[MS-FSCC\] sections 2.3.45 and 2.3.46. + +[<136> Section 2.2.5.5](#Appendix_A_Target_136): Windows always peeks from a named pipe using the read mode that was specified when the named pipe was created. The peek operation is not affected when the TRANS_SET_NMPIPE_STATE subcommand is used to change the state of the named pipe. In addition, the operation always returns immediately and is not affected by the wait mode of the named pipe. For more information, see \[MSDN-PkNmdPipe\]. + +[<137> Section 2.2.5.6](#Appendix_A_Target_137): The [TRANS_TRANSACT_NMPIPE](#Section_f599d0f080b148869657944f36a44138) subcommand was introduced to provide support for the **TransactNamedPipe()** system call in OS/2 and Win32. For more information, see [\[MSDN-TrnsactNmdPipe\]](https://go.microsoft.com/fwlink/?LinkId=182709). Windows NT servers use FSCTL_PIPE_TRANSCEIVE to implement this subcommand. For more information, see \[MS-FSCC\] sections 2.3.47 and 2.3.48. + +[<138> Section 2.2.5.6.2](#Appendix_A_Target_138): If the Windows NT Server receives a single-request transaction where the request's **DataCount** field equals the **TotalDataCount** field and the **ParameterCount** field equals the **TotalParameterCount** field, and if the server response indicates a STATUS_BUFFER_OVERFLOW, the data read from the named pipe is included in the response's **ReadData** field, even if the amount of data read from the pipe exceeds the **MaxDataCount** field of the client's request. In this case, the response's **TotalDataCount** field is greater than the **DataCount** field and indicates the number of remaining bytes that were not transferred to the client in the response. + +[<139> Section 2.2.5.7](#Appendix_A_Target_139): Windows NT Server permits only a 2-byte write that contains two null padding bytes, and requires that the pipe is in message mode. If these conditions are not met, NT server returns a STATUS_INVALID_PARAMETER error. + +[<140> Section 2.2.5.10](#Appendix_A_Target_140): The [TRANS_WAIT_NMPIPE](#Section_385ce4de217048a1910053f3c4aad60d) subcommand was introduced to provide support for the **WaitNamedPipe()** system call in OS/2 and Win32. For more information, see [\[MSDN-WaitNmdPipe\]](https://go.microsoft.com/fwlink/?LinkId=182711). Windows NT servers use FSCTL_PIPE_WAIT to implement this subcommand. For more information, see \[MS-FSCC\] sections 2.3.49 and 2.3.50. + +[<141> Section 2.2.5.10.1](#Appendix_A_Target_141): Windows NT server honors the **Timeout** field for this transaction. + +[<142> Section 2.2.5.10.1](#Appendix_A_Target_142): Windows NT servers ignore the **Priority** value in the [TRANS_WAIT_NMPIPE Request (section 2.2.5.10.1)](#Section_343d6fda9a094d7581c4bd5e6ff05932), and do not provide a default priority. + +[<143> Section 2.2.5.11](#Appendix_A_Target_143): The [TRANS_CALL_NMPIPE](#Section_a600138d46b741b49d9380a3bd5096de) subcommand was introduced to provide support for the CallNamedPipe() system call in OS/2 and Win32. For more information, see [\[MSDN-CallNmdPipe\]](https://go.microsoft.com/fwlink/?LinkId=182715). Windows NT servers use FSCTL_PIPE_TRANSCEIVE to implement this subcommand. For more information, see \[MS-FSCC\] sections 2.3.47 and 2.3.48. + +[<144> Section 2.2.5.11.2](#Appendix_A_Target_144): Windows 98 clients misread the number of data bytes returned. For more information, see [\[MSKB-235717\]](https://go.microsoft.com/fwlink/?LinkId=182630). + +[<145> Section 2.2.5.11.2](#Appendix_A_Target_145): When the TRANS_CALL_NMPIPE (section 2.2.5.11) operation returns STATUS_BUFFER_OVERFLOW, Windows-based servers set the **SetupCount** field value in the [TRANS_CALL_NMPIPE Response (section 2.2.5.11.2)](#Section_b08561068cd242f18cec3e6d3cac341c) to the **SetupCount** field value in the [TRANS_CALL_NMPIPE Request (section 2.2.5.11.1)](#Section_57e182d43dd646a5911c4d714cb1865b) \* 2. + +[<146> Section 2.2.6.3.1](#Appendix_A_Target_146): If the client sends an empty string (0x00 or 0x0000) in the **FileName** field for the [TRANS2_FIND_NEXT2 Request (section 2.2.6.3.1)](#Section_80dc980efe03455cada67c5dd6c551ba), Windows NT servers return no data in the **Trans2_Data** block. The **SearchCount** field value in the **Trans2_Parameters** block is set to zero (0x0000). + +[<147> Section 2.2.6.8.2](#Appendix_A_Target_147): If the information level is SMB_QUERY_FILE_ALL_INFO, Windows NT servers append 4 additional bytes at the end of the **Trans2_Data** block that are set to arbitrary values and that are ignored on receipt. + +[<148> Section 2.2.7.1.1](#Appendix_A_Target_148): Windows NT Server requires that this field be aligned to a 32-bit boundary. No padding is required, however, because the NT_Trans_Data block is aligned, and the **SecurityDescriptor** field is always a multiple of 32 bits. + +[<149> Section 2.2.7.2](#Appendix_A_Target_149): Windows clients generate IOCTL and FSCTL codes that are supported only by Windows NT Server. + +[<150> Section 2.2.7.3](#Appendix_A_Target_150): **[Security descriptors](#gt_e5213722-75a9-44e7-b026-8e4833f0d350)** are typically useful only to Windows clients. + +[<151> Section 2.2.7.4.2](#Appendix_A_Target_151): The Windows NT Server implementation of NT_TRANSACT_NOTIFY_CHANGE always returns the names of changed files in Unicode format. + +[<152> Section 2.2.7.6](#Appendix_A_Target_152): Security descriptors are typically useful only to Windows clients. + +[<153> Section 2.2.8.1.1](#Appendix_A_Target_153): Windows NT servers append a single NULL padding character to this field. If CAP_UNICODE has been negotiated, the server appends two NULL bytes to this field; otherwise, one NULL byte is appended. The length of the terminating NULL character is not included in the value of the **FileNameLength** field. + +[<154> Section 2.2.8.1.2](#Appendix_A_Target_154): Windows NT servers always append a single NULL padding byte to the **FileName** field. The length of this additional byte is not included in the value of the **FileNameLength** field. + +[<155> Section 2.2.8.1.3](#Appendix_A_Target_155): If CAP_UNICODE has been negotiated, Windows NT servers set the **FileNameLength** field to an arbitrary value. + +[<156> Section 2.2.8.1.3](#Appendix_A_Target_156): Windows NT servers always append a single NULL padding byte to the **FileName** field. The length of this additional byte is not included in the value of the **FileNameLength** field. + +[<157> Section 2.2.8.1.4](#Appendix_A_Target_157): Windows-based CIFS servers set the **FileIndex** field to a nonzero value if the underlying [**object store**](#gt_0cc469e1-4b1f-41c4-9f94-d6209fcf468e) supports indicating the position of a [**file**](#gt_a04c146a-de3b-4e4b-829f-a9e772f3fe25) within the parent directory. + +[<158> Section 2.2.8.1.4](#Appendix_A_Target_158): If CAP_UNICODE has not been negotiated, Windows NT servers include the length of the terminating NULL byte in the value of the **FileNameLength** field. + +[<159> Section 2.2.8.1.4](#Appendix_A_Target_159): Windows NT servers append an arbitrary number of extra NULL padding bytes to the **FileName** field. The length of these additional NULL bytes is not included in the value of the **FileNameLength** field unless CAP_UNICODE has not been negotiated. If CAP_UNICODE has not been negotiated, only the length of the first NULL byte is included in the value of the **FileNameLength** field. + +[<160> Section 2.2.8.1.5](#Appendix_A_Target_160): Windows-based CIFS servers set the **FileIndex** field to a nonzero value if the underlying object store supports indicating the position of a file within the parent directory. + +[<161> Section 2.2.8.1.5](#Appendix_A_Target_161): If CAP_UNICODE has not been negotiated, Windows NT servers include the length of one NULL padding byte in the **FileNameLength** field value. + +[<162> Section 2.2.8.1.5](#Appendix_A_Target_162): Windows NT servers append an arbitrary number of extra NULL padding bytes to the **FileName** field. The length of these additional NULL bytes is not included in the value of the **FileNameLength** field unless CAP_UNICODE has not been negotiated. If CAP_UNICODE has not been negotiated, only the length of the first NULL byte is included in the value of the **FileNameLength** field. + +[<163> Section 2.2.8.1.6](#Appendix_A_Target_163): Windows-based CIFS servers set the **FileIndex** field to a nonzero value if the underlying object store supports indicating the position of a file within the parent directory. + +[<164> Section 2.2.8.1.6](#Appendix_A_Target_164): If CAP_UNICODE has not been negotiated, Windows NT servers include the length of one NULL padding byte in the **FileNameLength** field value. + +[<165> Section 2.2.8.1.6](#Appendix_A_Target_165): Windows NT servers append an arbitrary number of extra NULL padding bytes to the **FileName** field. The length of these additional NULL bytes is not included in the value of the **FileNameLength** field unless CAP_UNICODE has not been negotiated. If CAP_UNICODE has not been negotiated, only the length of the first NULL byte is included in the value of the **FileNameLength** field. + +[<166> Section 2.2.8.1.7](#Appendix_A_Target_166): Windows-based CIFS servers set the **FileIndex** field to a nonzero value if the underlying object store supports indicating the position of a file within the parent directory. + +[<167> Section 2.2.8.1.7](#Appendix_A_Target_167): If CAP_UNICODE has not been negotiated, Windows NT servers include the length of one NULL padding byte in the **FileNameLength** field value. + +[<168> Section 2.2.8.1.7](#Appendix_A_Target_168): Windows NT servers append an arbitrary number of extra NULL padding bytes to the **FileName** field. The length of these additional NULL bytes is not included in the value of the **FileNameLength** field unless CAP_UNICODE has not been negotiated. If CAP_UNICODE has not been negotiated, only the length of the first NULL byte is included in the value of the **FileNameLength** field. + +[<169> Section 2.2.8.2.1](#Appendix_A_Target_169): Windows-based servers always return zero (0x00000000). + +[<170> Section 2.2.8.2.2](#Appendix_A_Target_170): Windows NT servers use the FileFsVolumeInformation information class to retrieve file system volume information. See \[MS-FSCC\], section 2.5.9. + +If the **VolumeLabelLength** field of the FILE_FS_VOLUME_INFORMATION data element contains a value greater than 13, an error response is returned to the client with a status of STATUS_BUFFER_OVERFLOW (ERRDOS/ERRmoredata). Otherwise, the **ulVolSerialNbr** field is copied from the **VolumeSerialNumber** field of the FILE_FS_VOLUME_INFORMATION data element. **VolumeLabelLength** is copied to **cCharCount** and **VolumeLabel** is copied to **VolumeLabel**. + +Windows clients request SMB_INFO_VOLUME only if CAP_NT_SMBS has not been negotiated. If CAP_NT_SMBS has been negotiated, Windows clients request SMB_QUERY_FS_VOLUME_INFO instead of SMB_INFO_VOLUME. + +If CAP_UNICODE has been negotiated, the contents of the **VolumeLabel** field returned by Windows NT servers is undefined. + +If CAP_UNICODE has not been negotiated, Windows NT servers append an arbitrary number of extra NULL padded bytes to the **VolumeLabel** field. + +[<171> Section 2.2.8.2.3](#Appendix_A_Target_171): Windows NT Server servers use the FileFsVolumeInformation (\[MS-FSCC\] section 2.5.9) information class to retrieve file system volume information. + +[<172> Section 2.2.8.2.4](#Appendix_A_Target_172): Windows NT servers use the FileFsSizeInformation (\[MS-FSCC\] section 2.5.8) information class to retrieve file system allocation and size information. + +[<173> Section 2.2.8.2.5](#Appendix_A_Target_173): Windows NT servers use the FileFsDeviceInformation (\[MS-FSCC\] section 2.5.10) information class to retrieve file system device information. + +[<174> Section 2.2.8.2.6](#Appendix_A_Target_174): Windows NT Server use the FileFsAttributeInformation (\[MS-FSCC\] section 2.5.1) informationclass to retrieve file system attribute information. + +- SMB_QUERY_FS_ATTRIBUTE_INFO +- { +- ULONG FileSystemAttributes; +- LONG MaxFileNameLengthInBytes; +- ULONG LengthOfFileSystemName; +- WCHAR FileSystemName\[LengthOfFileSystemName/2\]; +- } + +[<175> Section 2.2.8.3.6](#Appendix_A_Target_175): Windows NT Server use the FileBasicInformation (\[MS-FSCC\] section 2.4.7) information class to retrieve timestamp and extended file attribute information for a file. + +[<176> Section 2.2.8.3.7](#Appendix_A_Target_176): Windows NT servers use the FileStandardInformation (\[MS-FSCC\] section 2.4.47) information class to retrieve the specified standard information for a file. + +[<177> Section 2.2.8.3.8](#Appendix_A_Target_177): Windows NT Server use the FileEaInformation (\[MS-FSCC\] section 2.4.13) information class to EA size information for a file. + +[<178> Section 2.2.8.3.9](#Appendix_A_Target_178): Windows NT Server use the FileNameInformation (\[MS-FSCC\] section 2.4.32) information class to retrieve the long name for a file. + +[<179> Section 2.2.8.3.11](#Appendix_A_Target_179): Windows NT servers use the FileAlternateNameInformation (\[MS-FSCC\] section 2.4.5) information class to retrieve the 8.3 format name for a file. + +[<180> Section 2.2.8.3.12](#Appendix_A_Target_180): Windows NT Server use the FileStreamInformation (\[MS-FSCC\] section 2.4.49) information class to retrieve the stream information for a file. + +[<181> Section 2.2.8.3.13](#Appendix_A_Target_181): Windows NT Server use the FileCompressionInformation (\[MS-FSCC\] section 2.4.9) information class to retrieve the compression information for a file. + +[<182> Section 2.2.8.4.3](#Appendix_A_Target_182): Windows NT servers use the FileBasicInformation (\[MS-FSCC\] section 2.4.7) information class to set timestamp and extended file attribute information for a file. + +[<183> Section 2.2.8.4.4](#Appendix_A_Target_183): Windows NT servers use the FileDispositionInformation (\[MS-FSCC\] section 2.4.11) information class to mark or unmark a file for deletion.) + +[<184> Section 2.2.8.4.5](#Appendix_A_Target_184): Windows NT servers use the FileAllocationInformation (\[MS-FSCC\] section 2.4.4) information class to set allocation size information for a file. + +[<185> Section 2.2.8.4.6](#Appendix_A_Target_185): Windows NT servers use the FileEndOfFileInformation (\[MS-FSCC\] section 2.4.14) information class to set end-of-file information for a file. + +[<186> Section 3.1.5.2](#Appendix_A_Target_186): Windows clients do not provide a configuration parameter to specify LMv2 authentication. Rather, a single system parameter enables both LMv2 and NTLMv2 authentication. For more information, see [\[MSFT-SecurityWatch\]](https://go.microsoft.com/fwlink/?LinkId=177588). + +[<187> Section 3.2.1.1](#Appendix_A_Target_187): Windows NT Workstation 4.0 added support for the ability to enable and require signing in Service Pack 3 (SP3). See [\[ENSIGN\]](https://go.microsoft.com/fwlink/?LinkId=161959). + +[<188> Section 3.2.1.5](#Appendix_A_Target_188): Windows 98 and NT 4 Workstation clients do not request Exclusive or Level II OpLocks. + +[<189> Section 3.2.2.1](#Appendix_A_Target_189): Windows NT and Windows 98 CIFS clients implement this timer with a default value of 30 seconds. + +[<190> Section 3.2.3](#Appendix_A_Target_190): Windows 98 clients set **Client.PlaintextAuthenticationPolicy** to **Disabled** by default. Plain text authentication can be enabled by selecting the HKLM\\System\\CurrentControlSet\\Services\\VxD\\VNETSUP registry path and setting the EnablePlainTextPassword registry value to 1. + +Windows NT clients prior to NT 4 SP3 set **Client.PlaintextAuthenticationPolicy** to **Enabled** by default. Windows NT 4.0 SP3 and above client systems set **Client.PlaintextAuthenticationPolicy** to **Disabled** by default. Plain text authentication can be enabled by selecting the HKLM\\System\\CurrentControlSet\\Services\\Rdr\\Parameters registry path and setting the EnablePlainTextPassword registry value to 1. + +Windows 98 clients determine **Client.LMAuthenticationPolicy** and **Client.NTLMAuthenticationPolicy** based upon the value of the LMCompatibility registry key. See \[MSFT-SecurityWatch\] and \[IMP-CIFS\] section 15.5.7 for further information. Windows 98 clients do not support NTLMv2 authentication, but support can be added. See [\[MSKB-288358\]](https://go.microsoft.com/fwlink/?LinkId=182635). + +Windows NT 4.0 Workstation clients determine **Client.LMAuthenticationPolicy** and **Client.NTLMAuthenticationPolicy** based upon the value of the LMCompatibilityLevel registry key. Support for NTLMv2 authentication was added to Windows NT 4.0 in SP4. See \[MSFT-SecurityWatch\], [\[MSKB-239869\]](https://go.microsoft.com/fwlink/?LinkId=182633), and \[IMP-CIFS\] section 15.5.7 for further information. + +[<191> Section 3.2.3](#Appendix_A_Target_191): Windows NT 3.51 servers do not support signing. Windows NT 4.0 added support for the ability to enable and require signing in Service Pack 3 (SP3). See \[ENSIGN\]. + +[<192> Section 3.2.3](#Appendix_A_Target_192): Windows NT clients use a default value of 45 seconds. This value is obtained from a system-wide configuration parameter. See [\[KB102067\]](https://go.microsoft.com/fwlink/?LinkId=162005) for more information. + +[<193> Section 3.2.3](#Appendix_A_Target_193): The default maximum buffer size for Windows 98 and NT 4 Workstation clients is 4356 bytes. + +[<194> Section 3.2.3](#Appendix_A_Target_194): Windows-based clients set the list of supported dialect identifier strings in the following order. + +- PC NETWORK PROGRAM 1.0 +- LANMAN1.0 +- MICROSOFT NETWORKS 3.0 +- LM1.2X002 +- LANMAN2.1 +- NT LM 0.12 + +This technical document describes only the NT LM 0.12 dialect behavior; see section [1](#Section_934c2faa54af4526ac746a24d126724e). + +[<195> Section 3.2.3](#Appendix_A_Target_195): By default, Windows 98 and NT 4 Workstation clients set the **Client.Connection.MaxMpxCount** value to 50. This can be configured using the MaxCmds registry setting. + +[<196> Section 3.2.4.1.4](#Appendix_A_Target_196): Windows 98 and Windows NT 4.0 clients do not send AndX chains longer than two commands in length. Windows NT Server 4.0 produces unexpected errors if an untested AndX chain is received. + +[<197> Section 3.2.4.1.5](#Appendix_A_Target_197): Windows 98 clients and Windows NT clients and servers do not support sending a transaction with secondary messages as part of an AndX chain. The SMB_COM_SESSION_SETUP_ANDX and SMB_COM_TREE_CONNECT_ANDX commands each permits an SMB_COM_TRANSACTION as a follow-on command. Transactions that are part of an AndX chain are "complete". That is, the entire transaction request fits within the primary transaction request. + +[<198> Section 3.2.4.2.1](#Appendix_A_Target_198): The Windows implementation, by default, attempts to connect on all available [**SMB transports**](#gt_f8b0f8a6-e412-459a-b8ba-219008e5bcd7) (NetBIOS-compatible and direct IPX) simultaneously and selects the one that succeeds the fastest. Any connection that is not selected is immediately closed. Windows also allows an upper layer to specify what transport to use. + +[<199> Section 3.2.4.2.4](#Appendix_A_Target_199): Windows NT servers do not support share level access control. + +[<200> Section 3.2.4.2.4](#Appendix_A_Target_200): Null sessions are also used to allow clients to access the browse list and list of available server shares. See [\[MS-BRWS\]](%5bMS-BRWS%5d.pdf#Section_d2d83b294b62479eb4279b750303387b) for more information on the Browser Service. + +[<201> Section 3.2.4.2.4](#Appendix_A_Target_201): Windows NT Server does not support share level access control. + +[<202> Section 3.2.4.2.4](#Appendix_A_Target_202): Windows clients determine the authentication type using the following rules: + +- IF Client.NTLMAuthenticationPolicy NOT EQUALS Disabled THEN +- USE NT LAN Manager (NTLM) Response OR NT LAN Manager version 2 (NTLMv2) Response +- ELSE IF Client.LMAuthenticationPolicy NOT EQUALS Disabled THEN +- USE LAN Manager (LM) Response OR LAN Manager version 2 (LMv2) Response +- ELSE IF Client.PlaintextAuthenticationPolicy EQUALS Enabled THEN +- USE Plaintext Authentication +- ELSE +- Fail the Authentication +- END IF + +[<203> Section 3.2.4.2.4](#Appendix_A_Target_203): Windows 98 and NT 4 Workstation clients do not retry authentication. + +[<204> Section 3.2.4.5](#Appendix_A_Target_204): Windows 98and Windows NT Workstation 4.0 clients never request exclusive OpLocks. + +[<205> Section 3.2.4.14.1](#Appendix_A_Target_205): If a Windows-based server does not support the READ RAW capability, but a client sends an SMB_COM_READ_RAW request to the server, the server sends a zero-length response. + +[<206> Section 3.2.4.15](#Appendix_A_Target_206): Windows clients set the first two bytes of the **SMB_Data.Bytes.Data** field to the **SMB_Parameters.Words.Remaining** field value for the first write request. + +[<207> Section 3.2.4.15.1](#Appendix_A_Target_207): Windows 98 and NT clients set the **Timeout** field to 0x00000000 in this request. + +If the server has indicated support for Raw Mode by setting CAP_RAW_MODE in the SMB_COM_NEGOTIATE Response (section 2.2.4.52.2), a Windows NT client might send SMB_COM_WRITE_RAW, even if it has not indicated support for RAW WRITE, by setting the CAP_RAW_MODE bit in the **Capabilities** bit field of the SMB_COM_SESSION_SETUP_ANDX Request (section 2.2.4.53.1). This is expected to succeed, because the server has already indicated support for the Raw Mode. + +[<208> Section 3.2.4.43](#Appendix_A_Target_208): Support for DFS Client capabilities was introduced in Windows NT 4.0 Workstation and Server. + +[<209> Section 3.2.5.1.2](#Appendix_A_Target_209): Windows-based clients that use message signing disconnect the connection on receipt of an incorrectly signed message. + +[<210> Section 3.2.5.13](#Appendix_A_Target_210): Windows NT CIFS servers maintain a 64-bit offset value internally, but return only the lower-order 32-bits. + +[<211> Section 3.2.6.1](#Appendix_A_Target_211): Windows NT clients use a default **Client.SessionTimeoutValue** value of 45 seconds. Additional time will be added depending upon the size of the message. See \[KB102067\] for more information. + +[<212> Section 3.2.6.1](#Appendix_A_Target_212): Windows NT and Windows 98 CIFS clients periodically scan for any commands that have not completed. If there are outstanding commands that have exceeded the **Client.SessionTimeoutValue**, an [SMB_COM_ECHO (section 2.2.4.39)](#Section_8c85435267c647f7a60da6c87b6b3aac) is sent to determine whether or not the connection has been lost. Regardless of whether the client receives an [SMB_COM_ECHO Response (section 2.2.4.39.2)](#Section_362424677c624041b60f939683cacdf2), it closes the connection if there is no response to the outstanding commands that have exceeded the **Client.SessionTimeoutValue**. + +[<213> Section 3.3.1.1](#Appendix_A_Target_213): Windows NT Server 4.0 added support for the ability to enable and require signing in Service Pack 3 (SP3). See \[ENSIGN\]. + +[<214> Section 3.3.1.2](#Appendix_A_Target_214): Windows NT servers allow the sharing of printers and traditional file shares. + +[<215> Section 3.3.1.2](#Appendix_A_Target_215): In Windows, this ADM element contains the security descriptor for the share. + +[<216> Section 3.3.1.3](#Appendix_A_Target_216): Windows NT Server 4.0 does not include the **CID** as a lookup key to identify the list of pending requests that are associated with the SMB transport in **Server.Connection.PendingRequestTable**; it includes only the **UID**, **TID**, **PID**, and **MID**. + +[<217> Section 3.3.2.1](#Appendix_A_Target_217): The default OpLock acknowledgment time-out on Windows NT Servers is 35 seconds. This value is controlled by the \\HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\LanmanServer\\Parameters\\OplockBreakWait registry parameter. See [\[KB129202\]](https://go.microsoft.com/fwlink/?LinkId=162006). + +[<218> Section 3.3.2.2](#Appendix_A_Target_218): The default idle timer time-out value for Windows NT 4.0 is 15 minutes. See [\[KB297684\]](https://go.microsoft.com/fwlink/?LinkId=162010) for more information on Windows NT idle timer settings. + +[<219> Section 3.3.3](#Appendix_A_Target_219): Windows NT Server initializes **Server.ShareLevelAuthentication** to FALSE because Windows NT Server does not support share-level security. + +[<220> Section 3.3.3](#Appendix_A_Target_220): Windows-based server sets the list of supported dialect identifier strings in the following order: + +- PC NETWORK PROGRAM 1.0 +- LANMAN1.0 +- MICROSOFT NETWORKS 3.0 +- LM1.2X002 +- LANMAN2.1 +- NT LM 0.12 + +This technical document describes only the NT LM 0.12 dialect behavior; see section 1. + +[<221> Section 3.3.3](#Appendix_A_Target_221): By default, Windows NT Server accepts plaintext authentication. + +Windows NT Server determines **Server.LMAuthenticationPolicy** and **Server.NTLMAuthenticationPolicy** based upon the value of the LMCompatibilityLevel registry key. Support for NTLMv2 authentication was added in Windows NT 4.0 operating system Service Pack 4 (SP4). See \[MSFT-SecurityWatch\], \[MSKB-239869\], and \[IMPCIFS\] section 15.5.7 for further information. + +[<222> Section 3.3.3](#Appendix_A_Target_222): The default **MaxBufferSize** on Windows NT Server is 4356 (0x00001104) bytes (4KB + 260 bytes) if the server has 512 MB of memory or less. If the server has more than 512 MB of memory, the default **MaxBufferSize** is 16644 (0x00004104) bytes (16KB + 260Bytes). Windows NT Server always uses a **MaxBufferSize** value that is a multiple of four (0x00000004). The **MaxBufferSize** can be configured through the following registry setting: + +- HKLM\\SYSTEM\\CurrentControlSet\\Services\\LanmanServer\\Parameters\\SizReqBuf + +[<223> Section 3.3.3](#Appendix_A_Target_223): On Windows NT Server, the default value is 50 (0x0032). This value can be set using the **MaxMpxCt** registry key. + +[<224> Section 3.3.3](#Appendix_A_Target_224): Windows NT 3.51 servers do not support signing. Windows NT 4.0 added support for the ability to enable and require signing in Windows NT 4.0 operating system Service Pack 3 (SP3). See \[ENSIGN\] for more information. + +[<225> Section 3.3.3](#Appendix_A_Target_225): Windows-based servers set the **Server.MaxRawSize** value to 65,536 (0x00010000) bytes (64KB). + +[<226> Section 3.3.3](#Appendix_A_Target_226): Windows-based servers initialize **Server.MaxSearches** to 2048. + +[<227> Section 3.3.4.1](#Appendix_A_Target_227): When signing is neither enabled nor required: + +- Windows-based servers do not initialize the **SecuritySignature** field in the header of the [SMB_COM_SESSION_SETUP_ANDX Response (section 2.2.4.53.2)](#Section_e7514918a0f649329f00ced094445537). The value of this field is arbitrary. +- Windows clients ignore the **SecuritySignature** field. + +[<228> Section 3.3.4.1.1](#Appendix_A_Target_228): Windows-based servers set the **SMB_Header.Reserved** field of the response to the **SMB_Header.Reserved** value received in the request. + +[<229> Section 3.3.4.1.2](#Appendix_A_Target_229): If 32-bit status codes have not been negotiated, Windows-based servers convert NTSTATUS codes to their equivalent SMBSTATUS Class/Code pairs before sending the response. + +[<230> Section 3.3.4.2](#Appendix_A_Target_230): Windows-based servers receive the type of OpLock that has been requested to be broken from the object store, as described in \[MS-FSA\] section 2.1.5.18.3, with the following output element mapping: + +- **NewOpLockLevel** is copied to the **NewOpLockLevel** field of the [SMB_COM_LOCKING_ANDX Request (section 2.2.4.32.1)](#Section_b5c6eae7976b4444b52ec76c68c861ad). + +[<231> Section 3.3.4.2](#Appendix_A_Target_231): Windows NT Server 4.0 always sets the **Timeout**, **NumberOfUnlocks**, **NumberofLocks**, and **ByteCount** fields to zero, and the client ignores these fields. + +[<232> Section 3.3.4.3](#Appendix_A_Target_232): Support for DFS Server capability was introduced in Windows NT Server 4.0 operating system with Service Pack 2 (SP2). + +[<233> Section 3.3.4.17](#Appendix_A_Target_233): For each supported transport type as listed in section [2.1](#Section_56df901359444ccf970b67c30ef5c449), the Windows CIFS server attempts to form an association with the specified device with local calls specific to each supported transport type and rejects the entry if none of the associations succeed. + +[<234> Section 3.3.4.17](#Appendix_A_Target_234): On Windows, **ServerName** is used only when the transport is [NBT (section 2.1.1.2)](#Section_45170055a0cd49109228801d5bf7ac84). + +[<235> Section 3.3.4.17](#Appendix_A_Target_235): On Windows, servers manage listening in TDI transport drivers through the interface described in [\[MSDN-MakeEndpoint\]](https://go.microsoft.com/fwlink/?LinkId=214275). + +[<236> Section 3.3.5.1](#Appendix_A_Target_236): On Windows, the transport name is obtained from the TDI device object that was opened as part of transport initialization and returned by the new connection indication. For more information on TDI device objects, see [\[MSDN-TDIDeviceObj\]](https://go.microsoft.com/fwlink/?LinkId=214277). Possible Windows-specific values for **Server.Connection.TransportName** are listed in a product behavior note attached to [\[MS-SRVS\]](%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 2.2.4.96. + +[<237> Section 3.3.5.1](#Appendix_A_Target_237): Windows-based servers do not generate a token and always set **Server.Connection.SessionKey** to zero. + +[<238> Section 3.3.5.2](#Appendix_A_Target_238): Windows NT servers perform basic validation tests on received command requests before determining whether or not the command is Obsolete or Not Implemented. If a request is found to be incorrectly formatted, the server returns STATUS_INVALID_SMB (ERRSRV/ERRerror). + +[<239> Section 3.3.5.2](#Appendix_A_Target_239): Windows NT Server does not validate the **TID** field in SMB_COM_ECHO requests. + +[<240> Section 3.3.5.2.5](#Appendix_A_Target_240): Windows NT servers fail a transaction request with STATUS_INSUFF_SERVER_RESOURCES, if (**SetupCount** + **MaxSetupCount** + **TotalParameterCount** + **MaxParameterCount** + **TotalDataCount** + **MaxDataCount**) is greater than 65\*1024. + +[<241> Section 3.3.5.3](#Appendix_A_Target_241): Windows-based servers create directories within the object store as described in \[MS-FSA\] sections 2.1.5.1 and 2.1.5.1.1, with the following mapping of input elements: + +- **RootOpen** is provided by using the **SMB_Header.TID** field to find the matching **Server.TreeConnect** in the **Server.Connection.TreeConnectTable**. The server then acquires an **Open** on **Server.TreeConnect.Share.LocalPath**, which is passed as **RootOpen**. +- PathName is the **SMB_Data.Bytes.DirectoryName** field from the request. +- **SecurityContext** is found by using the **SMB_Header.UID** field to look up the matching **Session** entry in the **Server.Connection.SessionTable**. The **Server.Session.UserSecurityContext** is passed as **SecurityContext**. +- **DesiredAccess** is set to FILE_TRAVERSE, which has the same value as FILE_EXECUTE: 0x00000020. +- **ShareAccess** is set to 0x00000000. +- **CreateOptions** is set to FILE_DIRECTORY_FILE. +- **CreateDisposition** is set to FILE_CREATE. +- **DesiredFileAttributes** is set to FILE_ATTRIBUTE_NORMAL. +- **IsCaseSensitive** is set to FALSE if the SMB_FLAGS_CASE_INSENSITIVE bit is set in the **SMB_Header.Flags** field of the request. Otherwise, **IsCaseSensitive** is set depending upon system defaults. For more information, see the description of the OBJ_CASE_INSENSITIVE flag of the **OBJECT_ATTRIBUTES** structure [\[MSDOCS-OBJ_ATTRIBS\]](https://go.microsoft.com/fwlink/?linkid=2105002). +- **OpLockKey** is empty. + +The returned **Status** is copied into the **SMB_Header.Status** field of the response. If the operation is successful, the **Open** returned from the process described in \[MS-FSA\] section 2.1.5.1 is closed. All other results are ignored. + +[<242> Section 3.3.5.4](#Appendix_A_Target_242): Windows-based servers delete directories within the object store by opening them as described in \[MS-FSA\] section 2.1.5.1, with DesiredAccess set to DELETE. The following is a mapping of input elements: + +- **RootOpen** is provided by using the **SMB_Header.TID** to find the matching **treeConnect** in the **Server.Connection.TreeConnectTable**, which in turn provides the **Server.TreeConnect.Share**. **Server.TreeConnect.Share** points to an entry in the **Server.Share** table. The **Server.Share.LocalPath** is the path to the root of the share. An Open directory handle representing **Server.Share.LocalPath** is passed as **RootOpen**. +- **PathName** is the **SMB_Data.Bytes.DirectoryName** field from the request. +- **SecurityContext** is found by using the **SMB_Header.UID** to look up the matching [**session**](#gt_0cd96b80-a737-4f06-bca4-cf9efb449d12) entry in the **Server.Connection.SessionTable**. The **Server.Session.UserSecurityContext** is passed as **SecurityContext**. +- **DesiredAccess** is set to DELETE (0x00010000). +- **ShareAccess** is set to 0x00000000. +- **CreateOptions** is set to FILE_DIRECTORY_FILE. +- **CreateDisposition** is set to FILE_OPEN. +- **DesiredFileAttributes** is set to 0x00000000. +- **IsCaseSensitive** is set to FALSE if the SMB_FLAGS_CASE_INSENSITIVE bit is set in the **SMB_Header.Flags** field of the request. Otherwise, **IsCaseSensitive** is set depending upon system defaults. For more information, see the description of the OBJ_CASE_INSENSITIVE flag of the **OBJECT_ATTRIBUTES** structure \[MSDOCS-OBJ_ATTRIBS\]. +- **OpLockKey** is empty. + +The file is opened as described in \[MS-FSA\] section 2.1.5.1, and the returned **Status** is copied into the **SMB_Header.Status** field of the response. If the operation fails, the **Status** is returned in an Error Response and processing is complete. + +If the operation is successful, the file is marked to be deleted when closed as described in \[MS-FSA\] section 2.1.5.15, passing the following mapping of input elements: + +- **Open** is the **Open** returned in the previous operation. +- **FileInformationClass** is FileDispositionInformation. See \[MS-FSA\] section 2.1.5.15.3. +- **InputBuffer** is the FILE_DISPOSITION_INFORMATION data element specified in \[MS-FSCC\] section 2.4.11. **InputBuffer.DeletePending** is set to TRUE. +- **InputBufferLength** is the size of the FILE_DISPOSITION_INFORMATION data element. + +If the Set File Information operation fails, the **Status** is returned in an Error Response and processing is complete. If the operation is successful, the **Open** is immediately closed, which results in the deletion of the file. All other results are ignored. + +[<243> Section 3.3.5.4](#Appendix_A_Target_243): Windows NT servers close any **SearchOpen** with a matching **TID** where the canonicalized directory name derived from the **SMB_Data.Bytes.DirectoryName** field is a prefix of the canonicalized full search path, including the filename portion. This could potentially result in unrelated **SearchOpens** being closed. + +[<244> Section 3.3.5.5](#Appendix_A_Target_244): Windows NT Server always ignores the **SearchAttributes** field on Open and Create operations, and searches for files by name only. + +[<245> Section 3.3.5.5](#Appendix_A_Target_245): Windows-based servers open files in the object store as described in \[MS-FSA\] section 2.1.5.1, with the following mapping of input elements: + +- **RootOpen** is provided by using the **SMB_Header.TID** to find the matching **Server.TreeConnect** in the **Server.Connection.TreeConnectTable**. The server then acquires an **Open** on **Server.TreeConnect.Share.LocalPath**, which is passed as **RootOpen**. +- **PathName** is the **SMB_Data.Bytes.FileName** field from the request. +- **SecurityContext** is found by using the **SMB_Header.UID** to look up the matching **Session** entry in the **Server.Connection.SessionTable**. The **Server.Session.UserSecurityContext** is passed as **SecurityContext**. +- **DesiredAccess** is set as follows: + - The **AccessMode** subfield of the **AccessMode** field in the request is used to set the value of **DesiredAccess**. The **AccessMode** subfield represents the lowest order four bits of the **AccessMode** field (0x0007), as shown in the table in section [2.2.4.3.1](#Section_ab9bb87219674088b4446a35d0af305e). The mapping of values is as follows. + +| AccessMode.AccessMode | DesiredAccess | +| --------------------- | ---------------------------------------------------------------- | +| 0 | GENERIC_READ (0x80000000) | +| 1 | GENERIC_WRITE \| FILE_READ_ATTRIBUTES (0x40000000 \| 0x00000080) | +| 2 | GENERIC_READ \| GENERIC_WRITE (0x80000000 \| 0x40000000) | +| 3 | GENERIC_READ \| GENERIC_EXECUTE (0x80000000 \| 0x20000000) | + +- - For any other value of **AccessMode.AccessMode**, this algorithm returns STATUS_OS2_INVALID_ACCESS (ERRDOS/ERRbadaccess). +- **ShareAccess** is set as follows: + - The **SharingMode** subfield of the **AccessMode** field in the request is used to set the value of **ShareAccess**. The **SharingMode** subfield is a 4-bit subfield of the **AccessMode** field (0x0070), as shown in the table in section 2.2.4.3.1. The mapping of values is as follows. + +| AccessMode.SharingMode | ShareAccess | +| ---------------------- | ----------------------------------- | +| 0 | Compatibility mode (see below) | +| 1 | 0x0L (don't share, exclusive use) | +| 2 | FILE_SHARE_READ | +| 3 | FILE_SHARE_WRITE | +| 4 | FILE_SHARE_READ \| FILE_SHARE_WRITE | + +- - For Compatibility mode, special filename suffixes (after the '.' in the filename) are mapped to **SharingMode** 4. The special filename suffix set is: "EXE", "DLL", "SYM, "COM". All other file names are mapped to **SharingMode** 3. + - If **AccessMode** field in the request is 0xFF, and the file is already open on the server, the current sharing mode of the existing **Open** is preserved and a **FID** for the file is returned. If the file is not already open on the server, the server attempts to open the file using **SharingMode** 1. + - For any other value of **AccessMode.SharingMode**, this algorithm returns STATUS_OS2_INVALID_ACCESS (ERRDOS/ERRbadaccess). +- **CreateOptions** is set to (**FILE_NON_DIRECTORY_FILE | FILE_COMPLETE_IF_OPLOCKED**). If the **SMB_Header.Flags2 SMB_FLAGS2_KNOWS_EAS** flag is not set, then the **FILE_NO_EA_KNOWLEDGE** bit is also set. The FILE_WRITE_THROUGH bit is set based on the **SMB_Parameters**. **Words.AccessMode.WritethroughMode** bit. +- **CreateDisposition** is set to **FILE_OPEN**. +- **DesiredFileAttributes** is set to FILE_ATTRIBUTE_NORMAL. +- **IsCaseSensitive** is set to FALSE if the **SMB_FLAGS_CASE_INSENSITIVE** bit is set in the **SMB_Header.Flags** field of the request. Otherwise, **IsCaseSensitive** is set depending upon system defaults. For more information, see the description of the **OBJ_CASE_INSENSITIVE** flag of the **OBJECT_ATTRIBUTES** structure \[MSDOCS-OBJ_ATTRIBS\]. +- **OpLockKey** is empty. +- The returned **Status** is copied into the **SMB_Header.Status** field of the response. If the operation fails, the **Status** is returned in an Error Response and processing is complete. +- If the operation is successful, processing continues as follows: +- If the **SMB_FLAGS_OPLOCK** flag is set in the **SMB_Header.Flags** of the request, then an OpLock is being requested. Windows-based servers obtain OpLocks as described in \[MS-FSA\] section 2.1.5.18, with the following mapping of input elements: + - **Open** is the **Open** passed through from the preceding operation. + - **Type** is LEVEL_BATCH if the **SMB_FLAGS_OPBATCH** flag is set in the **SMB_Header.Flags** of the request; otherwise, it is LEVEL_ONE. +- If an OpLock is granted, the **SMB_Header.Flags SMB_FLAGS_OPLOCK** and **SMB_FLAGS_OPBATCH** flags are copied from the request to the response. Otherwise, both flags are set to zero in the response. +- The **SMB_Parameters.Words.AccessMode** from the request is copied to the response. +- Windows-based servers obtain the **SMB_Parameters.Words.FileAttributes** and **SMB_Parameters.Words.LastModified** response field values by querying file information from the object store as described in \[MS-FSA\] section 2.1.5.12, with the following mapping of input elements: + - **Open** is the **Open** passed through from the preceding operations. + - **FileInformationClass** is **FileBasicInformation**. +- If the query fails, the **Status** is returned in an Error Response and processing is complete. Otherwise: + - **SMB_Parameters.Words.FileAttributes** is set to OutputBuffer.FileAttributes. + - **SMB_Parameters.Words.LastModified** is set to OutputBuffer.ChangeTime. +- Windows-based servers obtain the **SMB_Parameters.Words.FileSize** response field values by querying file information from the object store as described in \[MS-FSA\] section 2.1.5.12, with the following mapping of input elements: + - **Open** is the **Open** passed through from the preceding operations. + - **FileInformationClass** is **FileStandardInformation**. +- If the query fails, the **Status** is returned in an Error Response and processing is complete. Otherwise: + - **SMB_Parameters.Words.FileSize** is set to the lowest-order 32 bits of OutputBuffer.EndOfFile. +- If the query fails, the **Status** is returned in an Error Response and processing is complete. +- A new **FID** is generated for the **Open** returned. All of the other results of the **Open** operation are ignored. The **FID** is copied into the **SMB_Parameters.Words.FID** field of the response. + +While opening an existing file, the underlying object store checks for the necessity of an Oplock break, as described in \[MS-FSA\] section 2.1.4.12, and if necessary, notifies the server, as described in section [3.3.4.2](#Section_b50b9ddaf3744427a93edf9c55c043a6) and defers the opening of the file until the server acknowledges the Oplock break, as described in section [3.3.5.30](#Section_709a30abb9f54745bd8e86f7212d4bc4). + +[<246> Section 3.3.5.6](#Appendix_A_Target_246): Windows-based servers ignore the **CreationTime** field in the [SMB_COM_CREATE Request (section 2.2.4.4.1)](#Section_244621046b354fe4aeaa7c30cd727bc9). + +[<247> Section 3.3.5.6](#Appendix_A_Target_247): When opening, overwriting, deleting, or renaming a file, Windows NT Server checks for sharing violations. If a sharing violation would be generated by the operation, by default the server delays for 200 ms and then tests again for a sharing violation. By default the server retries five times, for a total delay of approximately one second, before giving up and returning the sharing violation error. The sharing violation delay time and number of retries are configurable as described in \[MSKB-150384\]. + +[<248> Section 3.3.5.6](#Appendix_A_Target_248): Windows-based servers create files in the object store as described in \[MS-FSA\] section 2.1.5.1, with the following mapping of input elements: + +- **RootOpen** is provided by using the **SMB_Header.TID** to find the matching **TreeConnect** in the **Server.Connection.TreeConnectTable**, which in turn provides the **Server.TreeConnect.Share. Server.TreeConnect.Share** points to an entry in the **Server.Share** table. The **Server.Share.LocalPath** is the path to the root of the share. An Open directory handle representing **Server.Share.LocalPath** is passed as **RootOpen**. +- **PathName** is the **SMB_Data.Bytes.FileName** field from the request. +- **SecurityContext** is found by using the **SMB_Header.UID** to look up the matching **Session** entry in the **Server.Connection.SessionTable**. The **Server.Session.UserSecurityContext** is passed as **SecurityContext**. +- **DesiredAccess** is set to (GENERIC_READ | GENERIC_WRITE). +- **ShareAccess** is set to FILE_SHARE_WRITE. If the file extension (after the "." in the filename) is in the special filename suffix set ("EXE", "DLL", "SYM", "COM"), ShareAccess is set to FILE_SHARE_WRITE | FILE_SHARE_READ). +- **DesiredFileAttributes** is set as follows: + - **DesiredFileAttributes** is set to the bitwise AND of the **FileAttributes** field in the request and + +(SMB_FILE_ATTRIBUTE_READONLY | + +SMB_FILE_ATTRIBUTE_HIDDEN | + +SMB_FILE_ATTRIBUTE_SYSTEM | + +SMB_FILE_ATTRIBUTE_ARCHIVE | + +**SMB_FILE_ATTRIBUTE_DIRECTORY** ). + +- - If the resulting value of **DesiredFileAttributes** is zero, **DesiredFileAttributes** is set to FILE_ATTRIBUTE_NORMAL. +- **CreateDisposition** is set to FILE_OVERWRITE_IF. + - If the **SMB_Header.Flags2 SMB_FLAGS2_KNOWS_EAS** flag is not set, the FILE_NO_EA_KNOWLEDGE bit is also set. +- **CreateOptions** is set to **FILE_NON_DIRECTORY_FILE**. + - If the **WritethroughMode** bit of the **SMB_Parameters.Words.AccessMode** field is set, the FILE_WRITE_THROUGH bit is also set. +- **OpLockKey** is empty. + +The returned **Status** is copied into the **SMB_Header.Status** field of the response. If the operation fails, the **Status** is returned in an Error Response and processing is complete. + +If the operation is successful, processing continues as follows: + +- If the **SMB_FLAGS_OPLOCK** flag is set in the **SMB_Header.Flags** of the request, an OpLock is being requested. Windows-based servers obtain OpLocks as described in \[MS-FSA\] section 2.1.5.18, with the following mapping of input elements: + - **Open** is the **Open** passed through from the preceding operation. + - **Type** is LEVEL_BATCH if the **SMB_FLAGS_OPBATCH** flag is set in the **SMB_Header.Flags** of the request; otherwise, it is LEVEL_ONE. + +If an OpLock is granted, the **SMB_Header.Flags SMB_FLAGS_OPLOCK** and **SMB_FLAGS_OPBATCH** flags are copied from the request to the response. Otherwise, both flags are set to zero in the response. + +- Windows-based servers set the **LastWriteTime** of the file if the **SMB_Parameters.Words.CreationTime** in the request is not zero or -1 (0xFFFFFFFF). Windows-based servers set this value as described in \[MS-FSA\] section 2.1.5.15, with the following mapping of input elements: + - **Open** is the **Open** passed through from the preceding operations. + - **FileInformationClass** is **FileBasicInformation**. + - **InputBuffer.CreationTime**, **InputBuffer.LastAccessTime**, **InputBuffer.ChangeTime**, and **InputBuffer.FileAttributes** are each set to zero. + - **InputBuffer.LastWriteTime** is set to the time value in **SMB_Parameters.Words.CreationTime**. + +The result of the set operation is ignored. + +- A new **FID** is generated for the **Open** returned. All of the other results of the Open operation are ignored. The **FID** is copied into the **SMB_Parameters.Words.FID** field of the response. + +[<249> Section 3.3.5.7](#Appendix_A_Target_249): Windows-based servers update the last modification time for the file, as described in \[MS-FSA\] section 2.1.5.15.2, with the following mapping of input elements: + +- **Open** is the **Open** corresponding to the input **FID**. +- **InputBuffer.LastWriteTime** is set to **SMB_Parameters.Word.LastTimeModified**. +- **FileInformationClass** is FileBasicInformation (\[MS-FSCC\] section 2.4.7). +- **InputBuffer.CreationTime**, **InputBuffer.LastAccessTime**, **InputBuffer.ChangeTime** and **InputBuffer.FileAttributes** are all set to zero. + +[<250> Section 3.3.5.7](#Appendix_A_Target_250): Windows-based servers close an existing **Open** in the object store as described in \[MS-FSA\] section 2.1.5.5, Server Requests Closing an Open. The returned status is copied into the **SMB_Header.Status** field of the response. Any Oplocks held by the **Open** are cleaned up as described in Phase 8 -- Oplock Cleanup in \[MS-FSA\] section 2.1.5.5. + +[<251> Section 3.3.5.7](#Appendix_A_Target_251): Windows-based servers release a byte-range lock from the underlying object store as described in \[MS-FSA\] section 2.1.5.9, with the following mapping of input elements for each element **X** in the **Server.Open.Locks** array: + +- **Open** is the **Open** indicated by the **FID**. +- **FileOffset** is the **Server.Open.Locks\[X\].ByteOffset** if the entry is formatted as a **LOCKING_ANDX_RANGE32** structure, or **Server.Open.Locks\[X\].ByteOffsetHigh** and **Unlocks\[X\].ByteOffsetLow** if the entry is formatted as a **LOCKING_ANDX_RANGE64** structure. +- **LOCKING_ANDX_RANGE32** structure, or **Server.Open.Locks\[X\].LengthInBytesHigh** and **Server.Open.Locks\[X\].LengthInBytesLow** if the entry is formatted as a **LOCKING_ANDX_RANGE64** structure + +[<252> Section 3.3.5.8](#Appendix_A_Target_252): Windows-based servers flush a file by passing the **Open** to the algorithm described in \[MS-FSA\] section 2.1.5.7. The returned Status is copied into the **SMB_Header.Status** field of the response. + +[<253> Section 3.3.5.9](#Appendix_A_Target_253): Windows processes any required Oplock break notification to SMB prior to deletion via the interface described in \[MS-FSA\] section 2.1.5.18.3 and defers the delete operation until acknowledged via the interface in \[MS-FSA\] section 2.1.5.19. + +[<254> Section 3.3.5.9](#Appendix_A_Target_254): The \[XOPEN-SMB\] specification (section 7.12) indicates that the server deletes all files matching the search criteria that it can delete and returns Success if any is deleted, stating "If a wildcard pathname matches more than one file, and not all of the files could be unlinked, the request fails silently". Windows NT CIFS servers search for and delete files matching the search criteria in a sequential fashion. If an error occurs, processing stops, and the error is returned in the **Status** field of an error response message. No more matching files are deleted. + +[<255> Section 3.3.5.9](#Appendix_A_Target_255): When opening, overwriting, deleting, or renaming a file, Windows NT Server checks for sharing violations. If a sharing violation would be generated by the operation, the server delays for 200 ms and then tests again for a sharing violation. The server retries five times, for a total delay of approximately one second, before giving up and returning the sharing violation error. + +[<256> Section 3.3.5.9](#Appendix_A_Target_256): Windows-based servers implement wildcard file deletion as a three-step process. + +Step 1: Wildcard Matching + +Windows-based servers match wildcard patterns within directories as described in \[MS-FSA\] section 2.1.5.6. The following is a mapping of input elements: + +- **Open** is an Open resulting from opening the directory portion of the **SMB_Data.Bytes.FileName** field from the request. +- **FileNamePattern** is the final component of the **FileName** field. + +If the operation fails, the **Status** is returned in an Error Response and processing is complete. Otherwise, all files that match the **FileNamePattern** are candidates for deletion. The next step is performed for each file that matches the wildcard pattern. + +Step 2: SearchAttribute Filtering + +Windows-based servers match **SearchAttributes** as follows: + +If both SMB_FILE_ATTRIBUTE_HIDDEN and SMB_FILE_ATTRIBUTE_SYSTEM are specified in **SearchAttributes**, all files match. + +If either or both of the SMB_FILE_ATTRIBUTE_HIDDEN or SMB_FILE_ATTRIBUTE_SYSTEM are not set, the server queries the object store for the attributes of the file. + +- Windows-based servers obtain **FileAttributes** values by querying file information from the object store as described in \[MS-FSA\] section 2.1.5.12, with the following mapping of input elements: + - **Open** is the Open resulting from opening the file to be queried. + - **FileInformationClass** is **FileBasicInformation**. + +If the query fails, the file does not match and is not deleted. Otherwise: + +- - All bits except the SMB_FILE_ATTRIBUTE_HIDDEN and SMB_FILE_ATTRIBUTE_SYSTEM bits are cleared from the **FileAttributes** returned from the query operation. + +FileAttributes &= (FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN) + +- - If the Value of **FileAttributes**, cast to a USHORT, does not exactly match **SearchAttributes**, the file does not match and is not deleted. Otherwise, the **Open** is closed and the matching **FileName** is passed to the next step. + +Step 3: File Deletion + +If there are no matching **FileNames** to be deleted, the server returns an Error Response with **Status** set to STATUS_NO_SUCH_FILE (ERRDOS/ERRbadfile) and processing is complete. Otherwise: + +Windows-based servers delete files and directories within the object store by opening them as described in \[MS-FSA\] section 2.1.5.1 with **DesiredAccess** set to DELETE. The following is a mapping of input elements: + +- **RootOpen** is provided by using the **SMB_Header.TID** to find the matching **TreeConnect** in the **Server.Connection.TreeConnectTable**, which in turn provides the **Server.TreeConnect.Share. Server.TreeConnect.Share** points to an entry in the **Server.Share** table. The **Server.Share.LocalPath** is the path to the root of the share. An **Open** directory handle representing **Server.Share.LocalPath** is passed as **RootOpen**. +- **PathName** is the **FileName** generated as a result of the wildcard matching step. +- **SecurityContext** is found by using the **SMB_Header.UID** to look up the matching **Session** entry in the **Server.Connection.SessionTable**. The **Server.Session.UserSecurityContext** is passed as **SecurityContext**. +- **DesiredAccess** is set to **DELETE** (0x00010000). +- **ShareAccess** is set to 0x00000000. +- **CreateOptions** is set to **FILE_NON_DIRECTORY_FILE**. +- **CreateDisposition** is set to **FILE_OPEN**. +- **DesiredFileAttributes** is set to 0x00000000. +- **IsCaseSensitive** is set to FALSE if the **SMB_FLAGS_CASE_INSENSITIVE** bit is set in the **SMB_Header.Flags** field of the request. Otherwise, **IsCaseSensitive** is set depending upon system defaults. For more information, see the description of the **OBJ_CASE_INSENSITIVE** flag of the **OBJECT_ATTRIBUTES** structure \[MSDOCS-OBJ_ATTRIBS\]. +- **OpLockKey** is empty. + +The file is opened as described in \[MS-FSA\] section 2.1.5.1, and the returned **Status** is copied into the **SMB_Header.Status** field of the response. If the operation fails, the **Status** is returned in an Error Response, and processing is complete. + +If the operation is successful, the file is marked to be deleted when closed as described in \[MS-FSA\] section 2.1.5.14, passing the following mapping of input elements: + +- **Open** is the **Open** returned in the previous operation. +- **FileInformationClass** is **FileDispositionInformation**. See \[MS-FSA\] section 2.1.5.15.3. +- **InputBuffer** is the FILE_DISPOSITION_INFORMATION data element specified in \[MS-FSCC\]. **InputBuffer.DeletePending** is set to TRUE. +- **InputBufferLength** is the size of the FILE_DISPOSITION_INFORMATION data element. + +If the Set File Information operation fails, the **Status** is returned in an Error Response, and processing is complete. If the operation is successful, the **Open** is immediately closed, which results in the deletion of the file. All other results are ignored. + +[<257> Section 3.3.5.10](#Appendix_A_Target_257): Windows-based servers implement wildcard file rename as a three-step process. + +Step 1: Old Filename Wildcard Matching + +Windows-based servers match wildcard patterns within directories as described in \[MS-FSA\] section 2.1.5.6. The following is a mapping of input elements: + +- **Open** is an **Open** resulting from opening the directory portion of the **SMB_Data.Bytes.OldFileName** field from the request. +- **FileNamePattern** is the final component of the **OldFileName** field. + +If the operation fails, the **Status** is returned in an Error Response, and processing is complete. Otherwise, all files that match the **FileNamePattern** are candidates for deletion. The next step is performed for each file that matches the wildcard pattern. + +Step 2: SearchAttribute Filtering + +Windows-based servers match **SearchAttributes** as follows: + +If both SMB_FILE_ATTRIBUTE_HIDDEN and SMB_FILE_ATTRIBUTE_SYSTEM are specified in **SearchAttributes**, then all files match. + +If either or both of the SMB_FILE_ATTRIBUTE_HIDDEN or SMB_FILE_ATTRIBUTE_SYSTEM are not set, the server queries the object store for the attributes of the file. + +- Windows-based servers obtain **FileAttributes** values by querying file information from the object store as described in \[MS-FSA\] section 2.1.5.12, with the following mapping of input elements: + - **Open** is the **Open** resulting from opening the **FileName** to be queried. + - **FileInformationClass** is **FileBasicInformation**. + +If the open or the query fails, the file does not match and is not renamed. Otherwise: + +- - All bits except the SMB_FILE_ATTRIBUTE_HIDDEN and SMB_FILE_ATTRIBUTE_SYSTEM bits are cleared from the FileAttributes returned from the query operation. + +FileAttributes &= (FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN) + +- - If the value of **FileAttributes** cast to a USHORT does not exactly match **SearchAttributes**, the file does not match and is not renamed. Otherwise, the **Open** is passed to the next step. + +Step 3: Rename + +Windows-based servers rename files as described in \[MS-FSA\] section 2.1.5.15. The following is a mapping of input elements: + +- **Open** is an **Open** resulting from opening the **OldFileName**, as provided by the preceding steps. +- **FileInformationClass** is **FileRenameInformation**. +- **ReplaceIfExists** is FALSE. +- **RootOpen** is provided by using the **SMB_Header.TID** to find the matching **TreeConnect** in the **Server.Connection.TreeConnectTable**, which in turn provides the **Server.TreeConnect.Share**. **Server.TreeConnect.Share** points to an entry in the **Server.Share** table. The **Server.Share.LocalPath** is the path to the root of the share. An **Open** directory handle representing **Server.Share.LocalPath** is passed as **RootOpen**. +- **FileName** is generated from the **OldFileName** and the wildcard pattern in **NewFileName**. A description of the wildcard mapping that produces **FileName** is given in \[XOPEN-SMB\] section 3.6. +- **FileNameLength** is the length, in bytes, of the new **FileName**. The length includes the trailing null byte(s), if present. + +The returned **Status** is copied into the **SMB_Header.Status** field of the response. The **Open** is closed. All other results are ignored. + +[<258> Section 3.3.5.10](#Appendix_A_Target_258): When opening, overwriting, deleting, or renaming a file, Windows NT Server checks for sharing violations. If a sharing violation would be generated by the operation, the server delays for 200 ms and then tests again for a sharing violation. The server retries five times, for a total delay of approximately one second, before giving up and returning the sharing violation error. + +[<259> Section 3.3.5.10](#Appendix_A_Target_259): Windows processes any required OpLock break notification to SMB prior to deletion via the interface described in \[MS-FSA\] section 2.1.5.18.3 and pends the delete operation until acknowledged via the interface described \[MS-FSA\] section 2.1.5.19. + +[<260> Section 3.3.5.11](#Appendix_A_Target_260): Windows-based servers obtain file information from the object store as described in \[MS-FSA\] section 2.1.5.12, with the following mapping of input elements: + +- **Open** is created by opening the file indicated by **FileName** in the request. If the open operation fails, the **Status** is returned in an Error Response and processing is complete. While opening the file, the underlying object store checks for the necessity of an [**OpLock break**](#gt_5c86b468-90a1-4542-8bde-460c098d2a5a), as described in \[MS-FSA\] section 2.1.4.12, and if necessary, notifies the server as specified in section 3.3.4.2 and defers the opening of the file until the server acknowledges the Oplock break, as specified in section 3.3.5.30. +- **FileInformationClass** is **FileNetworkOpenInformation**. + +[<261> Section 3.3.5.12](#Appendix_A_Target_261): In order to set file attributes and the time of the last write to the file, Windows NT CIFS servers open the file in the object store as described in \[MS-FSA\] section 2.1.5.1. While opening the file, the underlying object store checks for the necessity of an OpLock break, as described in \[MS-FSA\] section 2.1.4.12, and if necessary, notifies the server via section 3.3.4.2 and defers the opening of the file until the server acknowledges the Oplock break, as specified in section 3.3.5.30. + +Windows-based servers set the **LastWriteTime** of the file if the **SMB_Parameters.Words.LastWriteTime** field in the request is not zero or -1 (0xFFFFFFFF). Windows-based servers set this value as described in \[MS-FSA\] section 2.1.5.15.2, with the following mapping of input elements: + +- **Open** is created by opening the file indicated by **FileName** field in the request. If the open operation fails, the **Status** is returned in an Error Response, and processing is complete. +- **FileInformationClass** is **FileBasicInformation**. +- **InputBuffer.CreationTime**, **InputBuffer.LastAccessTime**, **InputBuffer.ChangeTime**, and **InputBuffer.FileAttributes** are all set to zero. +- **InputBuffer.LastWriteTime** is set to the time value in the **SMB_Parameters.Words.LastWriteTime** field. + +The returned **Status** is copied into the **SMB_Header.Status** field of the response. The **Open** is closed. All other results are ignored. + +[<262> Section 3.3.5.13](#Appendix_A_Target_262): Windows-based servers request a read of the file from the object store as described in \[MS-FSA\] section 2.1.5.3, with the following mapping of input elements: + +- **Open** is the Open indicated by the **SMB_Parameters.Words.FID** field of the request. +- **ByteOffset** is the **SMB_Parameters.Words.ReadOffsetInBytes** field of the request. +- **ByteCount** is the **SMB_Parameters.Words.CountOfBytesToRead** field of the request. +- **IsNonCached** is not used. +- **Key** is set to ((**Open.FID** << 16) | **Open.PID.PIDLow**). + +The returned **Status** is copied into the **SMB_Header.Status** field of the response. If the operation is successful, the following additional mapping of output elements applies: + +- **OutputBuffer** is copied into the **SMB_Data.Bytes.Bytes** field of the response. +- **BytesRead** is copied into both the **SMB_Parameters.Words.CountOfBytesReturned** and **SMB_Data.Bytes.CountOfBytesRead** fields of the response. + +[<263> Section 3.3.5.14](#Appendix_A_Target_263): Windows-based servers request a write to a file in the object store as described in \[MS-FSA\] section 2.1.5.4, with the following mapping of input elements: + +- **Open** is the **Open** indicated by the **SMB_Parameters.Words.FID** field of the request. +- **ByteOffset** is the **SMB_Parameters.Words.WriteOffsetInBytes** field of the request. +- **ByteCount** is the **SMB_Parameters.Words.CountOfBytesToWrite** field of the request. +- **IsWriteThrough** is set to TRUE if **Open.IsWriteThrough** is TRUE. +- **IsNonCached** is not used. +- **InputBuffer** is copied from the **SMB_Data.Bytes.Bytes** field of the request. +- **Key** is set to ((**Open.FID** << 16) | **Open.PID.PIDLow**). + +The returned **Status** is copied into the **SMB_Header.Status** field of the response. If the write fails, the **Status** is returned in an Error Response, and processing is complete. If the operation is successful, the following additional mapping of output elements applies: + +- **BytesWritten** is copied into the **SMB_Parameters.Words.CountOfBytesWritten** field of the response. + +[<264> Section 3.3.5.15](#Appendix_A_Target_264): Windows-based servers request a byte-range lock from the underlying object store as described in \[MS-FSA\] section 2.1.5.8, with the following mapping of input elements: + +- **Open** is the **Open** indicated by the **SMB_Parameters.Words.FID** field of the request. +- **FileOffset** is the **SMB_Parameters.Words.LockOffsetInBytes** field of the request. +- **Length** is the **SMB_Parameters.Words.CountOfBytesToLock** field of the request. +- **ExclusiveLock** - TRUE +- **FailImmediately** - FALSE, if **Server.Open.LastFailedLockOffset** is equal to **LockOffsetInBytes** field of the request. Otherwise - TRUE +- **LockKey** is set to ((**Open.FID** << 16) | **Open.PID.PIDLow**). + +[<265> Section 3.3.5.15](#Appendix_A_Target_265): The default timeout for lock violations on Windows NT CIFS servers is 250 milliseconds. + +[<266> Section 3.3.5.16](#Appendix_A_Target_266): Windows-based servers release a byte-range lock from the underlying object store as described in \[MS-FSA\] section 2.1.5.9, with the following mapping of input elements: + +- **Open** is the **Open** indicated by the **SMB_Parameters.Words.FID** field of the request. +- **FileOffset** is the **SMB_Parameters.Words.UnlockOffsetInBytes** field of the request +- **Length** is the **SMB_Parameters.Words.CountOfBytesToUnlock** field of the request. +- **LockKey** is set to ((**Open.FID** << 16) | **Open.PID.PIDLow**). + +The returned Status is copied into the **SMB_Header.Status** field of the response. + +[<267> Section 3.3.5.17](#Appendix_A_Target_267): Windows-based servers create temporary files in the object store as described in \[MS-FSA\] section 2.1.5.1, with the following mapping of input elements: + +- **RootOpen** is provided by using the **SMB_Header.TID** to find the matching **TreeConnect** in the **Server.Connection.TreeConnectTable**, which in turn provides the **Server.TreeConnect.Share**. **Server.TreeConnect.Share** points to an entry in the **Server.Share** table. The **Server.Share.LocalPath** is the path to the root of the share. An Open directory handle representing **Server.Share.LocalPath** is passed as **RootOpen**. +- **PathName** is created by combining the **SMB_Data.Bytes.DirectoryName** field from the request with a pseudo-randomly generated file name. Windows-based servers generate file names in the form SRVxxxxx, where xxxxx is a hexadecimal integer. +- **SecurityContext** is found by using the **SMB_Header.UID** to look up the matching **Session** entry in the **Server.Connection.SessionTable**. The **Server.Session.UserSecurityContext** is passed as **SecurityContext**. +- DesiredAccess is set to (GENERIC_READ | GENERIC_WRITE). +- **ShareAccess** is set to FILE_SHARE_WRITE. If the file extension (after the '.' in the filename) is in the special filename suffix set ("EXE", "DLL", "SYM, "COM"), then **ShareAccess** is set to FILE_SHARE_WRITE | FILE_SHARE_READ). +- **DesiredFileAttributes** is set to FILE_ATTRIBUTE_NORMAL. +- **CreateDisposition** is set to FILE_CREATE. + - If the **SMB_Header.Flags2 SMB_FLAGS2_KNOWS_EAS** flag is not set, then the FILE_NO_EA_KNOWLEDGE bit is also set. +- **CreateOptions** is set to **FILE_NON_DIRECTORY_FILE**. + - If the WritethroughMode bit of the **SMB_Parameters.Words.AccessMode** field is set, then the FILE_WRITE_THROUGH bit is also set. +- **OpLockKey** is empty. + +The returned **Status** is copied into the **SMB_Header.Status** field of the response. If the operation fails, the **Status** is returned in an Error Response, and processing is complete. + +If the operation is successful, processing continues as follows: + +- If the **SMB_FLAGS_OPLOCK** flag is set in the **SMB_Header.Flags** of the request, then an OpLock is being requested. Windows-based servers obtain OpLocks as described in \[MS-FSA\] section 2.1.5.18, with the following mapping of input elements: + - **Open** is the **Open** passed through from the preceding operation. + - **Type** is LEVEL_BATCH if the **SMB_FLAGS_OPBATCH** flag is set in the **SMB_Header.Flags** of the request; otherwise, it is LEVEL_ONE. + +If an OpLock is granted, the **SMB_Header.Flags SMB_FLAGS_OPLOCK** and **SMB_FLAGS_OPBATCH** flags are copied from the request to the response. Otherwise, both flags are set to zero in the response. + +- Windows-based servers ignore the **SMB_Parameters.Words.CreationTime** in this request. +- A new **FID** is generated for the **Open** returned. All of the other results of the **Open** operation are ignored. The **FID** is copied into the **SMB_Parameters.Words.FID** field of the response. The pseudo-randomly generated file name is returned as a null-terminated OEM_STRING in the **SMB_Data.Bytes.TemporaryFileName** field. + +[<268> Section 3.3.5.18](#Appendix_A_Target_268): Windows-based servers process this command as an SMB_COM_CREATE request, as specified in section [3.3.5.6](#Section_782ed034df484e9da0696be5d906382e), with the exception that **CreateDisposition** is set to FILE_CREATE instead of FILE_OVERWRITE_IF. + +[<269> Section 3.3.5.19](#Appendix_A_Target_269): Windows-based servers obtain file information from the object store as described in \[MS-FSA\] section 2.1.5.12, with the following mapping of input elements: + +- **Open** is created by opening the **DirectoryName** in the request as a directory. If the open operation fails, the Status is returned in an Error Response and processing is complete. +- **FileInformationClass** is **FileNetworkOpenInformation**. + +The returned **Status** is copied into the **SMB_Header.Status** field of the response. **Success** indicates that the **DirectoryName** is the name of an existing directory. + +[<270> Section 3.3.5.20](#Appendix_A_Target_270): Windows-based servers close an existing **Open** in the object store as described in \[MS-FSA\] section 2.1.5.5, Server Requests Closing an Open. Any Oplocks held by the **Open** are cleaned up as described in Phase 8 -- Oplock Cleanup in \[MS-FSA\] section 2.1.5.5. + +[<271> Section 3.3.5.20](#Appendix_A_Target_271): Windows NT Server 4.0 does not use the header **CID** field as a lookup key. The list of pending requests is associated with the SMB transport, so the effect is the same. + +[<272> Section 3.3.5.21](#Appendix_A_Target_272): Windows-based servers query file information from the object store as described in \[MS-FSA\] section 2.1.5.12. Windows-based servers set information on files in the object store as described in \[MS-FSA\] section 2.1.5.15. File position can be set or retrieved with the following mapping of input elements: + +Open is the Open indicated by the **SMB_Parameters.Words.FID** field of the request. + +**FileInformationClass** is **FilePositionInformation**. + +If **SMB_Parameters.Words.Mode** is 0x0000, the new current position is set; next, **InputBuffer.CurrentByteOffset** (see \[MS-FSA\] section 2.1.5.15.10) is set to **SMB_Parameters.Words.Offset**. + +If **SMB_Parameters.Words.Mode** is 0x0001, the **CurrentByteOffset** is read by sending a query (see \[MS-FSA\] section 2.1.5.12.23). The **OutputBuffer.CurrentByteOffset** is then added to **SMB_Parameters.Words.Offset**, and the result is stored in **InputBuffer.CurrentByteOffset**. + +If **SMB_Parameters.Words.Mode** is 0x0001, the file size is read by setting **FileInformationClass** to **FileStandardInformation**. **SMB_Parameters.Words.Offset** is then subtracted from **OutputBuffer.EndOfFile**. The result is stored in **InputBuffer.CurrentByteOffset**. **FileInformationClass** is reset to **FilePositionInformation**. + +The new file position is then set as described in \[MS-FSA\] section 2.1.5.15. The returned **Status** is copied into the **SMB_Header.Status** field of the response. If the operation fails, the **Status** is returned in an Error Response, and processing is complete. If the operation is successful, the **InputBuffer.CurrentByteOffset** is copied to the **SMB_Paramters.Words.Offset** field of the response. + +[<273> Section 3.3.5.22](#Appendix_A_Target_273): Windows-based servers process this command as if it were an [SMB_COM_LOCK_BYTE_RANGE (section 2.2.4.13)](#Section_21f7b95a56c6482d80d6881ec0e6db69) followed by an [SMB_COM_READ (section 2.2.4.11)](#Section_b88922ddb18e46e09f7408eaace9a95c). See the behavior notes in sections [3.3.5.15](#Section_e046e927ee0241b390766fe50ffb417a) and [3.3.5.13](#Section_b4de39e5fda0450589e32bb0f7c4503e). + +[<274> Section 3.3.5.23](#Appendix_A_Target_274): With one exception, Windows-based servers process this command as if it were an SMB_COM_WRITE followed by an SMB_COM_UNLOCK_BYTE_RANGE. See the behavior notes for sections [3.3.5.14](#Section_8cac8066d6624e4186dc904ae3382260) and [3.3.5.16](#Section_1c224ee171c94792958277e5950f1b3f). The exception is that the write and unlock requests are passed to the underlying file system in a single step. + +[<275> Section 3.3.5.24](#Appendix_A_Target_275): Windows-based servers request a [**raw read**](#gt_9900d904-169e-4292-8613-714e7c177641) of the file from the object store, as described in \[MS-FSA\] section 2.1.5.3, with the following mapping of input elements: + +- **Open** is the **Open** indicated by the **SMB_Parameters.Words.FID** field of the request. +- **ByteOffset** is the **SMB_Parameters.Words.ReadOffsetInBytes** field of the request. +- **ByteCount** is the **SMB_Parameters.Words.CountOfBytesToRead** field of the request. +- **IsNonCached** is not used. +- **Key** is set to ((**Open.FID** << 16) | **Open.PID.PIDLow**). + +Due to this command's not returning an [**SMB message**](#gt_1308cf27-6aba-4d86-b38d-7926ba662311) as a response, the **Status** field is not sent to the client in the event of an error. If **Status** indicates an error, the server simply sends a zero-length response to the client. If the operation is successful, the following additional mapping of output elements applies: + +- **OutputBuffer** is the raw data to be sent to the client over the SMB transport. +- **BytesRead** is not used + +[<276> Section 3.3.5.24](#Appendix_A_Target_276): Windows-based servers ignore the **Timeout** field. + +[<277> Section 3.3.5.25](#Appendix_A_Target_277): Windows-based servers request a multiplexed read of the file from the object store as described in \[MS-FSA\] section 2.1.5.3, with the following mapping of input elements: + +- **Open** is the **Open** indicated by the **SMB_Parameters.Words.FID** field of the request. +- **ByteOffset** is the **SMB_Parameters.Words. Offset** field of the request. +- **ByteCount** is the **SMB_Parameters.Words.MaxCountOfBytesToReturn** field of the request. +- **IsNonCached** is not used. +- **Key** is set to ((**Open.FID** << 16) | **Open.PID.PIDLow**). + +The returned **Status** is copied into the **SMB_Header.Status** field of the response. If the operation is successful, the following additional mapping of output elements applies: + +- **OutputBuffer** is divided among the **SMB_Data.Bytes.Data** fields of however many responses that the server needs to send to the client to complete the operation. +- **BytesRead:** The sum of all the **SMB_Parameters.Words.DataLength** fields across however many responses that the server needs to send add up to this value. + +[<278> Section 3.3.5.25](#Appendix_A_Target_278): Windows NT and Windows 98 clients and Windows NT Server support this command on connectionless transports only. In particular, clients can send this command only over the Direct IPX Transport. Windows NT Server does not support the use of SMB_COM_READ_MPX to read from named pipes or I/O devices. Server support for this command is indicated by the CAP_MPX_MODE Capability bit in the SMB_COM_NEGOTIATE response. + +[<279> Section 3.3.5.25](#Appendix_A_Target_279): Windows-based servers ignore the **Timeout** field. + +[<280> Section 3.3.5.26](#Appendix_A_Target_280): Windows NT servers do not validate the **DataOffset** field value. + +[<281> Section 3.3.5.26](#Appendix_A_Target_281): If raw mode data buffers or other resources are not available, Windows NT Server fails the SMB_COM_WRITE_RAW request without writing the initial data. Likewise, if the FID represents a named pipe or device, the write operation might block, and if there are insufficient resources to buffer the data while waiting to write it, Windows NT fails the request without writing the initial data. + +[<282> Section 3.3.5.26](#Appendix_A_Target_282): Windows-based servers ignore the **Timeout** field. + +[<283> Section 3.3.5.26](#Appendix_A_Target_283): \[XOPEN-SMB\] specifies that if all of the data to be written is contained in the initial request, the server has to send an Interim Server Response and the client has to send a zero-length raw write. Older clients can exhibit that behavior. Windows NT Server, however, behaves as specified in section [3.3.5.26](#Section_129a1c1f587f41c0b67ceff0359389b6) of this document. If all of the data was transferred in the initial request, the NT server sends a Final Server Response indicating that the entire write operation has been completed. + +[<284> Section 3.3.5.28](#Appendix_A_Target_284): Windows-based servers obtain file information from the object store as described in \[MS-FSA\] section 2.1.5.12, with the following mapping of input elements: + +- **Open** is the **Open** indicated by the **SMB_Parameters.Words.FID** field of the request. +- **FileInformationClass** is **FileNetworkOpenInformation**. + +If the query fails, the **Status** is returned in an Error Response and processing is complete. Otherwise, the response message fields are populated as follows: + +- The **SMB_DATE** and **SMB_TIME** fields in the **SMB_Parameters.Words** block of the response are set by converting the FILETIME fields with matching names to SMB_DATE/SMB_TIME format. + - **CreateDate** and **CreationTime** are derived from **OutputBuffer.CreationTime**. + - **LastAccessDate** and **LastAccessTime** are derived from **OutputBuffer.LastAccessTime**. + - **LastWriteDate** and **LastWriteTime** are derived from **OutputBuffer.LastModificationTime**. + - **OutputBuffer.ChangeTime** is not returned to the client. +- **SMB_Parameters.Words.FileDataSize** is set to **OutputBuffer.EndOfFile**. +- **SMB_Parameters.Words. FileAllocationSize** is set to **OutputBuffer.AllocationSize**. +- **SMB_Parameters.Words.FileAttributes** is set by converting **OutputBuffer.FileAttributes** from the 32-bit SMB_EXT_FILE_ATTR format to the 16-bit SMB_FILE_ATTRIBUTE format (see sections [**2.2.1.2.4**](#Section_2198f480e0474df0ba64f28eadef00b9) and **2.2.1.2.3**). + +- FileAttributes &= ( SMB_FILE_ATTRIBUTE_READONLY | +- SMB_FILE_ATTRIBUTE_HIDDEN | +- SMB_FILE_ATTRIBUTE_SYSTEM | +- SMB_FILE_ATTRIBUTE_ARCHIVE | +- SMB_FILE_ATTRIBUTE_DIRECTORY ) + +[<285> Section 3.3.5.29](#Appendix_A_Target_285): Windows-based servers set file information from the object store as described in \[MS-FSA\] section 2.1.5.15, with the following mapping of input elements: + +- **Open** is the **Open** indicated by the **SMB_Parameters.Words.FID** field of the request. +- **FileInformationClass** is set to **FileBasicInformation**. +- The **SMB_DATE** and **SMB_TIME** fields in the **SMB_Parameters.Words** block of the request are converted to **FILETIME** fields with matching names to SMB_DATE/SMB_TIME format: + - **CreateDate** and **CreationTime** are converted and copied to **InputBuffer.CreationTime**. + - **LastAccessDate** and **LastAccessTime** are converted and copied to **InputBuffer.LastAccessTime**. + - **LastWriteDate** and **LastWriteTime** are converted and copied to **OutputBuffer.LastModificationTime**. + - **InputBuffer.ChangeTime** is set to zero (0). + +The **Status** returned is copied into the **SMB_Header.Status** field of the response. + +[<286> Section 3.3.5.30](#Appendix_A_Target_286): If an SMB_COM_LOCKING_ANDX Request has a nonzero **NumberOfRequestedUnlocks** field, Windows-based servers release a byte-range lock from the underlying object store as described in \[MS-FSA\] section 2.1.5.9, with the following mapping of input elements for each element "X" in the **SMB_Data.Bytes.Unlocks** array: + +- **Open** is the **Open** indicated by the **SMB_Parameters.Words.FID** field of the request. +- **FileOffset** is the **Unlocks\[X\].ByteOffset** field of the request for LOCKING_RANGE_ANDX32, or **Unlocks\[X\].ByteOffsetHigh** and **Unlocks\[X\].ByteOffsetLow** for LOCKING_ANDX_RANGE64. +- **Length** is the **Unlocks\[X\].LengthInBytes** field of the request for LOCKING_RANGE_ANDX32, or **Unlocks\[X\].LengthInBytesHigh** and **Unlocks\[X\].LengthInBytesLow** for LOCKING_ANDX_RANGE64. + +Either the first returned **Status** indicating an error or the final returned success **Status** is copied into the **SMB_Header.Status** field of the response. + +[<287> Section 3.3.5.30](#Appendix_A_Target_287): If an SMB_COM_LOCKING_ANDX Request has a nonzero **NumberOfRequestedLocks** field, Windows-based servers request a byte-range lock from the underlying object store as described in \[MS-FSA\] section 2.1.5.8, with the following mapping of input elements for each element "X" in the **SMB_Data.Bytes.Locks** array: + +- **Open** is the **Open** indicated by the **SMB_Parameters.Words.FID** field of the request. +- **FileOffset** is the **Locks\[X\].ByteOffset** field of the request for LOCKING_RANGE_ANDX32, or **Locks\[X\].ByteOffsetHigh** and **Locks\[X\].ByteOffsetLow** for LOCKING_ANDX_RANGE64. +- **Length** is the **Locks\[X\].LengthInBytes** field of the request for LOCKING_RANGE_ANDX32, or **Locks\[X\]. LengthInBytes High** and **Locks\[X\].LengthInBytes Low** for LOCKING_ANDX_RANGE64. +- **ExclusiveLock** is TRUE if **SMB_Parameters.Words.TypeOfLock** indicates READ_WRITE_LOCK, or FALSE if it indicates SHARED_LOCK. +- **FailImmediately** is TRUE if **SMB_Parameters.Words.Timeout** is zero, or FALSE if **Timeout** is nonzero. +- **LockKey** is set to ((**Open.FID** << 16) | **Open.PID.PIDLow**). + +[<288> Section 3.3.5.30](#Appendix_A_Target_288): Windows-based servers process the Oplock break acknowledgment by invoking \[MS-FSA\] section 2.1.5.19 with the following mapping of input elements: **Open** is the **Open** indicated by the **SMB_Parameters.Words.FID** field of the request. Type is the resultant Oplock level from **Server.Open.Oplock**. + +[<289> Section 3.3.5.30](#Appendix_A_Target_289): Windows NT Server do not test whether **NumberOfRequestedUnlocks** is nonzero in an OpLock Break Request message. + +[<290> Section 3.3.5.30](#Appendix_A_Target_290): Windows-based servers acknowledge an OpLock break as described in \[MS-FSA\] section 2.1.5.19, with the following mapping of input elements: + +- **Open** is the **Open** indicated by the **SMB_Parameters.Words.FID** field of the request. +- **Type** is LEVEL_TWO. + +[<291> Section 3.3.5.30](#Appendix_A_Target_291): After failing the lock byte range request with STATUS_LOCK_NOT_GRANTED, if a client attempts to lock the same range of locked bytes, subranges, or overlapping ranges, Windows-based servers fail the lock request with STATUS_FILE_LOCK_CONFLICT (ERRDOS/ERRlock). + +[<292> Section 3.3.5.32](#Appendix_A_Target_292): Windows NT servers support a specific set of IOCTL requests (see the notes in section [2.2.4.35](#Section_0d8f5f1716af499da192a5fd85fbb7e1)). The IOCTL requests were originally defined by the OS/2 operating system. + +The following table provides a mapping of OS/2 IOCTL request to Windows NT server actions. See [\[MSDN-SDCTRLREQSTS\]](https://go.microsoft.com/fwlink/?LinkId=182724) for more information on Serial Device Control Requests. + +| Category | OS/2 IOCTL function | Action | +| -------------------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| SERIAL_DEVICE0x0001 | GET_BAUD_RATE0x0061 | NtDeviceIoControlFile() is called with IoControlCode set to IOCTL_SERIAL_GET_BAUD_RATE. | +| SERIAL_DEVICE0x0001 | SET_BAUD_RATE0x0041 | NtDeviceIoControlFile() is called with IoControlCode set to IOCTL_SERIAL_SET_BAUD_RATE. | +| SERIAL_DEVICE0x0001 | GET_LINE_CONTROL0x0062 | NtDeviceIoControlFile() is called with IoControlCode set to IOCTL_SERIAL_GET_LINE_CONTROL. | +| SERIAL_DEVICE0x0001 | SET_LINE_CONTROL0x0042 | NtDeviceIoControlFile() is called with IoControlCode set to IOCTL_SERIAL_SET_LINE_CONTROL. | +| SERIAL_DEVICE0x0001 | GET_DCB_INFORMATION0x0073 | NtDeviceIoControlFile() is called with IoControlCode set to IOCTL_SERIAL_GET_TIMEOUTS. | +| SERIAL_DEVICE0x0001 | SET_DCB_INFORMATION0x0053 | Windows NT Server returns STATUS_SUCCESS without processing the IOCTL. The IOCTL response returns no **Parameters** or **Data**. | +| SERIAL_DEVICE0x0001 | GET_COMM_ERROR0x006D | Windows NT Server returns STATUS_SUCCESS without processing the IOCTL. The IOCTL response returns no **Parameters** or **Data**. | +| SERIAL_DEVICE0x0001 | SET_TRANSMIT_TIMEOUT0x0044 | Windows NT Server returns an error response with **Status** of STATUS_NOT_IMPLEMENTED. | +| SERIAL_DEVICE0x0001 | SET_BREAK_OFF0x0045 | Windows NT Server returns an error response with **Status** of STATUS_NOT_IMPLEMENTED. | +| SERIAL_DEVICE0x0001 | SET_MODEM_CONTROL0x0046 | Windows NT Server returns an error response with **Status** of STATUS_NOT_IMPLEMENTED. | +| SERIAL_DEVICE0x0001 | SET_BREAK_ON0x004B | Windows NT Server returns an error response with **Status** of STATUS_NOT_IMPLEMENTED. | +| SERIAL_DEVICE0x0001 | STOP_TRANSMIT0x0047 | Windows NT Server returns an error response with **Status** of STATUS_NOT_IMPLEMENTED. | +| SERIAL_DEVICE0x0001 | START_TRANSMIT0x0048 | Windows NT Server returns an error response with **Status** of STATUS_NOT_IMPLEMENTED. | +| SERIAL_DEVICE0x0001 | GET_COMM_STATUS0x0064 | Windows NT Server returns an error response with **Status** of STATUS_NOT_IMPLEMENTED. | +| SERIAL_DEVICE0x0001 | GET_LINE_STATUS0x0065 | Windows NT Server returns an error response with **Status** of STATUS_NOT_IMPLEMENTED. | +| SERIAL_DEVICE0x0001 | GET_MODEM_OUTPUT0x0066 | Windows NT Server returns an error response with **Status** of STATUS_NOT_IMPLEMENTED. | +| SERIAL_DEVICE0x0001 | GET_MODEM_INPUT0x0067 | Windows NT Server returns an error response with **Status** of STATUS_NOT_IMPLEMENTED. | +| SERIAL_DEVICE0x0001 | GET_INQUEUE_COUNT0x0068 | Windows NT Server returns an error response with **Status** of STATUS_NOT_IMPLEMENTED. | +| SERIAL_DEVICE0x0001 | GET_OUTQUEUE_COUNT0x0069 | Windows NT Server returns an error response with **Status** of STATUS_NOT_IMPLEMENTED. | +| SERIAL_DEVICE0x0001 | GET_COMM_EVENT0x0072 | Windows NT Server returns an error response with **Status** of STATUS_NOT_IMPLEMENTED. | +| SERIAL_DEVICE0x0001 | Any other value. | Windows NT Server returns an error response with **Status** of STATUS_INVALID_PARAMETER. | +| PRINTER_DEVICE0x0005 | GET_PRINTER_STATUS0x0066 | Windows NT Server returns STATUS_SUCCESS without processing the IOCTL. The IOCTL response returns only one **Data** byte, which contains an OS/2 printer status code of 0x90 (OS2_STATUS_PRINTER_HAPPY). | +| SPOOLER_DEVICE0x0053 | GET_PRINTER_ID0x0060 | Windows NT Server stores the **JobID** as an attribute of the printer file **Open**. The share name is an attribute of the **TreeConnect** (**Server.TreeConnect.Share->Share.ShareName**) and server name is the configured name of the server. These values are returned in the response. | +| GENERAL_DEVICE0x000B | | Windows NT Server returns an error response with **Status** of STATUS_NOT_IMPLEMENTED. | + +[<293> Section 3.3.5.33](#Appendix_A_Target_293): Windows 98 accepts only an SMB_COM_ECHO request containing a valid **TID** or a **TID** value of 0xFFFF (-1). Windows NT systems ignore the **TID** in the SMB_COM_ECHO request. + +[<294> Section 3.3.5.34](#Appendix_A_Target_294): Windows-based servers process this command as if it were an [SMB_COM_WRITE (section 2.2.4.12)](#Section_5f3ebf6a5d0643ee9429c8cc1b58eef5) followed by an SMB_COM_CLOSE (section 2.2.4.5). See the product behavior notes for sections 3.3.5.14 and [3.3.5.7](#Section_99b767e28f0e438bace54323940f2dc8). + +[<295> Section 3.3.5.35](#Appendix_A_Target_295): Windows NT Server always ignores the **FileAttrs** field and the **SearchAttrs** field on Open and Create operations, and searches for files by name only. + +[<296> Section 3.3.5.35](#Appendix_A_Target_296): Windows-based servers permit the file creation, if the FileExistsOpts flag value is 0 and the **AccessMode.SharingMode** field value is 1, 2, 3, or 4. + +[<297> Section 3.3.5.35](#Appendix_A_Target_297): Windows-based servers open files in the object store as described in \[MS-FSA\] section 2.1.5.1, with the following mapping of input elements: + +- **RootOpen** is provided by using the **SMB_Header.TID** to find the matching **Server.TreeConnect** in the **Server.Connection.TreeConnectTable**. The server then acquires an **Open** on **Server.TreeConnect.Share.LocalPath**, which is passed as **RootOpen**. +- **PathName** is the **SMB_Data.Bytes.FileName** field from the request. +- **SecurityContext** is found by using the **SMB_Header.UID** to look up the matching **Session** entry in the **Server.Connection.SessionTable**. The **Server.Session.UserSecurityContext** is passed as **SecurityContext**. +- **UserCertificate** is empty. +- **DesiredAccess** is set as follows: + - The **AccessMode** subfield of the **AccessMode** field in the request is used to set the value of **DesiredAccess**. The **AccessMode** subfield represents the lowest-order four bits of the **AccessMode** field (0x0007), as shown in the table in section 2.2.4.3.1. The mapping of values is as follows. + +| AccessMode.AccessMode | DesiredAccess | +| --------------------- | ---------------------------------------------------------------- | +| 0 | GENERIC_READ (0x80000000) | +| 1 | GENERIC_WRITE \| FILE_READ_ATTRIBUTES (0x40000000 \| 0x00000080) | +| 2 | GENERIC_READ \| GENERIC_WRITE (0x80000000 \| 0x40000000) | +| 3 | GENERIC_READ \| GENERIC_EXECUTE (0x80000000 \| 0x20000000) | + +For any other value of **AccessMode.AccessMode**, this algorithm returns STATUS_OS2_INVALID_ACCESS (ERRDOS/ERRbadaccess). + +- **ShareAccess** is set as follows: + - The **SharingMode** subfield of the **AccessMode** field in the request is used to set the value of **ShareAccess**. The **SharingMode** subfield is a 4-bit subfield of the **AccessMode** field (0x0070), as shown in the table in section 2.2.4.3.1. The mapping of values is as follows. + +| AccessMode.SharingMode | ShareAccess | +| ---------------------- | ----------------------------------- | +| 0 | Compatibility mode (see below) | +| 1 | 0x0L (don't share, exclusive use) | +| 2 | FILE_SHARE_READ | +| 3 | FILE_SHARE_WRITE | +| 4 | FILE_SHARE_READ \| FILE_SHARE_WRITE | + +- - - For Compatibility mode, special filename suffixes (after the '.' in the filename) are mapped to **SharingMode** 4. The special filename suffix set is: "EXE", "DLL", "SYM", and "COM". All other file names are mapped to **SharingMode** 3. + - If **AccessMode** field in the request is 0xFF, and the file is already open on the server, the current sharing mode of the existing Open is preserved, and a **FID** for the file is returned. If the file is not already open on the server, the server attempts to open the file using **SharingMode** 1. + - For any other value of **AccessMode.SharingMode**, this algorithm returns STATUS_OS2_INVALID_ACCESS (ERRDOS/ERRbadaccess). + - **CreateOptions** bits are set as follows. + +| CreateOptions value | SMB_COM_OPEN_ANDX equivalent | +| ------------------------------ | ---------------------------------------------------------------------- | +| FILE_WRITE_THROUGH | AccessMode.WritethroughMode == 1 | +| FILE_SEQUENTIAL_ONLY | AccessMode.ReferenceLocality == 1 | +| FILE_RANDOM_ACCESS | AccessMode.ReferenceLocality == 2 or AccessMode.ReferenceLocality == 3 | +| FILE_NO_INTERMEDIATE_BUFFERING | AccessMode.CacheMode == 1 | +| FILE_NON_DIRECTORY_FILE | Is set | +| FILE_COMPLETE_IF_OPLOCKED | Is set | +| FILE_NO_EA_KNOWLEDGE | SMB_Header.Flags2.SMB_FLAGS2_KNOWS_EAS == 0 | + +- - - All other bits are unused. + - **CreateDisposition** is set as follows. + +| CreateDisposition value | SMB_Parameters.Word.OpenMode equivalent | +| --------------------------------------------------------------------------- | --------------------------------------- | +| Invalid combination; return STATUS_OS2_INVALID_ACCESS (ERRDOS/ERRbadaccess) | FileExistsOpts = 0 & CreateFile = 0 | +| FILE_CREATE | FileExistsOpts = 0 & CreateFile = 1 | +| FILE_OPEN | FileExistsOpts = 1 & CreateFile = 0 | +| FILE_OPEN_IF | FileExistsOpts = 1 & CreateFile = 1 | +| FILE_OVERWRITE | FileExistsOpts = 2 & CreateFile = 0 | +| FILE_OVERWRITE_IF | FileExistsOpts = 2 & CreateFile = 1 | + +While opening an existing file, the underlying object store checks for the necessity of an OpLock break, as described in \[MS-FSA\] section 2.1.4.12, and if necessary, notifies the server as specified in section 3.3.4.2 and defers the opening of the file until the server acknowledges the OpLock break, as specified in section 3.3.5.30. + +[<298> Section 3.3.5.35](#Appendix_A_Target_298): When opening, overwriting, deleting, or renaming a file, Windows NT Server checks for sharing violations. If a sharing violation would be generated by the operation, the server delays for 200 ms and then tests again for a sharing violation. The server retries five times, for a total delay of approximately one second, before giving up and returning the sharing violation error. + +[<299> Section 3.3.5.36](#Appendix_A_Target_299): Windows-based servers request a read of the file from the object store as described in \[MS-FSA\] section 2.1.5.3, with the following mapping of input elements: + +- **Open** is the **Open** indicated by the **SMB_Parameters.Words.FID**. field of the request. +- **ByteOffset** is either the 32- or 64-bit offset, as determined by the server. +- **ByteCount** is the **SMB_Parameters.Words.MaxCountOfBytesToReturn** field of the request. +- **IsNonCached** is not used. +- **Key** is set to ((**Open.FID** << 16) | **Open.PID.PIDLow**). + +The returned **Status** is copied into the **SMB_Header.Status** field of the response. If the operation is successful, the following additional mapping of output elements applies: + +- **OutputBuffer** is copied into the **SMB_Data.Bytes.Data** field of the response. +- BytesRead is copied into the **SMB_Parameters.Words.DataLength** field of the response. + +[<300> Section 3.3.5.36](#Appendix_A_Target_300): Windows-based servers ignore the **Timeout** field. Reads from named pipes and I/O devices will always block until **MinCountOfBytesToReturn** are read. + +[<301> Section 3.3.5.37](#Appendix_A_Target_301): Windows NT servers do not validate the **DataOffset** field value. + +[<302> Section 3.3.5.37](#Appendix_A_Target_302): Windows NT based servers do not fail the request; instead, they write only **SMB_Parameters.Words.DataLength** bytes from the **SMB_Data.Bytes.Data** field to the target file. + +[<303> Section 3.3.5.37](#Appendix_A_Target_303): Windows-based servers ignore the **Timeout** field. Writes to named pipes or I/O devices always block until the number of **DataLength** bytes are written. + +[<304> Section 3.3.5.37](#Appendix_A_Target_304): If the **Remaining** field is nonzero, and if the MSG_START bit is set in the **SMB_Parameters.Words.WriteMode** field, Windows-based servers ignore the first two bytes of the **SMB_Data.Bytes.Data** field. + +[<305> Section 3.3.5.37](#Appendix_A_Target_305): Windows-based servers request a write to a file in the object store as described in \[MS-FSA\] section 2.1.5.4, with the following mapping of input elements: + +- **Open** is the **Open** indicated by the **SMB_Parameters.Words.FID** field of the request. +- **ByteOffset** is the **SMB_Parameters.Words.Offset** field of the request. +- **ByteCount** is the **SMB_Parameters.Words.DataLength** field of the request. +- **IsWriteThrough** is the **SMB_Parameters.Words.WriteMode.WritethroughMode** bit of the request. +- **IsNonCached** is not used. +- **InputBuffer** is copied from the **SMB_Data.Bytes.Data** field of the request. +- **Key** is set to ((**Open.FID** << 16) | **Open.PID.PIDLow**). + +The returned **Status** is copied into the **SMB_Header.Status** field of the response. If the write fails, the **Status** is returned in an Error Response and processing is complete. If the operation is successful, the following additional mapping of output elements applies: + +- **BytesWritten** is copied into the **SMB_Parameters.Words.Count** field of the response. + +[<306> Section 3.3.5.40](#Appendix_A_Target_306): Windows implementations check to see if the user indicated by the **Server.Session.UserSecurityContext** identified by the **SMB_Header.UID** is a member of the Administrator group. + +[<307> Section 3.3.5.45](#Appendix_A_Target_307): Windows implementations check to see if the user indicated by the **Server.Session.UserSecurityContext** identified by the **SMB_Header.UID** is a member of the Administrator group. + +[<308> Section 3.3.5.45](#Appendix_A_Target_308): Windows-based servers do not fail tree connects to non-administrative shares by users that are not granted access but will fail attempts by those clients to open or create files. Windows-based servers will fail tree-connect requests to administrative shares, such as C\$ or D\$, that are issued by a non-administrator. + +[<309> Section 3.3.5.46](#Appendix_A_Target_309): Windows-based servers obtain volume information from the object store as described in \[MS-FSA\] section 2.1.5.13, with the following mapping of input elements: + +- **Open** is provided by using the **SMB_Header.TID** to find the matching **Server.TreeConnect** in the **Server.Connection.TreeConnectTable**. The server then acquires an **Open** on **Server.TreeConnect.Share.LocalPath**, which is passed as **Open**. +- **FsInformationClass is set to FileFsSizeInformation.** + +The returned **Status** is copied into the **SMB_Header.Status** field of the response. If the operation fails, the **Status** is returned in an Error Response, and processing is complete. If the operation is successful, the information returned in **OutputBuffer** is adjusted to fit within the data structure provided by SMB. + +All of the fields in the [SMB_COM_QUERY_INFORMATION_DISK Response (section 2.2.4.57.2)](#Section_3d5291fd33f54899b3ad949b0d4d7f93) are 16-bit, but the **FileFsSizeInformation** InformationLevel provides 32- and 64-bit values. The goal is to adjust the values so that the total bytes on disk and the total number of available (free) bytes can be calculated reasonably correctly from the numbers returned. + +- The value of **Output.TotalAllocationUnits** is divided by two (bitshifted) until the result fits within a USHORT (16 bits, unsigned); that is, until the result is less than 0x00010000. The number of bit shifts is counted and stored as **HighBits** and also as **ExtraBits**. If the value of **HighBits** is greater than zero, the value of **Output.SectorsPerAllocationUnit** is multiplied by two, and **HighBits** is decremented. This is repeated until **HighBits** is zero or the result of the multiplication is greater than or equal to 0x8000. The result is copied into **SMB_Parameters.Words.BlocksPerUnit**. +- If the value of **HighBits** is still greater than zero, the value of **Output.BytesPerSector** is multiplied by two and **HighBits** is decremented. This is repeated until **HighBits** is zero or the result of the multiplication is greater than or equal to 0x8000. The result is copied into **SMB_Parameters.Words.BlockSize**. +- If the value of **HighBits** is still greater than zero, **SMB_Parameters.Words.TotalUnits** is set to the largest possible value: 0xFFFF. Otherwise, **SMB_Parameters.Words.TotalUnits** is calculated as (**Output.TotalAllocationUnits** / (2 × **ExtraBits**)). +- **SMB_Parameters.Words.FreeUnits** is calculated as (**Output.ActualAvailableAllocationUnits** / (2 × (**ExtraBits** -**HighBits**))). If the result of the calculation is greater than 0xFFFF, **SMB_Parameters.Words.FreeUnits** is set to 0xFFFF. + +The **SMB_Header.Status** field of the response is set to **Success**. + +[<310> Section 3.3.5.47](#Appendix_A_Target_310): Windows NT Server 4.0 returns STATUS_NO_MORE_FILES for an empty string in the **FileName** field of the [SMB_COM_SEARCH (section 2.2.4.58)](#Section_d33e84721356406d88edbd9fc10b060b) request. + +[<311> Section 3.3.5.47](#Appendix_A_Target_311): Windows NT Server uses both of these techniques. + +[<312> Section 3.3.5.47](#Appendix_A_Target_312): If the SMB_FILE_ATTRIBUTE_VOLUME bit is set--and is the only bit set--in the **SMB_Parameters.Words.SearchAttributes** field in the request, Windows-based servers return the volume name of the volume underlying the share indicated by **SMB_Header.TID**. Volume information is queried as described in \[MS-FSA\] section 2.1.5.13. The following is a mapping of input elements: + +- **Open** is an Open resulting from opening the directory portion of the **SMB_Data.Bytes.FileName** field from the request. +- **FileInformationClass** is set to **FileFsVolumeInformation**. + +The returned Status is copied into the **SMB_Header.Status** field of the response. If the operation fails, Status is returned in an Error Response, and processing is complete; otherwise, a single **DirectoryInformationData\[\]** field entry is returned in the **SMB_Data.Bytes** block of the response: + +- The **FileAttributes** field is set to SMB_FILE_ATTRIBUTE_VOLUME. +- The **LastWriteTime**, **LastWriteDate**, and **FileSize** fields are set to zero. +- The **OutputBuffer.VolumeLabel** is converted to the OEM character set and copied into the **FileName** field. At most, 11 bytes of the volume label are copied. If the volume label is greater than 8 bytes in length, a dot (".") is inserted between the 8th and 9th characters. Unused bytes are space-padded. +- The **SMB_Header.Status** field of the response is set to Success. + +If the **SMB_Parameters.Words.SearchAttributes** field in the request is not equal to SMB_FILE_ATTRIBUTE_VOLUME, Windows-based servers proceed with a normal directory lookup. + +Windows-based servers search directories for files with names that match wildcard patterns as described in \[MS-FSA\] sections 2.1.5.6 and 2.1.5.6.3. The following is a mapping of input elements: + +- **Open** is an **Open** resulting from opening the directory portion of the **SMB_Data.Bytes.FileName** field from the request. +- **FileInformationClass** is set to **FileBothDirectoryInformation**. +- **OutputBufferSize** is large enough to hold at least one **FILE_BOTH_DIR_INFORMATION** (\[MS-FSCC\] section 2.4.8) structure. +- **RestartScan** is FALSE. +- **ReturnSingleEntry** is FALSE. +- If the **SMB_Data.Bytes.ResumeKeyLength** field is zero, then this is a new search, and **FileIndex** is not used; otherwise, the **SMB_Data.Bytes.ResumeKey** field is used to set **FileIndex** so that the directory search continues sequentially. +- **FileNamePattern** is the final component of the **FileName** field. + +If the directory search operation fails: + +- If **Status** is returned as STATUS_NO_SUCH_FILE, **Status** is set to STATUS_NO_MORE_FILES to indicate that the search has completed. +- If **Status** is returned as STATUS_NO_MORE_FILES, **Status** is set to STATUS_OBJECT_PATH_NOT_FOUND because the **SMB_Data.Bytes.FileName** field in the request provided a complete path. +- The **Status** is copied to the **SMB_Header.Status** field and returned in an Error Response. Processing is complete. + +If the search operation succeeds, the **OutputBuffer.FileAttributes** of each entry in the list of files returned is compared against the **SMB_Parameters.Words.SearchAttributes** field in the request as follows: + +- The SMB_FILE_ATTRIBUTE_VOLUME bit is ignored. +- If **OutputBuffer.FileAttributes** has FILE_ATTRIBUTE_HIDDEN set, but SMB_FILE_ATTRIBUTE_HIDDEN is not set in the **SMB_Parameters.Words.SearchAttributes** field, the entry is rejected. +- If **OutputBuffer.FileAttributes** has FILE_ATTRIBUTE_SYSTEM set, but SMB_FILE_ATTRIBUTE_SYSTEM is not set in the **SMB_Parameters.Words.SearchAttributes** field, the entry is rejected. +- If **OutputBuffer.FileAttributes** has FILE_ATTRIBUTE_DIRECTORY set, but SMB_FILE_ATTRIBUTE_DIRECTORY is not set in the **SMB_Parameters.Words.SearchAttributes** field, the entry is rejected. +- If there is no short name (8.3 format name) for this file, the entry is rejected. +- If there are exclusive bits set in the **SMB_Parameters.Words.SearchAttributes** field, the following additional tests are performed: + - If SMB_SEARCH_ATTRIBUTE_READONLY is set in **SearchAttributes**, but FILE_ATTRIBUTE_READONLY is not set in **OutputBuffer.FileAttributes**, the entry is rejected. + - If SMB_SEARCH_ATTRIBUTE_HIDDEN is set in **SearchAttributes**, but FILE_ATTRIBUTE_HIDDEN is not set in **OutputBuffer.FileAttributes**, the entry is rejected. + - If SMB_SEARCH_ATTRIBUTE_SYSTEM is set in **SearchAttributes**, but FILE_ATTRIBUTE_SYSTEM is not set in **OutputBuffer.FileAttributes**, the entry is rejected. + - If SMB_SEARCH_ATTRIBUTE_ARCHIVE is set in **SearchAttributes**, but FILE_ATTRIBUTE_ARCHIVE is not set in **OutputBuffer.FileAttributes**, the entry is rejected. + - If SMB_SEARCH_ATTRIBUTE_DIRECTORY is set in **SearchAttributes**, but FILE_ATTRIBUTE_DIRECTORY is not set in **OutputBuffer.FileAttributes**, the entry is rejected. + +If the entry has not been rejected, the required **OutputBuffer** fields are converted into the field formats used by the **SMB_Directory_Information** structure, described in section [2.2.4.58.2](#Section_12a609ad870944929b954a402589cf56). A **DirectoryInformationData\[\]** field entry is added to the response message buffer, and the **SMB_Parameters.Words.Count** field is incremented to indicate the total number of **DirectoryInformationData\[\]** field entries in the response message. + +- If the **SMB_Parameters.Words.Count** field is equal to the maximum number of entries to return: + - The **SMB_Data.Bytes.BufferFormat** field is set to 0x05. + - The **SMB_Data.Bytes.DataLength** field is set to the total number of bytes copied into the **DirectoryInformationData\[\]** field array, which is 43 × **SMB_Parameters.Words.Count**. + - The **ResumeKey** field of the final **DirectoryInformationData\[\]** field entry to be placed into the response buffer is calculated and copied into the **ResumeKey** field of that entry. + - The **SMB_Header.Status** field is set to Success, and processing is complete. +- The maximum number of entries to return is the minimum of: + - The value of the **SMB_Parameters.Words.MaxCount** field in the request. + - The maximum number of **DirectoryInformationData\[\]** field entries that will fit in the **SMB_Data.Bytes** block of the response, based upon the **Server.Connection.ClientMaxBufferSize** ADM element. (The size of the response with no **DirectoryInformationData\[\]** entries is 40 bytes.) + +If the maximum number of entries to return has not been reached, additional entries returned in **OutputBuffer** are processed as described preceding. If there are no additional entries in **OutputBuffer**, another directory query is executed, with the value of **FileIndex** set to the **FileIndex** at the end of the previous query. If Status is returned as STATUS_NO_MORE_FILES, Status is set to Success, and processing is complete. In this way, directory entries are enumerated sequentially until there are either enough entries in the **DirectoryInformationData\[\]** field to complete the request, or there are no more entries to be added. + +[<313> Section 3.3.5.48](#Appendix_A_Target_313): Processing of this command is identical to the processing of the SMB_COM_FIND request with **SMB_Parameters.Words.MaxCount** set to 0x0001. + +[<314> Section 3.3.5.51](#Appendix_A_Target_314): This is dependent upon the underlying file system. On Windows NT Server, if the request to create a file is performed on a Windows FAT or FAT32 file system, the request fails with STATUS_ACCESS_DENIED. Otherwise it fails with STATUS_PRIVILEGE NOT HELD. + +[<315> Section 3.3.5.51](#Appendix_A_Target_315): Windows NT servers allow only the FILE_OPEN option on a named pipe. All other options are ignored and considered the same as FILE_OPEN. When the object in question is a disk object, all options are valid. + +[<316> Section 3.3.5.51](#Appendix_A_Target_316): Windows-based servers open files in the object store as described in \[MS-FSA\] section 2.1.5.1, with the following mapping of input elements: + +- **RootOpen** is provided in one of two ways: + - If the **SMB_Parameters.Words.RootDirectoryFID** field is zero, **RootOpen** is provided by using the **SMB_Header.TID** field to find the matching **Server.TreeConnect** in the **Server.Connection.TreeConnectTable**. The server then acquires an **Open** on the **Server.TreeConnect.Share.LocalPath**, which is passed as **RootOpen**. + - If the **SMB_Parameters.Words.RootDirectoryFID** field is non-zero, **RootOpen** is provided by looking up the **RootDirectoryFID** field in the **Server.Connection.FileOpenTable**. +- **PathName** is the **SMB_Data.Bytes.FileName** field of the request. +- **SecurityContext** is found by using the **SMB_Header.UID** field to look up the matching **Session** entry in the **Server.Connection.SessionTable**. The **Server.Session.UserSecurityContext** is passed as **SecurityContext**. +- **UserCertificate** is empty. +- **DesiredAccess** is the **SMB_Parameters.Words.DesiredAccess** field of the request. The FILE_READ_ATTRIBUTES option is added (using a bitwise OR) to the set provided by the client. If the FILE_NO_INTERMEDIATE_BUFFERING flag is set, it is cleared, and FILE_WRITE_THROUGH is set. +- **ShareAccess** is the **SMB_Parameters.Words.ShareAccess** field of the request. +- **CreateOptions** is the **SMB_Parameters.Words.CreateOptions** field of the request. The FILE_COMPLETE_IF_OPLOCKED option is added (using a bitwise OR) to the set provided by the client. If the FILE_NO_INTERMEDIATE_BUFFERING flag is set, it is cleared, and FILE_WRITE_THROUGH is set. +- **CreateDisposition** is the **SMB_Parameters.Words.CreateDisposition** field of the request. +- **DesiredFileAttributes** is the **SMB_Parameters.Words.ExtFileAttributes** field of the request. +- **IsCaseSensitive** is set to **FALSE** if the SMB_FLAGS_CASE_INSENSITIVE bit is set in the **SMB_Header.Flags** field of the request. Otherwise, **IsCaseSensitive** is set depending upon system defaults. For more information, see the description of the OBJ_CASE_INSENSITIVE flag of the **OBJECT_ATTRIBUTES** structure in \[MSDOCS-OBJ_ATTRIBS\]. +- **OpLockKey** is empty. + +The returned **Status** is copied into the **SMB_Header.Status** field of the response. If the operation fails, the **Status** is returned in an Error Response, and processing is complete. + +If the operation is successful, processing continues as follows: + +- If either the NT_CREATE_REQUEST_OPLOCK or the NT_CREATE_REQUEST_OPBATCH flag is set in the **SMB_Parameters.Words.Flags** field of the request, an OpLock is requested. Windows-based servers obtain OpLocks as described in \[MS-FSA\] section 2.1.5.18, with the following mapping of input elements: + - **Open** is the **Open** passed through from the preceding operation. + - **Type** is LEVEL_BATCH if the NT_CREATE_REQUEST_OPBATCH flag is set, or LEVEL_ONE if the NT_CREATE_REQUEST_OPLOCK flag is set. + +If an OpLock is granted, the **SMB_Parameters.Words.OpLockLevel** field of the response is set. + +- Windows-based servers obtain the extended file attribute and timestamp response information by querying file information from the object store as described in \[MS-FSA\] section 2.1.5.12, with the following mapping of input elements: + - **Open** is the **Open** passed through from the preceding operations. + - **FileInformationClass** is **FileBasicInformation** (\[MS-FSCC\] section 2.4.7). + +If the query fails, the **Status** is returned in an Error Response, and processing is complete. Otherwise: + +- - **SMB_Parameters.Words.ExtFileAttributes** is set to **OutputBuffer.FileAttributes**. + - **SMB_Parameters.Words.CreateTime** is set to **OutputBuffer.CreateTime**. + - **SMB_Parameters.Words.LastAccessTime** is set to **OutputBuffer.LastAccessTime**. + - **SMB_Parameters.Words.LastWriteTime** is set to **OutputBuffer.LastWriteTime**. + - **SMB_Parameters.Words.LastChangeTime** is set to **OutputBuffer.ChangeTime**. +- Windows-based servers obtain the file size response field values by querying file information from the object store as described in \[MS-FSA\] section 2.1.5.12, with the following mapping of input elements: + - **Open** is the **Open** passed through from the preceding operations. + - **FileInformationClass** is **FileStandardInformation** (\[MS-FSCC\] section 2.4.47). + +If the query fails, the **Status** is returned in an Error Response, and processing is complete. Otherwise: + +- - **SMB_Parameters.Words.AllocationSize** is set to **OutputBuffer.AllocationSize**. + - **SMB_Parameters.Words.EndOfFile** is set to **OutputBuffer.EndOfFile**. + +If the query fails, the **Status** is returned in an Error Response, and processing is complete. + +- **Open.File.FileType** is used to set the **SMB_Parameters.Words.ResourceType** and **SMB_Parameters.Words.Directory** fields of the response. +- If **Open.File.FileType** indicates a named pipe, Windows-based servers perform two queries for named pipe state on the underlying object store, each with different information levels, as described in \[MS-FSA\] section 2.1.5.12, with the following mapping of input elements: + - **Open** is the **Server.Open** identified by the **SMB_Parameters.Words.Setup.FID** field of the request that is used for both queries. + - **FileInformationClass** is **FilePipeInformation** (\[MS-FSCC\] section 2.4.37) for one query and **FilePipeLocalInformation** for the other (\[MS-FSCC\] section 2.4.38). + - **OutputBufferSize** is 8 bytes for the **FilePipeInformation** buffer (size of FILE_PIPE_INFORMATION data), and 40 bytes for the **FilePipeLocalInformation** buffer (size of FILE_PIPE_LOCAL_INFORMATION data). + +If either query returns an error status in **Status**, that value is set as the **SMB_Header.Status** field of the response message. If both return success, a success status is used, and the following additional mapping of output elements applies: + +- - **OutputBuffer**: The output buffers from both queries are used to construct an [**SMB_NMPIPE_STATUS (section 2.2.1.3)**](#Section_6911a7095dfb4ffbb0903e8ef872f85c) data type. The **SMB_NMPIPE_STATUS** buffer is copied into the **SMB_Parameters.Words.NMPipeState** field of the response. + - **ByteCount** is not used. +- A new **FID** is generated for the **Open** returned. All of the other results of the **Open** operation are ignored. The **FID** is copied into the **SMB_Parameters.Words.FID** field of the response. + +While opening an existing file, the underlying object store checks for the necessity of an Oplock break, as described in \[MS-FSA\] section 2.1.4.12, and if necessary, notifies the server as described in section 3.3.4.2 and defers the opening of the file until the server acknowledges the Oplock break, as described in section 3.3.5.30. + +[<317> Section 3.3.5.52](#Appendix_A_Target_317): Windows NT Server 4.0 does not use the **CID** as a lookup key. The list of pending requests is associated with the SMB transport, so the effect is the same. + +[<318> Section 3.3.5.52](#Appendix_A_Target_318): Windows-based servers cancel object store operations, as described in the Server Requests Canceling an Operation section in \[MS-FSA\], with the following mapping of input elements: + +- **IORequest** is the **IORequest** of the pending object store operation that is being canceled. + +[<319> Section 3.3.5.53](#Appendix_A_Target_319): Windows NT servers do not completely implement the obsolete SMB_NT_RENAME_MOVE_FILE information level. Instead of returning an error, Windows NT servers perform a file copy. + +[<320> Section 3.3.5.53](#Appendix_A_Target_320): Windows-based servers add link names to files as described in \[MS-FSA\] section 2.1.5.15, with the following mapping of input elements: + +- **Open** is created by opening the file indicated by **SMB_Data.Bytes.NewFileName** in the request. If the open operation fails, the **Status** is returned in an Error Response, and processing is complete. The minimum access required in order to add a link to the file is (READ_CONTROL | FILE_READ_DATA | FILE_READ_ATTRIBUTES | FILE_READ_EA). +- **FileInformationClass** is FileLinkInformation. +- **InputBuffer.FileName** is copied from SMB_Data.Bytes.NewFileName. + +The returned **Status** is copied into the **SMB_Header.Status** field of the response. If the operation fails, the **Status** is returned in an Error Response. + +[<321> Section 3.3.5.53](#Appendix_A_Target_321): When opening, overwriting, deleting, hard linking, or renaming a file, Windows NT Server checks for sharing violations. If a sharing violation would be generated by the operation, the server delays for 200 ms and then tests again for a sharing violation. The server retries five times, for a total delay of approximately one second, before giving up and returning the sharing violation error. + +[<322> Section 3.3.5.53](#Appendix_A_Target_322): It is uncertain how Windows-based servers respond when a hard linking operation interferes with an ongoing search or other operations. + +[<323> Section 3.3.5.54](#Appendix_A_Target_323): Windows-based servers open printer spool files in the object store as described in \[MS-FSA\] section 2.1.5.1, with the following mapping of input elements: + +- **RootOpen** is provided by using the **SMB_Header.TID** to find the matching **Server.TreeConnect** in the **Server.Connection.TreeConnectTable**. The server then acquires an **Open** on **Server.TreeConnect.Share.LocalPath**, which is passed as **RootOpen**. +- **PathName** is "\\", which indicates the root of the share. +- **SecurityContext** is found by using the **SMB_Header.UID** to look up the matching **Session** entry in the **Server.Connection.SessionTable**. The **Server.Session.UserSecurityContext** is passed as **SecurityContext**. +- **DesiredAccess** is (GENERIC_WRITE | FILE_READ_ATTRIBUTES). +- **ShareAccess** is not FILE_SHARE_READ. +- **CreateOptions** is set to (**FILE_NON_DIRECTORY_FILE | FILE_SEQUENTIAL_ONLY | FILE_COMPLETE_IF_OPLOCKED**). If the **SMB_Header.Flags2 SMB_FLAGS2_KNOWS_EAS** flag is not set, then the **FILE_NO_EA_KNOWLEDGE** bit is also set. +- **CreateDisposition** is set to **FILE_OVERWRITE_IF**. +- **DesiredFileAttributes** is set to FILE_ATTRIBUTE_NORMAL. +- **IsCaseSensitive** is set to FALSE if the **SMB_FLAGS_CASE_INSENSITIVE** bit is set in the **SMB_Header.Flags** field of the request. Otherwise, **IsCaseSensitive** is set depending upon system defaults. For more information, see the description of the **OBJ_CASE_INSENSITIVE** flag of the **OBJECT_ATTRIBUTES** structure \[MSDOCS-OBJ_ATTRIBS\]. +- OpLockKey is empty. + +The returned **Status** is copied into the **SMB_Header.Status** field of the response. If the operation fails, the **Status** is returned in an Error Response, and processing is complete. + +If the command is successful, the server allocates an **Open** object and inserts it into **Server.Connection.FileOpenTable** with the following default values: + +- A new **FID** is created to uniquely identify this **Open** in **Server.Connection.FileOpenTable**. +- **Server.Open.TreeConnect** is set to the **TreeConnect** on which the open request was performed, and **Server.Open.TreeConnect.OpenCount** is increased by 1. + +The server registers the **Open** by invoking the event Server Registers a New Open (\[MS-SRVS\] section 3.1.6.4) and assigns the return value to **Server.Open.FileGlobalId**. + +All of the other results of the Open operation are ignored. The **FID** is copied into the **SMB_Parameters.Words.FID** field of the response. + +[<324> Section 3.3.5.55](#Appendix_A_Target_324): Windows-based servers request a write to a printer spool file in the object store as described in \[MS-FSA\] section 2.1.5.4, with the following mapping of input elements: + +- **Open** is the **Open** indicated by the **SMB_Parameters.Words.FID** field of the request. +- **ByteOffset** is not used. +- **ByteCount** is the **SMB_Data.Bytes.DataLength** field of the request. +- **InputBuffer** is copied from the **SMB_Data.Bytes.Data** field of the request. + +The returned **Status** is copied into the **SMB_Header.Status** field of the response. If the write fails, the **Status** is returned in an Error Response. + +[<325> Section 3.3.5.56](#Appendix_A_Target_325): Windows-based servers flush a file by passing the **Open** to the algorithm described in \[MS-FSA\] section 2.1.5.7. The returned **Status** is copied into the **SMB_Header.Status** field of the response. + +[<326> Section 3.3.5.57.2](#Appendix_A_Target_326): Windows-based servers set pipe state information on named pipes as described in \[MS-FSA\] section 2.1.5.15, with the following mapping of input elements: + +- **Open** is the **Server.Open** identified by the **SMB_Parameters.Words.Setup.FID** field of the request. +- **FileInformationClass** is FilePipeInformation (see \[MS-FSCC\] section 2.4). +- **InputBuffer** is a buffer formatted as a **FILE_PIPE_INFORMATION** structure, specified in \[MS-FSCC\] section 2.4.37, where the specific values are taken from the Trans_Parameters.PipeState field of the request, according to the following mapping. + +| PipeState bit name | Values | FilePipeInformation value | +| ------------------ | ------ | ---------------------------- | +| Nonblocking | 0 | FILE_PIPE_QUEUE_OPERATION | +| | 1 | FILE_PIPE_COMPLETE_OPERATION | +| ReadMode | 0 | FILE_PIPE_BYTE_STREAM_MODE | +| | 1 | FILE_PIPE_MESSAGE_MODE | + +- **InputBufferSize** is 8 bytes, the size of the FILE_PIPE_INFORMATION data. + +The returned **Status** is copied into the **SMB_Header.Status** field of the response. + +[<327> Section 3.3.5.57.3](#Appendix_A_Target_327): Windows NT Server does not support this transaction subcommand. It returns a **Status** of STATUS_INVALID_PARAMETER (ERRDOS/ERRinvalidparam). + +[<328> Section 3.3.5.57.4](#Appendix_A_Target_328): Windows-based servers perform two queries for information on the underlying object store, each with different information levels, as described in \[MS-FSA\] section 2.1.5.12, with the following mapping of input elements: + +- **Open** is the **Server.Open** identified by the **SMB_Parameters.Words.Setup.FID** field of the request and is used for both queries. +- FileInformationClass is FilePipeInformation (\[MS-FSCC\] section 2.3.47) for one query and FilePipeLocalInformation (\[MS-FSCC\] section 2.3.48) for the other. +- **OutputBufferSize** is 8 bytes for the FilePipeInformation buffer (size of FILE_PIPE_INFORMATION data), and 40 bytes for the FilePipeLocalInformation buffer (size of FILE_PIPE_LOCAL_INFORMATION data). + +If either query returns an error status in **Status**, that value is set as the **SMB_Header.Status** field of the response message. If both return success, a success status is used, and the following additional mapping of output elements applies: + +- **OutputBuffer**: The output buffers from both queries are used to construct an SMB_NMPIPE_STATUS data type, as specified in section **2.2.1.3**. The SMB_NMPIPE_STATUS buffer is the **Trans_Parameters.NMPipeState** field of the response. +- **ByteCount** is not used. + +[<329> Section 3.3.5.57.5](#Appendix_A_Target_329): Windows-based servers perform a query for state information of a named pipe on the underlying object store as described in \[MS-FSA\] section 2.1.5.12, with the following mapping of input elements: + +- **Open** is the **Server.Open** identified by the **SMB_Parameters.Words.Setup.FID** field of the request. +- **FileInformationClass** is FilePipeLocalInformation (\[MS-FSCC\] section 2.4.38). +- **OutputBufferSize** is 40 bytes, the size of the **FILE_PIPE_LOCAL_INFORMATION data**. + +The returned **Status** is copied into the **SMB_Header.Status** field of the response. If the operation is successful, the following additional mapping of output elements applies: + +- **OutputBuffer** is used to populate the **Trans_Data** subfields of the response, according to the following mapping. + +| FilePipeLocalInformation field | Response Trans_Data subfield | +| ------------------------------ | ---------------------------- | +| OutboundQuota | OutputBufferSize | +| InboundQuota | InputBufferSize | +| MaximumInstances | MaximumInstances | +| CurrentInstances | CurrentInstances | + +- **ByteCount** is not used. + +[<330> Section 3.3.5.57.6](#Appendix_A_Target_330): Windows-based servers peek at named pipes on the underlying object store using an FSCTL_PIPE_PEEK request (\[MS-FSCC\] section 2.3.46). Processing follows as described in \[MS-FSA\] section 2.1.5.10, with the following mapping of input elements: + +- **Open** is the **Server.Open** identified by the **SMB_Parameters.Words.Setup.FID** field of the request. +- **OutputBufferSize** is 16 bytes (size of FSCTL_PIPE_PEEK reply data) + **SMB_Parameters.Words.MaxDataCount** bytes. + +The returned **Status** is copied into the **SMB_Header.Status** field of the response. If the operation is successful, the following additional mapping of output elements applies: + +- **OutputBuffer** is an FSCTL_PIPE_PEEK reply structure (\[MS-FSCC\] section 2.3.46) and is used to populate the **Trans_Parameters** and **Trans_Data** blocks of the response. The following fields from the **OutputBuffer** map to subfields in the response. Note that **FSCTL_PIPE_PEEK.MessageLength** is not mapped directly, but is used as part of a calculation. + +| FSCTL_PIPE_PEEK reply field | SMB response field | +| --------------------------- | ----------------------------------------------------------------------------------------------- | +| **NamedPipeState** | **Trans_Parameters.NamedPipeState** | +| **ReadDataAvailable** | **Trans_Parameters.ReadDataAvailable** | +| **NumberOfMessages** | Not used | +| **MessageLength** | **Trans_Parameters.MessageBytesLength** = **MessageLength** -**SMB_Parameters.Words.DataCount** | +| **Data** | **Trans_Data.ReadData** | + +[<331> Section 3.3.5.57.7](#Appendix_A_Target_331): Windows-based servers write data to and read data from ("transceive" on) named pipes on the underlying object store using an FSCTL_PIPE_TRANSCEIVE request (\[MS-FSCC\] section 2.3.47). Processing follows as described in \[MS-FSA\] section 2.1.5.10, with the following mapping of input elements: + +- **Open** is the **Server.Open** identified by the **SMB_Parameters.Words.Setup.FID** field of the request. +- **InputBufferSize** is **SMB_Parameters.Words.TotalDataCount** bytes. +- **InputBuffer** is the **Trans_Data.WriteData** field of the request. +- **OutputBufferSize** is 4 bytes (size of FSCTL_PIPE_TRANSCEIVE reply data) + **SMB_Parameters.Words.MaxDataCount** bytes. + +The returned **Status** is copied into the **SMB_Header.Status** field of the response. If the operation is successful, the following additional mapping of output elements applies: + +- **OutputBuffer** is an FSCTL_PIPE_TRANSCEIVE structure (\[MS-FSCC\] section 2.3.48) and is copied into the **ReadData** field of the response. + +[<332> Section 3.3.5.57.8](#Appendix_A_Target_332): Windows NT servers allow only message mode for raw writes on named pipes. If the ReadMode bitmask of the **PipeState** field for the named pipe is set to [**byte mode**](#gt_8586fe9a-1cfa-458a-a145-8db64d69c69c), the server fails raw write requests on named pipes and returns STATUS_INVALID_PARAMETER. + +[<333> Section 3.3.5.57.8](#Appendix_A_Target_333): Windows NT Server permits only a 2-byte write that contains two null (0x00) padding bytes, and requires that the pipe is in message mode. If these conditions are not met, NT server returns a STATUS_INVALID_PARAMETER error. + +[<334> Section 3.3.5.57.9](#Appendix_A_Target_334): Windows-based servers read data from named pipes on the underlying object store as described in \[MS-FSA\] section 2.1.5.3, with the following mapping of input elements: + +- **Open** is the **Server.Open** identified by the **SMB_Parameters.Words.Setup.FID** field of the request. +- **ByteCount** is **SMB_Parameters.Words.MaxDataCount** bytes. +- **ByteOffset** is zero. +- **IsNonCached** is not used. + +The returned **Status** is copied into the **SMB_Header.Status** field of the response. If the operation is successful, the following additional mapping of output elements applies: + +[<335> Section 3.3.5.57.10](#Appendix_A_Target_335): Windows-based servers write data to named pipes on the underlying object store as described in \[MS-FSA\] section 2.1.5.4, with the following mapping of input elements: + +- **Open** is the **Server.Open** identified by the **SMB_Parameters.Words.Setup.FID** field of the request. +- **ByteSize** is **SMB_Parameters.Words.TotalDataCount** bytes. +- **InputBuffer** is the **Trans_Data.WriteData** field of the request. +- **ByteOffset** is zero. +- **IsWriteThrough** and **IsNonCached** are not used. + +The returned **Status** is copied into the **SMB_Header.Status** field of the response. If the operation is successful, the following additional mapping of output elements applies: + +- **BytesWritten** is copied into the **Trans_Parameters.BytesWritten** field of the response + +[<336> Section 3.3.5.57.11](#Appendix_A_Target_336): Windows-based servers test the availability of named pipes on the underlying object store using an FSCTL_PIPE_WAIT request (\[MS-FSCC\] section 2.3.49). Processing follows as described in \[MS-FSA\] section 2.1.5.10, with the following mapping of input elements: + +- **InputBufferSize** is 14 + **SMB_Data.ByteCount** bytes (the size of the FSCTL_PIPE_WAIT request structure's static portion plus the size of the variable-length pipe name). +- **InputBuffer** is the FSCTL_PIPE_WAIT request structure. + +The returned **Status** is copied into the **SMB_Header.Status** field of the response. + +[<337> Section 3.3.5.57.11](#Appendix_A_Target_337): Windows NT Server honors the **Timeout** field for this transaction. + +[<338> Section 3.3.5.58.1](#Appendix_A_Target_338): Windows-based servers pass information level requests to the underlying object store using the information level's corresponding information class. Each information level's corresponding mapping to one or more information classes is given in the information level's corresponding subsection of section [2.2.8](#Section_2bcf1801eb0d422a9b6d43a6e33fb446). Information classes are defined in \[MS-FSCC\] sections 2.4 and 2.5, and their corresponding behaviors are described in \[MS-FSA\] sections 2.1.5.12 and 2.1.5.13, with the following additional considerations: + +- The **Open** input element required for each information class's processing algorithm is either the **Server.Open** that matches the **FID** of the request or created by opening the file indicated by the pathname in the request. If the open operation fails, the **Status** is returned in an Error Response, and processing is complete. +- If the preceding open operation succeeds, once processing completes, the **Open** is closed. + +[<339> Section 3.3.5.58.2](#Appendix_A_Target_339): Windows-based servers open files in the object store as described in \[MS-FSA\] section 2.1.5.1, with the following mapping of input elements: + +- **RootOpen** is provided by using the **SMB_Header.TID** to find the matching **Server.TreeConnect** in the **Server.Connection.TreeConnectTable**. The server then acquires an Open on **Server.TreeConnect.Share.LocalPath**, which is passed as **RootOpen**. +- **PathName** is the **Trans2_Parameters.FileName** field from the request. +- **SecurityContext** is found by using the **SMB_Header.UID** to look up the matching Session entry in the **Server.Connection.SessionTable**. The **Server.Session.UserSecurityContext** is passed as **SecurityContext**. +- **DesiredAccess** is set as follows: + - The **AccessMode** subfield of the **Trans2_Parameters.AccessMode** field in the request is used to set the value of **DesiredAccess**. The **AccessMode** subfield represents the lowest order 4 bits of the **AccessMode** field (0x0007), as shown in the table in section 2.2.4.3.1. The mapping of values is as follows. + +| AccessMode.AccessMode | DesiredAccess | +| --------------------- | ---------------------------------------------------------------- | +| 0 | GENERIC_READ (0x80000000) | +| 1 | GENERIC_WRITE \| FILE_READ_ATTRIBUTES (0x40000000 \| 0x00000080) | +| 2 | GENERIC_READ \| GENERIC_WRITE (0x80000000 \| 0x40000000) | +| 3 | GENERIC_READ \| GENERIC_EXECUTE (0x80000000 \| 0x20000000) | + +- - For any other value of **AccessMode.AccessMode**, this algorithm returns STATUS_OS2_INVALID_ACCESS (ERRDOS/ERRbadaccess). +- **ShareAccess** is set as follows: + - The **SharingMode** subfield of the **Trans2_Parameters.AccessMode** field in the request is used to set the value of **ShareAccess**. The **SharingMode** subfield is a 4-bit subfield of the **AccessMode** field (0x0070), as shown in the table in section 2.2.4.3.1. The mapping of values is as follows. + +| AccessMode.SharingMode | ShareAccess | +| ---------------------- | ----------------------------------- | +| 0 | Compatibility mode (see following) | +| 1 | 0x0L (don't share, exclusive use) | +| 2 | FILE_SHARE_READ | +| 3 | FILE_SHARE_WRITE | +| 4 | FILE_SHARE_READ \| FILE_SHARE_WRITE | + +- - For Compatibility mode, special filename suffixes (after the "." in the filename) are mapped to **SharingMode** 4. The special filename suffix set is: "EXE", "DLL", "SYM", "COM". All other file names are mapped to **SharingMode** 3. + - If **AccessMode** field in the request is 0xFF, and the file is already open on the server, the current sharing mode of the existing Open is preserved, and a **FID** for the file is returned. If the file is not already open on the server, the server attempts to open the file using **SharingMode** 1. + - For any other value of **AccessMode.SharingMode**, this algorithm returns STATUS_OS2_INVALID_ACCESS (ERRDOS/ERRbadaccess). +- **CreateOptions** bits are set as follows. + +| CreateOptions value | TRNS2_OPEN2 equivalent | +| ------------------------- | ----------------------------------------------------------------------------- | +| FILE_WRITE_THROUGH | AccessMode.WritethroughMode == 1 | +| FILE_SEQUENTIAL_ONLY | AccessMode.ReferenceLocality == 1 | +| FILE_RANDOM_ACCESS | AccessMode.ReferenceLocality == 2 or

AccessMode.ReferenceLocality == 3 | +| FILE_WRITE_THROUGH | AccessMode.CacheMode == 1 | +| FILE_NON_DIRECTORY_FILE | Is set | +| FILE_COMPLETE_IF_OPLOCKED | Is set | +| FILE_NO_EA_KNOWLEDGE | SMB_Header.Flags2 & SMB_FLAGS2_KNOWS_EAS == 0 | + +- - All other bits are unused. +- **CreateDisposition** is set as follows: + +| CreateDisposition Value | Trans2_Parameters.OpenMode Equivalent | +| --------------------------------------------------------------------------- | ------------------------------------- | +| Invalid combination; return STATUS_OS2_INVALID_ACCESS (ERRDOS/ERRbadaccess) | FileExistsOpts = 0 & CreateFile = 0 | +| FILE_CREATE | FileExistsOpts = 0 & CreateFile = 1 | +| FILE_OPEN | FileExistsOpts = 1 & CreateFile = 0 | +| FILE_OPEN_IF | FileExistsOpts = 1 & CreateFile = 1 | +| FILE_OVERWRITE | FileExistsOpts = 2 & CreateFile = 0 | +| FILE_OVERWRITE_IF | FileExistsOpts = 2 & CreateFile = 1 | + +- **DesiredFileAttributes** is set as follows: + - **DesiredFileAttributes** is set to the bitwise AND of the **FileAttributes** field in the request and + +( SMB_FILE_ATTRIBUTE_READONLY | + +SMB_FILE_ATTRIBUTE_HIDDEN | + +SMB_FILE_ATTRIBUTE_SYSTEM | + +SMB_FILE_ATTRIBUTE_ARCHIVE | + +SMB_FILE_ATTRIBUTE_DIRECTORY ). + +- - If the resulting value of **DesiredFileAttributes** is zero, **DesiredFileAttributes** is set to FILE_ATTRIBUTE_NORMAL. See sections **2.2.1.2.3** and **2.2.1.2.4**. +- **IsCaseSensitive** is set to FALSE if the **SMB_FLAGS_CASE_INSENSITIVE** bit is set in the **SMB_Header.Flags** field of the request; otherwise, **IsCaseSensitive** is set depending upon system defaults. For more information, see the description of the **OBJ_CASE_INSENSITIVE** flag of the **OBJECT_ATTRIBUTES** structure \[MSDOCS-OBJ_ATTRIBS\]. +- **OpLockKey** is empty. + +The returned **Status** is copied into the **SMB_Header.Status** field of the response. If the operation fails, the **Status** is returned in an Error Response and processing is complete. + +If the operation is successful, processing continues as follows: + +- If the request's **Trans2_Data.ExtendedAttributesList** is nonzero, Windows-based servers set the extended attribute information on the object store as described in \[MS-FSA\] section 2.1.5.15, with the following mapping of input elements: + - **Open** is the **Open** passed through from the preceding operations. + - **FileInformationClass** is **FileFullEaInformation**. + - **InputBuffer** is the **Trans2_Data.ExtendedAttributeList** field of the request. + - **InputBufferSize** is the **SMB_Parameters.Words.TotalDataCount** field of the request. + +The returned **Status** is copied into the **SMB_Header.Status** field of the response. If the operation fails, the **Status** is returned in an Error Response, and processing is complete. + +If the operation is successful, processing continues as follows: + +- If the **REQ_OPLOCK** flag is set in the **Trans2_Parameters.Flags** field of the request, an OpLock is being requested. Windows-based servers obtain OpLocks as described in \[MS-FSA\] section 2.1.5.18, with the following mapping of input elements: + - **Open** is the **Open** passed through from the preceding operation. + - **Type** is LEVEL_BATCH if both the **REQ_OPLOCK** flag and the **REQ_OPLOCK_BATCH** flag are set, or LEVEL_ONE if only the **REQ_OPLOCK** flag is set. + +If an OpLock is granted, the **Trans2_Parameters.OpenResults.LockStatus** bit of the response is set. + +- The **Trans2_Parameters.AccessMode** from the request is copied to the response. +- **Open.File.FileType** is used to set the **Trans2_Parameters.ResourceType**. +- Windows-based servers obtain the **Trans2_Parameters.FileAttributes** response field values by querying file information from the object store as described in \[MS-FSA\] section 2.1.5.12, with the following mapping of input elements: + - **Open** is the **Open** passed through from the preceding operations. + - **FileInformationClass** is **FileBasicInformation**. + +If the query fails, the **Status** is returned in an Error Response, and processing is complete. Otherwise: + +- - **SMB_Parameters.Words.FileAttrs** is set to **OutputBuffer.FileAttributes**. +- If the **REQ_ATTRIB** flag is set in the **Trans2_Parameters.Flags** field of the request, Windows-based servers obtain the **Trans2_Parameters.FileDataSize** response field values by querying file information from the object store as described in \[MS-FSA\] section 2.1.5.12, with the following mapping of input elements: + - **Open** is the **Open** passed through from the preceding operations. + - **FileInformationClass** is **FileStandardInformation**. + +If the query fails, the **Status** is returned in an Error Response, and processing is complete. Otherwise: + +- - **Trans2_Parameters.FileDataSize** is set to the lowest-order 32 bits of **OutputBuffer.EndOfFile**. +- If the **REQ_EASIZE** flag is set in the **Trans2_Parameters.Flags** field of the request, Windows-based servers obtain the **Trans2_Parameters.ExtendedAttributeLength** response field values by querying file information from the object store as described in \[MS-FSA\] section 2.1.5.12, with the following mapping of input elements: + - **Open** is the **Open** passed through from the preceding operations. + - FileInformationClass is FileEaInformation. + +If the query fails, the **Status** is returned in an Error Response, and processing is complete. Otherwise: + +- - **Trans2_Parameters.ExtendedAttributeLength** is set to **OutputBuffer.EaSize**. + +If the query fails, the **Status** is returned in an Error Response, and processing is complete. + +- A new **FID** is generated for the **Open** returned. All of the other results of the Open operation are ignored. The **FID** is copied into the **SMB_Parameters.Words.FID** field of the response. + +[<340> Section 3.3.5.58.3](#Appendix_A_Target_340): If no matching entries are found, Windows NT servers fail the [TRANS2_FIND_FIRST2 Request (section 2.2.6.2.1)](#Section_b2b2a73094994f05884ed5bb7b9caf90) and return a full [TRANS2_FIND_FIRST2 Response (section 2.2.6.2.2)](#Section_4e65d94e09af4511a77ab73adf1c52d6), setting all the fields to zero. + +[<341> Section 3.3.5.58.3](#Appendix_A_Target_341): Windows-based servers close the search and return a nonzero **SID** field value. + +[<342> Section 3.3.5.58.3](#Appendix_A_Target_342): Windows-based servers process this command in the same way as the SMB_COM_SEARCH (section 2.2.4.58) and [SMB_COM_FIND (section 2.2.4.59)](#Section_5df45d03d4e94dfd850f639363b8dffd) commands (see the notes in section [3.3.5.47](#Section_74dce06ec6594d40aec07edeb8ac32f9)), with the following differences: + +- The **FileInformationClass** is set to **FileDirectoryInformation**, **FileBothDirectoryInformation**, or **FileFullDirectoryInformation**, depending upon the information required in the EA to be returned. +- The **FileIndex** field is not used. +- **Trans2_Parameters.SearchCount** replaces **SMB_Parameters.Words.MaxCount**. +- The files returned are not required to have short names. +- Instead of returning an **SMB_Directory_Information** structure for each directory entry that matches the required **FileName** and **SearchAttributes** fields, the server returns an **InformationClass** structure of the type requested in the **Trans2_Parameters.InformationLevel** field. If the requested **InformationLevel** is [SMB_INFO_QUERY_EAS_FROM_LIST (section 2.2.8.1.3)](#Section_031d81a90fda4b2fb976f4c15c8a7efa), the server queries the file for the list of extended attributes (EAs), as described in \[MS-FSA\] section 2.1.5.12. FileInformationClass is set to FileFullEaInformation. For each **AttributeName** field listed in the **GetExtendedAttributeList** field, the corresponding FILE_FULL_EA_INFORMATION data returned from the query is converted into SMB_FEA (section 2.2.1.2.2) format and copied into the **Trans2_Data** block of the response. If an error is returned, the **Status** is not copied into the **SMB_Header.Status** field. Instead, the offset of the **GetExtendedAttributeList.GEAList** field entry that caused the error is stored in the **EaErrorOffset** field, and no more EAs are returned. + +[<343> Section 3.3.5.58.4](#Appendix_A_Target_343): Windows-based servers process this command in the same way as the [TRANS2_FIND_FIRST2 (section 2.2.6.2)](#Section_a782468b56f14066bb6ee2630f0e8695) except that the **FileIndex** field is used to restart the search at the selected location. + +[<344> Section 3.3.5.58.6](#Appendix_A_Target_344): If the **InformationLevel** field is SMB_QUERY_FILE_NAME_INFO, Windows-based servers set the **Trans2_Data.FileName** field in response to the **Server.Open.PathName** ADM element where the **Server.Open.FID** ADM element matches the **FID** field in the request. If the **InformationLevel** field is SMB_QUERY_FILE_ALL_INFO, Windows-based servers set the **Trans2_Data.FileName** field in the response to the full pathname relative to the root of the share. + +[<345> Section 3.3.5.58.8](#Appendix_A_Target_345): If the **InformationLevel** field is SMB_QUERY_FILE_NAME_INFO, Windows-based servers set the **Trans2_Data.FileName** field in response to the **Server.Open.PathName** ADM element where the **Server.Open.FID** ADM element matches the **FID** field in the request. If the **InformationLevel** field is SMB_QUERY_FILE_ALL_INFO, Windows-based servers set the **Trans2_Data.FileName** field in the response to the full pathname relative to the root of the share. + +[<346> Section 3.3.5.58.10](#Appendix_A_Target_346): Windows-based servers create directories within the object store as described in \[MS-FSA\] section 2.1.5.1, with the following mapping of input elements: + +- **RootOpen** is provided by using the **SMB_Header.TID** to find the matching **Server.TreeConnect** in the **Server.Connection.TreeConnectTable**. The server then acquires an Open on **Server.TreeConnect.Share**.LocalPath, which is passed as **RootOpen**. +- **PathName** is the **Trans2_Parameters.DirectoryName** field from the request. +- **SecurityContext** is found by using the **SMB_Header**.**UID** to look up the matching Session entry in the **Server.Connection.SessionTable**. The **Server.Session.UserSecurityContext** is passed as SecurityContext. +- **DesiredAccess** is set to **FILE_TRAVERSE** (which has the same value as **FILE_EXECUTE**: 0x00000020). +- **ShareAccess** is set to 0x00000000. +- **CreateOptions** is set to **FILE_DIRECTORY_FILE**. +- **CreateDisposition** is set to **FILE_CREATE**. +- **DesiredFileAttributes** is set to **FILE_ATTRIBUTE_NORMAL**. +- **IsCaseSensitive** is set to FALSE if the **SMB_FLAGS_CASE_INSENSITIVE** bit is set in the **SMB_Header**. **Flags** field of the request. Otherwise, **IsCaseSensitive** is set depending upon system defaults. For more information, see the description of the **OBJ_CASE_INSENSITIVE** flag of the **OBJECT_ATTRIBUTES** structure \[MSDOCS-OBJ_ATTRIBS\]. +- **OpLockKey** is empty. + +The returned **Status** is copied into the **SMB_Header.Status** field of the response. If the operation fails, the **Status** is returned in an Error Response, and processing is complete. + +- If the request's **Trans2_Data.ExtendedAttributesList** is nonzero, Windows-based servers set the extended attribute (EA) information on the object store as described in \[MS-FSA\] section 2.1.5.15, with the following mapping of input elements: + - **Open** is the **Open** passed through from the preceding operations. + - **FileInformationClass** is **FileFullEaInformation**. + - **InputBuffer** is the **Trans2_Data.ExtendedAttributeList** field of the request. + - **InputBufferSize** is the **SMB_Parameters.Words.TotalDataCount** field of the request. + +The returned **Status** is copied into the **SMB_Header.Status** field of the response. If the operation is successful, the Open returned from the process described in \[MS-FSA\] section 2.1.5.1 is closed. All other results are ignored. + +[<347> Section 3.3.5.59.1](#Appendix_A_Target_347): This is dependent upon the underlying file system. On Windows NT Server, if the request to create a file is performed on a Windows FAT or FAT32 file system, the request fails with STATUS*ACCESS_DENIED. Otherwise, it fails with STATUS_PRIVILEGE_NOT* HELD. + +[<348> Section 3.3.5.59.1](#Appendix_A_Target_348): Windows-based servers open files in the object store as described in \[MS-FSA\] section 2.1.5.1, with the following mapping of input elements: + +- **RootOpen** is provided in one of two ways: + - If **NT_Trans_Parameters.RootDirectoryFID** is zero, **RootOpen** is provided by using the **SMB_Header.TID** to find the matching **Server.TreeConnect** in the **Server.Connection.TreeConnectTable**. The server then acquires an **Open** on **Server.TreeConnect.Share.LocalPath**, which is passed as **RootOpen**. + - If **NT_Trans_Parameters.RootDirectoryFID** is nonzero, **RootOpen** is provided by looking up the **RootDirectoryFID** in the **Server.Connection.FileOpenTable**. +- **PathName** is the **NT_Trans_Parameters.FileName** field of the request. +- **SecurityContext** is found by using the **SMB_Header.UID** to look up the matching **Session** entry in the **Server.Connection.SessionTable**. The **Server.Session.UserSecurityContext** is passed as **SecurityContext**. +- **DesiredAccess** is the **NT_Trans_Parameters.DesiredAccess** field of the request. The FILE_READ_ATTRIBUTES attribute is added (using a bitwise OR) to ensure that the server can query attributes once the file has been opened. +- **ShareAccess** is the **NT_Trans_Parameters.ShareAccess** field of the request. +- **CreateOptions** is the **NT_Trans_Parameters.CreateOptions** field of the request. The FILE_COMPLETE_IF_OPLOCKED option is added (using a bitwise OR) to the set provided by the client. If the FILE_NO_INTERMEDIATE_BUFFERING flag is set, it is cleared, and FILE_WRITE_THROUGH is set. +- **CreateDisposition** is the **NT_Trans_Parameters.CreateDisposition** field of the request. +- **DesiredFileAttributes** is the **NT_Trans_Parameters.ExtFileAttributes** field of the request. +- **IsCaseSensitive** is set to FALSE if the SMB_FLAGS_CASE_INSENSITIVE bit is set in the **SMB_Header.Flags** field of the request; otherwise, **IsCaseSensitive** is set depending upon system defaults. For more information, see the description of the OBJ_CASE_INSENSITIVE flag of the **OBJECT_ATTRIBUTES** structure \[MSDOCS-OBJ_ATTRIBS\]. +- **OpLockKey** is empty. + +Windows-based servers complete the [NT_TRANSACT_CREATE Request (section 2.2.7.1.1)](#Section_42eef5ff34d74389a4e5812820475686) by calling the Win32 **IoCreateFile()** function, which allows both security descriptors (SDs) and extended attributes (EAs) to be set directly rather than having to set them in separate steps. See [\[MSDN-IoCreateFile\]](https://go.microsoft.com/fwlink/?LinkId=182725). With respect to the algorithm presented in \[MS-FSA\] section 2.1.5.1: + +- If the request's **NT_Trans_Parameters.SecurityDescriptorLength** value is greater than zero, Windows-based servers set **Open.File.SecurityDescriptor** to the security descriptor passed in the **NT_Trans_Data.SecurityDescriptor** field in the request. (The SD is passed to the object store in the _ObjectAttributes_ parameter of **IoCreateFile()**.) +- If the request's **NT_Trans_Parameters.EALength** value is greater than zero, Windows-based servers set **Open.File.ExtendedAttributes** and **Open.File.ExtendedAttributesLength** from **NT_Trans_Data.ExtendedAttributes** and **NT_Trans_Parameters.EALength**, respectively. (These values are passed to the object store via the _EaBuffer_ and _EaLength_ parameters of **IoCreateFile()**.) + +The returned **Status** is copied into the **SMB_Header.Status** field of the response. If the operation fails, the **Status** is returned in an Error Response, and processing is complete. + +If the operation is successful, processing continues as follows: + +- If either the NT_CREATE_REQUEST_OPLOCK or NT_CREATE_REQUEST_OPBATCH flag is set in the **SMB_Parameters.Words.Flags** field of the request, an OpLock is being requested. Windows-based servers obtain OpLocks as described in \[MS-FSA\] section 2.1.5.18, with the following mapping of input elements: + - **Open** is the **Open** passed through from the preceding operation. + - **Type** is LEVEL_BATCH if the NT_CREATE_REQUEST_OPBATCH flag is set, or LEVEL_ONE if the NT_CREATE_REQUEST_OPLOCK flag is set. +- If an OpLock is granted, the **SMB_Parameters.Words.OpLockLevel** field of the response is set. + +The returned **Status** is copied into the **SMB_Header.Status** field of the response. If the operation fails, the **Status** is returned in an Error Response, and processing is complete. + +If the operation is successful, processing continues as follows: + +- Windows-based servers obtain the extended file attribute and timestamp response information by querying file information from the object store as described in \[MS-FSA\] section 2.1.5.12, with the following mapping of input elements: + - **Open** is the **Open** passed through from the preceding operations. + - **FileInformationClass** is FileBasicInformation. +- If the query fails, the **Status** is returned in an Error Response, and processing is complete. Otherwise: + - **NT_Trans_Parameters.ExtFileAttributes** is set to **OutputBuffer.FileAttributes**. + - **NT_Trans_Parameters.CreateTime** is set to **OutputBuffer.CreateTime**. + - **NT_Trans_Parameters.LastAccessTime** is set to **OutputBuffer.LastAccessTime**. + - **NT_Trans_Parameters.LastWriteTime** is set to **OutputBuffer.LastWriteTime**. + - **NT_Trans_Parameters.LastChangeTime** is set to **OutputBuffer.ChangeTime**. +- Windows-based servers obtain the file size response field values by querying file information from the object store as described in \[MS-FSA\] section 2.1.5.12, with the following mapping of input elements: + - **Open** is the **Open** passed through from the preceding operations. + - **FileInformationClass** is FileStandardInformation. +- If the query fails, the **Status** is returned in an Error Response, and processing is complete. Otherwise: + - **NT_Trans_Parameters.AllocationSize** is set to **OutputBuffer.AllocationSize**. + - **NT_Trans_Parameters.EndOfFile** is set to **OutputBuffer.EndOfFile**. +- If the query fails, the **Status** is returned in an Error Response, and processing is complete. +- **Open.File.FileType** is used to set the **NT_Trans_Parameters.ResourceType** and **NT_Trans_Parameters.Directory** fields of the response. +- If **Open.File.FileType** indicates a named pipe, Windows-based servers perform two queries for named pipe state on the underlying object store, each with different information levels, as described in \[MS-FSA\] section 2.1.5.12, with the following mapping of input elements: + - **Open** is the **Server.Open** identified by the **SMB_Parameters.Words.Setup.FID** field of the request and is used for both queries. + - **FileInformationClass** is FilePipeInformation for one query and FilePipeLocalInformation for the other (\[MS-FSCC\] section 2.4). + - **OutputBufferSize** is 8 bytes for the FilePipeInformation buffer (size of FILE_PIPE_INFORMATION data), and 40 bytes for the FilePipeLocalInformation buffer (size of FILE_PIPE_LOCAL_INFORMATION data). +- If either query returns an error status in **Status**, that value is set as the **SMB_Header.Status** field of the response message. If both return success, a success status is used, and the following additional mapping of output elements applies: + - **OutputBuffer**: The output buffers from both queries are used to construct an **SMB_NMPIPE_STATUS (section 2.2.1.3)** data type. The **SMB_NMPIPE_STATUS** buffer is copied into the **NT_Trans_Parameters.NMPipeState** field of the response. + - **ByteCount** is not used. +- A new **FID** is generated for the **Open** returned. All of the other results of the **Open** operation are ignored. The **FID** is copied into the **SMB_Parameters.Words.FID** field of the response. + +[<349> Section 3.3.5.59.2](#Appendix_A_Target_349): Windows-based servers send IOCTL and FSCTL requests to the underlying object store as described in each control code's specific subsection of \[MS-FSA\] section 2.1.5.10. + +[<350> Section 3.3.5.59.3](#Appendix_A_Target_350): Windows-based servers set security descriptors on objects within the object store as described in \[MS-FSA\] section 2.1.5.17, with the following mapping of input elements: + +- **Open** is the **Open** indicated by looking up **FID** in **Server.Connection.FileOpenTable**. +- **SecurityInformation** is copied from the **NT_Trans_Parameters.SecurityInformation** field in the request. +- **InputBuffer** is copied from the **NT_Trans.Data_SecurityDescriptor** field in the request. + +Upon completion, the returned **Status** is copied into the **SMB_Header.Status** field of the response message. + +[<351> Section 3.3.5.59.4](#Appendix_A_Target_351): Windows-based servers provide notification of changes within the object store as described in \[MS-FSA\] section 2.1.5.11, with the following mapping of input elements: + +- **Open** is the **Open** indicated by looking up **FID** in **Server.Connection.FileOpenTable**. +- **WatchTree** is set based upon the value of the **WatchTree** field in the request. +- **CompletionFilter** is copied from the **CompletionFilter** field in the request. + +A thread of execution on the server waits for the completion of the notification request. The notification request is an object store I/O operation, and can be canceled as described in sections [2.2.4.65](#Section_bf04c12be5ee41079b760e5ffda9cc3f) and [3.3.5.52](#Section_0a2324454ed64225bad85b9b6e6f8a00), and in \[MS-FSA\] section 2.1.5.20. + +Upon completion, the returned **Status** is copied into the **SMB_Header.Status** field of the response message. If the operation is successful, the **NotifyEventEntries** are copied from the **OutputBuffer** to the **NT_Trans_Parameters.FileNotifyInformation** field. + +[<352> Section 3.3.5.59.5](#Appendix_A_Target_352): Windows-based servers query security descriptors on objects within the object store as described in \[MS-FSA\] section 2.1.5.14, with the following mapping of input elements: + +- **Open** is the **Open** indicated by looking up **FID** in **Server.Connection.FileOpenTable**. + +[<353> Section 3.3.6.4](#Appendix_A_Target_353): Windows-based servers use a default timeout value of 2 minutes. Windows-based servers close the connections if **Server.Connection.SelectedDialect** is empty and current time minus **Server.Connection.CreationTime** is more than 30 seconds. + +[<354> Section 3.3.7.1](#Appendix_A_Target_354): Windows TDI transport drivers indicate transport disconnection by signaling an Error Notification as described in [\[MSDN-RecErrorNotif\]](https://go.microsoft.com/fwlink/?LinkId=214276). + +[<355> Section 3.3.7.2](#Appendix_A_Target_355): Windows SMB servers request that a TDI transport driver close a connection by issuing a disconnect request, as described in [\[MSDN-DiscntEndpoint\]](https://go.microsoft.com/fwlink/?LinkId=214274), and by subsequently closing the TDI file object. + +[<356> Section 3.3.7.3](#Appendix_A_Target_356): Windows SMB servers request that TDI transport drivers accept or reject incoming connections as described in \[MSDN-MakeEndpoint\]. + +[<357> Section 3.4.4.9](#Appendix_A_Target_357): Windows-based SMB clients on Windows NT 4.0 operating system Service Pack 2 (SP2), Windows 2000, and Windows Server 2003 do not check the CAP_DFS flag and always send the DFS referral request to the server. + +[<358> Section 5.1](#Appendix_A_Target_358): Windows NT servers provide a mechanism for restricting the access of anonymous logon users (also known as null session connections). See [\[KB143474\]](https://go.microsoft.com/fwlink/?LinkId=162009) for a description. + +Guest account support is optional and can be disabled. + +[<359> Section 5.1](#Appendix_A_Target_359): Share level access control is deprecated in favor of user level access control. + +Windows clients can be configured to fail authentication if plaintext passwords are required by the server. By default, Windows 98 clients require that the server accept challenge/response authentication. By default, Windows NT 4.0 and Windows NT 4.0 SP2 Workstation clients send plaintext passwords if requested by the server. Windows NT 4.0 SP3 clients require challenge/response by default. See [\[MSDN-ENPLAINTXT\]](https://go.microsoft.com/fwlink/?LinkId=162040). + +# Change Tracking + +No table of changes is available. The document is either new or has had no changes since its last release. + +# Index + +A + +Abstract data model + +[client](#section_f2b6ee5514dc428cb2a335c8d8fea576) 477 + +global ([section 3.1.1.1](#section_213329362ceb4b869692ebf8ed1fbe40) 474, [section 3.2.1.1](#section_4a242e20b3ca426b8727c04e0cfbbd5a) 477) + +overview ([section 3.1.1](#section_5523379590774c93b2b314510438b9d2) 474, [section 3.2.1](#section_f2b6ee5514dc428cb2a335c8d8fea576) 477) + +RPC + +[global](#section_213329362ceb4b869692ebf8ed1fbe40) 474 + +overview ([section 3.1.1](#section_5523379590774c93b2b314510438b9d2) 474, [section 3.4.1](#section_a03dc25a693d4c7c966e55d7afbe2257) 627) + +SMB + +[connection](#section_0b33fdf6ea2e4f6298c952adf88796f8) 479 + +[session](#section_c42729fbc655424f8d9a44825d609b86) 481 + +[tree connect](#section_c3ddee8909f742049ccd842802a6bd8d) 481 + +unique + +[open](#section_9b04bf6b664e41d5aec17ddc7c92d9ff) 481 + +[open search](#section_19172733fcff46c19ef6fe95d0cfd159) 482 + +[server](#section_872714487679438a8a0d3514bf3ca69b) 549 + +global ([section 3.1.1.1](#section_213329362ceb4b869692ebf8ed1fbe40) 474, [section 3.3.1.1](#section_2b4f1d5c442a4ed4a4518a986351c5a9) 549) + +overview ([section 3.1.1](#section_5523379590774c93b2b314510438b9d2) 474, [section 3.3.1](#section_872714487679438a8a0d3514bf3ca69b) 549) + +RPC + +[global](#section_213329362ceb4b869692ebf8ed1fbe40) 474 + +overview ([section 3.1.1](#section_5523379590774c93b2b314510438b9d2) 474, [section 3.5.1](#section_fcabdf6bfc904c0bb52b324e109f930a) 634) + +[share](#section_bc0e0b5e43af467a81eda2b55647640f) 551 + +SMB + +[command - pending](#section_6047c1ae579a4d2db93257fdc1d2958b) 554 + +[connection](#section_592b9143f8594ece82442353c78a04cb) 552 + +[session](#section_c553f7d7534549a7b95cb8fb53db07a2) 555 + +[tree connect](#section_e1fcf7bc13ae4c889ed7efe1ad0a67a0) 555 + +unique + +[open](#section_738e3f3cabff439bbd4f0fe36aee1ce8) 556 + +[open search](#section_adf55b16671b42ec97935e863b30fc54) 556 + +[AndX packet](#section_fc4d19f78040426d91547219c57453c8) 84 + +[Applicability](#section_ccc54ebf28294656a1535083f1dda9d8) 30 + +C + +[Capability negotiation](#section_80850595e3014464974558e4945eb99b) 30 + +[Change tracking](#section_d12c335b970845bf9931adc5fbd3388d) 708 + +[Character sequences data type](#section_d13dd8de250442549f81e351fc5baacd) 42 + +Client + +[abstract data model](#section_f2b6ee5514dc428cb2a335c8d8fea576) 477 + +global ([section 3.1.1.1](#section_213329362ceb4b869692ebf8ed1fbe40) 474, [section 3.2.1.1](#section_4a242e20b3ca426b8727c04e0cfbbd5a) 477) + +overview ([section 3.1.1](#section_5523379590774c93b2b314510438b9d2) 474, [section 3.2.1](#section_f2b6ee5514dc428cb2a335c8d8fea576) 477) + +SMB + +[connection](#section_0b33fdf6ea2e4f6298c952adf88796f8) 479 + +[session](#section_c42729fbc655424f8d9a44825d609b86) 481 + +[tree connect](#section_c3ddee8909f742049ccd842802a6bd8d) 481 + +unique + +[open](#section_9b04bf6b664e41d5aec17ddc7c92d9ff) 481 + +[open search](#section_19172733fcff46c19ef6fe95d0cfd159) 482 + +higher-layer triggered events + +[cryptographic session key - querying](#section_18d8396c245648d7b338c99e05001012) 529 + +device + +[reading](#section_18c7441d4b024f738b3e13b78396a1e4) 508 + +[writing](#section_13ec5da367744618a4a0709002cda9dc) 512 + +DFS + +[querying referrals](#section_68f4963e657a4400b4504f5c144fb29e) 529 + +[subsystem active](#section_b43ac9a496294974a189fcdbedfad21a) 529 + +directory + +[contents change notification](#section_e76cc07beff448dfb03b227f8e5e3941) 527 + +[creating](#section_839f343a00eb40acbe2cbda8dc06d11d) 495 + +[deleting](#section_e41fbdab7aaf405da368ac99d0733ff9) 496 + +[enumeration](#section_fbfa3470766841aeaed03e2f08a2d3a6) 523 + +[verifying path](#section_79e3f2310df542e8a063000750098e4c) 520 + +file + +attributes + +[querying](#section_e70273837f8e45a18e7f81604dedd759) 505 + +[setting](#section_c43492ca1d6b4bb98a2c982b9c547815) 506 + +[byte-range lock](#section_0a200d604cfb47fdb15d6c55fc155a6f) 518 + +[byte-range lock - release](#section_0c6eb3ee74a64907b02304daca274cf1) 519 + +[closing](#section_5afb8ecf09a14bd49ab67d86890914d6) 502 + +[create or overwrite](#section_ed665df4858c4ad0b65012bdf79e7da6) 500 + +[creating a hard link](#section_36e5c360fab64557b18ad2b68bbcb84e) 504 + +[deleting](#section_10abe589ae044bb7aeb9814ed81e4cec) 503 + +[flushing data](#section_5d05af7582d8437db084a9c4dafb711b) 502 + +[opening an existing](#section_66435b844e2242ffb4e15ff7b07de138) 496 + +[opportunistic lock](#section_388621802e684a56985a5da4c5b7d0b5) 520 + +[print](#section_65f21277dec34bfa9d7291db9e608dc8) 525 + +[reading](#section_18c7441d4b024f738b3e13b78396a1e4) 508 + +[renaming](#section_180d43e85c2c427f93153b0632d6f32b) 503 + +[seek to a location](#section_033340bfb2a9458592d2b232a82358d6) 521 + +[sending IOCTL](#section_bec8c29eec9a456eb90ed90c07e5c7fc) 521 + +[system attributes - querying](#section_825e9d38ac5c4a6db5e34600e1749d31) 522 + +[writing](#section_13ec5da367744618a4a0709002cda9dc) 512 + +named pipe + +[exchange (call)](#section_eb7675050c85419e8eaadf01500ac5f7) 526 + +[executing a transaction](#section_0e868b83c198491cae21ab5b353ad5d1) 526 + +[peeking at data](#section_25b60122a69347078a14c22b2b919491) 526 + +querying + +[handle state](#section_eba89c166c1e485fa029987f4b70caf5) 525 + +[information](#section_03dbe090791e489e970d59e751eced86) 526 + +reading ([section 3.2.4.14](#section_18c7441d4b024f738b3e13b78396a1e4) 508, [section 3.2.4.37](#section_9fef605a943143289a00f4599a691745) 527) + +[setting state](#section_9fd144a554004a3482497b51a07bea10) 525 + +[waiting for availability](#section_ee6ea352bf2a4be29d7acbf7648f3c15) 526 + +writing ([section 3.2.4.15](#section_13ec5da367744618a4a0709002cda9dc) 512, [section 3.2.4.38](#section_40ec464830534b0586bbe2418b12eba0) 527) + +[named RAP transaction](#section_46fa86910d3b4a4e91c04657250d7514) 528 + +[number of opens on tree connect](#section_dd4363b135d043578d096efe08ea0ab9) 529 + +[operations - canceling pending](#section_54301b60971f42a4b6c1d70dd06a8a45) 524 + +[process exit notification](#section_c099c3f16eb74a60a7fa31d5fc93c329) 521 + +security descriptors + +[querying](#section_baa7103e084242c88faeee37015fa717) 528 + +[setting](#section_136a67e9bfb645e8a176a31ea23f819b) 528 + +sending any message ([section 3.1.4.1](#section_68c3d17ae48e4eb4b97e3246bfe0262f) 474, [section 3.2.4.1](#section_87ad25ebedcb48dda230ba0d852fbfbd) 483) + +[share - connecting](#section_96d90ccb9f7f47159d21987b93304f74) 490 + +[SMB session logoff](#section_c23c7dfd8d7f46f593be17e05e333904) 522 + +[transport layer connection - testing](#section_2c2b8e1fa42746dab9b6902c4e8902d2) 522 + +[tree disconnect (unmount share)](#section_cbce4d659c874d7ea121730932263936) 522 + +initialization ([section 3.1.3](#section_1e7f29da8e484f73ba9b7266709f22d8) 474, [section 3.2.3](#section_2067fd35c8b84cb9a5dc404743069bc6) 482) + +local events + +[handling transport disconnect](#section_fb0ae8852794480e8b7a897ee33d46ea) 548 + +[overview](#section_7ad63bf7b4a24eb5b9c331029007014f) 477 + +message processing + +[algorithms for challenge/response authentication](#section_4d1a2cb00951462a8582121fd1afe28e) 476 + +OpLock + +[break notification](#section_4b44b6339447458382557e32942bfc86) 547 + +[grant](#section_11e0cb3291244de09c9bb92d2d24be9a) 546 + +receiving any message ([section 3.1.5.1](#section_35839d070f694d20af2f2c45aa7522b3) 475, [section 3.2.5.1](#section_4702ded4cd2f4d2187c97664fb637e5d) 530) + +[SMB_COM_CLOSE response](#section_1915525f27fc430d844f00f18021f512) 535 + +[SMB_COM_CREATE response](#section_bea6eee9ce6b472f95b1cd2a8c52e7ba) 535 + +[SMB_COM_CREATE_NEW response](#section_7e585519b04548509fb80033b0824e5c) 536 + +[SMB_COM_CREATE_TEMPORARY response](#section_e51fd50aba0d49b1b01412b78eee3749) 536 + +[SMB_COM_ECHO response](#section_595b064024854c828809f939b59e2257) 539 + +[SMB_COM_FIND response](#section_461ac2873bb74030af644a6817a3e4fa) 541 + +[SMB_COM_FIND_CLOSE2 response](#section_95bbc586f8c54d928e95b86e9b36f49b) 541 + +[SMB_COM_FIND_UNIQUE response](#section_4af7a8e8da6541028abe474e9b6a36dd) 542 + +[SMB_COM_IOCTL response](#section_3844da42590242b68250533bdf8c4afb) 539 + +[SMB_COM_LOCK_AND_READ response](#section_a16136c122df4c8894a153daedd44816) 536 + +[SMB_COM_LOGOFF_ANDX response](#section_00fc0299496c4330908967358994f272) 541 + +[SMB_COM_NEGOTIATE response](#section_8ab141119b414edeac94dbea557451c6) 532 + +[SMB_COM_NT_CREATE_ANDX response](#section_455b35b11f384f9baa5d3882a8f1a351) 542 + +[SMB_COM_NT_TRANSACT response](#section_9b2d904777df442ab7e37c264fd22e4a) 542 + +[SMB_COM_NT_TRANSACT subcommand response](#section_71acb4f2760c4047939264c542209ad3) 546 + +[SMB_COM_OPEN response](#section_78b0ced13d09497992a16aad6910ccc4) 534 + +[SMB_COM_OPEN_ANDX response](#section_be71cad6f42b4a4c8ceb9c6b0913e631) 539 + +[SMB_COM_OPEN_PRINT_FILE response](#section_330fde8506544b1da836459911c5df89) 542 + +[SMB_COM_QUERY_INFORMATION response](#section_a1d582e4f38f4dcd9a4bdcc4e5b66d54) 535 + +[SMB_COM_QUERY_INFORMATION_DISK response](#section_6c1b5aa0f68e4a678d324b33cd09ec19) 541 + +[SMB_COM_QUERY_INFORMATION2 response](#section_afcddca01b5b43c5945d94bb11f91996) 539 + +[SMB_COM_READ response](#section_376bda2b28694ffe92397a4ae5a2c270) 535 + +[SMB_COM_READ_ANDX response](#section_f52bc17049be41dabfcf5e3019a2307e) 540 + +[SMB_COM_READ_MPX response](#section_e192577705db470084f588f1ba9b96f4) 537 + +[SMB_COM_READ_RAW response](#section_e3fc8016c3da4350a0c1b82a8ab4ec6f) 537 + +[SMB_COM_SEARCH response](#section_461ac2873bb74030af644a6817a3e4fa) 541 + +[SMB_COM_SEEK response](#section_b8ea8b4b6ab24b0a9df78feea3e5aed5) 536 + +[SMB_COM_SESSION_SETUP_ANDX response](#section_ab69487980ac423ead5c3a603c01f9aa) 533 + +[SMB_COM_TRANSACTION response](#section_e79afde3dab1410383e5a13ee4b0f1f1) 539 + +[SMB_COM_TRANSACTION subcommand response](#section_da202ae1e4034674956086f58eda106c) 543 + +[SMB_COM_TRANSACTION2 response](#section_0402a2b0004147d890d68c72856cdefa) 541 + +[SMB_COM_TRANSACTION2 subcommand response](#section_127b3aca7f884ae9a9657123af4c71eb) 544 + +[SMB_COM_TREE_CONNECT response](#section_c7cb45aaf9234cd4a9d54a1418e41d42) 534 + +[SMB_COM_TREE_CONNECT_ANDX response](#section_c7cb45aaf9234cd4a9d54a1418e41d42) 534 + +[SMB_COM_TREE_DISCONNECT response](#section_9d0f2c9d78904673b454a7417f44de87) 541 + +[SMB_COM_WRITE response](#section_f844d4eb596d4f29afbd0d7abf09283f) 535 + +[SMB_COM_WRITE_AND_CLOSE response](#section_67df9e32dbb04485897c75d66ceb41fb) 539 + +[SMB_COM_WRITE_AND_UNLOCK response](#section_65e57a22cc0a4079ad57ea9b49e43e0e) 536 + +[SMB_COM_WRITE_ANDX response](#section_ab8d951681494052ac26efa9a585580f) 540 + +[SMB_COM_WRITE_MPX response](#section_2dc811a7539d4970b143393d4786bb7e) 538 + +[SMB_COM_WRITE_RAW response](#section_59a776d36ea44d7c967c5d1981c9edb9) 538 + +[STATUS_PATH_NOT_COVERED](#section_77604f5421434c20b51d9b1c45ae9f3d) 547 + +[overview](#section_097195ea1dc74275937d9e68aeb9012f) 474 + +RPC + +abstract data model + +[global](#section_213329362ceb4b869692ebf8ed1fbe40) 474 + +overview ([section 3.1.1](#section_5523379590774c93b2b314510438b9d2) 474, [section 3.4.1](#section_a03dc25a693d4c7c966e55d7afbe2257) 627) + +higher-layer triggered events + +[DFS referrals - querying](#section_0544586d6c084df687ef52db1b639f22) 631 + +[extended DFS referral capability - querying](#section_a62af4a6b640445a808b1e98c8332742) 633 + +named pipe + +[closing](#section_d1aec2af930c4c93a81c50e6d9debc32) 630 + +[opening](#section_4b0b077a46f040a6ad13b5488d3720d0) 627 + +[reading](#section_37f68581a73c4f2ba8fb6bfb474522b4) 629 + +[transaction - issuing](#section_e871eae631cf4c888d23eef701c6f0af) 630 + +[writing](#section_9ac2fb524c284733a70516b58886c81f) 629 + +[sending any message](#section_68c3d17ae48e4eb4b97e3246bfe0262f) 474 + +session + +[initiating](#section_3c90e44ecc2e4bf599828e3ec7a850db) 631 + +[key - authenticated context](#section_41aaaefab36649c895e8feaaaf8524e0) 631 + +[terminating](#section_6f357e8739e54d8daff905a0fa0405ce) 631 + +[share connection - requesting](#section_6d776ad6fd9940b586553fcef6cb7a02) 632 + +[tree disconnect - requesting](#section_06cdaae72df14ee0a6d70824a8812106) 633 + +initialization ([section 3.1.3](#section_1e7f29da8e484f73ba9b7266709f22d8) 474, [section 3.4.3](#section_23b86d3cbc55457db3ac4fb3a205c958) 627) + +local events ([section 3.1.7](#section_7ad63bf7b4a24eb5b9c331029007014f) 477, [section 3.4.7](#section_e3d11e4f09314ec28b64a106015b6d69) 633) + +message processing + +[algorithms for challenge/response authentication](#section_4d1a2cb00951462a8582121fd1afe28e) 476 + +[overview](#section_a76898c1feaa4f719ddd2d59b9f0b49a) 633 + +[receiving any message](#section_35839d070f694d20af2f2c45aa7522b3) 475 + +[overview](#section_2f7f0b0746464fda804660015f5f8063) 626 + +sequencing rules + +[algorithms for challenge/response authentication](#section_4d1a2cb00951462a8582121fd1afe28e) 476 + +[overview](#section_a76898c1feaa4f719ddd2d59b9f0b49a) 633 + +[receiving any message](#section_35839d070f694d20af2f2c45aa7522b3) 475 + +timer events ([section 3.1.6](#section_94a9134e9d5a47ae955f40872f4c8ff2) 477, [section 3.4.6](#section_24eda5c10ee84494ad7efe28a21d5953) 633) + +timers ([section 3.1.2](#section_4dcae91fb3914318b8de3b5285bbb242) 474, [section 3.4.2](#section_bec484ce9cc340a4b261060b9814233a) 627) + +sequencing rules + +[algorithms for challenge/response authentication](#section_4d1a2cb00951462a8582121fd1afe28e) 476 + +OpLock + +[break notification](#section_4b44b6339447458382557e32942bfc86) 547 + +[grant](#section_11e0cb3291244de09c9bb92d2d24be9a) 546 + +receiving any message ([section 3.1.5.1](#section_35839d070f694d20af2f2c45aa7522b3) 475, [section 3.2.5.1](#section_4702ded4cd2f4d2187c97664fb637e5d) 530) + +[SMB_COM_CLOSE response](#section_1915525f27fc430d844f00f18021f512) 535 + +[SMB_COM_CREATE response](#section_bea6eee9ce6b472f95b1cd2a8c52e7ba) 535 + +[SMB_COM_CREATE_NEW response](#section_7e585519b04548509fb80033b0824e5c) 536 + +[SMB_COM_CREATE_TEMPORARY response](#section_e51fd50aba0d49b1b01412b78eee3749) 536 + +[SMB_COM_ECHO response](#section_595b064024854c828809f939b59e2257) 539 + +[SMB_COM_FIND response](#section_461ac2873bb74030af644a6817a3e4fa) 541 + +[SMB_COM_FIND_CLOSE2 response](#section_95bbc586f8c54d928e95b86e9b36f49b) 541 + +[SMB_COM_FIND_UNIQUE response](#section_4af7a8e8da6541028abe474e9b6a36dd) 542 + +[SMB_COM_IOCTL response](#section_3844da42590242b68250533bdf8c4afb) 539 + +[SMB_COM_LOCK_AND_READ response](#section_a16136c122df4c8894a153daedd44816) 536 + +[SMB_COM_LOGOFF_ANDX response](#section_00fc0299496c4330908967358994f272) 541 + +[SMB_COM_NEGOTIATE response](#section_8ab141119b414edeac94dbea557451c6) 532 + +[SMB_COM_NT_CREATE_ANDX response](#section_455b35b11f384f9baa5d3882a8f1a351) 542 + +[SMB_COM_NT_TRANSACT response](#section_9b2d904777df442ab7e37c264fd22e4a) 542 + +[SMB_COM_NT_TRANSACT subcommand response](#section_71acb4f2760c4047939264c542209ad3) 546 + +[SMB_COM_OPEN response](#section_78b0ced13d09497992a16aad6910ccc4) 534 + +[SMB_COM_OPEN_ANDX response](#section_be71cad6f42b4a4c8ceb9c6b0913e631) 539 + +[SMB_COM_OPEN_PRINT_FILE response](#section_330fde8506544b1da836459911c5df89) 542 + +[SMB_COM_QUERY_INFORMATION response](#section_a1d582e4f38f4dcd9a4bdcc4e5b66d54) 535 + +[SMB_COM_QUERY_INFORMATION_DISK response](#section_6c1b5aa0f68e4a678d324b33cd09ec19) 541 + +[SMB_COM_QUERY_INFORMATION2 response](#section_afcddca01b5b43c5945d94bb11f91996) 539 + +[SMB_COM_READ response](#section_376bda2b28694ffe92397a4ae5a2c270) 535 + +[SMB_COM_READ_ANDX response](#section_f52bc17049be41dabfcf5e3019a2307e) 540 + +[SMB_COM_READ_MPX response](#section_e192577705db470084f588f1ba9b96f4) 537 + +[SMB_COM_READ_RAW response](#section_e3fc8016c3da4350a0c1b82a8ab4ec6f) 537 + +[SMB_COM_SEARCH response](#section_461ac2873bb74030af644a6817a3e4fa) 541 + +[SMB_COM_SEEK response](#section_b8ea8b4b6ab24b0a9df78feea3e5aed5) 536 + +[SMB_COM_SESSION_SETUP_ANDX response](#section_ab69487980ac423ead5c3a603c01f9aa) 533 + +[SMB_COM_TRANSACTION response](#section_e79afde3dab1410383e5a13ee4b0f1f1) 539 + +[SMB_COM_TRANSACTION subcommand response](#section_da202ae1e4034674956086f58eda106c) 543 + +[SMB_COM_TRANSACTION2 response](#section_0402a2b0004147d890d68c72856cdefa) 541 + +[SMB_COM_TRANSACTION2 subcommand response](#section_127b3aca7f884ae9a9657123af4c71eb) 544 + +[SMB_COM_TREE_CONNECT response](#section_c7cb45aaf9234cd4a9d54a1418e41d42) 534 + +[SMB_COM_TREE_CONNECT_ANDX response](#section_c7cb45aaf9234cd4a9d54a1418e41d42) 534 + +[SMB_COM_TREE_DISCONNECT response](#section_9d0f2c9d78904673b454a7417f44de87) 541 + +[SMB_COM_WRITE response](#section_f844d4eb596d4f29afbd0d7abf09283f) 535 + +[SMB_COM_WRITE_AND_CLOSE response](#section_67df9e32dbb04485897c75d66ceb41fb) 539 + +[SMB_COM_WRITE_AND_UNLOCK response](#section_65e57a22cc0a4079ad57ea9b49e43e0e) 536 + +[SMB_COM_WRITE_ANDX response](#section_ab8d951681494052ac26efa9a585580f) 540 + +[SMB_COM_WRITE_MPX response](#section_2dc811a7539d4970b143393d4786bb7e) 538 + +[SMB_COM_WRITE_RAW response](#section_59a776d36ea44d7c967c5d1981c9edb9) 538 + +[STATUS_PATH_NOT_COVERED](#section_77604f5421434c20b51d9b1c45ae9f3d) 547 + +timer events + +[overview](#section_94a9134e9d5a47ae955f40872f4c8ff2) 477 + +[request expiration](#section_048f3f3f243f46cd99c2e2e2853a6cb4) 548 + +timers + +[idle connection](#section_01688aa7038d484991ff3b55781a7253) 557 + +[OpLock break acknowledgment](#section_acb45ee235ad43b5ad6864cc65e927f3) 557 + +[overview](#section_4dcae91fb3914318b8de3b5285bbb242) 474 + +[request expiration](#section_e81016e6ef9146b0bd19cf959eb7cc31) 482 + +[unused open search](#section_6a35f88585474d9e9c88f7d36cabe3e4) 557 + +Codes + +[command - SMB_COM](#section_32b5d4b7d90b483fad6a003fd110f0ec) 54 + +[data buffer format](#section_9189a82fc1c04af9818c85050f7e5e66) 77 + +[information level](#section_03c10ab9d7234368b9a6c72de3244c77) 64 + +[SMB error classes](#section_8f11e0f3d54546cc97e6f00569e3e1bc) 67 + +[subcommand - transaction](#section_14937ad838af4c749604ddb8470d0ed9) 61 + +[Command codes - SMB_COM](#section_32b5d4b7d90b483fad6a003fd110f0ec) 54 + +Commands - SMB + +[SMB_COM_CHECK_DIRECTORY (0x10)](#section_6a989d5130bf4ceba46e7ae1cee6b516) 145 + +[SMB_COM_CLOSE (0x04)](#section_10059dd2ae0a48a2a95ca92505e9145f) 102 + +[SMB_COM_CLOSE_AND_TREE_DISC (0x31)](#section_3b4c6712d77c48ed90d8653956601ecd) 252 + +[SMB_COM_CLOSE_PRINT_FILE (0xC2)](#section_c4993aeed13b4a6e87bdefdaf7506906) 363 + +[SMB_COM_COPY (0x29)](#section_14b0f5c56fa84e1a9a597556206bcd56) 221 + +[SMB_COM_CREATE (0x03)](#section_87622f4337584bf9b1fb35109f0e5c15) 97 + +[SMB_COM_CREATE_DIRECTORY (0x00)](#section_e6e870ad70374b79ac544a42a1ba4561) 85 + +[SMB_COM_CREATE_NEW (0x0F)](#section_161fa213ba9d4bad948329e8b5872dca) 141 + +[SMB_COM_CREATE_TEMPORARY (0x0E)](#section_6ea3a4b22a9b4749a4a441efebdf4015) 137 + +[SMB_COM_DELETE (0x06)](#section_e455faa4d99643a587eb9993b0ceb896) 107 + +[SMB_COM_DELETE_DIRECTORY (0x01)](#section_0bca354c42d946b7a0aed8c6870242ca) 88 + +[SMB_COM_ECHO (0x2B)](#section_8c85435267c647f7a60da6c87b6b3aac) 221 + +[SMB_COM_FIND (0x82)](#section_5df45d03d4e94dfd850f639363b8dffd) 310 + +[SMB_COM_FIND_CLOSE (0x84)](#section_3ffcd296c7cc43938ab06c902a928eec) 321 + +[SMB_COM_FIND_CLOSE2 (0x34)](#section_31cdb10b8c1b4ee99ad23221c3941760) 264 + +[SMB_COM_FIND_NOTIFY_CLOSE (0x35)](#section_98e3f3b8adf74dfaa63391c19f0b83b0) 266 + +[SMB_COM_FIND_UNIQUE (0x83)](#section_828fff83d37b4deb811824c950dca87a) 316 + +[SMB_COM_FLUSH (0x05)](#section_32acdf03011d4e93b169a787f21dc13d) 104 + +[SMB_COM_GET_PRINT_QUEUE (0xC3)](#section_8aaa6b27b1444cd69171102217b1406d) 365 + +[SMB_COM_INVALID (0xFE)](#section_56cd8dd298cb4ef7a0885c53905e0fc0) 365 + +[SMB_COM_IOCTL (0x27)](#section_0d8f5f1716af499da192a5fd85fbb7e1) 213 + +[SMB_COM_IOCTL_SECONDARY (0x28)](#section_3a5f8e4716e6484d93466c4cbdc22dec) 220 + +[SMB_COM_LOCK_AND_READ (0x13)](#section_88a423e782324b22904dd9e6cc0a226e) 153 + +[SMB_COM_LOCK_BYTE_RANGE (0x0C)](#section_21f7b95a56c6482d80d6881ec0e6db69) 130 + +[SMB_COM_LOCKING_ANDX (0x24)](#section_df492170a2e840d1b7d5eb29364047e1) 192 + +[SMB_COM_LOGOFF_ANDX (0x74)](#section_53800b5cf0c64b9cbaeb1ad6b08ecb6b) 290 + +[SMB_COM_MOVE (0x2A)](#section_817ee280ffc9443db9f3475c4c02a4f1) 221 + +[SMB_COM_NEGOTIATE (0x72)](#section_96ccc2bd67ba463abb73fd6a9265199e) 272 + +[SMB_COM_NEW_FILE_SIZE (0x30)](#section_e3b0e8eca0f348d792b925715e5ec6c8) 251 + +[SMB_COM_NO_ANDX_COMMAND (0xFF)](#section_10921e06804f4b5a92a51cc562f43068) 366 + +[SMB_COM_NT_CANCEL (0xA4)](#section_bf04c12be5ee41079b760e5ffda9cc3f) 351 + +[SMB_COM_NT_CREATE_ANDX (0xA2)](#section_d3f83a7e493b4d29b21c55768b93e144) 338 + +[SMB_COM_NT_RENAME (0xA5)](#section_014a414742064ab2a167b58a4d11f1a7) 353 + +[SMB_COM_NT_TRANSACT (0xA0)](#section_55db04d6105f45d184ac6972c0a1ddc8) 325 + +[SMB_COM_NT_TRANSACT_SECONDARY (0xA1)](#section_0941c749cbf34c1b91b2b013a7473827) 334 + +[SMB_COM_OPEN (0x02)](#section_ec064de86538401e8c73b37231c36f2b) 91 + +[SMB_COM_OPEN_ANDX (0x2D)](#section_49a0f97dc4a748a3bf5046d816825729) 229 + +[SMB_COM_OPEN_PRINT_FILE (0xC0)](#section_4cce0e9fab2740f797cc6f12b4a9afef) 356 + +[SMB_COM_PROCESS_EXIT (0x11)](#section_233f62a6f565478db9b82b58ff347547) 147 + +[SMB_COM_QUERY_INFORMATION (0x08)](#section_d36b4a5cdf1b4255aa5bac6ef5c2fb7c) 113 + +[SMB_COM_QUERY_INFORMATION_DISK (0x80)](#section_c5b02889bcf44ad19bd7014614179107) 300 + +[SMB_COM_QUERY_INFORMATION2 (0x23)](#section_33ebe09e4c9d4adcb23b40e4348c704f) 188 + +[SMB_COM_QUERY_SERVER (0x21)](#section_d7ad4160575846859f680e6c531982a2) 185 + +[SMB_COM_READ (0x0A)](#section_b88922ddb18e46e09f7408eaace9a95c) 120 + +[SMB_COM_READ_ANDX (0x2E)](#section_129aa093574b483ea55ddf334606a622) 238 + +[SMB_COM_READ_BULK (0xD8)](#section_c5d7c2d74c994bd8b4efa756f09e114a) 365 + +[SMB_COM_READ_MPX (0x1B)](#section_9688c7181f3543f280c530d8a59ac305) 166 + +[SMB_COM_READ_MPX_SECONDARY (0x1C)](#section_f0c06fcc62384119be52e3e9606d209b) 171 + +[SMB_COM_READ_RAW (0x1A)](#section_a8c3a184272c4168bbb2dcc621c503a0) 163 + +[SMB_COM_RENAME (0x07)](#section_d78c549c9ab84d92bbbc6843bed943f6) 109 + +[SMB_COM_SEARCH (0x81)](#section_d33e84721356406d88edbd9fc10b060b) 303 + +[SMB_COM_SECURITY_PACKAGE_ANDX (0x7E)](#section_adb39707dd584d278aa07a98c04cff42) 300 + +[SMB_COM_SEEK (0x12)](#section_80846ca98b50418385c601c4e586227e) 149 + +[SMB_COM_SESSION_SETUP_ANDX (0x73)](#section_d902407ce73b46f58f9ea2de2b6085a2) 280 + +[SMB_COM_SET_INFORMATION (0x09)](#section_e3cd0acdaa844fbf8c9d3e7d3bb3fd52) 117 + +[SMB_COM_SET_INFORMATION2 (0x22)](#section_cfcda87d76344902a137c60a1f4a5ae5) 185 + +[SMB_COM_TRANSACTION (0x25)](#section_0ed1ad9fab964a7ab94a0915f3796781) 200 + +[SMB_COM_TRANSACTION_SECONDARY (0x26)](#section_a4c643871dc445fbb01f9ad8b69e83e1) 210 + +[SMB_COM_TRANSACTION2 (0x32)](#section_3d9d8f3edc70410da3fc6f4a881e8cab) 252 + +[SMB_COM_TRANSACTION2_SECONDARY (0x33)](#section_80207e036cd64bbe863fdb52f4d2cb1a) 261 + +[SMB_COM_TREE_CONNECT (0x70)](#section_4a6fc9eade6d484da59b3ba68a6d760c) 266 + +[SMB_COM_TREE_CONNECT_ANDX (0x75)](#section_a105173ad8544950be283d3240529ec3) 293 + +[SMB_COM_TREE_DISCONNECT (0x71)](#section_31cc172a80844f0baad6d8d69da76a0e) 270 + +[SMB_COM_UNLOCK_BYTE_RANGE (0x0D)](#section_3cfce68297d8499b8a2cef000f5d6b26) 133 + +[SMB_COM_WRITE (0x0B)](#section_5f3ebf6a5d0643ee9429c8cc1b58eef5) 125 + +[SMB_COM_WRITE_AND_CLOSE (0x2C)](#section_029b038c4d4b42fc8c5199eb23055e9c) 224 + +[SMB_COM_WRITE_AND_UNLOCK (0x14)](#section_5006049ae39b4dac83f20ec64c731c9c) 158 + +[SMB_COM_WRITE_ANDX (0x2F)](#section_81aec3770ff44fc4bc568f05b70c3e42) 244 + +[SMB_COM_WRITE_BULK (0xD9)](#section_a5baa1040ad040889d96848aa59aef3b) 365 + +[SMB_COM_WRITE_BULK_DATA (0xDA)](#section_0cc4166580d549aaaf4e6fff0ed1820f) 365 + +[SMB_COM_WRITE_COMPLETE (0x20)](#section_1e82640ccd3149ee972984b30ee1132c) 185 + +[SMB_COM_WRITE_MPX (0x1E)](#section_ab9a94409c2249fd859e2fd81c57e9d9) 179 + +[SMB_COM_WRITE_MPX_SECONDARY (0x1F)](#section_d07bc94a9da843f787779e9033891ef7) 185 + +[SMB_COM_WRITE_PRINT_FILE (0xC1)](#section_1b14601f89a54e21b2ac0bf1d2374957) 360 + +[SMB_COM_WRITE_RAW (0x1D)](#section_5feebf73e3b34bbda4497aea0a4cf87e) 172 + +[Common data types](#section_8d0ae1fbb2814e0394451d99bdc783f3) 41 + +[Common Data Types message](#section_8d0ae1fbb2814e0394451d99bdc783f3) 41 + +Copy file + +[from share example](#section_7b067a415f3e401085bd4b3cb6e474c2) 642 + +[to share example](#section_102bd261c45e45a2b343cee88faf4abe) 643 + +D + +[Data buffer format codes](#section_9189a82fc1c04af9818c85050f7e5e66) 77 + +Data model - abstract + +[client](#section_f2b6ee5514dc428cb2a335c8d8fea576) 477 + +global ([section 3.1.1.1](#section_213329362ceb4b869692ebf8ed1fbe40) 474, [section 3.2.1.1](#section_4a242e20b3ca426b8727c04e0cfbbd5a) 477) + +overview ([section 3.1.1](#section_5523379590774c93b2b314510438b9d2) 474, [section 3.2.1](#section_f2b6ee5514dc428cb2a335c8d8fea576) 477) + +RPC + +[global](#section_213329362ceb4b869692ebf8ed1fbe40) 474 + +overview ([section 3.1.1](#section_5523379590774c93b2b314510438b9d2) 474, [section 3.4.1](#section_a03dc25a693d4c7c966e55d7afbe2257) 627) + +SMB + +[connection](#section_0b33fdf6ea2e4f6298c952adf88796f8) 479 + +[session](#section_c42729fbc655424f8d9a44825d609b86) 481 + +[tree connect](#section_c3ddee8909f742049ccd842802a6bd8d) 481 + +unique + +[open](#section_9b04bf6b664e41d5aec17ddc7c92d9ff) 481 + +[open search](#section_19172733fcff46c19ef6fe95d0cfd159) 482 + +[server](#section_872714487679438a8a0d3514bf3ca69b) 549 + +global ([section 3.1.1.1](#section_213329362ceb4b869692ebf8ed1fbe40) 474, [section 3.3.1.1](#section_2b4f1d5c442a4ed4a4518a986351c5a9) 549) + +overview ([section 3.1.1](#section_5523379590774c93b2b314510438b9d2) 474, [section 3.3.1](#section_872714487679438a8a0d3514bf3ca69b) 549) + +RPC + +[global](#section_213329362ceb4b869692ebf8ed1fbe40) 474 + +overview ([section 3.1.1](#section_5523379590774c93b2b314510438b9d2) 474, [section 3.5.1](#section_fcabdf6bfc904c0bb52b324e109f930a) 634) + +[share](#section_bc0e0b5e43af467a81eda2b55647640f) 551 + +SMB + +[command - pending](#section_6047c1ae579a4d2db93257fdc1d2958b) 554 + +[connection](#section_592b9143f8594ece82442353c78a04cb) 552 + +[session](#section_c553f7d7534549a7b95cb8fb53db07a2) 555 + +[tree connect](#section_e1fcf7bc13ae4c889ed7efe1ad0a67a0) 555 + +unique + +[open](#section_738e3f3cabff439bbd4f0fe36aee1ce8) 556 + +[open search](#section_adf55b16671b42ec97935e863b30fc54) 556 + +Data types + +[character sequences](#section_d13dd8de250442549f81e351fc5baacd) 42 + +[common - overview](#section_8d0ae1fbb2814e0394451d99bdc783f3) 41 + +[file attributes](#section_3502eb5ed0e4433c852abb82844a4058) 43 + +[SMB_ERROR](#section_d3b37beca9da460c89b08a8e83e93534) 50 + +[SMB_NMPIPE_STATUS](#section_6911a7095dfb4ffbb0903e8ef872f85c) 48 + +[time](#section_80aa10e5b2e44e5a885bb77e54f61363) 49 + +[unique identifiers](#section_39a29276cadf41d3b5f174facea48607) 51 + +[DAY](#section_31b65222417149b4aeed7d3f38ecf68b) 50 + +[Direct hosting](#section_4a059c679d204ee1a6b72ec2bc7db74a) 35 + +[Direct IPX](#section_f33a2e37706347ffaeb428de05c9857e) 35 + +[Disconnect example](#section_32a2618d78f543da9b87c78b09e23dca) 636 + +E + +[Error classes and codes - SMB](#section_8f11e0f3d54546cc97e6f00569e3e1bc) 67 + +Events + +local + +client + +[handling transport disconnect](#section_fb0ae8852794480e8b7a897ee33d46ea) 548 + +[overview](#section_7ad63bf7b4a24eb5b9c331029007014f) 477 + +RPC ([section 3.1.7](#section_7ad63bf7b4a24eb5b9c331029007014f) 477, [section 3.4.7](#section_e3d11e4f09314ec28b64a106015b6d69) 633) + +server + +[disconnecting connection](#section_a363f0bcb07e485f953e16fa5efd1715) 626 + +handling + +[incoming transport connection](#section_009cdc251f3c40198c03588cd57d8d2c) 626 + +[transport disconnect](#section_c7de49528f774c9a8ad1411925af4a13) 626 + +[overview](#section_7ad63bf7b4a24eb5b9c331029007014f) 477 + +RPC ([section 3.1.7](#section_7ad63bf7b4a24eb5b9c331029007014f) 477, [section 3.5.7](#section_fd6357dd919e4df7b767484ceba85670) 635) + +timer + +client + +[overview](#section_94a9134e9d5a47ae955f40872f4c8ff2) 477 + +[request expiration](#section_048f3f3f243f46cd99c2e2e2853a6cb4) 548 + +RPC ([section 3.1.6](#section_94a9134e9d5a47ae955f40872f4c8ff2) 477, [section 3.4.6](#section_24eda5c10ee84494ad7efe28a21d5953) 633) + +server + +[idle connection](#section_12c4ac69d10b44acb70687352f9755f1) 625 + +[OpLock break acknowledgment](#section_4b7ee4832be04373979dea82fc90ee64) 625 + +[overview](#section_94a9134e9d5a47ae955f40872f4c8ff2) 477 + +RPC ([section 3.1.6](#section_94a9134e9d5a47ae955f40872f4c8ff2) 477, [section 3.5.6](#section_529c6289c71246878aad39813eed7de7) 635) + +[unused open search](#section_bd252eff54fe4e86acc4128325e3f891) 626 + +Examples + +copy file + +[from share](#section_7b067a415f3e401085bd4b3cb6e474c2) 642 + +[to share](#section_102bd261c45e45a2b343cee88faf4abe) 643 + +[disconnect](#section_32a2618d78f543da9b87c78b09e23dca) 636 + +[get file attributes](#section_0025b3baaa0546ca81dea4b234e6d4f5) 639 + +[message signing](#section_d1cb421685f94c119abb7d26880dfac6) 637 + +[negotiate and tree connect](#section_7b32d717682640258b78211171f3c65e) 636 + +[overview](#section_39fafddf9698449fabd9fc56e909bbbd) 636 + +[set file attributes](#section_7e1b8bfd1dfa401d8227169d45e59c4f) 640 + +F + +[Fields - vendor extensible](#section_3babab5101b845aaab8bbd4044d8ee79) 32 + +[Fields - vendor-extensible](#section_3babab5101b845aaab8bbd4044d8ee79) 32 + +[File attributes data type](#section_3502eb5ed0e4433c852abb82844a4058) 43 + +[Final_Server_Response packet](#section_f767334e77244f41b5df31b56d3b4328) 176 + +G + +[Get file attributes example](#section_0025b3baaa0546ca81dea4b234e6d4f5) 639 + +[Glossary](#section_760f8b7f9a8a4f0ca0441501a83a933b) 17 + +H + +Higher-layer triggered events + +client + +[cryptographic session key - querying](#section_18d8396c245648d7b338c99e05001012) 529 + +device + +[reading](#section_18c7441d4b024f738b3e13b78396a1e4) 508 + +[writing](#section_13ec5da367744618a4a0709002cda9dc) 512 + +DFS + +[querying referrals](#section_68f4963e657a4400b4504f5c144fb29e) 529 + +[subsystem active](#section_b43ac9a496294974a189fcdbedfad21a) 529 + +directory + +[contents change notification](#section_e76cc07beff448dfb03b227f8e5e3941) 527 + +[creating](#section_839f343a00eb40acbe2cbda8dc06d11d) 495 + +[deleting](#section_e41fbdab7aaf405da368ac99d0733ff9) 496 + +[enumeration](#section_fbfa3470766841aeaed03e2f08a2d3a6) 523 + +[verifying path](#section_79e3f2310df542e8a063000750098e4c) 520 + +file + +attributes + +[querying](#section_e70273837f8e45a18e7f81604dedd759) 505 + +[setting](#section_c43492ca1d6b4bb98a2c982b9c547815) 506 + +[byte-range lock](#section_0a200d604cfb47fdb15d6c55fc155a6f) 518 + +[byte-range lock - release](#section_0c6eb3ee74a64907b02304daca274cf1) 519 + +[closing](#section_5afb8ecf09a14bd49ab67d86890914d6) 502 + +[create or overwrite](#section_ed665df4858c4ad0b65012bdf79e7da6) 500 + +[creating a hard link](#section_36e5c360fab64557b18ad2b68bbcb84e) 504 + +[deleting](#section_10abe589ae044bb7aeb9814ed81e4cec) 503 + +[flushing data](#section_5d05af7582d8437db084a9c4dafb711b) 502 + +[opening an existing](#section_66435b844e2242ffb4e15ff7b07de138) 496 + +[opportunistic lock](#section_388621802e684a56985a5da4c5b7d0b5) 520 + +[print](#section_65f21277dec34bfa9d7291db9e608dc8) 525 + +[reading](#section_18c7441d4b024f738b3e13b78396a1e4) 508 + +[renaming](#section_180d43e85c2c427f93153b0632d6f32b) 503 + +[seek to a location](#section_033340bfb2a9458592d2b232a82358d6) 521 + +[sending IOCTL](#section_bec8c29eec9a456eb90ed90c07e5c7fc) 521 + +[system attributes - querying](#section_825e9d38ac5c4a6db5e34600e1749d31) 522 + +[writing](#section_13ec5da367744618a4a0709002cda9dc) 512 + +named pipe + +[exchange (call)](#section_eb7675050c85419e8eaadf01500ac5f7) 526 + +[executing a transaction](#section_0e868b83c198491cae21ab5b353ad5d1) 526 + +[peeking at data](#section_25b60122a69347078a14c22b2b919491) 526 + +querying + +[handle state](#section_eba89c166c1e485fa029987f4b70caf5) 525 + +[information](#section_03dbe090791e489e970d59e751eced86) 526 + +reading ([section 3.2.4.14](#section_18c7441d4b024f738b3e13b78396a1e4) 508, [section 3.2.4.37](#section_9fef605a943143289a00f4599a691745) 527) + +[setting state](#section_9fd144a554004a3482497b51a07bea10) 525 + +[waiting for availability](#section_ee6ea352bf2a4be29d7acbf7648f3c15) 526 + +writing ([section 3.2.4.15](#section_13ec5da367744618a4a0709002cda9dc) 512, [section 3.2.4.38](#section_40ec464830534b0586bbe2418b12eba0) 527) + +[named RAP transaction](#section_46fa86910d3b4a4e91c04657250d7514) 528 + +[number of opens on tree connect](#section_dd4363b135d043578d096efe08ea0ab9) 529 + +[operations - canceling pending](#section_54301b60971f42a4b6c1d70dd06a8a45) 524 + +[process exit notification](#section_c099c3f16eb74a60a7fa31d5fc93c329) 521 + +RPC + +[DFS referrals - querying](#section_0544586d6c084df687ef52db1b639f22) 631 + +[extended DFS referral capability - querying](#section_a62af4a6b640445a808b1e98c8332742) 633 + +named pipe + +[closing](#section_d1aec2af930c4c93a81c50e6d9debc32) 630 + +[opening](#section_4b0b077a46f040a6ad13b5488d3720d0) 627 + +[reading](#section_37f68581a73c4f2ba8fb6bfb474522b4) 629 + +[transaction - issuing](#section_e871eae631cf4c888d23eef701c6f0af) 630 + +[writing](#section_9ac2fb524c284733a70516b58886c81f) 629 + +[sending any message](#section_68c3d17ae48e4eb4b97e3246bfe0262f) 474 + +session + +[initiating](#section_3c90e44ecc2e4bf599828e3ec7a850db) 631 + +[key - authenticated context](#section_41aaaefab36649c895e8feaaaf8524e0) 631 + +[terminating](#section_6f357e8739e54d8daff905a0fa0405ce) 631 + +[share connection - requesting](#section_6d776ad6fd9940b586553fcef6cb7a02) 632 + +[tree disconnect - requesting](#section_06cdaae72df14ee0a6d70824a8812106) 633 + +security descriptors + +[querying](#section_baa7103e084242c88faeee37015fa717) 528 + +[setting](#section_136a67e9bfb645e8a176a31ea23f819b) 528 + +sending any message ([section 3.1.4.1](#section_68c3d17ae48e4eb4b97e3246bfe0262f) 474, [section 3.2.4.1](#section_87ad25ebedcb48dda230ba0d852fbfbd) 483) + +[share - connecting](#section_96d90ccb9f7f47159d21987b93304f74) 490 + +[SMB session logoff](#section_c23c7dfd8d7f46f593be17e05e333904) 522 + +[transport layer connection - testing](#section_2c2b8e1fa42746dab9b6902c4e8902d2) 522 + +[tree disconnect (unmount share)](#section_cbce4d659c874d7ea121730932263936) 522 + +server + +client session + +[security context](#section_c0c86a311e3b4e6f8f4bd4006461d093) 561 + +[session key](#section_c1401b93b1884a3b9b9851507e0e1cc9) 561 + +[configuration - updating](#section_0b3352fbbdcb4c0abec1b8243dedec73) 566 + +DFS subsystem + +[active](#section_1430eeb382ce47deb4bbfefd88a537fb) 560 + +[DFS share](#section_c91e1469a4a745a9be5e0bdbdbb37189) 560 + +[not a DFS share](#section_318afa4ee14b4c4b9c51c532f4d954e8) 560 + +[disabling](#section_4bdd9f19402d4eaea0a38b2434ac46d3) 565 + +[enabling](#section_c4ee4c5e36644a59ad01d8a654580cad) 565 + +open + +[closing](#section_9800e30c24fe4abb998eed309a489841) 563 + +[querying](#section_ad0c8f3f6d3e4db18ca8c50976e87d2e) 564 + +[OpLock break](#section_b50b9ddaf3744427a93edf9c55c043a6) 559 + +[pausing](#section_419790b2de6b45cabc23502f4ace19c7) 566 + +[resuming](#section_c1dd60f17cf643e4988e6b9bdb9d52e0) 566 + +RPC + +named pipe + +[closing its open](#section_f989e5beb56649fe8317fb9115d276b3) 635 + +[waiting for clients to open](#section_f07dfaffa8624747a5a59c7c0ef8a686) 634 + +[security context](#section_6ee34ae044564d7a8227c01f2fec05ab) 635 + +[sending any message](#section_68c3d17ae48e4eb4b97e3246bfe0262f) 474 + +[session key](#section_09662fd247fa41458d145468bffd9df7) 635 + +sending any message ([section 3.1.4.1](#section_68c3d17ae48e4eb4b97e3246bfe0262f) 474, [section 3.3.4.1](#section_391c8ce60b83497f9706f7cec50dd697) 558) + +session + +[closing](#section_5b526bffbfdb45aba4bff80a8917980b) 561 + +[querying](#section_55355166f9ce4fba9f31983e1ae6bb7f) 563 + +share + +[deregistering](#section_7c96c13de5de4326a9c7aae97250a66a) 562 + +[querying](#section_c51938394cd54f958adadf13584251ce) 563 + +[registering](#section_644bbaa18e9e4634b1e4e8e508e3f861) 561 + +[updating](#section_5f810fc9fc2a49dc8f8ab772e016ea66) 562 + +[statistics](#section_0542a8a782f44dcea162bcff82e03705) 566 + +[transport binding change](#section_a0a15b401d974912aa0348f78e46a85e) 565 + +[TreeConnect - querying](#section_91c2672f36044cc78b6e934ef847d6cc) 564 + +[HOUR](#section_401749d1ee4142739dcb698180e68745) 50 + +I + +[Implementer - security considerations](#section_8eba9f9ae5984196bc7d664ee9c4e49a) 644 + +[Index of security parameters](#section_d7fd4a96040d410ebed37536a1e93449) 644 + +Information level + +[codes](#section_03c10ab9d7234368b9a6c72de3244c77) 64 + +[overview](#section_2bcf1801eb0d422a9b6d43a6e33fb446) 452 + +[Information Levels message](#section_2bcf1801eb0d422a9b6d43a6e33fb446) 452 + +[Informative references](#section_df8b96df11144bb69d8cab129d23daaa) 24 + +Initialization + +[client](#section_2067fd35c8b84cb9a5dc404743069bc6) 482 + +overview ([section 3.1.3](#section_1e7f29da8e484f73ba9b7266709f22d8) 474, [section 3.2.3](#section_2067fd35c8b84cb9a5dc404743069bc6) 482) + +RPC ([section 3.1.3](#section_1e7f29da8e484f73ba9b7266709f22d8) 474, [section 3.4.3](#section_23b86d3cbc55457db3ac4fb3a205c958) 627) + +[server](#section_0f8cfca1fdd8422d9f42b4bc2ae45173) 557 + +overview ([section 3.1.3](#section_1e7f29da8e484f73ba9b7266709f22d8) 474, [section 3.3.3](#section_0f8cfca1fdd8422d9f42b4bc2ae45173) 557) + +RPC ([section 3.1.3](#section_1e7f29da8e484f73ba9b7266709f22d8) 474, [section 3.5.3](#section_7c2a37c2405948c9b3c507cbc098876d) 634) + +[Interim_Server_Response packet](#section_d115b1d2149242aab37f222bfe272fbd) 175 + +[Introduction](#section_934c2faa54af4526ac746a24d126724e) 17 + +L + +Local events + +client + +[handling transport disconnect](#section_fb0ae8852794480e8b7a897ee33d46ea) 548 + +[overview](#section_7ad63bf7b4a24eb5b9c331029007014f) 477 + +RPC ([section 3.1.7](#section_7ad63bf7b4a24eb5b9c331029007014f) 477, [section 3.4.7](#section_e3d11e4f09314ec28b64a106015b6d69) 633) + +server + +[disconnecting connection](#section_a363f0bcb07e485f953e16fa5efd1715) 626 + +handling + +[incoming transport connection](#section_009cdc251f3c40198c03588cd57d8d2c) 626 + +[transport disconnect](#section_c7de49528f774c9a8ad1411925af4a13) 626 + +[overview](#section_7ad63bf7b4a24eb5b9c331029007014f) 477 + +RPC ([section 3.1.7](#section_7ad63bf7b4a24eb5b9c331029007014f) 477, [section 3.5.7](#section_fd6357dd919e4df7b767484ceba85670) 635) + +M + +Message processing + +client + +[algorithms for challenge/response authentication](#section_4d1a2cb00951462a8582121fd1afe28e) 476 + +OpLock + +[break notification](#section_4b44b6339447458382557e32942bfc86) 547 + +[grant](#section_11e0cb3291244de09c9bb92d2d24be9a) 546 + +receiving any message ([section 3.1.5.1](#section_35839d070f694d20af2f2c45aa7522b3) 475, [section 3.2.5.1](#section_4702ded4cd2f4d2187c97664fb637e5d) 530) + +RPC + +[algorithms for challenge/response authentication](#section_4d1a2cb00951462a8582121fd1afe28e) 476 + +[overview](#section_a76898c1feaa4f719ddd2d59b9f0b49a) 633 + +[receiving any message](#section_35839d070f694d20af2f2c45aa7522b3) 475 + +[SMB_COM_CLOSE response](#section_1915525f27fc430d844f00f18021f512) 535 + +[SMB_COM_CREATE response](#section_bea6eee9ce6b472f95b1cd2a8c52e7ba) 535 + +[SMB_COM_CREATE_NEW response](#section_7e585519b04548509fb80033b0824e5c) 536 + +[SMB_COM_CREATE_TEMPORARY response](#section_e51fd50aba0d49b1b01412b78eee3749) 536 + +[SMB_COM_ECHO response](#section_595b064024854c828809f939b59e2257) 539 + +[SMB_COM_FIND response](#section_461ac2873bb74030af644a6817a3e4fa) 541 + +[SMB_COM_FIND_CLOSE2 response](#section_95bbc586f8c54d928e95b86e9b36f49b) 541 + +[SMB_COM_FIND_UNIQUE response](#section_4af7a8e8da6541028abe474e9b6a36dd) 542 + +[SMB_COM_IOCTL response](#section_3844da42590242b68250533bdf8c4afb) 539 + +[SMB_COM_LOCK_AND_READ response](#section_a16136c122df4c8894a153daedd44816) 536 + +[SMB_COM_LOGOFF_ANDX response](#section_00fc0299496c4330908967358994f272) 541 + +[SMB_COM_NEGOTIATE response](#section_8ab141119b414edeac94dbea557451c6) 532 + +[SMB_COM_NT_CREATE_ANDX response](#section_455b35b11f384f9baa5d3882a8f1a351) 542 + +[SMB_COM_NT_TRANSACT response](#section_9b2d904777df442ab7e37c264fd22e4a) 542 + +[SMB_COM_NT_TRANSACT subcommand response](#section_71acb4f2760c4047939264c542209ad3) 546 + +[SMB_COM_OPEN response](#section_78b0ced13d09497992a16aad6910ccc4) 534 + +[SMB_COM_OPEN_ANDX response](#section_be71cad6f42b4a4c8ceb9c6b0913e631) 539 + +[SMB_COM_OPEN_PRINT_FILE response](#section_330fde8506544b1da836459911c5df89) 542 + +[SMB_COM_QUERY_INFORMATION response](#section_a1d582e4f38f4dcd9a4bdcc4e5b66d54) 535 + +[SMB_COM_QUERY_INFORMATION_DISK response](#section_6c1b5aa0f68e4a678d324b33cd09ec19) 541 + +[SMB_COM_QUERY_INFORMATION2 response](#section_afcddca01b5b43c5945d94bb11f91996) 539 + +[SMB_COM_READ response](#section_376bda2b28694ffe92397a4ae5a2c270) 535 + +[SMB_COM_READ_ANDX response](#section_f52bc17049be41dabfcf5e3019a2307e) 540 + +[SMB_COM_READ_MPX response](#section_e192577705db470084f588f1ba9b96f4) 537 + +[SMB_COM_READ_RAW response](#section_e3fc8016c3da4350a0c1b82a8ab4ec6f) 537 + +[SMB_COM_SEARCH response](#section_461ac2873bb74030af644a6817a3e4fa) 541 + +[SMB_COM_SEEK response](#section_b8ea8b4b6ab24b0a9df78feea3e5aed5) 536 + +[SMB_COM_SESSION_SETUP_ANDX response](#section_ab69487980ac423ead5c3a603c01f9aa) 533 + +[SMB_COM_TRANSACTION response](#section_e79afde3dab1410383e5a13ee4b0f1f1) 539 + +[SMB_COM_TRANSACTION subcommand response](#section_da202ae1e4034674956086f58eda106c) 543 + +[SMB_COM_TRANSACTION2 response](#section_0402a2b0004147d890d68c72856cdefa) 541 + +[SMB_COM_TRANSACTION2 subcommand response](#section_127b3aca7f884ae9a9657123af4c71eb) 544 + +[SMB_COM_TREE_CONNECT response](#section_c7cb45aaf9234cd4a9d54a1418e41d42) 534 + +[SMB_COM_TREE_CONNECT_ANDX response](#section_c7cb45aaf9234cd4a9d54a1418e41d42) 534 + +[SMB_COM_TREE_DISCONNECT response](#section_9d0f2c9d78904673b454a7417f44de87) 541 + +[SMB_COM_WRITE response](#section_f844d4eb596d4f29afbd0d7abf09283f) 535 + +[SMB_COM_WRITE_AND_CLOSE response](#section_67df9e32dbb04485897c75d66ceb41fb) 539 + +[SMB_COM_WRITE_AND_UNLOCK response](#section_65e57a22cc0a4079ad57ea9b49e43e0e) 536 + +[SMB_COM_WRITE_ANDX response](#section_ab8d951681494052ac26efa9a585580f) 540 + +[SMB_COM_WRITE_MPX response](#section_2dc811a7539d4970b143393d4786bb7e) 538 + +[SMB_COM_WRITE_RAW response](#section_59a776d36ea44d7c967c5d1981c9edb9) 538 + +[STATUS_PATH_NOT_COVERED](#section_77604f5421434c20b51d9b1c45ae9f3d) 547 + +server + +[algorithms for challenge/response authentication](#section_4d1a2cb00951462a8582121fd1afe28e) 476 + +[incoming connection](#section_aa0fa406f1664fafa7d98e2a897174ce) 567 + +receiving any message ([section 3.1.5.1](#section_35839d070f694d20af2f2c45aa7522b3) 475, [section 3.3.5.2](#section_b09b63d73882458b9c8ec821c706ebdf) 568) + +RPC + +[algorithms for challenge/response authentication](#section_4d1a2cb00951462a8582121fd1afe28e) 476 + +[overview](#section_19839c17948f4b79a17ecd3b10027062) 635 + +[receiving any message](#section_35839d070f694d20af2f2c45aa7522b3) 475 + +[SMB_COM_CHECK_DIRECTORY request](#section_913b94e104c54165944729ab6ddef706) 583 + +[SMB_COM_CLOSE request](#section_99b767e28f0e438bace54323940f2dc8) 575 + +[SMB_COM_CLOSE_PRINT_FILE request](#section_09d18c57b79641c9b147a1125609ccf2) 611 + +[SMB_COM_CREATE request](#section_782ed034df484e9da0696be5d906382e) 574 + +[SMB_COM_CREATE_DIRECTORY request](#section_c41845a09efc45be93983a4cc19cf34a) 572 + +[SMB_COM_CREATE_NEW request](#section_74a49aa3f96548db97ca685bbdd6a48e) 582 + +[SMB_COM_CREATE_TEMPORARY request](#section_2e1b0b27f248428ca3d276fa3e9a270a) 581 + +[SMB_COM_DELETE request](#section_fbac1bf18df64cde86b7d345c9833a2d) 576 + +[SMB_COM_DELETE_DIRECTORY request](#section_40edf254c3ad40c2a92dd9c8ee70c966) 573 + +[SMB_COM_ECHO request](#section_b3f7857524e34c58b0bbc758fd61c87f) 592 + +[SMB_COM_FIND request](#section_74dce06ec6594d40aec07edeb8ac32f9) 604 + +[SMB_COM_FIND_CLOSE request](#section_c5ffdc0966784739b343bacf2fcba831) 606 + +[SMB_COM_FIND_CLOSE2 request](#section_59604cd16a604f92a2ea849a64d89d14) 597 + +[SMB_COM_FIND_UNIQUE request](#section_73367ac5f8f34b23b8b9db37ff3605ff) 606 + +[SMB_COM_FLUSH request](#section_195439ae798a4c1ab13556b39a166427) 575 + +[SMB_COM_IOCTL request](#section_8e789e3b41054dc1bd7e5dee3d222429) 592 + +[SMB_COM_LOCK_AND_READ request](#section_20630a58dbb445859320b000c73d1ab7) 584 + +[SMB_COM_LOCK_BYTE_RANGE request](#section_e046e927ee0241b390766fe50ffb417a) 580 + +[SMB_COM_LOCKING_ANDX request](#section_709a30abb9f54745bd8e86f7212d4bc4) 590 + +[SMB_COM_LOGOFF_ANDX request](#section_ef073efe53884c178c9755a55f4274f4) 602 + +[SMB_COM_NEGOTIATE request](#section_55ecb4c66fdb459c8688b36ea1fc66e8) 599 + +[SMB_COM_NT_CANCEL request](#section_0a2324454ed64225bad85b9b6e6f8a00) 609 + +[SMB_COM_NT_CREATE_ANDX request](#section_d11800d00b444966b951b103bc252ba0) 607 + +[SMB_COM_NT_RENAME request](#section_c190a9d82a4b463c8c2b668d888bf9a8) 609 + +[SMB_COM_NT_TRANSACT request](#section_d422859bc95b48c0b9e51433617a50b5) 607 + +[SMB_COM_NT_TRANSACT subcommand request](#section_0870fb17651048bcb5b59515b00f6f3c) 621 + +[SMB_COM_OPEN request](#section_91838c728a744f758a266ae95eb6c5f5) 573 + +[SMB_COM_OPEN_ANDX request](#section_723c1f8e385b45d583f9a1ceb3a6ba6b) 593 + +[SMB_COM_OPEN_PRINT_FILE request](#section_0c7577d275a24d67af738075104fac80) 611 + +[SMB_COM_PROCESS_EXIT request](#section_bfc8ccd3132b4b4398df40bf0dd56cf1) 583 + +[SMB_COM_QUERY_INFORMATION request](#section_cfa18c9761c7422eab64cd3849864dfd) 578 + +[SMB_COM_QUERY_INFORMATION_DISK request](#section_158ccb58deb34c15b031eb140d3e6512) 604 + +[SMB_COM_QUERY_INFORMATION2 request](#section_dddf5118e1384b5c8ade23e1889d03e9) 590 + +[SMB_COM_READ request](#section_b4de39e5fda0450589e32bb0f7c4503e) 579 + +[SMB_COM_READ_ANDX request](#section_bb8fcb6a303246a1ad4ac0d7892921f9) 595 + +[SMB_COM_READ_MPX request](#section_2b03927add4b4c088fae5ad8353d951f) 586 + +[SMB_COM_READ_RAW request](#section_07e4a83801374405b5341e5eeaf16812) 585 + +[SMB_COM_RENAME request](#section_3d30e1e24a1a40de85792143f1574dab) 577 + +[SMB_COM_SEARCH request](#section_74dce06ec6594d40aec07edeb8ac32f9) 604 + +[SMB_COM_SEEK request](#section_8c6fd5861e8d4731957cc86c35755be0) 584 + +[SMB_COM_SESSION_SETUP_ANDX request](#section_905fbe981fe540e9b17a22ec8b17f7b3) 600 + +[SMB_COM_SET_INFORMATION request](#section_c0fbdf1ab24447e9bac14a89dfc93e24) 578 + +[SMB_COM_SET_INFORMATION2 request](#section_75155fd797454a1d98c780d861eddcdb) 590 + +[SMB_COM_TRANSACTION request](#section_0c79c58db9384e8e98e1cee43ecc0cd8) 592 + +[SMB_COM_TRANSACTION subcommand request](#section_421617c6f5994041a042d63ab081c354) 612 + +[SMB_COM_TRANSACTION2 request](#section_fa784f0d6ffc4fb8bb5d4c009ef4df4c) 597 + +[SMB_COM_TRANSACTION2 subcommand request](#section_f1d6e1a8e3504d25b6a72d5cfff98e5a) 617 + +[SMB_COM_TREE_CONNECT request](#section_b062f3e31b654a9a854a0ee432499d8f) 598 + +[SMB_COM_TREE_CONNECT_ANDX request](#section_602e4ab97b2a493fba11caab118fd13b) 602 + +[SMB_COM_TREE_DISCONNECT request](#section_2b0520b264614065bb978ce3427ac5d7) 599 + +[SMB_COM_UNLOCK_BYTE_RANGE request](#section_1c224ee171c94792958277e5950f1b3f) 581 + +[SMB_COM_WRITE request](#section_8cac8066d6624e4186dc904ae3382260) 579 + +[SMB_COM_WRITE_AND_CLOSE request](#section_6e66fe751be4423497550ffb8da32dd1) 592 + +[SMB_COM_WRITE_AND_UNLOCK request](#section_5bf60f58836b40fdbffbe9604f9a5c36) 585 + +[SMB_COM_WRITE_ANDX request](#section_936a467857004161acde02e379669cf4) 596 + +[SMB_COM_WRITE_MPX request](#section_735a59f0197045ff83ca4a905abb5d0a) 589 + +[SMB_COM_WRITE_PRINT_FILE request](#section_080c6955be884e52bfb918ef95fff13b) 611 + +[SMB_COM_WRITE_RAW request](#section_129a1c1f587f41c0b67ceff0359389b6) 587 + +[Message signing example](#section_d1cb421685f94c119abb7d26880dfac6) 637 + +Messages + +[character sequences data type](#section_d13dd8de250442549f81e351fc5baacd) 42 + +[Common Data Types](#section_8d0ae1fbb2814e0394451d99bdc783f3) 41 + +[data buffer format codes](#section_9189a82fc1c04af9818c85050f7e5e66) 77 + +[file attributes data type](#section_3502eb5ed0e4433c852abb82844a4058) 43 + +information level + +[codes](#section_03c10ab9d7234368b9a6c72de3244c77) 64 + +[overview](#section_2bcf1801eb0d422a9b6d43a6e33fb446) 452 + +[Information Levels](#section_2bcf1801eb0d422a9b6d43a6e33fb446) 452 + +NT Transact subcommands + +[NT_TRANSACT_CREATE (0x0001)](#section_f85bb6cf2d3949c9bfe5307ad57d5da5) 428 + +[NT_TRANSACT_IOCTL (0x0002)](#section_26a843f52fee43ea889100a31cb5d854) 440 + +[NT_TRANSACT_NOTIFY_CHANGE (0x0004)](#section_2a65e0f460e041ef8184ae9bc2430316) 446 + +[NT_TRANSACT_QUERY_SECURITY_DESC (0x0006)](#section_a4cb863952e14115b2f10c3b179a0479) 449 + +[NT_TRANSACT_RENAME (0x0005)](#section_95b5e7287ff14e53a9f266f031d86b4c) 449 + +[NT_TRANSACT_SET_SECURITY_DESC (0x0003)](#section_ee4287977c94413fa19ee2176f66501d) 443 + +SMB + +commands + +[SMB_COM_CHECK_DIRECTORY (0x10)](#section_6a989d5130bf4ceba46e7ae1cee6b516) 145 + +[SMB_COM_CLOSE (0x04)](#section_10059dd2ae0a48a2a95ca92505e9145f) 102 + +[SMB_COM_CLOSE_AND_TREE_DISC (0x31)](#section_3b4c6712d77c48ed90d8653956601ecd) 252 + +[SMB_COM_CLOSE_PRINT_FILE (0xC2)](#section_c4993aeed13b4a6e87bdefdaf7506906) 363 + +[SMB_COM_COPY (0x29)](#section_14b0f5c56fa84e1a9a597556206bcd56) 221 + +[SMB_COM_CREATE (0x03)](#section_87622f4337584bf9b1fb35109f0e5c15) 97 + +[SMB_COM_CREATE_DIRECTORY (0x00)](#section_e6e870ad70374b79ac544a42a1ba4561) 85 + +[SMB_COM_CREATE_NEW (0x0F)](#section_161fa213ba9d4bad948329e8b5872dca) 141 + +[SMB_COM_CREATE_TEMPORARY (0x0E)](#section_6ea3a4b22a9b4749a4a441efebdf4015) 137 + +[SMB_COM_DELETE (0x06)](#section_e455faa4d99643a587eb9993b0ceb896) 107 + +[SMB_COM_DELETE_DIRECTORY (0x01)](#section_0bca354c42d946b7a0aed8c6870242ca) 88 + +[SMB_COM_ECHO (0x2B)](#section_8c85435267c647f7a60da6c87b6b3aac) 221 + +[SMB_COM_FIND (0x82)](#section_5df45d03d4e94dfd850f639363b8dffd) 310 + +[SMB_COM_FIND_CLOSE (0x84)](#section_3ffcd296c7cc43938ab06c902a928eec) 321 + +[SMB_COM_FIND_CLOSE2 (0x34)](#section_31cdb10b8c1b4ee99ad23221c3941760) 264 + +[SMB_COM_FIND_NOTIFY_CLOSE (0x35)](#section_98e3f3b8adf74dfaa63391c19f0b83b0) 266 + +[SMB_COM_FIND_UNIQUE (0x83)](#section_828fff83d37b4deb811824c950dca87a) 316 + +[SMB_COM_FLUSH (0x05)](#section_32acdf03011d4e93b169a787f21dc13d) 104 + +[SMB_COM_GET_PRINT_QUEUE (0xC3)](#section_8aaa6b27b1444cd69171102217b1406d) 365 + +[SMB_COM_INVALID (0xFE)](#section_56cd8dd298cb4ef7a0885c53905e0fc0) 365 + +[SMB_COM_IOCTL (0x27)](#section_0d8f5f1716af499da192a5fd85fbb7e1) 213 + +[SMB_COM_IOCTL_SECONDARY (0x28)](#section_3a5f8e4716e6484d93466c4cbdc22dec) 220 + +[SMB_COM_LOCK_AND_READ (0x13)](#section_88a423e782324b22904dd9e6cc0a226e) 153 + +[SMB_COM_LOCK_BYTE_RANGE (0x0C)](#section_21f7b95a56c6482d80d6881ec0e6db69) 130 + +[SMB_COM_LOCKING_ANDX (0x24)](#section_df492170a2e840d1b7d5eb29364047e1) 192 + +[SMB_COM_LOGOFF_ANDX (0x74)](#section_53800b5cf0c64b9cbaeb1ad6b08ecb6b) 290 + +[SMB_COM_MOVE (0x2A)](#section_817ee280ffc9443db9f3475c4c02a4f1) 221 + +[SMB_COM_NEGOTIATE (0x72)](#section_96ccc2bd67ba463abb73fd6a9265199e) 272 + +[SMB_COM_NEW_FILE_SIZE (0x30)](#section_e3b0e8eca0f348d792b925715e5ec6c8) 251 + +[SMB_COM_NO_ANDX_COMMAND (0xFF)](#section_10921e06804f4b5a92a51cc562f43068) 366 + +[SMB_COM_NT_CANCEL (0xA4)](#section_bf04c12be5ee41079b760e5ffda9cc3f) 351 + +[SMB_COM_NT_CREATE_ANDX (0xA2)](#section_d3f83a7e493b4d29b21c55768b93e144) 338 + +[SMB_COM_NT_RENAME (0xA5)](#section_014a414742064ab2a167b58a4d11f1a7) 353 + +[SMB_COM_NT_TRANSACT (0xA0)](#section_55db04d6105f45d184ac6972c0a1ddc8) 325 + +[SMB_COM_NT_TRANSACT_SECONDARY (0xA1)](#section_0941c749cbf34c1b91b2b013a7473827) 334 + +[SMB_COM_OPEN (0x02)](#section_ec064de86538401e8c73b37231c36f2b) 91 + +[SMB_COM_OPEN_ANDX (0x2D)](#section_49a0f97dc4a748a3bf5046d816825729) 229 + +[SMB_COM_OPEN_PRINT_FILE (0xC0)](#section_4cce0e9fab2740f797cc6f12b4a9afef) 356 + +[SMB_COM_PROCESS_EXIT (0x11)](#section_233f62a6f565478db9b82b58ff347547) 147 + +[SMB_COM_QUERY_INFORMATION (0x08)](#section_d36b4a5cdf1b4255aa5bac6ef5c2fb7c) 113 + +[SMB_COM_QUERY_INFORMATION_DISK (0x80)](#section_c5b02889bcf44ad19bd7014614179107) 300 + +[SMB_COM_QUERY_INFORMATION2 (0x23)](#section_33ebe09e4c9d4adcb23b40e4348c704f) 188 + +[SMB_COM_QUERY_SERVER (0x21)](#section_d7ad4160575846859f680e6c531982a2) 185 + +[SMB_COM_READ (0x0A)](#section_b88922ddb18e46e09f7408eaace9a95c) 120 + +[SMB_COM_READ_ANDX (0x2E)](#section_129aa093574b483ea55ddf334606a622) 238 + +[SMB_COM_READ_BULK (0xD8)](#section_c5d7c2d74c994bd8b4efa756f09e114a) 365 + +[SMB_COM_READ_MPX (0x1B)](#section_9688c7181f3543f280c530d8a59ac305) 166 + +[SMB_COM_READ_MPX_SECONDARY (0x1C)](#section_f0c06fcc62384119be52e3e9606d209b) 171 + +[SMB_COM_READ_RAW (0x1A)](#section_a8c3a184272c4168bbb2dcc621c503a0) 163 + +[SMB_COM_RENAME (0x07)](#section_d78c549c9ab84d92bbbc6843bed943f6) 109 + +[SMB_COM_SEARCH (0x81)](#section_d33e84721356406d88edbd9fc10b060b) 303 + +[SMB_COM_SECURITY_PACKAGE_ANDX (0x7E)](#section_adb39707dd584d278aa07a98c04cff42) 300 + +[SMB_COM_SEEK (0x12)](#section_80846ca98b50418385c601c4e586227e) 149 + +[SMB_COM_SESSION_SETUP_ANDX (0x73)](#section_d902407ce73b46f58f9ea2de2b6085a2) 280 + +[SMB_COM_SET_INFORMATION (0x09)](#section_e3cd0acdaa844fbf8c9d3e7d3bb3fd52) 117 + +[SMB_COM_SET_INFORMATION2 (0x22)](#section_cfcda87d76344902a137c60a1f4a5ae5) 185 + +[SMB_COM_TRANSACTION (0x25)](#section_0ed1ad9fab964a7ab94a0915f3796781) 200 + +[SMB_COM_TRANSACTION_SECONDARY (0x26)](#section_a4c643871dc445fbb01f9ad8b69e83e1) 210 + +[SMB_COM_TRANSACTION2 (0x32)](#section_3d9d8f3edc70410da3fc6f4a881e8cab) 252 + +[SMB_COM_TRANSACTION2_SECONDARY (0x33)](#section_80207e036cd64bbe863fdb52f4d2cb1a) 261 + +[SMB_COM_TREE_CONNECT (0x70)](#section_4a6fc9eade6d484da59b3ba68a6d760c) 266 + +[SMB_COM_TREE_CONNECT_ANDX (0x75)](#section_a105173ad8544950be283d3240529ec3) 293 + +[SMB_COM_TREE_DISCONNECT (0x71)](#section_31cc172a80844f0baad6d8d69da76a0e) 270 + +[SMB_COM_UNLOCK_BYTE_RANGE (0x0D)](#section_3cfce68297d8499b8a2cef000f5d6b26) 133 + +[SMB_COM_WRITE (0x0B)](#section_5f3ebf6a5d0643ee9429c8cc1b58eef5) 125 + +[SMB_COM_WRITE_AND_CLOSE (0x2C)](#section_029b038c4d4b42fc8c5199eb23055e9c) 224 + +[SMB_COM_WRITE_AND_UNLOCK (0x14)](#section_5006049ae39b4dac83f20ec64c731c9c) 158 + +[SMB_COM_WRITE_ANDX (0x2F)](#section_81aec3770ff44fc4bc568f05b70c3e42) 244 + +[SMB_COM_WRITE_BULK (0xD9)](#section_a5baa1040ad040889d96848aa59aef3b) 365 + +[SMB_COM_WRITE_BULK_DATA (0xDA)](#section_0cc4166580d549aaaf4e6fff0ed1820f) 365 + +[SMB_COM_WRITE_COMPLETE (0x20)](#section_1e82640ccd3149ee972984b30ee1132c) 185 + +[SMB_COM_WRITE_MPX (0x1E)](#section_ab9a94409c2249fd859e2fd81c57e9d9) 179 + +[SMB_COM_WRITE_MPX_SECONDARY (0x1F)](#section_d07bc94a9da843f787779e9033891ef7) 185 + +[SMB_COM_WRITE_PRINT_FILE (0xC1)](#section_1b14601f89a54e21b2ac0bf1d2374957) 360 + +[SMB_COM_WRITE_RAW (0x1D)](#section_5feebf73e3b34bbda4497aea0a4cf87e) 172 + +structure + +[batched messages ("AndX" messages)](#section_fc4d19f78040426d91547219c57453c8) 84 + +[data block](#section_48b4bd5d72064002bde1c34cf614b138) 84 + +[overview](#section_4d330f4c151c4d79b20740bd4f754da9) 78 + +[parameter block](#section_c87a9a6ee31844d385e182398f8dc9f5) 83 + +[SMB_Header](#section_69a29f73de0c45a6a1aa8ceeea42217f) 78 + +[SMB error classes and codes](#section_8f11e0f3d54546cc97e6f00569e3e1bc) 67 + +[SMB Message Structure](#section_4d330f4c151c4d79b20740bd4f754da9) 78 + +[SMB_COM command codes](#section_32b5d4b7d90b483fad6a003fd110f0ec) 54 + +[SMB_ERROR data type](#section_d3b37beca9da460c89b08a8e83e93534) 50 + +[SMB_NMPIPE_STATUS data type](#section_6911a7095dfb4ffbb0903e8ef872f85c) 48 + +[syntax](#section_089b6f3eb91d465983a73e50a1a5faf7) 39 + +[time data type](#section_80aa10e5b2e44e5a885bb77e54f61363) 49 + +[transaction subcommand codes](#section_14937ad838af4c749604ddb8470d0ed9) 61 + +[Transaction Subcommands](#section_227cb1473c094c4bb1456c94b04c8231) 366 + +[overview](#section_227cb1473c094c4bb1456c94b04c8231) 366 + +[TRANS_CALL_NMPIPE (0x0054)](#section_a600138d46b741b49d9380a3bd5096de) 393 + +[TRANS_MAILSLOT_WRITE (0x0001)](#section_be3b074f9c634869b5ef9ecb598f0591) 396 + +[TRANS_PEEK_NMPIPE (0x0023)](#section_80f114bfb3e34b82a0f517c039d70e9e) 377 + +[TRANS_QUERY_NMPIPE_INFO (0x0022)](#section_58c3b35b06834035941616c62e941203) 373 + +[TRANS_QUERY_NMPIPE_STATE (0x0021)](#section_905e248a9fc44c09aeae5cf2a6dfd015) 371 + +[TRANS_RAW_READ_NMPIPE (0x0011)](#section_cfcebfaeed1345ee9117fdc6da5a4060) 369 + +[TRANS_RAW_WRITE_NMPIPE (0x0031)](#section_84397ad8d55c4ba7933ca96f2f64167d) 383 + +[TRANS_READ_NMPIPE (0x0036)](#section_d9004cc94b844d4ca522ec559f53c1a7) 386 + +[TRANS_SET_NMPIPE_STATE (0x0001)](#section_2481644c725944b89b8bae539f7b3eb6) 366 + +[TRANS_TRANSACT_NMPIPE (0x0026)](#section_f599d0f080b148869657944f36a44138) 380 + +[TRANS_WAIT_NMPIPE (0x0053)](#section_385ce4de217048a1910053f3c4aad60d) 391 + +[TRANS_WRITE_NMPIPE (0x0037)](#section_de6ca9e1b30f426ebc072198375b1bd7) 388 + +Transaction2 subcommands + +[TRANS2_CREATE_DIRECTORY (0x000D)](#section_d77e09845be54aba9f8a8606e48ff7d0) 424 + +[TRANS2_FIND_FIRST2 (0x0001)](#section_a782468b56f14066bb6ee2630f0e8695) 402 + +[TRANS2_FIND_NEXT2 (0x0002)](#section_8f2e9ab5a6be4540a8fdf62492b34d24) 406 + +[TRANS2_FIND_NOTIFY_FIRST (0x000B)](#section_ba5cd70dff5c4ddf844162609c092e58) 423 + +[TRANS2_FIND_NOTIFY_NEXT (0x000C)](#section_0fb0df5b36fa47d984345d0a512b517a) 423 + +[TRANS2_FSCTL (0x0009)](#section_57b86f1028c245c6a3703daecf746461) 423 + +[TRANS2_GET_DFS_REFERRAL (0x0010)](#section_795a49a409894a15aa475b167fca6c7b) 427 + +[TRANS2_IOCTL2 (0x000A)](#section_94e0959682cf40b48c6112f454506643) 423 + +[TRANS2_OPEN2 (0x0000)](#section_ee2f11ca7c7e49ac9cb78b1ed1259c2c) 396 + +[TRANS2_QUERY_FILE_INFORMATION (0x0007)](#section_16c2516fc82c43b79ab732fb1109f9fe) 417 + +[TRANS2_QUERY_FS_INFORMATION (0x0003)](#section_a96c1c03cade4a4a81a9b00674d23d93) 410 + +[TRANS2_QUERY_PATH_INFORMATION (0x0005)](#section_39021262e1624948b4999dfccef77ef6) 412 + +[TRANS2_REPORT_DFS_INCONSISTENCY (0x0011)](#section_ed6cd621ec064a17ba0d4f3f2ec9eb87) 428 + +[TRANS2_SESSION_SETUP (0x000E)](#section_3dd0b2797a3b4c42af0b62a1e15acb1c) 426 + +[TRANS2_SET_FILE_INFORMATION (0x0008)](#section_cb2b7f2138774bc5adf4b78c8aa2a717) 420 + +[TRANS2_SET_FS_INFORMATION (0x0004)](#section_ac4b00db6015416a89a1bf5da2503bc3) 412 + +[TRANS2_SET_PATH_INFORMATION (0x0006)](#section_a23483d965434aaaa996e7c9506f8b94) 415 + +[transport](#section_56df901359444ccf970b67c30ef5c449) 34 + +[direct hosting](#section_4a059c679d204ee1a6b72ec2bc7db74a) 35 + +[direct IPX](#section_f33a2e37706347ffaeb428de05c9857e) 35 + +NetBIOS + +[frames](#section_b102769bbaef4fb499476e2bf218faa6) 34 + +over + +[IPX/SPX](#section_72558ac240a0407eaf6dc16e35c735b5) 35 + +[TCP/UDP](#section_45170055a0cd49109228801d5bf7ac84) 35 + +NetBIOS-based transports + +[other](#section_be8b6fa946b34af6b0fb809051c6008b) 35 + +[overview](#section_1430ebe92ad04763b14fc720338e0482) 34 + +[overview](#section_56df901359444ccf970b67c30ef5c449) 34 + +[virtual circuits](#section_402e87ee4cff49ed817b88e8ef0d13cb) 39 + +[unique identifiers data type](#section_39a29276cadf41d3b5f174facea48607) 51 + +[MINUTES](#section_401749d1ee4142739dcb698180e68745) 50 + +[MONTH](#section_31b65222417149b4aeed7d3f38ecf68b) 50 + +N + +[Negotiate and tree connect example](#section_7b32d717682640258b78211171f3c65e) 636 + +NetBIOS + +[frames](#section_b102769bbaef4fb499476e2bf218faa6) 34 + +over + +[IPX/SPX](#section_72558ac240a0407eaf6dc16e35c735b5) 35 + +[TCP/UDP](#section_45170055a0cd49109228801d5bf7ac84) 35 + +NetBIOS-based transports + +[other](#section_be8b6fa946b34af6b0fb809051c6008b) 35 + +[overview](#section_1430ebe92ad04763b14fc720338e0482) 34 + +[Normative references](#section_cd82db1996f248fea161ace8025423ad) 23 + +NT Transact subcommands + +[NT_TRANSACT_CREATE (0x0001)](#section_f85bb6cf2d3949c9bfe5307ad57d5da5) 428 + +[NT_TRANSACT_IOCTL (0x0002)](#section_26a843f52fee43ea889100a31cb5d854) 440 + +[NT_TRANSACT_NOTIFY_CHANGE (0x0004)](#section_2a65e0f460e041ef8184ae9bc2430316) 446 + +[NT_TRANSACT_QUERY_SECURITY_DESC (0x0006)](#section_a4cb863952e14115b2f10c3b179a0479) 449 + +[NT_TRANSACT_RENAME (0x0005)](#section_95b5e7287ff14e53a9f266f031d86b4c) 449 + +[NT_TRANSACT_SET_SECURITY_DESC (0x0003)](#section_ee4287977c94413fa19ee2176f66501d) 443 + +O + +[Other](#section_2198f480e0474df0ba64f28eadef00b9) 47 + +[Overview](#section_56412e46786f4909a4a1dfcb98865f91) 27 + +[Overview (synopsis)](#section_56412e46786f4909a4a1dfcb98865f91) 27 + +P + +[Parameters - security index](#section_d7fd4a96040d410ebed37536a1e93449) 644 + +[Preconditions](#section_a09a3874df174e35b84ca9c8bb34dd5e) 30 + +[Prerequisites](#section_a09a3874df174e35b84ca9c8bb34dd5e) 30 + +[Product behavior](#section_4c7317545e504a5aba8085a9a09ead3d) 645 + +R + +[References](#section_145c68a605fc4737938223dadc47b458) 23 + +[informative](#section_df8b96df11144bb69d8cab129d23daaa) 24 + +[normative](#section_cd82db1996f248fea161ace8025423ad) 23 + +[Relationship to other protocols](#section_705f300ef56d4c988d32af8155caba5d) 29 + +Request packet ([section 2.2.4.2.1](#section_f944f5bb06684cdfb6ffbec3f6ea8667) 88, [section 2.2.4.3.1](#section_ab9bb87219674088b4446a35d0af305e) 91, [section 2.2.4.4.1](#section_244621046b354fe4aeaa7c30cd727bc9) 97, [section 2.2.4.5.1](#section_eb85efbc9fd543208cd691b53ac49203) 102, [section 2.2.4.6.1](#section_e5e1e00c5ec24a5cb825f8cf2f4cda79) 104, [section 2.2.4.7.1](#section_2e57889eca5b4076a86508103b947e59) 107, [section 2.2.4.8.1](#section_c970f3bf806e43098ea96515605f450d) 109, [section 2.2.4.9.1](#section_fc708fd3b133415c9659b0acf5f596c7) 113, [section 2.2.4.10.1](#section_76577ee1eb2d4db79bed65c74a952741) 117, [section 2.2.4.11.1](#section_23704aa0e6d247628dfde8eeaacca71b) 120, [section 2.2.4.12.1](#section_861c96cfd6b14fb9b6e31783220813ad) 125, [section 2.2.4.13.1](#section_0828263608764ded82b1973edd255f87) 130, [section 2.2.4.14.1](#section_7d3d2faf84214acc885c805162028764) 134, [section 2.2.4.15.1](#section_3dae394e5c4846fc82ea4031995f903c) 137, [section 2.2.4.16.1](#section_2e4852f086724d62984842f931b91533) 141, [section 2.2.4.17.1](#section_dc566429904b4bf58158d68f2370ae68) 145, [section 2.2.4.18.1](#section_bb004a1834b647f3a1d1f1dfe441a222) 147, [section 2.2.4.19.1](#section_e9dd996cba2b474bae5d5f65c3be1251) 150, [section 2.2.4.20.1](#section_4652d923dc4e4611b17e9215d8c66f2e) 153, [section 2.2.4.21.1](#section_c03fec3fd7094e7f96b1de9760766f77) 158, [section 2.2.4.22.1](#section_1458b62a18ed4fb2b8a9ceabffb2c3b7) 163, [section 2.2.4.23.1](#section_3e066ba09fce43c785fd756e4721f7ee) 166, [section 2.2.4.25.1](#section_1ff2a25fefe2470ca780b06ef46c4089) 172, [section 2.2.4.26.1](#section_c7fa0e9f343b47df8157719a3ca9035c) 179, [section 2.2.4.30.1](#section_de521278f8004a57b5244811fe9edd8f) 185, [section 2.2.4.31.1](#section_7b86f7999dbb407893c5f9041c7f9f47) 189, [section 2.2.4.32.1](#section_b5c6eae7976b4444b52ec76c68c861ad) 193, [section 2.2.4.33.1](#section_57bfc115fe294482a0fea935757e0a4f) 200, [section 2.2.4.34.1](#section_79ece32a139d46b0ba28055f822a8c05) 210, [section 2.2.4.35.1](#section_c8f1b5b19ec149d2a0e178ee88f39e71) 214, [section 2.2.4.39.1](#section_5dd916b29c384f0cba55a2c86dd5de10) 221, [section 2.2.4.40.1](#section_995268754b5a49cc968668ab49825a65) 224, [section 2.2.4.41.1](#section_3a760987f60d4012930bfe90328775cc) 229, [section 2.2.4.42.1](#section_7e6c7cc2c3f143358263d7412f77140e) 238, [section 2.2.4.43.1](#section_a66126d2a1db446b8736b9f5559c49bd) 245, [section 2.2.4.46.1](#section_f7d148cde3d549ae8b379633822bfeac) 252, [section 2.2.4.47.1](#section_da6bf4b03a714f1f9c048426cf82b892) 261, [section 2.2.4.48.1](#section_a0ac55c1d2ed4c38b2f66d4af4490d87) 264, [section 2.2.4.50.1](#section_0036eb8174664e1cafb6ea8bc9dd19dc) 266, [section 2.2.4.51.1](#section_354844d75d3946d28e6b727fcf53e98d) 271, [section 2.2.4.52.1](#section_25c8c3c958fc4bb8aa8f0272dede84c5) 272, [section 2.2.4.53.1](#section_81e15dee8fb6410286447eaa7ded63f7) 281, [section 2.2.4.54.1](#section_efbd2ebb470f4d8abcab1eadb432305e) 290, [section 2.2.4.55.1](#section_90bf689a85364f039f1b683ee4bdd67c) 293, [section 2.2.4.57.1](#section_711abf8cb5a343e78213ef37b9f9cb00) 300, [section 2.2.4.58.1](#section_239b0def83704dc78391ee60952901b1) 303, [section 2.2.4.59.1](#section_f2890270ee43427f9e4807420a836457) 310, [section 2.2.4.60.1](#section_1120965ef21742a086f0f8285ecbc32a) 316, [section 2.2.4.61.1](#section_f62c901bc2e0412ea7dfc4f3889a2412) 321, [section 2.2.4.62.1](#section_1e62725cbb9e470499a48db520a6f2da) 326, [section 2.2.4.63.1](#section_4173c449a6e14fa9b980708a229fdb3a) 334, [section 2.2.4.64.1](#section_f2a0f032754541c99cebaab39852c11a) 338, [section 2.2.4.65.1](#section_e4f9bcfa982e43dd8db792db9aac13cc) 352, [section 2.2.4.66.1](#section_d777310edeb1490c915726456c0b0116) 353, [section 2.2.4.67.1](#section_a0199848ec124408981288a5f1c30ceb) 356, [section 2.2.4.68.1](#section_1f2768bcc9664ca9b43f857efa3b725a) 360, [section 2.2.4.69.1](#section_7712477c4dad481ba82dfa1caff56dc5) 363, [section 2.2.5.1.1](#section_4f2f5424814549ecaeeb6f477559e39b) 366, [section 2.2.5.4.1](#section_fc1b3176ad524643b5ee03aba8dec5ce) 373, [section 2.2.5.6.1](#section_7ce2407248694348af7bf66b6f7591e7) 380, [section 2.2.5.7.1](#section_5d5a4e36b7ab46a48be3cb1e5a68dc07) 383, [section 2.2.5.9.1](#section_29c50bbac4a14001b27e86d925f914d0) 388, [section 2.2.5.11.1](#section_57e182d43dd646a5911c4d714cb1865b) 393, [section 2.2.6.8.1](#section_357bf60df30a457e97879f78322b92d3) 418, [section 2.2.6.9.1](#section_194935c314c8466798633e2b35e19033) 420, [section 2.2.7.1.1](#section_42eef5ff34d74389a4e5812820475686) 428, [section 2.2.7.2.1](#section_932020a1bbb04baa8adc9c3c19e6ea67) 440, [section 2.2.7.3.1](#section_41fa05e3a01e48bfa53373b62b758a77) 443, [section 2.2.7.4.1](#section_ecf3b6004b0945d684c2d3fd8bb2e2c4) 446, [section 2.2.7.6.1](#section_6cd8638ea4f446d59e9aefa64008d3d5) 449) + +Response packet ([section 2.2.4.2.2](#section_6e183cd33f3b48a8be709dd75183da8b) 89, [section 2.2.4.3.2](#section_20829e08c77a42f3b4272ef87d3cf212) 94, [section 2.2.4.4.2](#section_c11c97aee5ea48c0aeec2d3012b440e2) 99, [section 2.2.4.5.2](#section_41884c88944947f2a98ba48d8da3b447) 103, [section 2.2.4.6.2](#section_29985252cd1a44a7966040f78b632dcc) 105, [section 2.2.4.7.2](#section_69122f4692f34c1a87e1bc137fda0861) 108, [section 2.2.4.8.2](#section_eda3174f448e44b6bfe00a2f3fc3f0f4) 111, [section 2.2.4.9.2](#section_847573c9cbe64dcba0db9b5af815759b) 114, [section 2.2.4.10.2](#section_ae244b27eeeb4d71b8843a74b1c37c03) 118, [section 2.2.4.11.2](#section_bc54fec83e8a4c05bbe911ed116d1d67) 122, [section 2.2.4.12.2](#section_3f68a73ce6d64383b81ad49c2eb4234b) 127, [section 2.2.4.13.2](#section_f18f498818da4b0786e6a92ceceb4d82) 132, [section 2.2.4.14.2](#section_620101d654224aeb8a4a7f39e0562893) 135, [section 2.2.4.15.2](#section_763af5c574bf43c6b410e48c79b08f57) 138, [section 2.2.4.16.2](#section_060b7ffa0b944cdd833a9ef3053c5931) 143, [section 2.2.4.17.2](#section_b99f80c3fbfc4f5b95d567b62244de89) 146, [section 2.2.4.18.2](#section_343fc70452db48a5b999439e134c1c9d) 148, [section 2.2.4.19.2](#section_089b214b85014bcba9bd9b2aa80b0042) 151, [section 2.2.4.20.2](#section_ac41df92de514d2d935a7eae93ae9bcc) 154, [section 2.2.4.21.2](#section_6d09be2358ea4966b1be86f27c8ea45a) 160, [section 2.2.4.23.2](#section_4511aa9b411b44f7814339f2ca6dcd5f) 168, [section 2.2.4.26.2](#section_25efbb005ad042a2886199a79c4d63fe) 182, [section 2.2.4.30.2](#section_b8fb4dc1abb54f46b6f7454152240d97) 187, [section 2.2.4.31.2](#section_eed3d7c3759e470a873110583931426f) 189, [section 2.2.4.32.2](#section_165cd91f1207419ebb62eb305ea9a67a) 197, [section 2.2.4.33.2](#section_c9303b42897841449c18a813c0033ca5) 205, [section 2.2.4.35.2](#section_27cb85fe071a41aa9068317720909892) 217, [section 2.2.4.39.2](#section_362424677c624041b60f939683cacdf2) 222, [section 2.2.4.40.2](#section_fcf13ef6ce164143a926e7cafabaeea3) 226, [section 2.2.4.41.2](#section_dbce00e768a141c6982d9483c902ad9b) 233, [section 2.2.4.42.2](#section_89d6b5525406445c85d554c80b94a20f) 240, [section 2.2.4.43.2](#section_43a10562269f4536b46017b494405cc4) 248, [section 2.2.4.46.2](#section_216e606aeee14c3fb88e0eb14dc380b2) 257, [section 2.2.4.48.2](#section_f7363dea5a984000be0ca860d125aebe) 265, [section 2.2.4.50.2](#section_f9a8a7131c534fb0908e625389840cf8) 268, [section 2.2.4.51.2](#section_7a4c41231e5d4c3f8a05dd5e49694a6d) 271, [section 2.2.4.52.2](#section_a4229e1a8a4e489aa2eb11b7f360e60c) 274, [section 2.2.4.53.2](#section_e7514918a0f649329f00ced094445537) 287, [section 2.2.4.54.2](#section_0e94351308f54e5fa5067acb1d8f1c9c) 291, [section 2.2.4.55.2](#section_3286744b5b584ad5b62ec4f29a2492f1) 297, [section 2.2.4.57.2](#section_3d5291fd33f54899b3ad949b0d4d7f93) 301, [section 2.2.4.58.2](#section_12a609ad870944929b954a402589cf56) 306, [section 2.2.4.59.2](#section_b8674ab770a24b8bbc303137b0ed4284) 312, [section 2.2.4.60.2](#section_eb2614e0ce334a7f847bbcddb97c00a6) 318, [section 2.2.4.61.2](#section_4c9f95de365b4a41b4fbfe0233b280eb) 323, [section 2.2.4.62.2](#section_dd00c8422398412fb21dbf5074a9a1c4) 330, [section 2.2.4.64.2](#section_32085986b516486cabbb0abbdf9f1909) 346, [section 2.2.4.66.2](#section_6a71ba7f66c04460ad52fe31d5a874ef) 354, [section 2.2.4.67.2](#section_fb4c1ba4426947ff8e4302f3577190db) 358, [section 2.2.4.68.2](#section_2c9b7ac33dc846249ce480306c8c6d3a) 361, [section 2.2.4.69.2](#section_220850bcb5cb45c8b3587fe8c697aab5) 364, [section 2.2.5.2.2](#section_fef0294cda8c42a0a679c8b44a57065a) 369, [section 2.2.5.3.2](#section_259877b6e0b5485e81ed97c400fc722e) 372, [section 2.2.5.4.2](#section_4a3c9d6b8c9c482ab608e16d0dfb86fb) 375, [section 2.2.5.5.2](#section_8ed256b221184a9e97e5283848f1ff9a) 378, [section 2.2.5.6.2](#section_b5bddf69094247f985a5379a7dcc2959) 381, [section 2.2.5.7.2](#section_f6b4acc781ae4de4ab14b6dec46f938f) 384, [section 2.2.5.8.2](#section_f17528d6126c4092b36ae0a5aeafa5e1) 386, [section 2.2.5.9.2](#section_cec02281cccd4bb78fe33888bd777ce9) 389, [section 2.2.5.11.2](#section_b08561068cd242f18cec3e6d3cac341c) 394, [section 2.2.6.3.2](#section_891140f445fc4a7c801df182a29ed4d1) 409, [section 2.2.6.7.2](#section_cf1cd5799687465d927408ebb5944cd3) 416, [section 2.2.6.9.2](#section_032d3f248e034bfeb3e33278ab382387) 421, [section 2.2.6.14.2](#section_3c4b6c3cb4a8411ea63832a82ffacd75) 424, [section 2.2.7.1.2](#section_ab2b6ac6161e4826885a45b4d4834f18) 435, [section 2.2.7.2.2](#section_b58fb6f4e8d048db8dd330d4214376cd) 441, [section 2.2.7.4.2](#section_258b956ce6514435b4fdfe1cfdad44b2) 448, [section 2.2.7.6.2](#section_5ea8d8dd90144d108c2e75587d78a292) 450) + +S + +[SECONDS](#section_401749d1ee4142739dcb698180e68745) 50 + +Security + +[implementer considerations](#section_8eba9f9ae5984196bc7d664ee9c4e49a) 644 + +[overview](#section_3a9b5f4e622f4e5689b939d13a2de5ea) 644 + +[parameter index](#section_d7fd4a96040d410ebed37536a1e93449) 644 + +Sequencing rules + +client + +[algorithms for challenge/response authentication](#section_4d1a2cb00951462a8582121fd1afe28e) 476 + +OpLock + +[break notification](#section_4b44b6339447458382557e32942bfc86) 547 + +[grant](#section_11e0cb3291244de09c9bb92d2d24be9a) 546 + +receiving any message ([section 3.1.5.1](#section_35839d070f694d20af2f2c45aa7522b3) 475, [section 3.2.5.1](#section_4702ded4cd2f4d2187c97664fb637e5d) 530) + +RPC + +[algorithms for challenge/response authentication](#section_4d1a2cb00951462a8582121fd1afe28e) 476 + +[overview](#section_a76898c1feaa4f719ddd2d59b9f0b49a) 633 + +[receiving any message](#section_35839d070f694d20af2f2c45aa7522b3) 475 + +[SMB_COM_CLOSE response](#section_1915525f27fc430d844f00f18021f512) 535 + +[SMB_COM_CREATE response](#section_bea6eee9ce6b472f95b1cd2a8c52e7ba) 535 + +[SMB_COM_CREATE_NEW response](#section_7e585519b04548509fb80033b0824e5c) 536 + +[SMB_COM_CREATE_TEMPORARY response](#section_e51fd50aba0d49b1b01412b78eee3749) 536 + +[SMB_COM_ECHO response](#section_595b064024854c828809f939b59e2257) 539 + +[SMB_COM_FIND response](#section_461ac2873bb74030af644a6817a3e4fa) 541 + +[SMB_COM_FIND_CLOSE2 response](#section_95bbc586f8c54d928e95b86e9b36f49b) 541 + +[SMB_COM_FIND_UNIQUE response](#section_4af7a8e8da6541028abe474e9b6a36dd) 542 + +[SMB_COM_IOCTL response](#section_3844da42590242b68250533bdf8c4afb) 539 + +[SMB_COM_LOCK_AND_READ response](#section_a16136c122df4c8894a153daedd44816) 536 + +[SMB_COM_LOGOFF_ANDX response](#section_00fc0299496c4330908967358994f272) 541 + +[SMB_COM_NEGOTIATE response](#section_8ab141119b414edeac94dbea557451c6) 532 + +[SMB_COM_NT_CREATE_ANDX response](#section_455b35b11f384f9baa5d3882a8f1a351) 542 + +[SMB_COM_NT_TRANSACT response](#section_9b2d904777df442ab7e37c264fd22e4a) 542 + +[SMB_COM_NT_TRANSACT subcommand response](#section_71acb4f2760c4047939264c542209ad3) 546 + +[SMB_COM_OPEN response](#section_78b0ced13d09497992a16aad6910ccc4) 534 + +[SMB_COM_OPEN_ANDX response](#section_be71cad6f42b4a4c8ceb9c6b0913e631) 539 + +[SMB_COM_OPEN_PRINT_FILE response](#section_330fde8506544b1da836459911c5df89) 542 + +[SMB_COM_QUERY_INFORMATION response](#section_a1d582e4f38f4dcd9a4bdcc4e5b66d54) 535 + +[SMB_COM_QUERY_INFORMATION_DISK response](#section_6c1b5aa0f68e4a678d324b33cd09ec19) 541 + +[SMB_COM_QUERY_INFORMATION2 response](#section_afcddca01b5b43c5945d94bb11f91996) 539 + +[SMB_COM_READ response](#section_376bda2b28694ffe92397a4ae5a2c270) 535 + +[SMB_COM_READ_ANDX response](#section_f52bc17049be41dabfcf5e3019a2307e) 540 + +[SMB_COM_READ_MPX response](#section_e192577705db470084f588f1ba9b96f4) 537 + +[SMB_COM_READ_RAW response](#section_e3fc8016c3da4350a0c1b82a8ab4ec6f) 537 + +[SMB_COM_SEARCH response](#section_461ac2873bb74030af644a6817a3e4fa) 541 + +[SMB_COM_SEEK response](#section_b8ea8b4b6ab24b0a9df78feea3e5aed5) 536 + +[SMB_COM_SESSION_SETUP_ANDX response](#section_ab69487980ac423ead5c3a603c01f9aa) 533 + +[SMB_COM_TRANSACTION response](#section_e79afde3dab1410383e5a13ee4b0f1f1) 539 + +[SMB_COM_TRANSACTION subcommand response](#section_da202ae1e4034674956086f58eda106c) 543 + +[SMB_COM_TRANSACTION2 response](#section_0402a2b0004147d890d68c72856cdefa) 541 + +[SMB_COM_TRANSACTION2 subcommand response](#section_127b3aca7f884ae9a9657123af4c71eb) 544 + +[SMB_COM_TREE_CONNECT response](#section_c7cb45aaf9234cd4a9d54a1418e41d42) 534 + +[SMB_COM_TREE_CONNECT_ANDX response](#section_c7cb45aaf9234cd4a9d54a1418e41d42) 534 + +[SMB_COM_TREE_DISCONNECT response](#section_9d0f2c9d78904673b454a7417f44de87) 541 + +[SMB_COM_WRITE response](#section_f844d4eb596d4f29afbd0d7abf09283f) 535 + +[SMB_COM_WRITE_AND_CLOSE response](#section_67df9e32dbb04485897c75d66ceb41fb) 539 + +[SMB_COM_WRITE_AND_UNLOCK response](#section_65e57a22cc0a4079ad57ea9b49e43e0e) 536 + +[SMB_COM_WRITE_ANDX response](#section_ab8d951681494052ac26efa9a585580f) 540 + +[SMB_COM_WRITE_MPX response](#section_2dc811a7539d4970b143393d4786bb7e) 538 + +[SMB_COM_WRITE_RAW response](#section_59a776d36ea44d7c967c5d1981c9edb9) 538 + +[STATUS_PATH_NOT_COVERED](#section_77604f5421434c20b51d9b1c45ae9f3d) 547 + +server + +[algorithms for challenge/response authentication](#section_4d1a2cb00951462a8582121fd1afe28e) 476 + +[incoming connection](#section_aa0fa406f1664fafa7d98e2a897174ce) 567 + +receiving any message ([section 3.1.5.1](#section_35839d070f694d20af2f2c45aa7522b3) 475, [section 3.3.5.2](#section_b09b63d73882458b9c8ec821c706ebdf) 568) + +RPC + +[algorithms for challenge/response authentication](#section_4d1a2cb00951462a8582121fd1afe28e) 476 + +[overview](#section_19839c17948f4b79a17ecd3b10027062) 635 + +[receiving any message](#section_35839d070f694d20af2f2c45aa7522b3) 475 + +[SMB_COM_CHECK_DIRECTORY request](#section_913b94e104c54165944729ab6ddef706) 583 + +[SMB_COM_CLOSE request](#section_99b767e28f0e438bace54323940f2dc8) 575 + +[SMB_COM_CLOSE_PRINT_FILE request](#section_09d18c57b79641c9b147a1125609ccf2) 611 + +[SMB_COM_CREATE request](#section_782ed034df484e9da0696be5d906382e) 574 + +[SMB_COM_CREATE_DIRECTORY request](#section_c41845a09efc45be93983a4cc19cf34a) 572 + +[SMB_COM_CREATE_NEW request](#section_74a49aa3f96548db97ca685bbdd6a48e) 582 + +[SMB_COM_CREATE_TEMPORARY request](#section_2e1b0b27f248428ca3d276fa3e9a270a) 581 + +[SMB_COM_DELETE request](#section_fbac1bf18df64cde86b7d345c9833a2d) 576 + +[SMB_COM_DELETE_DIRECTORY request](#section_40edf254c3ad40c2a92dd9c8ee70c966) 573 + +[SMB_COM_ECHO request](#section_b3f7857524e34c58b0bbc758fd61c87f) 592 + +[SMB_COM_FIND request](#section_74dce06ec6594d40aec07edeb8ac32f9) 604 + +[SMB_COM_FIND_CLOSE request](#section_c5ffdc0966784739b343bacf2fcba831) 606 + +[SMB_COM_FIND_CLOSE2 request](#section_59604cd16a604f92a2ea849a64d89d14) 597 + +[SMB_COM_FIND_UNIQUE request](#section_73367ac5f8f34b23b8b9db37ff3605ff) 606 + +[SMB_COM_FLUSH request](#section_195439ae798a4c1ab13556b39a166427) 575 + +[SMB_COM_IOCTL request](#section_8e789e3b41054dc1bd7e5dee3d222429) 592 + +[SMB_COM_LOCK_AND_READ request](#section_20630a58dbb445859320b000c73d1ab7) 584 + +[SMB_COM_LOCK_BYTE_RANGE request](#section_e046e927ee0241b390766fe50ffb417a) 580 + +[SMB_COM_LOCKING_ANDX request](#section_709a30abb9f54745bd8e86f7212d4bc4) 590 + +[SMB_COM_LOGOFF_ANDX request](#section_ef073efe53884c178c9755a55f4274f4) 602 + +[SMB_COM_NEGOTIATE request](#section_55ecb4c66fdb459c8688b36ea1fc66e8) 599 + +[SMB_COM_NT_CANCEL request](#section_0a2324454ed64225bad85b9b6e6f8a00) 609 + +[SMB_COM_NT_CREATE_ANDX request](#section_d11800d00b444966b951b103bc252ba0) 607 + +[SMB_COM_NT_RENAME request](#section_c190a9d82a4b463c8c2b668d888bf9a8) 609 + +[SMB_COM_NT_TRANSACT request](#section_d422859bc95b48c0b9e51433617a50b5) 607 + +[SMB_COM_NT_TRANSACT subcommand request](#section_0870fb17651048bcb5b59515b00f6f3c) 621 + +[SMB_COM_OPEN request](#section_91838c728a744f758a266ae95eb6c5f5) 573 + +[SMB_COM_OPEN_ANDX request](#section_723c1f8e385b45d583f9a1ceb3a6ba6b) 593 + +[SMB_COM_OPEN_PRINT_FILE request](#section_0c7577d275a24d67af738075104fac80) 611 + +[SMB_COM_PROCESS_EXIT request](#section_bfc8ccd3132b4b4398df40bf0dd56cf1) 583 + +[SMB_COM_QUERY_INFORMATION request](#section_cfa18c9761c7422eab64cd3849864dfd) 578 + +[SMB_COM_QUERY_INFORMATION_DISK request](#section_158ccb58deb34c15b031eb140d3e6512) 604 + +[SMB_COM_QUERY_INFORMATION2 request](#section_dddf5118e1384b5c8ade23e1889d03e9) 590 + +[SMB_COM_READ request](#section_b4de39e5fda0450589e32bb0f7c4503e) 579 + +[SMB_COM_READ_ANDX request](#section_bb8fcb6a303246a1ad4ac0d7892921f9) 595 + +[SMB_COM_READ_MPX request](#section_2b03927add4b4c088fae5ad8353d951f) 586 + +[SMB_COM_READ_RAW request](#section_07e4a83801374405b5341e5eeaf16812) 585 + +[SMB_COM_RENAME request](#section_3d30e1e24a1a40de85792143f1574dab) 577 + +[SMB_COM_SEARCH request](#section_74dce06ec6594d40aec07edeb8ac32f9) 604 + +[SMB_COM_SEEK request](#section_8c6fd5861e8d4731957cc86c35755be0) 584 + +[SMB_COM_SESSION_SETUP_ANDX request](#section_905fbe981fe540e9b17a22ec8b17f7b3) 600 + +[SMB_COM_SET_INFORMATION request](#section_c0fbdf1ab24447e9bac14a89dfc93e24) 578 + +[SMB_COM_SET_INFORMATION2 request](#section_75155fd797454a1d98c780d861eddcdb) 590 + +[SMB_COM_TRANSACTION request](#section_0c79c58db9384e8e98e1cee43ecc0cd8) 592 + +[SMB_COM_TRANSACTION subcommand request](#section_421617c6f5994041a042d63ab081c354) 612 + +[SMB_COM_TRANSACTION2 request](#section_fa784f0d6ffc4fb8bb5d4c009ef4df4c) 597 + +[SMB_COM_TRANSACTION2 subcommand request](#section_f1d6e1a8e3504d25b6a72d5cfff98e5a) 617 + +[SMB_COM_TREE_CONNECT request](#section_b062f3e31b654a9a854a0ee432499d8f) 598 + +[SMB_COM_TREE_CONNECT_ANDX request](#section_602e4ab97b2a493fba11caab118fd13b) 602 + +[SMB_COM_TREE_DISCONNECT request](#section_2b0520b264614065bb978ce3427ac5d7) 599 + +[SMB_COM_UNLOCK_BYTE_RANGE request](#section_1c224ee171c94792958277e5950f1b3f) 581 + +[SMB_COM_WRITE request](#section_8cac8066d6624e4186dc904ae3382260) 579 + +[SMB_COM_WRITE_AND_CLOSE request](#section_6e66fe751be4423497550ffb8da32dd1) 592 + +[SMB_COM_WRITE_AND_UNLOCK request](#section_5bf60f58836b40fdbffbe9604f9a5c36) 585 + +[SMB_COM_WRITE_ANDX request](#section_936a467857004161acde02e379669cf4) 596 + +[SMB_COM_WRITE_MPX request](#section_735a59f0197045ff83ca4a905abb5d0a) 589 + +[SMB_COM_WRITE_PRINT_FILE request](#section_080c6955be884e52bfb918ef95fff13b) 611 + +[SMB_COM_WRITE_RAW request](#section_129a1c1f587f41c0b67ceff0359389b6) 587 + +Server + +[abstract data model](#section_872714487679438a8a0d3514bf3ca69b) 549 + +global ([section 3.1.1.1](#section_213329362ceb4b869692ebf8ed1fbe40) 474, [section 3.3.1.1](#section_2b4f1d5c442a4ed4a4518a986351c5a9) 549) + +overview ([section 3.1.1](#section_5523379590774c93b2b314510438b9d2) 474, [section 3.3.1](#section_872714487679438a8a0d3514bf3ca69b) 549) + +[share](#section_bc0e0b5e43af467a81eda2b55647640f) 551 + +SMB + +[command - pending](#section_6047c1ae579a4d2db93257fdc1d2958b) 554 + +[connection](#section_592b9143f8594ece82442353c78a04cb) 552 + +[session](#section_c553f7d7534549a7b95cb8fb53db07a2) 555 + +[tree connect](#section_e1fcf7bc13ae4c889ed7efe1ad0a67a0) 555 + +unique + +[open](#section_738e3f3cabff439bbd4f0fe36aee1ce8) 556 + +[open search](#section_adf55b16671b42ec97935e863b30fc54) 556 + +higher-layer triggered events + +client session + +[security context](#section_c0c86a311e3b4e6f8f4bd4006461d093) 561 + +[session key](#section_c1401b93b1884a3b9b9851507e0e1cc9) 561 + +[configuration - updating](#section_0b3352fbbdcb4c0abec1b8243dedec73) 566 + +DFS subsystem + +[active](#section_1430eeb382ce47deb4bbfefd88a537fb) 560 + +[DFS share](#section_c91e1469a4a745a9be5e0bdbdbb37189) 560 + +[not a DFS share](#section_318afa4ee14b4c4b9c51c532f4d954e8) 560 + +[disabling](#section_4bdd9f19402d4eaea0a38b2434ac46d3) 565 + +[enabling](#section_c4ee4c5e36644a59ad01d8a654580cad) 565 + +open + +[closing](#section_9800e30c24fe4abb998eed309a489841) 563 + +[querying](#section_ad0c8f3f6d3e4db18ca8c50976e87d2e) 564 + +[OpLock break](#section_b50b9ddaf3744427a93edf9c55c043a6) 559 + +[pausing](#section_419790b2de6b45cabc23502f4ace19c7) 566 + +[resuming](#section_c1dd60f17cf643e4988e6b9bdb9d52e0) 566 + +sending any message ([section 3.1.4.1](#section_68c3d17ae48e4eb4b97e3246bfe0262f) 474, [section 3.3.4.1](#section_391c8ce60b83497f9706f7cec50dd697) 558) + +session + +[closing](#section_5b526bffbfdb45aba4bff80a8917980b) 561 + +[querying](#section_55355166f9ce4fba9f31983e1ae6bb7f) 563 + +share + +[deregistering](#section_7c96c13de5de4326a9c7aae97250a66a) 562 + +[querying](#section_c51938394cd54f958adadf13584251ce) 563 + +[registering](#section_644bbaa18e9e4634b1e4e8e508e3f861) 561 + +[updating](#section_5f810fc9fc2a49dc8f8ab772e016ea66) 562 + +[statistics](#section_0542a8a782f44dcea162bcff82e03705) 566 + +[transport binding change](#section_a0a15b401d974912aa0348f78e46a85e) 565 + +[TreeConnect - querying](#section_91c2672f36044cc78b6e934ef847d6cc) 564 + +initialization ([section 3.1.3](#section_1e7f29da8e484f73ba9b7266709f22d8) 474, [section 3.3.3](#section_0f8cfca1fdd8422d9f42b4bc2ae45173) 557) + +local events + +[disconnecting connection](#section_a363f0bcb07e485f953e16fa5efd1715) 626 + +handling + +[incoming transport connection](#section_009cdc251f3c40198c03588cd57d8d2c) 626 + +[transport disconnect](#section_c7de49528f774c9a8ad1411925af4a13) 626 + +[overview](#section_7ad63bf7b4a24eb5b9c331029007014f) 477 + +message processing + +[algorithms for challenge/response authentication](#section_4d1a2cb00951462a8582121fd1afe28e) 476 + +[incoming connection](#section_aa0fa406f1664fafa7d98e2a897174ce) 567 + +receiving any message ([section 3.1.5.1](#section_35839d070f694d20af2f2c45aa7522b3) 475, [section 3.3.5.2](#section_b09b63d73882458b9c8ec821c706ebdf) 568) + +[SMB_COM_CHECK_DIRECTORY request](#section_913b94e104c54165944729ab6ddef706) 583 + +[SMB_COM_CLOSE request](#section_99b767e28f0e438bace54323940f2dc8) 575 + +[SMB_COM_CLOSE_PRINT_FILE request](#section_09d18c57b79641c9b147a1125609ccf2) 611 + +[SMB_COM_CREATE request](#section_782ed034df484e9da0696be5d906382e) 574 + +[SMB_COM_CREATE_DIRECTORY request](#section_c41845a09efc45be93983a4cc19cf34a) 572 + +[SMB_COM_CREATE_NEW request](#section_74a49aa3f96548db97ca685bbdd6a48e) 582 + +[SMB_COM_CREATE_TEMPORARY request](#section_2e1b0b27f248428ca3d276fa3e9a270a) 581 + +[SMB_COM_DELETE request](#section_fbac1bf18df64cde86b7d345c9833a2d) 576 + +[SMB_COM_DELETE_DIRECTORY request](#section_40edf254c3ad40c2a92dd9c8ee70c966) 573 + +[SMB_COM_ECHO request](#section_b3f7857524e34c58b0bbc758fd61c87f) 592 + +[SMB_COM_FIND request](#section_74dce06ec6594d40aec07edeb8ac32f9) 604 + +[SMB_COM_FIND_CLOSE request](#section_c5ffdc0966784739b343bacf2fcba831) 606 + +[SMB_COM_FIND_CLOSE2 request](#section_59604cd16a604f92a2ea849a64d89d14) 597 + +[SMB_COM_FIND_UNIQUE request](#section_73367ac5f8f34b23b8b9db37ff3605ff) 606 + +[SMB_COM_FLUSH request](#section_195439ae798a4c1ab13556b39a166427) 575 + +[SMB_COM_IOCTL request](#section_8e789e3b41054dc1bd7e5dee3d222429) 592 + +[SMB_COM_LOCK_AND_READ request](#section_20630a58dbb445859320b000c73d1ab7) 584 + +[SMB_COM_LOCK_BYTE_RANGE request](#section_e046e927ee0241b390766fe50ffb417a) 580 + +[SMB_COM_LOCKING_ANDX request](#section_709a30abb9f54745bd8e86f7212d4bc4) 590 + +[SMB_COM_LOGOFF_ANDX request](#section_ef073efe53884c178c9755a55f4274f4) 602 + +[SMB_COM_NEGOTIATE request](#section_55ecb4c66fdb459c8688b36ea1fc66e8) 599 + +[SMB_COM_NT_CANCEL request](#section_0a2324454ed64225bad85b9b6e6f8a00) 609 + +[SMB_COM_NT_CREATE_ANDX request](#section_d11800d00b444966b951b103bc252ba0) 607 + +[SMB_COM_NT_RENAME request](#section_c190a9d82a4b463c8c2b668d888bf9a8) 609 + +[SMB_COM_NT_TRANSACT request](#section_d422859bc95b48c0b9e51433617a50b5) 607 + +[SMB_COM_NT_TRANSACT subcommand request](#section_0870fb17651048bcb5b59515b00f6f3c) 621 + +[SMB_COM_OPEN request](#section_91838c728a744f758a266ae95eb6c5f5) 573 + +[SMB_COM_OPEN_ANDX request](#section_723c1f8e385b45d583f9a1ceb3a6ba6b) 593 + +[SMB_COM_OPEN_PRINT_FILE request](#section_0c7577d275a24d67af738075104fac80) 611 + +[SMB_COM_PROCESS_EXIT request](#section_bfc8ccd3132b4b4398df40bf0dd56cf1) 583 + +[SMB_COM_QUERY_INFORMATION request](#section_cfa18c9761c7422eab64cd3849864dfd) 578 + +[SMB_COM_QUERY_INFORMATION_DISK request](#section_158ccb58deb34c15b031eb140d3e6512) 604 + +[SMB_COM_QUERY_INFORMATION2 request](#section_dddf5118e1384b5c8ade23e1889d03e9) 590 + +[SMB_COM_READ request](#section_b4de39e5fda0450589e32bb0f7c4503e) 579 + +[SMB_COM_READ_ANDX request](#section_bb8fcb6a303246a1ad4ac0d7892921f9) 595 + +[SMB_COM_READ_MPX request](#section_2b03927add4b4c088fae5ad8353d951f) 586 + +[SMB_COM_READ_RAW request](#section_07e4a83801374405b5341e5eeaf16812) 585 + +[SMB_COM_RENAME request](#section_3d30e1e24a1a40de85792143f1574dab) 577 + +[SMB_COM_SEARCH request](#section_74dce06ec6594d40aec07edeb8ac32f9) 604 + +[SMB_COM_SEEK request](#section_8c6fd5861e8d4731957cc86c35755be0) 584 + +[SMB_COM_SESSION_SETUP_ANDX request](#section_905fbe981fe540e9b17a22ec8b17f7b3) 600 + +[SMB_COM_SET_INFORMATION request](#section_c0fbdf1ab24447e9bac14a89dfc93e24) 578 + +[SMB_COM_SET_INFORMATION2 request](#section_75155fd797454a1d98c780d861eddcdb) 590 + +[SMB_COM_TRANSACTION request](#section_0c79c58db9384e8e98e1cee43ecc0cd8) 592 + +[SMB_COM_TRANSACTION subcommand request](#section_421617c6f5994041a042d63ab081c354) 612 + +[SMB_COM_TRANSACTION2 request](#section_fa784f0d6ffc4fb8bb5d4c009ef4df4c) 597 + +[SMB_COM_TRANSACTION2 subcommand request](#section_f1d6e1a8e3504d25b6a72d5cfff98e5a) 617 + +[SMB_COM_TREE_CONNECT request](#section_b062f3e31b654a9a854a0ee432499d8f) 598 + +[SMB_COM_TREE_CONNECT_ANDX request](#section_602e4ab97b2a493fba11caab118fd13b) 602 + +[SMB_COM_TREE_DISCONNECT request](#section_2b0520b264614065bb978ce3427ac5d7) 599 + +[SMB_COM_UNLOCK_BYTE_RANGE request](#section_1c224ee171c94792958277e5950f1b3f) 581 + +[SMB_COM_WRITE request](#section_8cac8066d6624e4186dc904ae3382260) 579 + +[SMB_COM_WRITE_AND_CLOSE request](#section_6e66fe751be4423497550ffb8da32dd1) 592 + +[SMB_COM_WRITE_AND_UNLOCK request](#section_5bf60f58836b40fdbffbe9604f9a5c36) 585 + +[SMB_COM_WRITE_ANDX request](#section_936a467857004161acde02e379669cf4) 596 + +[SMB_COM_WRITE_MPX request](#section_735a59f0197045ff83ca4a905abb5d0a) 589 + +[SMB_COM_WRITE_PRINT_FILE request](#section_080c6955be884e52bfb918ef95fff13b) 611 + +[SMB_COM_WRITE_RAW request](#section_129a1c1f587f41c0b67ceff0359389b6) 587 + +[overview](#section_097195ea1dc74275937d9e68aeb9012f) 474 + +RPC + +abstract data model + +[global](#section_213329362ceb4b869692ebf8ed1fbe40) 474 + +overview ([section 3.1.1](#section_5523379590774c93b2b314510438b9d2) 474, [section 3.5.1](#section_fcabdf6bfc904c0bb52b324e109f930a) 634) + +higher-layer triggered events + +named pipe + +[closing its open](#section_f989e5beb56649fe8317fb9115d276b3) 635 + +[waiting for clients to open](#section_f07dfaffa8624747a5a59c7c0ef8a686) 634 + +[security context](#section_6ee34ae044564d7a8227c01f2fec05ab) 635 + +[sending any message](#section_68c3d17ae48e4eb4b97e3246bfe0262f) 474 + +[session key](#section_09662fd247fa41458d145468bffd9df7) 635 + +initialization ([section 3.1.3](#section_1e7f29da8e484f73ba9b7266709f22d8) 474, [section 3.5.3](#section_7c2a37c2405948c9b3c507cbc098876d) 634) + +local events ([section 3.1.7](#section_7ad63bf7b4a24eb5b9c331029007014f) 477, [section 3.5.7](#section_fd6357dd919e4df7b767484ceba85670) 635) + +message processing + +[algorithms for challenge/response authentication](#section_4d1a2cb00951462a8582121fd1afe28e) 476 + +[overview](#section_19839c17948f4b79a17ecd3b10027062) 635 + +[receiving any message](#section_35839d070f694d20af2f2c45aa7522b3) 475 + +[overview](#section_70ab865e3be24a04a618142873fe31e5) 634 + +sequencing rules + +[algorithms for challenge/response authentication](#section_4d1a2cb00951462a8582121fd1afe28e) 476 + +[overview](#section_19839c17948f4b79a17ecd3b10027062) 635 + +[receiving any message](#section_35839d070f694d20af2f2c45aa7522b3) 475 + +timer events ([section 3.1.6](#section_94a9134e9d5a47ae955f40872f4c8ff2) 477, [section 3.5.6](#section_529c6289c71246878aad39813eed7de7) 635) + +timers ([section 3.1.2](#section_4dcae91fb3914318b8de3b5285bbb242) 474, [section 3.5.2](#section_0e3f623e78ff452aa28d027cef56a71e) 634) + +sequencing rules + +[algorithms for challenge/response authentication](#section_4d1a2cb00951462a8582121fd1afe28e) 476 + +[incoming connection](#section_aa0fa406f1664fafa7d98e2a897174ce) 567 + +receiving any message ([section 3.1.5.1](#section_35839d070f694d20af2f2c45aa7522b3) 475, [section 3.3.5.2](#section_b09b63d73882458b9c8ec821c706ebdf) 568) + +[SMB_COM_CHECK_DIRECTORY request](#section_913b94e104c54165944729ab6ddef706) 583 + +[SMB_COM_CLOSE request](#section_99b767e28f0e438bace54323940f2dc8) 575 + +[SMB_COM_CLOSE_PRINT_FILE request](#section_09d18c57b79641c9b147a1125609ccf2) 611 + +[SMB_COM_CREATE request](#section_782ed034df484e9da0696be5d906382e) 574 + +[SMB_COM_CREATE_DIRECTORY request](#section_c41845a09efc45be93983a4cc19cf34a) 572 + +[SMB_COM_CREATE_NEW request](#section_74a49aa3f96548db97ca685bbdd6a48e) 582 + +[SMB_COM_CREATE_TEMPORARY request](#section_2e1b0b27f248428ca3d276fa3e9a270a) 581 + +[SMB_COM_DELETE request](#section_fbac1bf18df64cde86b7d345c9833a2d) 576 + +[SMB_COM_DELETE_DIRECTORY request](#section_40edf254c3ad40c2a92dd9c8ee70c966) 573 + +[SMB_COM_ECHO request](#section_b3f7857524e34c58b0bbc758fd61c87f) 592 + +[SMB_COM_FIND request](#section_74dce06ec6594d40aec07edeb8ac32f9) 604 + +[SMB_COM_FIND_CLOSE request](#section_c5ffdc0966784739b343bacf2fcba831) 606 + +[SMB_COM_FIND_CLOSE2 request](#section_59604cd16a604f92a2ea849a64d89d14) 597 + +[SMB_COM_FIND_UNIQUE request](#section_73367ac5f8f34b23b8b9db37ff3605ff) 606 + +[SMB_COM_FLUSH request](#section_195439ae798a4c1ab13556b39a166427) 575 + +[SMB_COM_IOCTL request](#section_8e789e3b41054dc1bd7e5dee3d222429) 592 + +[SMB_COM_LOCK_AND_READ request](#section_20630a58dbb445859320b000c73d1ab7) 584 + +[SMB_COM_LOCK_BYTE_RANGE request](#section_e046e927ee0241b390766fe50ffb417a) 580 + +[SMB_COM_LOCKING_ANDX request](#section_709a30abb9f54745bd8e86f7212d4bc4) 590 + +[SMB_COM_LOGOFF_ANDX request](#section_ef073efe53884c178c9755a55f4274f4) 602 + +[SMB_COM_NEGOTIATE request](#section_55ecb4c66fdb459c8688b36ea1fc66e8) 599 + +[SMB_COM_NT_CANCEL request](#section_0a2324454ed64225bad85b9b6e6f8a00) 609 + +[SMB_COM_NT_CREATE_ANDX request](#section_d11800d00b444966b951b103bc252ba0) 607 + +[SMB_COM_NT_RENAME request](#section_c190a9d82a4b463c8c2b668d888bf9a8) 609 + +[SMB_COM_NT_TRANSACT request](#section_d422859bc95b48c0b9e51433617a50b5) 607 + +[SMB_COM_NT_TRANSACT subcommand request](#section_0870fb17651048bcb5b59515b00f6f3c) 621 + +[SMB_COM_OPEN request](#section_91838c728a744f758a266ae95eb6c5f5) 573 + +[SMB_COM_OPEN_ANDX request](#section_723c1f8e385b45d583f9a1ceb3a6ba6b) 593 + +[SMB_COM_OPEN_PRINT_FILE request](#section_0c7577d275a24d67af738075104fac80) 611 + +[SMB_COM_PROCESS_EXIT request](#section_bfc8ccd3132b4b4398df40bf0dd56cf1) 583 + +[SMB_COM_QUERY_INFORMATION request](#section_cfa18c9761c7422eab64cd3849864dfd) 578 + +[SMB_COM_QUERY_INFORMATION_DISK request](#section_158ccb58deb34c15b031eb140d3e6512) 604 + +[SMB_COM_QUERY_INFORMATION2 request](#section_dddf5118e1384b5c8ade23e1889d03e9) 590 + +[SMB_COM_READ request](#section_b4de39e5fda0450589e32bb0f7c4503e) 579 + +[SMB_COM_READ_ANDX request](#section_bb8fcb6a303246a1ad4ac0d7892921f9) 595 + +[SMB_COM_READ_MPX request](#section_2b03927add4b4c088fae5ad8353d951f) 586 + +[SMB_COM_READ_RAW request](#section_07e4a83801374405b5341e5eeaf16812) 585 + +[SMB_COM_RENAME request](#section_3d30e1e24a1a40de85792143f1574dab) 577 + +[SMB_COM_SEARCH request](#section_74dce06ec6594d40aec07edeb8ac32f9) 604 + +[SMB_COM_SEEK request](#section_8c6fd5861e8d4731957cc86c35755be0) 584 + +[SMB_COM_SESSION_SETUP_ANDX request](#section_905fbe981fe540e9b17a22ec8b17f7b3) 600 + +[SMB_COM_SET_INFORMATION request](#section_c0fbdf1ab24447e9bac14a89dfc93e24) 578 + +[SMB_COM_SET_INFORMATION2 request](#section_75155fd797454a1d98c780d861eddcdb) 590 + +[SMB_COM_TRANSACTION request](#section_0c79c58db9384e8e98e1cee43ecc0cd8) 592 + +[SMB_COM_TRANSACTION subcommand request](#section_421617c6f5994041a042d63ab081c354) 612 + +[SMB_COM_TRANSACTION2 request](#section_fa784f0d6ffc4fb8bb5d4c009ef4df4c) 597 + +[SMB_COM_TRANSACTION2 subcommand request](#section_f1d6e1a8e3504d25b6a72d5cfff98e5a) 617 + +[SMB_COM_TREE_CONNECT request](#section_b062f3e31b654a9a854a0ee432499d8f) 598 + +[SMB_COM_TREE_CONNECT_ANDX request](#section_602e4ab97b2a493fba11caab118fd13b) 602 + +[SMB_COM_TREE_DISCONNECT request](#section_2b0520b264614065bb978ce3427ac5d7) 599 + +[SMB_COM_UNLOCK_BYTE_RANGE request](#section_1c224ee171c94792958277e5950f1b3f) 581 + +[SMB_COM_WRITE request](#section_8cac8066d6624e4186dc904ae3382260) 579 + +[SMB_COM_WRITE_AND_CLOSE request](#section_6e66fe751be4423497550ffb8da32dd1) 592 + +[SMB_COM_WRITE_AND_UNLOCK request](#section_5bf60f58836b40fdbffbe9604f9a5c36) 585 + +[SMB_COM_WRITE_ANDX request](#section_936a467857004161acde02e379669cf4) 596 + +[SMB_COM_WRITE_MPX request](#section_735a59f0197045ff83ca4a905abb5d0a) 589 + +[SMB_COM_WRITE_PRINT_FILE request](#section_080c6955be884e52bfb918ef95fff13b) 611 + +[SMB_COM_WRITE_RAW request](#section_129a1c1f587f41c0b67ceff0359389b6) 587 + +timer events + +[idle connection](#section_12c4ac69d10b44acb70687352f9755f1) 625 + +[OpLock break acknowledgment](#section_4b7ee4832be04373979dea82fc90ee64) 625 + +[overview](#section_94a9134e9d5a47ae955f40872f4c8ff2) 477 + +[unused open search](#section_bd252eff54fe4e86acc4128325e3f891) 626 + +[timers](#section_4dcae91fb3914318b8de3b5285bbb242) 474 + +[Set file attributes example](#section_7e1b8bfd1dfa401d8227169d45e59c4f) 640 + +SMB commands + +[SMB_COM_CHECK_DIRECTORY (0x10)](#section_6a989d5130bf4ceba46e7ae1cee6b516) 145 + +[SMB_COM_CLOSE (0x04)](#section_10059dd2ae0a48a2a95ca92505e9145f) 102 + +[SMB_COM_CLOSE_AND_TREE_DISC (0x31)](#section_3b4c6712d77c48ed90d8653956601ecd) 252 + +[SMB_COM_CLOSE_PRINT_FILE (0xC2)](#section_c4993aeed13b4a6e87bdefdaf7506906) 363 + +[SMB_COM_COPY (0x29)](#section_14b0f5c56fa84e1a9a597556206bcd56) 221 + +[SMB_COM_CREATE (0x03)](#section_87622f4337584bf9b1fb35109f0e5c15) 97 + +[SMB_COM_CREATE_DIRECTORY (0x00)](#section_e6e870ad70374b79ac544a42a1ba4561) 85 + +[SMB_COM_CREATE_NEW (0x0F)](#section_161fa213ba9d4bad948329e8b5872dca) 141 + +[SMB_COM_CREATE_TEMPORARY (0x0E)](#section_6ea3a4b22a9b4749a4a441efebdf4015) 137 + +[SMB_COM_DELETE (0x06)](#section_e455faa4d99643a587eb9993b0ceb896) 107 + +[SMB_COM_DELETE_DIRECTORY (0x01)](#section_0bca354c42d946b7a0aed8c6870242ca) 88 + +[SMB_COM_ECHO (0x2B)](#section_8c85435267c647f7a60da6c87b6b3aac) 221 + +[SMB_COM_FIND (0x82)](#section_5df45d03d4e94dfd850f639363b8dffd) 310 + +[SMB_COM_FIND_CLOSE (0x84)](#section_3ffcd296c7cc43938ab06c902a928eec) 321 + +[SMB_COM_FIND_CLOSE2 (0x34)](#section_31cdb10b8c1b4ee99ad23221c3941760) 264 + +[SMB_COM_FIND_NOTIFY_CLOSE (0x35)](#section_98e3f3b8adf74dfaa63391c19f0b83b0) 266 + +[SMB_COM_FIND_UNIQUE (0x83)](#section_828fff83d37b4deb811824c950dca87a) 316 + +[SMB_COM_FLUSH (0x05)](#section_32acdf03011d4e93b169a787f21dc13d) 104 + +[SMB_COM_GET_PRINT_QUEUE (0xC3)](#section_8aaa6b27b1444cd69171102217b1406d) 365 + +[SMB_COM_INVALID (0xFE)](#section_56cd8dd298cb4ef7a0885c53905e0fc0) 365 + +[SMB_COM_IOCTL (0x27)](#section_0d8f5f1716af499da192a5fd85fbb7e1) 213 + +[SMB_COM_IOCTL_SECONDARY (0x28)](#section_3a5f8e4716e6484d93466c4cbdc22dec) 220 + +[SMB_COM_LOCK_AND_READ (0x13)](#section_88a423e782324b22904dd9e6cc0a226e) 153 + +[SMB_COM_LOCK_BYTE_RANGE (0x0C)](#section_21f7b95a56c6482d80d6881ec0e6db69) 130 + +[SMB_COM_LOCKING_ANDX (0x24)](#section_df492170a2e840d1b7d5eb29364047e1) 192 + +[SMB_COM_LOGOFF_ANDX (0x74)](#section_53800b5cf0c64b9cbaeb1ad6b08ecb6b) 290 + +[SMB_COM_MOVE (0x2A)](#section_817ee280ffc9443db9f3475c4c02a4f1) 221 + +[SMB_COM_NEGOTIATE (0x72)](#section_96ccc2bd67ba463abb73fd6a9265199e) 272 + +[SMB_COM_NEW_FILE_SIZE (0x30)](#section_e3b0e8eca0f348d792b925715e5ec6c8) 251 + +[SMB_COM_NO_ANDX_COMMAND (0xFF)](#section_10921e06804f4b5a92a51cc562f43068) 366 + +[SMB_COM_NT_CANCEL (0xA4)](#section_bf04c12be5ee41079b760e5ffda9cc3f) 351 + +[SMB_COM_NT_CREATE_ANDX (0xA2)](#section_d3f83a7e493b4d29b21c55768b93e144) 338 + +[SMB_COM_NT_RENAME (0xA5)](#section_014a414742064ab2a167b58a4d11f1a7) 353 + +[SMB_COM_NT_TRANSACT (0xA0)](#section_55db04d6105f45d184ac6972c0a1ddc8) 325 + +[SMB_COM_NT_TRANSACT_SECONDARY (0xA1)](#section_0941c749cbf34c1b91b2b013a7473827) 334 + +[SMB_COM_OPEN (0x02)](#section_ec064de86538401e8c73b37231c36f2b) 91 + +[SMB_COM_OPEN_ANDX (0x2D)](#section_49a0f97dc4a748a3bf5046d816825729) 229 + +[SMB_COM_OPEN_PRINT_FILE (0xC0)](#section_4cce0e9fab2740f797cc6f12b4a9afef) 356 + +[SMB_COM_PROCESS_EXIT (0x11)](#section_233f62a6f565478db9b82b58ff347547) 147 + +[SMB_COM_QUERY_INFORMATION (0x08)](#section_d36b4a5cdf1b4255aa5bac6ef5c2fb7c) 113 + +[SMB_COM_QUERY_INFORMATION_DISK (0x80)](#section_c5b02889bcf44ad19bd7014614179107) 300 + +[SMB_COM_QUERY_INFORMATION2 (0x23)](#section_33ebe09e4c9d4adcb23b40e4348c704f) 188 + +[SMB_COM_QUERY_SERVER (0x21)](#section_d7ad4160575846859f680e6c531982a2) 185 + +[SMB_COM_READ (0x0A)](#section_b88922ddb18e46e09f7408eaace9a95c) 120 + +[SMB_COM_READ_ANDX (0x2E)](#section_129aa093574b483ea55ddf334606a622) 238 + +[SMB_COM_READ_BULK (0xD8)](#section_c5d7c2d74c994bd8b4efa756f09e114a) 365 + +[SMB_COM_READ_MPX (0x1B)](#section_9688c7181f3543f280c530d8a59ac305) 166 + +[SMB_COM_READ_MPX_SECONDARY (0x1C)](#section_f0c06fcc62384119be52e3e9606d209b) 171 + +[SMB_COM_READ_RAW (0x1A)](#section_a8c3a184272c4168bbb2dcc621c503a0) 163 + +[SMB_COM_RENAME (0x07)](#section_d78c549c9ab84d92bbbc6843bed943f6) 109 + +[SMB_COM_SEARCH (0x81)](#section_d33e84721356406d88edbd9fc10b060b) 303 + +[SMB_COM_SECURITY_PACKAGE_ANDX (0x7E)](#section_adb39707dd584d278aa07a98c04cff42) 300 + +[SMB_COM_SEEK (0x12)](#section_80846ca98b50418385c601c4e586227e) 149 + +[SMB_COM_SESSION_SETUP_ANDX (0x73)](#section_d902407ce73b46f58f9ea2de2b6085a2) 280 + +[SMB_COM_SET_INFORMATION (0x09)](#section_e3cd0acdaa844fbf8c9d3e7d3bb3fd52) 117 + +[SMB_COM_SET_INFORMATION2 (0x22)](#section_cfcda87d76344902a137c60a1f4a5ae5) 185 + +[SMB_COM_TRANSACTION (0x25)](#section_0ed1ad9fab964a7ab94a0915f3796781) 200 + +[SMB_COM_TRANSACTION_SECONDARY (0x26)](#section_a4c643871dc445fbb01f9ad8b69e83e1) 210 + +[SMB_COM_TRANSACTION2 (0x32)](#section_3d9d8f3edc70410da3fc6f4a881e8cab) 252 + +[SMB_COM_TRANSACTION2_SECONDARY (0x33)](#section_80207e036cd64bbe863fdb52f4d2cb1a) 261 + +[SMB_COM_TREE_CONNECT (0x70)](#section_4a6fc9eade6d484da59b3ba68a6d760c) 266 + +[SMB_COM_TREE_CONNECT_ANDX (0x75)](#section_a105173ad8544950be283d3240529ec3) 293 + +[SMB_COM_TREE_DISCONNECT (0x71)](#section_31cc172a80844f0baad6d8d69da76a0e) 270 + +[SMB_COM_UNLOCK_BYTE_RANGE (0x0D)](#section_3cfce68297d8499b8a2cef000f5d6b26) 133 + +[SMB_COM_WRITE (0x0B)](#section_5f3ebf6a5d0643ee9429c8cc1b58eef5) 125 + +[SMB_COM_WRITE_AND_CLOSE (0x2C)](#section_029b038c4d4b42fc8c5199eb23055e9c) 224 + +[SMB_COM_WRITE_AND_UNLOCK (0x14)](#section_5006049ae39b4dac83f20ec64c731c9c) 158 + +[SMB_COM_WRITE_ANDX (0x2F)](#section_81aec3770ff44fc4bc568f05b70c3e42) 244 + +[SMB_COM_WRITE_BULK (0xD9)](#section_a5baa1040ad040889d96848aa59aef3b) 365 + +[SMB_COM_WRITE_BULK_DATA (0xDA)](#section_0cc4166580d549aaaf4e6fff0ed1820f) 365 + +[SMB_COM_WRITE_COMPLETE (0x20)](#section_1e82640ccd3149ee972984b30ee1132c) 185 + +[SMB_COM_WRITE_MPX (0x1E)](#section_ab9a94409c2249fd859e2fd81c57e9d9) 179 + +[SMB_COM_WRITE_MPX_SECONDARY (0x1F)](#section_d07bc94a9da843f787779e9033891ef7) 185 + +[SMB_COM_WRITE_PRINT_FILE (0xC1)](#section_1b14601f89a54e21b2ac0bf1d2374957) 360 + +[SMB_COM_WRITE_RAW (0x1D)](#section_5feebf73e3b34bbda4497aea0a4cf87e) 172 + +SMB message structure + +[batched messages ("AndX" messages)](#section_fc4d19f78040426d91547219c57453c8) 84 + +[data block](#section_48b4bd5d72064002bde1c34cf614b138) 84 + +[overview](#section_4d330f4c151c4d79b20740bd4f754da9) 78 + +[parameter block](#section_c87a9a6ee31844d385e182398f8dc9f5) 83 + +[SMB_Header](#section_69a29f73de0c45a6a1aa8ceeea42217f) 78 + +[SMB Message Structure message](#section_4d330f4c151c4d79b20740bd4f754da9) 78 + +[SMB_COM_CREATE_DIRECTORY_REQUEST packet](#section_06cc0c53355a4042ae24794aadb412f3) 86 + +[SMB_COM_CREATE_DIRECTORY_RESPONSE packet](#section_90dee34694114e9790224d2caf02562e) 86 + +[SMB_Data packet](#section_48b4bd5d72064002bde1c34cf614b138) 84 + +[SMB_ERROR data type](#section_d3b37beca9da460c89b08a8e83e93534) 50 + +[SMB_ERROR packet](#section_d3b37beca9da460c89b08a8e83e93534) 50 + +[SMB_FEA packet](#section_53d6fe8e489a4ec6bf98a3040baad686) 44 + +[SMB_FEA_LIST packet](#section_1ca1684e6552432cbdd0f559814bbaef) 46 + +[SMB_FILE_ATTRIBUTE_ARCHIVE](#section_2198f480e0474df0ba64f28eadef00b9) 47 + +[SMB_FILE_ATTRIBUTE_DIRECTORY](#section_2198f480e0474df0ba64f28eadef00b9) 47 + +[SMB_FILE_ATTRIBUTE_HIDDEN](#section_2198f480e0474df0ba64f28eadef00b9) 47 + +[SMB_FILE_ATTRIBUTE_NORMAL](#section_2198f480e0474df0ba64f28eadef00b9) 47 + +[SMB_FILE_ATTRIBUTE_READONLY](#section_2198f480e0474df0ba64f28eadef00b9) 47 + +[SMB_FILE_ATTRIBUTE_SYSTEM](#section_2198f480e0474df0ba64f28eadef00b9) 47 + +[SMB_FILE_ATTRIBUTE_VOLUME](#section_2198f480e0474df0ba64f28eadef00b9) 47 + +[SMB_FIND_FILE_BOTH_DIRECTORY_INFO packet](#section_2aa849f41bc042bf9c8fd09f11fccc4c) 458 + +[SMB_FIND_FILE_DIRECTORY_INFO packet](#section_8be9119ab37e4ff5bee73d7a5997dc88) 456 + +[SMB_FIND_FILE_FULL_DIRECTORY_INFO packet](#section_64bd690ed3a4458896ef0cb90b065d08) 457 + +[SMB_FIND_FILE_NAMES_INFO packet](#section_88b9968ba36f482abb30c7a51a3e290d) 458 + +[SMB_GEA packet](#section_e40c0bee37894b24869448b796a2d4fc) 43 + +[SMB_GEA_LIST packet](#section_9238146205024313aaf0ffc3e0ff050d) 44 + +[SMB_Header packet](#section_69a29f73de0c45a6a1aa8ceeea42217f) 78 + +[SMB_INFO_ALLOCATION packet](#section_194f7dd3a0194789a70cb28e029e6409) 459 + +[SMB_INFO_QUERY_ALL_EAS packet](#section_2db63466bdbf45c496fcdff83ebda893) 465 + +SMB_INFO_QUERY_EA_SIZE packet ([section 2.2.8.1.2](#section_66ca377d17bd456cb65e59c84462a161) 454, [section 2.2.8.3.2](#section_b0a5faf7e7cc4b38878d2253a2ef9ad4) 464) + +SMB_INFO_QUERY_EAS_FROM_LIST packet ([section 2.2.8.1.3](#section_031d81a90fda4b2fb976f4c15c8a7efa) 455, [section 2.2.8.3.3](#section_0cf863b20f6a470bb02a6a21441e2c4a) 465) + +[SMB_INFO_SET_EAS packet](#section_417809e182ff4acfbc999de5bf7455d4) 471 + +SMB_INFO_STANDARD packet ([section 2.2.8.1.1](#section_b7cc0966f87d41a6aa1a48526a9cc729) 453, [section 2.2.8.3.1](#section_a6ec7008abfc43229ed930ba50839a7c) 463, [section 2.2.8.4.1](#section_3e6f3a136a404f76af70bb514554ea5b) 470) + +[SMB_INFO_VOLUME packet](#section_13d589f567e949e88c337b04b8f7cd8c) 460 + +[SMB_NMPIPE_STATUS data type](#section_6911a7095dfb4ffbb0903e8ef872f85c) 48 + +[SMB_Parameters packet](#section_c87a9a6ee31844d385e182398f8dc9f5) 83 + +[SMB_QUERY_FILE_ALL_INFO packet](#section_162baf4542014b07a397060e868599d7) 467 + +[SMB_QUERY_FILE_ALT_NAME_INFO packet](#section_3edd12e7f4074b469465c6ed20e24c1a) 468 + +[SMB_QUERY_FILE_BASIC_INFO packet](#section_3da7df7543ba4498a6b3a68ba57ec922) 466 + +[SMB_QUERY_FILE_COMRESSION_INFO packet](#section_1211daed3d9342aebf22c8554d7bbe97) 469 + +[SMB_QUERY_FILE_EA_INFO packet](#section_3e85d60e696a4436875784233d9f0245) 467 + +[SMB_QUERY_FILE_NAME_INFO packet](#section_0cdd9e53bc924f268b22ed11fc06a6d7) 467 + +[SMB_QUERY_FILE_STANDARD_INFO packet](#section_3bdd080cf8a44a09acf10f8bd00152e4) 466 + +[SMB_QUERY_FILE_STREAM_INFO packet](#section_23f37dcd5b5043d491cdffab868fd65e) 469 + +[SMB_QUERY_FS_ATTRIBUTE_INFO packet](#section_1011206a55c54dbfaff0119514136940) 463 + +[SMB_QUERY_FS_DEVICE_INFO packet](#section_d7ea6e1a65264230b566e9588c7498f1) 461 + +[SMB_QUERY_FS_SIZE_INFO packet](#section_3045d7df775747259ffd20227978cc46) 461 + +[SMB_QUERY_FS_VOLUME_INFO packet](#section_879f3ae2b0294b3b8043c830fc517b28) 460 + +[SMB_SEARCH_ATTRIBUTE_ARCHIVE](#section_2198f480e0474df0ba64f28eadef00b9) 47 + +[SMB_SEARCH_ATTRIBUTE_DIRECTORY](#section_2198f480e0474df0ba64f28eadef00b9) 47 + +[SMB_SEARCH_ATTRIBUTE_HIDDEN](#section_2198f480e0474df0ba64f28eadef00b9) 47 + +[SMB_SEARCH_ATTRIBUTE_READONLY](#section_2198f480e0474df0ba64f28eadef00b9) 47 + +[SMB_SEARCH_ATTRIBUTE_SYSTEM](#section_2198f480e0474df0ba64f28eadef00b9) 47 + +[SMB_SET_FILE_ALLOCATION_INFO packet](#section_d362c412dcd0463d93e43e09aa8cacc5) 472 + +[SMB_SET_FILE_BASIC_INFO packet](#section_021549daef784282ae937ae93acaba97) 471 + +[SMB_SET_FILE_DISPOSITION_INFO packet](#section_bb8e952bd2934fc3bc4767ce1a8f8655) 472 + +[SMB_SET_FILE_END_OF_FILE_INFO packet](#section_4735b3d3cb3b4c9db11c482d7bc48722) 473 + +[Standards assignments](#section_029cb7a6e6e9459fa4704099b47a9ea5) 33 + +Structures - SMB message + +[batched messages ("AndX" messages)](#section_fc4d19f78040426d91547219c57453c8) 84 + +[data block](#section_48b4bd5d72064002bde1c34cf614b138) 84 + +[overview](#section_4d330f4c151c4d79b20740bd4f754da9) 78 + +[parameter block](#section_c87a9a6ee31844d385e182398f8dc9f5) 83 + +[SMB_Header](#section_69a29f73de0c45a6a1aa8ceeea42217f) 78 + +[Subcommand codes - transaction](#section_14937ad838af4c749604ddb8470d0ed9) 61 + +Subcommands + +NT Transact + +[NT_TRANSACT_CREATE (0x0001)](#section_f85bb6cf2d3949c9bfe5307ad57d5da5) 428 + +[NT_TRANSACT_IOCTL (0x0002)](#section_26a843f52fee43ea889100a31cb5d854) 440 + +[NT_TRANSACT_NOTIFY_CHANGE (0x0004)](#section_2a65e0f460e041ef8184ae9bc2430316) 446 + +[NT_TRANSACT_QUERY_SECURITY_DESC (0x0006)](#section_a4cb863952e14115b2f10c3b179a0479) 449 + +[NT_TRANSACT_RENAME (0x0005)](#section_95b5e7287ff14e53a9f266f031d86b4c) 449 + +[NT_TRANSACT_SET_SECURITY_DESC (0x0003)](#section_ee4287977c94413fa19ee2176f66501d) 443 + +Transaction + +[overview](#section_227cb1473c094c4bb1456c94b04c8231) 366 + +[TRANS_CALL_NMPIPE (0x0054)](#section_a600138d46b741b49d9380a3bd5096de) 393 + +[TRANS_MAILSLOT_WRITE (0x0001)](#section_be3b074f9c634869b5ef9ecb598f0591) 396 + +[TRANS_PEEK_NMPIPE (0x0023)](#section_80f114bfb3e34b82a0f517c039d70e9e) 377 + +[TRANS_QUERY_NMPIPE_INFO (0x0022)](#section_58c3b35b06834035941616c62e941203) 373 + +[TRANS_QUERY_NMPIPE_STATE (0x0021)](#section_905e248a9fc44c09aeae5cf2a6dfd015) 371 + +[TRANS_RAW_READ_NMPIPE (0x0011)](#section_cfcebfaeed1345ee9117fdc6da5a4060) 369 + +[TRANS_RAW_WRITE_NMPIPE (0x0031)](#section_84397ad8d55c4ba7933ca96f2f64167d) 383 + +[TRANS_READ_NMPIPE (0x0036)](#section_d9004cc94b844d4ca522ec559f53c1a7) 386 + +[TRANS_SET_NMPIPE_STATE (0x0001)](#section_2481644c725944b89b8bae539f7b3eb6) 366 + +[TRANS_TRANSACT_NMPIPE (0x0026)](#section_f599d0f080b148869657944f36a44138) 380 + +[TRANS_WAIT_NMPIPE (0x0053)](#section_385ce4de217048a1910053f3c4aad60d) 391 + +[TRANS_WRITE_NMPIPE (0x0037)](#section_de6ca9e1b30f426ebc072198375b1bd7) 388 + +Transaction2 + +[TRANS2_CREATE_DIRECTORY (0x000D)](#section_d77e09845be54aba9f8a8606e48ff7d0) 424 + +[TRANS2_FIND_FIRST2 (0x0001)](#section_a782468b56f14066bb6ee2630f0e8695) 402 + +[TRANS2_FIND_NEXT2 (0x0002)](#section_8f2e9ab5a6be4540a8fdf62492b34d24) 406 + +[TRANS2_FIND_NOTIFY_FIRST (0x000B)](#section_ba5cd70dff5c4ddf844162609c092e58) 423 + +[TRANS2_FIND_NOTIFY_NEXT (0x000C)](#section_0fb0df5b36fa47d984345d0a512b517a) 423 + +[TRANS2_FSCTL (0x0009)](#section_57b86f1028c245c6a3703daecf746461) 423 + +[TRANS2_GET_DFS_REFERRAL (0x0010)](#section_795a49a409894a15aa475b167fca6c7b) 427 + +[TRANS2_IOCTL2 (0x000A)](#section_94e0959682cf40b48c6112f454506643) 423 + +[TRANS2_OPEN2 (0x0000)](#section_ee2f11ca7c7e49ac9cb78b1ed1259c2c) 396 + +[TRANS2_QUERY_FILE_INFORMATION (0x0007)](#section_16c2516fc82c43b79ab732fb1109f9fe) 417 + +[TRANS2_QUERY_FS_INFORMATION (0x0003)](#section_a96c1c03cade4a4a81a9b00674d23d93) 410 + +[TRANS2_QUERY_PATH_INFORMATION (0x0005)](#section_39021262e1624948b4999dfccef77ef6) 412 + +[TRANS2_REPORT_DFS_INCONSISTENCY (0x0011)](#section_ed6cd621ec064a17ba0d4f3f2ec9eb87) 428 + +[TRANS2_SESSION_SETUP (0x000E)](#section_3dd0b2797a3b4c42af0b62a1e15acb1c) 426 + +[TRANS2_SET_FILE_INFORMATION (0x0008)](#section_cb2b7f2138774bc5adf4b78c8aa2a717) 420 + +[TRANS2_SET_FS_INFORMATION (0x0004)](#section_ac4b00db6015416a89a1bf5da2503bc3) 412 + +[TRANS2_SET_PATH_INFORMATION (0x0006)](#section_a23483d965434aaaa996e7c9506f8b94) 415 + +[Syntax](#section_089b6f3eb91d465983a73e50a1a5faf7) 39 + +T + +[Time data type](#section_80aa10e5b2e44e5a885bb77e54f61363) 49 + +Timer events + +client + +[overview](#section_94a9134e9d5a47ae955f40872f4c8ff2) 477 + +[request expiration](#section_048f3f3f243f46cd99c2e2e2853a6cb4) 548 + +RPC ([section 3.1.6](#section_94a9134e9d5a47ae955f40872f4c8ff2) 477, [section 3.4.6](#section_24eda5c10ee84494ad7efe28a21d5953) 633) + +server + +[idle connection](#section_12c4ac69d10b44acb70687352f9755f1) 625 + +[OpLock break acknowledgment](#section_4b7ee4832be04373979dea82fc90ee64) 625 + +[overview](#section_94a9134e9d5a47ae955f40872f4c8ff2) 477 + +RPC ([section 3.1.6](#section_94a9134e9d5a47ae955f40872f4c8ff2) 477, [section 3.5.6](#section_529c6289c71246878aad39813eed7de7) 635) + +[unused open search](#section_bd252eff54fe4e86acc4128325e3f891) 626 + +Timers + +client + +[idle connection](#section_01688aa7038d484991ff3b55781a7253) 557 + +[OpLock break acknowledgment](#section_acb45ee235ad43b5ad6864cc65e927f3) 557 + +[overview](#section_4dcae91fb3914318b8de3b5285bbb242) 474 + +[request expiration](#section_e81016e6ef9146b0bd19cf959eb7cc31) 482 + +RPC ([section 3.1.2](#section_4dcae91fb3914318b8de3b5285bbb242) 474, [section 3.4.2](#section_bec484ce9cc340a4b261060b9814233a) 627) + +[unused open search](#section_6a35f88585474d9e9c88f7d36cabe3e4) 557 + +server + +[overview](#section_4dcae91fb3914318b8de3b5285bbb242) 474 + +RPC ([section 3.1.2](#section_4dcae91fb3914318b8de3b5285bbb242) 474, [section 3.5.2](#section_0e3f623e78ff452aa28d027cef56a71e) 634) + +[Tracking changes](#section_d12c335b970845bf9931adc5fbd3388d) 708 + +[TRANS2_FIND_FIRST2_REQUEST packet](#section_b2b2a73094994f05884ed5bb7b9caf90) 403 + +[TRANS2_FIND_NEXT2_REQUEST packet](#section_80dc980efe03455cada67c5dd6c551ba) 407 + +[TRANS2_OPEN2_REQUEST packet](#section_59261f5ba49a4013b7772efbb0f46bb9) 396 + +[TRANS2_OPEN2_RESPONSE packet](#section_20316f50c6cd4d418b74cd35efd1fed0) 399 + +Transaction subcommands + +[overview](#section_227cb1473c094c4bb1456c94b04c8231) 366 + +[TRANS_CALL_NMPIPE (0x0054)](#section_a600138d46b741b49d9380a3bd5096de) 393 + +[TRANS_MAILSLOT_WRITE (0x0001)](#section_be3b074f9c634869b5ef9ecb598f0591) 396 + +[TRANS_PEEK_NMPIPE (0x0023)](#section_80f114bfb3e34b82a0f517c039d70e9e) 377 + +[TRANS_QUERY_NMPIPE_INFO (0x0022)](#section_58c3b35b06834035941616c62e941203) 373 + +[TRANS_QUERY_NMPIPE_STATE (0x0021)](#section_905e248a9fc44c09aeae5cf2a6dfd015) 371 + +[TRANS_RAW_READ_NMPIPE (0x0011)](#section_cfcebfaeed1345ee9117fdc6da5a4060) 369 + +[TRANS_RAW_WRITE_NMPIPE (0x0031)](#section_84397ad8d55c4ba7933ca96f2f64167d) 383 + +[TRANS_READ_NMPIPE (0x0036)](#section_d9004cc94b844d4ca522ec559f53c1a7) 386 + +[TRANS_SET_NMPIPE_STATE (0x0001)](#section_2481644c725944b89b8bae539f7b3eb6) 366 + +[TRANS_TRANSACT_NMPIPE (0x0026)](#section_f599d0f080b148869657944f36a44138) 380 + +[TRANS_WAIT_NMPIPE (0x0053)](#section_385ce4de217048a1910053f3c4aad60d) 391 + +[TRANS_WRITE_NMPIPE (0x0037)](#section_de6ca9e1b30f426ebc072198375b1bd7) 388 + +[Transaction Subcommands message](#section_227cb1473c094c4bb1456c94b04c8231) 366 + +Transaction2 subcommands + +[TRANS2_CREATE_DIRECTORY (0x000D)](#section_d77e09845be54aba9f8a8606e48ff7d0) 424 + +[TRANS2_FIND_FIRST2 (0x0001)](#section_a782468b56f14066bb6ee2630f0e8695) 402 + +[TRANS2_FIND_NEXT2 (0x0002)](#section_8f2e9ab5a6be4540a8fdf62492b34d24) 406 + +[TRANS2_FIND_NOTIFY_FIRST (0x000B)](#section_ba5cd70dff5c4ddf844162609c092e58) 423 + +[TRANS2_FIND_NOTIFY_NEXT (0x000C)](#section_0fb0df5b36fa47d984345d0a512b517a) 423 + +[TRANS2_FSCTL (0x0009)](#section_57b86f1028c245c6a3703daecf746461) 423 + +[TRANS2_GET_DFS_REFERRAL (0x0010)](#section_795a49a409894a15aa475b167fca6c7b) 427 + +[TRANS2_IOCTL2 (0x000A)](#section_94e0959682cf40b48c6112f454506643) 423 + +[TRANS2_OPEN2 (0x0000)](#section_ee2f11ca7c7e49ac9cb78b1ed1259c2c) 396 + +[TRANS2_QUERY_FILE_INFORMATION (0x0007)](#section_16c2516fc82c43b79ab732fb1109f9fe) 417 + +[TRANS2_QUERY_FS_INFORMATION (0x0003)](#section_a96c1c03cade4a4a81a9b00674d23d93) 410 + +[TRANS2_QUERY_PATH_INFORMATION (0x0005)](#section_39021262e1624948b4999dfccef77ef6) 412 + +[TRANS2_REPORT_DFS_INCONSISTENCY (0x0011)](#section_ed6cd621ec064a17ba0d4f3f2ec9eb87) 428 + +[TRANS2_SESSION_SETUP (0x000E)](#section_3dd0b2797a3b4c42af0b62a1e15acb1c) 426 + +[TRANS2_SET_FILE_INFORMATION (0x0008)](#section_cb2b7f2138774bc5adf4b78c8aa2a717) 420 + +[TRANS2_SET_FS_INFORMATION (0x0004)](#section_ac4b00db6015416a89a1bf5da2503bc3) 412 + +[TRANS2_SET_PATH_INFORMATION (0x0006)](#section_a23483d965434aaaa996e7c9506f8b94) 415 + +[Transport](#section_56df901359444ccf970b67c30ef5c449) 34 + +NetBIOS + +[frames](#section_b102769bbaef4fb499476e2bf218faa6) 34 + +over + +[IPX/SPX](#section_72558ac240a0407eaf6dc16e35c735b5) 35 + +[TCP/UDP](#section_45170055a0cd49109228801d5bf7ac84) 35 + +[overview](#section_56df901359444ccf970b67c30ef5c449) 34 + +Transports + +[direct hosting](#section_4a059c679d204ee1a6b72ec2bc7db74a) 35 + +[direct IPX](#section_f33a2e37706347ffaeb428de05c9857e) 35 + +NetBIOS-based transports + +[other](#section_be8b6fa946b34af6b0fb809051c6008b) 35 + +[overview](#section_1430ebe92ad04763b14fc720338e0482) 34 + +[virtual circuits](#section_402e87ee4cff49ed817b88e8ef0d13cb) 39 + +Triggered events + +client + +[cryptographic session key - querying](#section_18d8396c245648d7b338c99e05001012) 529 + +device + +[reading](#section_18c7441d4b024f738b3e13b78396a1e4) 508 + +[writing](#section_13ec5da367744618a4a0709002cda9dc) 512 + +DFS + +[querying referrals](#section_68f4963e657a4400b4504f5c144fb29e) 529 + +[subsystem active](#section_b43ac9a496294974a189fcdbedfad21a) 529 + +directory + +[contents change notification](#section_e76cc07beff448dfb03b227f8e5e3941) 527 + +[creating](#section_839f343a00eb40acbe2cbda8dc06d11d) 495 + +[deleting](#section_e41fbdab7aaf405da368ac99d0733ff9) 496 + +[enumeration](#section_fbfa3470766841aeaed03e2f08a2d3a6) 523 + +[verifying path](#section_79e3f2310df542e8a063000750098e4c) 520 + +file + +attributes + +[querying](#section_e70273837f8e45a18e7f81604dedd759) 505 + +[setting](#section_c43492ca1d6b4bb98a2c982b9c547815) 506 + +[byte-range lock](#section_0a200d604cfb47fdb15d6c55fc155a6f) 518 + +[byte-range lock - release](#section_0c6eb3ee74a64907b02304daca274cf1) 519 + +[closing](#section_5afb8ecf09a14bd49ab67d86890914d6) 502 + +[create or overwrite](#section_ed665df4858c4ad0b65012bdf79e7da6) 500 + +[creating a hard link](#section_36e5c360fab64557b18ad2b68bbcb84e) 504 + +[deleting](#section_10abe589ae044bb7aeb9814ed81e4cec) 503 + +[flushing data](#section_5d05af7582d8437db084a9c4dafb711b) 502 + +[opening an existing](#section_66435b844e2242ffb4e15ff7b07de138) 496 + +[opportunistic lock](#section_388621802e684a56985a5da4c5b7d0b5) 520 + +[print](#section_65f21277dec34bfa9d7291db9e608dc8) 525 + +[reading](#section_18c7441d4b024f738b3e13b78396a1e4) 508 + +[renaming](#section_180d43e85c2c427f93153b0632d6f32b) 503 + +[seek to a location](#section_033340bfb2a9458592d2b232a82358d6) 521 + +[sending IOCTL](#section_bec8c29eec9a456eb90ed90c07e5c7fc) 521 + +[system attributes - querying](#section_825e9d38ac5c4a6db5e34600e1749d31) 522 + +[writing](#section_13ec5da367744618a4a0709002cda9dc) 512 + +named pipe + +[exchange (call)](#section_eb7675050c85419e8eaadf01500ac5f7) 526 + +[executing a transaction](#section_0e868b83c198491cae21ab5b353ad5d1) 526 + +[peeking at data](#section_25b60122a69347078a14c22b2b919491) 526 + +querying + +[handle state](#section_eba89c166c1e485fa029987f4b70caf5) 525 + +[information](#section_03dbe090791e489e970d59e751eced86) 526 + +reading ([section 3.2.4.14](#section_18c7441d4b024f738b3e13b78396a1e4) 508, [section 3.2.4.37](#section_9fef605a943143289a00f4599a691745) 527) + +[setting state](#section_9fd144a554004a3482497b51a07bea10) 525 + +[waiting for availability](#section_ee6ea352bf2a4be29d7acbf7648f3c15) 526 + +writing ([section 3.2.4.15](#section_13ec5da367744618a4a0709002cda9dc) 512, [section 3.2.4.38](#section_40ec464830534b0586bbe2418b12eba0) 527) + +[named RAP transaction](#section_46fa86910d3b4a4e91c04657250d7514) 528 + +[number of opens on tree connect](#section_dd4363b135d043578d096efe08ea0ab9) 529 + +[operations - canceling pending](#section_54301b60971f42a4b6c1d70dd06a8a45) 524 + +[process exit notification](#section_c099c3f16eb74a60a7fa31d5fc93c329) 521 + +RPC + +[DFS referrals - querying](#section_0544586d6c084df687ef52db1b639f22) 631 + +[extended DFS referral capability - querying](#section_a62af4a6b640445a808b1e98c8332742) 633 + +named pipe + +[closing](#section_d1aec2af930c4c93a81c50e6d9debc32) 630 + +[opening](#section_4b0b077a46f040a6ad13b5488d3720d0) 627 + +[reading](#section_37f68581a73c4f2ba8fb6bfb474522b4) 629 + +[transaction - issuing](#section_e871eae631cf4c888d23eef701c6f0af) 630 + +[writing](#section_9ac2fb524c284733a70516b58886c81f) 629 + +[sending any message](#section_68c3d17ae48e4eb4b97e3246bfe0262f) 474 + +session + +[initiating](#section_3c90e44ecc2e4bf599828e3ec7a850db) 631 + +[key - authenticated context](#section_41aaaefab36649c895e8feaaaf8524e0) 631 + +[terminating](#section_6f357e8739e54d8daff905a0fa0405ce) 631 + +[share connection - requesting](#section_6d776ad6fd9940b586553fcef6cb7a02) 632 + +[tree disconnect - requesting](#section_06cdaae72df14ee0a6d70824a8812106) 633 + +security descriptors + +[querying](#section_baa7103e084242c88faeee37015fa717) 528 + +[setting](#section_136a67e9bfb645e8a176a31ea23f819b) 528 + +sending any message ([section 3.1.4.1](#section_68c3d17ae48e4eb4b97e3246bfe0262f) 474, [section 3.2.4.1](#section_87ad25ebedcb48dda230ba0d852fbfbd) 483) + +[share - connecting](#section_96d90ccb9f7f47159d21987b93304f74) 490 + +[SMB session logoff](#section_c23c7dfd8d7f46f593be17e05e333904) 522 + +[transport layer connection - testing](#section_2c2b8e1fa42746dab9b6902c4e8902d2) 522 + +[tree disconnect (unmount share)](#section_cbce4d659c874d7ea121730932263936) 522 + +server + +client session + +[security context](#section_c0c86a311e3b4e6f8f4bd4006461d093) 561 + +[session key](#section_c1401b93b1884a3b9b9851507e0e1cc9) 561 + +[configuration - updating](#section_0b3352fbbdcb4c0abec1b8243dedec73) 566 + +DFS subsystem + +[active](#section_1430eeb382ce47deb4bbfefd88a537fb) 560 + +[DFS share](#section_c91e1469a4a745a9be5e0bdbdbb37189) 560 + +[not a DFS share](#section_318afa4ee14b4c4b9c51c532f4d954e8) 560 + +[disabling](#section_4bdd9f19402d4eaea0a38b2434ac46d3) 565 + +[enabling](#section_c4ee4c5e36644a59ad01d8a654580cad) 565 + +open + +[closing](#section_9800e30c24fe4abb998eed309a489841) 563 + +[querying](#section_ad0c8f3f6d3e4db18ca8c50976e87d2e) 564 + +[OpLock break](#section_b50b9ddaf3744427a93edf9c55c043a6) 559 + +[pausing](#section_419790b2de6b45cabc23502f4ace19c7) 566 + +[resuming](#section_c1dd60f17cf643e4988e6b9bdb9d52e0) 566 + +RPC + +named pipe + +[closing its open](#section_f989e5beb56649fe8317fb9115d276b3) 635 + +[waiting for clients to open](#section_f07dfaffa8624747a5a59c7c0ef8a686) 634 + +[security context](#section_6ee34ae044564d7a8227c01f2fec05ab) 635 + +[sending any message](#section_68c3d17ae48e4eb4b97e3246bfe0262f) 474 + +[session key](#section_09662fd247fa41458d145468bffd9df7) 635 + +sending any message ([section 3.1.4.1](#section_68c3d17ae48e4eb4b97e3246bfe0262f) 474, [section 3.3.4.1](#section_391c8ce60b83497f9706f7cec50dd697) 558) + +session + +[closing](#section_5b526bffbfdb45aba4bff80a8917980b) 561 + +[querying](#section_55355166f9ce4fba9f31983e1ae6bb7f) 563 + +share + +[deregistering](#section_7c96c13de5de4326a9c7aae97250a66a) 562 + +[querying](#section_c51938394cd54f958adadf13584251ce) 563 + +[registering](#section_644bbaa18e9e4634b1e4e8e508e3f861) 561 + +[updating](#section_5f810fc9fc2a49dc8f8ab772e016ea66) 562 + +[statistics](#section_0542a8a782f44dcea162bcff82e03705) 566 + +[transport binding change](#section_a0a15b401d974912aa0348f78e46a85e) 565 + +[TreeConnect - querying](#section_91c2672f36044cc78b6e934ef847d6cc) 564 + +U + +[Unique identifiers data type](#section_39a29276cadf41d3b5f174facea48607) 51 + +V + +[Vendor-extensible fields](#section_3babab5101b845aaab8bbd4044d8ee79) 32 + +[Versioning](#section_80850595e3014464974558e4945eb99b) 30 + +[Virtual circuits](#section_402e87ee4cff49ed817b88e8ef0d13cb) 39 + +Y + +[YEAR](#section_31b65222417149b4aeed7d3f38ecf68b) 50 \ No newline at end of file diff --git a/spec/ms-smb.md b/spec/ms-smb.md new file mode 100644 index 0000000..b5ccc29 --- /dev/null +++ b/spec/ms-smb.md @@ -0,0 +1,6695 @@ +**\[MS-SMB\]:** + +**Server Message Block (SMB) Protocol** + +Intellectual Property Rights Notice for Open Specifications Documentation + +- **Technical Documentation.** Microsoft publishes Open Specifications documentation ("this documentation") for protocols, file formats, data portability, computer languages, and standards support. Additionally, overview documents cover inter-protocol relationships and interactions. +- **Copyrights**. This documentation is covered by Microsoft copyrights. Regardless of any other terms that are contained in the terms of use for the Microsoft website that hosts this documentation, you can make copies of it in order to develop implementations of the technologies that are described in this documentation and can distribute portions of it in your implementations that use these technologies or in your documentation as necessary to properly document the implementation. You can also distribute in your implementation, with or without modification, any schemas, IDLs, or code samples that are included in the documentation. This permission also applies to any documents that are referenced in the Open Specifications documentation. +- **No Trade Secrets**. Microsoft does not claim any trade secret rights in this documentation. +- **Patents**. Microsoft has patents that might cover your implementations of the technologies described in the Open Specifications documentation. Neither this notice nor Microsoft's delivery of this documentation grants any licenses under those patents or any other Microsoft patents. However, a given Open Specifications document might be covered by the Microsoft [Open Specifications Promise](http://go.microsoft.com/fwlink/?LinkId=214445) or the [Microsoft Community Promise](http://go.microsoft.com/fwlink/?LinkId=214448). If you would prefer a written license, or if the technologies described in this documentation are not covered by the Open Specifications Promise or Community Promise, as applicable, patent licenses are available by contacting [iplg@microsoft.com](mailto:iplg@microsoft.com). +- **Trademarks**. The names of companies and products contained in this documentation might be covered by trademarks or similar intellectual property rights. This notice does not grant any licenses under those rights. For a list of Microsoft trademarks, visit [www.microsoft.com/trademarks](http://www.microsoft.com/trademarks). +- **Fictitious Names**. The example companies, organizations, products, domain names, email addresses, logos, people, places, and events that are depicted in this documentation are fictitious. No association with any real company, organization, product, domain name, email address, logo, person, place, or event is intended or should be inferred. + +**Reservation of Rights**. All other rights are reserved, and this notice does not grant any rights other than as specifically described above, whether by implication, estoppel, or otherwise. + +**Tools**. The Open Specifications documentation does not require the use of Microsoft programming tools or programming environments in order for you to develop an implementation. If you have access to Microsoft programming tools and environments, you are free to take advantage of them. Certain Open Specifications documents are intended for use in conjunction with publicly available standards specifications and network programming art and, as such, assume that the reader either is familiar with the aforementioned material or has immediate access to it. + +**Revision Summary** + +| Date | Revision History | Revision Class | Comments | +| ---------- | ---------------- | -------------- | ---------------------------------------------------------------------------- | +| 4/3/2007 | 0.01 | New | Version 0.01 release | +| 7/3/2007 | 1.0 | Major | MLonghorn+90 | +| 7/20/2007 | 2.0 | Major | Updated and revised the technical content. | +| 8/10/2007 | 3.0 | Major | Updated and revised the technical content. | +| 9/28/2007 | 4.0 | Major | Updated and revised the technical content. | +| 10/23/2007 | 5.0 | Major | Updated and revised the technical content. | +| 11/30/2007 | 5.0.1 | Editorial | Changed language and formatting in the technical content. | +| 1/25/2008 | 5.0.2 | Editorial | Changed language and formatting in the technical content. | +| 3/14/2008 | 5.0.3 | Editorial | Changed language and formatting in the technical content. | +| 5/16/2008 | 6.0 | Major | Updated and revised the technical content. | +| 6/20/2008 | 7.0 | Major | Updated and revised the technical content. | +| 7/25/2008 | 8.0 | Major | Updated and revised the technical content. | +| 8/29/2008 | 9.0 | Major | Updated and revised the technical content. | +| 10/24/2008 | 10.0 | Major | Updated and revised the technical content. | +| 12/5/2008 | 11.0 | Major | Updated and revised the technical content. | +| 1/16/2009 | 12.0 | Major | Updated and revised the technical content. | +| 2/27/2009 | 13.0 | Major | Updated and revised the technical content. | +| 4/10/2009 | 14.0 | Major | Updated and revised the technical content. | +| 5/22/2009 | 15.0 | Major | Updated and revised the technical content. | +| 7/2/2009 | 16.0 | Major | Updated and revised the technical content. | +| 8/14/2009 | 17.0 | Major | Updated and revised the technical content. | +| 9/25/2009 | 18.0 | Major | Updated and revised the technical content. | +| 11/6/2009 | 19.0 | Major | Updated and revised the technical content. | +| 12/18/2009 | 20.0 | Major | Updated and revised the technical content. | +| 1/29/2010 | 21.0 | Major | Updated and revised the technical content. | +| 3/12/2010 | 22.0 | Major | Updated and revised the technical content. | +| 4/23/2010 | 23.0 | Major | Updated and revised the technical content. | +| 6/4/2010 | 24.0 | Major | Updated and revised the technical content. | +| 7/16/2010 | 25.0 | Major | Updated and revised the technical content. | +| 8/27/2010 | 26.0 | Major | Updated and revised the technical content. | +| 10/8/2010 | 27.0 | Major | Updated and revised the technical content. | +| 11/19/2010 | 28.0 | Major | Updated and revised the technical content. | +| 1/7/2011 | 29.0 | Major | Updated and revised the technical content. | +| 2/11/2011 | 30.0 | Major | Updated and revised the technical content. | +| 3/25/2011 | 31.0 | Major | Updated and revised the technical content. | +| 5/6/2011 | 32.0 | Major | Updated and revised the technical content. | +| 6/17/2011 | 33.0 | Major | Updated and revised the technical content. | +| 9/23/2011 | 34.0 | Major | Updated and revised the technical content. | +| 12/16/2011 | 35.0 | Major | Updated and revised the technical content. | +| 3/30/2012 | 36.0 | Major | Updated and revised the technical content. | +| 7/12/2012 | 37.0 | Major | Updated and revised the technical content. | +| 10/25/2012 | 38.0 | Major | Updated and revised the technical content. | +| 1/31/2013 | 39.0 | Major | Updated and revised the technical content. | +| 8/8/2013 | 40.0 | Major | Updated and revised the technical content. | +| 11/14/2013 | 41.0 | Major | Updated and revised the technical content. | +| 2/13/2014 | 42.0 | Major | Updated and revised the technical content. | +| 5/15/2014 | 43.0 | Major | Updated and revised the technical content. | +| 6/30/2015 | 44.0 | Major | Significantly changed the technical content. | +| 10/16/2015 | 44.0 | None | No changes to the meaning, language, or formatting of the technical content. | +| 7/14/2016 | 45.0 | Major | Significantly changed the technical content. | + +Table of Contents + +[1 Introduction 9](#_Toc456184877) + +[1.1 Glossary 9](#_Toc456184878) + +[1.2 References 14](#_Toc456184879) + +[1.2.1 Normative References 14](#_Toc456184880) + +[1.2.2 Informative References 15](#_Toc456184881) + +[1.3 Overview 16](#_Toc456184882) + +[1.4 Relationship to Other Protocols 16](#_Toc456184883) + +[1.5 Prerequisites/Preconditions 18](#_Toc456184884) + +[1.6 Applicability Statement 18](#_Toc456184885) + +[1.7 Versioning and Capability Negotiation 19](#_Toc456184886) + +[1.8 Vendor-Extensible Fields 19](#_Toc456184887) + +[1.9 Standards Assignments 19](#_Toc456184888) + +[2 Messages 21](#_Toc456184889) + +[2.1 Transport 21](#_Toc456184890) + +[2.2 Message Syntax 21](#_Toc456184891) + +[2.2.1 Common Data Type Extensions 22](#_Toc456184892) + +[2.2.1.1 Character Sequences 22](#_Toc456184893) + +[2.2.1.1.1 Pathname Extensions 22](#_Toc456184894) + +[2.2.1.2 File Attributes 23](#_Toc456184895) + +[2.2.1.2.1 Extended File Attribute (SMB_EXT_FILE_ATTR) Extensions 23](#_Toc456184896) + +[2.2.1.2.2 File System Attribute Extensions 24](#_Toc456184897) + +[2.2.1.3 Unique Identifiers 25](#_Toc456184898) + +[2.2.1.3.1 FileId Generation 26](#_Toc456184899) + +[2.2.1.3.2 VolumeGUID Generation 26](#_Toc456184900) + +[2.2.1.3.3 Copychunk Resume Key Generation 26](#_Toc456184901) + +[2.2.1.4 Access Masks 26](#_Toc456184902) + +[2.2.1.4.1 File_Pipe_Printer_Access_Mask 26](#_Toc456184903) + +[2.2.1.4.2 Directory_Access_Mask 28](#_Toc456184904) + +[2.2.2 Defined Constant Extensions 30](#_Toc456184905) + +[2.2.2.1 SMB_COM Command Codes 30](#_Toc456184906) + +[2.2.2.2 Transaction Subcommand Codes 30](#_Toc456184907) + +[2.2.2.3 Information Level Codes 30](#_Toc456184908) + +[2.2.2.3.1 FIND Information Level Codes 30](#_Toc456184909) + +[2.2.2.3.2 QUERY_FS Information Level Codes 31](#_Toc456184910) + +[2.2.2.3.3 QUERY Information Level Codes 31](#_Toc456184911) + +[2.2.2.3.4 SET Information Level Codes 31](#_Toc456184912) + +[2.2.2.3.5 Pass-through Information Level Codes 31](#_Toc456184913) + +[2.2.2.3.6 Other Information Level Codes 31](#_Toc456184914) + +[2.2.2.4 SMB Error Classes and Codes 31](#_Toc456184915) + +[2.2.2.5 Session Key Protection Hash 33](#_Toc456184916) + +[2.2.3 SMB Message Structure Extensions 34](#_Toc456184917) + +[2.2.3.1 SMB Header Extensions 34](#_Toc456184918) + +[2.2.4 SMB Command Extensions 36](#_Toc456184919) + +[2.2.4.1 SMB_COM_OPEN_ANDX (0x2D) 36](#_Toc456184920) + +[2.2.4.1.1 Client Request Extensions 36](#_Toc456184921) + +[2.2.4.1.2 Server Response Extensions 37](#_Toc456184922) + +[2.2.4.2 SMB_COM_READ_ANDX (0x2E) 39](#_Toc456184923) + +[2.2.4.2.1 Client Request Extensions 39](#_Toc456184924) + +[2.2.4.2.2 Server Response Extensions 41](#_Toc456184925) + +[2.2.4.3 SMB_COM_WRITE_ANDX (0x2F) 42](#_Toc456184926) + +[2.2.4.3.1 Client Request Extensions 42](#_Toc456184927) + +[2.2.4.3.2 Server Response Extensions 43](#_Toc456184928) + +[2.2.4.4 SMB_COM_TRANSACTION2 (0x32) Extensions 44](#_Toc456184929) + +[2.2.4.5 SMB_COM_NEGOTIATE (0x72) 44](#_Toc456184930) + +[2.2.4.5.1 Client Request Extensions 44](#_Toc456184931) + +[2.2.4.5.2 Server Response Extensions 44](#_Toc456184932) + +[2.2.4.5.2.1 Extended Security Response 44](#_Toc456184933) + +[2.2.4.5.2.2 Non-Extended Security Response 49](#_Toc456184934) + +[2.2.4.6 SMB_COM_SESSION_SETUP_ANDX (0x73) 52](#_Toc456184935) + +[2.2.4.6.1 Client Request Extensions 52](#_Toc456184936) + +[2.2.4.6.2 Server Response Extensions 54](#_Toc456184937) + +[2.2.4.7 SMB_COM_TREE_CONNECT_ANDX (0x75) 57](#_Toc456184938) + +[2.2.4.7.1 Client Request Extensions 57](#_Toc456184939) + +[2.2.4.7.2 Server Response Extensions 58](#_Toc456184940) + +[2.2.4.8 SMB_COM_NT_TRANSACT (0xA0) Extensions 60](#_Toc456184941) + +[2.2.4.9 SMB_COM_NT_CREATE_ANDX (0xA2) 60](#_Toc456184942) + +[2.2.4.9.1 Client Request Extensions 60](#_Toc456184943) + +[2.2.4.9.2 Server Response Extensions 62](#_Toc456184944) + +[2.2.4.10 SMB_COM_SEARCH (0x81) Extensions 65](#_Toc456184945) + +[2.2.5 Transaction Subcommand Extensions 66](#_Toc456184946) + +[2.2.5.1 TRANS_RAW_READ_NMPIPE (0x0011) 66](#_Toc456184947) + +[2.2.5.2 TRANS_CALL_NMPIPE (0x0054) 66](#_Toc456184948) + +[2.2.6 Transaction 2 Subcommand Extensions 66](#_Toc456184949) + +[2.2.6.1 TRANS2_FIND_FIRST2 (0x0001) 66](#_Toc456184950) + +[2.2.6.1.1 Client Request Extensions 66](#_Toc456184951) + +[2.2.6.1.2 Server Response Extensions 66](#_Toc456184952) + +[2.2.6.2 TRANS2_FIND_NEXT2 (0x0002) 67](#_Toc456184953) + +[2.2.6.2.1 Client Request Extensions 67](#_Toc456184954) + +[2.2.6.2.2 Server Response Extensions 67](#_Toc456184955) + +[2.2.6.3 TRANS2_QUERY_FS_INFORMATION (0x0003) 67](#_Toc456184956) + +[2.2.6.3.1 Client Request Extensions 67](#_Toc456184957) + +[2.2.6.3.2 Server Response Extensions 67](#_Toc456184958) + +[2.2.6.4 TRANS2_SET_FS_INFORMATION (0x0004) 67](#_Toc456184959) + +[2.2.6.4.1 Client Request 67](#_Toc456184960) + +[2.2.6.4.2 Server Response 68](#_Toc456184961) + +[2.2.6.5 TRANS2_QUERY_PATH_INFORMATION (0x0005) 69](#_Toc456184962) + +[2.2.6.5.1 Client Request Extensions 69](#_Toc456184963) + +[2.2.6.5.2 Server Response Extensions 70](#_Toc456184964) + +[2.2.6.6 TRANS2_SET_PATH_INFORMATION (0x0006) 70](#_Toc456184965) + +[2.2.6.6.1 Client Request Extensions 70](#_Toc456184966) + +[2.2.6.6.2 Server Response Extensions 70](#_Toc456184967) + +[2.2.6.7 TRANS2_QUERY_FILE_INFORMATION (0x0007) 70](#_Toc456184968) + +[2.2.6.7.1 Client Request Extensions 70](#_Toc456184969) + +[2.2.6.7.2 Server Response Extensions 70](#_Toc456184970) + +[2.2.6.8 TRANS2_SET_FILE_INFORMATION (0x0008) 70](#_Toc456184971) + +[2.2.6.8.1 Client Request Extensions 70](#_Toc456184972) + +[2.2.6.8.2 Server Response Extensions 71](#_Toc456184973) + +[2.2.7 NT Transact Subcommand Extensions 71](#_Toc456184974) + +[2.2.7.1 NT_TRANSACT_CREATE (0x0001) Extensions 71](#_Toc456184975) + +[2.2.7.1.1 Client Request Extensions 71](#_Toc456184976) + +[2.2.7.1.2 Server Response Extensions 73](#_Toc456184977) + +[2.2.7.2 NT_TRANSACT_IOCTL (0x0002) 76](#_Toc456184978) + +[2.2.7.2.1 Client Request Extensions 76](#_Toc456184979) + +[2.2.7.2.1.1 SRV_COPYCHUNK 78](#_Toc456184980) + +[2.2.7.2.2 Server Response Extensions 79](#_Toc456184981) + +[2.2.7.2.2.1 FSCTL_SRV_ENUMERATE_SNAPSHOTS Response 79](#_Toc456184982) + +[2.2.7.2.2.2 FSCTL_SRV_REQUEST_RESUME_KEY Response 80](#_Toc456184983) + +[2.2.7.2.2.3 FSCTL_SRV_COPYCHUNK Response 81](#_Toc456184984) + +[2.2.7.3 NT_TRANSACT_SET_SECURITY_DESC (0x0003) Extensions 82](#_Toc456184985) + +[2.2.7.4 NT_TRANSACT_QUERY_SECURITY_DESC (0x0006) Extensions 83](#_Toc456184986) + +[2.2.7.5 NT_TRANSACT_QUERY_QUOTA (0x0007) 83](#_Toc456184987) + +[2.2.7.5.1 Client Request 84](#_Toc456184988) + +[2.2.7.5.2 Server Response 85](#_Toc456184989) + +[2.2.7.6 NT_TRANSACT_SET_QUOTA (0x0008) 87](#_Toc456184990) + +[2.2.7.6.1 Client Request 87](#_Toc456184991) + +[2.2.7.6.2 Server Response 88](#_Toc456184992) + +[2.2.8 Information Levels 89](#_Toc456184993) + +[2.2.8.1 FIND Information Level Extensions 90](#_Toc456184994) + +[2.2.8.1.1 SMB_FIND_FILE_BOTH_DIRECTORY_INFO Extensions 90](#_Toc456184995) + +[2.2.8.1.2 SMB_FIND_FILE_ID_FULL_DIRECTORY_INFO 92](#_Toc456184996) + +[2.2.8.1.3 SMB_FIND_FILE_ID_BOTH_DIRECTORY_INFO 93](#_Toc456184997) + +[2.2.8.2 QUERY_FS Information Level Extensions 95](#_Toc456184998) + +[2.2.8.2.1 SMB_QUERY_FS_ATTRIBUTE_INFO 95](#_Toc456184999) + +[2.2.8.3 QUERY Information Level Extensions 95](#_Toc456185000) + +[2.2.8.4 SET Information level Extensions 96](#_Toc456185001) + +[3 Protocol Details 97](#_Toc456185002) + +[3.1 Common Details 97](#_Toc456185003) + +[3.1.1 Abstract Data Model 97](#_Toc456185004) + +[3.1.1.1 Global 97](#_Toc456185005) + +[3.1.2 Timers 97](#_Toc456185006) + +[3.1.3 Initialization 97](#_Toc456185007) + +[3.1.4 Higher-Layer Triggered Events 97](#_Toc456185008) + +[3.1.4.1 Sending Any Message 97](#_Toc456185009) + +[3.1.5 Message Processing Events and Sequencing Rules 98](#_Toc456185010) + +[3.1.5.1 Receiving Any Message 98](#_Toc456185011) + +[3.1.6 Timer Events 98](#_Toc456185012) + +[3.1.7 Other Local Events 98](#_Toc456185013) + +[3.2 Client Details 98](#_Toc456185014) + +[3.2.1 Abstract Data Model 98](#_Toc456185015) + +[3.2.1.1 Global 98](#_Toc456185016) + +[3.2.1.2 Per SMB Connection 99](#_Toc456185017) + +[3.2.1.3 Per SMB Session 99](#_Toc456185018) + +[3.2.1.4 Per Tree Connect 99](#_Toc456185019) + +[3.2.1.5 Per Unique Open 99](#_Toc456185020) + +[3.2.2 Timers 99](#_Toc456185021) + +[3.2.3 Initialization 100](#_Toc456185022) + +[3.2.4 Higher-Layer Triggered Events 100](#_Toc456185023) + +[3.2.4.1 Sending Any Message 100](#_Toc456185024) + +[3.2.4.1.1 Scanning a Path for a Previous Version Token 100](#_Toc456185025) + +[3.2.4.2 Application Requests Connecting to a Share 100](#_Toc456185026) + +[3.2.4.2.1 Connection Establishment 100](#_Toc456185027) + +[3.2.4.2.2 Dialect Negotiation 100](#_Toc456185028) + +[3.2.4.2.3 Capabilities Negotiation 101](#_Toc456185029) + +[3.2.4.2.4 User Authentication 101](#_Toc456185030) + +[3.2.4.2.4.1 Sequence Diagram 102](#_Toc456185031) + +[3.2.4.2.5 Connecting to the Share (Tree Connect) 104](#_Toc456185032) + +[3.2.4.3 Application Requests Opening a File 104](#_Toc456185033) + +[3.2.4.3.1 SMB_COM_NT_CREATE_ANDX Request 105](#_Toc456185034) + +[3.2.4.3.2 SMB_COM_OPEN_ANDX Request (deprecated) 105](#_Toc456185035) + +[3.2.4.4 Application Requests Reading from a File, Named Pipe, or Device 105](#_Toc456185036) + +[3.2.4.4.1 Large Read Support 105](#_Toc456185037) + +[3.2.4.5 Application Requests Writing to a File, Named Pipe, or Device 106](#_Toc456185038) + +[3.2.4.6 Application Requests a Directory Enumeration 106](#_Toc456185039) + +[3.2.4.7 Application Requests Querying File Attributes 106](#_Toc456185040) + +[3.2.4.8 Application Requests Setting File Attributes 107](#_Toc456185041) + +[3.2.4.9 Application Requests Querying File System Attributes 107](#_Toc456185042) + +[3.2.4.10 Application Requests Setting File System Attributes 108](#_Toc456185043) + +[3.2.4.11 Application Requests Sending an I/O Control to a File or Device 108](#_Toc456185044) + +[3.2.4.11.1 Application Requests Enumerating Available Previous Versions 108](#_Toc456185045) + +[3.2.4.11.2 Performing a Server-Side Data Copy 108](#_Toc456185046) + +[3.2.4.11.2.1 Application queries the Copychunk Resume Key of the Source File 109](#_Toc456185047) + +[3.2.4.11.2.2 Application requests a Server-side Data Copy 109](#_Toc456185048) + +[3.2.4.12 Application Requests Querying of DFS Referral 110](#_Toc456185049) + +[3.2.4.13 Application Requests Querying User Quota Information 110](#_Toc456185050) + +[3.2.4.14 Application Requests Setting User Quota Information 111](#_Toc456185051) + +[3.2.4.15 Application Requests the Session Key for a Connection 111](#_Toc456185052) + +[3.2.5 Message Processing Events and Sequencing Rules 112](#_Toc456185053) + +[3.2.5.1 Receiving Any Message 112](#_Toc456185054) + +[3.2.5.2 Receiving an SMB_COM_NEGOTIATE Response 112](#_Toc456185055) + +[3.2.5.3 Receiving an SMB_COM_SESSION_SETUP_ANDX Response 112](#_Toc456185056) + +[3.2.5.4 Receiving an SMB_COM_TREE_CONNECT_ANDX Response 114](#_Toc456185057) + +[3.2.5.5 Receiving an SMB_COM_NT_CREATE_ANDX Response 115](#_Toc456185058) + +[3.2.5.6 Receiving an SMB_COM_OPEN_ANDX Response 115](#_Toc456185059) + +[3.2.5.7 Receiving an SMB_COM_READ_ANDX Response 115](#_Toc456185060) + +[3.2.5.8 Receiving an SMB_COM_WRITE_ANDX Response 116](#_Toc456185061) + +[3.2.5.9 Receiving any SMB_COM_NT_TRANSACT Response 116](#_Toc456185062) + +[3.2.5.9.1 Receiving an NT_TRANSACT_IOCTL Response 116](#_Toc456185063) + +[3.2.5.9.1.1 Receiving an FSCTL_SRV_REQUEST_RESUME_KEY Function Code 116](#_Toc456185064) + +[3.2.5.9.1.2 Receiving an FSCTL_SRV_COPYCHUNK Function Code 116](#_Toc456185065) + +[3.2.5.9.2 Receiving an NT_TRANSACT_QUERY_QUOTA Response 116](#_Toc456185066) + +[3.2.5.9.3 Receiving an NT_TRANSACT_SET_QUOTA Response 116](#_Toc456185067) + +[3.2.5.10 Receiving an SMB_COM_SEARCH Response 116](#_Toc456185068) + +[3.2.5.11 Receiving any SMB_COM_TRANSACTION2 subcommand Response 117](#_Toc456185069) + +[3.2.5.11.1 Receiving any TRANS2_SET_FS_INFORMATION Response 117](#_Toc456185070) + +[3.2.6 Timer Events 117](#_Toc456185071) + +[3.2.7 Other Local Events 117](#_Toc456185072) + +[3.3 Server Details 117](#_Toc456185073) + +[3.3.1 Abstract Data Model 117](#_Toc456185074) + +[3.3.1.1 Global 117](#_Toc456185075) + +[3.3.1.2 Per Share 118](#_Toc456185076) + +[3.3.1.3 Per SMB Connection 118](#_Toc456185077) + +[3.3.1.4 Per Pending SMB Command 118](#_Toc456185078) + +[3.3.1.5 Per SMB Session 118](#_Toc456185079) + +[3.3.1.6 Per Tree Connect 118](#_Toc456185080) + +[3.3.1.7 Per Unique Open 118](#_Toc456185081) + +[3.3.2 Timers 118](#_Toc456185082) + +[3.3.2.1 Authentication Expiration Timer 118](#_Toc456185083) + +[3.3.3 Initialization 119](#_Toc456185084) + +[3.3.4 Higher-Layer Triggered Events 119](#_Toc456185085) + +[3.3.4.1 Sending Any Message 119](#_Toc456185086) + +[3.3.4.1.1 Sending Any Error Response Message 119](#_Toc456185087) + +[3.3.4.2 Server Application Queries a User Session Key 119](#_Toc456185088) + +[3.3.4.3 DFS Server Notifies SMB Server That DFS Is Active 120](#_Toc456185089) + +[3.3.4.4 DFS Server Notifies SMB Server That a Share Is a DFS Share 120](#_Toc456185090) + +[3.3.4.5 DFS Server Notifies SMB Server That a Share Is Not a DFS Share 120](#_Toc456185091) + +[3.3.4.6 Server Application Updates a Share 120](#_Toc456185092) + +[3.3.4.7 Server Application Requests Querying a Share 120](#_Toc456185093) + +[3.3.5 Message Processing Events and Sequencing Rules 121](#_Toc456185094) + +[3.3.5.1 Receiving Any Message 121](#_Toc456185095) + +[3.3.5.1.1 Scanning a Path for a Previous Version Token 122](#_Toc456185096) + +[3.3.5.1.2 Granting Oplocks 122](#_Toc456185097) + +[3.3.5.2 Receiving an SMB_COM_NEGOTIATE Request 122](#_Toc456185098) + +[3.3.5.3 Receiving an SMB_COM_SESSION_SETUP_ANDX Request 123](#_Toc456185099) + +[3.3.5.4 Receiving an SMB_COM_TREE_CONNECT_ANDX Request 125](#_Toc456185100) + +[3.3.5.5 Receiving an SMB_COM_NT_CREATE_ANDX Request 126](#_Toc456185101) + +[3.3.5.6 Receiving an SMB_COM_OPEN_ANDX Request 127](#_Toc456185102) + +[3.3.5.7 Receiving an SMB_COM_READ_ANDX Request 128](#_Toc456185103) + +[3.3.5.8 Receiving an SMB_COM_WRITE_ANDX Request 128](#_Toc456185104) + +[3.3.5.9 Receiving an SMB_COM_SEARCH Request 129](#_Toc456185105) + +[3.3.5.10 Receiving any SMB_COM_TRANSACTION2 subcommand 129](#_Toc456185106) + +[3.3.5.10.1 Receiving any Information Level 129](#_Toc456185107) + +[3.3.5.10.2 Receiving a TRANS2_FIND_FIRST2 Request 129](#_Toc456185108) + +[3.3.5.10.3 Receiving a TRANS2_FIND_NEXT2 Request 129](#_Toc456185109) + +[3.3.5.10.4 Receiving a TRANS2_QUERY_FILE_INFORMATION Request 130](#_Toc456185110) + +[3.3.5.10.5 Receiving a TRANS2_QUERY_PATH_INFORMATION Request 130](#_Toc456185111) + +[3.3.5.10.6 Receiving a TRANS2_SET_FILE_INFORMATION Request 130](#_Toc456185112) + +[3.3.5.10.7 Receiving a TRANS2_SET_PATH_INFORMATION Request 130](#_Toc456185113) + +[3.3.5.10.8 Receiving a TRANS2_QUERY_FS_INFORMATION Request 130](#_Toc456185114) + +[3.3.5.10.9 Receiving a TRANS2_SET_FS_INFORMATION Request 130](#_Toc456185115) + +[3.3.5.11 Receiving any SMB_COM_NT_TRANSACT Subcommand 130](#_Toc456185116) + +[3.3.5.11.1 Receiving an NT_TRANSACT_IOCTL Request 130](#_Toc456185117) + +[3.3.5.11.1.1 Receiving an FSCTL_SRV_ENUMERATE_SNAPSHOTS Function Code 131](#_Toc456185118) + +[3.3.5.11.1.2 Receiving an FSCTL_SRV_REQUEST_RESUME_KEY Function Code 131](#_Toc456185119) + +[3.3.5.11.1.3 Receiving an FSCTL_SRV_COPYCHUNK Request 131](#_Toc456185120) + +[3.3.5.11.2 Receiving an NT_TRANS_QUERY_QUOTA Request 132](#_Toc456185121) + +[3.3.5.11.3 Receiving an NT_TRANS_SET_QUOTA Request 132](#_Toc456185122) + +[3.3.5.11.4 Receiving an NT_TRANSACT_CREATE Request 133](#_Toc456185123) + +[3.3.6 Timer Events 133](#_Toc456185124) + +[3.3.6.1 Authentication Expiration Timer Event 133](#_Toc456185125) + +[3.3.7 Other Local Events 133](#_Toc456185126) + +[4 Protocol Examples 134](#_Toc456185127) + +[4.1 Extended Security Authentication 134](#_Toc456185128) + +[4.2 Previous File Version Enumeration 136](#_Toc456185129) + +[4.3 Message Signing Example 139](#_Toc456185130) + +[4.4 Copy File (Remote to Local) 141](#_Toc456185131) + +[4.5 Copy File (Local to Remote) 144](#_Toc456185132) + +[4.6 FSCTL SRV COPYCHUNK 147](#_Toc456185133) + +[4.7 TRANS TRANSACT NMPIPE 153](#_Toc456185134) + +[5 Security 157](#_Toc456185135) + +[5.1 Security Considerations for Implementers 157](#_Toc456185136) + +[5.2 Index of Security Parameters 157](#_Toc456185137) + +[6 Appendix A: Product Behavior 158](#_Toc456185138) + +[7 Change Tracking 177](#_Toc456185139) + +[8 Index 179](#_Toc456185140) + +# Introduction + +The Server Message Block (SMB) Version 1.0 Protocol defines extensions to the Common Internet File System (CIFS) Protocol, which is specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b). Unless specifically extended or overridden in this document, all specifications and behaviors that are described for Windows NT operating system clients and servers in \[MS-CIFS\] apply to the Windows client and server implementations covered in this document. The list of Windows client and server implementations covered in this document is provided in section [6](#Section_ecd51ae2478c455b8669254b74208d3b). + +Unless otherwise noted, this document only provides the extensions made to the CIFS Protocol relative to the specification in \[MS-CIFS\]. The extended CIFS Protocol is known as the Server Message Block (SMB) Version 1.0 Protocol. Both this document and \[MS-CIFS\] are required in order to create a complete implementation of the Server Message Block (SMB) Version 1.0 Protocol. + +This document also defines Windows behavior with respect to optional behavior that is described in the specifications of the SMB extensions. + +Sections 1.5, 1.8, 1.9, 2, and 3 of this specification are normative. All other sections and examples in this specification are informative. + +## Glossary + +This document uses the following terms: + +**@GMT token**: A special token that can be present as part of a file path to indicate a request to see a previous version of the file or directory. The format is "@GMT-YYYY.MM.DD-HH.MM.SS". This 16-bit [**Unicode string**](#gt_b069acb4-e364-453e-ac83-42d469bb339e) represents a time and date in [**Coordinated Universal Time (UTC)**](#gt_f2369991-a884-4843-a8fa-1505b6d5ece7), with YYYY representing the year, MM the month, DD the day, HH the hour, MM the minute, and SS the seconds. + +**8.3 name**: A file name string restricted in length to 12 characters that includes a base name of up to eight characters, one character for a period, and up to three characters for a file name extension. For more information on 8.3 file names, see [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.1.1.1. + +**byte mode**: One of two kinds of [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca), the other of which is [**message mode**](#gt_c49a48e8-f1ac-4568-bc87-0672eb08868b). In byte mode, the data sent or received on the named pipe does not have message boundaries but is treated as a continuous stream. \[XOPEN-SMB\] uses the term stream mode instead of byte mode, and [\[SMB-LM1X\]](http://go.microsoft.com/fwlink/?LinkId=164302) refers to byte mode as byte stream mode. + +**Common Internet File System (CIFS)**: The "NT LM 0.12" / NT LAN Manager dialect of the [**Server Message Block (SMB)**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) Protocol, as implemented in Windows NT. The CIFS name originated in the 1990's as part of an attempt to create an Internet standard for [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625), based upon the then-current Windows NT implementation. + +**Coordinated Universal Time (UTC)**: A high-precision atomic time standard that approximately tracks Universal Time (UT). It is the basis for legal, civil time all over the Earth. Time zones around the world are expressed as positive and negative offsets from UTC. In this role, it is also referred to as Zulu time (Z) and Greenwich Mean Time (GMT). In these specifications, all references to UTC refer to the time at UTC-0 (or GMT). + +**Copychunk Resume Key**: A 24-byte value generated by a [**Server Message Block (SMB)**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) server in response to a request by an [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) client that uniquely identifies an open file on the [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) server. A [**Copychunk Resume Key**](#gt_7a86a8b5-6ac4-471d-aa3c-9b2bb4638700) is used by [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) server-side data movement operations between files without requiring the data to be read by the client and then written back to the server. Note that this is different from the resume key specified in \[MS-CIFS\] section 2.2.6.2 that is returned by the server in response to a TRANS2_FIND_FIRST2 subcommand of an SMB_COM_TRANSACTION2 client request. + +**deprecated**: A deprecated feature is one that has been superseded in the protocol by a newer feature. Use of deprecated features is discouraged. Server implementations might need to implement deprecated features to support clients that negotiate earlier [**SMB dialects**](#gt_29b8d978-7450-42b5-845c-045fc72b0fe1). + +**discretionary access control list (DACL)**: An access control list (ACL) that is controlled by the owner of an object and that specifies the access particular users or groups can have to the object. + +**Distributed File System (DFS)**: A file system that logically groups physical shared folders located on different servers by transparently connecting them to one or more hierarchical namespaces. [**DFS**](#gt_0b8086c9-d025-45b8-bf09-6b5eca72713e) also provides fault-tolerance and load-sharing capabilities. [**DFS**](#gt_0b8086c9-d025-45b8-bf09-6b5eca72713e) refers to the Microsoft DFS available in Windows Server operating system platforms. + +**domain**: A set of users and computers sharing a common namespace and management infrastructure. At least one computer member of the set must act as a domain controller (DC) and host a member list that identifies all members of the domain, as well as optionally hosting the Active Directory service. The domain controller provides authentication (2) of members, creating a unit of trust for its members. Each domain has an identifier that is shared among its members. For more information, see [\[MS-AUTHSOD\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-AUTHSOD%5d.pdf#Section_953d700a57cb4cf7b0c3a64f34581cc9) section 1.1.1.5 and [\[MS-ADTS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-ADTS%5d.pdf#Section_d243592709994c628c6d13ba31a52e1a). + +**Fid**: A 16-bit value that the [**Server Message Block (SMB)**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) server uses to represent an opened file, [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca), printer, or device. A [**Fid**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) is returned by an [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) server in response to a client request to open or create a file, [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca), printer, or device. The [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) server guarantees that the [**Fid**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) value returned is unique for a given [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) connection until the [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) connection is closed, at which time the [**Fid**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) value can be reused. The [**Fid**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) is used by the [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) client in subsequent [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) commands to identify the opened file, [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca), printer, or device. + +**file allocation table (FAT)**: A data structure that the operating system creates when a volume is formatted by using [**FAT**](#gt_f2bf797b-e733-4fb9-b5e5-7e122f4abbe0) or FAT32 file systems. The operating system stores information about each file in the [**FAT**](#gt_f2bf797b-e733-4fb9-b5e5-7e122f4abbe0) so that it can retrieve the file later. + +**file system control (FSCTL)**: A command issued to a file system to alter or query the behavior of the file system and/or set or query metadata that is associated with a particular file or with the file system itself. + +**FileId**: A 64-bit value that is used to represent a file. The value of a [**FileId**](#gt_3b097896-b707-47b5-b1bb-384867a453ea) is unique on a single volume of a local file system or a remote file server. A [**FileId**](#gt_3b097896-b707-47b5-b1bb-384867a453ea) is not guaranteed to be unique across volumes, but the file system on the server must guarantee that it is unique within a given volume if [**FileIds**](#gt_3b097896-b707-47b5-b1bb-384867a453ea) are supported. [**FileIds**](#gt_3b097896-b707-47b5-b1bb-384867a453ea) are not supported by all local file systems. On Windows, [**NTFS**](#gt_86f79a17-c0be-4937-8660-0cf6ce5ddc1a) supports [**FileIds**](#gt_3b097896-b707-47b5-b1bb-384867a453ea), but the [**file allocation table (FAT)**](#gt_f2bf797b-e733-4fb9-b5e5-7e122f4abbe0) file system does not support them. + +**guest account**: A security account available to users who do not have an account on the computer. + +**I/O control (IOCTL)**: A command that is issued to a target file system or target device in order to query or alter the behavior of the target; or to query or alter the data and attributes that are associated with the target or the objects that are exposed by the target. + +**information level**: A number used to identify the volume, file, or device information being requested by a client. Corresponding to each [**information level**](#gt_b01da706-86d0-4ee2-9461-2d9fb1060543), the server returns a specific structure to the client that contains different information in the response. + +**Key Distribution Center (KDC)**: The Kerberos service that implements the authentication (2) and ticket granting services specified in the Kerberos protocol. The service runs on computers selected by the administrator of the realm or domain; it is not present on every machine on the network. It must have access to an account database for the realm that it serves. Windows [**KDCs**](#gt_6e5aafba-6b66-4fdd-872e-844f142af287) are integrated into the domain controller role of a Windows Server acting as a Domain Controller. It is a network service that supplies tickets to clients for use in authenticating to services. + +**little-endian**: Multiple-byte values that are byte-ordered with the least significant byte stored in the memory location with the lowest address. + +**message mode**: A named pipe can be of two types: byte mode or [**message mode**](#gt_c49a48e8-f1ac-4568-bc87-0672eb08868b). In byte mode, the data sent or received on the named pipe does not have message boundaries but is treated as a continuous Stream. In message mode, message boundaries are enforced. + +**named pipe**: A named, one-way, or duplex pipe for communication between a pipe server and one or more pipe clients. + +**network byte order**: The order in which the bytes of a multiple-byte number are transmitted on a network, most significant byte first (in big-endian storage). This may or may not match the order in which numbers are normally stored in memory for a particular processor. + +**NT file system (NTFS)**: A proprietary Microsoft file system. For more information, see [\[MSFT-NTFS\]](http://go.microsoft.com/fwlink/?LinkId=90200). + +**object store**: A system that provides the ability to create, query, modify, or apply policy to a local resource on behalf of a remote client. The object store is backed by a file system, a named pipe, or a print job that is accessed as a file. + +**Obsolescent**: A feature that has no replacement but is becoming obsolete. Although the use of obsolescent features is discouraged, server implementations might need to implement them to support clients that negotiate earlier [**SMB dialects**](#gt_29b8d978-7450-42b5-845c-045fc72b0fe1). + +**open**: A runtime object that corresponds to a currently established access to a specific file or a named pipe from a specific client to a specific server, using a specific user security context. Both clients and servers maintain opens that represent active accesses. + +**oplock break**: An unsolicited request sent by a [**Server Message Block (SMB)**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) server to an [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) client to inform the client to change the [**oplock**](#gt_7b8c743e-84b1-4c7e-83ea-cfb818cdb394) level for a file. + +**opportunistic lock (oplock)**: A mechanism designed to allow clients to dynamically alter their buffering strategy in a consistent manner to increase performance and reduce network use. The network performance for remote file operations may be increased if a client can locally buffer file data, which reduces or eliminates the need to send and receive network packets. For example, a client may not have to write information into a file on a remote server if the client knows that no other process is accessing the data. Likewise, the client may buffer read-ahead data from the remote file if the client knows that no other process is writing data to the remote file. There are three types of [**oplocks**](#gt_7b8c743e-84b1-4c7e-83ea-cfb818cdb394): Exclusive oplock allows a client to open a file for exclusive access and allows the client to perform arbitrary buffering. Batch oplock allows a client to keep a file open on the server even though the local accessor on the client machine has closed the file. Level II oplock indicates that there are multiple readers of a file and no writers. Level II Oplocks are supported if the negotiated SMB Dialect is NT LM 0.12 or later. When a client opens a file, it requests the server to grant it a particular type of [**oplock**](#gt_7b8c743e-84b1-4c7e-83ea-cfb818cdb394) on the file. The response from the server indicates the type of [**oplock**](#gt_7b8c743e-84b1-4c7e-83ea-cfb818cdb394) granted to the client. The client uses the granted [**oplock**](#gt_7b8c743e-84b1-4c7e-83ea-cfb818cdb394) type to adjust its buffering policy. + +**original equipment manufacturer (OEM) character**: An 8-bit encoding used in MS-DOS and Windows operating systems to associate a sequence of bits with specific characters. The ASCII character set maps the letters, numerals, and specified punctuation and control characters to the numbers from 0 to 127. The term "code page" is used to refer to extensions of the ASCII character set that map specified characters and symbols to the numbers from 128 to 255. These code pages are referred to as OEM character sets. For more information, see [\[MSCHARSET\]](http://go.microsoft.com/fwlink/?LinkId=89944). + +**process identifier (PID)**: A nonzero integer used by some operating systems (for example, Windows and UNIX) to uniquely identify a process. For more information, see [\[PROCESS\]](http://go.microsoft.com/fwlink/?LinkId=90251). + +**raw read (on a named pipe)**: The act of reading data from a [**named pipe**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca) that ignores message boundaries even if the pipe was set up as a [**message mode**](#gt_c49a48e8-f1ac-4568-bc87-0672eb08868b) pipe. + +**reparse point**: An attribute that can be added to a file to store a collection of user-defined data that is opaque to [**NTFS**](#gt_86f79a17-c0be-4937-8660-0cf6ce5ddc1a) or ReFS. If a file that has a reparse point is opened, the open will normally fail with STATUS_REPARSE, so that the relevant file system filter driver can detect the open of a file associated with (owned by) this reparse point. At that point, each installed filter driver can check to see if it is the owner of the reparse point, and, if so, perform any special processing required for a file with that reparse point. The format of this data is understood by the application that stores the data and the file system filter that interprets the data and processes the file. For example, an encryption filter that is marked as the owner of a file's reparse point could look up the encryption key for that file. A file can have (at most) 1 reparse point associated with it. For more information, see [\[MS-FSCC\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-FSCC%5d.pdf#Section_efbfe12773ad41409967ec6500e66d5e). + +**security context**: An abstract data structure that contains authorization information for a particular security principal in the form of a Token/Authorization Context (see [\[MS-DTYP\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-DTYP%5d.pdf#Section_cca2742956894a16b2b49325d93e4ba2) section 2.5.2). A server uses the authorization information in a [**security context**](#gt_88d49f20-6c95-4b64-a52c-c3eca2fe5709) to check access to requested resources. A [**security context**](#gt_88d49f20-6c95-4b64-a52c-c3eca2fe5709) also contains a key identifier that associates mutually established cryptographic keys, along with other information needed to perform secure communication with another security principal. + +**security descriptor**: A data structure containing the security information associated with a securable object. A [**security descriptor**](#gt_e5213722-75a9-44e7-b026-8e4833f0d350) identifies an object's owner by its [**security identifier (SID)**](#gt_83f2020d-0804-4840-a5ac-e06439d50f8d). If access control is configured for the object, its [**security descriptor**](#gt_e5213722-75a9-44e7-b026-8e4833f0d350) contains a [**discretionary access control list (DACL)**](#gt_d727f612-7a45-48e4-9d87-71735d62b321) with [**SIDs**](#gt_83f2020d-0804-4840-a5ac-e06439d50f8d) for the security principals who are allowed or denied access. Applications use this structure to set and query an object's security status. The [**security descriptor**](#gt_e5213722-75a9-44e7-b026-8e4833f0d350) is used to guard access to an object as well as to control which type of auditing takes place when the object is accessed. The [**security descriptor**](#gt_e5213722-75a9-44e7-b026-8e4833f0d350) format is specified in \[MS-DTYP\] section 2.4.6; a string representation of [**security descriptors**](#gt_e5213722-75a9-44e7-b026-8e4833f0d350), called SDDL, is specified in \[MS-DTYP\] section 2.5.1. + +**security identifier (SID)**: An identifier for security principals in Windows that is used to identify an account or a group. Conceptually, the [**SID**](#gt_83f2020d-0804-4840-a5ac-e06439d50f8d) is composed of an account authority portion (typically a [**domain**](#gt_b0276eb2-4e65-4cf1-a718-e0920a614aca)) and a smaller integer representing an identity relative to the account authority, termed the relative identifier (RID). The [**SID**](#gt_83f2020d-0804-4840-a5ac-e06439d50f8d) format is specified in \[MS-DTYP\] section 2.4.2; a string representation of [**SIDs**](#gt_83f2020d-0804-4840-a5ac-e06439d50f8d) is specified in \[MS-DTYP\] section 2.4.2 and [\[MS-AZOD\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-AZOD%5d.pdf#Section_5a0a0a3ec7a742e1b5f2cc8d8bd9739e) section 1.1.1.2. + +**security principal name (SPN)**: The name that identifies a security principal (for example, machinename\$@domainname for a machine joined to a domain or username@domainname for a user). Domainname is resolved using the Domain Name System (DNS). + +**Server Message Block (SMB)**: A protocol that is used to request file and print services from server systems over a network. The SMB protocol extends the CIFS protocol with additional security, file, and disk management support. For more information, see [\[CIFS\]](http://go.microsoft.com/fwlink/?LinkId=89836) and [\[MS-SMB\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-SMB%5d.pdf#Section_f210069c70864dc2885e861d837df688). + +**service principal name (SPN)**: The name a client uses to identify a service for mutual authentication. (For more information, see [\[RFC1964\]](http://go.microsoft.com/fwlink/?LinkId=90304) section 2.1.1.) An [**SPN**](#gt_547217ca-134f-4b43-b375-f5bca4c16ce4) consists of either two parts or three parts, each separated by a forward slash ('/'). The first part is the service class, the second part is the instance name, and the third part (if present) is the service name. For example, "ldap/dc-01.fabrikam.com/fabrikam.com" is a three-part [**SPN**](#gt_547217ca-134f-4b43-b375-f5bca4c16ce4) where "ldap" is the service class name, "dc-01.fabrikam.com" is the instance name, and "fabrikam.com" is the service name. See [\[SPNNAMES\]](http://go.microsoft.com/fwlink/?LinkId=90532) for more information about [**SPN**](#gt_547217ca-134f-4b43-b375-f5bca4c16ce4) format and composing a unique [**SPN**](#gt_547217ca-134f-4b43-b375-f5bca4c16ce4). + +**session**: In [**Server Message Block (SMB)**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625), a persistent-state association between an [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) client and [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) server. A [**session**](#gt_0cd96b80-a737-4f06-bca4-cf9efb449d12) is tied to the lifetime of the underlying NetBIOS or TCP connection. + +**shadow copy**: A duplicate of data held on a volume at a well-defined instant in time. + +**share**: A resource offered by a Common Internet File System (CIFS) server for access by CIFS clients over the network. A [**share**](#gt_a49a79ea-dac7-4016-9a84-cf87161db7e3) typically represents a directory tree and its included files (referred to commonly as a "disk share" or "file share") or a printer (a "print share"). If the information about the [**share**](#gt_a49a79ea-dac7-4016-9a84-cf87161db7e3) is saved in persistent store (for example, Windows registry) and reloaded when a file server is restarted, then the [**share**](#gt_a49a79ea-dac7-4016-9a84-cf87161db7e3) is referred to as a "sticky share". Some [**share**](#gt_a49a79ea-dac7-4016-9a84-cf87161db7e3) names are reserved for specific functions and are referred to as special [**shares**](#gt_a49a79ea-dac7-4016-9a84-cf87161db7e3): IPC\$, reserved for interprocess communication, ADMIN\$, reserved for remote administration, and A\$, B\$, C\$ (and other local disk names followed by a dollar sign), assigned to local disk devices. + +**share connect**: The act of establishing authentication and shared state between a Common Internet File System (CIFS) server and client that allows a CIFS client to access a [**share**](#gt_a49a79ea-dac7-4016-9a84-cf87161db7e3) offered by the CIFS server. + +**SMB command**: A set of SMB messages that are exchanged in order to perform an operation. An [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) command is typically identified by a unique command code in the message headers, although some [**SMB commands**](#gt_dbae2612-173d-4988-9301-86cb559029f9) require the use of secondary commands. Within \[MS-CIFS\], the term command means an [**SMB command**](#gt_dbae2612-173d-4988-9301-86cb559029f9) unless otherwise stated. + +**SMB connection**: A transport connection between a [**Server Message Block (SMB)**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) client and an [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) server. The [**SMB connection**](#gt_e1d88514-18e6-4e2e-a459-20d5e17e9078) is assumed to provide reliable in-order message delivery semantics. An [**SMB connection**](#gt_e1d88514-18e6-4e2e-a459-20d5e17e9078) can be established over any available [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) transport that is supported by both the [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) client and the [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) server, as specified in \[MS-CIFS\]. + +**SMB dialect**: There are several different versions and subversions of the [**Server Message Block (SMB)**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) protocol. A particular version of the [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) protocol is referred to as an [**SMB dialect**](#gt_29b8d978-7450-42b5-845c-045fc72b0fe1). Different [**SMB dialects**](#gt_29b8d978-7450-42b5-845c-045fc72b0fe1) can include both new [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) messages as well as changes to the fields and semantics of existing [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) messages used in other [**SMB dialects**](#gt_29b8d978-7450-42b5-845c-045fc72b0fe1). When an [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) client connects to an [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) server, the client and server negotiate the [**SMB dialect**](#gt_29b8d978-7450-42b5-845c-045fc72b0fe1) to be used. + +**SMB message**: A protocol data unit. [**SMB messages**](#gt_fb37399e-d72d-41b6-b073-086da2d96e09) are comprised of a header, a parameter section, and a data section. The latter two can be zero length. An [**SMB message**](#gt_1308cf27-6aba-4d86-b38d-7926ba662311) is sometimes referred to simply as an SMB. Within \[MS-CIFS\], the term command means an [**SMB command**](#gt_dbae2612-173d-4988-9301-86cb559029f9) unless otherwise stated. + +**SMB session**: An authenticated user connection established between an [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) client and an [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) server over an [**SMB connection**](#gt_e1d88514-18e6-4e2e-a459-20d5e17e9078). There can be multiple active [**SMB sessions**](#gt_ee1ec898-536f-41c4-9d90-b4f7d981fd67) over a single [**SMB connection**](#gt_e1d88514-18e6-4e2e-a459-20d5e17e9078). The Uid field in the [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625) packet header distinguishes the various sessions. + +**snapshot**: The point in time at which a [**shadow copy**](#gt_34537940-5a56-4122-b6ff-b9a4d065d066) of a volume is made. + +**stream**: A sequence of bytes written to a file on the [**NTFS**](#gt_86f79a17-c0be-4937-8660-0cf6ce5ddc1a) file system. Every file stored on a volume that uses the [**NTFS**](#gt_86f79a17-c0be-4937-8660-0cf6ce5ddc1a) file system contains at least one [**stream**](#gt_f3529cd8-50da-4f36-aa0b-66af455edbb6), which is normally used to store the primary contents of the file. Additional [**streams**](#gt_f3529cd8-50da-4f36-aa0b-66af455edbb6) within the file can be used to store file attributes, application parameters, or other information specific to that file. Every file has a default data [**stream**](#gt_f3529cd8-50da-4f36-aa0b-66af455edbb6), which is unnamed by default. That data [**stream**](#gt_f3529cd8-50da-4f36-aa0b-66af455edbb6), and any other data [**stream**](#gt_f3529cd8-50da-4f36-aa0b-66af455edbb6) associated with a file, can optionally be named. + +**system access control list (SACL)**: An access control list (ACL) that controls the generation of audit messages for attempts to access a securable object. The ability to get or set an object's [**SACL**](#gt_c189801e-3752-4715-88f4-17804dad5782) is controlled by a privilege typically held only by system administrators. + +**Transmission Control Protocol (TCP)**: A protocol used with the Internet Protocol (IP) to send data in the form of message units between computers over the Internet. TCP handles keeping track of the individual units of data (called packets) that a message is divided into for efficient routing through the Internet. + +**tree connect**: A connection between a CIFS client and a share on a remote CIFS server. + +**Unicode**: A character encoding standard developed by the Unicode Consortium that represents almost all of the written languages of the world. The [**Unicode**](#gt_c305d0ab-8b94-461a-bd76-13b40cb8c4d8) standard [\[UNICODE5.0.0/2007\]](http://go.microsoft.com/fwlink/?LinkId=154659) provides three forms (UTF-8, UTF-16, and UTF-32) and seven schemes (UTF-8, UTF-16, UTF-16 BE, UTF-16 LE, UTF-32, UTF-32 LE, and UTF-32 BE). + +**Unicode string**: A [**Unicode**](#gt_c305d0ab-8b94-461a-bd76-13b40cb8c4d8) 8-bit string is an ordered sequence of 8-bit units, a [**Unicode**](#gt_c305d0ab-8b94-461a-bd76-13b40cb8c4d8) 16-bit string is an ordered sequence of 16-bit code units, and a [**Unicode**](#gt_c305d0ab-8b94-461a-bd76-13b40cb8c4d8) 32-bit string is an ordered sequence of 32-bit code units. In some cases, it could be acceptable not to terminate with a terminating null character. Unless otherwise specified, all [**Unicode strings**](#gt_b069acb4-e364-453e-ac83-42d469bb339e) follow the UTF-16LE encoding scheme with no Byte Order Mark (BOM). + +**volume identifier (VolumeId)**: A 128-bit value used to represent a volume. The value of a [**VolumeId**](#gt_892a6724-e635-4ba0-8b8a-d6368f166221) is unique on a single computer (the local file system or a remote file server). + +**MAY, SHOULD, MUST, SHOULD NOT, MUST NOT:** These terms (in all caps) are used as defined in [\[RFC2119\]](http://go.microsoft.com/fwlink/?LinkId=90317). All statements of optional behavior use either MAY, SHOULD, or SHOULD NOT. + +## References + +Links to a document in the Microsoft Open Specifications library point to the correct section in the most recently published version of the referenced document. However, because individual documents in the library are not updated at the same time, the section numbers in the documents may not match. You can confirm the correct section numbering by checking the [Errata](http://msdn.microsoft.com/en-us/library/dn781092.aspx). + +### Normative References + +We conduct frequent surveys of the normative references to assure their continued availability. If you have any issue with finding a normative reference, please contact [dochelp@microsoft.com](mailto:dochelp@microsoft.com). We will assist you in finding the relevant information. + +\[IANAPORT\] IANA, "Service Name and Transport Protocol Port Number Registry", November 2006, [http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml](http://go.microsoft.com/fwlink/?LinkId=89888) + +\[MS-CIFS\] Microsoft Corporation, "[Common Internet File System (CIFS) Protocol](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b)". + +\[MS-DFSC\] Microsoft Corporation, "[Distributed File System (DFS): Referral Protocol](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-DFSC%5d.pdf#Section_3109f4be2dbb42c99b8e0b34f7a2135e)". + +\[MS-DTYP\] Microsoft Corporation, "[Windows Data Types](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-DTYP%5d.pdf#Section_cca2742956894a16b2b49325d93e4ba2)". + +\[MS-EFSR\] Microsoft Corporation, "[Encrypting File System Remote (EFSRPC) Protocol](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-EFSR%5d.pdf#Section_08796ba801c8487292211000ec2eff31)". + +\[MS-FSA\] Microsoft Corporation, "[File System Algorithms](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-FSA%5d.pdf#Section_860b1516c45247b4bdbc625d344e2041)". + +\[MS-FSCC\] Microsoft Corporation, "[File System Control Codes](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-FSCC%5d.pdf#Section_efbfe12773ad41409967ec6500e66d5e)". + +\[MS-KILE\] Microsoft Corporation, "[Kerberos Protocol Extensions](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-KILE%5d.pdf#Section_2a32282edd484ad9a542609804b02cc9)". + +\[MS-NLMP\] Microsoft Corporation, "[NT LAN Manager (NTLM) Authentication Protocol](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-NLMP%5d.pdf#Section_b38c36ed28044868a9ff8dd3182128e4)". + +\[MS-RAP\] Microsoft Corporation, "[Remote Administration Protocol](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-RAP%5d.pdf#Section_fb8d5bd1e57c4be1b063ec31330bdd58)". + +\[MS-SRVS\] Microsoft Corporation, "[Server Service Remote Protocol](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9)". + +\[RFC1321\] Rivest, R., "The MD5 Message-Digest Algorithm", RFC 1321, April 1992, [http://www.ietf.org/rfc/rfc1321.txt](http://go.microsoft.com/fwlink/?LinkId=90275) + +\[RFC2104\] Krawczyk, H., Bellare, M., and Canetti, R., "HMAC: Keyed-Hashing for Message Authentication", RFC 2104, February 1997, [http://www.ietf.org/rfc/rfc2104.txt](http://go.microsoft.com/fwlink/?LinkId=90314) + +\[RFC2119\] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997, [http://www.rfc-editor.org/rfc/rfc2119.txt](http://go.microsoft.com/fwlink/?LinkId=90317) + +\[RFC2743\] Linn, J., "Generic Security Service Application Program Interface Version 2, Update 1", RFC 2743, January 2000, [http://www.rfc-editor.org/rfc/rfc2743.txt](http://go.microsoft.com/fwlink/?LinkId=90378) + +\[RFC4178\] Zhu, L., Leach, P., Jaganathan, K., and Ingersoll, W., "The Simple and Protected Generic Security Service Application Program Interface (GSS-API) Negotiation Mechanism", RFC 4178, October 2005, [http://www.rfc-editor.org/rfc/rfc4178.txt](http://go.microsoft.com/fwlink/?LinkId=90461) + +### Informative References + +\[MD5Collision\] Klima, V., "Tunnels in Hash Functions: MD5 Collisions Within a Minute", March 2006, [http://eprint.iacr.org/2006/105.pdf](http://go.microsoft.com/fwlink/?LinkId=89937) + +\[MS-AUTHSOD\] Microsoft Corporation, "[Authentication Services Protocols Overview](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-AUTHSOD%5d.pdf#Section_953d700a57cb4cf7b0c3a64f34581cc9)". + +\[MS-BRWSA\] Microsoft Corporation, "[Common Internet File System (CIFS) Browser Auxiliary Protocol](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-BRWSA%5d.pdf#Section_5995d2f2fff140af9100ca67794d50a5)". + +\[MS-BRWS\] Microsoft Corporation, "[Common Internet File System (CIFS) Browser Protocol](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-BRWS%5d.pdf#Section_d2d83b294b62479eb4279b750303387b)". + +\[MS-DFSNM\] Microsoft Corporation, "[Distributed File System (DFS): Namespace Management Protocol](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-DFSNM%5d.pdf#Section_95a506a8cae64c42b19d9c1ed1223979)". + +\[MS-ERREF\] Microsoft Corporation, "[Windows Error Codes](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-ERREF%5d.pdf#Section_1bc92ddfb79e413cbbaa99a5281a6c90)". + +\[MS-MAIL\] Microsoft Corporation, "[Remote Mailslot Protocol](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-MAIL%5d.pdf#Section_8ea19aa46e5a4aedb6280b5cd75a1ab9)". + +\[MS-RPCE\] Microsoft Corporation, "[Remote Procedure Call Protocol Extensions](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-RPCE%5d.pdf#Section_290c38b192fe422991e64fc376610c15)". + +\[MS-SMB2\] Microsoft Corporation, "[Server Message Block (SMB) Protocol Versions 2 and 3](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-SMB2%5d.pdf#Section_5606ad475ee0437a817e70c366052962)". + +\[MS-WKST\] Microsoft Corporation, "[Workstation Service Remote Protocol](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-WKST%5d.pdf#Section_5bb08058bc364d3cabebb132228281b7)". + +\[MS-WPO\] Microsoft Corporation, "[Windows Protocols Overview](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-WPO%5d.pdf#Section_c5f54a7765be40a0bb829e4181d8ab67)". + +\[MSBRWSE\] Thompson IV, D. and McLaughlin, R., "MS Windows NT Browser", [https://www.microsoft.com/technet/archive/winntas/deploy/prodspecs/ntbrowse.mspx](http://go.microsoft.com/fwlink/?LinkId=89943) + +\[MSDFS\] Microsoft Corporation, "How DFS Works", March 2003, [http://technet.microsoft.com/en-us/library/cc782417%28WS.10%29.aspx](http://go.microsoft.com/fwlink/?LinkId=89945) + +\[MSDN-IMPERS\] Microsoft Corporation, "Impersonation", [http://msdn.microsoft.com/en-us/library/ms691341.aspx](http://go.microsoft.com/fwlink/?LinkId=106009) + +\[MSKB-121007\] Microsoft Corporation, "Long Name: How to Disable the 8.3 Name Creation on NTFS Partitions", December 2007, [http://support.microsoft.com/kb/121007](http://go.microsoft.com/fwlink/?LinkId=228457) + +\[NETBEUI\] IBM Corporation, "LAN Technical Reference: 802.2 and NetBIOS APIs", 1986, [http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/BK8P7001/CCONTENTS](http://go.microsoft.com/fwlink/?LinkId=90224) + +\[RFC1001\] Network Working Group, "Protocol Standard for a NetBIOS Service on a TCP/UDP Transport: Concepts and Methods", RFC 1001, March 1987, [http://www.ietf.org/rfc/rfc1001.txt](http://go.microsoft.com/fwlink/?LinkId=90260) + +\[RFC1002\] Network Working Group, "Protocol Standard for a NetBIOS Service on a TCP/UDP Transport: Detailed Specifications", STD 19, RFC 1002, March 1987, [http://www.rfc-editor.org/rfc/rfc1002.txt](http://go.microsoft.com/fwlink/?LinkId=90261) + +\[RFC793\] Postel, J., Ed., "Transmission Control Protocol: DARPA Internet Program Protocol Specification", RFC 793, September 1981, [http://www.rfc-editor.org/rfc/rfc793.txt](http://go.microsoft.com/fwlink/?LinkId=150872) + +\[SNIA\] Storage Networking Industry Association, "Common Internet File System (CIFS) Technical Reference, Revision 1.0", March 2002, [http://networks.cs.ucdavis.edu/~zhuk/research/sans/documents/CIFS-TR-1p00_FINAL.pdf](http://go.microsoft.com/fwlink/?LinkId=90519) + +## Overview + +Client systems use the Common Internet File System (CIFS) Protocol to request file and print services from server systems over a network. CIFS is a stateful protocol, in which clients establish a [**session**](#gt_0cd96b80-a737-4f06-bca4-cf9efb449d12) with a server and use that session to make a variety of requests to access files, printers, and inter-process communication (IPC) mechanisms, such as [**named pipes**](#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca). CIFS imposes state to maintain an authentication context, cryptographic operations, file semantics, such as locking, and similar features. A detailed overview of how the CIFS Protocol functions is provided in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2. + +The Server Message Block (SMB) Version 1.0 Protocol extends the CIFS Protocol with additional security, file, and disk management support. These extensions do not alter the basic message sequencing of the CIFS Protocol but introduce new flags, extended requests and responses, and new [**Information Levels**](#gt_b01da706-86d0-4ee2-9461-2d9fb1060543). All of these extensions follow a request/response pattern in which the client initiates all of the requests. The base protocol allows for one exception to this pattern--[**oplock breaks**](#gt_5c86b468-90a1-4542-8bde-460c098d2a5a)\--as specified in \[MS-CIFS\] section 3.2.5.42. + +This document defines the SMB Version 1.0 Protocol extensions to CIFS, which provide support for the following features: + +- New authentication methods, including Kerberos. The Negotiate and Session Setup commands have been enhanced to carry opaque security tokens to support mechanisms that are compatible with the Generic Security Services (GSS). +- Enumeration and access to previous versions of files. A new subcommand that uses a file system control ([**FSCTL**](#gt_4ffb96a7-5fad-488e-9438-b7707d2e4226)) allows the client to query the server for the presence of older versions of files. If the server implements a file system with versioning, then this can be exposed to clients. +- Client requests for server-side data movement operations between files without requiring the data to be read by the client and then written back to the server. As specified in \[MS-CIFS\], to copy a file on the server requires the client to read all of the data from the server and then write the data back to the server. The SMB Version 1.0 Protocol introduces a method by which such an operation can be done entirely on the server without consuming network resources. +- [**SMB connections**](#gt_e1d88514-18e6-4e2e-a459-20d5e17e9078) that use Direct TCP for the SMB transport. The CIFS Protocol supports the use of NBT for connections, as specified in \[MS-CIFS\] section 2.1.1.2. The SMB Version 1.0 Protocol includes a method to connect directly over [**TCP**](#gt_b08d36f6-b5c6-4ce4-8d2d-6f2ab75ea4cb) (see [\[RFC793\]](http://go.microsoft.com/fwlink/?LinkId=150872)) without involving NetBIOS (see [\[RFC1001\]](http://go.microsoft.com/fwlink/?LinkId=90260) and [\[RFC1002\]](http://go.microsoft.com/fwlink/?LinkId=90261)). Information about NetBIOS is specified in [\[NETBEUI\]](http://go.microsoft.com/fwlink/?LinkId=90224). +- Support for retrieving extended information in response to [**share connect**](#gt_956367c4-c5cb-49a4-bf4b-9bd1596ed5d0) and file open operations. Certain server functionality and indicators (such as the need for the client to cache the contents of a [**share**](#gt_a49a79ea-dac7-4016-9a84-cf87161db7e3)) are new in the SMB Version 1.0 Protocol and are returned to the client through these extensions to existing commands. +- Additional [**SMB commands**](#gt_dbae2612-173d-4988-9301-86cb559029f9) for the setting and querying of quotas by user. Provided the server supports quotas, the client can constrain the file system capacity consumed by the files of users. + +Many of these capabilities are exposed in enhancements to the [SMB_COM_NEGOTIATE](#Section_9fef5150550144a8b5b50b20057187ac) (section 2.2.4.5) and [SMB_COM_SESSION_SETUP_ANDX](#Section_115b551adcd74ff28c59a334b92e01c0) (section 2.2.4.6) command requests and responses. + +## Relationship to Other Protocols + +The extensions to the CIFS protocol rely on the Simple and Protected Generic Security Service Application Program Interface Negotiation Mechanism (SPNEGO), as described in [\[MS-AUTHSOD\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-AUTHSOD%5d.pdf#Section_953d700a57cb4cf7b0c3a64f34581cc9) section 2.1.2.3.1 and specified in [\[RFC4178\]](http://go.microsoft.com/fwlink/?LinkId=90461), for authentication, which in turn relies on Kerberos, as specified in [\[MS-KILE\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-KILE%5d.pdf#Section_2a32282edd484ad9a542609804b02cc9), and/or the NT LAN Manager (NTLM), as specified in [\[MS-NLMP\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-NLMP%5d.pdf#Section_b38c36ed28044868a9ff8dd3182128e4), challenge/response authentication protocol. + +The Server Message Block (SMB) Version 2 Protocol is a new version of [**SMB**](#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625). For more information about the SMB Version 2 Protocol, see [\[MS-SMB2\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-SMB2%5d.pdf#Section_5606ad475ee0437a817e70c366052962). This specification does not require implementation of the SMB Version 2 Protocol. + +The following protocols extend this specification to provide additional functionality: + +- The Distributed File System (DFS): Namespace Referral Protocol, as specified in [\[MS-DFSC\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-DFSC%5d.pdf#Section_3109f4be2dbb42c99b8e0b34f7a2135e). For more information, see [\[MSDFS\]](http://go.microsoft.com/fwlink/?LinkId=89945). For management of [**DFS**](#gt_0b8086c9-d025-45b8-bf09-6b5eca72713e), see [\[MS-DFSNM\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-DFSNM%5d.pdf#Section_95a506a8cae64c42b19d9c1ed1223979). + +The following protocols can use the SMB Version 1.0 Protocol as a transport: + +- - The Remote Procedure Call (RPC) Protocol Extensions. Note that when named pipes are used, this protocol requires the SMB Protocol. For more information, see [\[MS-RPCE\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-RPCE%5d.pdf#Section_290c38b192fe422991e64fc376610c15). + - The Remote Mailslot Protocol. This protocol can use the SMB Version 1.0 Protocol as a transport but supports other transports as well. For more information, see [\[MS-MAIL\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-MAIL%5d.pdf#Section_8ea19aa46e5a4aedb6280b5cd75a1ab9). + - The CIFS Browser Protocol. This protocol uses the Remote Mailslot Protocol and the RAP as transport protocols, which in turn can use this specification. It does not use this specification directly, but is included here for completeness. For more information, see [\[MS-BRWS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-BRWS%5d.pdf#Section_d2d83b294b62479eb4279b750303387b) and [\[MSBRWSE\]](http://go.microsoft.com/fwlink/?LinkId=89943). + +The SMB protocol server, upon request from an underlying object store, optionally invokes the Encrypting File System Remote (EFSRPC) protocol when a user attempts to open or create a new encrypted file. For more information, see [\[MS-FSA\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-FSA%5d.pdf#Section_860b1516c45247b4bdbc625d344e2041) and [\[MS-EFSR\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-EFSR%5d.pdf#Section_08796ba801c8487292211000ec2eff31). + +For more information, see [\[MS-BRWSA\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-BRWSA%5d.pdf#Section_5995d2f2fff140af9100ca67794d50a5) and [\[MS-WKST\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-WKST%5d.pdf#Section_5bb08058bc364d3cabebb132228281b7). + +The following diagram illustrates the relationship amongst the protocols. + +![Relationships to other protocols](data:image/png;base64,iVBORw0KGgoAAAANSUhE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8BcLXOqsl5XhLW5Zfk1EMTnWAVFq5+JxIrcTqfJ7W2QYxnQtC5VfXIWgrYci+AtsmfGCfibtOQ53PtohzauMJ6ePMtkPHlXhQddJt2MxzPeo2CIi/vRZJVPyvy6upaq8LYXPM1ZwEjqHu56649u031y3nSwJLOOKJEYKEjbgG+8JzHRInsK5eRxGRuZnS4FAe1rJ3CXDMlO21LL8moxgcoNJLxXsK1Wy0nOoogRteK9FzwcRcehMOnds+2utIHCQIqC0jlbuc9DHEaJ3CKfs9dC2G4jjn2omIzMlUBkeOYzSD0wNUlG1rwynEXUbnGKyxqQbnmpxjcERE5P/Q4PTFqgwOXGpKMBS9tR5MYbRoHdrXQiQiInejwemL1RkcERGROdDg9IUGR0REZAQ0OH2hwRERERkBDU5faHBERERGQIPTFxocERGREdDg9IUGR0REZAQ0OH2hwRERERkBDU5faHBERERGQIPTFxocERGREdDg9IUGR0REZAQ0OH2hwRERERkBDU5faHBERERGQIPTFxocERGREdDg9IUGR0REZAQ0OH2hwRERERkBDA6VqupDz5490+CIiIhcypMnT3YVqupHX3/99e3dubn5/2xsuEGiXM8oAAAAAElFTkSuQmCC) + +Figure 1: Relationships to other protocols + +## Prerequisites/Preconditions + +The SMB Version 1.0 Protocol assumes the availability of the following resources: + +- An underlying transport protocol that supports reliable, in-order message delivery. +- An underlying object store on the server, such as a file system, exposing file, named pipe, or printer objects. + +## Applicability Statement + +The extensions specified in this document are applicable to environments in which the security characteristics of the base protocol, as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b), are insufficient. In particular, these extensions provide for enhanced message integrity and stronger authentication mechanisms. + +The extensions are applicable to an environment that requires tighter data retention policies. In particular, through the use of previous version capabilities, the extensions allow access to versions of a file that have been changed or deleted when the server supports this capability. This feature is applicable to environments that require more stringent data retention policies that include maintaining access to previous versions of files. + +## Versioning and Capability Negotiation + +This document covers versioning issues in the following areas: + +- Supported Transports: The extensions in this document add additional transports, as defined in section [2.1](#Section_f906c680330c43ae9a71f854e24aeee6). +- Security and Authentication Methods: The extensions in this document add additional authentication methods, as specified in section [3.2.4.2](#Section_061aa811d5e044c3974243ae0a222a59). +- Capability Negotiation: The extensions in this document use capability negotiation, as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) sections 1.7, 2.2.4.52, 2.2.4.53, and 3.3.1.2. + +[**SMB dialect**](#gt_29b8d978-7450-42b5-845c-045fc72b0fe1) negotiation is handled as specified in \[MS-CIFS\] sections 1.7 and 3.2.4.2. The extensions specified in this document introduce no new dialects and apply only to connections that have negotiated the **NT LAN Manager** dialect, as identified by the "NT LM 0.12" dialect identification string. The extensions specified in this document are detected via the following methods: + +- They can be returned in the **Capabilities** field, as specified in \[MS-CIFS\] section 2.2.4.52. Specific new capability options are defined in this document. +- They can be supplied or returned in the **Flags** and **Flags2** fields of the SMB header, as specified in \[MS-CIFS\] sections 2.2.3.1. +- A server can return an error code (STATUS_NOT_SUPPORTED) when a client request is sent to a server for a new feature that is not supported. + +A client written to support these extensions cannot require that the target server implement these extensions to successfully connect. Thus, a server that does not implement an extension is still accessible by a client that implements that extension, although the relevant new features might not be available. The one exception is that a client offers the capability to be configured to require the new security features to create a more secure environment so that the client could be restricted from connecting successfully to servers that do not implement these features. + +Negotiation of the use of the Generic Security Service Application Program Interface (GSS API) for authentication is specified in section [3.2.4.2.4](#Section_d3b7bcd3cd684d3b916b443ccd55f953). The GSS API is specified in [\[RFC2743\]](http://go.microsoft.com/fwlink/?LinkId=90378). + +## Vendor-Extensible Fields + +The CAP_UNIX capability bit is specified in order to allow third-party implementers to collaborate on the definition of a specific set of extensions. SMB_COM_TRANSACTION2 Information Levels in the range 0x200 to 0x3E0 (inclusive) are reserved for these extensions.[<1>](#Appendix_A_1) + +## Standards Assignments + +In addition to any standards assignments specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b), the Direct TCP Transport, as specified in section [2.2](#Section_6cdbc7263e4a499982b3f5e3d7f3c37a), makes use of the following assignment: + +| Parameter | TCP port value | Reference | +| ------------ | -------------- | ------------------------------------------------------------ | +| Microsoft-DS | 445 (0x01BD) | [\[IANAPORT\]](http://go.microsoft.com/fwlink/?LinkId=89888) | + +**SMB** transports can have assigned port numbers or other assigned values. See the documentation for the specific transport for more information. + +# Messages + +An SMB Version 1.0 Protocol implementation MUST implement CIFS, as specified by section 2 of the [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) specification. + +## Transport + +In addition to the transport protocols listed in section 2.1 of [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b), the extended version of the protocol supports the use of TCP as a transport layer. Hereafter, the special TCP-related characteristics that are employed in the application of SMB over TCP are known as the Direct TCP transport.[<2>](#Appendix_A_2) + +The extended version of the SMB Version 1.0 Protocol can use Direct TCP over either IPv4 or IPv6 as a reliable stream-oriented transport for [**SMB messages**](#gt_fb37399e-d72d-41b6-b073-086da2d96e09). No NetBIOS layer is provided or used. TCP provides a full, duplex, sequenced, and reliable transport for the connection. When using TCP as the reliable connection-oriented transport, the extended version of the SMB Version 1.0 Protocol makes no higher-level attempts to ensure sequenced delivery of messages between a client and server. The TCP transport has mechanisms to detect failures of either the client node or the server node, and to deliver such an indication to the client or server software so that it can clean up the state. + +When using Direct TCP as the SMB transport, the implementer MUST establish a TCP connection from an SMB client to a TCP port on the server. The TCP source port used by the SMB client can be of any TCP port value. The SMB server SHOULD listen for connections on port 445. This port number has been registered with the Internet Assigned Numbers Authority (IANA) and has been officially assigned for Microsoft-DS.[<3>](#Appendix_A_3) + +When using Direct TCP as the SMB transport, the implementer MUST prepend a 4-byte Direct TCP transport packet header to each [**SMB message**](#gt_1308cf27-6aba-4d86-b38d-7926ba662311). This transport header MUST be formatted as a byte of zero (8 zero bits) followed by 3 bytes that indicate the length of the SMB message that is encapsulated. The body of the SMB packet follows as a variable-length payload. A Direct TCP transport packet has the following structure (in [**network byte order**](#gt_502de58c-ffc0-4dda-8fcb-b152b2c31fba)). + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ---------------------- | --- | --- | --- | --- | --- | --- | --- | ---------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Zero | | | | | | | | Stream Protocol Length | | | | | | | | | | | | | | | | | | | | | | | | +| SMB Message (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Zero (1 byte):** The first byte of the Direct TCP transport packet header MUST be zero (0x00). + +**Stream Protocol Length (3 bytes):** The length, in bytes, of the SMB message. This length is formatted as a 3-byte integer in network byte order. The length field does not include the 4-byte Direct TCP transport header; rather, it is only the length of the enclosed SMB message. For SMB messages, if this value exceeds 0x1FFFF, the server SHOULD[<4>](#Appendix_A_4) disconnect the connection. + +**SMB Message (variable):** The body of the SMB packet. The length of an SMB message varies based on the SMB command represented by the message. + +## Message Syntax + +A client exchanges messages with a server to access resources on the server. These messages are called SMB messages or SMBs. Every SMB message has a common format, as defined in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2. + +All SMB messages MUST begin with a fixed-length SMB header (as specified in \[MS-CIFS\], section 2.2.1). The header contains a command field that indicates the operation code that the client requests or to which the server responds. An SMB message is of variable length. The actual length depends on the SMB command field (and consequent appended data structures) and whether the SMB message is a client request or a server response. + +Unless otherwise indicated, numeric fields are integers of the specified byte length. + +Unless otherwise specified, multibyte fields (that is, 16-bit, 32-bit, and 64-bit fields) in an SMB message MUST be transmitted in [**little-endian**](#gt_079478cb-f4c5-4ce5-b72b-2144da5d2ce7) byte order (least significant byte first). + +Unless otherwise noted, fields marked as Reserved SHOULD be set to zero when being sent and MUST be ignored upon receipt. Unless otherwise noted, unused or reserved bits in bit fields SHOULD be set to zero when being sent and MUST be ignored upon receipt. + +When an error occurs, unless otherwise noted in this specification, an SMB server SHOULD return an Error Response message. An Error Response message is comprised of a complete SMB header, along with an empty parameter and data portion.[<5>](#Appendix_A_5) + +### Common Data Type Extensions + +#### Character Sequences + +##### Pathname Extensions + +In addition to the specification in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.1.1.2, pathnames include the following extension: + +- Previous Version Tokens -- Support for this feature is optional.[<6>](#Appendix_A_6) + +Pathnames are allowed to contain a previous version token (or [**@GMT token**](#gt_9fb4d987-6d9a-4ef5-81be-eeae393afb40)), as a directory element in a path. A previous version token indicates that the pathname is a request to access the previous version (or [**shadow copy**](#gt_34537940-5a56-4122-b6ff-b9a4d065d066)) of the file or directory at a particular point in time. This feature is available on any path-based operation (for example, SMB_COM_NT_CREATE_ANDX). A pathname MUST NOT contain more than one previous version token. + +For example, requesting a previous version of the file \\\\server\\mydocs\\reviews\\feb01.doc at 2:44:00 P.M. on March30, 2001 [**UTC**](#gt_f2369991-a884-4843-a8fa-1505b6d5ece7) is specified in the following format: + +- \\\\server\\mydocs\\reviews\\@GMT-2001.03.30-14.44.00\\feb01.doc + +The same technique can be used to build a path that represents a previous version of a directory as opposed to a file. + +For example, requesting a previous version of the directory \\\\server\\mydocs\\reviews at 2:44:00 PM on 3/30/01 UTC can be specified in either of the following formats: + +A token appearing as an intermediate path component: + +- \\\\server\\mydocs\\@GMT-2001.03.30-14.44.00\\reviews + +A token appearing as a final path component: + +- \\\\server\\mydocs\\reviews\\@GMT-2001.03.30-14.44.00 + +In addition, it is possible to request an enumeration of available previous version timestamps (or [**snapshots**](#gt_24e415c9-f158-4de0-b687-598511501c68)) of a file or directory. While the NT_TRANSACT_IOCTL subcommand can be used with the FSCTL_SRV_ENUMERATE_SNAPSHOTS FSCTL code to enumerate available previous version timestamps using a valid [**Fid**](#gt_ab858f4d-7f0c-474c-9697-50f0af92f766) (section [2.2.7.2.1](#Section_2f8a9baed8c1462893daadba011e4f17)), these extensions also present a path-based method to access this functionality. The TRANS2_FIND_FIRST2 subcommand's SMB_FIND_FILE_BOTH_DIRECTORY_INFO Information Level (section [2.2.6.1](#Section_aedac660ae304dc186ce160c223fc883)) has been extended to allow a special previous version wildcard token, @GMT-\*. + +For example, requesting an enumeration of available previous version timestamps of the examples, discussed earlier in this section, can be specified in the following ways: + +- \\\\server\\mydocs\\reviews\\@GMT-\*\\feb01.doc +- \\\\server\\mydocs\\@GMT-\*\\reviews +- \\\\server\\mydocs\\reviews\\@GMT-\* + +#### File Attributes + +##### Extended File Attribute (SMB_EXT_FILE_ATTR) Extensions + +The list of extended file attributes valid in 32-bit attribute values, as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.1.2.3, has been extended to include the following attributes: + +- ATTR_SPARSE +- ATTR_REPARSE_POINT +- ATTR_OFFLINE +- ATTR_NOT_CONTENT_INDEXED +- ATTR_ENCRYPTED + +The following table lists all possible values. Unless otherwise noted, any combination of these values is acceptable. + +| Name & bitmask | Extension | Meaning | +| ------------------------------------------ | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| ATTR_READONLY

0x00000001 | No | File is read-only. Applications cannot write or delete the file. | +| ATTR_HIDDEN

0x00000002 | No | File is hidden. It is not to be included in an ordinary directory enumeration. | +| ATTR_SYSTEM

0x00000004 | No | File is part of or is used exclusively by the operating system. | +| ATTR_DIRECTORY

0x00000010 | No | File is a directory. | +| ATTR_ARCHIVE

0x00000020 | No | File has not been archived since it was last modified. | +| ATTR_NORMAL

0x00000080 | No | File has no other attributes set. This value is valid only when used alone. | +| ATTR_TEMPORARY

0x00000100 | No | File is temporary. | +| ATTR_SPARSE

0x00000200 | Yes | File is a sparse file. | +| ATTR_REPARSE_POINT

0x00000400 | Yes | File or directory has an associated [**reparse point**](#gt_4fed0b53-5fc8-4818-886f-93d87f3035e1). | +| ATTR_COMPRESSED

0x00000800 | No | File is compressed on the disk. This does not affect how it is transferred over the network. | +| ATTR_OFFLINE

0x00001000 | Yes | File data is not available. The attribute indicates that the file has been moved to offline storage. | +| ATTR_NOT_CONTENT_INDEXED

0x00002000 | Yes | File or directory SHOULD NOT be indexed by a content indexing service. | +| ATTR_ENCRYPTED

0x00004000 | Yes | File or directory is encrypted. For a file, this means that all data in the file is encrypted. For a directory, this means that encryption is the default for newly created files and subdirectories. | +| Reserved

0xFFFF8048 | N/A | SHOULD be set to zero when sending and MUST be ignored upon receipt of the message. | + +##### File System Attribute Extensions + +The list of file system attributes, as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.8.2.6, has been extended. For completeness, the following table lists all of the available attribute flags and their symbolic constants. Unless otherwise noted, any combination of the following bits is valid. Any bit that is not listed in this section is considered reserved; the sender SHOULD set it to zero, and the receiver MUST ignore it. For more information, see [\[MS-FSCC\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-FSCC%5d.pdf#Section_efbfe12773ad41409967ec6500e66d5e) section 2.5.1. + +| Name & bitmask | Extension | Meaning | +| --------------------------------------------------- | ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| FILE_CASE_SENSITIVE_SEARCH

0x00000001 | No | File system supports case-sensitive file names. | +| FILE_CASE_PRESERVED_NAMES

0x00000002 | No | File system preserves the case of file names when it stores the name on disk. | +| FILE_UNICODE_ON_DISK

0x00000004 | No | File system supports [**Unicode**](#gt_c305d0ab-8b94-461a-bd76-13b40cb8c4d8) in file names. | +| FILE_PERSISTENT_ACLS

0x00000008 | No | File system preserves and enforces access control lists. | +| FILE_FILE_COMPRESSION

0x00000010 | No | File system supports file-based compression. This flag is incompatible with FILE_VOLUME_IS_COMPRESSED. This flag does not affect how data is transferred over the network. | +| FILE_VOLUME_QUOTAS

0x00000020 | Yes | File system supports per-user quotas. | +| FILE_SUPPORTS_SPARSE_FILES

0x00000040 | Yes | File system supports sparse files. | +| FILE_SUPPORTS_REPARSE_POINTS

0x00000080 | Yes | File system supports reparse points. | +| FILE_SUPPORTS_REMOTE_STORAGE

0x00000100 | Yes | File system supports remote storage. | +| FILE_VOLUME_IS_COMPRESSED

0x00008000 | No | Volume is a compressed volume. This flag is incompatible with FILE_FILE_COMPRESSION. This does not affect how data is transferred over the network. | +| FILE_SUPPORTS_OBJECT_IDS

0x00010000 | Yes | File system supports object identifiers. | +| FILE_SUPPORTS_ENCRYPTION

0x00020000 | Yes | File system supports encryption. | +| FILE_NAMED_STREAMS

0x00040000 | Yes | File system supports multiple named data [**streams**](#gt_f3529cd8-50da-4f36-aa0b-66af455edbb6) for a file. | +| FILE_READ_ONLY_VOLUME

0x00080000 | Yes[<7>](#Appendix_A_7) | Specified volume is read-only. | +| FILE_SEQUENTIAL_WRITE_ONCE

0x00100000 | Yes[<8>](#Appendix_A_8) | Specified volume can be written to one time only. The write MUST be performed in sequential order. | +| FILE_SUPPORTS_TRANSACTIONS

0x00200000 | Yes[<9>](#Appendix_A_9) | File system supports transaction processing. | +| FILE_SUPPORTS_HARD_LINKS

0x00400000 | Yes[<10>](#Appendix_A_10) | File system supports direct links to other devices and partitions. | +| FILE_SUPPORTS_EXTENDED_ATTRIBUTES

0x00800000 | Yes[<11>](#Appendix_A_11) | File system supports extended attributes (EAs). | +| FILE_SUPPORTS_OPEN_BY_FILE_ID

0x01000000 | Yes[<12>](#Appendix_A_12) | File system supports open by FileID. | +| FILE_SUPPORTS_USN_JOURNAL

0x02000000 | Yes[<13>](#Appendix_A_13) | File system supports update sequence number (USN) journals. | +| Reserved

0xFE007E00 | N/A | These bits fields SHOULD be set to zero when sending and MUST be ignored when the message is received. | + +#### Unique Identifiers + +The SMB Version 1.0 Protocol makes use of the following data types from [\[MS-DTYP\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-DTYP%5d.pdf#Section_cca2742956894a16b2b49325d93e4ba2): + +- GUID as specified in section 2.3.4.2 + +The list of unique identifiers, specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.1.6, has been extended to include the following new unique identifiers: + +- 64-bit file identifier (FileId) +- Volume GUID (VolumeGUID) +- [**Copychunk Resume Key**](#gt_7a86a8b5-6ac4-471d-aa3c-9b2bb4638700) + +##### FileId Generation + +64-bit file identifiers ([**FileIds**](#gt_3b097896-b707-47b5-b1bb-384867a453ea)) are generated on SMB servers. The generation of FileIds MUST satisfy the following constraints: + +- The FileId MUST be a 64-bit opaque value. +- The FileId MUST be unique for a file on a given object store.[<14>](#Appendix_A_14) +- The FileId for a file MUST persist for the lifetime of a file on a given object store. A FileId MUST NOT be changed when a file is renamed. When the file is deleted, the FileId MAY be reused. +- All possible values for FileId are valid. + +##### VolumeGUID Generation + +VolumeGUIDs (Volume Globally Unique Identifiers, or [**volume identifiers**](#gt_892a6724-e635-4ba0-8b8a-d6368f166221), see also [\[MS-DTYP\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-DTYP%5d.pdf#Section_cca2742956894a16b2b49325d93e4ba2) section 2.3.4) are generated on SMB servers. The generation of VolumeGUIDs MUST satisfy the following constraints: + +- The VolumeGUID MUST be a 128-bit opaque value. +- The VolumeGUID MUST be unique for a logical file system volume on a given server. +- The VolumeGUID for the volume can change while the system is running. The VolumeGUID can change when the system is restarted. +- All possible values for the VolumeGUID are valid. + +##### Copychunk Resume Key Generation + +Copychunk Resume Keys are generated on SMB servers. The generation of Copychunk Resume Keys MUST satisfy the following constraints: + +- The Copychunk Resume Key MUST be a 24-byte opaque value generated by an SMB server in response to a request by the client (an SMB_COM_NT_TRANSACTION request with an NT_TRANSACT_IOCTL subcommand for the FSCTL_SRV_REQUEST_RESUME_KEY). For more information, see section [2.2.7.2](#Section_bdcc7363d0c74417b45ae46934b11419). +- The Copychunk Resume Key MUST be unique on the SMB server for a given open file on a server. +- The Copychunk Resume Key MUST remain valid for the lifetime of the open file on the server. +- All possible values for the Copychunk Resume Key are valid. + +COPYCHUNK_RESUME_KEY (see sections [2.2.7.2.1](#Section_2f8a9baed8c1462893daadba011e4f17) and [2.2.7.2.2.2](#Section_c2571af45f264bfcba6738d26f16effc)) represents an opaque data type that contains the server-returned Copychunk Resume Key. + +#### Access Masks + +The SMB protocol introduces the use of Access Mask structures, which are based on the ACCESS_MASK data type specified in [\[MS-DTYP\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-DTYP%5d.pdf#Section_cca2742956894a16b2b49325d93e4ba2) section 2.4.3. SMB defines two types of access masks for two basic groups: either for a file, pipe, or printer (specified in section [2.2.1.4.1](#Section_27f99d2977844684b6dd264e9025b286)) or for a directory (specified in section [2.2.1.4.2](#Section_d524144c3cfc49c3903c284e5adbd60a)). Each access mask MUST be a combination of zero or more of the bit positions. + +##### File_Pipe_Printer_Access_Mask + +The following SMB Access Mask structure is defined for use on a file, named pipe, or printer. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| File_Pipe_Printer_Access_Mask | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**File_Pipe_Printer_Access_Mask (4 bytes):** For a file, named pipe, or printer, the value MUST be constructed using the following values. For a printer, the value MUST have at least one of the following: FILE_WRITE_DATA, FILE_APPEND_DATA, or GENERIC_WRITE. + +| Value | Meaning | +| ---------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| FILE_READ_DATA

0x00000001 | This value indicates the right to read data from the file or named pipe. | +| FILE_WRITE_DATA

0x00000002 | This value indicates the right to write data into the file, named pipe, or printer beyond the end of the file. | +| FILE_APPEND_DATA

0x00000004 | This value indicates the right to append data into the file, named pipe, or printer. | +| FILE_READ_EA

0x00000008 | This value indicates the right to read the extended attributes of the file or named pipe. | +| FILE_WRITE_EA

0x00000010 | This value indicates the right to write or change the extended attributes to the file or named pipe. | +| FILE_EXECUTE

0x00000020 | This value indicates the right to execute the file. | +| FILE_DELETE_CHILD

0x00000040 | This value indicates the right to delete entries within a directory. | +| FILE_READ_ATTRIBUTES

0x00000080 | This value indicates the right to read the attributes of the file. | +| FILE_WRITE_ATTRIBUTES

0x00000100 | This value indicates the right to change the attributes of the file. | +| DELETE

0x00010000 | This value indicates the right to delete the file. | +| READ_CONTROL

0x00020000 | This value indicates the right to read the security descriptor for the file or named pipe. | +| WRITE_DAC

0x00040000 | This value indicates the right to change the [**discretionary access control list (DACL)**](#gt_d727f612-7a45-48e4-9d87-71735d62b321) in the [**security descriptor**](#gt_e5213722-75a9-44e7-b026-8e4833f0d350) for the file or named pipe. For the DACL data structure, see ACL in [\[MS-DTYP\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-DTYP%5d.pdf#Section_cca2742956894a16b2b49325d93e4ba2) section 2.4.5. | +| WRITE_OWNER

0x00080000 | This value indicates the right to change the owner in the security descriptor for the file or named pipe. | +| SYNCHRONIZE

0x00100000 | This flag SHOULD NOT be used by the client and MUST be ignored by the server unless on a named pipe as discussed in section [3.2.4.3.1](#Section_28ca564a5aa34ef3a245829627a7b37e) and section [3.3.5.5](#Section_a192be2b06824cc785e2edb544b78d8b). | +| ACCESS_SYSTEM_SECURITY

0x01000000 | This value indicates the right to read or change the [**system access control list (SACL)**](#gt_c189801e-3752-4715-88f4-17804dad5782) in the security descriptor for the file or named pipe. For the SACL data structure, see ACL in \[MS-DTYP\] section 2.4.5. | +| MAXIMUM_ALLOWED

0x02000000 | This value indicates that the client is requesting an [**open**](#gt_0d572cce-4683-4b21-945a-7f8035bb6469) to the file with the highest level of access the client has on this file. If no access is granted for the client on this file, the server MUST fail the open with STATUS_ACCESS_DENIED. | +| GENERIC_ALL

0x10000000 | This value indicates a request for all the access flags that are previously listed, except MAXIMUM_ALLOWED and ACCESS_SYSTEM_SECURITY. | +| GENERIC_EXECUTE

0x20000000 | This value indicates a request for the following combination of access flags listed above: FILE_READ_ATTRIBUTES, FILE_EXECUTE, SYNCHRONIZE, and READ_CONTROL. | +| GENERIC_WRITE

0x40000000 | This value indicates a request for the following combination of access flags listed above: FILE_WRITE_DATA, FILE_APPEND_DATA, FILE_WRITE_ATTRIBUTES, FILE_WRITE_EA, SYNCHRONIZE, and READ_CONTROL. | +| GENERIC_READ

0x80000000 | This value indicates a request for the following combination of access flags listed above: FILE_READ_DATA, FILE_READ_ATTRIBUTES, FILE_READ_EA, SYNCHRONIZE, and READ_CONTROL. | + +##### Directory_Access_Mask + +The following SMB Access Mask is defined for use on a directory. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Directory_Access_Mask | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Directory_Access_Mask (4 bytes):** For a directory, the value MUST be constructed using the following values: + +| Value | Meaning | +| ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| FILE_LIST_DIRECTORY

0x00000001 | This value indicates the right to enumerate the contents of the directory. | +| FILE_ADD_FILE

0x00000002 | This value indicates the right to create a file under the directory. | +| FILE_ADD_SUBDIRECTORY

0x00000004 | This value indicates the right to add a sub-directory under the directory. | +| FILE_READ_EA

0x00000008 | This value indicates the right to read the extended attributes of the directory. | +| FILE_WRITE_EA

0x00000010 | This value indicates the right to write or change the extended attributes of the directory. | +| FILE_TRAVERSE

0x00000020 | This value indicates the right to traverse this directory if the underlying object store enforces traversal checking. | +| FILE_DELETE_CHILD

0x00000040 | This value indicates the right to delete the files and directories within this directory. | +| FILE_READ_ATTRIBUTES

0x00000080 | This value indicates the right to read the attributes of the directory. | +| FILE_WRITE_ATTRIBUTES

0x00000100 | This value indicates the right to change the attributes of the directory. | +| DELETE

0x00010000 | This value indicates the right to delete the directory. | +| READ_CONTROL

0x00020000 | This value indicates the right to read the security descriptor for the directory. | +| WRITE_DAC

0x00040000 | This value indicates the right to change the DACL in the security descriptor for the directory. For the DACL data structure, see ACL in [\[MS-DTYP\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-DTYP%5d.pdf#Section_cca2742956894a16b2b49325d93e4ba2) section 2.4.5. | +| WRITE_OWNER

0x00080000 | This value indicates the right to change the owner in the security descriptor for the directory. | +| SYNCHRONIZE

0x00100000 | This flag MUST be ignored by both clients and servers. | +| ACCESS_SYSTEM_SECURITY

0x01000000 | This value indicates the right to read or change the SACL in the security descriptor for the directory. For the SACL data structure, see ACL in \[MS-DTYP\] section 2.4.5. | +| MAXIMUM_ALLOWED

0x02000000 | This value indicates that the client is requesting an open to the directory with the highest level of access that the client has on this directory. If no access is granted for the client on this directory, then the server MUST fail the open with STATUS_ACCESS_DENIED. | +| GENERIC_ALL

0x10000000 | This value indicates a request for all of the access flags that are listed above, except MAXIMUM_ALLOWED and ACCESS_SYSTEM_SECURITY. | +| GENERIC_EXECUTE

0x20000000 | This value indicates a request for the following access flags listed above: FILE_READ_ATTRIBUTES, FILE_TRAVERSE, SYNCHRONIZE, and READ_CONTROL. | +| GENERIC_WRITE

0x40000000 | This value indicates a request for the following access flags listed above: FILE_ADD_FILE, FILE_ADD_SUBDIRECTORY, FILE_WRITE_ATTRIBUTES, FILE_WRITE_EA, SYNCHRONIZE, and READ_CONTROL. | +| GENERIC_READ

0x80000000 | This value indicates a request for the following access flags listed above: FILE_LIST_DIRECTORY, FILE_READ_ATTRIBUTES, FILE_READ_EA, SYNCHRONIZE, and READ_CONTROL. | + +### Defined Constant Extensions + +#### SMB_COM Command Codes + +No new SMB_COM command codes are introduced other than those specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.2.1.[<15>](#Appendix_A_15) + +#### Transaction Subcommand Codes + +In addition to the transaction subcommand codes specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.2.2, the following modifications and extensions apply. In the following tables, the Description column is also used to specify changes in a particular subcommand's current usage status. + +**Transaction Codes used with SMB_COM_TRANSACTION** + +| Constant/value | Description | +| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| TRANS_RAW_READ_NMPIPE

0x0011 | This command code has changed from [**deprecated**](#gt_129acedf-ccf1-4e13-8df7-3bc59eff6f6d) to [**obsolescent**](#gt_8377951d-81ca-44a2-af83-2a6d6388c121). | +| TRANS_CALL_NMPIPE

0x0054 | This command code has changed from current to obsolescent. | + +**Transaction Codes used with SMB_COM_TRANSACTION2** + +| Constant/value | Description | +| --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | +| TRANS2_SET_FS_INFORMATION

0x0004 | Set information on a file system on the server. This command code has changed from reserved but not implemented to current. | + +**Transaction Codes used with SMB_COM_NT_TRANSACT** + +| Constant/value | Description | +| ------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| NT_TRANSACT_QUERY_QUOTA

0x0007 | Query a server for a user's disk quota information. This command code is new to these extensions. | +| NT_TRANSACT_SET_QUOTA

0x0008 | Set a user's disk quota information on a server. This command code is new to these extensions. | +| NT_TRANSACT_CREATE2

0x0009 | This command code is new to these extensions. The client requests and processes the NT_TRANSACT_CREATE2 command the same way it would for an NT_TRANSACT_CREATE command, as specified in \[MS-CIFS\] section 3.2.5.40.1. The server also processes and responds the same way it would for an NT_TRANSACT_CREATE command, as specified in \[MS-CIFS\] section 3.3.5.59.1.[<16>](#Appendix_A_16) | + +#### Information Level Codes + +The following new Information Level codes are specified in addition to those defined in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.2.3. + +##### FIND Information Level Codes + +The following new Information Level codes are specified in addition to those specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.2.3.1.[<17>](#Appendix_A_17) + +| Name | Code | Meaning | Dialect | +| ------------------------------------ | ------ | -------------------------------------------------------------------- | --------- | +| SMB_FIND_FILE_ID_FULL_DIRECTORY_INFO | 0x0105 | Returns the SMB*FIND* FULL_DIRECTORY_INFO data with a FileId. | NT LANMAN | +| SMB_FIND_FILE_ID_BOTH_DIRECTORY_INFO | 0x0106 | Returns the SMB_FIND_FILE_ID_BOTH_DIRECTORY_INFO data with a FileId. | NT LANMAN | + +##### QUERY_FS Information Level Codes + +No new SMB-specific Information Level codes are specified for these extensions. + +##### QUERY Information Level Codes + +No new SMB-specific Information Level codes are specified for these extensions. + +##### SET Information Level Codes + +No new SMB-specific Information Level codes are specified for these extensions. + +##### Pass-through Information Level Codes + +This document provides an extension of a new Information Level code value range called **pass-through Information Levels**, which can be used to set or query information on the server. These Information Levels allow SMB clients to directly query Information Levels native to the underlying object store.[<18>](#Appendix_A_18) + +Servers indicate support for these new pass-through Information Levels by setting the new CAP_INFOLEVEL_PASSTHRU capability flag in an SMB_COM_NEGOTIATE server response (section [2.2.4.5.2](#Section_8f8ce04ae1844d17bfb22cf762e6f6c4)). + +To access these new Information Levels, a client adds the constant SMB_INFO_PASSTHROUGH (0x03e8) to the desired native information class level value. This value is then sent in the **InformationLevel** field of the particular SMB_COM_TRANSACTION2 subcommand being used to access the Information Levels. + +##### Other Information Level Codes + +In addition, SMB_COM_TRANSACTION2 Information Levels in the range 0x200 to 0x3E0 (inclusive) are reserved for third-party extensions, as described in section [1.8](#Section_f99c712ef9984bbc9125cfe2010b6e44).[<19>](#Appendix_A_19) + +#### SMB Error Classes and Codes + +The following is a list of 32-bit status codes that are required to implement these extensions, their associated values, and a description of what they represent.[<20>](#Appendix_A_20) + +| NT status value | Description | +| ------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| 0x00000000

STATUS_SUCCESS | The client request is successful. | +| 0x00010002

STATUS_INVALID_SMB | An invalid SMB client request is received by the server. | +| 0x00050002

STATUS_SMB_BAD_TID | The client request received by the server contains an invalid TID value. | +| 0x00160002

STATUS_SMB_BAD_COMMAND | The client request received by the server contains an unknown SMB command code. | +| 0x005B0002

STATUS_SMB_BAD_UID | The client request to the server contains an invalid UID value. | +| 0x00FB0002

STATUS_SMB_USE_STANDARD | The client request received by the server is for a non-standard SMB operation (for example, an SMB_COM_READ_MPX request on a non-disk share). The client SHOULD send another request with a different SMB command to perform this operation. | +| 0x80000005

STATUS_BUFFER_OVERFLOW | The data was too large to fit into the specified buffer. | +| 0x80000006

STATUS_NO_MORE_FILES | No more files were found that match the file specification. | +| 0x8000002D

STATUS_STOPPED_ON_SYMLINK | The create operation stopped after reaching a symbolic link. | +| 0xC0000002

STATUS_NOT_IMPLEMENTED | The requested operation is not implemented. | +| 0xC000000D

STATUS_INVALID_PARAMETER | The parameter specified in the request is not valid. | +| 0xC000000E

STATUS_NO_SUCH_DEVICE | A device that does not exist was specified. | +| 0xC0000010

STATUS_INVALID_DEVICE_REQUEST | The specified request is not a valid operation for the target device. | +| 0xC0000016

STATUS_MORE_PROCESSING_REQUIRED | If extended security has been negotiated, then this error code can be returned in the SMB_COM_SESSION_SETUP_ANDX response from the server to indicate that additional authentication information is to be exchanged. See section [2.2.4.6](#Section_115b551adcd74ff28c59a334b92e01c0) for details. | +| 0xC0000022

STATUS_ACCESS_DENIED | The client did not have the required permission needed for the operation. | +| 0xC0000023

STATUS_BUFFER_TOO_SMALL | The buffer is too small to contain the entry. No information has been written to the buffer. | +| 0xC0000034

STATUS_OBJECT_NAME_NOT_FOUND | The object name is not found. | +| 0xC0000035

STATUS_OBJECT_NAME_COLLISION | The object name already exists. | +| 0xC000003A

STATUS_OBJECT_PATH_NOT_FOUND | The path to the directory specified was not found. This error is also returned on a create request if the operation requires the creation of more than one new directory level for the path specified. | +| 0xC00000A5

STATUS_BAD_IMPERSONATION_LEVEL | A specified impersonation level is invalid. This error is also used to indicate that a required impersonation level was not provided. | +| 0xC00000B5

STATUS_IO_TIMEOUT | The specified I/O operation was not completed before the time-out period expired. | +| 0xC00000BA

STATUS_FILE_IS_A_DIRECTORY | The file that was specified as a target is a directory and the caller specified that it could be anything but a directory. | +| 0xC00000BB

STATUS_NOT_SUPPORTED | The client request is not supported. | +| 0xC00000C9

STATUS_NETWORK_NAME_DELETED | The network name specified by the client has been deleted on the server. This error is returned if the client specifies an incorrect TID or the share on the server represented by the TID was deleted. | +| 0xC0000203

STATUS_USER_SESSION_DELETED | The user session specified by the client has been deleted on the server. This error is returned by the server if the client sends an incorrect UID. | +| 0xC000035C

STATUS_NETWORK_SESSION_EXPIRED | The client's session has expired; therefore, the client MUST re-authenticate to continue accessing remote resources. | +| 0xC000205A

STATUS_SMB_TOO_MANY_UIDS | The client has requested too many UID values from the server or the client already has an [**SMB session**](#gt_ee1ec898-536f-41c4-9d90-b4f7d981fd67) setup with this UID value. | + +#### Session Key Protection Hash + +The SSKeyHash is a well-known constant array. + +- BYTE SSKeyHash\[256\] = { +- 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, +- 0x20, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, +- 0x72, 0x65, 0x20, 0x4b, 0x65, 0x79, 0x20, 0x55, +- 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x79, 0x07, +- 0x6e, 0x28, 0x2e, 0x69, 0x88, 0x10, 0xb3, 0xdb, +- 0x01, 0x55, 0x72, 0xfb, 0x74, 0x14, 0xfb, 0xc4, +- 0xc5, 0xaf, 0x3b, 0x41, 0x65, 0x32, 0x17, 0xba, +- 0xa3, 0x29, 0x08, 0xc1, 0xde, 0x16, 0x61, 0x7e, +- 0x66, 0x98, 0xa4, 0x0b, 0xfe, 0x06, 0x83, 0x53, +- 0x4d, 0x05, 0xdf, 0x6d, 0xa7, 0x51, 0x10, 0x73, +- 0xc5, 0x50, 0xdc, 0x5e, 0xf8, 0x21, 0x46, 0xaa, +- 0x96, 0x14, 0x33, 0xd7, 0x52, 0xeb, 0xaf, 0x1f, +- 0xbf, 0x36, 0x6c, 0xfc, 0xb7, 0x1d, 0x21, 0x19, +- 0x81, 0xd0, 0x6b, 0xfa, 0x77, 0xad, 0xbe, 0x18, +- 0x78, 0xcf, 0x10, 0xbd, 0xd8, 0x78, 0xf7, 0xd3, +- 0xc6, 0xdf, 0x43, 0x32, 0x19, 0xd3, 0x9b, 0xa8, +- 0x4d, 0x9e, 0xaa, 0x41, 0xaf, 0xcb, 0xc6, 0xb9, +- 0x34, 0xe7, 0x48, 0x25, 0xd4, 0x88, 0xc4, 0x51, +- 0x60, 0x38, 0xd9, 0x62, 0xe8, 0x8d, 0x5b, 0x83, +- 0x92, 0x7f, 0xb5, 0x0e, 0x1c, 0x2d, 0x06, 0x91, +- 0xc3, 0x75, 0xb3, 0xcc, 0xf8, 0xf7, 0x92, 0x91, +- 0x0b, 0x3d, 0xa1, 0x10, 0x5b, 0xd5, 0x0f, 0xa8, +- 0x3f, 0x5d, 0x13, 0x83, 0x0a, 0x6b, 0x72, 0x93, +- 0x14, 0x59, 0xd5, 0xab, 0xde, 0x26, 0x15, 0x6d, +- 0x60, 0x67, 0x71, 0x06, 0x6e, 0x3d, 0x0d, 0xa7, +- 0xcb, 0x70, 0xe9, 0x08, 0x5c, 0x99, 0xfa, 0x0a, +- 0x5f, 0x3d, 0x44, 0xa3, 0x8b, 0xc0, 0x8d, 0xda, +- 0xe2, 0x68, 0xd0, 0x0d, 0xcd, 0x7f, 0x3d, 0xf8, +- 0x73, 0x7e, 0x35, 0x7f, 0x07, 0x02, 0x0a, 0xb5, +- 0xe9, 0xb7, 0x87, 0xfb, 0xa1, 0xbf, 0xcb, 0x32, +- 0x31, 0x66, 0x09, 0x48, 0x88, 0xcc, 0x18, 0xa3, +- 0xb2, 0x1f, 0x1f, 0x1b, 0x90, 0x4e, 0xd7, 0xe1 +- }; + +### SMB Message Structure Extensions + +#### SMB Header Extensions + +All client requests MUST begin with a fixed-size SMB header, as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.3.1. All server responses, with the exception of the SMB_COM_READ_RAW response message, as specified in \[MS-CIFS\] section 2.2.4.22.2, MUST begin with the same fixed-size SMB header. + +- SMB_Header +- { +- UCHAR Protocol\[4\]; +- UCHAR Command; +- SMB_ERROR Status; +- UCHAR Flags; +- USHORT Flags2; +- USHORT PIDHigh; +- UCHAR SecurityFeatures\[8\]; +- USHORT Reserved; +- USHORT TID; +- USHORT PIDLow; +- USHORT UID; +- USHORT MID; +- } + +The following SMB header fields contain extensions: + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------- | --- | --- | --- | --- | --- | --- | --- | ------ | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Protocol | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Command | | | | | | | | Status | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | Flags | | | | | | | | Flags2 | | | | | | | | | | | | | | | | +| PIDHigh | | | | | | | | | | | | | | | | SecurityFeatures | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | Reserved | | | | | | | | | | | | | | | | +| TID | | | | | | | | | | | | | | | | PIDLow | | | | | | | | | | | | | | | | +| UID | | | | | | | | | | | | | | | | MID | | | | | | | | | | | | | | | | + +**Flags2 (2 bytes):** The **Flags2** field contains individual bit flags that, depending on the negotiated SMB dialect, indicate various client and server capabilities. This field is defined as specified in \[MS-CIFS\] section 2.2.3.1. There are several new Flags2 values in the SMB header that are not in \[MS-CIFS\], but are part of these extensions. Unused bit fields SHOULD be set to zero by the sender when sending an SMB message and SHOULD[<21>](#Appendix_A_21) be ignored when received by the receiver. This field is constructed using the values listed in section 2.2.3.1 of \[MS-CIFS\], as well as the following additional values: + +| Name & bitmask | Meaning | +| -------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| SMB_FLAGS2_COMPRESSED

0x0008 | If set by the client, the client is requesting compressed data for an SMB_COM_READ_ANDX request. If cleared by the server, the server is notifying the client that the data was written uncompressed. This bit field SHOULD only be set to one when NT LAN Manager or later is negotiated for the SMB dialect. | +| SMB_FLAGS2_SMB_SECURITY_SIGNATURE_REQUIRED

0x0010 | This flag SHOULD[<22>](#Appendix_A_22) be set by the client on the first [SMB_COM_SESSION_SETUP_ANDX request (section 2.2.4.6.1)](#Section_a00d03613544484596ab309b4bb7705d) sent to a server that supports extended security if the client requires all further communication with this server to be signed. If the server does not support signing, it MUST disconnect the client by closing the underlying transport connection. Clients and servers MUST ignore this value for other requests and responses. If the client receives a non-signed response from the server, it MUST disconnect the underlying transport connection. This bit field SHOULD only be set to one when NT LAN Manager or later is negotiated for the SMB dialect, the client supports extended security, and the client is configured to require security signatures. | +| SMB_FLAGS2_IS_LONG_NAME

0x0040 | If set, the path contained in the message contains long names; otherwise, the paths are restricted to [**8.3 names**](#gt_d2302116-d3d3-4465-a72e-c07a7737b7ae). This bit field SHOULD only be set to one when NT LAN Manager or later is negotiated for the SMB dialect. If client sets this bit in the request, the server SHOULD[<23>](#Appendix_A_23) also set this bit in the response. | +| SMB_FLAGS2_REPARSE_PATH

0x0400 | If set, the path in the request MUST contain an @GMT token (that is, a Previous Version token), as specified in section [2.2.1.1.1](#Section_bffc70f9b16a453b939a0b6d3c9263af). | +| SMB_FLAGS2_EXTENDED_SECURITY

0x0800 | Indicates that the client or server supports SPNEGO authentication, as specified in section [3.2.5.2](#Section_d367854f5eee45e8a588eed596a1a521) for client behavior and section [3.3.5.2](#Section_5c005d39b56b4abf83d43847e9ed949c) for server behavior. This bit field SHOULD be set to one only when NT LAN Manager or later is negotiated for the SMB dialect and the client or server supports extended security. | + +**PIDHigh (2 bytes):** This field MUST give the 2 high bytes of the [**process identifier (PID)**](#gt_38a420dd-6f31-456e-ae5c-63ec6905380d) if the _Client.Supports32BitPIDs_, as specified in section [3.2.1.1](#Section_585c3763326b4cff8db5a4379509bbaa), is TRUE. Otherwise, it MUST be set to zero. + +### SMB Command Extensions + +#### SMB_COM_OPEN_ANDX (0x2D) + +##### Client Request Extensions + +An SMB_COM_OPEN_ANDX request is sent by a client to open a file or named pipe on a server. The new flag value in the **Flags** field of the SMB_COM_OPEN_ANDX request, SMB_OPEN_EXTENDED_RESPONSE, is used to trigger new behavior that is specified in this document. All other fields are as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.4.41.1. + +This command has been deprecated. Client implementations SHOULD use SMB_COM_NT_CREATE_ANDX. + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- UCHAR AndXCommand; +- UCHAR AndXReserved; +- USHORT AndXOffset; +- USHORT Flags; +- USHORT AccessMode; +- SMB_FILE_ATTRIBUTES SearchAttrs; +- SMB_FILE_ATTRIBUTES FileAttrs; +- UTIME CreationTime; +- USHORT OpenMode; +- ULONG AllocationSize; +- ULONG Timeout; +- USHORT Reserved\[2\]; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- SMB_STRING FileName; +- } +- } + +**SMB_Parameters** + +Words (34 bytes): + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------ | --- | --- | --- | --- | --- | --- | --- | ------------ | --- | ---------- | --- | --- | --- | --- | --- | -------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| AndXCommand | | | | | | | | AndXReserved | | | | | | | | AndXOffset | | | | | | | | | | | | | | | | +| Flags | | | | | | | | | | | | | | | | AccessMode | | | | | | | | | | | | | | | | +| SearchAttrs | | | | | | | | | | | | | | | | FileAttrs | | | | | | | | | | | | | | | | +| CreationTime | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| OpenMode | | | | | | | | | | | | | | | | AllocationSize | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | Timeout | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | Reserved | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | + +**Flags (2 bytes):** A 16-bit field of bit flags. For completeness, all flags are listed in the following table. Bit values listed as reserved SHOULD be set to zero by the client and MUST be ignored by the server. + +| Name & bitmask | Meaning | +| ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| SMB_OPEN_QUERY_INFORMATION

0x0001 | If set, the client is requesting additional info in the response. The server MUST set **FileDataSize**, **FileAttrs**, **AccessRights**, **ResourceType**, and **NMPipeStatus** in the response. If not set, the server MUST set these fields to zero. | +| SMB_OPEN_OPLOCK

0x0002 | If set, the client is requesting an [**oplock**](#gt_7b8c743e-84b1-4c7e-83ea-cfb818cdb394). | +| SMB_OPEN_OPBATCH

0x0004 | If set, the client is requesting a batch oplock. | +| SMB_OPEN_EXTENDED_RESPONSE

0x0010 | If set, the client is requesting the extended format of the response, as described later in this section. | +| Reserved

0xFFE8 | Reserved; SHOULD be set to zero by the client, and MUST be ignored by the server. | + +##### Server Response Extensions + +If the client requested extended information by setting SMB_OPEN_EXTENDED_RESPONSE, then a successful response takes the following format. Aside from **WordCount**, **ResourceType**, **ServerFID**, **Reserved**, **MaximalAccessRights**, and **GuestMaximalAccessRights** fields, all other fields are as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.4.41.2. + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- UCHAR AndXCommand; +- UCHAR AndXReserved; +- USHORT AndXOffset; +- USHORT FID; +- SMB_FILE_ATTRIBUTES FileAttrs; +- UTIME LastWriteTime; +- ULONG FileDataSize; +- USHORT AccessRights; +- USHORT ResourceType; +- USHORT NMPipeStatus; +- USHORT OpenResults; +- ULONG ServerFID; +- USHORT Reserved; +- ACCESS_MASK MaximalAccessRights; +- ACCESS_MASK GuestMaximalAccessRights; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | -------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters (39 bytes) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data | | | | | | | | +| ... | | | | | | | | + +**SMB_Parameters (39 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ---------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words (38 bytes) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** The value of this field MUST be 0x13. + +**Words (38 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------- | --- | --- | --- | --- | --- | --- | --- | ------------ | --- | ---------- | --- | --- | --- | --- | --- | ------------------------ | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| AndXCommand | | | | | | | | AndXReserved | | | | | | | | AndXOffset | | | | | | | | | | | | | | | | +| FID | | | | | | | | | | | | | | | | FileAttrs | | | | | | | | | | | | | | | | +| LastWriteTime | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| FileDataSize | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| AccessRights | | | | | | | | | | | | | | | | ResourceType | | | | | | | | | | | | | | | | +| NMPipeStatus | | | | | | | | | | | | | | | | OpenResults | | | | | | | | | | | | | | | | +| ServerFID | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Reserved | | | | | | | | | | | | | | | | MaximalAccessRights | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | GuestMaximalAccessRights | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | + +**ResourceType (2 bytes):** The file type. This field MUST be interpreted as follows: + +| Name & value | Meaning | +| ------------------------------------- | ----------------------------------------------------------------------- | +| FileTypeDisk

0x0000 | File or Directory | +| FileTypeByteModePipe

0x0001 | [**Byte mode**](#gt_8586fe9a-1cfa-458a-a145-8db64d69c69c) named pipe | +| FileTypeMessageModePipe

0x0002 | [**Message mode**](#gt_c49a48e8-f1ac-4568-bc87-0672eb08868b) named pipe | +| FileTypePrinter

0x0003 | Printer Device | +| FileTypeUnknown

0xFFFF | Unknown file type | + +**ServerFID (4 bytes):** Reserved but not implemented. Intended as a 32-bit server file identifier that uniquely identifies the file on the server. This field MUST be set to zero by the server and ignored by the client. + +**Reserved (2 bytes):** An unused value that SHOULD be set to zero when sending this message. The client MUST ignore this field when receiving this message. + +**MaximalAccessRights (4 bytes):** The maximum access rights that this user has on this object. This field MUST be encoded in an ACCESS_MASK format, as specified in section [2.2.1.4](#Section_6e848af95cb64e7383acb68698e3d920). + +**GuestMaximalAccessRights (4 bytes):** The maximum access rights that the [**guest account**](#gt_0377d4d6-d45e-4121-8f20-cba8f7fbb7a4) has on this file. This field MUST be encoded in an ACCESS_MASK format, as specified in section 2.2.1.4. Support and exact specifications of the notion of a guest account is implementation specific. Implementations that do not support the notion of a guest account MUST set this field to zero.[<24>](#Appendix_A_24) + +**SMB_Data (2 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** The value of this field SHOULD[<25>](#Appendix_A_25) be set to zero. The server MUST NOT send any data in this message. + +#### SMB_COM_READ_ANDX (0x2E) + +##### Client Request Extensions + +An SMB_COM_READ_ANDX request is sent by a client to read from a file or named pipe on a server. These extensions overload the **Timeout** field with the new **Timeout_or_MaxCountHigh** field, which allows the use of read lengths above 0xFFFF when CAP_LARGE_READX has been negotiated. All other fields are defined as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.4.42.1. + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- UCHAR AndXCommand; +- UCHAR AndXReserved; +- USHORT AndXOffset; +- USHORT FID; +- ULONG Offset; +- USHORT MaxCountOfBytesToReturn; +- USHORT MinCountOfBytesToReturn; +- ULONG Timeout_or_MaxCountHigh; +- USHORT Remaining; +- ULONG OffsetHigh (optional); +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +**SMB_Parameters** + +**Words (24 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------------------- | --- | --- | --- | --- | --- | --- | --- | ------------ | --- | ---------- | --- | --- | --- | --- | --- | ----------------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| AndXCommand | | | | | | | | AndXReserved | | | | | | | | AndXOffset | | | | | | | | | | | | | | | | +| FID | | | | | | | | | | | | | | | | Offset | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | MaxCountOfBytesToReturn | | | | | | | | | | | | | | | | +| MinCountOfBytesToReturn | | | | | | | | | | | | | | | | Timeout_or_MaxCountHigh | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | Remaining | | | | | | | | | | | | | | | | +| OffsetHigh (optional) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Timeout_or_MaxCountHigh (4 bytes):** This field is extended to be treated as a union of a 32-bit **Timeout** field and a 16-bit **MaxCountHigh** field. When reading from a regular file, the field MUST be interpreted as **MaxCountHigh** and the two unused bytes MUST be zero. When reading from a name pipe or I/O device, the field MUST be interpreted as **Timeout**. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Timeout | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Timeout (4 bytes):** The client can set the **Timeout** field to a requested time-out value in milliseconds. The client SHOULD[<26>](#Appendix_A_26) set this field to any integer value. The values 0, 0xFFFFFFFF, and 0xFFFFFFFE have special meaning, as specified in \[MS-CIFS\] section 3.3.5.36. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------ | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | -------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| MaxCountHigh | | | | | | | | | | | | | | | | Reserved | | | | | | | | | | | | | | | | + +**MaxCountHigh (2 bytes):** This field is a 16-bit integer. If the read being requested is larger than 0xFFFF bytes in size, then the client MUST use the **MaxCountHigh** field to hold the two most significant bytes of the requested size, which allows for 32-bit read lengths to be requested when combined with **MaxCountOfBytesToReturn**. If the read is not larger than 0xFFFF bytes, then the client MUST set the **MaxCountHigh** to zero.[<27>](#Appendix_A_27) + +**Reserved (2 bytes):** Unlike most other reserved fields, this field can sometimes take specific values. The **Reserved** field SHOULD be set to zero by the client if **MaxCountHigh** is zero, and SHOULD be set to 0xFFFF by the client if **MaxCountHigh** is 0xFFFF. For all other values, this field SHOULD be set to zero by the client. For all values, this field MUST be ignored by the server. + +##### Server Response Extensions + +A successful response takes the following format. Aside from the first two bytes of the **SMB_Parameters.Words.Reserved2\[\]** field being extended for use as the new **DataLengthHigh** field, all other fields are defined as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.4.42.2. + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- UCHAR AndXCommand; +- UCHAR AndXReserved; +- USHORT AndXOffset; +- USHORT Available; +- USHORT DataCompactionMode; +- USHORT Reserved1; +- USHORT DataLength; +- USHORT DataOffset; +- USHORT DataLengthHigh; +- USHORT Reserved2\[4\]; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR Pad\[\] (optional); +- UCHAR Data\[variable\]; +- } +- } + +**SMB_Parameters** + +**Words (24 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------- | --- | --- | --- | --- | --- | --- | --- | ------------ | --- | ---------- | --- | --- | --- | --- | --- | ------------------ | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| AndXCommand | | | | | | | | AndXReserved | | | | | | | | AndXOffset | | | | | | | | | | | | | | | | +| Available | | | | | | | | | | | | | | | | DataCompactionMode | | | | | | | | | | | | | | | | +| Reserved1 | | | | | | | | | | | | | | | | DataLength | | | | | | | | | | | | | | | | +| DataOffset | | | | | | | | | | | | | | | | DataLengthHigh | | | | | | | | | | | | | | | | +| Reserved2 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**DataLengthHigh (2 bytes):** If the data read is greater than or equal to 0x00010000 bytes (64KB) in length, then the server MUST set the two least-significant bytes of the length in the **DataLength** field of the response and the two most-significant bytes of the length in the **DataLengthHigh** field. Otherwise, this field MUST be set to zero. + +**Reserved2 (8 bytes):** This field MUST be set to zero by the server and MUST be ignored by the client. + +#### SMB_COM_WRITE_ANDX (0x2F) + +##### Client Request Extensions + +An SMB_COM_WRITE_ANDX request is sent by a client to write data to a file or named pipe on a server. These extensions allocate the **SMB_Parameters.Words.Reserved** field for use as the **DataLengthHigh** field. This field is used when the CAP_LARGE_WRITEX capability has been negotiated to allow for file writes larger than 0xFFFF bytes in length. All other fields are defined as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.4.43.1. + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- UCHAR AndXCommand; +- UCHAR AndXReserved; +- USHORT AndXOffset; +- USHORT FID; +- ULONG Offset; +- ULONG Timeout; +- USHORT WriteMode; +- USHORT Remaining; +- USHORT DataLengthHigh; +- USHORT DataLength; +- USHORT DataOffset; +- ULONG OffsetHigh (optional); +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR Pad; +- UCHAR Data\[variable\]; +- } +- } + +**SMB_Parameters** + +**Words (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------------------- | --- | --- | --- | --- | --- | --- | --- | ------------ | --- | ---------- | --- | --- | --- | --- | --- | -------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| AndXCommand | | | | | | | | AndXReserved | | | | | | | | AndXOffset | | | | | | | | | | | | | | | | +| FID | | | | | | | | | | | | | | | | Offset | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | Timeout | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | WriteMode | | | | | | | | | | | | | | | | +| Remaining | | | | | | | | | | | | | | | | DataLengthHigh | | | | | | | | | | | | | | | | +| DataLength | | | | | | | | | | | | | | | | DataOffset | | | | | | | | | | | | | | | | +| OffsetHigh (optional) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**DataLengthHigh (2 bytes):** This field contains the two most significant bytes of the length of the data to write to the file. If the number of bytes to be written is greater than or equal to 0x00010000( 64 kilobytes), then the client MUST set the two least significant bytes of the length in the **DataLength** field of the request and the two most significant bytes of the length in the **DataLengthHigh** field. + +##### Server Response Extensions + +A successful response takes the following format. These extensions allocate the first two bytes of the **SMB_Parameters.Words.Reserved** field for use as the **CountHigh** field. This field is used when the CAP_LARGE_WRITEX capability has been negotiated to allow for file writes larger than 0xFFFF bytes in length. All other fields are defined as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.4.43.2. + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- UCHAR AndXCommand; +- UCHAR AndXReserved; +- USHORT AndXOffset; +- USHORT Count; +- USHORT Available; +- USHORT CountHigh; +- USHORT Reserved; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +**SMB_Parameters** + +**Words (12 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------- | --- | --- | --- | --- | --- | --- | --- | ------------ | --- | ---------- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| AndXCommand | | | | | | | | AndXReserved | | | | | | | | AndXOffset | | | | | | | | | | | | | | | | +| Count | | | | | | | | | | | | | | | | Available | | | | | | | | | | | | | | | | +| CountHigh | | | | | | | | | | | | | | | | Reserved | | | | | | | | | | | | | | | | + +**CountHigh (2 bytes):** This field contains the two most significant bytes of the count of bytes written. If the number of bytes written is greater than or equal to 0x00010000( 64 kilobytes), then the server MUST set the two least significant bytes of the length in the **Count** field of the request and the two most significant bytes of the length in the **CountHigh** field. + +**Reserved (2 bytes):** This field is reserved. Servers MUST set this field to zero and clients MUST ignore this field upon receipt. + +#### SMB_COM_TRANSACTION2 (0x32) Extensions + +The SMB_COM_TRANSACTION2 request is sent by a client to execute a specific operation of various types on the server. These operations include file enumeration, query and set file attribute operations, and DFS referral retrieval. The general format of the SMB_COM_TRANSACTION2 command requests and responses is given in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) sections 2.2.4.46 and 2.2.4.47. Execution of SMB_COM_TRANSACTION2 is defined as specified in \[MS-CIFS\] sections 3.2.4.1.5, 3.2.5.1.4, and 3.3.5.2.5. + +Valid SMB_COM_TRANSACTION2 subcommand codes, also known as "Trans2 subcommands", are specified in section [2.2.2.2](#Section_75a3a815d2c64c948d668221869c7975). The format and syntax of these subcommands are specified in section [2.2.6](#Section_a3f5183beedd40e9a13ba4d80eec5d0b) and in \[MS-CIFS\] section 2.2.6. + +#### SMB_COM_NEGOTIATE (0x72) + +##### Client Request Extensions + +All fields are defined as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.4.52.1. In order to support the extension in this document, the client MUST include the NT LAN Manager dialect (identified by the "NT LM 0.12" dialect string) in the **SMB_Data.Bytes.Dialects\[\]** array of the request. + +When set, the **SMB_Header.Flags2** SMB_FLAGS2_EXTENDED_SECURITY flag indicates support for specification [\[RFC2743\]](http://go.microsoft.com/fwlink/?LinkId=90378) and GSS authentication (see section [3.1.5.1](#Section_2fa60c5a71ee4248a4e9dd5d0db2373d)), and indicates to the server that it sends an Extended Security response (see section [2.2.4.5.2](#Section_8f8ce04ae1844d17bfb22cf762e6f6c4)). + +##### Server Response Extensions + +###### Extended Security Response + +If the selected dialect is NT LAN Manager and the client has indicated extended security is being used, a successful response MUST take the following form. Aside from the additional notes to the **SMB_Parameters.Words.MaxBufferSize** and **SMB_Parameters.Words.ChallengeLength** fields, the new **SMB_Parameters.Words.Capabilities** bits, and the **SMB_Data.Bytes.ServerGuid** and **SMB_Data.Bytes.SecurityBlob** fields, all other fields are defined as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.4.52.2. + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT DialectIndex; +- UCHAR SecurityMode; +- USHORT MaxMpxCount; +- USHORT MaxNumberVcs; +- ULONG MaxBufferSize; +- ULONG MaxRawSize; +- ULONG SessionKey; +- ULONG Capabilities; +- FILETIME SystemTime; +- SHORT ServerTimeZone; +- UCHAR ChallengeLength; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- GUID ServerGUID; +- UCHAR SecurityBlob\[\]; +- } +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ------------------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters (35 bytes) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data (variable) | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (35 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ---------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words (34 bytes) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | + +**Words (34 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------ | --- | --- | --- | --- | --- | --- | --- | --------------- | --- | ---------- | --- | --- | --- | --- | --- | ------------ | --- | --- | --- | ---------- | --- | --- | --- | -------------- | --- | --- | --- | --- | --- | ---------- | --- | +| DialectIndex | | | | | | | | | | | | | | | | SecurityMode | | | | | | | | MaxMpxCount | | | | | | | | +| ... | | | | | | | | MaxNumberVcs | | | | | | | | | | | | | | | | MaxBufferSize | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | MaxRawSize | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | SessionKey | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | Capabilities | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | SystemTime | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | ServerTimeZone | | | | | | | | +| ... | | | | | | | | ChallengeLength | | | | | | | | + +**MaxBufferSize (4 bytes):** Maximum size, in bytes, of the server buffer for receiving SMB messages. This value accounts for the size of the largest SMB message that the client can send to the server, measured from the start of the SMB header to the end of the packet. This value does not account for any underlying transport-layer packet headers, and thus does not account for the size of the complete network packet.[<28>](#Appendix_A_28) + +The only cases in which this maximum buffer size MUST be exceeded are: + +- When the SMB_COM_WRITE_ANDX command is used and the client and server both support the CAP_LARGE_WRITEX capability (see the **Capabilities** field for more information). +- When the SMB_COM_WRITE_RAW command is used and both the client and server support the CAP_RAW_MODE capability. + +**Capabilities (4 bytes):** A 32-bit field providing a set of server capability indicators. This bit field is used to indicate to the client which features are supported by the server. Any value not listed in the following table is unused. The server MUST set the unused bits to zero. The client MUST ignore these bits. + +These extensions provide the following new capability bits: + +- CAP_COMPRESSED_DATA +- CAP_DYNAMIC_REAUTH +- CAP_EXTENDED_SECURITY +- CAP_INFOLEVEL_PASSTHRU +- CAP_LARGE_WRITEX +- CAP_LWIO +- CAP_UNIX + +The rest of the values in the capabilities table are included for completeness. + +| Name and bitmask | Meaning | +| ---------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| CAP_RAW_MODE

0x00000001 | The server supports SMB_COM_READ_RAW and SMB_COM_WRITE_RAW requests.[<29>](#Appendix_A_29) Raw mode is not supported over connectionless transports. | +| CAP_MPX_MODE

0x00000002 | The server supports SMB_COM_READ_MPX and SMB_COM_WRITE_MPX requests.[<30>](#Appendix_A_30) MPX mode is supported only over connectionless transports. | +| CAP_UNICODE

0x00000004 | The server supports UTF-16LE [**Unicode strings**](#gt_b069acb4-e364-453e-ac83-42d469bb339e). | +| CAP_LARGE_FILES

0x00000008 | The server supports large files with 64-bit offsets. | +| CAP_NT_SMBS

0x00000010 | The server supports SMB commands particular to the NT LAN Manager dialect. | +| CAP_RPC_REMOTE_APIS

0x00000020 | The server supports the use of remote procedure call [\[MS-RPCE\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-RPCE%5d.pdf#Section_290c38b192fe422991e64fc376610c15) for remote API calls. Similar functionality would otherwise require use of the legacy Remote Administration Protocol, as specified in [\[MS-RAP\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-RAP%5d.pdf#Section_fb8d5bd1e57c4be1b063ec31330bdd58). | +| CAP_STATUS32

0x00000040 | The server is capable of responding with 32-bit status codes in the **Status** field of the SMB header (for more information, see \[MS-CIFS\] 2.2.3.1). CAP_STATUS32 can also be referred to as CAP_NT_STATUS. | +| CAP_LEVEL_II_OPLOCKS

0x00000080 | The server supports level II opportunistic locks (oplocks). | +| CAP_LOCK_AND_READ

0x00000100 | The server supports the SMB_COM_LOCK_AND_READ command requests. | +| CAP_NT_FIND

0x00000200 | The server supports the TRANS2_FIND_FIRST2, TRANS2_FIND_NEXT2, and FIND_CLOSE2 command requests. This bit SHOULD[<31>](#Appendix_A_31) be set if CAP_NT_SMBS is set. | +| CAP_DFS

0x00001000 | The server is aware of the DFS Referral Protocol, as specified in [\[MS-DFSC\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-DFSC%5d.pdf#Section_3109f4be2dbb42c99b8e0b34f7a2135e), and can respond to DFS referral requests. For more information, see \[MS-CIFS\] sections 2.2.6.16.1 and 2.2.6.16.2. | +| CAP_INFOLEVEL_PASSTHRU

0x00002000 | The server supports pass-through Information Levels, as specified in section [2.2.2.3](#Section_51380f0586164df6998c26d65d7d6ca8). This allows the client to pass Information Level structures in QUERY and SET operations.[<32>](#Appendix_A_32) | +| CAP_LARGE_READX

0x00004000 | The server supports large read operations. This capability affects the maximum size, in bytes, of the server buffer for sending an SMB_COM_READ_ANDX response to the client. When this capability is set by the server (and set by the client in the SMB_COM_SESSION_SETUP_ANDX request), then the maximum server buffer size for sending data can exceed the **MaxBufferSize** field. Therefore, the server can send a single SMB_COM_READ_ANDX response to the client up to an implementation-specific default size.[<33>](#Appendix_A_33)

When signing is active on a connection, then clients MUST limit read lengths to the **MaxBufferSize** value negotiated by the server irrespective of the value of the CAP_LARGE_READX flag. | +| CAP_LARGE_WRITEX

0x00008000 | The server supports large write operations. This capability affects the maximum size, in bytes, of the server buffer for receiving an SMB_COM_WRITE_ANDX client request. When this capability is set by the server (and set by the client in the SMB_COM_SESSION_SETUP_ANDX request), then the maximum server buffer size of bytes it writes can exceed the **MaxBufferSize** field. Therefore, a client can send a single SMB_COM_WRITE_ANDX request up to this size.[<34>](#Appendix_A_34)

When signing is active on a connection, then clients MUST limit write lengths to the **MaxBufferSize** value negotiated by the server, irrespective of the value of the CAP_LARGE_WRITEX flag. | +| CAP_LWIO

0x00010000 | The server supports new light-weight I/O control ([**IOCTL**](#gt_09d6bc87-34ed-48e8-b4d4-962e90543462)) and file system control (FSCTL) operations. These operations are accessed using the NT_TRANSACT_IOCTL subcommand (section [2.2.7.2](#Section_bdcc7363d0c74417b45ae46934b11419)).[<35>](#Appendix_A_35) | +| CAP_UNIX

0x00800000 | The server supports UNIX extensions.[<36>](#Appendix_A_36) For more information, see [\[SNIA\]](http://go.microsoft.com/fwlink/?LinkId=90519). | +| CAP_COMPRESSED_DATA

0x02000000 | Reserved but not implemented.[<37>](#Appendix_A_37)

The server supports compressed SMB packets. | +| CAP_DYNAMIC_REAUTH

0x20000000 | The server supports re-authentication.[<38>](#Appendix_A_38) | +| CAP_PERSISTENT_HANDLES

0x40000000 | Reserved but not implemented.[<39>](#Appendix_A_39)

The server supports persistent handles. | +| CAP_EXTENDED_SECURITY

0x80000000 | The server supports extended security for authentication, as specified in section [3.2.4.2.4](#Section_d3b7bcd3cd684d3b916b443ccd55f953). This bit is used in conjunction with the SMB_FLAGS2_EXTENDED_SECURITY **SMB_Header.Flags2** flag, as specified in section [2.2.3.1](#Section_3c0848a6efe947c2b57af7e8217150b9). | + +**ChallengeLength (1 byte):** When the CAP_EXTENDED_SECURITY bit is set, the server MUST set this value to zero and clients MUST ignore this value. + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** The number of bytes in the **SMB_Data.Bytes** array, which follows. This field MUST be greater than or equal to 0x0010. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ServerGUID (16 bytes) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| SecurityBlob (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ServerGUID (16 bytes):** This field MUST be a GUID generated by the server to uniquely identify this server. This field SHOULD NOT be used by a client as a secure method of identifying a server because it can be forged. A client SHOULD use this information to detect whether connections to different textual names resolve to the same target server when direct TCP is used. This knowledge can then be used to set the **SMB_Parameters.Words.VcNumber** field in the SMB_COM_SESSION_SETUP_ANDX request (see \[MS-CIFS\] section 2.2.4.53.1).[<40>](#Appendix_A_40) + +**SecurityBlob (variable):** A security binary large object (BLOB) that SHOULD contain an authentication token as produced by the GSS protocol (as specified in section 3.2.4.2.4 and [\[RFC2743\]](http://go.microsoft.com/fwlink/?LinkId=90378)). + +###### Non-Extended Security Response + +If extended security is not being used and the NT LAN Manager dialect has been selected, then a successful response MUST take the following form. Aside from the new **SMB_Parameters.Words.Capabilities** bits, the additional notes to the **SMB_Parameters.Words.MaxBufferSize** field, and the **SMB_Data.Bytes.ServerName** field, all other fields are defined as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.4.52.2. The **SMB_Parameters.Words.ChallengeLength** field and the entire **SMB_Data** block are included from \[MS-CIFS\] to highlight the differences between the Extended and Non-Extended Security responses. + +In order to determine whether the **SMB_Data.Bytes.ServerName** field is present, the client MUST check the **SMB_Data.ByteCount** field to determine whether additional data is present beyond the NULL terminator of the **SMB_Data.Bytes.DomainName** string. + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- USHORT DialectIndex; +- UCHAR SecurityMode; +- USHORT MaxMpxCount; +- USHORT MaxNumberVcs; +- ULONG MaxBufferSize; +- ULONG MaxRawSize; +- ULONG SessionKey; +- ULONG Capabilities; +- FILETIME SystemTime; +- SHORT ServerTimeZone; +- UCHAR ChallengeLength; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR Challenge\[\]; +- SMB_STRING DomainName\[\]; +- SMB_STRING ServerName\[\]; +- } +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ------------------- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters (35 bytes) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | SMB_Data (variable) | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (35 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ---------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Words (34 bytes) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | + +**Words (34 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------ | --- | --- | --- | --- | --- | --- | --- | --------------- | --- | ---------- | --- | --- | --- | --- | --- | ------------ | --- | --- | --- | ---------- | --- | --- | --- | -------------- | --- | --- | --- | --- | --- | ---------- | --- | +| DialectIndex | | | | | | | | | | | | | | | | SecurityMode | | | | | | | | MaxMpxCount | | | | | | | | +| ... | | | | | | | | MaxNumberVcs | | | | | | | | | | | | | | | | MaxBufferSize | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | MaxRawSize | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | SessionKey | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | Capabilities | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | SystemTime | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | ServerTimeZone | | | | | | | | +| ... | | | | | | | | ChallengeLength | | | | | | | | + +**MaxBufferSize (4 bytes):** Maximum size, in bytes, of the server buffer for receiving SMB messages. This value indicates the size of the largest SMB message that the server is capable of receiving from the client, measured from the start of the SMB header to the end of the packet. This value does not account for any underlying transport-layer packet headers and thus does not account for the size of the complete network packet.[<41>](#Appendix_A_41) + +The only exceptions in which this maximum buffer size can be exceeded are: + +- When the SMB_COM_WRITE_ANDX command is used and both the client and server support the CAP_LARGE_WRITEX capability (see the **Capabilities** field for more information). +- When the SMB_COM_READ_ANDX command is used and both the client and server support the CAP_LARGE_READX capability (see the Capabilities field for more information). +- When the SMB_COM_WRITE_RAW command is used and both the client and server support the CAP_RAW_MODE capability. + +**Capabilities (4 bytes):** A 32-bit field providing a set of server capability indicators. This bit field is used to indicate to the client which features are supported by the server. Any value not listed in the following table is unused. The server MUST set the unused bits to zero in a response and the client MUST ignore these bits. + +There are several new capability bits: + +- CAP_COMPRESSED_DATA +- CAP_DYNAMIC_REAUTH +- CAP_EXTENDED_SECURITY +- CAP_INFOLEVEL_PASSTHRU +- CAP_LARGE_WRITEX +- CAP_LWIO +- CAP_UNIX + +Any value not listed in the following table SHOULD be unused. A server SHOULD set the unused bits to zero in a response and a client MUST ignore these bits. The table of server capabilities is provided in the previous section. + +**ChallengeLength (1 byte):** The value of this field MUST be 0x08 and is the length of the random challenge used in challenge/response authentication. This field is often referred to as EncryptionKeyLength. + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** This field MUST be greater than or equal to 0x0003. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Challenge (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| DomainName (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ServerName (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Challenge (variable):** An array of unsigned bytes that MUST be the length of the number of bytes specified in the **ChallengeLength** field and MUST represent the server challenge. This array MUST NOT be NULL-terminated.[<42>](#Appendix_A_42) + +**DomainName (variable):** The name of the [**domain**](#gt_b0276eb2-4e65-4cf1-a718-e0920a614aca) or workgroup to which the server belongs. + +**ServerName (variable):** A variable-length, NULL-terminated Unicode string that contains the name of the Server. + +#### SMB_COM_SESSION_SETUP_ANDX (0x73) + +##### Client Request Extensions + +An SMB_COM_SESSION_SETUP_ANDX request MUST be sent by a client to begin user authentication on an SMB connection and establish an SMB session. + +When extended security is being used (see section [3.2.4.2.4](#Section_d3b7bcd3cd684d3b916b443ccd55f953)), the request MUST take the following form. Aside from the **SecurityBlobLength** field, the additional capabilities used in the **Capabilities** field, and the **ByteCount** and **SecurityBlob** fields, all other fields are as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.4.53.1. + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- UCHAR AndXCommand; +- UCHAR AndXReserved; +- USHORT AndXOffset; +- USHORT MaxBufferSize; +- USHORT MaxMpxCount; +- USHORT VcNumber; +- ULONG SessionKey; +- USHORT SecurityBlobLength; +- ULONG Reserved; +- ULONG Capabilities; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR SecurityBlob\[SecurityBlobLength\]; +- SMB_STRING NativeOS\[\]; +- SMB_STRING NativeLanMan\[\]; +- } +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | ------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters (25 bytes) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | SMB_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (25 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ---------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words (24 bytes) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | + +**WordCount (1 byte):** The value of this field MUST be 0x0C. + +**Words (24 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------- | --- | --- | --- | --- | --- | --- | --- | ------------ | --- | ---------- | --- | --- | --- | --- | --- | ------------------ | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| AndXCommand | | | | | | | | AndXReserved | | | | | | | | AndXOffset | | | | | | | | | | | | | | | | +| MaxBufferSize | | | | | | | | | | | | | | | | MaxMpxCount | | | | | | | | | | | | | | | | +| VcNumber | | | | | | | | | | | | | | | | SessionKey | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | SecurityBlobLength | | | | | | | | | | | | | | | | +| Reserved | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Capabilities | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SecurityBlobLength (2 bytes):** This value MUST specify the length in bytes of the variable-length **SecurityBlob** field that is contained within the request. + +**Capabilities (4 bytes):** A set of client capabilities. This field has the same structure as the **SMB_Parameters.Capabilities** field of the SMB_COM_NEGOTIATE Server Response specified in section [2.2.4.5.2](#Section_8f8ce04ae1844d17bfb22cf762e6f6c4).[<43>](#Appendix_A_43) + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** If SMB_FLAGS2_UNICODE is set in the **SMB_Header.Flags2** field, then this field MUST be greater than or equal to 0x0004. If SMB_FLAGS2_UNICODE is not set, then this field MUST be greater than or equal to 0x0002. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SecurityBlob (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| NativeOS (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| NativeLanMan (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SecurityBlob (variable):** This field MUST be the authentication token sent to the server, as specified in section 3.2.4.2.4 and in [\[RFC2743\]](http://go.microsoft.com/fwlink/?LinkId=90378). + +**NativeOS (variable):** A string that represents the native operating system of the SMB client. If SMB_FLAGS2_UNICODE is set in the **Flags2** field of the SMB header of the request, then the name string MUST be a NULL-terminated array of 16-bit Unicode characters. Otherwise, the name string MUST be a NULL-terminated array of [**OEM characters**](#gt_681188c8-235a-47f5-af29-7fbd0676a6b8). If the name string consists of Unicode characters, then this field MUST be aligned to start on a 2-byte boundary from the start of the SMB header.[<44>](#Appendix_A_44) + +**NativeLanMan (variable):** A string that represents the native LAN manager type of the client. If SMB_FLAGS2_UNICODE is set in the **Flags2** field of the SMB header of the request, then the name string MUST be a NULL-terminated array of 16-bit Unicode characters. Otherwise, the name string MUST be a NULL-terminated array of OEM characters. If the name string consists of Unicode characters, then this field MUST be aligned to start on a 2-byte boundary from the start of the SMB header.[<45>](#Appendix_A_45) + +##### Server Response Extensions + +When extended security is being used (see section [3.2.4.2.4](#Section_d3b7bcd3cd684d3b916b443ccd55f953)), a successful response MUST take the following form. Aside from the SecurityBlobLength field, the additional capabilities used in the Capabilities field, the ByteCount and SecurityBlob fields, and the omission of the PrimaryDomain field, all of the other fields are as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.4.53.2. + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- UCHAR AndXCommand; +- UCHAR AndXReserved; +- USHORT AndXOffset; +- USHORT Action; +- USHORT SecurityBlobLength; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR SecurityBlob\[SecurityBlobLength\]; +- SMB_STRING NativeOS\[\]; +- SMB_STRING NativeLanMan\[\]; + +- } +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | ------------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SMB_Parameters | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | SMB_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SMB_Parameters (9 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ----- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | + +**WordCount (1 byte):** The value of this field MUST be 0x04. + +**Words (8 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------- | --- | --- | --- | --- | --- | --- | --- | ------------ | --- | ---------- | --- | --- | --- | --- | --- | ------------------ | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| AndXCommand | | | | | | | | AndXReserved | | | | | | | | AndXOffset | | | | | | | | | | | | | | | | +| Action | | | | | | | | | | | | | | | | SecurityBlobLength | | | | | | | | | | | | | | | | + +**Action (2 bytes):** A 16-bit field. The two lowest-order bits have been defined. + +| Name and bitmask | Meaning | +| -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| SMB_SETUP_GUEST

0x0001 | If clear (0), then the user successfully authenticated and is logged in.

If set (1), then authentication failed but the server has granted guest access; the user is logged in as a Guest. | +| SMB_SETUP_USE_LANMAN_KEY

0x0002 | This bit is not used with extended security and MUST be clear. | + +The server's response does not specify whether the access granted is of type Anonymous. However, the security system can provide that information once authorization completes. + +**SecurityBlobLength (2 bytes):** This value MUST specify the length, in bytes, of the variable-length **SecurityBlob** that is contained within the response. + +**SMB_Data (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ByteCount | | | | | | | | | | | | | | | | Bytes (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ByteCount (2 bytes):** If SMB_FLAGS2_UNICODE is set in the **SMB_Header.Flags2** field, then this field MUST be greater than or equal to 0x0006. If SMB_FLAGS2_UNICODE is not set, then this field MUST be greater than or equal to 0x0003. + +**Bytes (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SecurityBlob (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| NativeOS (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| NativeLanMan (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SecurityBlob (variable):** This value MUST contain the authentication token being returned to the client, as specified in section [3.3.5.3](#Section_1f152df0a61d4e769af6da96fa783c02) and [\[RFC2743\]](http://go.microsoft.com/fwlink/?LinkId=90378). + +**NativeOS (variable):** A string that represents the native operating system of the server. If SMB_FLAGS2_UNICODE is set in the **Flags2** field of the SMB header of the response, then the string MUST be a NULL-terminated array of 16-bit Unicode characters. Otherwise, the string MUST be a NULL-terminated array of OEM characters. If the name string consists of Unicode characters, then this field MUST be aligned to start on a 2-byte boundary from the start of the SMB header. + +**NativeLanMan (variable):** A string that represents the native LAN Manager type of the server. If SMB_FLAGS2_UNICODE is set in the **Flags2** field of the SMB header of the response, then the string MUST be a NULL-terminated array of 16-bit Unicode characters. Otherwise, the string MUST be a NULL-terminated array of OEM characters. If the name string consists of Unicode characters, then this field MUST be aligned to start on a 2-byte boundary from the start of the SMB header. + +#### SMB_COM_TREE_CONNECT_ANDX (0x75) + +##### Client Request Extensions + +An SMB_COM_TREE_CONNECT_ANDX request MUST be sent by a client to establish a [**tree connect**](#gt_c65d1989-3473-4fa9-ac45-6522573823e3) to a share. These extensions define new flags (TREE_CONNECT_ANDX_EXTENDED_SIGNATURES and TREE_CONNECT_ANDX_EXTENDED_RESPONSE) in the **SMB_Parameters.Words.Flags** field that are used to trigger the new behavior defined in this specification. The full field description from [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) is included for completeness. All other fields are as specified in \[MS-CIFS\] section 2.2.4.55.1. + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- UCHAR AndXCommand; +- UCHAR AndXReserved; +- USHORT AndXOffset; +- USHORT Flags; +- USHORT PasswordLength; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- UCHAR Password\[PasswordLength\]; +- UCHAR Pad\[\]; +- SMB_STRING Path; +- OEM_STRING Service; +- } +- } + +**SMB_Parameters** + +**Words (8 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------- | --- | --- | --- | --- | --- | --- | --- | ------------ | --- | ---------- | --- | --- | --- | --- | --- | -------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| AndXCommand | | | | | | | | AndXReserved | | | | | | | | AndXOffset | | | | | | | | | | | | | | | | +| Flags | | | | | | | | | | | | | | | | PasswordLength | | | | | | | | | | | | | | | | + +**Flags (2 bytes):** A set of options that modify the SMB_COM_TREE_CONNECT_ANDX request. The entire flag set is given here with its symbolic constants. Any combination of the following flags is valid. Any values not given as follows are considered reserved. + +| Name & bitmask | Meaning | +| --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| TREE_CONNECT_ANDX_DISCONNECT_TID

0x0001 | If set and **SMB_Header.TID** is valid, the tree connect specified by the TID in the SMB header of the request SHOULD be disconnected when the server sends the response. If this tree disconnect fails, then the error SHOULD be ignored.

If set and TID is invalid, the server MUST ignore this bit. | +| TREE_CONNECT_ANDX_EXTENDED_SIGNATURES

0x0004 | If set, then the client is requesting signing key protection, as specified in sections [3.2.4.2.5](#Section_d4f09ef1a9aa4530a2ae438fd601e2e3) and [3.2.5.4](#Section_66aeb6701e484cb9a6517c70f355cd16). | +| TREE_CONNECT_ANDX_EXTENDED_RESPONSE

0x0008 | If set, then the client is requesting extended information in the SMB_COM_TREE_CONNECT_ANDX response. | + +##### Server Response Extensions + +When a server returns extended information, the response takes the following format. Aside from the **WordCount**, **MaximalShareAccessRights**, and **GuestMaximalShareAccessRights** fields, and the new **OptionalSupport** flags, all other fields are defined as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.4.55.2. + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- UCHAR AndXCommand; +- UCHAR AndXReserved; +- USHORT AndXOffset; +- USHORT OptionalSupport; +- ACCESS_MASK MaximalShareAccessRights; +- ACCESS_MASK GuestMaximalShareAccessRights; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- OEM_STRING Service; +- UCHAR Pad\[\]; +- SMB_STRING NativeFileSystem; +- } +- } + +**SMB_Parameters** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------- | --- | --- | --- | --- | --- | --- | --- | ---------------- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| WordCount | | | | | | | | Words (14 bytes) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | + +**WordCount (1 byte):** The value of this field MUST be 0x07. + +**Words (14 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------------- | --- | --- | --- | --- | --- | --- | --- | ------------ | --- | ---------- | --- | --- | --- | --- | --- | ----------------------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| AndXCommand | | | | | | | | AndXReserved | | | | | | | | AndXOffset | | | | | | | | | | | | | | | | +| OptionalSupport | | | | | | | | | | | | | | | | MaximalShareAccessRights | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | GuestMaximalShareAccessRights | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | + +**OptionalSupport (2 bytes):** The following **OptionalSupport** bit fields are new extensions: SMB_CSC_MASK, SMB_UNIQUE_FILE_NAME, and SMB_EXTENDED_SIGNATURES. Values from \[MS-CIFS\] are included for completeness. The values of SMB_CSC_MASK each have their own name and are included for reference purposes only. Any combination of the following flags MUST be supported. All undefined values are considered reserved. The server SHOULD set them to zero and the client MUST ignore them. + +| Name & bitmask | Value | Meaning | +| ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| SMB_SUPPORT_SEARCH_BITS

0x0001 | 0 | If set, then the server supports the use of SMB_FILE_ATTRIBUTES Search Attributes in client directory search requests, as specified in \[MS-CIFS\]. | +| 1 | +| SMB_SHARE_IS_IN_DFS

0x0002 | 0 | If set, this share is managed by Distributed File System (DFS), as specified in [\[MS-DFSC\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-DFSC%5d.pdf#Section_3109f4be2dbb42c99b8e0b34f7a2135e). | +| 1 | +| SMB_CSC_MASK

0x000C | 0 | SMB_CSC_CACHE_MANUAL_REINT Clients are allowed to cache files that the user requests for offline use, but there is no automatic file-by-file reintegration. | +| 1 | SMB_CSC_CACHE_AUTO_REINT Clients are allowed to automatically cache the files that a user or application modifies for offline use. Automatic file-by-file reintegration MUST be permitted. | +| 2 | SMB_CSC_CACHE_VDO Clients are allowed to automatically cache the files that a user or application modifies for offline use. Clients are permitted to work from their local cache even while online. | +| 3 | SMB_CSC_NO_CACHING No offline caching is allowed for this share. | +| SMB_UNIQUE_FILE_NAME

0x0010 | 0 | If set, then the server is using long file names only and does not support short file names. If set, then the server allows the client to assume that there is no name aliasing for this share (in other words, a single file cannot have two different names). If set, then the server permits the client to cache directory enumerations and file metadata based on the pathname.

The client MAY[<46>](#Appendix_A_46) choose to satisfy file attribute queries from its cache and thus could present a slightly stale view of files on the share. The client MUST NOT cache remote file system information for more than 60 seconds. | +| 1 | +| SMB_EXTENDED_SIGNATURES

0x0020 | 0 | If set, then the server is using signing key protection (see section [3.3.5.4](#Section_8e1132db35514a439552326236eb2c67)), as requested by the client. | +| 1 | + +**MaximalShareAccessRights (4 bytes):** This field MUST specify the maximum rights that the user has to this share based on the security enforced by the share. This field MUST be encoded in an ACCESS_MASK format, as specified in section [2.2.1.4](#Section_6e848af95cb64e7383acb68698e3d920). + +**GuestMaximalShareAccessRights (4 bytes):** This field MUST specify the maximum rights that the guest account has on this share based on the security enforced by the share. Note that the notion of a guest account is implementation specific.[<47>](#Appendix_A_47) + +Implementations that do not support the notion of a guest account MUST set this field to zero, which implies no access. This field MUST be encoded in an ACCESS_MASK format, as specified in section 2.2.1.4. + +#### SMB_COM_NT_TRANSACT (0xA0) Extensions + +The SMB_COM_NT_TRANSACT request is sent by a client to specify operations on the server. The operations include file open, file create, device I/O control, notify directory change, and set and query security descriptors. The general format of the SMB_COM_NT_TRANSACT command requests and responses is given in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) sections 2.2.4.62 and 2.2.4.63. Execution of SMB_COM_NT_TRANSACT is as specified in \[MS-CIFS\] sections 3.2.4.1.5, 3.2.5.1.4, and 3.3.5.2.5. + +Valid SMB_COM_NT_TRANSACT subcommand codes, also known as "NT Trans subcommand" codes, are specified in section [2.2.2.2](#Section_75a3a815d2c64c948d668221869c7975). The format and syntax of these subcommands are specified in section [2.2.7](#Section_64c604b9394b4ad7b7fd167271882359) and in \[MS-CIFS\] section 2.2.7. + +#### SMB_COM_NT_CREATE_ANDX (0xA2) + +##### Client Request Extensions + +An SMB_COM_NT_CREATE_ANDX request is sent by a client to open a file or device on the server. This extension adds the following: + +- An additional flag bit is added to the **Flags** field of the SMB_COM_NT_CREATE_ANDX request. The additional flag, NT_CREATE_REQUEST_EXTENDED_RESPONSE, is used to request an extended response from the server. +- An additional parameter value is added to the **ImpersonationLevel** field. SECURITY_DELEGATION is added to allow the server to call other servers while impersonating the original client. + +All other fields are as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.4.64.1.[<48>](#Appendix_A_48) + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- UCHAR AndXCommand; +- UCHAR AndXReserved; +- USHORT AndXOffset; +- UCHAR Reserved; +- USHORT NameLength; +- ULONG Flags; +- ULONG RootDirectoryFID; +- ULONG DesiredAccess; +- LARGE_INTEGER AllocationSize; +- SMB_EXT_FILE_ATTR ExtFileAttributes; +- ULONG ShareAccess; +- ULONG CreateDisposition; +- ULONG CreateOptions; +- ULONG ImpersonationLevel; +- UCHAR SecurityFlags; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- Bytes +- { +- SMB_STRING FileName; +- } +- } + +**SMB_Parameters** + +**Words (48 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------- | --- | --- | --- | --- | --- | --- | --- | ------------ | --- | ---------- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ---------- | --- | --- | --- | ------------------ | --- | --- | --- | --- | --- | ---------- | --- | +| AndXCommand | | | | | | | | AndXReserved | | | | | | | | AndXOffset | | | | | | | | | | | | | | | | +| Reserved | | | | | | | | NameLength | | | | | | | | | | | | | | | | Flags | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | RootDirectoryFID | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | DesiredAccess | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | AllocationSize | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | ExtFileAttributes | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | ShareAccess | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | CreateDisposition | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | CreateOptions | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | ImpersonationLevel | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | SecurityFlags | | | | | | | | + +**Flags (4 bytes):** A set of flags that modify the client request, as defined in the table below. NT_CREATE_REQUEST_EXTENDED_RESPONSE is new to MS-SMB. All other flags are included in the table for completeness. Unused bits SHOULD be set to zero by the client when sending a request and MUST be ignored when received by the server. + +| Name & bitmask | Meaning | +| ----------------------------------------------------- | ------------------------------------------------------------------------------------------ | +| NT_CREATE_REQUEST_OPLOCK

0x00000002 | If set, then the client is requesting an oplock. | +| NT_CREATE_REQUEST_OPBATCH

0x00000004 | If set, then the client is requesting a batch oplock. | +| NT_CREATE_OPEN_TARGET_DIR

0x00000008 | If set, then the client indicates that the parent directory of the target is to be opened. | +| NT_CREATE_REQUEST_EXTENDED_RESPONSE

0x00000010 | If set, then the client is requesting extended information in the response. | + +**ImpersonationLevel (4 bytes):** This field specifies the impersonation level requested by the application that is issuing the create request, and MUST contain one of the following values. The server MUST validate this field, but otherwise ignore it. + +Impersonation is described in [\[MS-WPO\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-WPO%5d.pdf#Section_c5f54a7765be40a0bb829e4181d8ab67) section 9.7; for more information about impersonation, see [\[MSDN-IMPERS\]](http://go.microsoft.com/fwlink/?LinkId=106009). + +| Value | Meaning | +| ----------------------------------------- | ---------------------------------------------------------------- | +| SECURITY_ANONYMOUS

0x00000000 | The application-requested impersonation level is Anonymous. | +| SECURITY_IDENTIFICATION

0x00000001 | The application-requested impersonation level is Identification. | +| SECURITY_IMPERSONATION

0x00000002 | The application-requested impersonation level is Impersonation. | +| SECURITY_DELEGATION

0x00000003 | The application-requested impersonation level is Delegation. | + +##### Server Response Extensions + +A successful response takes the following format. If the server receives more than one SMB_COM_NT_CREATE_ANDX request from a client before it sends back any response, then the server can respond to these requests in any order. + +When a client requests extended information, then the response takes the form described below. Aside from the **WordCount**, **ResourceType**, **NMPipeStatus_or_FileStatusFlags**, **FileId**, **VolumeGUID**, **FileId**, **MaximalAccessRights**, and **GuestMaximalAccessRights** fields, all other fields are as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.4.64.2. + +- SMB_Parameters +- { +- UCHAR WordCount; +- Words +- { +- UCHAR AndXCommand; +- UCHAR AndXReserved; +- USHORT AndXOffset; +- UCHAR OplockLevel; +- USHORT FID; +- ULONG CreateDisposition; +- FILETIME CreateTime; +- FILETIME LastAccessTime; +- FILETIME LastWriteTime; +- FILETIME LastChangeTime; +- SMB_EXT_FILE_ATTR ExtFileAttributes; +- LARGE_INTERGER AllocationSize; +- LARGE_INTERGER EndOfFile; +- USHORT ResourceType; +- USHORT NMPipeStatus_or_FileStatusFlags; +- UCHAR Directory; +- GUID VolumeGUID; +- ULONGLONG FileId; +- ACCESS_MASK MaximalAccessRights; +- ACCESS_MASK GuestMaximalAccessRights; +- } +- } +- SMB_Data +- { +- USHORT ByteCount; +- } + +**SMB_Parameters:** + +**WordCount (1 bytes):** This field SHOULD[<49>](#Appendix_A_49) be 0x2A. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------ | --- | --- | --- | --- | --- | --- | --- | ------------------------------- | --- | ---------- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | ---------- | --- | --- | --- | ----------------- | --- | --- | --- | --- | --- | ---------- | --- | +| AndXCommand | | | | | | | | AndXReserved | | | | | | | | AndXOffset | | | | | | | | | | | | | | | | +| OplockLevel | | | | | | | | FID | | | | | | | | | | | | | | | | CreateDisposition | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | CreateTime | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | LastAccessTime | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | LastWriteTime | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | LastChangeTime | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | ExtFileAttributes | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | AllocationSize | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | EndOfFile | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | ResourceType | | | | | | | | +| ... | | | | | | | | NMPipeStatus_or_FileStatusFlags | | | | | | | | | | | | | | | | Directory | | | | | | | | +| VolumeGUID (16 bytes) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| FileId | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| MaximalAccessRights | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| GuestMaximalAccessRights | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ResourceType (2 bytes):** The file type. This field MUST be interpreted as follows: + +| Name & value | Meaning | +| ------------------------------------- | ----------------------- | +| FileTypeDisk

0x0000 | File or Directory | +| FileTypeByteModePipe

0x0001 | Byte mode named pipe | +| FileTypeMessageModePipe

0x0002 | Message mode named pipe | +| FileTypePrinter

0x0003 | Printer Device | + +**NMPipeStatus_or_FileStatusFlags (2 bytes):** A union between the **NMPipeStatus** field and the new **FileStatusFlags** field. If the **ResourceType** field is a named pipe (**FileTypeByteModePipe** or **FileTypeMessageModePipe**), then this field MUST be the **NMPipeStatus** field: + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------ | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| NMPipeStatus | | | | | | | | | | | | | | | | FileStatusFlags | | | | | | | | | | | | | | | | + +**NMPipeStatus (2 bytes):** A 16-bit field that shows the status of the opened named pipe. This field is formatted as an SMB_NMPIPE_STATUS (\[MS-CIFS\] section 2.2.1.3). + +If the **ResourceType** field is FileTypeDisk, then this field MUST be the **FileStatusFlags** field: + +**FileStatusFlags (2 bytes):** A 16-bit field that shows extra information about the opened file or directory. Any combination of the following flags is valid. Unused bit fields SHOULD be set to zero by the server and MUST be ignored by the client. + +| Name & bitmask | Meaning | +| --------------------------- | -------------------------------------------------------------------------- | +| NO_EAS

0x0001 | The file or directory has no extended attributes. | +| NO_SUBSTREAMS

0x0002 | The file or directory has no data streams other than the main data stream. | +| NO_REPARSETAG

0x0004 | The file or directory is not a reparse point. | + +For all other values of **ResourceType**, this field SHOULD be set to zero by the server when sending a response and MUST be ignored when received by the client. + +**VolumeGUID (16 bytes):** This field MUST be a GUID value that uniquely identifies the volume on which the file resides. This field MUST zero if the underlying file system does not support volume GUIDs.[<50>](#Appendix_A_50) + +**FileId (8 bytes):** This field MUST be a 64-bit opaque value that uniquely identifies this file on a volume. This field MUST be set to zero if the underlying file system does not support unique FileId numbers on a volume. If the underlying file system does support unique FileId numbers, then this value SHOULD[<51>](#Appendix_A_51) be set to the unique FileId for this file. + +**MaximalAccessRights (4 bytes):** The maximum access rights that the user opening the file has been granted for this file open. This field MUST be encoded in an ACCESS_MASK format, as specified in section [2.2.1.4](#Section_6e848af95cb64e7383acb68698e3d920). + +**GuestMaximalAccessRights (4 bytes):** The maximum access rights that the guest account has when opening this file. This field MUST be encoded in an ACCESS_MASK format, as specified in section 2.2.1.4. Note that the notion of a guest account is implementation-specific[<52>](#Appendix_A_52). Implementations that do not support the notion of a guest account MUST set this field to zero. + +**SMB_Data:** + +**ByteCount (2 bytes):** This field SHOULD[<53>](#Appendix_A_53) be zero. + +#### SMB_COM_SEARCH (0x81) Extensions + +The SMB_COM_SEARCH request is sent by a client to search a directory for files or other objects on the server that have names matching a given wildcard template. The general format of the SMB_COM_SEARCH command requests and responses are given in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.4.58. + +### Transaction Subcommand Extensions + +#### TRANS_RAW_READ_NMPIPE (0x0011) + +The TRANS_RAW_READ_NMPIPE subcommand allows for a [**raw read**](#gt_9900d904-169e-4292-8613-714e7c177641) of data from a named pipe. This method of reading data from a named pipe ignores message boundaries even if the pipe was set up as a message mode pipe. + +The status of this subcommand is **obsolescent**.[<54>](#Appendix_A_54) Aside from its new status as obsolescent, this subcommand is exactly as described in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.5.2. + +#### TRANS_CALL_NMPIPE (0x0054) + +The TRANS_CALL_NMPIPE subcommand allows a client to connect to a named pipe, write to the named pipe, read from the named pipe, and close the named pipe in a single command. + +The status of this subcommand is obsolescent.[<55>](#Appendix_A_55) Aside from its new status as obsolescent, this subcommand is exactly as described in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.5.11. + +### Transaction 2 Subcommand Extensions + +#### TRANS2_FIND_FIRST2 (0x0001) + +##### Client Request Extensions + +A TRANS2_FIND_FIRST2 subcommand of [SMB_COM_TRANSACTION2](#Section_714bb6fa7fab4dab8ff88a01c273b9ce) is sent by the client to retrieve an enumeration of files, as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.6.2.1. + +The list of valid Information Level values has been extended, as specified in section [2.2.2.3.1](#Section_34b83ded0f52406f887a83fe89f33e23), to include SMB_FIND_FILE_ID_FULL_DIRECTORY_INFO and SMB_FIND_FILE_ID_BOTH_DIRECTORY_INFO. Extensions are also presented to the SMB_FIND_FILE_BOTH_DIRECTORY_INFO Information Level, as specified in section [2.2.8.1.1](#Section_03d05a6fbbaf4a9ea556036581b02737). This Information Level now provides support for accessing enumerations of available previous version timestamps of files or directories. + +Aside from the Information Level extensions and the **FileName** field, all of the other fields are as specified in \[MS-CIFS\] [2.2.6.2.1](#Section_d172d48c744649e4a76642f3688d8895). + +**Trans2_Parameters** + +**FileName (variable)**: This field is extended to support use of the @GMT token wildcard (section [2.2.1.1.1](#Section_bffc70f9b16a453b939a0b6d3c9263af)).[<56>](#Appendix_A_56) If this character sequence contains the @GMT-\* wildcard, **Trans2_Data.InformationLevel** SHOULD be set to SMB_FIND_FILE_BOTH_DIRECTORY_INFO.[<57>](#Appendix_A_57) + +**Trans2_Data** + +**InformationLevel (2 bytes)**: This field contains an Information Level code, which determines the information contained in the response. The list of valid Information Level codes is specified in section 2.2.2.3.1. A client that has not negotiated long names support MUST request only SMB_INFO_STANDARD. If a client that has not negotiated long names support requests an **InformationLevel** other than SMB_INFO_STANDARD, then the server MUST return a status of STATUS_INVALID_PARAMETER (ERRDOS/ERRinvalidparam). + +##### Server Response Extensions + +A server MUST send a TRANS2_FIND_FIRST2 response in reply to a client TRANS2_FIND_FIRST2 subcommand request when the request is successful, as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.6.2.2. + +Thus subcommand also supports two new Information Levels, as well as extensions to the SMB_FIND_FILE_BOTH_DIRECTORY_INFO Information Level, as defined in section [2.2.2.3.1](#Section_34b83ded0f52406f887a83fe89f33e23). The format of the file information returned for these two Information Levels (and the format of information for a TRANS2_FIND_FIRST2 response for the special FileName pattern @GMT token) is listed in section [2.2.8.1](#Section_86ff792f35a74e668005604f8478ccea).If a client does not support long names (that is, SMB_FLAGS2_KNOWS_LONG_NAMES is not set in the **Flags2** field of the SMB Header), then any TRANS2_FIND_FIRST2 request with an Information Level other than SMB_INFO_STANDARD, or any TRANS2_FIND_NEXT2 request with an Information Level other than SMB_INFO_STANDARD or SMB_FIND_FILE_ID_BOTH_DIRECTORY_INFO, MUST be failed with STATUS_INVALID_PARAMETER. + +#### TRANS2_FIND_NEXT2 (0x0002) + +##### Client Request Extensions + +The TRANS2_FIND_NEXT2 subcommand of the [SMB_COM_TRANSACTION2](#Section_714bb6fa7fab4dab8ff88a01c273b9ce) request is sent by a client to continue a file enumeration, as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.6.3.1. The request format is identical to the request format that is specified in \[MS-CIFS\] section 2.2.6.3.1, except that two new Information Levels have been added and one has been extended. See section 2.2.6.1.1 for details. + +##### Server Response Extensions + +The server MUST send a TRANS2_FIND_NEXT2 response in reply to a client [TRANS2_FIND_NEXT2](#Section_d172d48c744649e4a76642f3688d8895) subcommand request when the request is successful. The format of this packet is identical to what is specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.6.3.2, except that two new Information Levels have been added and one has been extended. See section [2.2.6.1.2](#Section_2a812c92fa1a44bcb70f65b976f95556) for details. + +#### TRANS2_QUERY_FS_INFORMATION (0x0003) + +This subcommand supports new pass-through Information Level capabilities, as specified in section [2.2.2.3.5](#Section_ab2aca376c9e4505baa99e2bc556c475). + +##### Client Request Extensions + +A TRANS2_QUERY_FS_INFORMATION subcommand of the [SMB_COM_TRANSACTION2](#Section_714bb6fa7fab4dab8ff88a01c273b9ce) is sent by the client to request attribute information about the file system, as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section [2.2.6.4.1](#Section_cf5f012fe1c4499d9df8a95add99221d). + +##### Server Response Extensions + +A server MUST send a TRANS2_QUERY_FS_INFORMATION response in reply to an SMB_COM_TRANSACTION2 client request with a [TRANS2_QUERY_FS_INFORMATION](#Section_f10c0034ded34ce2bccf485431037122) subcommand when the request is successful, as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section [2.2.6.4.2](#Section_7ea947da5ce04a4b8789cb07a7f010e1). + +#### TRANS2_SET_FS_INFORMATION (0x0004) + +The TRANS2_SET_FS_INFORMATION subcommand of the SMB_COM_TRANSACTION2 command (section [2.2.4.4](#Section_714bb6fa7fab4dab8ff88a01c273b9ce)) is sent by the client to set file system attribute information on the server. This subcommand was introduced in the LAN Manager 2.0 dialect.[<58>](#Appendix_A_58) + +The TRANS2_SET_FS_INFORMATION request and response formats are special cases of SMB_COM_TRANSACTION2 command. Only the TRANS2_SET_FS_INFORMATION specifics are described here. + +##### Client Request + +**SMB_Parameters:** + +**WordCount (1 byte):** This field MUST be 0x0F. + +**Words (30 bytes):** + +**TotalParameterCount (2 bytes):** This field MUST be 0x0004. + +**TotalDataCount (2 bytes):** This field MUST be greater than or equal to 0x0000. + +**SetupCount (1 byte):** This field MUST be 0x01. + +**Setup (2 bytes):** This field MUST be TRANS2_SET_FS_INFORMATION (0x0004). + +**Trans2_Parameters** + +- Trans2_Parameters +- { +- USHORT FID; +- USHORT InformationLevel; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ---------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| FID | | | | | | | | | | | | | | | | InformationLevel | | | | | | | | | | | | | | | | + +**FID (2 bytes):** A valid Fid that represents the open file on the server that is to have its file attributes changed. + +**InformationLevel (2 bytes):** The Information Level of the request. This field MUST be a pass-through Information Level, as described in section [2.2.2.3.5](#Section_ab2aca376c9e4505baa99e2bc556c475). + +**Trans2_Data** + +The Trans2_Data block carries the structure of the Information Level specified by the request's **Trans2_Parameters.InformationLevel** field. Because this subcommand only accepts pass-through Information Levels, the structure of this section is implementation specific. + +##### Server Response + +A server MUST send a TRANS2_SET_FS_INFORMATION response in reply to a client TRANS2_SET_FS_INFORMATION subcommand request when the request is successful. The server MUST set an error code in the **Status** field of the SMB header of the response to indicate whether the request was successful or failed. The server MUST respond with STATUS_NOT_SUPPORTED if the information level of the request is not a pass-through information level. + +**Trans2_Parameters** + +No Trans2_Parameters are sent by this message. + +**Trans2_Data** + +No Trans2_Data is sent by this message. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| ----------------------- | --------------------------------------------------------------- | ---------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- | +| ERRDOS(0x01) | ERRnoaccess(0x0005) | STATUS_ACCESS_DENIED(0xC0000022) | EPERM | Access denied. | +| ERRbadfid(0x0006) | STATUS_INVALID_HANDLE(0xC0000008) | ENOENT | The Fid supplied is invalid. | +| ERRnomem(0x0008) | STATUS_INSUFF_SERVER_RESOURCES(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRunsup(0x0032) | STATUS_NOT_SUPPORTED(0xC00000BB) | | The supplied Information Level, as indicated by the Trans2_Parameters.InformationLevel value, is not a valid pass-through Information Level. | +| ERRinvalidparam(0x0057) | STATUS_INVALID_PARAMETER(0xC000000D) | | The supplied pass-through Information Level values in the Trans2_Data block contain at least one invalid parameter.

OR

Server does not support pass-through Information Levels. | +| ERRSRV(0x02) | ERRerror(0x0001) | STATUS_INVALID_SMB(0x00010002) | | Invalid SMB. Not enough parameter bytes were sent. | +| ERRinvtid(0x0005) | STATUS_INVALID_HANDLE(0xC0000008)STATUS_SMB_BAD_TID(0x00050002) | | The TID is no longer valid. | +| ERRbaduid(0x005B) | STATUS_INVALID_HANDLE(0xC0000008)STATUS_SMB_BAD_UID(0x005B0002) | | The UID supplied is not known to the session. | +| ERRHRD(0x03) | ERRnowrite(0x0013) | STATUS_MEDIA_WRITE_PROTECTED(0xC00000A2) | | The Fid supplied is on write-protected media. | +| ERRdata(0x0017) | STATUS_DATA_ERROR(0xC000003E) | EIO | Disk I/O error. | + +#### TRANS2_QUERY_PATH_INFORMATION (0x0005) + +This subcommand supports new pass-through Information Level capabilities, as specified in section [2.2.2.3.5](#Section_ab2aca376c9e4505baa99e2bc556c475). + +##### Client Request Extensions + +A TRANS2_QUERY_PATH_INFORMATION subcommand of SMB_COM_TRANSACTION2 is sent by the client to request attribute information for a file or directory by specifying the path, as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b), section 2.2.6.6.1. + +##### Server Response Extensions + +A server MUST send a TRANS2_QUERY_PATH_INFORMATION response in reply to an SMB_COM_TRANSACTION2 client request with a TRANS2_QUERY_PATH_INFORMATION subcommand when the request is successful, as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.6.6.2. + +#### TRANS2_SET_PATH_INFORMATION (0x0006) + +This subcommand supports new pass-through Information Level capabilities, as specified in section [2.2.2.3.5](#Section_ab2aca376c9e4505baa99e2bc556c475). + +##### Client Request Extensions + +A TRANS2_SET_PATH_INFORMATION subcommand of SMB_COM_TRANSACTION2 is sent by the client to request a change of attribute information for a file or directory by path, as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.6.7.1. + +##### Server Response Extensions + +A server MUST send a TRANS2_SET_PATH_INFORMATION response in reply to an [SMB_COM_TRANSACTION2 (section 2.2.4.4)](#Section_714bb6fa7fab4dab8ff88a01c273b9ce) client request with a TRANS2_SET_PATH_INFORMATION subcommand when the request is successful,as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.6.7.2. + +#### TRANS2_QUERY_FILE_INFORMATION (0x0007) + +This subcommand supports new pass-through Information Level capabilities, as specified in section [2.2.2.3.5](#Section_ab2aca376c9e4505baa99e2bc556c475). + +##### Client Request Extensions + +A TRANS2_QUERY_FILE_INFORMATION subcommand of [SMB_COM_TRANSACTION2](#Section_714bb6fa7fab4dab8ff88a01c273b9ce) is sent by a client to request attribute information for a file or directory that has been opened, as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.6.8.1. + +##### Server Response Extensions + +A server MUST send a TRANS2_QUERY_PATH_INFORMATION response in reply to an SMB_COM_TRANSACTION2 client request with a TRANS2_QUERY_PATH_INFORMATION subcommand when the request is successful. The Trans2_Data block of the transaction response contains the information requested by the Information Level in the request, as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.6.8.2. + +#### TRANS2_SET_FILE_INFORMATION (0x0008) + +This subcommand supports new pass-through Information Level capabilities, as specified in section [2.2.2.3.5](#Section_ab2aca376c9e4505baa99e2bc556c475). + +##### Client Request Extensions + +A TRANS2_SET_FILE_INFORMATION subcommand of [SMB_COM_TRANSACTION2](#Section_714bb6fa7fab4dab8ff88a01c273b9ce) is sent by the client to request a change of attribute information for a file or directory that has been opened, as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.6.9.1. + +##### Server Response Extensions + +A server MUST send a TRANS2_SET_FILE_INFORMATION response in reply to an SMB_COM_TRANSACTION2 client request with a TRANS2_SET_FILE_INFORMATION subcommand when the request is successful, as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.6.9.2. + +### NT Transact Subcommand Extensions + +#### NT_TRANSACT_CREATE (0x0001) Extensions + +##### Client Request Extensions + +An [SMB_COM_NT_TRANSACT (section 2.2.4.8)](#Section_602802fd5870433a955c79897847053e) command with an NT_TRANSACT_CREATE subcommand is sent by a client to open a file or device on the server. The NT_TRANSACT_CREATE subcommand is specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.7.1. This extension adds the following: + +- An additional flag bit is added to the **Flags** field. The additional flag, NT_CREATE_REQUEST_EXTENDED_RESPONSE, is used to request an extended response from the server. +- An additional parameter value, SECURITY_DELEGATION, is added to the **ImpersonationLevel** field. + +All other fields are as specified in \[MS-CIFS\] section 2.2.7.1. + +- NT_Trans_Parameters +- { +- ULONG Flags; +- ULONG RootDirectoryFID; +- ULONG DesiredAccess; +- LARGE_INTEGER AllocationSize; +- SMB_EXT_FILE_ATTR ExtFileAttributes; +- ULONG ShareAccess; +- ULONG CreateDisposition; +- ULONG CreateOptions; +- ULONG SecurityDescriptorLength; +- ULONG EALength; +- ULONG NameLength; +- ULONG ImpersonationLevel; +- UCHAR SecurityFlags; +- UCHAR Name\[NameLength\]; +- } +- NT_Trans_Data +- { +- SECURITY_DESCRIPTOR SecurityDescriptor; +- FILE_FULL_EA_INFORMATION ExtendedAttributes\[\]; +- } + +**NT_Trans_Parameters (variable):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| Flags | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| RootDirectoryFID | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| DesiredAccess | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| AllocationSize (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ExtFileAttributes | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ShareAccess | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| CreateDisposition | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| CreateOptions | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| SecurityDescriptorLength | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| EALength | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| NameLength | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ImpersonationLevel | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| SecurityFlags | | | | | | | | | | | | | | | | Name (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**Flags (4 bytes):** A 32-bit field containing a set of flags that modify the client request. Unused bits SHOULD be set to 0 by the client when sending a message and MUST be ignored when received by the server. + +| Name & bitmask | Meaning | +| ----------------------------------------------------- | -------------------------------------------------- | +| NT_CREATE_REQUEST_OPLOCK

0x00000002 | Level I (exclusive) OpLock requested. | +| NT_CREATE_REQUEST_OPBATCH

0x00000004 | Batch OpLock requested. | +| NT_CREATE_OPEN_TARGET_DIR

0x00000008 | Parent directory of the target is to be opened. | +| NT_CREATE_REQUEST_EXTENDED_RESPONSE

0x00000010 | Extended information is requested in the response. | + +**ImpersonationLevel (4 bytes):** This field specifies the impersonation level requested by the application that is issuing the create request, and MUST contain one of the following values. The server MUST validate this field but otherwise ignore it. + +Impersonation is described in [\[MS-WPO\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-WPO%5d.pdf#Section_c5f54a7765be40a0bb829e4181d8ab67) section 9.7; for more information about impersonation, see [\[MSDN-IMPERS\]](http://go.microsoft.com/fwlink/?LinkId=106009). + +| Value | Meaning | +| ----------------------------------------- | ---------------------------------------------------------------- | +| SECURITY_ANONYMOUS

0x00000000 | The application-requested impersonation level is Anonymous. | +| SECURITY_IDENTIFICATION

0x00000001 | The application-requested impersonation level is Identification. | +| SECURITY_IMPERSONATION

0x00000002 | The application-requested impersonation level is Impersonation. | +| SECURITY_DELEGATION

0x00000003 | The application-requested impersonation level is Delegation. | + +##### Server Response Extensions + +When a client requests extended information by setting NT_CREATE_REQUEST_EXTENDED_RESPONSE, a successful response takes the following format. + +Aside from **ResponseType**, **NMPipeStatus_or_FileStatusFlags**, **VolumeGUID**, **FileId**, **MaximalAccessRights**, and **GuestMaximalAccessRights** fields, all other fields are as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.7.1.2. + +- NT_Trans_Parameters +- { +- UCHAR OpLockLevel; +- UCHAR ResponseType; +- USHORT FID; +- ULONG CreateAction; +- ULONG EAErrorOffset; +- FILETIME CreationTime; +- FILETIME LastAccessTime; +- FILETIME LastWriteTime; +- FILETIME LastChangeTime; +- SMB_EXT_FILE_ATTR ExtFileAttributes; +- LARGE_INTEGER AllocationSize; +- LARGE_INTEGER EndOfFile; +- USHORT ResourceType; +- SMB_NMPIPE_STATUS NMPipeStatus_or_FileStatusFlags; +- UCHAR Directory; +- GUID VolumeGUID; +- ULONGLONG FileId; +- ACCESS_MASK MaximalAccessRights; +- ACCESS_MASK GuestMaximalAccessRights; +- } + +**NT_Trans_Parameters (69 bytes):** + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------- | --- | --- | --- | --- | --- | --- | --- | ------------------------ | --- | ---------- | --- | --- | --- | --- | --- | ------------------------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| OpLockLevel | | | | | | | | ResponseType | | | | | | | | FID | | | | | | | | | | | | | | | | +| CreateAction | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| EAErrorOffset | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| CreationTime (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| LastAccessTime (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| LastWriteTime (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| LastChangeTime (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ExtFileAttributes | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| AllocationSize (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| EndOfFile (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ResourceType | | | | | | | | | | | | | | | | NMPipeStatus_or_FileStatusFlags | | | | | | | | | | | | | | | | +| Directory | | | | | | | | VolumeGUID (16 bytes) | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | FileId | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | MaximalAccessRight | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | GuestMaximalAccessRights | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | + +**ResponseType (1 byte):** The response type received. This field MUST be set to any one of the following values, based on the response type. + +| Name & bitmask | Meaning | +| --------------------------------- | ---------------------------------------------- | +| NON_EXTENDED_RESPONSE

0x00 | Response received is not an extended response. | +| EXTENDED_RESPONSE

0x01 | Response received is an extended response. | + +**NMPipeStatus_or_FileStatusFlags (2 bytes):** A union between the **NMPipeStatus** field and the new **FileStatusFlags** field. If the **ResourceType** field is a named pipe (**FileTypeByteModePipe** or **FileTypeMessageModePipe**), then this field MUST be the **NMPipeStatus** field: + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------ | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| NMPipeStatus | | | | | | | | | | | | | | | | FileStatusFlags | | | | | | | | | | | | | | | | + +**NMPipeStatus (2 bytes):** A 16-bit field that shows the status of the opened named pipe. This field is formatted as an SMB_NMPIPE_STATUS (\[MS-CIFS\] section 2.2.1.3). + +If the **ResourceType** field is FileTypeDisk, then this field MUST be the **FileStatusFlags** field. + +**FileStatusFlags (2 bytes):** A 16-bit field that shows extra information about the opened file or directory. Any combination of the following flags is valid. Unused bit fields SHOULD be set to zero by the server and MUST be ignored by the client. + +| Name & bitmask | Meaning | +| --------------------------- | -------------------------------------------------------------------------- | +| NO_EAS

0x0001 | The file or directory has no extended attributes. | +| NO_SUBSTREAMS

0x0002 | The file or directory has no data streams other than the main data stream. | +| NO_REPARSETAG

0x0004 | The file or directory is not a reparse point. | + +For all other values of **ResourceType**, this field SHOULD be set to zero by the server when sending a response and MUST be ignored when received by the client. + +**VolumeGUID (16 bytes):** This field MUST be a GUID value that uniquely identifies the volume on which the file resides. This field MUST be zero if the underlying file system does not support volume GUIDs.[<59>](#Appendix_A_59) + +**FileId (8 bytes):** This field MUST be a 64-bit opaque value that uniquely identifies this file on a volume. This field MUST be set to zero if the underlying file system does not support unique **FileId** numbers on a volume. If the underlying file system does support unique **FileId** numbers, then this value SHOULD[<60>](#Appendix_A_60) be set to the unique **FileId** for this file. + +**MaximalAccessRight (4 bytes):** The maximum access rights that the user opening the file has been granted for this file open. This field MUST be encoded in an ACCESS_MASK format, as specified in section [2.2.1.4](#Section_6e848af95cb64e7383acb68698e3d920). + +**GuestMaximalAccessRights (4 bytes):** The maximum access rights that the guest account has when opening this file. This field MUST be encoded in an ACCESS_MASK format, as specified in section 2.2.1.4. Note that the notion of a guest account is implementation-specific[<61>](#Appendix_A_61). Implementations that do not support the notion of a guest account MUST set this field to zero. + +#### NT_TRANSACT_IOCTL (0x0002) + +An SMB_COM_NT_TRANSACT (section [2.2.4.8](#Section_602802fd5870433a955c79897847053e)) command with an NT_TRANSACT_IOCTL subcommand is sent by a client to pass an IOCTL or file system control (FSCTL) command to a server. The NT_TRANSACT_IOCTL subcommand is specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.7.2. + +##### Client Request Extensions + +The NT_TRANSACT_IOCTL request is a special case of the SMB_COM_NT_TRANSACT command request. Only the NT_TRANSACT_IOCTL specifics are described here. + +The FSCTL operations listed in the table below are new to these extensions and only those are specific to the SMB protocol.[<62>](#Appendix_A_62) Other FSCTL and IOCTL control codes are not defined in this specification and are specific to the underlying object store of the server.[<63>](#Appendix_A_63) If an application requests an undefined FSCTL or IOCTL operation, then the client SHOULD still pass the request through to the server. + +| Name | Value | Description | +| ----------------------------- | ---------- | -------------------------------------------------------------------------------------------- | +| FSCTL_SRV_ENUMERATE_SNAPSHOTS | 0x00144064 | Enumerate previous versions of a file. | +| FSCTL_SRV_REQUEST_RESUME_KEY | 0x00140078 | Retrieve an opaque file reference for server-side data movement.[<64>](#Appendix_A_64) | +| FSCTL_SRV_COPYCHUNK | 0x001440F2 | Perform server-side data movement.[<65>](#Appendix_A_65) | + +FSCTL_SRV_ENUMERATE_SNAPSHOTS Request + +This FSCTL is used to enumerate available previous version timestamps (snapshots) of a file or directory. + +The FSCTL_SRV_ENUMERATE_SNAPSHOTS request format is a special case of the NT_TRANSACT_IOCTL subcommand. Only the FSCTL_SRV_ENUMERATE_SNAPSHOTS request specifics are described here. + +**SMB_Parameters** + +**WordCount (1 byte):** The value of this field MUST be 0x17. + +**Words (46 bytes):** As specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.4.62.1 and with the following exceptions: + +**MaxDataCount (4 bytes):** This field MUST be greater than or equal to 0x000C. + +**SetupCount (1 byte):** The number of setup words that are included in the transaction request. The value MUST be set to 0x04. + +**Setup (8 bytes):** As specified in \[MS-CIFS\] section 2.2.7.2.1 and with the following exceptions: + +**FunctionCode (4 bytes):** This field MUST be set to 0x00144064. + +**FID (2 bytes):** This field MUST contain a valid Fid representing a valid Open on a file. This is the file for which snapshots are being requested. + +**IsFsctl (1 byte):** MUST be TRUE (any non-zero value). + +**IsFlags (1 byte):** MUST be zero (0x00). + +**NT_Trans_Parameters** + +No NT Trans parameters are sent in this request. + +**NT_Trans_Data** + +No NT Trans data is sent in this request. + +FSCTL_SRV_REQUEST_RESUME_KEY Request + +This FSCTL is used to retrieve an opaque file reference for server-side data movement operations, as specified in section [3.2.4.11.2](#Section_bceed388009a4aa688543a06c989af64). + +The FSCTL_SRV_REQUEST_RESUME_KEY request format is a special case of the NT_TRANSACT_IOCTL subcommand. Only the FSCTL_SRV_REQUEST_RESUME_KEY request specifics are described here. + +**SMB_Parameters** + +**WordCount (1 byte):** The value of this field MUST be 0x17. + +**Words (46 bytes):** + +**MaxDataCount (4 bytes):** This field MUST be greater than or equal to 0x001D. + +**Setup (8 bytes):** + +**FunctionCode (4 bytes):** This field MUST be 0x00140078. + +**FID (2 bytes):** This field MUST contain a valid Fid that represents a valid Open on a file. This file is the source file for a server-side data copy operation. + +**IsFsctl (1 byte):** MUST be TRUE (any non-zero value). + +**IsFlags (1 byte):** MUST be zero (0x00). + +**NT_Trans_Parameters** + +No NT Trans parameters are sent in this request. + +**NT_Trans_Data** + +No NT Trans data is sent in this request. + +FSCTL_SRV_COPYCHUNK Request + +This FSCTL is used for server-side data movement, as specified in section 3.2.4.11.2. + +The FSCTL_SRV_COPYCHUNK request format is a special case of NT_TRANSACT_IOCTL subcommand. Only the FSCTL_SRV_COPYCHUNK request specifics are described here. + +**SMB_Parameters** + +**WordCount (1 byte):** The value of this field MUST be 0x17. + +**Words (46 bytes):** + +**TotalDataCount (4 bytes):** This field MUST be greater than or equal to 0x0034. + +**MaxDataCount (4 bytes):** This field MUST be greater than or equal to 0x001D. + +**Setup (8 bytes):** + +**FunctionCode (4 bytes):** This field MUST be 0x00144078. + +**FID (2 bytes):** This field MUST contain a valid Fid that represents a valid Open on a file. This file is the destination file for a server-side data copy operation. + +**IsFsctl (1 byte):** This field MUST be TRUE (any non-zero value). + +**IsFlags (1 byte):** The value of this field MUST be zero (0x00). + +**NT_Trans_Parameters** + +No NT Trans parameters are sent in this request. + +**NT_Trans_Data** + +- NT_Trans_Data +- { +- COPYCHUNK_RESUME_KEY CopychunkResumeKey; +- ULONG ChunkCount; +- ULONG Reserved; +- SRV_COPYCHUNK CopychunkList\[ChunkCount\]; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| CopychunkResumeKey (24 bytes) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ChunkCount | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Reserved | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| CopychunkList (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**CopychunkResumeKey (24 bytes):** An opaque 24-byte server copychunk resume key for a source file in a server-side file copy operation. This field value is received from a previous FSCTL_SRV_REQUEST_RESUME_KEY server response. + +**ChunkCount (4 bytes):** The number of entries, or "copychunks", in the **CopyChunkList**. This field also represents the number of server-side data movement operations being requested. This field MUST NOT be zero. + +**Reserved (4 bytes):** A reserved field. This field SHOULD be set to zero when sending the request. This field MUST be ignored by the server when the message is received. + +**CopychunkList (variable):** A concatenated list of copychunks. Each entry is formatted as a SRV_COPYCHUNK structure. + +###### SRV_COPYCHUNK + +- SRV_COPYCHUNK +- { +- LARGE_INTEGER SourceOffset; +- LARGE_INTEGER DestinationOffset; +- ULONG CopyLength; +- ULONG Reserved; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SourceOffset | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| DestinationOffset | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| CopyLength | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Reserved | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SourceOffset (8 bytes):** The offset, in bytes, into the source file from which data is being copied. + +**DestinationOffset (8 bytes):** The offset, in bytes, into the destination file to which data is being copied. + +**CopyLength (4 bytes):** The number of bytes to copy from the source file to the destination file. + +**Reserved (4 bytes):** This field SHOULD[<66>](#Appendix_A_66) be set to zero by the client and MUST be ignored upon receipt by the server. + +##### Server Response Extensions + +An [SMB_COM_NT_TRANSACT (section 2.2.4.8)](#Section_602802fd5870433a955c79897847053e) response for an NT_TRANSACT_IOCTL ([\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.7.2) subcommand MUST be sent by a server in reply to a successful NT_TRANSACT_IOCTL request. + +The NT_TRANSACT_IOCTL response is a special case of the SMB_COM_NT_TRANSACT command response. Only the NT_TRANSACT_IOCTL specifics are described here. + +###### FSCTL_SRV_ENUMERATE_SNAPSHOTS Response + +The FSCTL_SRV_ENUMERATE_SNAPSHOTS response format is a special case of the NT_TRANSACT_IOCTL subcommand. Only the FSCTL_SRV_ENUMERATE_SNAPSHOTS response specifics are described here. + +**SMB_Parameters** + +**WordCount (1 byte):** This field MUST be set to 0x16. + +**SetupCount (1 byte):** The number of setup words that are included in the transaction response. The value MUST be set to 0x04. + +**Setup (8 bytes):** This field contains the following: + +**Function(2 bytes):** The transaction subcommand code, which is used to identify the operation performed by the server. The value MUST be set to 0x0002. + +**FunctionCode (4 bytes):** This field MUST be set to 0x00144064. + +**FID (2 bytes):** This field MUST contain a File ID representing the open of a file for which snapshots are requested. + +**NT_Trans_Parameters** + +No NT Trans parameters are sent in this response. + +**NT_Trans_Data** + +- NT_Trans_Data +- { +- ULONG NumberOfSnapShots; +- ULONG NumberOfSnapShotsReturned; +- ULONG SnapShotArraySize; +- WCHAR SnapShotMultiSZ\[\]; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| NumberOfSnapShots | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| NumberOfSnapShotsReturned | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| SnapShotArraySize | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| SnapShotMultiSZ (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**NumberOfSnapShots (4 bytes):** The number of snapshots that the underlying object store contains of this file. + +**NumberOfSnapShotsReturned (4 bytes):** This value MUST be the number of snapshots that are returned in this response. If this value is less than **NumberofSnapshots**, then there are more snapshots than were able to fit in this response. + +**SnapShotArraySize (4 bytes):** The length, in bytes, of the **SnapShotMultiSZ** field. + +**SnapShotMultiSZ (variable):** A concatenated list of available snapshots. Each snapshot MUST be encoded as a NULL-terminated sequence of 16-bit Unicode characters, and MUST take on the following form: @GMT-YYYY.MM.DD-HH.MM.SS. The concatenated list MUST be terminated by one additional 16-bit Unicode NULL character. If the response contains no snapshots, then the server MUST set this field to two 16-bit Unicode NULL characters. + +###### FSCTL_SRV_REQUEST_RESUME_KEY Response + +The FSCTL_SRV_REQUEST_RESUME_KEY response format is a special case of the NT_TRANSACT_IOCTL subcommand. Only the FSCTL_SRV_REQUEST_RESUME_KEY response specifics are described here. + +Although this FSCTL includes support for returning extended context information for a copychunk resume key, this feature is considered reserved but not implemented and is not used in this response. + +**NT_Trans_Parameters** + +No NT Trans parameters are sent in this response. + +**NT_Trans_Data** + +- NT_Trans_Data +- { +- COPYCHUNK_RESUME_KEY CopychunkResumeKey; +- ULONG ContextLength; +- UCHAR Context\[ContextLength\] (optional); +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| CopychunkResumeKey (24 bytes) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ContextLength | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Context (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**CopychunkResumeKey (24 bytes):** A 24-byte copychunk resume key generated by the server that can be subsequently used by the client to uniquely identify the open source file in a FSCTL_SRV_COPYCHUNK request. The client MUST NOT attach any interpretation to this key and MUST treat it as an opaque value. For more information, see section [3.3.5.11.1](#Section_7187919879ea439b970b8c301128edce). + +**ContextLength (4 bytes):** The length, in bytes, of the **Context** field. Since this feature is not used, this field SHOULD be set to zero by the server and MUST be ignored by the client. + +**Context (variable):** The copychunk resume key's extended context information. Since this feature is not used, this field SHOULD[<67>](#Appendix_A_67) be zero bytes in length. The client MUST ignore it on receipt. + +###### FSCTL_SRV_COPYCHUNK Response + +The FSCTL_SRV_COPYCHUNK response format is a special case of NT_TRANSACT_IOCTL subcommand. Only the FSCTL_SRV_COPYCHUNK response specifics are described here. + +**NT_Trans_Parameters** + +No NT Trans parameters are sent in this response. + +**NT_Trans_Data** + +- NT_Trans_Data +- { +- ULONG ChunksWritten; +- ULONG ChunkBytesWritten; +- ULONG TotalBytesWritten; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| ChunksWritten | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ChunkBytesWritten | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| TotalBytesWritten | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**ChunksWritten (4 bytes):** This field MUST represent the number of copychunk operations successfully processed by the server. + +**ChunkBytesWritten (4 bytes):** This field is unused. This field MUST be set to zero by the server and MUST be ignored by the client. + +**TotalBytesWritten (4 bytes):** This field MUST represent the total number of bytes written to the destination file across all copychunk operations. + +#### NT_TRANSACT_SET_SECURITY_DESC (0x0003) Extensions + +An SMB_COM_NT_TRANSACT command (section [2.2.4.8](#Section_602802fd5870433a955c79897847053e)) with an NT_TRANSACT_SET_SECURITY_DESC allows a client to set the security descriptors for a file or device on the server. The NT_TRANSACT_SET_SECURITY_DESC subcommand is specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.7.3. This extension adds LABEL_SECURITY_INFORMATION, ATTRIBUTE_SECURITY_INFORMATION, SCOPE_SECURITY_INFORMATION, and BACKUP_SECURITY_INFORMATION parameter values to the **SecurityInformation** field. + +**SecurityInformation (4 bytes)**: A ULONG. Fields of the security descriptor to be set. These values can be logically OR-ed together to set several descriptors in one request. Bits and security descriptors not mentioned in the following table MUST be ignored and MUST NOT be processed. + +| Name and bitmask | Meaning | +| ------------------------------------------------ | --------------------------------------------------------------------------------------- | +| OWNER_SECURITY_INFORMATION

0x00000001 | Owner of the object or resource. | +| GROUP_SECURITY_INFORMATION

0x00000002 | Group associated with the object or resource. | +| DACL_SECURITY_INFORMATION

0x00000004 | DACL associated with the object or resource. | +| SACL_SECURITY_INFORMATION

0x00000008 | SACL associated with the object or resource. | +| LABEL_SECURITY_INFORMATION

0x00000010 | Integrity label in the security descriptor of the file or named pipe. | +| ATTRIBUTE_SECURITY_INFORMATION

0x00000020 | Resource attribute in the security descriptor of the file or named pipe. | +| SCOPE_SECURITY_INFORMATION

0x00000040 | Central access policy of resource in the security descriptor of the file or named pipe. | +| BACKUP_SECURITY_INFORMATION

0x00010000 | Security descriptor information used for backup operation. | + +#### NT_TRANSACT_QUERY_SECURITY_DESC (0x0006) Extensions + +An SMB_COM_NT_TRANSACT command (section [2.2.4.8](#Section_602802fd5870433a955c79897847053e)) with an NT_TRANSACT_QUERY_SECURITY_DESC allows a client to retrieve the security descriptors for a file or device on the server. The NT_TRANSACT_QUERY_SECURITY_DESC subcommand is specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.7.6. This extension adds LABEL_SECURITY_INFORMATION, ATTRIBUTE_SECURITY_INFORMATION, SCOPE_SECURITY_INFORMATION, and BACKUP_SECURITY_INFORMATION parameter values to the **SecurityInfoFields** field. + +**SecurityInfoFields (4 bytes)**: A ULONG. This field represents the requested fields of the security descriptor to be retrieved. These values can be logically OR-ed together to request several descriptors in one request. The descriptor response format contains storage for all the descriptors. The values returned for security descriptors corresponding to bits not mentioned in the following table MUST be ignored. + +| Name and bitmask | Meaning | +| ------------------------------------------------ | --------------------------------------------------------------------------------------- | +| OWNER_SECURITY_INFORMATION

0x00000001 | Owner of the object or resource. | +| GROUP_SECURITY_INFORMATION

0x00000002 | Group associated with the object or resource. | +| DACL_SECURITY_INFORMATION

0x00000004 | DACL associated with the object or resource. | +| SACL_SECURITY_INFORMATION

0x00000008 | SACL associated with the object or resource. | +| LABEL_SECURITY_INFORMATION

0x00000010 | Integrity label in the security descriptor of the file or named pipe. | +| ATTRIBUTE_SECURITY_INFORMATION

0x00000020 | Resource attribute in the security descriptor of the file or named pipe. | +| SCOPE_SECURITY_INFORMATION

0x00000040 | Central access policy of resource in the security descriptor of the file or named pipe. | +| BACKUP_SECURITY_INFORMATION

0x00010000 | Security descriptor information used for backup operation. | + +#### NT_TRANSACT_QUERY_QUOTA (0x0007) + +An [SMB_COM_NT_TRANSACT (section 2.2.4.8)](#Section_602802fd5870433a955c79897847053e) command with an NT_TRANSACT_QUERY_QUOTA subcommand code is used by a client to query quota information for a user or multiple users. This subcommand is new to these extensions. + +##### Client Request + +The NT_TRANSACT_QUERY_QUOTA request is a special case of the SMB_COM_NT_TRANSACT command request. Only the NT_TRANSACT_QUERY_QUOTA specifics are described here. + +At least one of **NT_Trans_Parameters.SidListLength** or **NT_Trans_Parameters.StartSidLength** MUST be zero. If both are zero, then the quota information for all [**SIDs**](#gt_83f2020d-0804-4840-a5ac-e06439d50f8d), as specified in [\[MS-DTYP\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-DTYP%5d.pdf#Section_cca2742956894a16b2b49325d93e4ba2) section 2.4.2, on the underlying object store of a share MUST be enumerated by the server. + +**SMB_Parameters** + +**WordCount (1 byte):** The value of this field MUST be 0x13. + +**Words (38 bytes):** As specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.4.62.1 and with the following exceptions: + +**SetupCount (1 bytes):** This field MUST be 0x00. + +**NT_Trans_Parameters:** + +- NT_Trans_Parameters +- { +- USHORT FID; +- BOOLEAN ReturnSingleEntry; +- BOOLEAN RestartScan; +- ULONG SidListLength; +- ULONG StartSidLength; +- ULONG StartSidOffset; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| -------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ----------------- | --- | --- | --- | ---------- | --- | --- | --- | ----------- | --- | --- | --- | --- | --- | ---------- | --- | +| FID | | | | | | | | | | | | | | | | ReturnSingleEntry | | | | | | | | RestartScan | | | | | | | | +| SidListLength | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| StartSidLength | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| StartSidOffset | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**FID (2 bytes):** An Fid to a file or directory. The quota information of the object store underlying the file or directory MUST be queried. + +**ReturnSingleEntry (1 byte):** If TRUE (any non-zero value), then this field indicates that the server behavior is to be restricted to only return a single SID's quota information instead of filling the entire buffer. + +**RestartScan (1 byte):** If TRUE (any non-zero value), then this field indicates that the scan of quota information is to be restarted. + +**SidListLength (4 bytes):** If non-zero, then this field indicates that the client is requesting quota information of a particular set of SIDs and MUST represent the length of the **NT_Trans_Data.SidList** field. + +**StartSidLength (4 bytes):** If non-zero, then this field indicates that the **SidList** field contains a start SID (that is, a single SID entry indicating to the server where to start user quota information enumeration) and MUST represent the length, in bytes, of that **SidList** entry. + +**StartSidOffset (4 bytes):** If **StartSidLength** is non-zero, then this field MUST represent the offset from the start of the NT_Trans_Data to the specific **SidList** entry at which to begin user quota information enumeration. Otherwise, this field SHOULD be set to zero and MUST be ignored by the server. + +**NT_Trans_Data:** + +- NT_Trans_Data +- { +- FILE_GET_QUOTA_INFORMATION SidList\[\] (optional); +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------ | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| SidList (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**SidList (variable):** A list of one or more SIDs that are formatted as a FILE_GET_QUOTA_INFORMATION structure, as specified in [\[MS-FSCC\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-FSCC%5d.pdf#Section_efbfe12773ad41409967ec6500e66d5e) section 2.4.33.1. If **SidListLength** is non-zero, then this field MUST contain a list of one or more SIDs for which quota information is being requested. If **StartSidLength** is non-zero, then this field MUST contain a start SID. If both **SidListLength** and **StartSidLength** are zero, then this field MUST NOT be included in the request. + +##### Server Response + +An [SMB_COM_NT_TRANSACT (section 2.2.4.8)](#Section_602802fd5870433a955c79897847053e) response for an NT_TRANSACT_QUERY_QUOTA subcommand MUST be sent by a server in reply to a client [NT_TRANSACT_QUERY_QUOTA](#Section_9f3f73f99c4a42ba9f56e6352491d714) subcommand request when the request is successful. + +The NT_TRANSACT_QUERY_QUOTA response is a special case of the SMB_COM_NT_TRANSACT command response. Only the NT_TRANSACT_QUERY_QUOTA specifics are described here. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------------ | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| NT_Trans_Parameters | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| NT_Trans_Data (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**NT_Trans_Parameters (4 bytes):** + +- NT_Trans_Parameters +- { +- ULONG DataLength; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| DataLength | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**DataLength (4 bytes):** The length, in bytes, of the returned user quota information. This field MUST be equal to the **SMB_Parameters.Words.TotalDataCount** field. + +**NT_Trans_Data (variable):** + +- NT_Trans_Data +- { +- FILE_QUOTA_INFORMATION QuotaInformation\[\] (variable); +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| QuotaInformation (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**QuotaInformation (variable):** A concatenated list of FILE_QUOTA_INFORMATION structures, as specified in [\[MS-FSCC\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-FSCC%5d.pdf#Section_efbfe12773ad41409967ec6500e66d5e) section 2.4.33. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| --------------- | ----------------------- | ------------------------------------------ | ---------------- | ----------------------------------------------------------------------------------------------- | +| ERRDOS(0x01) | ERRbadfunc(0x0001) | STATUS_INVALID_DEVICE_REQUEST(0xC0000008) | | Quotas are not enabled on the volume. | +| ERRDOS(0x01) | ERRbadfid(0x0006) | STATUS_INVALID_HANDLE(0xC0000008) | EBADF | The Fid is invalid. | +| ERRDOS(0x01) | ERRnoaccess(0x0005) | STATUS_ACCESS_DENIED(0xC0000022) | EPERM | Access denied. | +| ERRDOS(0x01) | ERRinvalidparam(0x0057) | STATUS_INVALID_PARAMETER(0xC000000D) | | A parameter is invalid. | +| ERRDOS(0x01) | ERRinvalidsid(0x0539) | STATUS_INVALID_SID(0xC0000078) | | The **StartSid** parameter did not contain a valid SID. | +| ERRSRV(0x02) | ERRerror(0x0001) | STATUS_INVALID_SMB(0x00010002) | | Invalid SMB. Byte count and sizes are inconsistent. | +| ERRSRV(0x02) | ERRinvtid(0x0005) | STATUS_BAD_TID(0x00050002) | | The TID is no longer valid. | +| ERRSRV(0x02) | ERRnomem(0x0008) | STATUS_INSUFF_SERVER_RESOURCES(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRSRV(0x02) | ERRbaduid(0x005B) | STATUS_BAD_UID(0x005B0002) | | The UID supplied is not known to the session. | +| ERRSRV(0x02) | | STATUS_QUOTA_LIST_INCONSISTENT(0xC0000266) | | The **SidList** parameter did not contain a valid, properly formed list. | +| ERRSRV(0x02) | ERRmoredata(0x00EA) | STATUS_BUFFER_OVERFLOW(0x80000005) | | The number of bytes of changed data exceeded the MaxParameterCount field in the client request. | +| ERRHRD(0x03) | ERRdata(0x0017) | STATUS_DATA_ERROR(0xC000003E) | EIO | Disk I/O error. | +| ERRHRD(0x03) | ERRnowrite(0x0013) | STATUS_MEDIA_WRITE_PROTECTED(0xC00000A2) | EROFS | Attempt to modify a read-only file system. | + +#### NT_TRANSACT_SET_QUOTA (0x0008) + +An [SMB_COM_NT_TRANSACT (section 2.2.4.8)](#Section_602802fd5870433a955c79897847053e) request with an NT_TRANSACT_SET_QUOTA subcommand code is sent by a client to set user quota information on the underlying object store of a server. This subcommand is new to these extensions. + +##### Client Request + +The NT_TRANSACT_SET_QUOTA request is a special case of the SMB_COM_NT_TRANSACT command request. Only the NT_TRANSACT_SET_QUOTA specifics are described here. + +**SMB_Parameters:** + +**WordCount (1 byte):** The value of this field MUST be 0x13. + +**Words (38 bytes):** As specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.4.62.1 and with the following exceptions: + +**SetupCount (1 bytes):** This field MUST be 0x00. + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | ------------------------ | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| NT_Trans_Parameters | | | | | | | | | | | | | | | | NT_Trans_Data (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**NT_Trans_Parameters (2 bytes):** + +- NT_Trans_Parameters +- { +- USHORT FID; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| FID | | | | | | | | | | | | | | | | + +**FID (2 bytes):** An Fid to a file or directory. The quota information of the object store underlying the file or directory MUST be modified. + +**NT_Trans_Data (variable):** + +- NT_Trans_Data +- { +- FILE_QUOTA_INFORMATION QuotaInformation\[\] (variable); +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| --------------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| QuotaInformation (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**QuotaInformation (variable):** A concatenated list of FILE_QUOTA_INFORMATION structures, as specified in [\[MS-FSCC\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-FSCC%5d.pdf#Section_efbfe12773ad41409967ec6500e66d5e) section 2.4.33. + +##### Server Response + +An [SMB_COM_NT_TRANSACT (section 2.2.4.8)](#Section_602802fd5870433a955c79897847053e) response for the NT_TRANSACT_SET_QUOTA subcommand MUST be sent by a server in reply to a client NT_TRANSACT_SET_QUOTA request when the request is successful. + +The NT_TRANSACT_SET_QUOTA response is a special case of the SMB_COM_NT_TRANSACT command response. Only the NT_TRANSACT_SET_QUOTA specifics are described here. + +**NT_Trans_Parameters** + +No NT Trans parameters are returned in this response. + +**NT_Trans_Data** + +No NT Trans data is returned in this response. + +**Error Codes** + +| SMB error class | SMB error code | NT status code | POSIX equivalent | Description | +| --------------- | ----------------------- | ------------------------------------------ | ---------------- | -------------------------------------------------------------------------- | +| ERRDOS(0x01) | ERRbadfunc(0x0001) | STATUS_INVALID_DEVICE_REQUEST(0xC0000008) | | Quotas are not enabled on the volume. | +| ERRDOS(0x01) | ERRbadfid(0x0006) | STATUS_INVALID_HANDLE(0xC0000008) | EBADF | The Fid is invalid. | +| ERRDOS(0x01) | ERRnoaccess(0x0005) | STATUS_ACCESS_DENIED(0xC0000022) | EPERM | Access denied. | +| ERRDOS(0x01) | ERRinvalidparam(0x0057) | STATUS_INVALID_PARAMETER(0xC000000D) | | A parameter is invalid. | +| ERRSRV(0x02) | ERRerror(0x0001) | STATUS_INVALID_SMB(0x00010002) | | Invalid SMB. Byte count and sizes are inconsistent. | +| ERRSRV(0x02) | ERRinvtid(0x0005) | STATUS_BAD_TID(0x00050002) | | The TID is no longer valid. | +| ERRSRV(0x02) | ERRnomem(0x0008) | STATUS_INSUFF_SERVER_RESOURCES(0xC0000205) | ENOMEM | The server is out of resources. | +| ERRSRV(0x02) | ERRbaduid(0x005B) | STATUS_BAD_UID(0x005B0002) | | The UID supplied is not known to the session. | +| ERRSRV(0x02) | | STATUS_QUOTA_LIST_INCONSISTENT(0xC0000266) | | The _Sid_ parameter in FILE_QUOTA_INFORMATION did not contain a valid SID. | +| ERRHRD(0x03) | ERRdata(0x0017) | STATUS_DATA_ERROR(0xC000003E) | EIO | Disk I/O error. | +| ERRHRD(0x03) | ERRnowrite(0x0013) | STATUS_MEDIA_WRITE_PROTECTED(0xC00000A2) | EROFS | Attempt to modify a read-only file system. | + +### Information Levels + +In addition to the specification in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.8, the client MUST map the application provided FSCC information levels to SMB information levels as specified below. + +FIND Information Levels + +| FSCC Level | SMB Level | +| ------------------------------ | ------------------------------------ | +| FileIdFullDirectoryInformation | SMB_FIND_FILE_ID_FULL_DIRECTORY_INFO | +| FileIdBothDirectoryInformation | SMB_FIND_FILE_ID_BOTH_DIRECTORY_INFO | + +#### FIND Information Level Extensions + +##### SMB_FIND_FILE_BOTH_DIRECTORY_INFO Extensions + +If the query being executed is a request for the enumeration of available previous versions (section [2.2.1.1.1](#Section_bffc70f9b16a453b939a0b6d3c9263af)), then the returned structure is identical to the structure that is specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.8.1.7. However, the fields have a slightly different definition. + +- SMB_FIND_FILE_BOTH_DIRECTORY_INFO\[SearchCount\] +- { +- ULONG NextEntryOffset; +- ULONG FileIndex; +- FILETIME CreationTime; +- FILETIME LastAccessTime; +- FILETIME LastWriteTime; +- FILETIME LastChangeTime; +- LARGE_INTEGER EndOfFile; +- LARGE_INTEGER AllocationSize; +- SMB_EXT_FILE_ATTR ExtFileAttributes; +- ULONG FileNameLength; +- ULONG EaSize; +- UCHAR ShortNameLength; +- UCHAR Reserved; +- WCHAR ShortName\[12\]; +- SMB_STRING FileName; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ----------------- | --- | --- | --- | --- | --- | --- | --- | -------- | --- | ---------- | --- | --- | --- | --- | --- | -------------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| NextEntryOffset | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| FileIndex | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| CreationTime | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| LastAccessTime | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| LastWriteTime | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| LastChangeTime | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| EndOfFile | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| AllocationSize | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ExtFileAttributes | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| FileNameLength | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| EaSize | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ShortNameLength | | | | | | | | Reserved | | | | | | | | ShortName (24 bytes) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | FileName (variable) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**FileIndex (4 bytes):** This field SHOULD[<68>](#Appendix_A_68) be set to zero when sent in a response and SHOULD be ignored when received by the client. + +**CreationTime (8 bytes):** A FILETIME time stamp of when the previous version represented by the @GMT token was created. The FILETIME format is defined in [\[MS-DTYP\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-DTYP%5d.pdf#Section_cca2742956894a16b2b49325d93e4ba2), section 2.3.3. + +**LastAccessTime (8 bytes):** A FILETIME time stamp of when the previous version represented by the @GMT token was last accessed. + +**LastWriteTime (8 bytes):** A FILETIME time stamp of when the previous version represented by the @GMT token last had data written to it. + +**LastChangeTime (8 bytes):** A FILETIME time stamp of when the previous version represented by the @GMT token was last changed. + +**EndOfFile (8 bytes):** This field MUST be set to zero when sending a response and MUST be ignored when the client receives this message. + +**AllocationSize (8 bytes):** This field MUST be set to zero when sending a response and MUST be ignored when the client receives this message. + +**ExtFileAttributes (4 bytes):** Extended attributes for this file that MUST be marked as a DIRECTORY. + +**FileNameLength (4 bytes):** Length, in bytes, of the **FileName** field. + +**EaSize (4 bytes):** This field MUST be set to zero when sending a response and MUST be ignored when the client receives this message. + +**Reserved (1 byte):** An 8-bit unsigned integer used to maintain byte alignment. This field MUST be 0x00. + +**ShortName (24 bytes):** The 8.3 name for the file formatted as @GMT~XXX where XXX is an array index value in decimal of an array of snapshots returned, starting at an array index value of zero. The **ShortName** field MUST be formatted as an array of 16-bit Unicode characters and MUST NOT be NULL terminated. + +**FileName (variable):** An @GMT token that represents an available previous version for the file or directory. + +##### SMB_FIND_FILE_ID_FULL_DIRECTORY_INFO + +The fields and encoding of the TRANS2_FIND_FIRST2 SMB_FIND_FILE_ID_FULL_DIRECTORY_INFO Information Level response message are identical to the fields and encoding of the TRANS2_FIND_FIRST2 SMB_FIND_FILE_FULL_DIRECTORY_INFO Information Level response, as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 2.2.6.2.2, with the addition of the **FileId** field described in the list that follows the table in this section.[<69>](#Appendix_A_69) + +- SMB_FIND_FILE_ID_FULL_DIRECTORY_INFO\[SearchCount\] +- { +- ULONG NextEntryOffset; +- ULONG FileIndex; +- FILETIME CreationTime; +- FILETIME LastAccessTime; +- FILETIME LastWriteTime; +- FILETIME LastAttrChangeTime; +- LARGE_INTEGER EndOfFile; +- LARGE_INTEGER AllocationSize; +- SMB_EXT_FILE_ATTR ExtFileAttributes; +- ULONG FileNameLength; +- ULONG EaSize; +- ULONG Reserved; +- LARGE_INTEGER FileID; +- SMB_STRING FileName; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| NextEntryOffset | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| FileIndex | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| CreationTime | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| LastAccessTime | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| LastWriteTime | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| LastAttrChangeTime | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| EndOfFile | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| AllocationSize | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ExtFileAttributes | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| FileNameLength | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| EaSize | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| Reserved | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| FileId | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| FileName (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**FileIndex (4 bytes):** This field SHOULD[<70>](#Appendix_A_70) be set to zero when sent in a response and SHOULD be ignored when received by the client. + +**EndOfFile (8 bytes):** This LARGE_INTEGER field MUST be set to zero when sending a response and MUST be ignored when the client receives this message. + +**AllocationSize (8 bytes):** This LARGE_INTEGER field MUST be set to zero when sending a response and MUST be ignored when the client receives this message. + +**ExtFileAttributes (4 bytes):** Extended attributes for this file that MUST be marked as a DIRECTORY. + +**FileNameLength (4 bytes):** The length, in bytes, of the **FileName** field. + +**EaSize (4 bytes):** This field SHOULD[<71>](#Appendix_A_71) be set to zero when sending a response and MUST be ignored when the client receives this message. + +**Reserved (4 bytes):** This field SHOULD be set to 0x00000000 in the server response. The client MUST ignore this field. + +**FileId (8 bytes):** A LARGE_INTEGER that serves as an internal file system identifier. This number MUST be unique for each file on a given volume. If a remote file system does not support unique FileId values, then the **FileId** field MUST be set to zero. + +**FileName (variable):** This field contains the name of the file. + +##### SMB_FIND_FILE_ID_BOTH_DIRECTORY_INFO + +The fields and encoding of the TRANS2_FIND_FIRST2 SMB_FIND_FILE_ID_BOTH_DIRECTORY_INFO Information Level response message are identical to the fields and encoding of SMB_FIND_FILE_BOTH_DIRECTORY_INFO Information Level, as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b), section 2.2.6.2.2, with the addition of the **Reserved2** and **FileId** fields described in the list that follows the table.[<72>](#Appendix_A_72) + +- SMB_FIND_FILE_ID_BOTH_DIRECTORY_INFO\[SearchCount\] +- { +- ULONG NextEntryOffset; +- ULONG FileIndex; +- FILETIME CreationTime; +- FILETIME LastAccessTime; +- FILETIME LastWriteTime; +- FILETIME LastChangeTime; +- LARGE_INTEGER EndOfFile; +- LARGE_INTEGER AllocationSize; +- SMB_EXT_FILE_ATTR ExtFileAttributes; +- ULONG FileNameLength; +- ULONG EaSize; +- UCHAR ShortNameLength; +- UCHAR Reserved; +- WCHAR ShortName\[12\]; +- USHORT Reserved2; +- LARGE_INTEGER FileID; +- SMB_STRING FileName; +- } + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3

0 | 1 | +| ------------------- | --- | --- | --- | --- | --- | --- | --- | -------- | --- | ---------- | --- | --- | --- | --- | --- | -------------------- | --- | --- | --- | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---------- | --- | +| NextEntryOffset | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| FileIndex | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| CreationTime | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| LastAccessTime | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| LastWriteTime | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| LastChangeTime | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| EndOfFile | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| AllocationSize | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ExtFileAttributes | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| FileNameLength | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| EaSize | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ShortNameLength | | | | | | | | Reserved | | | | | | | | ShortName (24 bytes) | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | Reserved2 | | | | | | | | | | | | | | | | +| FileId | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| FileName (variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| ... | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +**FileIndex (4 bytes):** This field SHOULD[<73>](#Appendix_A_73) be set to zero when sent in a response and SHOULD be ignored when received by the client. + +**AllocationSize (8 bytes):** This LARGE_INTEGER field MUST be set to zero when sending a response and MUST be ignored when the client receives this message. + +**ExtFileAttributes (4 bytes):** This field represents the extended attributes for this file that MUST be marked as a DIRECTORY. + +**EaSize (4 bytes):** This field MUST be set to zero when sending a response and MUST be ignored when the client receives this message. + +**Reserved (1 byte):** An 8-bit unsigned integer that is used to maintain 64-bit alignment. This member MUST be 0x00. + +**Reserved2 (2 bytes):** A 16-bit unsigned integer that is used to maintain 64-bit alignment. This member MUST be 0x0000. + +**FileId (8 bytes):** A LARGE_INTEGER that serves as an internal file system identifier. This number MUST be unique for each file on a given volume. If a remote file system does not support unique FileId values, then the **FileId** field MUST be set to zero. + +#### QUERY_FS Information Level Extensions + +##### SMB_QUERY_FS_ATTRIBUTE_INFO + +For this Information Level, the server SHOULD check the **FileSystemAttributes** field and remove the attribute flags that are not supported by the underlying object store before sending the response to the client.[<74>](#Appendix_A_74) + +#### QUERY Information Level Extensions + +No new SMB-specific Information Levels are specified for these extensions. + +#### SET Information level Extensions + +No new SMB-specific Information Levels are specified for these extensions. + +# Protocol Details + +An SMB implementation MUST implement CIFS, as specified by section 3 of the [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) specification. + +## Common Details + +### Abstract Data Model + +This section specifies a conceptual model of possible data organization that an implementation maintains in order to participate in this protocol. The described organization is provided to explain how the protocol behaves. This document does not mandate that implementations adhere to this model as long as their external behavior is consistent with what is described in this document. + +The following elements extend the global abstract data model that is specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.1.1. + +#### Global + +There are no global parameters defined as common to both client and server. + +### Timers + +There are no timers common to both client and server. + +### Initialization + +No new common variables are defined in this document. + +### Higher-Layer Triggered Events + +#### Sending Any Message + +Processing of any message is handled as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.1.4.1 with the following additions: The MD5 algorithm, as specified in [\[RFC1321\]](http://go.microsoft.com/fwlink/?LinkId=90275), MUST be used to generate a hash of the SMB message (from the start of the SMB_Header), which is defined as follows. + +- IF ( Connection.SigningChallengeResponse != NULL ) THEN +- CALL MD5Init( md5context ) +- CALL MD5Update( md5context, Connection.SigningSessionKey ) +- CALL MD5Update( md5context, +- Connection.SigningChallengeResponse ) +- CALL MD5Update( md5context, SMB message ) +- CALL MD5Final( digest, md5context ) +- ELSE +- CALL MD5Init( md5context ) +- CALL MD5Update( md5context, Connection.SigningSessionKey ) +- CALL MD5Update( md5context, SMB message ) +- CALL MD5Final( digest, md5context ) +- END IF +- SET the signature TO the first 8 bytes of the digest + +The resulting 8-byte signature MUST be copied into the **SecuritySignature** field of the SMB header, after which the message can be transmitted. + +### Message Processing Events and Sequencing Rules + +#### Receiving Any Message + +Processing of any message is handled as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.1.5.1 with the following additions: + +The MD5 algorithm, as specified in [\[RFC1321\]](http://go.microsoft.com/fwlink/?LinkId=90275), MUST be used to generate a hash of the SMB message (from the start of the SMB header), and SHOULD be used as follows. + +- IF ( Connection.SigningChallengeResponse != NULL ) THEN +- CALL MD5Init( md5context ) +- CALL MD5Update( md5context, Connection.SigningSessionKey ) +- CALL MD5Update( md5context, +- Connection.SigningChallengeResponse ) +- CALL MD5Update( md5context, SMB message ) +- CALL MD5Final( digest, md5context ) +- ELSE +- CALL MD5Init( md5context ) +- CALL MD5Update( md5context, Connection.SigningSessionKey ) +- CALL MD5Update( md5context, SMB message ) +- CALL MD5Final( digest, md5context ) +- END IF +- SET the signature TO the first 8 bytes of the digest + +The resulting 8-byte signature is compared with the original value of the **SMB_Header.SecuritySignature** field. If the signature received with the message does not match the signature that is calculated, then the message MUST be discarded and no further processing on it is done. The receiver MAY also terminate the connection by disconnecting the underlying transport connection and cleaning up any state associated with the connection. + +### Timer Events + +There are no timers common to both client and server. + +### Other Local Events + +There are no local events common to both client and server. + +## Client Details + +### Abstract Data Model + +This section specifies a conceptual model of possible data organization that an implementation maintains in order to participate in this protocol. The described organization is provided to explain how the protocol behaves. This document does not mandate that implementations adhere to this model as long as their external behavior is consistent with what is described in this document. + +The following elements extend the client abstract data model specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.2.1. + +#### Global + +**Client.MessageSigningPolicy:** A state that determines whether or not this node signs messages. This parameter has four possible values: + +- _Required_ -- Message signing is required. Any connection to a server that does not use signing MUST be disconnected. +- _Enabled_ -- Message signing is enabled. If the other node enables or requires signing, signing MUST be used. +- _Declined_ -- Message signing is disabled unless the other party requires it. If the other party requires message signing, it MUST be used. Otherwise, message signing MUST NOT be used. +- _Disabled_ -- Message signing is disabled. Message signing MUST NOT be used. The _Disabled_ state is obsolete and SHOULD NOT[<75>](#Appendix_A_75) be used. + +**Client.SupportsExtendedSecurity:** A flag that indicates whether the client supports Generic Security Services (GSS), as specified in [\[RFC2743\]](http://go.microsoft.com/fwlink/?LinkId=90378), for selecting the authentication protocol. + +**Client.Supports32BidPIDs:** A flag that indicates whether the client supports 32-bit process IDs. + +#### Per SMB Connection + +**Client.Connection.GSSNegotiateToken:** A byte array that contains the token received during an extended security negotiation and that is remembered for authentication. + +**Client.Connection.ServerGUID:** A GUID generated by the server to uniquely identify this server. + +#### Per SMB Session + +**Client.Session.AuthenticationState:** A session can be in one of three states: + +- InProgress -- A session setup (an extended SMB_COM_SESSION_SETUP_ANDX exchange as described in section [3.2.4.2.4.1](#Section_495dd941077648aaaa8af1aa5eeadcea)) is in progress for this session. +- Valid -- A session setup exchange has successfully completed; the session is valid and a UID for the session has been assigned by the server. +- Expired -- The Kerberos ticket for this session has expired and the session needs to be re-established. + +**Client.Session.SessionKeyState:** The session key state. This can be either Unavailable or Available. + +**Client.Session.UserCredentials:** An opaque implementation-specific entity that identifies the credentials that were used to authenticate to the server. + +#### Per Tree Connect + +**Client.TreeConnect.GuestMaximalShareAccessRights:** The **GuestMaximalShareAccessRights** value as returned in the [SMB_COM_TREE_CONNECT_ANDX server response (section 2.2.4.7.2)](#Section_087860d5391941d5a7531b330d651196). + +**Client.TreeConnect.MaximalShareAccessRights:** The **MaximalShareAccessRights** value as returned in the SMB_COM_TREE_CONNECT_ANDX server response (section 2.2.4.7.2). + +#### Per Unique Open + +None. + +### Timers + +There are no new client timers other than those specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.2.2. + +### Initialization + +Initialization of the following additional parameters is required beyond that specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.2.3. + +The following values MUST be initialized at system startup: + +- **Client.MessageSigningPolicy** and **Client.SupportsExtendedSecurity** MUST be set based on system policy.[<76>](#Appendix_A_76) The value of this is not constrained by the values of any other policies. +- **Client.Supports32BitPIDs** MUST be set to TRUE if the client supports 32-bit process IDs.[<77>](#Appendix_A_77) + +When an SMB connection is established, the following values MUST be initialized: + +- **Client.Connection.GSSNegotiateToken** is set to an empty array. +- **Client.Connection.ServerGUID** is set to the GUID of the server. + +When an SMB session is established on an SMB connection, the following value MUST be initialized: + +- **Client.Session.AuthenticationState** MUST be set to _InProgress_. +- **Client.Session.SessionKeyState** MUST be set to _Unavailable_. +- **Client.Session.UserCredentials** MUST be empty. +- **Client.SessionTimeoutValue** (see \[MS-CIFS\] (section 3.2.1.1)) SHOULD be set to 60 seconds. + +All other values are initialized as specified in \[MS-CIFS\] section 3.2.3. + +### Higher-Layer Triggered Events + +#### Sending Any Message + +The following global details are presented to a client that sends any message in addition to what is specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.2.4.1. + +##### Scanning a Path for a Previous Version Token + +The application requests a previous version of a file by placing a time indicator in the path as a directory element, as specified in section [2.2.1.1.1](#Section_bffc70f9b16a453b939a0b6d3c9263af). For any path-based operation (for example,SMB_COM_NT_CREATE_ANDX) the client SHOULD scan the file path being provided by the application for a formatted @GMT token. + +If a previous version token is present in the pathname as a directory element or a final target, the client SHOULD[<78>](#Appendix_A_78) set the SMB_FLAGS2_REPARSE_PATH flag in the SMB header of the request. + +#### Application Requests Connecting to a Share + +Processing of this event is handled as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.2.4.2. + +##### Connection Establishment + +Processing of this event is handled as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.2.4.2.1. + +##### Dialect Negotiation + +Processing of this event is handled as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.2.4.2.2. + +##### Capabilities Negotiation + +Processing of this event is handled as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.2.4.2.3, with the addition that the new capabilities flags (specified in section [2.2.4.5.2](#Section_8f8ce04ae1844d17bfb22cf762e6f6c4)) are also to be considered in the list of possible capabilities. + +##### User Authentication + +Processing of this event is handled as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.2.4.2.4, with the following additions: + +If **Client.Connection.ShareLevelAccessControl** is FALSE: + +For each existing **Connection** to the server in **Client.ConnectionTable\[ServerName\]**, the client MUST search the **Client.Connection.SessionTable** for a **Session** that corresponds to the user that establishes the connection to the share. The client MUST search for a valid **Session** by either a [**security context**](#gt_88d49f20-6c95-4b64-a52c-c3eca2fe5709) or a **UID** representing the user. + +- If a **Connection** with an existing **Session** for this user is found, then the client MUST reuse the **Session** and continue processing. +- If none of the existing **Connections** to the server has a valid **Session** for this user, the client SHOULD[<79>](#Appendix_A_79) reuse one of the existing **Connections** identified or established in section [3.2.4.2.1](#Section_40ac56691c634026bac4807c4981205a). The client MUST establish a new **Session** for the user. The user's credentials, typically a username or principal and an associated password or password hash, MUST be stored in **Client.Session.UserCredentials**. + +Signing + +The client-global **Client.MessageSigningPolicy** MUST be compared against the selected **Client.Connection.ServerSigningState**, as per the following table. If the result is _Blocked_, the underlying transport connection SHOULD be closed.[<80>](#Appendix_A_80) + +| Client signing state | Server signing state | | | | +| --- | --- | | | | --- | --- | --- | +| | Disabled | Declined | Enabled | Required | +| Disabled | Message

Unsigned | Message Unsigned | Message

Unsigned | Blocked | +| Declined | Message Unsigned | Message Unsigned | Message Unsigned | Message Signed | +| Enabled | Message Unsigned | Message Unsigned | Message Signed | Message Signed | +| Required | Blocked | Message Signed | Message Signed | Message Signed | + +If the client's **Client.MessageSigningPolicy** is "Required", the client MUST set the SMB_FLAGS2_SMB_SECURITY_SIGNATURE_REQUIRED bit in the **Flags2** field of the [SMB_COM_SESSION_SETUP_ANDX request](#Section_a00d03613544484596ab309b4bb7705d) SMB header to indicate that the client refuses to connect if signing is not used. + +Extended Security + +If **Client.Connection.ServerCapabilities** has the CAP_EXTENDED_SECURITY flag set (which indicates that the server supports extended security), then the client MUST construct an SMB_COM_SESSION_SETUP_ANDX request, as specified in section 2.2.4.6.1. + +The client MUST do one of the following: + +- Pass the **Client.Connection.GSSNegotiateToken** (if valid) to the configured GSS authentication mechanism to obtain a GSS output token for the authentication protocol exchange.[<81>](#Appendix_A_81) +- Choose to ignore the **Client.Connection.GSSNegotiateToken** received from the server, and give an empty input token to the configured GSS authentication protocol to obtain a GSS output token for the authentication protocol exchange. + +In either case, the client MUST initiate the GSS authentication protocol via the GSS_Init_sec_context() interface, as specified in [\[RFC2743\]](http://go.microsoft.com/fwlink/?LinkId=90378), passing in the input **Client.Connection.GSSNegotiateToken** as previously described, along with the credentials from **Client.Session.UserCredentials**. The client MUST set the MutualAuth and Delegate options which are specified in [\[MS-KILE\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-KILE%5d.pdf#Section_2a32282edd484ad9a542609804b02cc9) section 3.2.1.[<82>](#Appendix_A_82) + +The client MUST then create an SMB_COM_SESSION_SETUP_ANDX request (section 2.2.4.6.1) message. The client MUST set CAP_EXTENDED_SECURITY in the **Capabilities** field, SMB_FLAGS2_EXTENDED_SECURITY in the **SMB_Header.Flags2** field, the **SMB_Data.Bytes.SecurityBlob** field to the GSS output token generated by the GSS_Init_sec_context() interface, and the **SMB_Parameters.Words.SecurityBlobLength** to the length of the GSS output token. + +###### Sequence Diagram + +For the user to be successfully authenticated and to establish a session, the client MUST follow a security negotiation scheme that can involve one or more roundtrips of SMB_COM_SESSION_SETUP_ANDX request and response. In each roundtrip, the server and client exchange security tokens. The exchange of security tokens MUST continue until either the client or the server determines that authentication has failed or both sides decide that authentication is complete. If authentication fails, then the client drops the connection and indicates the error (see the following diagram for details). If authentication succeeds, then the application protocol can be assured of the identity of the participants as far as the supporting authentication protocol can accomplish. + +In the sequence diagram that follows, requests with straight line arrows stand for the requests that the client MUST send. Requests with dotted line arrows stand for the requests the client could send. The server MUST respond to each client request that it receives. + +![User authentication and session establishment sequence](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAb0AAAGJCAYAAAAexe3/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADFMAAAxYAdynKLEAADkpSURBVHhe7Z0vdBRdtkcjRiCeQCIjEEhkRATiCcSImBGIJ56MGIFAIEaMiIxEjkBgEQgkEvEEEoGIGIEYgUBEjOm3dpNf5uR+Vd2dpm5Sney91l1ddf9XdXJ2n0ogez9+/Fj87W9/s0xUTk5OFufn5wsRkd/l9PR0MM5YtitnZ2eLPQ6ePXs22MFy/fL06dPFP/7xj4svWRGR7fj06dNif39/MM5Yrl+Ojo4W//u///tLehSZBm6q0hOR3wXpkZDINBCXlV4HlJ6ITIHSmxal1wmlJyJTo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wzWYa4K+6jrMn5MXutYJS9gDmRCPaV+M7F3xiD5bWQlInInMz3+bAdSaYP33EjQJ9An2IcIhADPcTKX1APHNfhzXNvHoE99HAiRb8Sa9ZiTfVUxseehrIlxQwJvUV4idwczvU5sIj2CKTf/wYMHy1864I8w3hZfv35diiOFP91fGfpFEuSSR2SIJVR5V6m18mGdOm4MxjBPsjrGUCIgxFWzrfbDQyvMIVgjhX0xh4//RO4eSu+GOT8/X970g4ODpehq+R3pMW+VFn/pOOKltBLjj0HWtfmLyKyf0vYf+svHfOFU6VWhhVZ6ZGAUjmkbGjNGpLRJdnYdEFxK1uixjojIddnZTI9M6vj4ePHw4cMrsqkF8VRacfGn+KuYKkiptlHq2FZi1yWPLREWciCzqo83OR6SBFJMlsgxQo5UKmRtVTj0ZZ2hDFNEZFvM9DoRSY1ldUOllV4rLkrN5m6ayIgyZRbEtSTTQq5VfiIiU6L0OvL+/fvlzX306NGg5IaKiIhI2OnHm2RIPAZc9YiTn82JiEgfzPQ60UqvhUd3PM57/vz55W9vUvgFExER6YPSmwn8XAtJ+u/AREQk3JlMT0REbh4zvU4oPRGR+aH0REREZoqZnoiIbI2ZXieUnojI/FB6IiIiM8VMT0REtsZMrxNKT0Rkfig9ERGRmWKmJyIiW2Om1wmlJyIyP5SeiIjITDHTExGRrTHT64TSExGZH0pPRERkppjpiYjI1pjpdULpiYjMD6UnIiIyU8z0RERka8z0OqH0RETmh9ITERGZJYvF/wPlpbql69RW6gAAAABJRU5ErkJggg==) + +Figure 2: User authentication and session establishment sequence + +The diagram illustrates the sequence of events during the protocol negotiation and session establishment process. After the initial SMB_COM_NEGOTIATE command exchange has been completed, the SMB_COM_NEGOTIATE exchange MUST NOT be repeated over the same SMB connection; otherwise, the server disconnects the client by closing the underlying transport connection. The parameters returned in the SMB_COM_NEGOTIATE response MUST be used when creating new sessions over the same connection. + +**Session Setup Roundtrip** + +The SMB_COM_NEGOTIATE Server response is processed as described in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.2.5.2. The protocol extensions in this document apply only to the NT LM 0.12 dialect of SMB. For further information on SMB dialects, see \[MS-CIFS\] section 1.7. + +If the NT LM 0.12 dialect is successfully negotiated, then the SMB client examines the Capabilities field in the SMB_COM_NEGOTIATE server response (section [2.2.4.5.2](#Section_8f8ce04ae1844d17bfb22cf762e6f6c4)). If the CAP_EXTENDED_SECURITY bit is clear (0x00000000), then the SMB server does not support extended security. In order for authentication to proceed, the SMB client MUST build a non-extended SMB_COM_SESSION_SETUP_ANDX request, and MUST set the **WordCount** field to 0x0d. Authentication then proceeds as described in \[MS-CIFS\] section 3.2.4.2.4. + +If the CAP_EXTENDED_SECURITY bit is set (0x80000000), then the SMB server does support extended security. The SMB client MUST build an SMB_COM_SESSION_SETUP_ANDX request in the extended form, as specified in section [2.2.4.6.1](#Section_a00d03613544484596ab309b4bb7705d). The request is sent to the SMB server, and the server builds an extended SMB_COM_SESSION_SETUP_ANDX server response (section [2.2.4.6.2](#Section_e5a467bccd364afa825e3f2a7bfd6189)). The security BLOB in the session setup response is built as specified in [\[RFC2743\]](http://go.microsoft.com/fwlink/?LinkId=90378). + +Upon receiving the extended SMB_COM_SESSION_SETUP_ANDX server response (section 2.2.4.6.2), the SMB client invokes the local security package to determine whether the session setup request SHOULD be completed, aborted, or continued. A completed session indicates that the server has enough information to establish the session. An aborted session indicates that the server cannot proceed with the session setup because of an error in the information presented by the client, or otherwise. If the session setup has to be continued, the security package on the client and/or server requires an additional roundtrip before the session setup can be established. This is especially true of new security packages that support mutual authentication between the client and server. + +In the case of extended security, the SMB protocol does not make the distinction between NTLM and Kerberos; therefore, the sequence defined previously in this section is the same in both cases. If authentication succeeds after a single roundtrip, then only one session setup exchange is required. Otherwise, additional roundtrips will be required. + +Each additional roundtrip MUST consist of one SMB_COM_SESSION_SETUP_ANDX client request and one SMB_COM_SESSION_SETUP_ANDX server response. In the sequence diagram, this is represented in the horizontal dotted line that symbolizes additional roundtrips until the final roundtrip, which is represented as SMB_COM_SESSION_SETUP_ANDX Client Request N and SMB_COM_SESSION_SETUP_ANDX Server Response N, where N is a number larger than 1. + +All additional SMB session setup roundtrips follow the same sequence details as Session Setup Roundtrip, as described earlier in this topic.[<83>](#Appendix_A_83) + +##### Connecting to the Share (Tree Connect) + +Processing of this event is handled as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.2.4.2.5, with the following additions: + +If a tree connect is already established to the target share in **Client.Connection.TreeConnectTable**, then it SHOULD be reused. If not, then the client creates an SMB_COM_TREE_CONNECT_ANDX request, as specified in section [2.2.4.7.1](#Section_16b173568eff49c29d21557e07ef085d), to connect to the target share. + +**Session Key Protection** + +The client SHOULD[<84>](#Appendix_A_84) request **Client.Session.SessionKey** protection by setting the TREE_CONNECT_ANDX_EXTENDED_SIGNATURES flag in the **Flags** field of the SMB_COM_TREE_CONNECT_ANDX request to TRUE. + +**Extended Information Response** + +The client MUST request extended information in the response by setting the TREE_CONNECT_ANDX_EXTENDED_RESPONSE flag in the **Flags** field of the SMB_COM_TREE_CONNECT_ANDX request to TRUE, as defined in section [2.2.4.3.2](#Section_056d7d3304574f9ab7e0ab983ce24ae4). + +The client sends this message to the server. + +#### Application Requests Opening a File + +The processing of this event is handled as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) sections 3.2.4.5 and 3.2.4.6, with the following additions: + +The application can request that additional information be returned for the Open, in particular maximal access information. The client can issue either an SMB_COM_NT_CREATE_ANDX request or an SMB_COM_OPEN_ANDX request to make use of these extensions, as specified in section [3.2.4.3.1](#Section_28ca564a5aa34ef3a245829627a7b37e).[<85>](#Appendix_A_85) + +##### SMB_COM_NT_CREATE_ANDX Request + +To access these extensions, the application can also provide: + +- **RequestExtendedResponse:** A BOOLEAN. If TRUE, then it indicates that the application is requesting a server to send an extended response. + +If the application is requesting an extended server response, then the client MUST set the NT_CREATE_REQUEST_EXTENDED_RESPONSE flag in the **SMB_Parameters.Flags** field of the request. + +For a named pipe request, the client MUST set the SYNCHRONIZE bit in the **DesiredAccess** field if the FILE_SYNCHRONOUS_IO_ALERT or FILE_SYNCHRONOUS_IO_NONALERT bit is set in the **CreateOptions** field. + +##### SMB_COM_OPEN_ANDX Request (deprecated) + +To access these extensions, the application can also provide: + +- **RequestExtendedResponse:** A BOOLEAN. If TRUE, then it indicates that the application is requesting a server to send an extended response. + +If the application is requesting an extended server response, then the client SHOULD[<86>](#Appendix_A_86) set the SMB_OPEN_EXTENDED_RESPONSE flag in the **SMB_Parameters.Flags** field of the request. + +#### Application Requests Reading from a File, Named Pipe, or Device + +Processing of this event is handled as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.2.4.14, with the following additions: + +The SMB_COM_READ_ANDX command request has been extended as specified below. + +**Timeout_or_MaxCountHigh** + +The **Timeout** field specified in \[MS-CIFS\] section 2.2.4.42.1 has been extended to be the **Timeout_or_MaxCountHigh** field. This field is treated as a union of a 32-bit **Timeout** field and a 16-bit unsigned integer named **MaxCountHigh**, as specified in section [2.2.4.2.1](#Section_df9244e87b2d4714a3836990589a8ff4). + +- For pipe reads, the client MUST use **Timeout_or_MaxCountHigh** as the **Timeout** field. The client MUST set the **Timeout** field either to a time-out value in milliseconds, or to 0xFFFFFFFF.[<87>](#Appendix_A_87) The latter value indicates to the server that the operation MUST NOT time out. +- For file reads, the client MUST use this as the **MaxCountHigh** field. If the count of bytes to read is larger than 0xFFFF bytes in length, then the client MUST use the **MaxCountHigh** field to hold the two most significant bytes of the count, thus allowing for a 32-bit read count when combined with **MaxCountOfBytesToReturn** field. If the read count is not larger than 0xFFFF, then the client MUST set **MaxCountHigh** to zero. + +##### Large Read Support + +If the CAP_LARGE_READX bit is set in **Client.Connection.ServerCapabilities**, then the client is allowed to issue a read of a size larger than **Client.Connection.MaxBufferSize** using an SMB_COM_READ_ANDX request. Otherwise, the client MUST split the read into multiple requests in order to retrieve the entire amount of data.[<88>](#Appendix_A_88) + +- If a large read is being issued and the object being read is not a file, then the count of bytes to read MUST be placed into the **MaxCountOfBytesToReturn** field. This field is a 16-bit unsigned integer; therefore, the maximum count of bytes that can be read is 0xFFFF bytes (64K - 1 byte). +- If a large read is being issued and the object being read is a file, then the two least significant bytes of the count of bytes to read MUST be placed into the **MaxCountOfBytesToReturn** field and the two most significant bytes of the count MUST be placed into the **MaxCountHigh** field. + +#### Application Requests Writing to a File, Named Pipe, or Device + +Processing of this event is handled as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.2.4.15 with the following additions: + +The SMB_COM_WRITE_ANDX command request has been extended as specified in section [2.2.4.3.1](#Section_178be656705649ea8bcbcf123737b016). + +Large Write Support + +If the CAP_LARGE_WRITEX bit is set in **Client.Connection.ServerCapabilities**, then the client is allowed to issue a write of a size larger than **Client.Connection.MaxBufferSize** using an SMB_COM_WRITE_ANDX request. Otherwise, it MUST split the write into multiple requests to write the entire amount of data. + +If the CAP_LARGE_WRITEX bit is set in **Client.Connection.ServerCapabilities**, and the client is issuing a write of a size larger than **Client.Connection.MaxBufferSize**, the client MUST ensure that the total length of the SMB packet does not exceed the maximum packet length allowed by the underlying transport, as specified in section [2.1](#Section_f906c680330c43ae9a71f854e24aeee6). + +If the count of bytes to be written is greater than or equal to 0x00010000 (64K), then the client MUST set the two least significant bytes of the count in the **DataLength** field of the request and the two most significant bytes of the count in the **DataLengthHigh** field. + +#### Application Requests a Directory Enumeration + +Processing of this event is handled as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.2.4.27, with the following additions: + +The TRANS2_FIND_FIRST2 subcommand request has been extended as specified below. + +New Information Levels + +To request the new Information Levels specified in section [2.2.6.1.1](#Section_7875b17bfe7b4810be2bc314272bce9c), the client MUST set the **InformationLevel** field of the TRANS2_FIND_FIRST2 request to the corresponding Information Level. + +Enumerating Previous Versions + +An application is allowed to request an enumeration of available previous versions of a file or directory using a TRANS2_FIND_FIRST2 request (see section [2.2.1.1.1](#Section_bffc70f9b16a453b939a0b6d3c9263af)). To do this, the request MUST have the @GMT token wildcard, @GMT-\*, as part of the search pattern in the **FileName** field and it MUST use the SMB_FIND_FILE_BOTH_DIRECTORY_INFO Information Level. This extension is not available for Information Levels other than SMB_FIND_FILE_BOTH_DIRECTORY_INFO. The client MAY[<89>](#Appendix_A_89) fail such requests or simply send the requests to the server. Because it is a path-based operation, this request follows the same previous version token parsing rules as specified in section [3.2.4.1.1](#Section_ad27e016fb4c410590985f85ac6c8c7e). + +The message is sent to the server. + +#### Application Requests Querying File Attributes + +Processing of this event is handled as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.2.4.12, with the following additions: + +**Pass-through Information Levels** + +The extension adds support for pass-through Information Levels, as defined in section [2.2.2.3.5](#Section_ab2aca376c9e4505baa99e2bc556c475). If the CAP_INFOLEVEL_PASSTHRU bit in **Client.Connection.ServerCapabilities** is set, the client MUST increment the Information Level value by SMB_INFO_PASSTHROUGH (0x03e8) and place the resulting value in the **InformationLevel** field of a TRANS2_QUERY_FILE_INFORMATION or TRANS2_QUERY_PATH_INFORMATION request. + +**File Streams** + +A client can send a TRANS2_QUERY_FILE_INFORMATION subcommand of the [SMB_COM_TRANSACTION2 request](#Section_714bb6fa7fab4dab8ff88a01c273b9ce) to the server with the **InformationLevel** field set to SMB_QUERY_FILE_STREAM_INFO (see \[MS-CIFS\] section 2.2.6.8). If the FID field in the client request is on an SMB share that does not support streams, then the server MUST fail the request with STATUS_INVALID_PARAMETER. + +A client can send a TRANS2_QUERY_PATH_INFORMATION subcommand of the SMB_COM_TRANSACTION2 request to the server with the **InformationLevel** field set to SMB_QUERY_FILE_STREAM_INFO (see \[MS-CIFS\] section 2.2.6.6.2). If the **FileName** field in the client request is on an SMB share that does not support streams, then the server MUST fail the request with STATUS_INVALID_PARAMETER. + +Previous Version Tokens + +Because the TRANS2_QUERY_PATH_INFORMATION subcommand request is a path-based operation, the path SHOULD be scanned for previous version tokens by the client, as specified in section [3.2.4.1.1](#Section_ad27e016fb4c410590985f85ac6c8c7e). + +#### Application Requests Setting File Attributes + +Processing of this event is handled as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.2.4.13, with the following additions: + +**Pass-Through Information Levels** + +The extension adds support for pass-through **Information Levels**, as defined in section [2.2.2.3.5](#Section_ab2aca376c9e4505baa99e2bc556c475). If the CAP_INFOLEVEL_PASSTHRU bit in **Client.Connection.ServerCapabilities** is set the client MUST increment the level value by SMB_INFO_PASSTHROUGH (0x03e8) and place the resulting value in the **InformationLevel** field of a TRANS2_SET_FILE_INFORMATION or TRANS2_SET_PATH_INFORMATION request. The serialized native structure is placed in the Trans2_Data block of the request and the **SMB_Parameters.TotalDataCount** is set to the length of this buffer. + +**Previous Version Tokens** + +Because the TRANS2_SET_PATH_INFORMATION subcommand request is a path-based operation, the path SHOULD be scanned for previous version tokens by the client, as specified in section [3.2.4.1.1](#Section_ad27e016fb4c410590985f85ac6c8c7e). + +#### Application Requests Querying File System Attributes + +The processing of this event is handled as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section [2.2.2.3.5](#Section_ab2aca376c9e4505baa99e2bc556c475), with the following additions: + +Support of pass-through Information Levels for the querying file system attributes through the use of the TRANS2_QUERY_FS_INFORMATION subcommand is defined in section 2.2.2.3.5. If the CAP_INFOLEVEL_PASSTHRU bit in **Client.Connection.ServerCapabilities** is set, the client MUST increment the Information Level value by SMB_INFO_PASSTHROUGH (0x03e8) and place the resulting value in the **InformationLevel** field of a TRANS2_QUERY_FS_INFORMATION request. + +#### Application Requests Setting File System Attributes + +The application MUST provide the following: + +- An **Open** that identifies a file on the file system that will have its attributes set. +- The Information Level that defines the format of the data to set. Valid Information Levels are specified in [\[MS-FSCC\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-FSCC%5d.pdf#Section_efbfe12773ad41409967ec6500e66d5e) section 2.5. +- A buffer that contains the attribute data to be set on the server. The buffer is formatted as specified in the subsection of \[MS-FSCC\] section 2.5 that corresponds to the Information Level supplied by application. + +This operation supports the use of pass-through Information Levels only. If the CAP_INFOLEVEL_PASSTHRU flag in **Client.Connection.ServerCapabilities** is not set, then the client MUST fail the request and return the error code STATUS_NOT_SUPPORTED to the calling application. + +The client MUST construct a TRANS2_SET_FS_INFORMATION subcommand request, as specified in section [2.2.6.4.1](#Section_cf5f012fe1c4499d9df8a95add99221d). + +The client MUST use **Open.TreeConnect** and **Open.Session** to send the request to the server. The request MUST be sent to the server, as specified in section [3.2.4.1](#Section_27c46f8bf18145c89e4b0383493bc009). + +#### Application Requests Sending an I/O Control to a File or Device + +Processing of this event is handled as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.2.4.22, with the following additions: + +A list of FSCTLs is specified in [\[MS-FSCC\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-FSCC%5d.pdf#Section_efbfe12773ad41409967ec6500e66d5e) section 2.3. Three I/O control codes specific to the extension are described in the following subsections. + +##### Application Requests Enumerating Available Previous Versions + +An application can request that a client retrieve an enumeration of available previous version time stamps for a share by issuing the FSCTL_SRV_ENUMERATE_SNAPSHOTS control code, as specified in section [2.2.7.2.1](#Section_2f8a9baed8c1462893daadba011e4f17).[<90>](#Appendix_A_90) The request is sent to the server. + +##### Performing a Server-Side Data Copy + +An outline of the steps taken for a server-side data copy follows. The application first requests the FSCTL_SRV_REQUEST_RESUME_KEY operation and the client issues the request to the server as specified in section [3.2.4.11.2.1](#Section_544b0e52d2a9475c8bdfc5d2ac8c877d). The client then returns the Copychunk Resume Key received from the server to the application. The application then requests the FSCTL_SRV_COPYCHUNK operation and the client issues the request to the server as specified in section [3.2.4.11.2.2](#Section_2441bfb1323f49c1ac221260c4cd8958). The client then returns the status received from the server to the application. + +![Server-side data copy of an entire file](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAkUAAAJECAYAAAAYIlBkAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAEBcAABAYAQ1Vg2AAAH0ASURBVHhe7b0rtCzFtm69xBZLHLHkEkcgEIgrkAgEEnEEFrEF4gokAoFAIo5AIhEIzBEIBGILJBJxBQKBRCIQ2Pn/vfb81hlrEFmV9cysnL23Fq0yIuOVkREjvox81LOHFfDTTz89/Pjjjw/ffffdw+eff667oaPNafuff/758WyIiIg8TW4uihBAn3zyycMbb7zx8OzZs5175513Ht57772HDz74YDhx667naHPa/u233351Pt56662Hzz77TKEkIiJPipuIIlYjPv7444eXL1/uBNCXX3758Ntvvz3ulbXxyy+/PHzxxRc7oYR45dz98MMPj3tFRES2ydVE0R9//LFbbXjx4sVuNeKrr756+P333x/3yr2AeOXcvf/++7tzyeoS51ZERGRrXFwU/fXXX7tVBlYY+HUC3Q6cS0QRt9dY7dsqOU6dbqtuKbuM3eB2vU63NsciDlxUFH399dc7MUTmiqHtwopfngvj1ujWYNJgkPSJRKfbgkvfXgLKRhjxcodOtxb37bff7uYzuIgo4oFcnj/56KOPvEX2hODWGrdGOfc8h7QVMnmIbJEl+zeiiElIZE0wl11MFKGweHjaN5WeLpx7+s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KztlhX37uv8WcDzffffdo09EROT+OSiKgNskt5x054qiunqyD0RQXdUgbdJ1YZKVJBjVA4FV09ft0UpRboNV5oiiNa8U8f0c3krMd3RERES2wCxRxIOyuFvBJJ9nfOKfEgFsIyDwE58VjA7hCBF+c3sMBwgP0mQf8fKQKtvUg7wRShFL+JO+bk89U5Sw1A8/pC7EocyaV32miHSE12eKiBu6/9r4Z7AiIrJFZokiJtxjH6o9BwRBXUVBmPAgchj5c3sKATECAUIc4pI/v0AaxAu/iKsIIkCUJDzxob4l1t8YQxglT8qEiCHyyf5AWvzE6XlRF/Ihbb0tR5x97XFtqNMtH74XERG5BbNEETAxb/EZEgRJFSmVrOjI/4JA5kvW3joTEZGtMVsUbXUyZJWlrs5UEILyOlsVxyIiIrNFEfBqPq/oy9Pk1rdRRUREbslRoojnYfgy8a3/C03Wwa3fQhQREbklR4ki8M2jp8lnn302+eyViIjIFjhaFMESX7mW5fj2228fPvzww0efiIjINjlJFMHHH388+YCybAffNhMRkafCyaKISZLbaD54vV34dhLPEfFXLyIiIlvnZFEUuI3GqpErCdsCsfvee+/5UL2IiDwZzhZFwG00JlBXFO4fRBDPD/nMmIiIPDUuIorgp59+2r2uz2Tq6sL9wUofb5e98cYbuwerRUREnhoXE0XAxMptFyZWJlhvqd0H/I8Z54zX7hW0IiLyVLmoKApMrEywz58/3/0tBLfX+PCjrAPOT16zf/Hixe4PXj0/IiLy1LmKKKrwP1k8iP3y5cvdm0y8sfb555/vHPt4w+meHP9WPwpfs0t7I4J49gshxDbCyJUhERGRf3N1UVThmzd8ETuTNKtITNL34nhmCnE32rdml/ZGBCGSRERE5O/cVBTdOzx7w60mERER2R6KoiNQFImIiGwXRdERKIpERES2i6LoCBRFIiIi20VRdASKIhERke2iKDoCRZGIiMh2URQdgaJIRERkuyiKjkBRJCIisl0URUegKBIREdkuiqIjUBSJiIhsF0XRESiKREREtoui6AgURSIiIttFUXQEX3311e4f/0VERGR7KIqOIP82LyIiIttDUXQEiiIREZHtoig6AkWRiIjIdlEUHYGiSEREZLsoio5AUSQiIrJdFEVHoCgSERHZLoqiI1AUiYiIbBdF0REoikRERLaLougIFEUiIiLbRVF0BIoiERGR7aIoOgJFkYiIyHZRFB2BokhERGS7KIr28Msvvzy89957r9wbb7yxczWMOCIiInL/KIoO8PLly4dnz54NHftERERkGyiKDvDxxx8PBRGOfSIiIrINFEUH+PHHH4eCCMc+ERER2QaKohmMbqF560xERGRbKIpmMLqF5q0zERGRbaEomsHoFpq3zkRERLaFomgm9Raat85ERES2h6JoJvUWmrfOREREtoeiaCb1Fpq3zkRERLaHougIuG3mrTMREZFtoig6Am6beetMRERkmywmin777bfdbah7cl9++eXOjfat2dHWcpi//vpr2H463RYc/ftWjMrX6dbuGCNXFUW///77w1dffbVbXckfqOa5nP7HqrrrOdqaNn/+/PmrMM7J119/vTtH8m+++OIL+6Vuk45+Tf++BVw4Oo509+beeuuth08++eTyooh/jWfwvf3227vnb5h8EUZRYrIcdSWEc/LRRx/tztE777yzM2RPfUXp888/3zmRrXHLvu04knuERQLmxIuJou+++26ntHCfffbZw88///y4R9bOTz/9tFPIXN0hZjmXTxGNuWyVW/Ztx5HcIxcTRaw6sNLwwQcf7FaJ5L5BzHIuWU5ELD0lNOayVW7Ztx1Hco+cLYqYPN9///0nOXk+BarYfSq31TTmslVu2bcdR3KPnCWKeB6FCfOHH354DJGtktui33777WPIdtGYy1a5Zd92HMk9crIoyrd6bvl6pywL5/rDDz/cPXe0ZTTmslVu2bcdR3KPHC2K/vjjj92tMlaJ5GnCG2rcTqMvbBGNuWyVW/Ztx5HcI0eJIp4f4q0kX6kXbqdx63SLzxlpzGWr3LJvO47kHpktivi431YnQTkN3jJEJG9txUhjLlvlln3bcST3yCxRxLMkvl0mI1g15O3DLT1bpjGXrXLLvu04kntkliji4dqn8NaRnEb+wmUraMxlq9yybzuO5B45KIr4qw6+TH0uPJh7if/cyUcFgcn41Ae+WeGoz0b9+uuvu4bYKn/++edVH47njTQewN4CI2NOX6Hfvf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Ep4XARMTYOrKzdVsNTtqQetR2UDzyklHPjNPtIlH9LXcFzo/iXwH/JFRERmiqLRN2xuDWIngicgNBAd0B+IPkds9HJGZc8lYmjNbPFbVCIiIscySxQBqyDffffdo28dVFHUWcMKzD1wzKv4IiIiW2a2KEKA8GzR2l7BnvpoIytHffVIXodzybeGXCUSERE5QhQBH+zjD0NlG3AuOaciIiJypChiRYGVBT/Yd/94LkVERF7nKFEEvKW09Mcc5XzW+IyYiIjIkhwtisDbaPcNn1fwIXQREZHXOUkUwRr+KFaOh7/y4C89RERE5HVOFkX8JQRvo93Dd3jk3/Bl7ffee8/niERERAacLIrgt99+2wkjn01ZP3yPCEHk/5uJiIiMOUsUAasOPLTrMyrrhWfA+ECjK0QiIiLTnC2KAg/v8qyKHwJcD5wLnv3yoXgREZHDXEwUAQ/x8u2bzz//3FWJBeEWGSKVc+HD8CIiIvO4qCgCxBCiiAnZf16/LbQ9q0K0PbczFaYiIiLzubgoCty64SOPL1682N1WYxXJh3wvD23KQ9S0MW3N80O2s4iIyPFcTRQFJuh8G4dJm4eyWUnCEc5r4rr5DgGU9uNtMtqUh6hpS1eGRERETufqoqjD6/uZ1BFKTOy6+Q4BlPZDJImIiMgleHj4/wA5HgSB5exPdwAAAABJRU5ErkJggg==) + +Figure 3: Server-side data copy of an entire file + +###### Application queries the Copychunk Resume Key of the Source File + +The application provides a handle to the **Open** representing the source file. + +To request a Copychunk Resume Key for an open file, the client constructs an NT_TRANSACT_IOCTL FSCTL_SRV_REQUEST_RESUME_KEY request, as specified in section [2.2.7.2.1](#Section_2f8a9baed8c1462893daadba011e4f17). The Fid of the source file (**Open.FID**) is placed in the **FID** field of the client request along with the FSCTL_SRV_REQUEST_RESUME_KEY function code. No **NT_Trans_Data** block is required. The request is sent to the server and the server's response is processed as specified in section [3.2.5.9.1.1](#Section_6ac8b081122d458db07541d5cf452d5f). + +###### Application requests a Server-side Data Copy + +The application provides: + +- A handle to the **Open** representing the destination file. +- Copychunk Resume Key of the source file. +- List of source and destination offsets and the lengths of data blocks to copy from the source file. + +To request a server-side copy of a data range, the client constructs an NT_TRANSACT_IOCTL FSCTL_SRV_COPYCHUNK request, as specified in section [2.2.7.2.1](#Section_2f8a9baed8c1462893daadba011e4f17). The Fid of the destination file (**Open.FID**) is placed in the **FID** field of the request along with the FSCTL_SRV_COPYCHUNK function code. + +The NT_Trans_Data buffer of the request is constructed as follows: + +- **CopychunkResumeKey** is set to the application-provided resume key. +- **CopyChunkList** is set to a list of SRV_COPYCHUNK structures (section [2.2.7.2.1.1](#Section_e4e201827c714755b638bb75ff1c06ca)), where each structure is filled with the application-supplied source and destination offsets and the length of each data block. +- **ChunkCount** is set to the total number of the data blocks supplied by the application. + +The request is sent to the server and the server's response is processed as specified in section [3.2.5.9.1.2](#Section_b7ac17fe078a4a35b5bab527a9a9bcb9). + +#### Application Requests Querying of DFS Referral + +Processing of this event is handled as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.2.4.44.[<91>](#Appendix_A_91) + +#### Application Requests Querying User Quota Information + +The application MUST provide: + +- A valid **Open** to a file or directory on a share. The quota information on the object store that underlies the file or directory is the quota information to be queried. +- A buffer to receive the quota information and the maximum number of bytes to receive. +- **RestartScan:** A **BOOLEAN** that indicates whether or not a scan on the volume is to be restarted. +- **ReturnSingleEntry:** A **BOOLEAN**. If TRUE, then the server MUST return a single user quota information entry. +- A security identifier (SID) list, a start SID, or no SID. If the application provides both an SID list and a start SID, then the client MUST fail the request with STATUS_INVALID_PARAMETER. + +The client MUST construct an NT_TRANSACT_QUERY_QUOTA subcommand request, as specified in section [2.2.7.5.1](#Section_9f3f73f99c4a42ba9f56e6352491d714), with the following additional requirements: + +- **NT_Trans_Parameters.FID** MUST be set to the Fid of the application-supplied Open. +- **NT_Trans_Parameters.ReturnSingleEntry** MUST be set to the value of the application-supplied **ReturnSingleEntry** BOOLEAN. +- **NT_Trans_Parameters.RestartScan** MUST be set to the value of the application-supplied RestartScan BOOLEAN. +- The **NT_Trans_Data.SidList** field is set to either the application-supplied SID list or start **SID**. If neither were supplied, then this field is not included. +- The NT_Trans_Parameters fields of **SidListLength**, **StartSidLength**, and **StartSidOffset** MUST be set according to the following rules: + - If the application provides a SID list (a list of SIDs that represents users whose quota information is to be queried), then the client MUST set the **SidList** field of the request to this list and set **SidListLength** to the length of the list. In this case, **StartSidLength** and **StartSidOffset** MUST be zero. + - If the application provides a start SID (a single SID that indicates to the server where to start user quota information enumeration), then the client MUST set **StartSidLength** to the length of the SID and **StartSidOffset** to the offset in bytes of the **NT_Trans_Data.SidList** field relative to the start of the SMB header. In this case, **SidListLength** MUST be zero. + - If the application does not provide a SID list or a start SID, then **StartSidLength**, **StartSidOffset**, and **SidListLength** MUST be zero. If the application provides both a SID list and a start SID, then the client MUST fail the request and return the error code STATUS_INVALID_PARAMETER to the calling application. + +The request is sent to the server. + +#### Application Requests Setting User Quota Information + +The application MUST provide: + +- A valid Open to a file or directory on a share. The quota information of the object store that underlies the file or directory is the quota information to be modified. +- A list of the security identifiers (SIDs, representing users) and their associated quota information to be set. + +The client MUST construct an NT_TRANSACT_SET_QUOTA subcommand request, as specified in section [2.2.7.6.1](#Section_5172dc9ce7ad47fa86c0317b047a37eb), with the following additional parameters: + +- **NT_Trans_Parameters.FID** MUST be set to the Fid of the application-supplied Open. +- The application-supplied list of SIDs and associated user quota information MUST be set as the contents of the NT_Trans_Data block, as specified in section 2.2.7.6.1. + +The client sends the request to the server. + +#### Application Requests the Session Key for a Connection + +An application provides one of the following: + +- An **Open** to a file or pipe. + +OR + +- An SMB session that identifies an authenticated connection to the server. + +If an Open was supplied by the caller, then **Client.Open.Session** MUST be used. + +If a **Session** is found, but **Client.Session.AuthenticationState** is not _Valid_, then an implementation-specific error MUST be returned to the caller that indicates that the session key is not available. + +If a session is found and **Client.Session.AuthenticationState** is _Valid_, but **Client.Session.SessionKeyState** is _Unavailable_, then the request MUST be failed with STATUS_ACCESS_DENIED. + +If a session is found, **Client.Session.AuthenticationState** is _Valid_, and **Client.Session.SessionKeyState** is _Available_, then the first 16-bytes of **Client.Session.SessionKey** MUST be returned to the calling application. + +### Message Processing Events and Sequencing Rules + +#### Receiving Any Message + +In addition to the global processing rules for a client that receives any message, as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.2.5.1, the following processing rules apply to the extensions presented in this document. + +**Signing** + +If a message is received and Client.Connection.IsSigningActive is TRUE for the connection, the client uses **Client.Connection.ClientResponseSequenceNumber\[PID,MID\]** as the sequence number in signature verification, as specified in section [3.1.5.1](#Section_2fa60c5a71ee4248a4e9dd5d0db2373d). If signature verification fails, then the message MUST be discarded and not processed. The client SHOULD disconnect the underlying connection and tear down all states associated with this connection. If the message is an oplock break, the signature is never verified, as specified in \[MS-CIFS\] section 3.2.5.42. + +**Session Expiration and Re-authentication** + +If the request passed a valid authenticated session identifier in the **SMB_Header.UID** field and the status code in the SMB header of the response is STATUS_NETWORK_SESSION_EXPIRED, then the client MUST look up the **Client.Connection.SessionTable \[UID\]**, set **Client.Session.AuthenticationState** to Expired, and attempt to re-authenticate this session. Re-authentication follows the steps as specified in section [3.2.4.2.4](#Section_d3b7bcd3cd684d3b916b443ccd55f953), except that the UID sent in the SMB header of the SMB_COM_SESSION_SETUP_ANDX request MUST be set to the UID that represents the expired Session. Also, as described in section [3.2.5.3](#Section_56560c32b01d4ed6907c7ebdcf7eef57), the existing Client.Session.SessionKey MUST NOT be modified during re-authentication after a session expiry. + +If the authentication fails, then the resulting error code MUST be returned for whichever operation failed with STATUS_NETWORK_SESSION_EXPIRED and the session associated with this UID is removed from the **Client.Connection.SessionTable**. If authentication succeeds, then the client MUST set **Client.Session.AuthenticationState** to Valid and retry the operation that failed with STATUS_NETWORK_SESSION_EXPIRED. + +#### Receiving an SMB_COM_NEGOTIATE Response + +Processing of an [SMB_COM_NEGOTIATE response](#Section_d883d0a55a0a46268e3e87b0b66b79aa) is handled as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.2.5.2 with the following additions: + +Storing extended security token and ServerGUID + +If the capabilities returned in the SMB_COM_NEGOTIATE response include CAP_EXTENDED_SECURITY, then the response MUST take the form defined in section [2.2.4.5.2](#Section_8f8ce04ae1844d17bfb22cf762e6f6c4), and the client MUST set the **Client.Connection.GSSNegotiateToken** to the value returned in the **SecurityBlob** field in the SMB_COM_NEGOTIATE server response.[<92>](#Appendix_A_92) If **SecurityBlobLength** is 0, then client-initiated authentication, with an authentication protocol of the client's choice, will be used instead of server-initiated SPNEGO authentication as described in [\[MS-AUTHSOD\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-AUTHSOD%5d.pdf#Section_953d700a57cb4cf7b0c3a64f34581cc9) section 2.1.2.2. The client MUST also set the **Client.Connection.ServerGUID** to the value returned in the **ServerGUID** field in the SMB_COM_NEGOTIATE server response.[<93>](#Appendix_A_93) + +#### Receiving an SMB_COM_SESSION_SETUP_ANDX Response + +The processing of an [SMB_COM_SESSION_SETUP_ANDX response](#Section_e5a467bccd364afa825e3f2a7bfd6189) is handled as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.2.5.3 with the following additions: + +**Extended Security Authentication** + +If **Client.Connection.ServerCapabilities** has the CAP_EXTENDED_SECURITY bit set, then the client MUST reject any SMB_COM_SESSION_SETUP_ANDX responses that do not take the form specified in section 2.2.4.6.2. If the **Status** field of the SMB header is not STATUS_SUCCESS and is not STATUS_MORE_PROCESSING_REQUIRED, then the authentication has failed and the error code MUST be propagated back to the application that initiated the connection attempt. Otherwise, if there is no entry in **Client.Connection.SessionTable** for the UID in the response, then one MUST be created with the following additional requirements: + +- **Client.Session.SessionUID** MUST be set to the UID in the response. +- **Client.Session.AuthenticationState** MUST be set to InProgress. +- **Client.Session.UserCredentials** MUST be set to the authentication credentials of the user that initiated the authentication attempt. +- **Client.Session.SessionKey** MUST be set to zero. +- **Client.Session.SessionKeyState** MUST be set to Unavailable. + +The client MUST then process the GSS token (the **SecurityBlob** field of the response with its length given in the **SecurityBlobLength** field).[<94>](#Appendix_A_94) The client MUST use the configured GSS authentication protocol to obtain the next GSS token for the authentication exchange. Based on the status code received in the response and the result from the GSS authentication protocol, one of the following actions MUST be taken: + +- If the GSS authentication protocol indicates an error, then the error MUST be returned to the calling application that initiated the connection. +- If the **Status** field of the response contains STATUS_SUCCESS and the GSS authentication protocol does not indicate an error, then authentication is complete. The **Client.Session.AuthenticationState** MUST be set to Valid and the **Client.Session.SessionKey** MUST be set using the value queried from the GSS protocol. For information about how this is calculated for Kerberos authentication via Generic Security Service Application Programming Interface (GSS-API), see [\[MS-KILE\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-KILE%5d.pdf#Section_2a32282edd484ad9a542609804b02cc9). The client MUST set **Client.Session.SessionKeyState** to Available. +- If the **Status** field of the response contains STATUS_MORE_PROCESSING_REQUIRED and the GSS authentication protocol did not indicate an error, then the client MUST create an [SMB_COM_SESSION_SETUP_ANDX request (section 2.2.4.6.1)](#Section_a00d03613544484596ab309b4bb7705d) with the following parameters: + - The client MUST set CAP_EXTENDED_SECURITY in the **Capabilities** field and set SMB_FLAGS2_EXTENDED_SECURITY in the SMB header **Flags2** field. + - The **SecurityBlob** and **SecurityBlobLength** fields MUST be set to the output token and its length returned by the GSS protocol. + - The **SMB_Header.UID** field MUST be set to the value of the **SMB_Header.UID** field received in the SMB_COM_SESSION_SETUP_ANDX response. + - This message MUST be sent to the server, and further processing listed in the remainder of this section is not necessary. + +**NTLM Authentication** + +If the CAP_EXTENDED_SECURITY bit in **Client.Connection.ServerCapabilities** is not set, then the client processes the response.[<95>](#Appendix_A_95) If the **Status** field of the response does not contain STATUS_SUCCESS, then the client MUST propagate the error to the application that initiated the authentication. The connection MUST remain open for the client to attempt another authentication. + +If the **Status** field of the response contains STATUS_SUCCESS, then authentication was successful. The client associates the returned **SMB_Header.UID** of the response with this user for further requests, as specified in \[MS-CIFS\]. The **Client.Session.AuthenticationState** MUST be set to Valid. If the **Client.Session.SessionKey** is zero, then the client MUST query the authentication package for the 16-byte session key, as specified in [\[MS-NLMP\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-NLMP%5d.pdf#Section_b38c36ed28044868a9ff8dd3182128e4), and set **Client.Session.SessionKey** to the returned value. If **Client.Session.SessionKey** is non-zero, then the client MUST NOT overwrite the existing session key. The client MUST set **Client.Session.SessionKeyState** to Available. + +**Activating Signing** + +If authentication has completed successfully, **Client.Connection.IsSigningActive** is FALSE, and the targeted behavior for this connection is signed according to the description in section [3.2.4.2.3](#Section_bfdbfa0c46f64982bce161762f29f3a7), then the client MUST determine whether signing is required to be activated. + +To determine whether signing is required to be active, the user security context that completed authentication is verified. If the user that authenticated is a guest or is anonymous, then signing MUST NOT be activated. Guest authentication is indicated by bit zero in the **Action** field of the SMB_COM_SESSION_SETUP_ANDX response being set. Anonymous authentication is indicated by the fact that no credentials are provided. + +If neither of these conditions are true, then the client MUST activate signing as follows: + +- If CAP_EXTENDED_SECURITY is set in **Client.Connection.ServerCapabilities**, the client MUST use GSS-API to query the session key used in this authentication and store the ExportedSessionKey returned by GSS-API into **Client.Connection.SigningSessionKey**. The client MUST set **Client.Connection.SigningChallengeResponse** to NULL. +- If CAP_EXTENDED_SECURITY is not set in **Client.Connection.ServerCapabilities**, the client MUST use NTLM to query the session key used in this authentication. + - For NTLMv1 - the client MUST store SessionBaseKey, returned by the **NTOWFv1** function defined in \[MS-NLMP\] section 3.3.1, into **Client.Connection.SigningSessionKey**. + - For NTLMv2 - the client MUST store SessionBaseKey, returned by the **NTOWFv2** function defined in \[MS-NLMP\] section 3.3.2, into **Client.Connection.SigningSessionKey**. + +The client MUST set **Client.Connection.SigningChallengeResponse** to the challenge response that is sent in the SMB_COM_SESSION_SETUP_ANDX response. + +Once these steps are completed, the client MUST verify the signature of this response. The client follows the steps specified in section [3.1.5.1](#Section_2fa60c5a71ee4248a4e9dd5d0db2373d), by passing in a sequence number of one because this is the first signed packet. + +#### Receiving an SMB_COM_TREE_CONNECT_ANDX Response + +The processing of an [SMB_COM_TREE_CONNECT_ANDX Response](#Section_087860d5391941d5a7531b330d651196) is handled as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.2.5.4 with the following additions: + +**Requesting Extended Information** + +The client MUST determine whether or not the server returned an extended response, as specified in section [2.2.4.7](#Section_a5b03e8212aa4ebc93f348750299cdc9). The client does this by determining whether or not the **WordCount** is equal to 0x07. If it is, then the client MUST make the new extended information available to the calling application by using the **SMB_Header.TID** value to set **Client.Connection.TreeConnectTable\[TID\].MaximalShareAccessRights** and **Client.Connection.TreeConnectTable\[TID\].GuestMaximalShareAccessRights** to the values that are in the response fields of **SMB_Parameters.Words.MaximalShareAccessRights** and **SMB_Parameters.Words.GuestMaximalShareAccessRights**, respectively. + +**Session Key Protection** + +If the response status is STATUS_SUCCESS and the SMB_EXTENDED_SIGNATURE bit is set in the **OptionalSupport** field of the SMB_COM_TREE_CONNECT_ANDX response, then the client MUST hash the session key of the calling user. This protects the key that is used for signing by making it unavailable to the calling applications. + +The one-way hash MUST be performed on **Client.Session.SessionKey** that uses the HMAC-MD5 algorithm, as specified in [\[RFC2104\]](http://go.microsoft.com/fwlink/?LinkId=90314). The steps are as follows: + +- Take the 16-byte user session key from **Client.Session.SessionKey**. + - If this is an LM authentication where the session key is only 8 bytes, then zero extend it to 16 bytes. + - If the session key is more than 16 bytes, then use only the first 16 bytes. +- Calculate the one-way hash as follows: +- CALL hmac_md5( SSKeyHash, 256, session key, session key length, digest ) +- SET user session key = digest + +The resulting 16-byte digest is treated as the user's new session key and is returned to the caller who requests it. SSKeyHash is the well-known constant array that is described in section [2.2.2.5](#Section_f9972df714c845638ffc6c8b228862ef). + +After the session key has been hashed, the client MUST place the hash into **Client.Session.SessionKey** and set **Client.Session.SessionKeyState** to Available, which allows applications to query the session key. + +If the TREE_CONNECT_ANDX_EXTENDED_SIGNATURE bit is not set, then the **Client.Session.SessionKey** is not changed and **Client.Session.SessionKeyState** MUST be set to Available. + +#### Receiving an SMB_COM_NT_CREATE_ANDX Response + +The processing of an SMB_COM_NT_CREATE_ANDX response is handled as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.2.5.36 with the following additions: + +The client MUST determine whether the server returned an extended response, as specified in section [2.2.4.9.2](#Section_9e7d187492bd44098089ffc1a4a4d94e). It does this by checking for a proper **WordCount** value. If **WordCount** is not equal to 0x2A, then the client MUST process the response as specified in \[MS-CIFS\] section 3.2.5.36. Otherwise, the extended information that is specified in section 2.2.4.9.2 MUST also be propagated back to the calling application. + +#### Receiving an SMB_COM_OPEN_ANDX Response + +The processing of an SMB_COM_OPEN_ANDX response is handled as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.2.5.25 with the following additions: + +The client MUST determine whether or not the server returned an extended response, as specified in section [2.2.4.1.2](#Section_2e946bbf5e0f4521b68398a7a4801c3c). It does this by checking whether or not the **WordCount** is equal to 0x13. If the response is not an extended response, then the client MUST process the response as specified in \[MS-CIFS\] section 3.2.5.25. If the response is an extended response, then the new information specified in section 2.2.4.1.2 MUST be propagated back to the calling application. + +#### Receiving an SMB_COM_READ_ANDX Response + +The processing of an SMB_COM_READ_ANDX response is handled as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.2.5.26 with the following additions: + +The first two bytes of the **SMB_Parameters.Words.Reserved2\[\]** field, specified in \[MS-CIFS\] section 2.2.4.42.2, are interpreted as the 16-bit **DataLengthHigh** field (specified in section [2.2.4.2.2](#Section_54dd2a6b299c4c9b9f8871c5b0511f6e)). The remaining 8 bytes of **Reserved2\[\]** remain unused and MUST be ignored by the client. The **DataLengthHigh** field MUST contain the two most-significant bytes of a 32-bit length count of bytes read from the server. + +#### Receiving an SMB_COM_WRITE_ANDX Response + +The processing of an SMB_COM_WRITE_ANDX response is handled as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.2.5.27 with the following additions: + +The 16-bit **SMB_Parameters.Words.Reserved** field, specified in \[MS-CIFS\] section 2.2.4.43.2, is now interpreted as a 16-bit **CountHigh** field followed by an 8-bit **Reserved** field. The **CountHigh** field MUST contain the two most-significant bytes of a 32-bit count of bytes written by the server. + +#### Receiving any SMB_COM_NT_TRANSACT Response + +The processing of any SMB_COM_NT_TRANSACT response is handled as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.2.5.40. + +##### Receiving an NT_TRANSACT_IOCTL Response + +The processing of an NT_TRANSACT_IOCTL response is handled as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.2.5.40.2 with the following additions. + +###### Receiving an FSCTL_SRV_REQUEST_RESUME_KEY Function Code + +If the response indicates that an error occurred, then the client MUST propagate the error to the application that initiated the call. + +If the response indicates that the operation is successful, then the client MUST return the copychunk resume key that is received in the Data block of the response to the application that initiated the call. + +###### Receiving an FSCTL_SRV_COPYCHUNK Function Code + +The success or failure code MUST be returned to the calling application. The FSCTL_SRV_COPYCHUNK response (section [2.2.7.2.2](#Section_2564d6a8c1e24492bd7f7a1587c1becf)) MUST also be returned to the calling application in both success and failure situations. + +##### Receiving an NT_TRANSACT_QUERY_QUOTA Response + +If the response indicates an error occurred, then the client MUST propagate the error to the application that initiated the call. + +If the response indicates the operation is successful, then the client MUST return the information received in the Data block of the response to the application that initiated the call. + +##### Receiving an NT_TRANSACT_SET_QUOTA Response + +The client MUST propagate the success or failure code in the response to the application that initiated the call. + +#### Receiving an SMB_COM_SEARCH Response + +The processing of an SMB_COM_SEARCH response is handled as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.2.5.33. + +#### Receiving any SMB_COM_TRANSACTION2 subcommand Response + +Aside from the following subcommand responses, all other SMB_COM_TRANSACTION2 subcommand responses are handled as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.2.5.39. + +##### Receiving any TRANS2_SET_FS_INFORMATION Response + +The client MUST propagate the success or failure code in the response to the application that initiated the call. + +### Timer Events + +There are no new client timers other than those specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.2.6. + +### Other Local Events + +There are no new client local events other than those specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.2.7. + +## Server Details + +### Abstract Data Model + +This section specifies a conceptual model of possible data organization that an implementation maintains in order to participate in this protocol. The described organization is provided to explain how the protocol behaves. This document does not mandate that implementations adhere to this model as long as their external behavior is consistent with what is described in this document. + +The following elements extend the client abstract data model specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.3.1. + +#### Global + +**ServerStatistics**: Server statistical information. This contains all the members of the **STAT_SERVER_0** structure, as specified in [\[MS-SRVS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 2.2.4.39. + +**Server.MessageSigningPolicy**: This ADM element is extended from the specification in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.3.1.1 to include a new possible value: + +- Declined -- Message signing is disabled unless the other party requires it. If the other party requires message signing, then it MUST be used. Otherwise, message signing MUST NOT be used. + +**Server.SupportsExtendedSecurity**: A flag that indicates whether or not this node supports Generic Security Services (GSS), as specified in [\[RFC2743\]](http://go.microsoft.com/fwlink/?LinkId=90378), for selecting the authentication protocol. + +**Server.IsDfsCapable**: A Boolean that, if set, indicates that the server supports the Distributed File System. + +**Server.MaxCopyChunks**: The maximum number of chunks the server will accept in a server-side data copy operation. + +**Server.MaxCopyChunkSize**: The maximum number of bytes the server will accept in a single chunk for a server-side data copy operation. + +**Server.MaxTotalCopyChunkSize**: The maximum total number of bytes the server will accept for a server-side data copy operation. + +**Server.CopyChunkTimeOut**: The amount of time for which the server restricts the processing of a single server-side data copy operation. + +#### Per Share + +**Server.Share.ShareFlags** is a **DWORD** bitmask value that MUST contain zero or more of the values, as specified in [\[MS-SRVS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 2.2.2.5. + +**Server.Share.IsDfs**: A Boolean that, if set, indicates that this share is configured for DFS. For more information, see [\[MSDFS\]](http://go.microsoft.com/fwlink/?LinkId=89945). + +#### Per SMB Connection + +**Server.Connection.GSSNegotiateToken:** A byte array that contains the token received during an extended security negotiation and that is remembered for authentication. + +#### Per Pending SMB Command + +There is no new state introduced per pending SMB command. + +#### Per SMB Session + +**Server.Session.AuthenticationState:** A session can be in one of four states: + +- **InProgress**: A session setup (an extended SMB_COM_SESSION_SETUP_ANDX exchange, as described in section [3.2.4.2.4.1](#Section_495dd941077648aaaa8af1aa5eeadcea)) is in progress for this session for the first time. +- **Valid**: The session is valid and a session key and UID are available for this session. +- **Expired**: The Kerberos ticket for this session has expired and the session needs to be re-established. +- **ReauthInProgress**: A session setup (an extended SMB_COM_SESSION_SETUP_ANDX exchange, as described in section 3.2.4.2.4.1) is in progress for re-authentication of an expired or valid session. + +**Server.Session.SessionKeyState:** The session key state. This can be either Unavailable or Available. + +**Server.Session.AuthenticationExpirationTime**: A value that specifies the time at which the session will be expired. + +#### Per Tree Connect + +- **TreeConnect.MaximalAccess**: Access rights for the user that established the tree connect on **TreeConnect.Share**, in the format specified in section [2.2.1.4](#Section_6e848af95cb64e7383acb68698e3d920). + +#### Per Unique Open + +**Server.Open.GrantedAccess:** The access level granted on this Open. + +### Timers + +#### Authentication Expiration Timer + +The Authentication Expiration Timer, a re-authentication timer, is used to mark an authentication as expired when its authentication-specific expiration time is reached. This timer controls the periodic scheduling of searching for sessions that have passed their Authentication expiration time. The server SHOULD[<96>](#Appendix_A_96) schedule this timer such that sessions are expired in a timely manner. + +### Initialization + +The Authentication Expiration Timer, as specified in section [3.3.2.1](#Section_d3866f1fcada48848b68999ee2142568), MUST be started at system startup. The following values MUST be initialized at system startup: + +- **Server.MessageSigningPolicy** and **Server.SupportsExtendedSecurity** MUST be set based on system policy.[<97>](#Appendix_A_97) The value of this is not constrained by the values of any other policies. +- **Server.MaxCopyChunks** MUST be set to an implementation-specific[<98>](#Appendix_A_98) default value. +- **Server.MaxCopyChunkSize** MUST be set to an implementation-specific[<99>](#Appendix_A_99) default value. +- **Server.MaxTotalCopyChunkSize** MUST be set to an implementation-specific[<100>](#Appendix_A_100) default value. +- **Server.CopyChunkTimeOut** MUST be set to an implementation-specific[<101>](#Appendix_A_101) default value. + +When an SMB connection is established, the following values MUST be initialized. + +- **Server.Connection.GSSNegotiateToken** MUST be empty. + +When an SMB session is established on an SMB connection, the following value MUST be initialized: + +- **Server.Session.AuthenticationState** MUST be set to InProgress. +- **Server.Session.SessionKeyState** MUST be set to Unavailable. +- **Server.IsDFSCapable** MUST be set to FALSE. +- **Server.Share.IsDfs** MUST be set to FALSE. + +All other values are initialized as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.3.3. + +### Higher-Layer Triggered Events + +#### Sending Any Message + +This interface is used internally by the server to send a message to the client. It is not exposed to external callers. + +No new global details are presented to a server that sends any message beyond what is specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.3.4.1. + +##### Sending Any Error Response Message + +In response to an error in the processing of any SMB request, the server SHOULD[<102>](#Appendix_A_102) follow the format as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.3.4.1.2. + +#### Server Application Queries a User Session Key + +The application MUST provide: + +- The security context of the user whose session is being sought. +- Either a valid ClientName or a valid **Open**. + +The server MUST locate an SMB connection that uses either the application-supplied **ServerName** to look in the **Server.ConnectionTable\[ClientName\]** or the application-supplied **Open.Connection**. If a valid **Connection** is found, then the server MUST scan for an SMB session in the **Server.Connection.SessionTable** that matches the security context of the user. If no entry is found, then the application request MUST be failed with STATUS_INVALID_PARAMETER. If a **Session** is found but **Server.Session.SessionKeyState** is Unavailable, the request MUST be failed with STATUS_ACCESS_DENIED and **ServerStatistics.sts0_permerrors** MUST be increased by 1. If **Server.Session.SessionKeyState** is Available, then the first 16-bytes of **Server.Session.SessionKey** MUST be returned to the calling application. + +#### DFS Server Notifies SMB Server That DFS Is Active + +In response to this event, the SMB server MUST set the global state variable **Server.IsDfsCapable** to TRUE. If the DFS server is running on this computer, it MUST notify the SMB server that the DFS capability is available via this event. + +#### DFS Server Notifies SMB Server That a Share Is a DFS Share + +In response to this event, the SMB server MUST set the **Server.Share.IsDfs** to TRUE. When a DFS server running on this computer claims a share as a DFS share, it MUST notify the SMB server via this event. + +#### DFS Server Notifies SMB Server That a Share Is Not a DFS Share + +In response to this event, the SMB server MUST clear the Server.ShareIsDfs attribute of the share specified in section [3.3.1.2](#Section_04c81d07a5bb48b7a14f3e32ab5dcd27). + +#### Server Application Updates a Share + +The calling application MUST provide a share in the SHARE_INFO_503_I and SHARE_INFO_1005 structures as input parameters to update an existing share. The server MUST look up the share in **Server.ShareTable** through the tuple <shi503_servername, shi503_netname>. If the matching share is found, the server MUST update the share as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.3.4.10 with the following values set; otherwise, the server MUST return an implementation-dependent error. + +- **Share.FileSecurity** MUST be set to shi503_security_descriptor. +- **Share.ShareFlags** MUST be set to shi1005_flags. + +#### Server Application Requests Querying a Share + +The calling application MUST provide the tuple <ServerName, ShareName> of the share that is being queried. The server MUST look up the share in the **Server.ShareTable**. If the matching share is found, the server MUST return a share in the SHARE_INFO_503_I and SHARE_INFO_1005 structures to the caller as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.3.4.12 with the following values set; otherwise, the server MUST return an implementation-dependent error. + +| Output Parameters | MS-SMB Share Properties | +| ------------------------------------------- | ----------------------------- | +| SHARE_INFO_503_I.shi503_security_descriptor | **Server.Share.FileSecurity** | +| SHARE_INFO_1005.shi1005_flags | **Server.Share.ShareFlags** | + +### Message Processing Events and Sequencing Rules + +#### Receiving Any Message + +The following global details are presented to a server that receives any message in addition to what is specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.3.5.2. + +**Signing** + +If a message is received and **Server.Connection.IsSigningActive** is TRUE the server uses **Server.Connection.ServerNextReceiveSequenceNumber** and the signature MUST be verified, as specified in section [3.1.5.1](#Section_2fa60c5a71ee4248a4e9dd5d0db2373d). + +The server MUST insert the sequence number for the response to this request into the **Server.Connection.ServerSendSequenceNumber** table with the **PID** and **MID** that identifies the request/response pair. (**PID** and **MID** are specified in \[MS-CIFS\] section 2.2.1.6.) + +If the signature on the received packet is incorrect, then the server MUST return STATUS_ACCESS_DENIED (ERRDOS/ERRnoaccess) and **ServerStatistics.sts0_permerrors** MUST be increased by 1. If the signature on the current message is correct, then the server MUST take the following steps. + +- IF request command EQUALS SMB_COM_NT_CANCEL THEN +- INCREMENT ServerNextReceiveSequenceNumber +- ELSE IF request has no response THEN +- INCREMENT ServerNextReceiveSequenceNumber BY 2 +- ELSE +- SET ServerSendSequenceNumber\[PID,MID\] TO +- ServerNextReceiveSequenceNumber + 1 +- INCREMENT ServerNextReceiveSequenceNumber BY 2 +- END IF + +**Session Validation and Re-authentication** + +If the **SMB_Header.UID** of the request is zero, then the server does not need to check for the expiry because a session is not being used for this request. + +If the **SMB_Header.UID** of the request is not zero, then the server MUST check the state of the session. + +- If **Connection.SessionTable\[UID\].AuthenticationState** is equal to Expired or ReauthInProgress, and the received message is an SMB_COM_SESSION_SETUP_ANDX request (indicating a session renewal), the behavior is as specified in section [3.3.5.3](#Section_1f152df0a61d4e769af6da96fa783c02). For details on how the client handles a session expiration, see section [3.2.5.1](#Section_33cc843042ca4f05af296485c3560daf). +- If **Connection.SessionTable\[UID\].AuthenticationState** is equal to Expired or ReauthInProgress, and the received message is one of the following requests, the server MUST continue processing the request. + - SMB_COM_CLOSE + - SMB_COM_LOGOFF_ANDX + - SMB_COM_FLUSH + - SMB_COM_LOCKING_ANDX + - SMB_COM_TREE_DISCONNECT + +If the received message is not one of the preceding requests, the server SHOULD[<103>](#Appendix_A_103) fail all operations with STATUS_NETWORK_SESSION_EXPIRED until the session renewal is successful. + +- If **Server.Connection.SessionTable** is not empty, **Server.Connection.SessionTable\[UID\].AuthenticationState** is InProgress, and the received message is not an SMB_COM_SESSION_SETUP_ANDX request, then the server SHOULD[<104>](#Appendix_A_104) fail all operations with STATUS_INVALID_HANDLE and MUST increase **ServerStatistics.sts0_permerrors** by 1. +- If **Server.Connection.SessionTable** is not empty, **SMB_Header.UID** is not found in **Server.Connection.SessionTable**, and the received message is not an SMB_COM_SESSION_SETUP_ANDX request, then the server MUST fail all operations with STATUS_SMB_BAD_UID and MUST increase **ServerStatistics.sts0_permerrors** by 1. +- If **Server.Connection.SessionTable** is empty, then the server SHOULD[<105>](#Appendix_A_105) disconnect the connection. +- If **Server.Connection.SessionTable\[UID\].AuthenticationState** is InProgress and the received message is an SMB_COM_SESSION_SETUP_ANDX request, the behavior is as specified in section 3.3.5.3. +- If **Server.Connection.SessionTable\[UID\].AuthenticationState** is Valid, then the server MUST allow all operations. + +##### Scanning a Path for a Previous Version Token + +If a request is a path-based operation (for example, SMB_COM_NT_CREATE_ANDX) and has SMB_FLAGS2_REPARSE_PATH set in the **Flag2** field of the SMB header, then the server MUST perform a parse of the path by checking for previous version tokens (section [2.2.1.1.1](#Section_bffc70f9b16a453b939a0b6d3c9263af)). If the flag is not set, then the server MAY[<106>](#Appendix_A_106) parse the path anyway. + +If a previous version token is found in the pathname, but the file or directory does not exist for the given snapshot, then the server MUST fail the operation with STATUS_OBJECT_NAME_NOT_FOUND. If the file or directory does exist, then processing continues as normal, except that the execution is against the previous version selected. + +If no previous version token is found in the pathname, the server MUST process the path-based operation normally. + +##### Granting Oplocks + +The server SHOULD grant oplocks according to the process specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.3.5.2.7, with the following additions: + +- If **Server.Share.ShareFlags** contains the SHI1005_FLAGS_FORCE_LEVELII_OPLOCK bit as defined in [\[MS-SRVS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-SRVS%5d.pdf#Section_accf23b00f57441c918543041f1b0ee9) section 2.2.4.29, and the request is for NT_CREATE_REQUEST_OPLOCK or NT_CREATE_REQUEST_OPBATCH oplock, the server SHOULD[<107>](#Appendix_A_107) downgrade the request and grant a level II oplock. + +#### Receiving an SMB_COM_NEGOTIATE Request + +The processing of an [SMB_COM_NEGOTIATE request](#Section_7991af9adc99437cbaf8a3b4ca56b151) is handled as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.3.5.42, with the following additions: + +**New Capabilities** + +The new capabilities flags specified in section 2.2.4.5.1 MUST also be considered when setting the **SMB_Parameters.Words.Capabilities** field of the response based on the **Server.Capabilities** attribute. + +**Generating Extended Security Token** + +If the client indicated support for extended security by setting SMB_FLAGS2_EXTENDED_SECURITY in the Flags2 field of the SMB header of the SMB_COM_NEGOTIATE request, then the server SHOULD set CAP_EXTENDED_SECURITY in the SMB_COM_NEGOTIATE response if it supports extended security. The response MUST take the form specified in section [2.2.4.5.2](#Section_8f8ce04ae1844d17bfb22cf762e6f6c4). + +The server SHOULD set the **SecurityBlob** of the SMB_COM_NEGOTIATE response to the first GSS token (or fragment thereof) produced by the GSS authentication protocol it is configured to use (GSS tokens are as specified in [\[RFC2743\]](http://go.microsoft.com/fwlink/?LinkId=90378)). Otherwise, it leaves it empty. This token is also stored in **Server.Connection.GSSNegotiateToken**. + +The server MUST initialize its GSS mechanism with the Integrity, Confidentiality, and Delegate options and use the Server-Initiated variation, as specified in [\[RFC4178\]](http://go.microsoft.com/fwlink/?LinkId=90461). The SMB_COM_NEGOTIATE response packet is sent to the client.[<108>](#Appendix_A_108) + +#### Receiving an SMB_COM_SESSION_SETUP_ANDX Request + +The processing of an [SMB_COM_SESSION_SETUP_ANDX request](#Section_a00d03613544484596ab309b4bb7705d) is handled as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.3.5.43 with the following additions:[<109>](#Appendix_A_109) + +**Storing Client Capabilities** + +If **Server.Connection.ClientCapabilities** is equal to zero, then the server MUST set **Server.Connection.ClientCapabilities** to the **Capabilities** field that is received in the SMB_COM_SESSION_SETUP_ANDX request. If **Server.Connection.ClientCapabilities** has already been determined and is nonzero, then the server MUST ignore the capabilities value on subsequent requests. + +**Determine Reauth or Continuation of Previous Auth** + +If the **SMB_Header.UID** is not zero, the server MUST obtain the user name: + +- If **Server.Connection.SessionTable\[UID\].UserSecurityContext** is NULL, the server MUST set it to a value representing the user that successfully authenticated this connection. The **UserSecurityContext** MUST be obtained from the GSS authentication subsystem. If it is not NULL, no changes are necessary. +- The server MUST invoke the GSS_Inquire_context call as specified in [\[RFC2743\]](http://go.microsoft.com/fwlink/?LinkId=90378) section 2.2.6, passing **Server.Connection.SessionTable\[UID\].UserSecurityContext** as the input parameter, and obtain the user name returned in "src \_name". + +If the received user name is not equal to **Server.Connection.SessionTable\[UID\].UserName**, the server MAY fail the session setup and tear down the underlying transport connection. + +Otherwise, the server MUST look up the authentication state for this session and take the following actions based on this state. + +- If **Server.Connection.SessionTable\[UID\].AuthenticationState** is InProgress or ReAuthInProgress, then this is a continuation of an authentication in progress. This state indicates that the authentication required multiple roundtrips, and that authentication continues. +- If **Server.Connection.SessionTable\[UID\].AuthenticationState** is Valid or Expired, then this is the re-authentication of a user. The server MUST set AuthenticationState to ReAuthInProgress and begin a new authentication for this session. The server MUST prevent any further operations from executing on this session until authentication is complete, and fail them with STATUS_NETWORK_SESSION_EXPIRED. +- If there is no session for the provided UID, then the request MUST be failed with STATUS_SMB_BAD_UID. + +**Extended Security** + +If CAP_EXTENDED_SECURITY is set in **Server.Connection.ClientCapabilities**, then the server MUST handle the authentication as defined in this section. Otherwise, it MUST continue to the following NTLM authentication section. + +The server MUST extract the GSS token, which is the **SecurityBlob** contained in the request, with a length of **SecurityBlobLength**.[<110>](#Appendix_A_110) The server MUST use the configured GSS authentication protocol to obtain the next GSS output token for the authentication protocol exchange. Note that this token can be 0 bytes in length. + +If the GSS mechanism indicates an error that is not STATUS_MORE_PROCESSING_REQUIRED, then the server MUST fail the client request, and return only an SMB header and propagate the failure code. If a **UID** was present in this request, then its associated session MUST be removed from the **Server.Connection.SessionTable**. The authentication has failed and no further processing is done on this request. This error response is sent to the client. + +If the GSS mechanism indicates success, then the server MUST create an [SMB_COM_SESSION_SETUP_ANDX response (section 2.2.4.6.2)](#Section_e5a467bccd364afa825e3f2a7bfd6189). The **SecurityBlob** MUST be set to the output token from the GSS mechanism, and **SecurityBlobLength** is set to the length of the output token. SMB_FLAGS2_EXTENDED_SECURITY is set in the **Flags2** field of the SMB header of the response. If the request did not specify a **UID** in the SMB header of the request, then a **UID** MUST be generated to represent this user's authentication and its value MUST be placed in the **UID** field of the SMB header of the response. + +If the GSS mechanism indicates that the current output token is the last output token of the authentication exchange based on the return code, as specified in \[RFC2743\], the **Status** field in the SMB header of the response MUST be set to STATUS_SUCCESS, and **Server.Connection.SessionTable\[UID\].AuthenticationState** MUST be set to Valid. If the client sets the CAP_DYNAMIC_REAUTH capability in the request or the Kerberos authentication protocol enforces session re-authentication, **Server.Session.AuthenticationExpirationTime** SHOULD[<111>](#Appendix_A_111) be set to the authentication (either NTLM or GSS processing) expiration time returned by the GSS authentication protocol, such as a Kerberos ticket time-out. If this is not the case, **Server.Session.AuthenticationExpirationTime** SHOULD be set to infinity. + +Otherwise, the **Status** field in the SMB header of the response MUST be set to STATUS_MORE_PROCESSING_REQUIRED, and **Server.Connection.SessionTable\[UID\].AuthenticationState** MUST be set to InProgress. + +**Activating Signing** + +If **Server.Connection.IsSigningActive** is FALSE, and the response of the SMB_COM_SESSION_SETUP_ANDX operation contains STATUS_SUCCESS, then the server MUST determine whether or not signing can be activated. + +If bit zero of the **Action** field of the SMB_COM_SESSION_SETUP_ANDX response is set, then signing MUST NOT be activated. If the value of this field is one, then the user attempted to log in as a user other than Guest, but could not be authenticated for that account. Using a fallback mechanism on the server, the user is now logged in as Guest. + +Otherwise, **Server.Connection.IsSigningActive** MUST be set to TRUE if any of the following conditions are satisfied: + +- **Server.MessageSigningPolicy** is Required. +- The SMB_FLAGS2_SMB_SECURITY_SIGNATURE_REQUIRED bit in the **Flags2** field of the SMB header of the request is set. +- **Server.MessageSigningPolicy** is Enabled and the SMB_FLAGS2_SMB_SECURITY_SIGNATURE bit in the **Flags2** field of the SMB header of the request is set. + +The server MUST query the authentication protocol, either using NTLM or via GSS API, for the session key used in this authentication, and store it as **Server.Connection.SigningSessionKey**. If CAP_EXTENDED_SECURITY is set in **Server.Connection.ClientCapabilities**, then it MUST set **Server.Connection.SigningChallengeResponse** to NULL. If that capability is not set, then it MUST set **Server.Connection.SigningChallengeResponse** to the challenge response received in the SMB_COM_SESSION_SETUP_ANDX request. + +Once these steps are performed, the server MUST sign the SMB_COM_SESSION_SETUP_ANDX response. The server follows the steps as specified in section [3.1.5](#Section_a07570c4cf07416597c8205fbf1b0fb0) by passing in a sequence number of one. + +**Acquire Session Key** + +If authentication is successful, the server MUST query the session key from the authentication package (as specified in [\[MS-NLMP\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-NLMP%5d.pdf#Section_b38c36ed28044868a9ff8dd3182128e4) for implicit NTLM and in [\[RFC4178\]](http://go.microsoft.com/fwlink/?LinkId=90461) for extended security). If the session key is equal to or longer than 16 bytes, the session key MUST be stored in **Server.Session.SessionKey**. Otherwise, the session key MUST be stored in **Server.Session.SessionKey** and MUST be padded with zeros up to 16 bytes. The server MUST set **Server.Session.SessionKeyState** to Unavailable. + +**Authentication Expiry** + +If **Server.Session.AuthenticationExpirationTime** expires, the Authentication Expiration Timer marks the **Server.Connection.SessionTable\[UID\].AuthenticationState** as Expired when the time-out occurs, as specified in [3.3.2.1](#Section_d3866f1fcada48848b68999ee2142568). + +#### Receiving an SMB_COM_TREE_CONNECT_ANDX Request + +The processing of an [SMB_COM_TREE_CONNECT_ANDX request](#Section_16b173568eff49c29d21557e07ef085d) is handled as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.3.5.45 with the following additions:[<112>](#Appendix_A_112) + +**Requesting Extended Information** + +If the TREE_CONNECT_ANDX_EXTENDED_RESPONSE is set in the **Flags** field of the SMB_COM_TREE_CONNECT_ANDX request, then the server MUST respond with the structure specified in section [2.2.4.7.2](#Section_087860d5391941d5a7531b330d651196). + +The server MUST populate the **SMB_Parameters.Words.OptionalSupport** field of the response with a value of **Server.Share.OptionalSupport**. + +The server SHOULD[<113>](#Appendix_A_113) set SMB_UNIQUE_FILE_NAME bit in the **OptionalSupport** field if **Share.ShareFlags** contains the SHI1005_FLAGS_ALLOW_NAMESPACE_CACHING constant. + +The server MUST calculate the maximal share access rights for the user that requests the tree connect using the following algorithm. + +- MaxRights = 0x00000000 +- IF Server.Share.FileSecurity == NULL +- MaxRights = 0xFFFFFFFF +- ELSE +- FOR EACH AccessBit value defined in section 2.2.1.4 +- Compute access for the user, using Server.Share.FileSecurity and +- Server.Session.SecurityContext, as described in \[MS-DTYP\] section 2.5.2.1. +- IF access was granted +- MaxRights = MaxRights | AccessBit; +- END IF +- END FOR +- END IF + +The computed MaxRights ACCESS_MASK MUST be placed in the **SMB_Parameters.Words.MaximalShareAccessRights** of the response. The server MUST set **TreeConnect.MaximalAccess** to **MaximalShareAccessRights**. If no access is granted for the client on this share, the server MUST fail the request with STATUS_ACCESS_DENIED and MUST increase **ServerStatistics.sts0_permerrors** by 1. + +Using the same algorithm, the **SMB_Parameters.Words.GuestMaximalAccessRights** field of the response SHOULD[<114>](#Appendix_A_114) be set to the calculated highest access rights the guest account has on this share. Instead of using **Server.Session.SecurityContext**, the server MUST use the guest account's security context. If the system does not support the guest account, then it MUST set **GuestMaximalAccessRights** to zero. + +**Session Key Protection** + +If the client has set the TREE_CONNECT_ANDX_EXTENDED_SIGNATURE bit in the **Flags** field of the SMB_COM_TREE_CONNECT_ANDX request, then the server MUST hash the session key of the calling user. This protects the key used for signing by making it unavailable to server-side applications. + +The one-way hash MUST be performed on the user session key by using the HMAC-MD5 algorithm, as specified in [\[RFC2104\]](http://go.microsoft.com/fwlink/?LinkId=90314). The steps are as follows: + +- Take the 16-byte user session key from **Server.Session.SessionKey**. + - If this is an LM authentication where the session key is only 8 bytes, then zero extend it to 16 bytes. + - If the session key is more than 16 bytes, then use only the first 16 bytes. +- Calculate the one-way hash as follows: +- CALL hmac_md5( SSKeyHash, 256, session key, session key length, digest ) +- SET user session key = digest + +The resulting 16-byte digest is treated as the user's new session key and returned to the caller who requests it. SSKeyHash is the well-known constant array that is described in section [2.2.2.5](#Section_f9972df714c845638ffc6c8b228862ef). + +After the session key has been hashed, the server MUST place the hash into **Server.Session.SessionKey** and set **Server.Session.SessionKeyState** to Available, which allows applications to query the session key. If the TREE_CONNECT_ANDX_EXTENDED_SIGNATURE bit is not set, then the **Server.Session.SessionKey** is not changed and **Server.Session.SessionKeyState** MUST be set to Available. + +#### Receiving an SMB_COM_NT_CREATE_ANDX Request + +The processing of an SMB_COM_NT_CREATE_ANDX request is handled as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.3.5.51 with the following additions: + +The **ImpersonationLevel** in the request MUST have one of the values specified in section [2.2.4.9.1](#Section_8e14ed93f27544d1bc46dfaf296c91b1). Otherwise, the server MUST fail the request with STATUS_BAD_IMPERSONATION_LEVEL. + +When opening a named pipe, if the **ImpersonationLevel** level is SECURITY_DELEGATION, the server MUST fail the request with STATUS_BAD_IMPERSONATION_LEVEL. + +If during the open processing the underlying object store returns STATUS_ACCESS_DENIED as specified in [\[MS-FSA\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-FSA%5d.pdf#Section_860b1516c45247b4bdbc625d344e2041) section 2.1.5.1, Server Requests an Open of a File, the server MUST fail the request with STATUS_ACCESS_DENIED and MUST increase **ServerStatistics.sts0_permerrors** by 1. + +If the underlying object store determines that encryption processing is required as specified in \[MS-FSA\] section 2.1.5.1 Server Requests an Open of a File, the object store MUST return STATUS_CS_ENCRYPTION_EXISTING_ENCRYPTED_FILE if the encrypted file exists or STATUS_CS_ENCRYPTION_NEW_ENCRYPTED_FILE if the file to be created will be encrypted, indicating that a UserCertificate is necessary to successfully complete the operation. In these cases, the server SHOULD attempt to obtain a user certificate by invoking the **Application Requests for a User-Certificate Binding** as specified in [\[MS-EFSR\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-EFSR%5d.pdf#Section_08796ba801c8487292211000ec2eff31) section 3.1.4.1, passing the **Server.Session.SecurityContext** as the security context of the user. If the enrollment fails, the server MUST fail the request with the resulting error. Otherwise, the server SHOULD repeat the handling as specified in \[MS-CIFS\] section 3.3.5.51, extended[<115>](#Appendix_A_115) to additionally pass the returned certificate to the object store as the **UserCertificate** argument. + +If FILE_DELETE_ON_CLOSE is set in the **CreateOptions** field and any of the following conditions is TRUE, the server SHOULD[<116>](#Appendix_A_116) fail the request with STATUS_ACCESS_DENIED. + +- **DesiredAccess** does not include DELETE or GENERIC_ALL. +- **Treeconnect.MaximalAccess** does not include DELETE or GENERIC_ALL. + +The server MUST ignore all **CreateOptions** on a named pipe except FILE_WRITE_THROUGH, FILE_SYNCHRONOUS_IO_ALERT, and FILE_SYNCHRONOUS_IO_NONALERT. + +For a named pipe request, if the client sets FILE_SYNCHRONOUS_IO_ALERT or FILE_SYNCHRONOUS_IO_NONALERT bits in the **CreateOptions** field and does not set the SYNCHRONIZE bit in the **DesiredAccess** field, the server MUST fail the **Open** request with STATUS_INVALID_PARAMETER. + +On a successful create or open, if the NT_CREATE_REQUEST_EXTENDED_RESPONSE flag was set in the **Flags** field of the request, the server SHOULD[<117>](#Appendix_A_117) send an extended response (section [2.2.4.9.2](#Section_9e7d187492bd44098089ffc1a4a4d94e)). + +If the server sends the new response, it MUST construct a response as specified in section 2.2.4.9.2, with the addition of the following rules: + +- The server MUST query the underlying object store for file attributes and SHOULD[<118>](#Appendix_A_118) set the **FileStatusFlags** in the response, in an implementation-specific manner. +- If the underlying object store of the share in which the file is opened or created does not support streams, then the server MUST set the NO_SUBSTREAMS bit in the **FileStatusFlags** field.[<119>](#Appendix_A_119) +- The server SHOULD[<120>](#Appendix_A_120) set the **VolumeGUID** and **FileId** fields to zero. +- The server MUST query the underlying object store for the granted access rights on the returned **Server.Open**. The server MUST use the granted access rights and SHOULD[<121>](#Appendix_A_121) set the **MaximalAccessRights** and **GuestMaximalAccessRights** fields in an implementation-specific manner. If the file has no security applied, **MaximalAccessRights** MUST be set to 0xFFFFFFFF. The server MUST use **Open.Session.UserSecurityContext** to impersonate the client. + +If **Server.IsDfsCapable** is TRUE and **Server.Share.IsDfs** is True, then server MUST invoke the interface defined in [\[MS-DFSC\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-DFSC%5d.pdf#Section_3109f4be2dbb42c99b8e0b34f7a2135e) section 3.2.4.1 to normalize the pathname by supplying **FileName** as the input parameter. If normalization fails, the server MUST fail the create request with the error code returned by the DFS normalization routine. If the normalization procedure succeeds, returning an altered target name, the **FileName** field MUST be set to the normalized path name, and used for further operations specified in section in \[MS-CIFS\] section 3.3.5.51. + +#### Receiving an SMB_COM_OPEN_ANDX Request + +The processing of an SMB_COM_OPEN_ANDX request is handled as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.3.5.35 with the following additions: + +If during the open processing the underlying object store returns STATUS_ACCESS_DENIED as specified in [\[MS-FSA\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-FSA%5d.pdf#Section_860b1516c45247b4bdbc625d344e2041) section 2.1.5.1.2, Server Requests an Open of an Existing File, the server MUST fail the request with STATUS_ACCESS_DENIED and MUST increase **ServerStatistics.sts0_permerrors** by 1. + +If the underlying object store determines that encryption processing is required as specified in \[MS-FSA\] section 2.1.5.1.2 Open of an Existing File, the object store MUST return STATUS_CS_ENCRYPTION_EXISTING_ENCRYPTED_FILE, indicating that a UserCertificate is necessary to successfully complete the operation. In this case, the server SHOULD attempt to obtain a user certificate by invoking the **Application Requests for a User-Certificate Binding** as specified in [\[MS-EFSR\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-EFSR%5d.pdf#Section_08796ba801c8487292211000ec2eff31) section 3.1.4.1, passing the **Server.Session.SecurityContext** as the security context of the user. If the enrollment fails, the server MUST fail the request with the resulting error. Otherwise, the server SHOULD repeat the handling as specified in \[MS-CIFS\] section 3.3.5.35, extended [<122>](#Appendix_A_122) to additionally pass the returned certificate to the object store as the **UserCertificate** argument. + +On a successful open, if the SMB_OPEN_EXTENDED_RESPONSE flag was set in the **Flags** field of the request, then the server SHOULD send an extended response, as specified in section [2.2.4.1.2](#Section_2e946bbf5e0f4521b68398a7a4801c3c). + +If the server chooses to send the new response, then it MUST construct a response as detailed in section 2.2.4.1.2. The server MUST query the underlying object store for the granted access rights on the returned **Server.Open**. The server MUST use the granted access rights and SHOULD[<123>](#Appendix_A_123) set the **MaximalAccessRights** and **GuestMaximalAccessRights** fields in an implementation-specific manner. If the file has no security applied, **MaximalAccessRights** MUST be set to 0xFFFFFFFF. If no access is granted for the client on this share, the server MUST fail the request with STATUS_ACCESS_DENIED and MUST increase **ServerStatistics.sts0_permerrors** by 1. + +#### Receiving an SMB_COM_READ_ANDX Request + +The processing of an SMB_COM_READ_ANDX request is handled as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.3.5.36 with the following additions:[<124>](#Appendix_A_124) + +If the read operation is on a named pipe, then the **Timeout_or_MaxCountHigh** field MUST be interpreted as the 32-bit **Timeout** field, as specified in section [2.2.4.2.1](#Section_df9244e87b2d4714a3836990589a8ff4). + +If the read operation is on a file, then the **Timeout_or_MaxCountHigh** field MUST be interpreted as the 16-bit **MaxCountHigh** field followed by a 16-bit **Reserved** field, as specified in section 2.2.4.2.1. The value in **MaxCountHigh** MUST be treated as the two most significant bytes of the count of bytes to read and is combined with the value of **MaxCountOfBytesToReturn** to create a 32-bit count of bytes to read (as specified in section [3.2.4.4](#Section_ce5b3e8052904fde92e71f1f846adacb)). If **MaxCountHigh** is set to 0xFFFF, then the value MUST be ignored, and only the length received in **MaxCountOfBytesToReturn** is used. + +It is acceptable to return fewer bytes than requested by the client, with the restriction that reads from named pipes or devices MUST return at least **MinCountOfBytesToReturn** bytes. If the read operation is on a file and the count of bytes to read is greater than or equal to 0x00010000 (64K), then the server MAY[<125>](#Appendix_A_125)Return the requested number of bytes in the response, set the two least significant bytes of the count in the **DataLength** field in the response, and the two most significant bytes of the count in the **DataLengthHigh** field (specified in section [2.2.4.2.2](#Section_54dd2a6b299c4c9b9f8871c5b0511f6e)). + +#### Receiving an SMB_COM_WRITE_ANDX Request + +The processing of an SMB_COM_WRITE_ANDX request is handled as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.3.5.37 with the following additions: + +If CAP_LARGE_WRITEX is set in **Server.Connection.ClientCapabilities**, then it is possible that the count of bytes to be written is larger than the server's **MaxBufferSize**. The count of bytes to be written is specified in the **DataLength** and **DataLengthHigh** fields sent in the request, as specified in section [2.2.4.3.1](#Section_178be656705649ea8bcbcf123737b016). If the size of **SMB_Data.Bytes.Data** is not equal to (**DataLength** | **DataLengthHigh** <<16), the server SHOULD[<126>](#Appendix_A_126) fail the request and return ERRSRV/ERRerror. + +If the server successfully writes data to the underlying object store, then the count of bytes written MUST be set in the **Count** and **CountHigh** fields of the response, as specified in section [2.2.4.3.2](#Section_056d7d3304574f9ab7e0ab983ce24ae4). + +#### Receiving an SMB_COM_SEARCH Request + +The processing of an SMB_COM_SEARCH request is handled as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.3.5.47, with the following additions: + +If the **FileName** field in the request is an empty string, the server SHOULD[<127>](#Appendix_A_127) return the root directory information in the response. + +#### Receiving any SMB_COM_TRANSACTION2 subcommand + +The processing of any SMB_COM_TRANSACTION2 subcommand request is handled as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.3.5.58 with the following additions: + +##### Receiving any Information Level + +If the server receives client request with a pass-through Information Level (section [2.2.2.3.5](#Section_ab2aca376c9e4505baa99e2bc556c475)) and the server supports the CAP_INFOLEVEL_PASSTHRU capability in **Server.Capabilities**, then the server MUST decrement the Information Level value by SMB_INFO_PASSTHROUGH by treating the value as little-endian, and pass that value to the underlying object store. If the Information Level includes any request data, then the data MUST also be passed to the underlying object store.[<128>](#Appendix_A_128) + +If the server does not support pass-through Information Levels, then it MUST fail this request with STATUS_INVALID_PARAMETER. + +The returned status and response data, if any, are sent to the client in a Trans2 subcommand response message that corresponds to the same subcommand that initiated the request. + +##### Receiving a TRANS2_FIND_FIRST2 Request + +**New Information Levels** + +The server SHOULD allow for the new Information Levels, as specified in section [2.2.2.3.1](#Section_34b83ded0f52406f887a83fe89f33e23). If the server does not support the new Information Levels, then it MUST fail the operation with STATUS_NOT_SUPPORTED.[<129>](#Appendix_A_129) + +**Enumerating Previous Versions** + +If a scan for previous version tokens (section [3.3.5.1.1](#Section_c2e66005cfe54ddbb5064887ee52c1c5)) reveals that the **FileName** of the TRANS_FIND_FIRST2 request contains the search pattern @GMT-\* and the requested Information Level is SMB_FIND_FILE_BOTH_DIRECTORY_INFO, then the server MAY[<130>](#Appendix_A_130) choose to return an enumeration of previous versions that are valid for the share. It does this by manufacturing a file entry for each previous version, as defined in section [2.2.8.1.1](#Section_03d05a6fbbaf4a9ea556036581b02737). If the server chooses not to do this, then the enumeration MUST be processed as a normal TRANS2_FIND_FIRST2 operation. + +##### Receiving a TRANS2_FIND_NEXT2 Request + +**New Information Levels** + +If the query is started using one of the new Information Levels, as specified in section [2.2.2.3.1](#Section_34b83ded0f52406f887a83fe89f33e23), then the same Information Level structure MUST be used for the return of subsequent entries in the enumeration continuation. + +**Enumerating Previous Versions** + +Likewise, a query for previous version information that is started MUST be continued at the client's request with further entries generated, as defined in section [3.3.5.10.1](#Section_ed7e027124ee46eda08b3e1335b3c0ee). + +##### Receiving a TRANS2_QUERY_FILE_INFORMATION Request + +**Pass-through Information Levels** + +If the client requests a pass-through Information Level, then the processing follows as specified in section [3.3.5.10.1](#Section_ed7e027124ee46eda08b3e1335b3c0ee). + +##### Receiving a TRANS2_QUERY_PATH_INFORMATION Request + +**Pass-through Information Levels** + +If the client requests a pass-through Information Level, then the processing follows as specified in section [3.3.5.10.1](#Section_ed7e027124ee46eda08b3e1335b3c0ee). + +##### Receiving a TRANS2_SET_FILE_INFORMATION Request + +**Pass-through Information Levels** + +If the client requests a pass-through Information Level, then the processing follows as specified in section [3.3.5.10.1](#Section_ed7e027124ee46eda08b3e1335b3c0ee).[<131>](#Appendix_A_131) + +##### Receiving a TRANS2_SET_PATH_INFORMATION Request + +**Pass-through Information Levels** + +If the client requests a pass-through Information Level, then the processing follows as specified in section [3.3.5.10.1](#Section_ed7e027124ee46eda08b3e1335b3c0ee).[<132>](#Appendix_A_132) + +##### Receiving a TRANS2_QUERY_FS_INFORMATION Request + +**Pass-through Information Levels** + +If the client requests a pass-through Information Level, then the processing follows as specified in section [3.3.5.10.1](#Section_ed7e027124ee46eda08b3e1335b3c0ee). + +##### Receiving a TRANS2_SET_FS_INFORMATION Request + +The server MAY support setting file system information. If the server does not support setting file system information, then it MUST fail the request with STATUS_ACCESS_DENIED. + +If the client requests a pass-through Information Level, then processing follows as specified in section [3.3.5.10.1](#Section_ed7e027124ee46eda08b3e1335b3c0ee). + +There is no way to know if a server file system supports a given Information Level. From a protocol perspective, if a client issues a request and it fails with STATUS_NOT_SUPPORTED, then it MUST be inferred that the server file system does not support the request. + +#### Receiving any SMB_COM_NT_TRANSACT Subcommand + +The processing of any SMB_COM_NT_TRANSACT subcommand request is handled as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.3.5.59 with the following additions specified in section [3.3.5.11.1](#Section_7187919879ea439b970b8c301128edce). + +##### Receiving an NT_TRANSACT_IOCTL Request + +The NT_TRANSACT_IOCTL extensions listed in section [2.2.7.2.1](#Section_2f8a9baed8c1462893daadba011e4f17) are not directly passed to the underlying object store. Instead, processing is as specified in the following sections. + +If the IsFsctl field is set to zero, the server SHOULD[<133>](#Appendix_A_133) fail the request with STATUS_NOT_SUPPORTED. + +When the server receives a pass-through FSCTL request, the server SHOULD[<134>](#Appendix_A_134) pass it through to the underlying object store. + +When the server receives an undefined FSCTL or IOCTL operation request that does not meet the private FSCTL requirements of [\[MS-FSCC\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-FSCC%5d.pdf#Section_efbfe12773ad41409967ec6500e66d5e) 2.3, the server MUST NOT pass the request to the underlying object store and MUST fail the request with STATUS_NOT_SUPPORTED. + +###### Receiving an FSCTL_SRV_ENUMERATE_SNAPSHOTS Function Code + +This is a request to enumerate the available previous versions for a share. The server MUST return an enumeration of available previous versions, as specified in section [2.2.7.2.2](#Section_2564d6a8c1e24492bd7f7a1587c1becf). The **NumberOfSnapshots** MUST contain the total number of previous versions that are available for the volume and **NumberOfSnapshotsReturned** contains the number of entries that are returned in this enumeration. If **MaxDataCount** is not large enough to hold all of the entries, then the server SHOULD return zero entries. The value returned in **SnapShotArraySize** MUST be the size required to receive all of the available previous versions. If the **MaxDataCount** of the request is smaller than the size of an FSCTL_ENUMERATE_SNAPSHOTS response, then the server MUST fail the request with STATUS_INVALID_PARAMETER. When sending the response to the client, the server SHOULD NOT [<135>](#Appendix_A_135)include any additional data after NT_Trans_Data in the FSCTL_SRV_ENUMERATE_SNAPSHOTS response (as specified in section [2.2.7.2.2.1](#Section_5a43eb2950c846b68319e793a11f6226)) and the client MUST ignore any additional data on receipt. + +If the server does not support this operation, then it SHOULD fail the request with STATUS_NOT_SUPPORTED. + +###### Receiving an FSCTL_SRV_REQUEST_RESUME_KEY Function Code + +This is a request for an opaque copychunk resume key for use in an FSCTL_SRV_COPYCHUNK operation. The server MUST generate a 24-byte value that is used to uniquely identify the open of the file against which this operation is executed. + +If this operation is successful, then the server MUST construct an FSCTL_SRV_REQUEST_RESUME_KEY response as specified in section [2.2.7.2.2](#Section_2564d6a8c1e24492bd7f7a1587c1becf), with the following additional requirements: + +The **CopychunkResumeKey** field MUST be the server-generated value. + +If the generation of the Copychunk Resume Key fails, the server MUST fail the request with STATUS_INVALID_PARAMETER. + +If the server does not support this operation, then it MUST fail the request with STATUS_NOT_SUPPORTED. + +###### Receiving an FSCTL_SRV_COPYCHUNK Request + +This is a request for a server-side data copy as specified in section [2.2.7.2.1](#Section_2f8a9baed8c1462893daadba011e4f17). The server MUST identify the source file based on the copychunk resume key field of the FSCTL_SRV_COPYCHUNK request. This copychunk resume key is a value that was returned by the server from an FSCTL_SRV_REQUEST_RESUME_KEY operation. If the copychunk resume key is not valid or does not represent an open file, then the server MUST fail the operation with STATUS_OBJECT_NAME_NOT_FOUND. If the file represented by the resume key is not opened for read-data access, then the server MUST fail the operation with STATUS_ACCESS_DENIED. Likewise, the target file MUST be specified by the Fid in the SMB_COM_NT_TRANSACTION request. If the target file is not opened for write-data access, then the server MUST fail the operation with STATUS_ACCESS_DENIED and **ServerStatistics.sts0_permerrors** MUST be increased by 1. + +The server MUST validate that the amount of data to be written is within the server's configured bounds. If the server determines that the total chunk count is more than **Server.MaxCopyChunks**, or the size of any chunk is more than **Server.MaxCopyChunkSize**, or the total size of all chunks exceeds **Server.MaxTotalCopyChunkSize**, the server MUST fail the request with STATUS_INVALID_PARAMETER and return a response as specified in section [2.2.7.2.2](#Section_2564d6a8c1e24492bd7f7a1587c1becf). + +The server MUST iterate through the data ranges specified in the request by reading data from the source offset of the source file and writing it to the target offset of the target file. If the underlying object store returns a failure, then the server MUST stop and set the response parameters, as specified in section 2.2.7.2.2, to indicate how much data was successfully written, and set the **Status** field of the header with the error code received. + +If the processing of FSCTL_SRV_COPYCHUNK operation is completed before **Server.CopyChunkTimeOut**, the server MUST return the FSCTL_SRV_COPYCHUNK response as specified in section 2.2.7.2.2 with the following values and Status field of the header set to STATUS_SUCCESS: + +- **ChunksWritten** is set to the number of copychunk operations requested by the client. +- **ChunkBytesWritten** is set to zero. +- **TotalBytesWritten** is set to the total number of bytes written to the destination file. + +If the processing of FSCTL_SRV_COPYCHUNK operation is not completed before **Server.CopyChunkTimeOut**, the server MUST fail the call with **Status** field of the header set to STATUS_IO_TIMEOUT and return the FSCTL_SRV_COPYCHUNK response as specified in section [2.2.7.2.2.2](#Section_c2571af45f264bfcba6738d26f16effc) with the following values: + +- **ChunksWritten** is set to the number of copychunk operations performed by the server within the time specified by **Server.CopyChunkTimeOut**. +- **ChunkBytesWritten** is set to zero. +- **TotalBytesWritten** is set to the total number of bytes written to the destination file within the time specified by **Server.CopyChunkTimeOut**. + +If the server does not support this operation, then it MUST fail the request with STATUS_NOT_SUPPORTED. + +##### Receiving an NT_TRANS_QUERY_QUOTA Request + +The server MUST query the underlying object store, in an implementation-specific manner, to enumerate the quota information for the list of SIDs specified in the **SidList** field, on which the file or directory indicated by the **Server.Open** identified by the **SMB_Parameters.Words.Setup.FID** field of the request resides.[<136>](#Appendix_A_136) If the underlying object store does not support quotas, then the server MUST return STATUS_NOT_SUPPORTED. + +The server MUST return as much of the available quota information that is able to fit in the maximum response buffer size denoted by **MaxDataCount**. If the entire quota information cannot fit in the response buffer, then the server MUST return a status of STATUS_BUFFER_TOO_SMALL. Otherwise, the server MUST return STATUS_SUCCESS. The format of the request determines which entries need to be returned, as specified in section [2.2.7.5.1](#Section_9f3f73f99c4a42ba9f56e6352491d714). The server MUST place the quota information in the response, as specified in section [2.2.7.5.2](#Section_178d375d029c40aeb7b8bd01547fff51), and send the response back to the client. + +##### Receiving an NT_TRANS_SET_QUOTA Request + +The server MUST attempt to apply the provided quota information to the underlying object store on which the file or directory indicated by the Fid resides, in an implementation-specific manner.[<137>](#Appendix_A_137) If the underlying object store does not support quotas, then the server MUST return STATUS_NOT_SUPPORTED. + +The server MUST apply the quota information provided in the **NT_Trans_Data** block of the request (see section [2.2.7.6.1](#Section_5172dc9ce7ad47fa86c0317b047a37eb)). + +The resulting success or error received from the underlying object store MUST be returned in the response, as specified in section [2.2.7.6.2](#Section_84801befd12e4efba9310ed9a6e730ea). + +##### Receiving an NT_TRANSACT_CREATE Request + +The processing of this subcommand request is handled as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.3.5.59.1 with the following exception. + +If the **MaxParameterCount** field of the SMB_COM_NT_TRANSACT request contains a value that is less than the size of the NT_TRANSACT_CREATE Response as specified in section [2.2.7.1.2](#Section_3527e3a938de444eaed28d300fbf0c09), the server SHOULD[<138>](#Appendix_A_138) fail the request with STATUS_INVALID_SMB (ERRSRV/ERRerror). + +### Timer Events + +#### Authentication Expiration Timer Event + +When the Authentication Expiration Timer expires, the server MUST scan all sessions and it MUST set **Server.Connection.SessionTable\[UID\].AuthenticationState** to _Expired_, for which the **Server.Connection.SessionTable\[UID\].AuthenticationState** is valid and **Server.Session.AuthenticationExpirationTime** has passed, as specified in section [3.3.5.3](#Section_1f152df0a61d4e769af6da96fa783c02). + +### Other Local Events + +There are no new server local events other than those specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.3.7. + +# Protocol Examples + +The following sections describe common scenarios that indicate normal traffic flow on the wire in order to illustrate the extensions to CIFS that are specified in this document. + +## Extended Security Authentication + +The following diagram depicts the protocol message sequence for a multi-phase extended security exchange and previous versions enumeration and access on the share root folder. + +![User authentication and session establishment sequence](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAb0AAAFxCAYAAADnBHaLAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADFMAAAxhAdIjpQsAADemSURBVHhe7Z0vdBTZukcRIxBXIJERiJFIBALxBOKKWMQVTyIRCMSTEVcgkU8gsAgEEolEIhCIJ5ARCGy/tXvyy/1y5lR3p6mTVCd7r3VWV506f6vDt/urzkzunJ6erv7nf/7HMlM5OTlZ/fr1ayUi8ru8fv26G2cs+5Xv37+v7nDw5MmTbgPL5cvDhw9X//u//3v2Iysish+fPn1aHR0ddeOM5fLl+Ph49d///d9/SY8i88BNVXoi8rsgPRISmQfistIbgNITkTlQevOi9Aah9ERkDpTevCi9QSg9EZkDpTcvSm8QSk9E5kDpzYvSG4TSE5E5UHrzovQGofREZA6U3rwovUEoPRGZA6U3L0pvEEpPROZA6c2L0huE0hOROVB686L0BqH0RGQOlN68KL1BKD0RmQOlNy9KbxBKT0TmQOnNi9IbhNITkTlQevOi9Aah9ERkDpTevCi9QSg9EZkDpTcvSm8QSk9E5kDpzYvSG4TSE5E5UHrzovQGofREZA6U3rwovUEoPRGZA6U3L4uS3s+fP1cnJydnZ4eN0hOROVB683Kl0vvx48fq+Ph49eDBg/Py+PHj1Zs3b9bXv3z5sq4LtKXMBfOw2atA6YnIHIySHvGwxmIK8Zbk4yZzZdJDeNxUJuM4vH379lxsrfS+ffu2LnNBFolkrwKlJyJzMEJ6Hz58WMdaxg7EWuIWcfgmc2XSY5KprC2fLFrp8YYkCwwRFwVhVrjGGM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aM37en+yb0mZ1IjcdpSc7Q8Dkh4Vg3AbeBH+CNK8EVAJ85JY2BPkadDnfJj7atVlMqAKq0D59mLf3Q541bIP1T8kre+I69dk7sDakwrlyEZF9uJGZ3unp6VoOuwTg6wZ5ENgJ9JQqFuqBNhFRrY8gKsgDYWwCkdKP/pWIh/mq1KinfcRc11DJI9ltKC+Rm4OZ3iB2kd7Xr1/Xf1n43r176z/GyB9hvC4QLwE9hR+M7IGCHNrsLlkWUuI4YuE430W1wmmlh0h2+QGMyJLBMWYVFuMk2+K1PhbkceEuj1FZawrzKTmRm4fSu2J+/fq1vun8tWFEV8vvSm8XceUvHFPq3Ii3XuOHovZ9//796vv372cz/YdIL8ctPelFdNTXa9tAppFSK+DfId+hUZB15qD4ix4icp0cbKaHMF69evW3P7Vfy9HR0XBx1bEvS0QVQXCcx5vQkx7QNnAcodRsDDivwsk8IiJzYaY3iCqap0+fXpDTpjJaXL9LZMTjvzmzrTxOpLCvKj8RkblQegNBUGRmd+/e7QquV0RERMLBPt78/PnzOoshe+vJLoXv/EREZAxmeoNopdfy8ePH9Xd87S+09H5ZRERE5kHpLQB+eYVHoS9evJj1ezIRETlsbkymJyIiV4+Z3iCUnojI8lB6IiIiC8VMT0RE9sZMbxBKT0RkeSg9ERGRhWKmJyIie2OmNwilJyKyPJSeiIjIQjHTExGRvTHTG4TSExFZHkpPRERkoZjpiYjI3pjpDULpiYgsD6UnIiKyUMz0RERkb8z0BqH0RESWh9ITERFZKGZ6IiKyN2Z6g1B6IiLLQ+mJiIgsktXq/wGr5EzqbfQmswAAAABJRU5ErkJggg==) + +Figure 4: User authentication and session establishment sequence + +Descriptions of the fields in this example are specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) and section 2.2.4.1. Fields that are shown and highlighted in bold text are relevant to this extension. It is assumed that the client has successfully established a network connection with the server. + +The client initiates the first message with an [SMB_COM_NEGOTIATE request](#Section_7991af9adc99437cbaf8a3b4ca56b151), as specified in \[MS-CIFS\]. The client specifies extended security negotiation in the header **Flags2** field. It also includes NT LM 0.12 in the dialect strings list. The server constructs an extended [SMB_COM_NEGOTIATE response](#Section_d883d0a55a0a46268e3e87b0b66b79aa) packet that is denoted by the _WordCount_ field. The server returns dialect index, its capabilities, GUID value, and the initial security binary large object (BLOB) obtained, as specified in [\[RFC2743\]](http://go.microsoft.com/fwlink/?LinkId=90378) and defined in the preceding figure. + +FRAME 1. Client negotiate request + +- Client -> Server: Command = SMB_COM_NEGOTIATE +- Flags2 Summary = 51207 (0xC807) +- 1100 1000 0000 0111 +- .... 1... .... .... = Extended security negotiation is supported +- Dialect Strings +- PC NETWORK PROGRAM 1.0 +- LANMAN1.0 +- Windows for Workgroups 3.1a +- LM1.2X002 +- LANMAN2.1 +- NT LM 0.12 + +FRAME 2. Server negotiate response + +- Server -> Client: Command = SMB_COM_NEGOTIATE +- NT status code = 0x0, STATUS_SUCCESS +- Word count = 17 +- Protocol Index = 5 (NT LM 0.12) +- Capabilities = 2147607549 (0x8001F3FD) +- 1000 0000 0000 0001 1111 0011 1111 1101 +- .... .... .... .... ..1. .... .... .... = Supports Pass-Thru levels +- 1... .... .... .... .... .... .... .... = Supports extended security +- Server GUID = 01 B3 1E 23 07 2A A4 4D A1 9F B6 69 F0 45 71 90 +- Security Blob in payload + +The client uses the initial security BLOB that is returned by the server along with any user credential information in order to obtain its security BLOB, as specified in \[RFC2743\] and defined in section [3.2.4.2.4](#Section_d3b7bcd3cd684d3b916b443ccd55f953). The resulting security BLOB is sent to the server as part of the [SMB_COM_SESSION_SETUP_ANDX extended request](#Section_a00d03613544484596ab309b4bb7705d). The client also sends its capabilities and zero **UID** to mark the start of a new session setup exchange. The server verifies that the client requests extended security by checking the **Flags2** and **Capabilities** fields in the request, accepts as input the client security BLOB, and processes it, as specified in \[RFC2743\]. In this case, the security package requires more processing and returns a second security BLOB to be returned to the client. Also, the server allocates a new UID and associates it with this session setup exchange. + +**Note** Extended security can require multiple request and response exchanges between client and server to complete. The **UID** is defined by the server on first response to an extended session setup and is used for the lifetime of the session. + +FRAME 3. Client request for extended session setup + +- Client -> Server: Command = SMB_COM_SESSION_SETUP_ANDX +- Header: Tid = 0x0000 Mid = 0x0070 Uid = 0x0000 +- Flags2 Summary = 51207 (0xC807) +- 1100 1000 0000 0111 +- .... 1... .... .... = Supports extended security +- Word count = 12 +- Capabilities = 0xA0000000 +- 1010 0000 0000 0000 0000 0000 0000 0000 +- ..1. .... .... .... .... .... .... .... = Supports dynamic reauth +- 1... .... .... .... .... .... .... .... = Requests extended security +- Security Blob Length = 74 (0x4A) +- Security Blob in payload + +FRAME 4. Server response with session setup continuation + +- Server -> Client: Command = SMB_COM_SESSION_SETUP_ANDX +- NT status code = 0xC0000016, STATUS_MORE_PROCESSING_REQUIRED +- Header: Tid = 0x0000 Mid = 0x0070 Uid = 0x0802 +- Flags2 Summary = 51207 (0xC807) +- 1100 1000 0000 0111 +- .... 1... .... .... = Extended security negotiation is supported +- Security Blob Length = 349 (0x15D) +- Security Blob in payload + +The client accepts as input the server security BLOB and processes it, as specified in \[RFC2743\], and its output is returned to the server along with the UID. The server uses the **UID** value to associate this request with the pending session establishment. The server processes this request, as specified in [\[RFC4178\]](http://go.microsoft.com/fwlink/?LinkId=90461), and receives a success result. At this point, the SMB_SESSION_SETUP_ANDX exchange is complete because the status code is not equal to STATUS_MORE_PROCESSING_REQUIRED. The final security BLOB is returned with the success indication. + +FRAME 5. Client session setup request continuation + +- Client -> Server: Command = SMB_COM_SESSION_SETUP_ANDX +- Header: Tid = 0x0000 Mid = 0x0080 Uid = 0x0802 +- Flags2 Summary = 51207 (0xC807) +- 1100 1000 0000 0111 +- .... 1... .... .... = Extended security negotiation is supported +- Word count = 12 +- Security Blob Length = 226 (0xE2) +- Security Blob in payload + +FRAME 6. Server response with session setup completion + +- Server -> Client: Command = SMB_COM_SESSION_SETUP_ANDX +- NT status code = 0x0, STATUS_SUCCESS +- Header: Tid = 0x0000 Mid = 0x0080 Uid = 0x0802 +- Security Blob Length = 9 (0x9) +- Security Blob in payload + +At this point, the client has been successfully authenticated. + +## Previous File Version Enumeration + +The following example shows how the client accesses a previous version of the share root folder. It is assumed that the client has already authenticated, established a tree connect to the target share, and opened a handle to the root directory, as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b). Thus, Frame 1 is not truly the first frame for the connection, but it is referred to as the starting point for this operation. + +![Previous file version enumeration sequence](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAb0AAAFxCAYAAADnBHaLAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADFMAAAxhAdIjpQsAADmzSURBVHhe7Z0veBTblkcjnkCMQCIRiCuRCAQSMQKLGDESiUAgRiIRI5AjEFgE4krEiCuRCARiBBKBQIzpmdUvv7yd/U7/SacqqU7W+r7zVdWp87cS9updnffuyc+fP1f/8R//YZmovHnzZvX79++ViMhlefv27TDOWA4r379/X51w8uTJk2EDy8XLw4cPV//1X/91+isrInIYnz9/Xt2/f38YZywXL8+ePVv9+7//+9+lR5Fp4KEqPRG5LEiPhESmgbis9GZA6YnIFCi9aVF6M6H0RGQKlN60KL2ZUHoiMgVKb1qU3kwoPRGZAqU3LUpvJpSeiEyB0psWpTcTSk9EpkDpTYvSmwmlJyJToPSmRenNhNITkSlQetOi9GZC6YnIFCi9aVF6M6H0RGQKlN60KL2ZUHoiMgVKb1qU3kwoPRGZAqU3LUpvJpSeiEyB0psWpTcTSk9EpkDpTYvSmwmlJyJToPSmRenNhNITkSlQetOi9GZC6YnIFCi9aVF6M6H0RGQKlN60KL2ZUHoiMgVKb1oWJb1fv36t3rx5c3p13Cg9EZkCpTctVyq9Hz9+rJ49e7Z68ODBWXn8+PHq3bt36/tfvnxZ1wXaUqaCedjsVaD0RGQK5pIe8bDGYgrxluTjJnNl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Risj1YKY3E/tI7+vXr+v/ztXdu3fXIkAI18Uh4kph/fUev1C178ePH8+NDflLzZAMLELpQgNkVes5Z11Ii/N833fdsE6K36WJLA+ld8X8/v17/dD5jzZWcVAQxmW4anFdBjIgRFWzrSpC1joCmYR6XkE2yZxTGG/TmCIiS+VoM73v37+vXr9+/U//xeJa7t+/f1TimgLEtet14UVBesm2REQqZnozUUXDf36/ymlbOUZxiYgcC0pvRhAUmdmdO3eGghsVERGRcLSvN//666/1d0tkbyPZpfCdn4iIzIOZ3kx06XX+/PPP9Xd8/Q9a+O5PRETmQektAP54hVehL1++nPyPOkRE5Hi5MZmeiIhcPWZ6M6H0RESWh9ITERFZKGZ6IiJyMGZ6M6H0RESWh9ITERFZKGZ6IiJyMGZ6M6H0RESWh9ITERFZKGZ6IiJyMGZ6M6H0RESWh9ITERFZKGZ6IiJyMGZ6M6H0RESWh9ITERFZKGZ6IiJyMGZ6M6H0RESWh9ITERFZKGZ6IiJyMGZ6M6H0RESWh9ITERFZJKvV/wHenL4+kE7F1wAAAABJRU5ErkJggg==) + +Figure 5: Previous file version enumeration sequence + +The first step is to enumerate the list of available snapshots on the server by using the FSCTL_SRV_ENUMERATE_SNAPSHOT command. The client requests the list of snapshots that are available on the server by using the root handle Fid. The server returns the list of snapshots in the format that is defined in the preceding figure. In this example, the server has one snapshot total for the root folder, the payload contains one snapshot string, the payload size is 0x34 bytes, and the snapshot name is @GMT-2006.04.26-04-08-27. The last 2 bytes of the payload are the snapshot strings 16-bit Unicode NULL delimiter. + +FRAME 1. Client requests FSCTL_SRV_ENUMERATE_SNAPSHOTS + +- Client -> Server: Command = SMB_COM_NT_TRANSACT +- NT IOCTL Function Code 0x00144064 FSCTL_SRV_ENUMERATE_SNAPSHOTS +- File ID (Fid) = 16391 (0x4007) + +FRAME 2. Server response with list of snapshots + +- Server -> Client: Command = SMB_COM_NT_TRANSACT +- NT status code = 0x0, STATUS_SUCCESS +- Payload contained in Data buffer as defined in section 3.1.5.4: +- 00090: 01 00 00 00 01 00 00 00 34 00 00 00 40 00 ..........4...@. +- 000A0: 47 00 4D 00 54 00 2D 00 32 00 30 00 30 00 36 00 G.M.T.-.2.0.0.6. +- 000B0: 2E 00 30 00 34 00 2E 00 32 00 36 00 2D 00 30 00 ..0.4...2.6.-.0. +- 000C0: 34 00 2E 00 30 00 38 00 2E 00 32 00 37 00 00 00 4...0.8...2.7... +- 000D0: 00 00 + +The client uses standard SMB commands to access the snapshot. The client also indicates in the header **Flags2** that the name in the request is tokenized with the previous version information. This indicates to the server that the client is accessing a previous version of the path. The server processes the request and returns the path information for the snapshot directory rather than to the current directory. + +FRAME 3. Client requests path information for snapshot 2006/04/26 04:08:27 AM + +- Client -> Server: Command = SMB_COM_TRANSACTION2 +- Flags2 Summary = 52231 (0xCC07) +- 1100 1100 0000 0111 +- .... .1.. .... .... = File name is tokenized with Previous +- Version Information +- Transact2 function = Query path info +- File name =\\@GMT-2006.04.26-04.08.27 +- 00080: 5C 00 40 00 +- ……............\\.@. +- 00090: 47 00 4D 00 54 00 2D 00 32 00 30 00 30 00 36 00 G.M.T.-.2.0.0.6. +- 000A0: 2E 00 30 00 34 00 2E 00 32 00 36 00 2D 00 30 00 ..0.4...2.6.-.0. +- 000B0: 34 00 2E 00 30 00 38 00 2E 00 32 00 37 00 00 00 4...0.8...2.7... + +FRAME 4. Server response with snapshot path information + +- Server -> Client: Command = SMB_COM_TRANSACTION2 +- NT status code = 0x0, STATUS_SUCCESS +- Data bytes = 40 (0x28) + +Payload contains path information for specified snapshot version + +Similar to its behavior during the query path exchange, the client specifies the previous version of the root folder in an open request. The server processes the request and returns an Fid for the specified previous version of the path. + +FRAME 5. Client open request for version 2006/04/26 04:08:27 AM on "\\" + +- Client -> Server: Command = SMB_COM_NT_CREATE_ANDX +- Flags2 Summary = 52231 (0xCC07) +- 1100 1100 0000 0111 +- .... .1.. .... .... = File name is tokenized with Previous +- Version Information +- Create Disposition = Open: If exist, Open, else fail +- File name =\\@GMT-2006.04.26-04.08.27 + +FRAME 6. Server open root folder and returns Fid + +- Server -> Client: Command = SMB_COM_NT_CREATE_ANDX +- NT status code = 0x0, STATUS_SUCCESS +- File ID (Fid) = 16392 (0x4008) +- Create Action = File Opened + +These similar steps can be used to open a file rather than a directory on a remote volume. In that case, the @GMT token is contained in the relative path, such as \\directory\\@GMT-2006.04.26-04.08.27\\file.txt. This path can be used to query attributes or to open a file. The resulting Fid is used to read its contents. + +Likewise, the @GMT token path in the example can be used as part of a TRANS2_FIND_FIRST2 and TRANS2_FIND_NEXT2 to enumerate the contents of the volume at the time of the snapshot. + +## Message Signing Example + +The following is the sequence of events that is related to SMB message authentication. In the following scenario, as specified in [\[RFC4178\]](http://go.microsoft.com/fwlink/?LinkId=90461), authentication is used between the client and the server. The client and server are both configured not to require SMB signing; however, both are capable of using SMB signing. This also applies to the figure in section [4.1](#Section_ee3e4254083b423092893ca0f969ac5a); however, the parameters significant to signing a negotiation are called out. + +- The client sends an [SMB_COM_NEGOTIATE request](#Section_7991af9adc99437cbaf8a3b4ca56b151) to the server. +- Client -> Server: SMB: C negotiate, Dialect = NTLM 0.12 +- SMB Flags2 contains 0xC843 +- 1... .... .... .... = Unicode Strings: Strings are Unicode +- .1.. .... .... .... = Error Code Type: Error codes are NT error codes +- ..0. .... .... .... = Execute-Only Reads: Do not permit reads if execute-only +- ...0 .... .... .... = Dfs: Do not resolve pathnames with Dfs +- .... 1... .... .... = Extended security negotiation is supported +- .... .... .1.. .... = Long Names Used +- .... .... .... .0.. = Security signatures are not supported +- .... .... .... ..1. = Extended Attributes: Extended attributes are supported +- .... .... .... ...1 = Long Names Allowed +- Security Signature is not set (the value is 00 00 00 00 00 00 00 +- 00). +- SECURITY_SIGNATURE: Bit2 (not set) + +No **SecuritySignature** is generated at this stage. + +- The client receives an [SMB_COM_NEGOTIATE response](#Section_d883d0a55a0a46268e3e87b0b66b79aa) SMB from the server. +- Server -> Client: SMB: R negotiate, Dialect # = 5 +- SMB Flags2 contains 0xC853 +- Binary: 00000000 00000000 11001000 01010011 +- ^ ^ ^ +- SECURITY_SIGNATURE: Bit2: (not set) +- Security Signature is not set (the value is 00 00 00 00 00 00 00 00). + +No **SecuritySignature** is generated at this stage. + +- The client builds an [SMB_COM_SESSION_SETUP_ANDX request](#Section_a00d03613544484596ab309b4bb7705d) SMB and sends it to the server. + +In the SessionSetupAndX SMB, an authentication request, such as an NTLM or NTLMv2 Challenge/Response or a Kerberos ticket, is sent from the client to the server. + +At this stage, the SessionKey is not yet available. + +- Client -> Server: SMB: C session setup & X +- SMB Flags2 contains 0xC807 +- Binary: 00000000 00000000 11001000 00000111 +- ^ ^ ^ +- SECURITY_SIGNATURE: Bit2 (set) + +After the packet is sent by the client, the sequence number is incremented to 1, which is the expected sequence number for the response packet from the server. + +- The server processes the request and sends an [SMB_COM_SESSION_SETUP_ANDX response](#Section_e5a467bccd364afa825e3f2a7bfd6189) to the client. + +It is possible that multiple roundtrips of SessionSetupAndX can be required to complete a given authentication. If STATUS_MORE_PROCESSING_REQUIRED is returned, then the implementer would return to the previous step and repeat. The following example demonstrates what happens when STATUS_SUCCESS is returned. Similarly, if this authentication was for Anonymous or Guest, then signing would not be activated at this time. + +- Server -> Client: SMB: R session setup & X +- SMB Flags2 contains 0xC807 +- Binary: 00000000 00000000 11001000 00000111 +- ^ ^ +- SECURITY_SIGNATURE: Bit2 (set) + +The server sets the sequence number to 1 for the response packet and generates the **SecuritySignature** as follows. + +The server places the sequence number (1) in the **SecuritySignature** field of the SMB header, and an MD5 hash is performed on the SessionKey + SMB packet. This results in a 16-byte value. The first 8 bytes of the computed hash (AB 44 C4 76 45 84 1A 6A) are placed in the **SecuritySignature** field and sent to the client. + +- 00000: 00 11 43 02 26 E6 00 C0 4F 60 2E 45 08 00 45 00 ..C.&f.@O'.E..E. +- 00010: 01 78 85 60 40 00 80 32 F6 4B AC 1B 92 B9 AC 1B .x&'@.,2vK,.9,. +- 00020: 92 B7 88 F2 96 BD 00 00 00 14 01 BD 05 48 8B A1 "Fr=.....=.H9! +- 00030: 8F 6C C1 3F C0 39 50 18 FF F0 84 70 00 00 00 00 lA?@9P.pp.... +- 00040: 01 2F FF 53 4D 42 73 00 00 00 00 98 07 C8 00 00 ./SMBs....\\.H.. +- 00050: >AB 44 C4 76 45 84 1A 6A<00 00 00 00 FF FE 00 08 +DDvE.j....~.. +- 00060: 40 00 04 FF 00 2F 01 00 00 A2 00 04 01 A1 81 9F @.../..."...!x +- 00070: 30 81 9C A0 03 0A 01 00 A1 0B 06 09 2A 86 48 82 0S +- ....!...\* H + +After the server sends the packet, the sequence number is incremented to 2, which is the expected sequence number for the next SMB packet from the client. + +- The client processes the response and obtains the SessionKey. +- SMB Flags2 contains 0xC807 +- Binary: 00000000 00000000 11001000 00000111 +- ^ ^ +- SECURITY_SIGNATURE: Bit2 (set) + +The expected sequence number is 1 for the response packet from the server. + +The client saves the **SecuritySignature** in the response packet. The expected sequence number (1) is placed in the **SecuritySignature** field of the SMB header, and an MD5 hash is performed on the SessionKey SMB packet. This results in a 16-byte value. The first 8 bytes of the computed hash are compared with the one sent by the server (AB 44 C4 76 45 84 1A 6A) to validate the SMB packet. For the SessionKey that is used for signing when Kerberos is used, see [\[MS-KILE\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-KILE%5d.pdf#Section_2a32282edd484ad9a542609804b02cc9) section 3.1.1.2, Cryptographic Material. + +- The client proceeds further and sends an [SMB_COM_TREE_CONNECT_ANDX request](#Section_16b173568eff49c29d21557e07ef085d) SMB. +- Client -> Server: SMB: C tree connect & X, Share + +The client sequence number is now incremented. The new value is 2. + +The sequence number (2) is placed in the **SecuritySignature** field of the SMB header, and an MD5 hash is performed on the 16-byte SessionKey + SMB packet. This results in a 16-byte value. The first 8 bytes (in this case, A5 B0 43 DC 07 51 0F 8B) are placed in the **SecuritySignature** field in the SMB header and then sent to the server. + +- 00000: 00 C0 4F 60 2E 45 00 11 43 02 26 E6 08 00 45 00 .@O'.E..C.&f..E. +- 00010: 00 98 21 48 40 00 80 32 5B 44 AC 1B 92 B7 AC 1B .\\!H@.,2\[D,.",. +- 00020: 92 B9 C4 70 3D 34 00 00 00 1C 05 48 01 BD C1 3F 9Dp=4.....H.=A? +- 00030: C0 39 8B A1 90 9F 50 18 42 EF D0 D6 00 00 00 00 @99!xP.BoPV.... +- 00040: 00 54 FF 53 4D 42 75 00 00 00 00 18 07 C8 00 00 .TSMBu......H.. +- 00050: >A5 B0 43 DC 07 51 0F 8B<00 00 00 00 FF FE 00 08 %0C\\.Q.9....~.. +- 00060: 80 00 04 FF 00 54 00 0C 00 01 00 29 00 00 5C 00 ,...T.....)..\\. +- 00070: 5C 00 4D 00 4F 00 48 00 41 00 4B 00 34 00 31 00 \\.M.O.H.A.K.4.1. + +The sequence continues until the session is terminated. + +In the case where extended security is not used, the same process is followed. However, the MD5 hash is performed on the 16-byte session key + NTLM challenge response + SMB packet with the appropriate sequence number. The NTLM challenge response is the authentication that is received in the SMB_COM_SESSION_SETUP_ANDX request in the **UnicodePassword** field if NTLM was used for authentication, or in the **OEMPassword** field if LM authentication was used. + +## Copy File (Remote to Local) + +The following example illustrates the sequence of operations during the copying of a file from a remote location to the local machine. The example assumes that the connection establishment and session management have already taken place. + +![Copy file (remote to local) sequence](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAb0AAAFxCAYAAADnBHaLAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADFMAAAxTAT9T8XoAAC4qSURBVHhe7d0teBRL2sbxiCMQK5DICMSRkYgIxArEiljEihUrkAgEYmXECiRyBQKLQCCRSMQRCETECmQEIuKYed//nNxznqnt+cikK+lJ/r/rqmv6o7q6eoC680wCHJyfn8/+9a9/2UZqp6ens4uLi5kkXdebN28G1xnbbu3s7Gx2wMbTp08HO9iu3o6Ojmb/+c9/Ln/LStJuPn/+PDs8PBxcZ2xXbycnJ7N//OMff4QeTePgTTX0JF0XoUdBonGwLht6HRh6ksZg6I3L0OvE0JM0BkNvXIZe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nT+76saHDQC4zrua3BJ0l21t5Xe2dnZ7PXr1//zHz/Wdnh4aHBJUkdWep3UoOE/g6zhtK4ZXJLUj6HXEQFFZVZ/VH5TkyQp9vbjzS9fvsx/OpPqbSjs0uqP1UuSxmWl10kbeq1Pnz7Nv8fX/kAL3/uTJPVh6E0AP7zCR6EvX7703zWUJC3cmUpPknTzrPQ6MfQkaXoMPUmSJspKT5K0Myu9Tgw9SZoeQ0+SpImy0pMk7cxKrxNDT5Kmx9CTJGmirPQkSTuz0uvE0JOk6TH0JEmaKCs9SdLOrPQ6MfQkaXoMPUmSJspKT5K0Myu9Tgw9SZoeQ0+SpImy0pMk7cxKrxNDT5Kmx9CTJGmSZrP/AwV7jIEudSMsAAAAAElFTkSuQmCC) + +Figure 6: Copy file (remote to local) sequence + +In the preceding diagram, the first frame is to open the remote file for read access. The subsequent frames read the data from the file, and then close the file. In between the read and the close, the data is written to the local file. + +NT_CREATE_ANDX + +- Client -> Server: SMB: C NT Create Andx, Dialect = NTLM 0.12 +- SMB: Tree ID (Tid) = 2049 (0x801) +- SMB: Process ID (Pid) = 3592 (0xE08) +- SMB: User ID (Uid) = 2048 (0x800) +- SMB: Multiplex ID (Mid) = 1712 (0x6B0) +- SMB: Command = C NT create & X +- SMB: Desired Access = 0x00000089 +- SMB: ...............................1 = Read Data Allowed +- SMB: ..............................0. = Write Data Denied +- SMB: .............................0.. = Append Data Denied +- SMB: ............................1... = Read EA Allowed +- SMB: ...........................0.... = Write EA Denied +- SMB: ..........................0..... = File Execute Denied +- SMB: .........................0...... = File Delete Denied +- SMB: ........................1....... = File Read Attributes Allowed +- SMB: .......................0........ = File Write Attributes Denied +- SMB: NT File Attributes = 0x00000080 +- SMB: ...............................0 = Not Read Only +- SMB: ..............................0. = Not Hidden +- SMB: .............................0.. = Not System +- SMB: ...........................0.... = Not Directory +- SMB: ..........................0..... = Not Archive +- SMB: .........................0...... = Not Device +- SMB: ........................1....... = Normal +- SMB: .......................0........ = Not Temporary +- SMB: ......................0......... = Not Sparse File +- SMB: .....................0.......... = Not Reparse Point +- SMB: ....................0........... = Not Compressed +- SMB: ...................0............ = Not Offline +- SMB: ..................0............. = +- CONTENT_INDEXED +- SMB: .................0.............. = Not Encrypted +- SMB: File Share Access = 0x00000003 +- SMB: ...............................1 = Read allowed +- SMB: ..............................1. = Write allowed +- SMB: .............................0.. = Delete not +- allowed +- SMB: Create Disposition = Open: If exist, Open, else fail +- SMB: Create Options = 68 (0x44) +- SMB: ...............................0 = non-directory +- SMB: ..............................0. = non-write through +- SMB: .............................1.. = Data is written to the file sequentially +- SMB: ............................0... = intermediate buffering allowed +- SMB: ...........................0.... = IO alerts bits not set +- SMB: ..........................0..... = IO non-alerts bit not set +- SMB: .........................1...... = Operation is on a non-directory file +- SMB: ........................0....... = tree connect bit not set +- SMB: .......................0........ = complete if oplocked bit is not set +- SMB: ......................0......... = no EA knowledge bit is not set +- SMB: .....................0.......... = 8.3 filenames bit is not set +- SMB: ....................0........... = random access bit is not set +- SMB: ...................0............ = delete on close bit is not set +- SMB: ..................0............. = open by filename +- SMB: .................0.............. = open for backup bit not set +- SMB: File name =\\filename.txt + +NT_CREATE_ANDX Response + +- Server -> Client: SMB: C NT Create Andx, Dialect = NTLM 0.12 +- SMB: Tree ID (Tid) = 2049 (0x801) +- SMB: Process ID (Pid) = 3592 (0xE08) +- SMB: User ID (Uid) = 2048 (0x800) +- SMB: Multiplex ID (Mid) = 1712 (0x6B0) +- SMB: Command = R NT create & X +- SMB: Oplock Level = Batch +- SMB: File ID (Fid) = 16389 (0x4005) +- SMB: NT File Attributes = 0x00000020 +- SMB: ...............................0 = Not Read Only +- SMB: ..............................0. = Not Hidden +- SMB: .............................0.. = Not System +- SMB: ...........................0.... = Not Directory +- SMB: ..........................1..... = Archive +- SMB: .........................0...... = Not Device +- SMB: ........................0....... = Not Normal +- SMB: .......................0........ = Not Temporary +- SMB: ......................0......... = Not Sparse File +- SMB: .....................0.......... = Not Reparse Point +- SMB: ....................0........... = Not Compressed +- SMB: ...................0............ = Not Offline +- SMB: ..................0............. = CONTENT_INDEXED +- SMB: .................0.............. = Not Encrypted + +SMB_COM_READ_ANDX Request + +- Client -> Server: SMB: C Read Andx, Dialect = NTLM 0.12 +- SMB: Tree ID (Tid) = 2049 (0x801) +- SMB: Process ID (Pid) = 65279 (0xFEFF) +- SMB: User ID (Uid) = 2048 (0x800) +- SMB: Multiplex ID (Mid) = 1744 (0x6D0) +- SMB: Command = C read & X +- SMB: File ID (Fid) = 16389 (0x4005) +- SMB: Max count = 1596 (0x63C) +- SMB: Min count = 1596 (0x63C) +- SMB: Bytes left = 1596 + +SMB_COM_READ_ANDX Response + +- Server -> Client: SMB: R Read Andx, Dialect = NTLM 0.12 +- SMB: Tree ID (Tid) = 2049 (0x801) +- SMB: Process ID (Pid) = 65279 (0xFEFF) +- SMB: User ID (Uid) = 2048 (0x800) +- SMB: Multiplex ID (Mid) = 1744 (0x6D0) +- SMB: Command = C read & X +- SMB: Data length = 1596 (0x63C) +- SMB: Data offset = 60 (0x3C) +- SMB: Byte count = 1597 +- Data = 00 90 27 D0 C4 6F 00 90 27 66 6D BE 08 00 45 00 …… + +SMB_COM_CLOSE Request + +- Client -> Server: SMB: C Close, Dialect = NTLM 0.12 +- SMB: Tree ID (Tid) = 2049 (0x801) +- SMB: Process ID (Pid) = 65279 (0xFEFF) +- SMB: User ID (Uid) = 2048 (0x800) +- SMB: Multiplex ID (Mid) = 1984 (0x7C0) +- SMB: Command = C Close +- SMB: File ID (Fid) = 16389 (0x4005) + +SMB_COM_CLOSE Response + +- Server -> Client: SMB: R Close, Dialect = NTLM 0.12 +- SMB: Tree ID (Tid) = 2049 (0x801) +- SMB: Process ID (Pid) = 65279 (0xFEFF) +- SMB: User ID (Uid) = 2048 (0x800) +- SMB: Multiplex ID (Mid) = 1984 (0x7C0) + +## Copy File (Local to Remote) + +The following example illustrates the sequence of operations while copying a local file to a remote share. The frames do not include the connection establishment or session management, for example. + +![Copy file (local to remote) sequence](data:image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P3/wEaoSS4A4EdupoS+YCjKnyqQGe+k3EQ58hMZAtRjiV9vFi9tayydqBNZAYhePshzcDHDM/ZegxZL1PItIXMz0Zhf/973/z4F2lhjSSqVWxUJ+sptZHmJVlQqowVxUfYqlzMUdEnL41q0JUQzJCWP4ShshqzPQ6ofT6w1+zQBwpfDPnvlOQQ/2zTg8ePFj8uad//vOfF7P8CWJBOIAIq5RClRpiiqio4zjj15FHp3lkWD8vA84jwuxjU7iOmsVxLTkXue8oPblVriquSIvC3y2sbXwj17H83cM69/n5+cWqfzxKpK5SHy1WoVUQVLKuSI498sp4EZExuZOZHoGfd/ZDQXYXuElxjQmPDZFVSn33x9dj6JdSeCS67hFiPptLdlWP62NKEbl5zPQ6kaC9im/fvs3/u5D8pXWC/m2xq+K6Lkhs3WdwInJ3UHo3DI/YuOn831dVHBSEcR3uq7hERO4qO5vpnZ6ezt68efOX//ixlv39fcUlItIRM71OVNHwn0FWOa0qiktEpB9KryMIisys/qr8uiIiIhJ29vHmly9f5r+dSfY2JLuU+mv1IiIyLmZ6nWil1/Lp06f5Z3ztL7Tw2Z+IiPRB6U0AfnmFR6GvXr3y7xqKiMiCO5PpiYjIzWOm1wmlJyIyPZSeiIjIRDHTExGRrTHT64TSExGZHkpPRERkopjpiYjI1pjpdULpiYhMD6UnIiIyUcz0RERka8z0OqH0RESmh9ITERGZKGZ6IiKyNWZ6nVB6IiLTQ+mJiIhMFDM9ERHZGjO9Tig9EZHpofREREQmipmeiIhsjZleJ5SeiMj0UHoiIiKTZDb7P2hkd+0yzNRtAAAAAElFTkSuQmCC) + +Figure 7: Copy file (local to remote) sequence + +In the frames in the preceding figure, the remote file is first created with the [SMB_COM_NT_CREATE_ANDX request](#Section_8e14ed93f27544d1bc46dfaf296c91b1). The data from the local file is then written to the remote file and, subsequently, the file is closed. + +NT_CREATE_ANDX + +- Client -> Server: SMB: C NT Create Andx, Dialect = NTLM 0.12 +- SMB: Tree ID (Tid) = 2049 (0x801) +- SMB: Process ID (Pid) = 3592 (0xE08) +- SMB: User ID (Uid) = 2048 (0x800) +- SMB: Multiplex ID (Mid) = 2288 (0x8F0) +- SMB: Command = C NT create & X +- SMB: Desired Access = 0x00030197 +- SMB: ...............................1 = Read Data Allowed +- SMB: ..............................1. = Write Data Allowed +- SMB: .............................1.. = Append Data Allowed +- SMB: ............................0... = Read EA Denied +- SMB: ...........................1.... = Write EA Allowed +- SMB: ..........................0..... = File Execute Denied +- SMB: .........................0...... = File Delete Denied +- SMB: ........................1....... = File Read Attributes Allowed +- SMB: .......................1........ = File Write Attributes Allowed +- SMB: NT File Attributes = 0x00000020 +- SMB: ...............................0 = Not Read Only +- SMB: ..............................0. = Not Hidden +- SMB: .............................0.. = Not System +- SMB: ...........................0.... = Not Directory +- SMB: ..........................1..... = Archive +- SMB: .........................0...... = Not Device +- SMB: ........................0....... = Not Normal +- SMB: .......................0........ = Not Temporary +- SMB: ......................0......... = Not Sparse File +- SMB: .....................0.......... = Not Reparse Point +- SMB: ....................0........... = Not Compressed +- SMB: ...................0............ = Not Offline +- SMB: ..................0............. = +- CONTENT_INDEXED +- SMB: .................0.............. = Not Encrypted +- SMB: File Share Access = 0x00000000 +- SMB: ...............................0 = Read not allowed +- SMB: ..............................0. = Write not allowed +- SMB: .............................0.. = Delete not allowed +- SMB: Create Disposition = Overwrite_If: If exist, open +- and overwrite, else create it +- SMB: Create Options = 68 (0x44) +- SMB: ...............................0 = non-directory +- SMB: ..............................0. = non-write through +- SMB: .............................1.. = Data is written to the file sequentially +- SMB: ............................0... = intermediate buffering allowed +- SMB: ...........................0.... = IO alerts bits not set +- SMB: ..........................0..... = IO non-alerts bit not set +- SMB: .........................1...... = Operation is on a non-directory file +- SMB: ........................0....... = tree connect bit not set +- SMB: .......................0........ = complete if oplocked bit is not set +- SMB: ......................0......... = no EA knowledge bit is not set +- SMB: .....................0.......... = 8.3 filenames bit is not set +- SMB: ....................0........... = random access bit is not set +- SMB: ...................0............ = delete on close bit is not set +- SMB: ..................0............. = open by filename +- SMB: .................0.............. = open for backup bit not set +- SMB: File name =\\filename.txt + +NT_CREATE_ANDX Response + +- Server -> Client: SMB: R NT Create Andx, Dialect = NTLM 0.12 +- SMB: Tree ID (Tid) = 2049 (0x801) +- SMB: Process ID (Pid) = 3592 (0xE08) +- SMB: User ID (Uid) = 2048 (0x800) +- SMB: Multiplex ID (Mid) = 2288 (0x8F0) +- SMB: Command = C NT create & X +- SMB: Oplock Level = Batch +- SMB: File ID (Fid) = 16392 (0x4008) +- SMB: NT File Attributes = 0x00000020 +- SMB: ...............................0 = Not Read Only +- SMB: ..............................0. = Not Hidden +- SMB: .............................0.. = Not System +- SMB: ...........................0.... = Not Directory +- SMB: ..........................1..... = Archive +- SMB: .........................0...... = Not Device +- SMB: ........................0....... = Not Normal +- SMB: .......................0........ = Not Temporary +- SMB: ......................0......... = Not Sparse File +- SMB: .....................0.......... = Not Reparse Point +- SMB: ....................0........... = Not Compressed +- SMB: ...................0............ = Not Offline +- SMB: ..................0............. = CONTENT_INDEXED +- SMB: .................0.............. = Not Encrypted + +SMB_COM_WRITE_ANDX Request + +- Client -> Server: SMB: C Write Andx, Dialect = NTLM 0.12 +- SMB: Tree ID (Tid) = 2049 (0x801) +- SMB: Process ID (Pid) = 65279 (0xFEFF) +- SMB: User ID (Uid) = 2048 (0x800) +- SMB: Multiplex ID (Mid) = 2384 (0x950) +- SMB: Command = C read & X +- SMB: File ID (Fid) = 16392 (0x4008) +- SMB: File offset = 0 (0x0) +- SMB: Data length = 1596 (0x63C) +- Data = 00 90 27 66 6D BE 00 90 27 D0 C4 6F 08 00 45 00 … + +SMB_COM_WRITE_ANDX Response + +- Server -> Client: SMB: R Write Andx, Dialect = NTLM 0.12 +- SMB: Tree ID (Tid) = 2049 (0x801) +- SMB: Process ID (Pid) = 65279 (0xFEFF) +- SMB: User ID (Uid) = 2048 (0x800) +- SMB: Multiplex ID (Mid) = 2384 (0x950) +- SMB: Command = C read & X + +SMB_COM_CLOSE Request + +- Client -> Server: SMB: C Close, Dialect = NTLM 0.12 +- SMB: Tree ID (Tid) = 2049 (0x801) +- SMB: Process ID (Pid) = 65279 (0xFEFF) +- SMB: User ID (Uid) = 2048 (0x800) +- SMB: Multiplex ID (Mid) = 2400 (0x960) +- SMB: Command = C Close +- SMB: File ID (Fid) = 16392 (0x4008) + +SMB_COM_CLOSE Response + +- Server -> Client: SMB: R Close, Dialect = NTLM 0.12 +- SMB: Tree ID (Tid) = 2049 (0x801) +- SMB: Process ID (Pid) = 65279 (0xFEFF) +- SMB: User ID (Uid) = 2048 (0x800) +- SMB: Multiplex ID (Mid) = 2400 (0x960) + +## FSCTL SRV COPYCHUNK + +The following example refers to the sequence of operations for a file copy in which the source and the destination are on the same server. The [FSCTL_SRV_COPYCHUNK (section 2.2.7.2)](#Section_bdcc7363d0c74417b45ae46934b11419) is used. The following sequence assumes that the SMB connection to the server, SMB session establishment, and other operations have been completed. + +![Copy file (from/to same remote server) sequence](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAb0AAAHRCAYAAAD+GGdlAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADFMAAAxYAdynKLEAAFkaSURBVHhe7Z0vtBRbdodHIhERSAQCEYGIQDwRiRiBiUA8ERGBRCAQEREjIhART0REIDARCARiRMQIxIgREYgnECOeRCAQY8j6+vEj++17qrtv36p7q+79vrXOqqrzZ599Tvfdv97V0PW7T58+ff3Xf/1Xy0zlD3/4w9cvX758FRG5KC9fvhzGGctp5ePHj19/x8k//uM/DjtYzl8ePHjw9b/+67++vWVFRE7jf/7nf77evXt3GGcs5y+PHz/++s///M+/ih5F5oFNVfRE5KIgeiQkMg/EZUVvARQ9EZkDRW9eFL2FUPREZA4UvXlR9BZC0ROROVD05kXRWwhFT0TmQNGbF0VvIRQ9EZkDRW9eFL2FUPREZA4UvXlR9BZC0ROROVD05kXRWwhFT0TmQNGbF0VvIRQ9EZkDRW9eFL2FUPREZA4UvXlR9BZC0ROROVD05kXRW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PGA2j4F43rmgX3Ehflpr7dd6UtdGM2BH8fMDdijLzYpnEccImYRDEp8wUfEirrsU4X2iOUawMeRn3Kz4T2h6F0xHz582P2EzpMnT77V3GwSrGrhA8Ton3zz5u2F/880+n9OtU8XHUgWAwT+BO+afVRhqX2AbIi6Q0SgkvlEcOttuSpKfR6yqhHx/ViwOWdmJSLzc20yPX5eh0/NDx8+/E1Q3gr8J9fLEKcU9nNkd+QDv1xxCPpV4SNLQVzy3VQXmoAYpT6CVG/tjcZMwfxTWROcKkoRUvyicF4FXeQmw98bMWUrbF702HDaRj8HtMQLMSVOCG4XEH52qApNCj9T1H3F/1HfucVpKSJyiFiyqvo9E+f1FmOoIsT5PpGjrRcRuVqIPcSqrbDJ25sEdz5lT2U2KYhLF4alxIkfju12k3X0gkDI8bBn7GUKr6GiJyKnsBnR+/HHH3fC8ujRozNCNFVGAqU4iYjMB7GS2LoVNnV7k0/4r1+/3p2PsrBe6CMiIsuh6F0i3N4iS6v/eKUXERGRsKlM79C/3hxlgSIishxmegtxSPQ6yQJFRGQ5FD0REZGVcm0zPRERWR4zvYVQ9ERE1oeiJyIislLM9ERE5GTM9BZC0RMRWR+KnoiIyEox0xMRkZMx01sIRU9EZH0oeiIiIivFTE9ERE7GTG8hFD0RkfWh6ImIiKySr1//D0gCbOsL+xXgAAAAAElFTkSuQmCC) + +Figure 8: Copy file (from/to same remote server) sequence + +The initial step in the preceding sequence is to open the source and the destination file using NT_CREATE_ANDX command. This step is followed by the FSCTL_SRV_REQUEST_RESUME_KEY request. This is sent as an NT_TRANSACT_IOCTL with the file ID of the source file. The server responds with the [FSCTL_SRV_REQUEST_RESUME_KEY response (section 2.2.7.2.2.2)](#Section_c2571af45f264bfcba6738d26f16effc). A 24-byte server copychunk resume key is returned. + +NT_CREATE_ANDX Request (Source) + +- Client -> Server: SMB: C NT Create Andx, Dialect = NTLM 0.12 +- SMB: Tree ID (Tid) = 2049 (0x801) +- SMB: Process ID (Pid) = 3592 (0xE08) +- SMB: User ID (Uid) = 2048 (0x800) +- SMB: Multiplex ID (Mid) = 384 (0x180) +- SMB: Command = C NT create & X +- SMB: Desired Access = 0x00020089 +- SMB: ...............................1 = Read Data Allowed +- SMB: ..............................0. = Write Data Denied +- SMB: .............................0.. = Append Data Denied +- SMB: ............................1... = Read EA Allowed +- SMB: ...........................0.... = Write EA Denied +- SMB: ..........................0..... = File Execute Denied +- SMB: .........................0...... = File Delete Denied +- SMB: ........................1....... = File Read Attributes Allowed +- SMB: .......................0........ = File Write Attributes Denied +- SMB: NT File Attributes = 0x00000000 +- SMB: ...............................0 = Not Read Only +- SMB: ..............................0. = Not Hidden +- SMB: .............................0.. = Not System +- SMB: ...........................0.... = Not Directory +- SMB: ..........................0..... = Not Archive +- SMB: .........................0...... = Not Device +- SMB: ........................0....... = Not Normal +- SMB: .......................0........ = Not Temporary +- SMB: ......................0......... = Not Sparse File +- SMB: .....................0.......... = Not Reparse Point +- SMB: ....................0........... = Not Compressed +- SMB: ...................0............ = Not Offline +- SMB: ..................0............. = +- CONTENT_INDEXED +- SMB: .................0.............. = Not Encrypted +- SMB: File Share Access = 0x00000005 +- SMB: ...............................1 = Read allowed +- SMB: ..............................0. = Write not allowed +- SMB: .............................1.. = Delete allowed +- SMB: Create Disposition = Open: If exist, Open, else fail +- SMB: Create Options = 2097220 (0x200044) +- SMB: ...............................0 = non-directory +- SMB: ..............................0. = non-write through +- SMB: .............................1.. = Data is written to the +- file sequentially +- SMB: ............................0... = intermediate buffering allowed +- SMB: ...........................0.... = IO alerts bits not set +- SMB: ..........................0..... = IO non-alerts bit not set +- SMB: .........................1...... = Operation is on a non-directory file +- SMB: ........................0....... = tree connect bit not set +- SMB: .......................0........ = complete if oplocked bit is not set +- SMB: ......................0......... = no EA knowledge bit is not set +- SMB: .....................0.......... = 8.3 filenames bit is not set +- SMB: ....................0........... = random access bit is not set +- SMB: ...................0............ = delete on close bit is not set +- SMB: ..................0............. = open by filename +- SMB: .................0.............. = open for backup bit not set +- SMB: File name = sourcefile.txt + +NT_CREATE_ANDX Response + +- Server -> Client: SMB: R NT Create Andx, Dialect = NTLM 0.12 +- SMB: Tree ID (Tid) = 2049 (0x801) +- SMB: Process ID (Pid) = 3592 (0xE08) +- SMB: User ID (Uid) = 2048 (0x800) +- SMB: Multiplex ID (Mid) = 384 (0x180) +- SMB: Command = R NT create & X +- SMB: Oplock Level = II +- SMB: File ID (Fid) = 16386 (0x4002) + +- SMB: NT File Attributes = 0x00000020 +- SMB: ...............................0 = Not Read Only +- SMB: ..............................0. = Not Hidden +- SMB: .............................0.. = Not System +- SMB: ...........................0.... = Not Directory +- SMB: ..........................1..... = Archive +- SMB: .........................0...... = Not Device +- SMB: ........................0....... = Not Normal +- SMB: .......................0........ = Not Temporary +- SMB: ......................0......... = Not Sparse File +- SMB: .....................0.......... = Not Reparse Point +- SMB: ....................0........... = Not Compressed +- SMB: ...................0............ = Not Offline +- SMB: ..................0............. = +- CONTENT_INDEXED +- SMB: .................0.............. = Not Encrypted +- SMB: File type = Disk file or directory + +NT_CREATE_ANDX Request (Destination) + +- Client -> Server: SMB: C NT Create Andx, Dialect = NTLM 0.12 +- SMB: Tree ID (Tid) = 2049 (0x801) +- SMB: Process ID (Pid) = 3592 (0xE08) +- SMB: User ID (Uid) = 2048 (0x800) +- SMB: Multiplex ID (Mid) = 480 (0x1E0) +- SMB: Command = C NT create & X +- SMB: Desired Access = 0x00030197 +- SMB: ...............................1 = Read Data Allowed +- SMB: ..............................1. = Write Data Allowed +- SMB: .............................1.. = Append Data Allowed +- SMB: ............................0... = Read EA Denied +- SMB: ...........................1.... = Write EA Allowed +- SMB: ..........................0..... = File Execute Denied +- SMB: .........................0...... = File Delete Denied +- SMB: ........................1....... = File Read Attributes Allowed +- SMB: .......................1........ = File Write Attributes Allowed +- SMB: NT File Attributes = 0x00000020 +- SMB: ...............................0 = Not Read Only +- SMB: ..............................0. = Not Hidden +- SMB: .............................0.. = Not System +- SMB: ...........................0.... = Not Directory +- SMB: ..........................1..... = Archive +- SMB: .........................0...... = Not Device +- SMB: ........................0....... = Not Normal +- SMB: .......................0........ = Not Temporary +- SMB: ......................0......... = Not Sparse File +- SMB: .....................0.......... = Not Reparse Point +- SMB: ....................0........... = Not Compressed +- SMB: ...................0............ = Not Offline +- SMB: ..................0............. = CONTENT_INDEXED +- SMB: .................0.............. = Not Encrypted +- SMB: File Share Access = 0x00000000 +- SMB: ...............................0 = Read not allowed +- SMB: ..............................0. = Write not allowed +- SMB: .............................0.. = Delete not allowed +- SMB: Create Disposition = Overwrite_If: If exist, open and overwrite, +- else create it +- SMB: Create Options = 68 (0x44) +- SMB: ...............................0 = non-directory +- SMB: ..............................0. = non-write through +- SMB: .............................1.. = Data is written to the file sequentially +- SMB: ............................0... = intermediate buffering allowed +- SMB: ...........................0.... = IO alerts bits not set +- SMB: ..........................0..... = IO non-alerts bit not set +- SMB: .........................1...... = Operation is on a non-directory file +- SMB: ........................0....... = tree connect bit not set +- SMB: .......................0........ = complete if oplocked bit is not set +- SMB: ......................0......... = no EA knowledge bit is not set +- SMB: .....................0.......... = 8.3 filenames bit is not set +- SMB: ....................0........... = random access bit is not set +- SMB: ...................0............ = delete on close bit is not set +- SMB: ..................0............. = open by filename +- SMB: .................0.............. = open for backup bit not set +- SMB: File name = destinationfile.txt + +NT_CREATE_ANDX Response + +- Server -> Client: SMB: R NT Create Andx, Dialect = NTLM 0.12 +- SMB: Tree ID (Tid) = 2049 (0x801) +- SMB: Process ID (Pid) = 3592 (0xE08) +- SMB: User ID (Uid) = 2048 (0x800) +- SMB: Multiplex ID (Mid) = 480 (0x1E0) +- SMB: Command = R NT create & X +- SMB: Oplock Level = Batch +- SMB: File ID (Fid) = 16387 (0x4003) + +- SMB: NT File Attributes = 0x00000020 +- SMB: ...............................0 = Not Read Only +- SMB: ..............................0. = Not Hidden +- SMB: .............................0.. = Not System +- SMB: ...........................0.... = Not Directory +- SMB: ..........................1..... = Archive +- SMB: .........................0...... = Not Device +- SMB: ........................0....... = Not Normal +- SMB: .......................0........ = Not Temporary +- SMB: ......................0......... = Not Sparse File +- SMB: .....................0.......... = Not Reparse Point +- SMB: ....................0........... = Not Compressed +- SMB: ...................0............ = Not Offline +- SMB: ..................0............. = CONTENT_INDEXED +- SMB: .................0.............. = Not Encrypted +- SMB: File type = Disk file or directory + +FSCTL_SRV_REQUEST_RESUME_KEY Request + +- Client -> Server: SMB: C NT Transact, Dialect = NTLM 0.12 +- NT IOCTL Function Code 0x00140078 FSCTL_SRV_REQUEST_RESUME_KEY +- File ID (Fid) = 16386 (0x4002) + +FSCTL_SRV_REQUEST_RESUME_KEY Response + +- Server -> Client: SMB: R NT Transact, Dialect = NTLM 0.12 +- NT IOCTL Function Code 0x00140078 FSCTL_SRV_REQUEST_RESUME_KEY +- File ID (Fid) = 16386 (0x4002) +- Key = 2D 0B 00 00 01 00 00 00 59 84 0C 62 1B 84 C6 01 08 0E 00 00 00 00 00 00 +- ContextLength = 0 + +This is followed by an FSCTL_SRV_COPYCHUNK request. The request uses the resume key generated earlier. + +FSCTL_SRV_COPYCHUNK Request + +- Client -> Server: SMB: C NT Transact, Dialect = NTLM 0.12 +- NT IOCTL Function Code 0x001440F2 FSCTL_SRV_COPYCHUNK +- File ID (Fid) = 16387 (0x4003) +- Key = 2D 0B 00 00 01 00 00 00 59 84 0C 62 1B 84 C6 01 08 0E 00 00 00 00 00 00 +- ChunkCount = 1 (01 00 00 00) +- Reserved = 0 (00 00 00 00) +- List: +- SourceOffset = 0 \_(00 00 00 00 00 00 00 00) +- DestinationOffset = 0 (00 00 00 00 00 00 00 00) +- Length = 1731 (3C 06 00 00) + +FSCTL_SRV_COPYCHUNK Response + +- Server -> Client: SMB: R NT Transact, Dialect = NTLM 0.12 +- NT IOCTL Function Code 0x001440F2 FSCTL_SRV_COPYCHUNK +- File ID (Fid) = 16387 (0x4003) +- ChunksWritten = 1 (01 00 00 00) +- ChunkBytesWritten = 0 (00 00 00 00) +- TotalBytesWritten = 1731 (3C 06 00 00) + +The final step is to close the source and the destination file with SMB_COM_CLOSE commands. + +SMB_COM_CLOSE Request (Source) + +- Client -> Server: SMB: C Close, Dialect = NTLM 0.12 +- SMB: Tree ID (Tid) = 2049 (0x801) +- SMB: Process ID (Pid) = 65279 (0xFEFF) +- SMB: User ID (Uid) = 2048 (0x800) +- SMB: Multiplex ID (Mid) = 640 (0x280) +- SMB: Command = C Close +- SMB: File ID (Fid) = 16386 (0x4002) + +SMB_COM_CLOSE Response + +- Server -> Client: SMB: R Close, Dialect = NTLM 0.12 +- SMB: Tree ID (Tid) = 2049 (0x801) +- SMB: Process ID (Pid) = 65279 (0xFEFF) +- SMB: User ID (Uid) = 2048 (0x800) +- SMB: Multiplex ID (Mid) = 640 (0x280) + +SMB_COM_CLOSE Request (Destination) + +- Client -> Server: SMB: C Close, Dialect = NTLM 0.12 +- SMB: Tree ID (Tid) = 2049 (0x801) +- SMB: Process ID (Pid) = 65279 (0xFEFF) +- SMB: User ID (Uid) = 2048 (0x800) +- SMB: Multiplex ID (Mid) = 656 (0x290) +- SMB: Command = C Close +- SMB: File ID (Fid) = 16387 (0x4003) + +SMB_COM_CLOSE Response + +- Server -> Client: SMB: R Close, Dialect = NTLM 0.12 +- SMB: Tree ID (Tid) = 2049 (0x801) +- SMB: Process ID (Pid) = 65279 (0xFEFF) +- SMB: User ID (Uid) = 2048 (0x800) +- SMB: Multiplex ID (Mid) = 656 (0x290) + +## TRANS TRANSACT NMPIPE + +The following example illustrates how the TRANS_TRANSACT_NMPIPE is used. + +![Named pipe request sequence](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAb0AAAFxCAYAAADnBHaLAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADFMAAAxaAe6RSjMAAC7nSURBVHhe7Z0teBRb1kYjrkCMQCIjEFdGIiKQiBGxiCtGjEAiEIiRESOQyBEILAKBRCJGIK5AICJGICMQEWP6+1bfvH13zlT/pFMnqe6s9Tzn6arzX5Vkr97VIRycn5/P/vG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DHzU4YeQ9b7JCJ9MdOTUfjvf/87D95VakgjmVoVC/XJamp9hFlZJqQKc1XxIZY6F3NExOlbsypENSQjhOUvYYisxkyvE0qvP/w1C8SRwjdz7jsFOdQ/6/TgwYPFn3v6+9//fjnLnyAWhAOIsEopVKkhpoiKOo4zfh15dJpHhvXzMuA8Isw+NoXrqFkc15JzkfuO0pM75briirQo/N3C2sY3ch3L3z2sc19cXFyu+sejROoq9dFiFVoFQSXriuTYI6+MFxEZk73M9Aj8vLMfCrK7wG2Ka0x4bIisUuq7P74eQ7+UwiPRdY8Q89lcsqt6XB9TisjtY6bXiQTtVXz79m3+34XkL60T9O+KXRXXTUFi6z6DE5H9QendMjxi46bzf19VcVAQxk24r+ISEdlXdjbTOzs7m71+/fp//uPHWg4PDxWXiEhHzPQ6UUXDfwZZ5bSqKC4RkX4ovY4gKDKz+qvy64qIiEjY2cebX758mf92JtnbkOxS6q/Vi4jIuJjpdaKVXsunT5/mn/G1v9DCZ38iItIHpTcB+OUVHoW+fPnSv2soIiIL9ibTExGR28dMrxNKT0Rkeig9ERGRiWKmJyIiW2Om1wmlJyIyPZSeiIjIRDHTExGRrTHT64TSExGZHkpPRERkopjpiYjI1pjpdULpiYhMD6UnIiIyUcz0RERka8z0OqH0RESmh9ITERGZKGZ6IiKyNWZ6nVB6IiLTQ+mJiIhMFDM9ERHZGjO9Tig9EZHpofREREQmyWz2f+6K4ibSEaQIAAAAAElFTkSuQmCC) + +Figure 9: Named pipe request sequence + +The first frame contains the NT_CREATE_ANDX request to the named pipe. The TRANS_TRANSACT_NMPIPE is then issued against the file ID assigned in the NT_CREATE_ANDX response. + +NT_CREATE_ANDX + +- Client -> Server: SMB: C NT Create Andx, Dialect = NTLM 0.12 +- SMB: Tree ID (Tid) = 2048 (0x800) +- SMB: Process ID (Pid) = 2292 (0x8F4) +- SMB: User ID (Uid) = 2048 (0x800) +- SMB: Multiplex ID (Mid) = 4048 (0xFD0) +- SMB: Command = C NT create & X +- SMB: Desired Access = 0x0002019F +- SMB: ...............................1 = Read Data Allowed +- SMB: ..............................1. = Write Data Allowed +- SMB: .............................1.. = Append Data Allowed +- SMB: ............................1... = Read EA Allowed +- SMB: ...........................1.... = Write EA Allowed +- SMB: ..........................0..... = File Execute Denied +- SMB: .........................0...... = File Delete Denied +- SMB: ........................1....... = File Read Attributes Allowed +- SMB: .......................1........ = File Write Attributes Allowed +- SMB: NT File Attributes = 0x00000000 +- SMB: ...............................0 = Not Read Only +- SMB: ..............................0. = Not Hidden +- SMB: .............................0.. = Not System +- SMB: ...........................0.... = Not Directory +- SMB: ..........................0..... = Not Archive +- SMB: .........................0...... = Not Device +- SMB: ........................0....... = Not Normal +- SMB: .......................0........ = Not Temporary +- SMB: ......................0......... = Not Sparse File +- SMB: .....................0.......... = Not Reparse Point +- SMB: ....................0........... = Not Compressed +- SMB: ...................0............ = Not Offline +- SMB: ..................0............. = +- CONTENT_INDEXED +- SMB: .................0.............. = Not Encrypted +- SMB: File Share Access = 0x00000003 +- SMB: ...............................1 = Read allowed +- SMB: ..............................1. = Write allowed +- SMB: .............................0.. = Delete not +- allowed +- SMB: Create Disposition = Open: If exist, Open, else fail +- SMB: Create Options = 4194368 (0x400040) +- SMB: ...............................0 = non-directory +- SMB: ..............................0. = non-write through +- SMB: .............................0.. = non-sequential writing allowed +- SMB: ............................0... = intermediate buffering allowed +- SMB: ...........................0.... = IO alerts bits not set +- SMB: ..........................0..... = IO non-alerts bit not set +- SMB: .........................1...... = Operation is on a non-directory file +- SMB: ........................0....... = tree connect bit not set +- SMB: .......................0........ = complete if oplocked bit is not set +- SMB: ......................0......... = no EA knowledge bit is not set +- SMB: .....................0.......... = 8.3 filenames bit is not set +- SMB: ....................0........... = random access bit is not set +- SMB: ...................0............ = delete on close bit is not set +- SMB: ..................0............. = open by filename +- SMB: .................0.............. = open for backup bit not set +- SMB: File name =\\srvsvc + +NT_CREATE_ANDX Response + +- Server -> Client: SMB: R NT Create Andx, Dialect = NTLM 0.12 +- SMB: Tree ID (Tid) = 2048 (0x800) +- SMB: Process ID (Pid) = 2292 (0x8F4) +- SMB: User ID (Uid) = 2048 (0x800) +- SMB: Multiplex ID (Mid) = 4048 (0xFD0) +- SMB: Command = R NT create & X +- SMB: Oplock Level = NONE +- SMB: File ID (Fid) = 16385 (0x4001) +- SMB: NT File Attributes = 0x00000080 +- SMB: ...............................0 = Not Read Only +- SMB: ..............................0. = Not Hidden +- SMB: .............................0.. = Not System +- SMB: ...........................0.... = Not Directory +- SMB: ..........................0..... = Not Archive +- SMB: .........................0...... = Not Device +- SMB: ........................1....... = Normal +- SMB: .......................0........ = Not Temporary +- SMB: ......................0......... = Not Sparse File +- SMB: .....................0.......... = Not Reparse Point +- SMB: ....................0........... = Not Compressed +- SMB: ...................0............ = Not Offline +- SMB: ..................0............. = CONTENT_INDEXED +- SMB: .................0.............. = Not Encrypted +- SMB: File type = Message mode named pipe + +SMB_COM_TRANSACTION Request + +- Client -> Server: SMB: C transact TransactNmPipe, Dialect = NTLM +- 0.12 +- SMB: Tree ID (Tid) = 2048 (0x800) +- SMB: Process ID (Pid) = 2292 (0x8F4) +- SMB: User ID (Uid) = 2048 (0x800) +- SMB: Multiplex ID (Mid) = 4096 (0x1000) +- SMB: Command = C transact +- SMB: Data bytes = 76 (0x4C) +- SMB: Data offset = 84 (0x54) +- SMB: Setup words +- SMB: Pipe function = Transact named pipe (TransactNmPipe) +- SMB: File ID (Fid) = 16385 (0x4001) +- Data = 00 90 27 66 6D BE 00 90 27 D0 C4 6F 08 00 45 00 …… + +SMB_COM_TRANSACTION Response + +- Server -> Client: SMB: R transact TransactNmPipe, Dialect = NTLM +- 0.12 +- SMB: Tree ID (Tid) = 2048 (0x800) +- SMB: Process ID (Pid) = 2292 (0x8F4) +- SMB: User ID (Uid) = 2048 (0x800) +- SMB: Multiplex ID (Mid) = 4096 (0x1000) +- SMB: Command = R transact +- SMB: Data bytes = 120 (0x78) +- SMB: Data offset = 56 (0x38) +- DATA = 00 90 27 D0 C4 6F 00 90 27 66 6D BE 08 00 45 00 …. + +SMB_COM_CLOSE Request + +- Client -> Server: SMB: C Close, Dialect = NTLM 0.12 +- SMB: Tree ID (Tid) = 2048 (0x800) +- SMB: Process ID (Pid) = 65279 (0xFEFF) +- SMB: User ID (Uid) = 2048 (0x800) +- SMB: Multiplex ID (Mid) = 4112 (0x1010) +- SMB: Command = C Close +- SMB: File ID (Fid) = 16385 (0x4001) + +SMB_COM_CLOSE Response + +- Server -> Client: SMB: R Close, Dialect = NTLM 0.12 +- SMB: Tree ID (Tid) = 2048 (0x800) +- SMB: Process ID (Pid) = 65279 (0xFEFF) +- SMB: User ID (Uid) = 2048 (0x800) +- SMB: Multiplex ID (Mid) = 4112 (0x1010) + +# Security + +The following section specifies security considerations for implementers of the Server Message Block (SMB) Protocol. + +## Security Considerations for Implementers + +The CIFS Protocol contains support for NTLM but lacks support for new authentication protocols. The extensions defined in this document offer support for increased security in remote file and printer access via SMB. + +In addition to the NTLM challenge/response authentication support, as specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b) section 3.1.5.2, these extensions enable support for Kerberos or any other protocol that can be encapsulated inside the extensible authentication package, as specified in [\[RFC2743\]](http://go.microsoft.com/fwlink/?LinkId=90378) and [\[RFC4178\]](http://go.microsoft.com/fwlink/?LinkId=90461). + +Extended message signing uses the HMAC_MD5 algorithm, as specified in [\[RFC2104\]](http://go.microsoft.com/fwlink/?LinkId=90314), to alter the user's session key. + +The protocol does not sign oplock break requests from the server to the client if message signing is enabled. This can allow an attacker to affect performance but does not allow an attacker to deny access or alter data. + +The algorithm used for message signing has been shown to be subject to collision attacks. See [\[MD5Collision\]](http://go.microsoft.com/fwlink/?LinkId=89937) for more information. + +The new "previous versions" feature potentially allows access to versions of a file that have been deleted or modified. This can provide access to information that was not available without these extensions. However, this access is still subject to the same access checks to which it is normally subject. + +## Index of Security Parameters + +| Security parameter | Section | +| ----------------------------------------------------------- | ---------------------------------------------------- | +| Signing Key Protection | [3.2.5.4](#Section_66aeb6701e484cb9a6517c70f355cd16) | +| Extended Security - GSS mechanism | [3.3.5.3](#Section_1f152df0a61d4e769af6da96fa783c02) | +| Extended Security - Maximal User and Guest Rights per Share | [3.3.5.4](#Section_8e1132db35514a439552326236eb2c67) | +| Authentication Expiration Time | [3.3.2.1](#Section_d3866f1fcada48848b68999ee2142568) | + +# Appendix A: Product Behavior + +The information in this specification is applicable to the following Microsoft products or supplemental software. References to product versions include released service packs. + +- Windows 2000 operating system +- Windows XP operating system +- Windows Server 2003 operating system +- Windows Server 2003 R2 operating system +- Windows Vista operating system +- Windows Server 2008 operating system +- Windows 7 operating system +- Windows Server 2008 R2 operating system +- Windows 8 operating system +- Windows Server 2012 operating system +- Windows 8.1 operating system +- Windows Server 2012 R2 operating system +- Windows 10 operating system +- Windows Server 2016 operating system + +Exceptions, if any, are noted below. If a service pack or Quick Fix Engineering (QFE) number appears with the product version, behavior changed in that service pack or QFE. The new behavior also applies to subsequent service packs of the product unless otherwise specified. If a product edition appears with the product version, behavior is different in that product edition. + +Unless otherwise specified, any statement of optional behavior in this specification that is prescribed using the terms SHOULD or SHOULD NOT implies product behavior in accordance with the SHOULD or SHOULD NOT prescription. Unless otherwise specified, the term MAY implies that the product does not follow the prescription. + +[<1> Section 1.8](#Appendix_A_Target_1): UNIX extensions are not supported by Windows-based SMB clients and servers. The CAP_UNIX capability bit and the Information Level range are reserved to allow third party implementers to collaborate on the definition of these extensions. The development of a common set of extensions has been informally supported by the Storage Networking Industry Association (SNIA). See [\[SNIA\]](http://go.microsoft.com/fwlink/?LinkId=90519) for SNIA specification on vendor-extension fields. + +[<2> Section 2.1](#Appendix_A_Target_2): The Direct TCP transport can be used by Windows-based SMB clients and servers. + +[<3> Section 2.1](#Appendix_A_Target_3): Windows-based clients and servers use TCP port 445 as the destination TCP port on the SMB server, the well-known port number assigned by IANA to Microsoft-DS. + +[<4> Section 2.1](#Appendix_A_Target_4): Windows 7 and Windows Server 2008 R2 servers without \[MS11-048\] do not disconnect the connection if the SMB message size exceeds 0x1FFFF bytes. + +[<5> Section 2.2](#Appendix_A_Target_5): When an error occurs, Windows-based SMB servers return an Error Response message unless specifically required to return data, as specified for named pipe read operations and certain I/O control code requests and other exceptions specified in [\[MS-CIFS\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-CIFS%5d.pdf#Section_d416ff7cc536406ea9514f04b2fd1d2b). Windows-based SMB clients expect that an SMB server returns an Error Response, unless otherwise specified. Windows implementations return data along with these error codes: + +- STATUS_MORE_PROCESSING_REQUIRED on a session setup request +- STATUS_BUFFER_OVERFLOW for a read request, IOCTL request, and Query Info request +- STATUS_INVALID_PARAMETER or STATUS_INVALID_VIEW_SIZE for CopyChunk IOCTL request return data along with the header +- STATUS_STOPPED_ON_SYMLINK includes the symbolic link data +- STATUS_BUFFER_TOO_SMALL returns a ULONG containing the required size + +[<6> Section 2.2.1.1.1](#Appendix_A_Target_6): This feature is unavailable in Windows 2000 and Windows XP. When enabled previous versions of files are accessible as read-only. + +[<7> Section 2.2.1.2.2](#Appendix_A_Target_7): This value is not supported in Windows 2000. + +[<8> Section 2.2.1.2.2](#Appendix_A_Target_8): This value is not supported in Windows 2000. + +[<9> Section 2.2.1.2.2](#Appendix_A_Target_9): This value is not supported in Windows 2000. + +[<10> Section 2.2.1.2.2](#Appendix_A_Target_10): This value is not supported in Windows 2000, Windows Server 2003, Windows Server 2003 R2, Windows XP, Windows Vista, or Windows Server 2008. + +[<11> Section 2.2.1.2.2](#Appendix_A_Target_11): This value is not supported in Windows 2000, Windows Server 2003, Windows Server 2003 R2, Windows XP, Windows Vista, or Windows Server 2008. + +[<12> Section 2.2.1.2.2](#Appendix_A_Target_12): This value is not supported in Windows 2000, Windows Server 2003, Windows Server 2003 R2, Windows XP, Windows Vista, or Windows Server 2008. + +[<13> Section 2.2.1.2.2](#Appendix_A_Target_13): This value is not supported in Windows 2000, Windows Server 2003, Windows Server 2003 R2, Windows XP, Windows Vista, or Windows Server 2008. + +[<14> Section 2.2.1.3.1](#Appendix_A_Target_14): Windows guarantees uniqueness of FileIds across a single volume. + +[<15> Section 2.2.2.1](#Appendix_A_Target_15): If a client request contains an invalid command code, then Windows 2000 Server operating system and Windows XP server fail the requests by sending an error response with an NTSTATUS code of STATUS_SMB_BAD_COMMAND (ERRSRV/ERRbadcommand). Windows XP operating system Service Pack 1 (SP1), Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Vista, Windows 7, Windows Server 2008 R2, Windows 8, Windows Server 2012, Windows 8.1, Windows Server 2012 R2, Windows 10, and Windows Server 2016 servers do not respond to such a request, and do not process further requests on that connection. + +[<16> Section 2.2.2.2](#Appendix_A_Target_16): Windows-based clients and servers do not support NT_TRANSACT_CREATE2. + +[<17> Section 2.2.2.3.1](#Appendix_A_Target_17): Windows 2000 Server does not support the SMB_FIND_FILE_ID_FULL_DIRECTORY_INFO and SMB_FIND_FILE_ID_BOTH_DIRECTORY_INFO Information Levels. + +[<18> Section 2.2.2.3.5](#Appendix_A_Target_18): Pass-through Information Levels on Windows-based servers map directly to native Windows NT operating system Information Classes, as specified in [\[MS-FSCC\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-FSCC%5d.pdf#Section_efbfe12773ad41409967ec6500e66d5e) sections 2.4 and 2.5. Windows-based servers do not support setting the following NT Information Levels via the pass-through Information Level mechanism. + +| Information level | Error code | +| -------------------------- | -------------------- | +| FileLinkInformation | STATUS_NOT_SUPPORTED | +| FileMoveClusterInformation | STATUS_NOT_SUPPORTED | +| FileTrackingInformation | STATUS_NOT_SUPPORTED | +| FileCompletionInformation | STATUS_NOT_SUPPORTED | +| FileMailslotSetInformation | STATUS_NOT_SUPPORTED | + +All other Information Levels are passed through to the underlying object store or file system. Refer to \[MS-FSCC\] sections 2.4 and 2.5 for a further list of Information Levels that are not supported by Windows file systems and the error codes that can be returned. + +[<19> Section 2.2.2.3.6](#Appendix_A_Target_19): These extensions, known as UNIX extensions, are not supported by Windows-based SMB clients and servers. The CAP_UNIX capability bit and the Information Level range specified are reserved to allow third party implementers to collaborate on the definition of these extensions. The development of a common set of extensions has been informally supported by the Storage Networking Industry Association (SNIA). + +[<20> Section 2.2.2.4](#Appendix_A_Target_20): For a detailed listing of possible status codes available on Windows implementations, see [\[MS-ERREF\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-ERREF%5d.pdf#Section_1bc92ddfb79e413cbbaa99a5281a6c90). For a list of error codes used by the SMB Version 1.0 Protocol and CIFS Protocol, see \[MS-CIFS\] section 2.2.2.4. + +[<21> Section 2.2.3.1](#Appendix_A_Target_21): Windows-based servers set the bits in the **Flags2** field with the same value(s) that were sent by the client in the request. Windows-based clients ignore this field when they receive the response. + +[<22> Section 2.2.3.1](#Appendix_A_Target_22): Windows clients set this flag in all SMB requests if the client's configuration requires signing. This flag is not applicable to Windows 2000. + +[<23> Section 2.2.3.1](#Appendix_A_Target_23): Windows-based SMB servers always ignore the SMB_FLAGS2_IS_LONG_NAME flag. + +[<24> Section 2.2.4.1.2](#Appendix_A_Target_24): Windows-based servers support the notion of a guest account and set this field based on the defined guest account rights on the server. + +[<25> Section 2.2.4.1.2](#Appendix_A_Target_25): Windows-based SMB servers set this field to an arbitrary value that is ignored on receipt. The servers do not send any data in this message. + +[<26> Section 2.2.4.2.1](#Appendix_A_Target_26): Windows clients always set this field to 0xFFFFFFFF when reading from a Named Pipe or I/O device. + +[<27> Section 2.2.4.2.1](#Appendix_A_Target_27): Windows-based servers support MaxCountHigh, but ignore it if set to 0xFFFF. + +[<28> Section 2.2.4.5.2.1](#Appendix_A_Target_28): Windows defaults to a **MaxBufferSize** value of 16,644 bytes on server versions of Windows. Windows defaults to a **MaxBufferSize** value of 4,356 bytes on client versions of Windows. + +[<29> Section 2.2.4.5.2.1](#Appendix_A_Target_29): Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, and Windows Server 2016 do not support SMB_COM_READ_RAW or SMB_COM_WRITE_RAW and disconnect the client by closing the underlying transport connection if either command is received from the client. + +[<30> Section 2.2.4.5.2.1](#Appendix_A_Target_30): Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, and Windows Server 2016 do not support SMB_COM_READ_MPX or SMB_COM_WRITE_MPX and disconnect the client by closing the underlying transport connection if either command is received from the client. + +[<31> Section 2.2.4.5.2.1](#Appendix_A_Target_31): Windows-based clients assume that CAP_NT_FIND is set if CAP_NT_SMBS is set. + +[<32> Section 2.2.4.5.2.1](#Appendix_A_Target_32): Windows-based clients and servers take advantage of CAP_INFOLEVEL_PASSTHRU, when available, to prevent the need to map from native file and directory information structures to comparable SMB structures. + +[<33> Section 2.2.4.5.2.1](#Appendix_A_Target_33): With CAP_LARGE_READX enabled, Windows-based servers provide a statically configured maximum read length, which defaults to 64 kilobytes. Windows-based clients and servers support CAP_LARGE_READX, which permits file transfers larger than the negotiated MaxBufferSize. + +[<34> Section 2.2.4.5.2.1](#Appendix_A_Target_34): Windows-based clients and servers support CAP_LARGE_WRITEX, which permits file transfers larger than the negotiated MaxBufferSize. + +[<35> Section 2.2.4.5.2.1](#Appendix_A_Target_35): Windows 2000 and Windows XP clients and servers support CAP_LWIO. + +[<36> Section 2.2.4.5.2.1](#Appendix_A_Target_36): Windows-based clients and servers do not support CAP_UNIX; therefore, this capability is never set. + +[<37> Section 2.2.4.5.2.1](#Appendix_A_Target_37): Windows-based clients and servers do not support CAP_COMPRESSED_DATA, and this capability is never set. + +[<38> Section 2.2.4.5.2.1](#Appendix_A_Target_38): Windows servers do not set the CAP_DYNAMIC_REAUTH flag, even if dynamic re-authentication is supported. On Windows XP, Windows Server 2003, Windows Server 2003 R2, Windows Vista, Windows Server 2008, Windows 7, Windows Server 2008 R2, Windows 8, Windows Server 2012, Windows 8.1, Windows Server 2012 R2, Windows 10, and Windows Server 2016, all clients and servers support dynamic re-authentication. + +[<39> Section 2.2.4.5.2.1](#Appendix_A_Target_39): Windows-based clients and servers do not support CAP_PERSISTENT_HANDLES. + +[<40> Section 2.2.4.5.2.1](#Appendix_A_Target_40): Windows-based clients use the **ServerGUID** field. + +[<41> Section 2.2.4.5.2.2](#Appendix_A_Target_41): Windows-based servers default to a **MaxBufferSize** value of 16,644 bytes. Windows-based clients default to a **MaxBufferSize** value of 4,356 bytes. + +[<42> Section 2.2.4.5.2.2](#Appendix_A_Target_42): Windows-based clients expect 8-byte cryptographic challenges. Windows-based servers provide 8-bit cryptographic challenges. + +[<43> Section 2.2.4.6.1](#Appendix_A_Target_43): Windows-based servers only check for and store a small number of client capabilities: + +- CAP_UNICODE +- CAP_LARGE_FILES +- CAP_NT_SMBS +- CAP_NT_FIND +- CAP_NT_STATUS +- CAP_EXTENDED_SECURITY +- CAP_LEVEL_II_OPLOCKS + +Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, and Windows Server 2016 also check for CAP_DYNAMIC_REAUTH. + +[<44> Section 2.2.4.6.1](#Appendix_A_Target_44): Windows-based SMB clients set this field based upon the version and service pack level of the Windows operating system. A list of possible values for this field includes the following. + +| Windows OS version | Native OS string | +| -------------------------------------------------------------- | --------------------------------------- | +| Windows 2000 | Windows 5.0 | +| Windows XP operating system Service Pack 2 (SP2) | Windows 2002 Service Pack 2 | +| Windows Server 2003 operating system with Service Pack 2 (SP2) | Windows Server 2003 3790 Service Pack 2 | + +Windows Vista, Windows Server 2008, Windows 7, Windows Server 2008 R2, Windows 8, Windows Server 2012, Windows 8.1, Windows Server 2012 R2, and Windows Server 2016 set this field to an empty string. + +[<45> Section 2.2.4.6.1](#Appendix_A_Target_45): Windows-based SMB clients set this field based upon the version of the Windows operating system. A list of possible values for this field includes the following: + +| Windows OS version | NativeLanMan string | +| ------------------- | ------------------------ | +| Windows 2000 | Windows 2000 LAN Manager | +| Windows XP SP2 | Windows 2002 5.1 | +| Windows Server 2003 | Windows Server 2003 5.2 | + +Windows Vista, Windows Server 2008, Windows 7, Windows Server 2008 R2, Windows 8, Windows Server 2012, Windows 8.1, Windows Server 2012 R2, and Windows Server 2016 set this field to an empty string. + +[<46> Section 2.2.4.7.2](#Appendix_A_Target_46): SMB clients on Windows XP, Windows Vista, Windows 7, Windows 8, Windows 8.1, and Windows 10 cache directory information if this bit is set on a share. SMB clients on all server versions of Windows do not cache directory information by default even if this bit is set on a share. Caching directory information by SMB clients on Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, and Windows Server 2016 can be enabled via a Windows registry setting. Windows 2000 operating system does not support directory caching. + +[<47> Section 2.2.4.7.2](#Appendix_A_Target_47): Windows-based clients and servers support the notion of a guest account and set this field to the access allowed for the guest account. + +[<48> Section 2.2.4.9.1](#Appendix_A_Target_48): Windows 7, Windows Server 2008 R2, Windows 8, Windows Server 2012, Windows 8.1, Windows Server 2012 R2, Windows 10, and Windows Server 2016 also support two new **CreateOptions** flags: + +- FILE_OPEN_REQUIRING_OPLOCK (0x00010000). Windows Vista, Windows Server 2008, Windows 7, Windows Server 2008 R2, Windows 8, Windows Server 2012, Windows 8.1, Windows Server 2012 R2, Windows 10, and Windows Server 2016 ignore this bit if set in the request. All other Windows-based SMB servers fail requests with the FILE_OPEN_REQUIRING_OPLOCK option set, and return STATUS_INVALID_PARAMETER in the **Status** field of the SMB header in the server response. +- FILE_DISALLOW_EXCLUSIVE (0x00020000). Windows Vista, Windows Server 2008, Windows 7, Windows Server 2008 R2, Windows 8, Windows Server 2012, Windows 8.1, Windows Server 2012 R2, Windows 10, and Windows Server 2016 ignore this bit if it is set in the request. All other Windows-based SMB servers fail requests with this option set, and return STATUS_INVALID_PARAMETER in the **Status** field of the SMB header in the server response. + +[<49> Section 2.2.4.9.2](#Appendix_A_Target_49): Windows-based SMB servers send 50 (0x32) words in the extended response although they set the **WordCount** field to 0x2A. + +[<50> Section 2.2.4.9.2](#Appendix_A_Target_50): Windows-based servers set the **VolumeGUID** field to zero; otherwise, this field is uninitialized. The **VolumeGUID** field is ignored by Windows-based SMB clients. + +[<51> Section 2.2.4.9.2](#Appendix_A_Target_51): Windows-based servers set the **FileId** field to zero. The **FileId** field is ignored by Windows-based SMB clients. + +[<52> Section 2.2.4.9.2](#Appendix_A_Target_52): Windows-based servers and clients support the notion of a guest account. + +[<53> Section 2.2.4.9.2](#Appendix_A_Target_53): Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, and Windows Server 2016 set this field to zero; otherwise, this field can be sent uninitialized. + +[<54> Section 2.2.5.1](#Appendix_A_Target_54): Windows-based clients never send this request. Windows-based servers fail this request with STATUS_INVALID_PARAMETER. + +[<55> Section 2.2.5.2](#Appendix_A_Target_55): Windows-based clients never send this request. + +[<56> Section 2.2.6.1.1](#Appendix_A_Target_56): Windows-based clients do not issue TRANS2_FIND_FIRST2 requests with the special @GMT-\* pattern in the **FileName** field natively. Applications that run on Windows-based clients, however, are allowed to explicitly include the @GMT-\* pattern in the pathname that they supply. + +[<57> Section 2.2.6.1.1](#Appendix_A_Target_57): Windows-based clients allow the @GMT-\* wildcard to be sent using Information Levels other than SMB_COM_FIND_FILE_BOTH_DIRECTORY_INFO. + +[<58> Section 2.2.6.4](#Appendix_A_Target_58): Support for this subcommand was introduced in Windows 2000. + +[<59> Section 2.2.7.1.2](#Appendix_A_Target_59): Windows-based servers set the **VolumeGUID** field to zero; otherwise, this field is uninitialized. The **VolumeGUID** field is ignored by Windows-based SMB clients. + +[<60> Section 2.2.7.1.2](#Appendix_A_Target_60): Windows-based servers set the **FileId** field to zero. The **FileId** field is ignored by Windows-based SMB clients. + +[<61> Section 2.2.7.1.2](#Appendix_A_Target_61): Windows-based servers and clients support guest accounts. + +[<62> Section 2.2.7.2.1](#Appendix_A_Target_62): Only Windows Server 2003 operating system with Service Pack 1 (SP1), Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, and Windows Server 2016 support these new FSCTLs. All other Windows-based servers fail requests that contain these FSCTL codes with STATUS_NOT_SUPPORTED. + +[<63> Section 2.2.7.2.1](#Appendix_A_Target_63): A definitive list of Windows FSCTL and IOCTL control codes and their structures (if any) is specified in \[MS-FSCC\] section 2.3. + +[<64> Section 2.2.7.2.1](#Appendix_A_Target_64): Only Windows Server 2003 with SP1, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, and Windows Server 2016 support this FSCTL. All other Windows-based servers fail the request with STATUS_NOT_SUPPORTED. + +[<65> Section 2.2.7.2.1](#Appendix_A_Target_65): Only Windows Server 2003 with SP1, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, and Windows Server 2016 servers support this FSCTL. All other Windows-based servers fail the request with STATUS_NOT_SUPPORTED. + +[<66> Section 2.2.7.2.1.1](#Appendix_A_Target_66): Windows-based clients do not initialize the **Reserved** field to zero. + +[<67> Section 2.2.7.2.2.2](#Appendix_A_Target_67): Windows-based servers set this field to an arbitrary number of uninitialized bytes. + +[<68> Section 2.2.8.1.1](#Appendix_A_Target_68): Windows-based SMB servers set the **FileIndex** field to a nonzero value if the underlying object store supports indicating the position of a file within the parent directory. + +[<69> Section 2.2.8.1.2](#Appendix_A_Target_69): The SMB_FIND_FILE_ID_FULL_DIRECTORY_INFO Information Level is not present in Windows 2000 Server and Windows XP. + +[<70> Section 2.2.8.1.2](#Appendix_A_Target_70): Windows-based SMB servers set the **FileIndex** field to a nonzero value if the underlying object store supports indicating the position of a file within the parent directory. + +[<71> Section 2.2.8.1.2](#Appendix_A_Target_71): Windows-based servers set this field to an arbitrary value. + +[<72> Section 2.2.8.1.3](#Appendix_A_Target_72): The SMB_FIND_FILE_ID_BOTH_DIRECTORY_INFO Information Level is not present in Windows 2000 Server and Windows XP. + +[<73> Section 2.2.8.1.3](#Appendix_A_Target_73): Windows-based SMB servers set the **FileIndex** field to a nonzero value if the underlying object store supports indicating the position of a file within the parent directory. + +[<74> Section 2.2.8.2.1](#Appendix_A_Target_74): The following attribute flags are removed by the Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, and Windows Server 2016 SMB server before sending the attribute data block to the client: + +- FILE_SUPPORTS_TRANSACTIONS +- FILE_SUPPORTS_OPEN_BY_FILE_ID + +[<75> Section 3.2.1.1](#Appendix_A_Target_75): Windows 2000 Server supports the _Disabled_ state. + +[<76> Section 3.2.3](#Appendix_A_Target_76): **Client.SupportsExtendedSecurity** is TRUE for Windows-based clients. + +[<77> Section 3.2.3](#Appendix_A_Target_77): Windows-based SMB clients on Windows 2000, Windows XP, and Windows Vista support 32-bit process IDs and use this field when sending the following SMB messages: SMB_COM_NT_CREATE_ANDX and SMB_COM_OPEN_PRINT_FILE. Windows-based SMB clients on Windows 2000, Windows XP, and Windows Vista also support and use this field when sending SMB_COM_TRANSACTION, SMB_COM_TRANSACTION2, and SMB_COM_TRANSACT messages when the server supports the CAP_NT_SMBS bit. The CAP_NT_SMBS bit is set in the Capabilities field in the SMB_COM_NEGOTIATE response (\[MS-CIFS\] section 2.2.4.52.2). Windows 7, Windows 8, Windows 8.1, and Windows 10 SMB clients do not support 32-bit process IDs and set this field to zero when sending SMB messages. Windows-based SMB servers support 32-bit process IDs when receiving SMB messages. + +[<78> Section 3.2.4.1.1](#Appendix_A_Target_78): Windows XP, Windows Vista, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows 7, Windows Server 2008 R2, Windows 8, Windows Server 2012, Windows 8.1, Windows Server 2012 R2, Windows 10, and Windows Server 2016 clients scan pathnames for previous version tokens and set the SMB_FLAGS2_REPARSE_PATH flag if a token is found. + +[<79> Section 3.2.4.2.4](#Appendix_A_Target_79): Windows-based SMB clients use the same connection to a server for all authentications other than terminal services. **Connections** configured for terminal services use one connection per user. + +[<80> Section 3.2.4.2.4](#Appendix_A_Target_80): In an [SMB_COM_SESSION_SETUP_ANDX request (section 2.2.4.6.1)](#Section_a00d03613544484596ab309b4bb7705d), Windows-based SMB clients initialize the **SMB_Header.SecurityFeatures** field to 'BSRSPYL' (0x42 0x53 0x52 0x53 0x50 0x59 0x4C). Windows-based SMB servers ignore this value. + +[<81> Section 3.2.4.2.4](#Appendix_A_Target_81): Windows-based clients implement this option. + +[<82> Section 3.2.4.2.4](#Appendix_A_Target_82): + +- Windows-based clients support extended security. +- Windows systems implement the first option that is previously described. + +[<83> Section 3.2.4.2.4.1](#Appendix_A_Target_83): Windows-based SMB clients are configured by default to not send plain text passwords. Sending plain text passwords can be configured via a registry setting. + +[<84> Section 3.2.4.2.5](#Appendix_A_Target_84): Windows 2000 client does not request **Client.Session.SessionKey** protection. + +[<85> Section 3.2.4.3](#Appendix_A_Target_85): Windows-based clients issue an SMB_COM_NT_CREATE_ANDX request for the NT LM 0.12 dialect for which all of the extensions here are described. + +[<86> Section 3.2.4.3.2](#Appendix_A_Target_86): Windows-based clients do not use this flag. + +[<87> Section 3.2.4.4](#Appendix_A_Target_87): Windows-based clients set the **Timeout** field to 0xFFFFFFFF on pipe reads. + +[<88> Section 3.2.4.4.1](#Appendix_A_Target_88): Windows-based clients issue large reads if the server supports them. + +[<89> Section 3.2.4.6](#Appendix_A_Target_89): Windows-based clients send these requests to the server regardless of the Information Level provided in the request. + +[<90> Section 3.2.4.11.1](#Appendix_A_Target_90): Windows XP, Windows Vista, Windows 7, Windows 8, Windows 8.1, and Windows 10 clients use this FSCTL. Windows 2000-based clients can use this FSCTL if the previous versions' down-level application is installed on them. + +[<91> Section 3.2.4.12](#Appendix_A_Target_91): Windows XP operating system Service Pack 3 (SP3), Windows Server 2003 with SP1, Windows Server 2003 R2, Windows Vista, Windows Server 2008, Windows 7, Windows Server 2008 R2, Windows 8, Windows Server 2012, Windows 8.1, Windows Server 2012 R2, Windows 10, and Windows Server 2016 clients support DFS. + +[<92> Section 3.2.5.2](#Appendix_A_Target_92): Windows-based SMB servers support Extended Security. They all are configured to use SPNEGO, as specified in [\[RFC4178\]](http://go.microsoft.com/fwlink/?LinkId=90461), as their GSS authentication protocol. Windows operating systems that use extended security send a GSS token (or fragment) if their SPNEGO implementation supports it. See \[RFC4178\] for details on Windows behavior. + +[<93> Section 3.2.5.2](#Appendix_A_Target_93): When the server completes negotiation and returns the CAP_EXTENDED_SECURITY flag as not set, Windows-based SMB clients query the [**Key Distribution Center (KDC)**](#gt_6e5aafba-6b66-4fdd-872e-844f142af287) to verify whether a service ticket is registered for the given [**security principal name (SPN)**](#gt_2f43ba25-67d2-491e-9282-8ee83d855397). If the query indicates that the [**SPN**](#gt_547217ca-134f-4b43-b375-f5bca4c16ce4) is registered with the KDC, then the SMB client terminates the connection and returns an implementation-specific security downgrade error to the caller. + +[<94> Section 3.2.5.3](#Appendix_A_Target_94): The Windows GSS implementation supports raw Kerberos / NTLM messages in the **SecurityBlob** as described in [\[MS-AUTHSOD\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-AUTHSOD%5d.pdf#Section_953d700a57cb4cf7b0c3a64f34581cc9) section 2.1.2.2. + +[<95> Section 3.2.5.3](#Appendix_A_Target_95): Windows Vista operating system with Service Pack 1 (SP1), Windows Server 2008, Windows 7, Windows Server 2008 R2 operating system, Windows 8, Windows Server 2012, Windows 8.1, Windows Server 2012 R2, Windows 10, and Windows Server 2016 servers fail a non-extended security session setup request with STATUS_INVALID_PARAMETER if the registry key is either missing or set to zero. + +[<96> Section 3.3.2.1](#Appendix_A_Target_96): Windows-based servers implement this timer with a default value of 300 seconds. + +[<97> Section 3.3.3](#Appendix_A_Target_97): **SupportsExtendedSecurity** is TRUE for Windows-based clients. + +[<98> Section 3.3.3](#Appendix_A_Target_98): Windows Server 2003 with SP1, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, and Windows Server 2016 set this value to 256. + +[<99> Section 3.3.3](#Appendix_A_Target_99): Windows Server 2003 with SP1, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, and Windows Server 2016 set this value to 1 megabyte. + +[<100> Section 3.3.3](#Appendix_A_Target_100): Windows Server 2003 with SP1, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, and Windows Server 2016 set this value to 16 megabytes. + +[<101> Section 3.3.3](#Appendix_A_Target_101): Windows Server 2003 with SP1, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, and Windows Server 2016 set this value to 25 seconds. + +[<102> Section 3.3.4.1.1](#Appendix_A_Target_102): Windows servers do not respond with an OS/2 error on the wire even if SMB_FLAGS2_NT_STATUS is set in the client request (see \[MS-CIFS\] section 2.2.3.1). If the negotiated dialect is DOS LANMAN 2.0, DOS LANMAN 2.1, or prior to LANMAN 1.0, an ERROR_GEN_FAILURE error is returned. Otherwise, the following table lists the corresponding DOS error (see \[MS-CIFS\] section 2.2.2.4 SMB Error Classes and Codes) that is returned: + +| OS/2 Error | DOS Error | +| ------------------------------------- | -------------------------------- | +| STATUS_OS2_INVALID_LEVEL | ERRunknownlevel | +| STATUS_OS2_EA_LIST_INCONSISTENT | ERRbadealist | +| STATUS_OS2_NEGATIVE_SEEK | ERRinvalidseek | +| STATUS_OS2_NO_MORE_SIDS | ERROR_NO_MORE_SEARCH_HANDLES | +| STATUS_OS2_EAS_DIDNT_FIT | ERROR_EAS_DIDNT_FIT | +| STATUS_OS2_EA_ACCESS_DENIED | ERROR_EA_ACCESS_DENIED | +| STATUS_OS2_CANCEL_VIOLATION | ERROR_CANCEL_VIOLATION | +| STATUS_OS2_ATOMIC_LOCKS_NOT_SUPPORTED | ERROR_ATOMIC_LOCKS_NOT_SUPPORTED | +| STATUS_OS2_CANNOT_COPY | ERROR_CANNOT_COPY | + +[<103> Section 3.3.5.1](#Appendix_A_Target_103): Windows XP, Windows 2000, Windows Server 2003, Windows Server 2003 R2, Windows Vista, Windows Server 2008, Windows 7, and Windows Server 2008 R2 fail a TREE_CONNECT_ANDX request to a share that does not allow anonymous access with STATUS_ACCESS_DENIED. All other requests, which require an access check (such as opening a file), are failed with STATUS_INVALID_HANDLE. + +[<104> Section 3.3.5.1](#Appendix_A_Target_104): Windows XP, Windows 2000, Windows Server 2003, Windows Server 2003 R2, Windows Vista, Windows Server 2008, Windows 7, and Windows Server 2008 R2 will fail the request with STATUS_ACCESS_DENIED. + +[<105> Section 3.3.5.1](#Appendix_A_Target_105): Windows XP, Windows 2000, Windows Server 2003, Windows Server 2003 R2, Windows Vista, Windows Server 2008, Windows 7, and Windows Server 2008 R2 will fail the request with STATUS_ACCESS_DENIED. + +[<106> Section 3.3.5.1.1](#Appendix_A_Target_106): SMB servers on Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, and Windows Server 2012 support the SMB_FLAGS2_REPARSE_PATH flag and previous version access. An SMB server on Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, or Windows Server 2016 parses paths when the flag is not set but only when configured to do so. This flag is used to expose the previous version logic to applications that run on clients whose SMB client does not understand the SMB_FLAGS2_REPARSE_PATH flag and does not set it. + +[<107> Section 3.3.5.1.2](#Appendix_A_Target_107): Windows servers grant level II oplocks, even if the client does not request an oplock. + +[<108> Section 3.3.5.2](#Appendix_A_Target_108): Windows-based SMB servers support Extended Security, and are configured to use SPNEGO (as specified in \[RFC4178\]) as their GSS authentication protocol. Windows operating systems that use extended security send a GSS token (or fragment) if their SPNEGO implementation supports it. For details on Windows behavior, see \[RFC4178\]. + +[<109> Section 3.3.5.3](#Appendix_A_Target_109): Windows 8, Windows Server 2012, Windows 8.1, Windows Server 2012 R2, and Windows Server 2016 fail the [SMB_COM_SESSION_SETUP_ANDX request](#Section_1f152df0a61d4e769af6da96fa783c02) with STATUS_ACCESS_DENIED if both the EncryptData and RejectUnencryptedAccess registry keys are set to nonzero values. + +[<110> Section 3.3.5.3](#Appendix_A_Target_110): The Windows GSS implementation supports raw Kerberos / NTLM messages in the **SecurityBlob** as described in \[MS-AUTHSOD\] section 2.1.2.2. If the client sends a zero length **SecurityBlob** in the request, the server-initiated SPNEGO exchange will be used. + +[<111> Section 3.3.5.3](#Appendix_A_Target_111): NTLM authentication has no expiration time, so authentications done with NTLM do not expire. For the Windows implementation of Kerberos expiration time, see [\[MS-KILE\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-KILE%5d.pdf#Section_2a32282edd484ad9a542609804b02cc9) section 3.3.1. + +[<112> Section 3.3.5.4](#Appendix_A_Target_112): Windows 8, Windows Server 2012, Windows 8.1, Windows Server 2012 R2, Windows 10, and Windows Server 2016 fail the [SMB_COM_TREE_CONNECT_ANDX request](#Section_8e1132db35514a439552326236eb2c67) with STATUS_ACCESS_DENIED, if **Share.ShareFlags** contains SHI1005_FLAGS_ENCRYPT_DATA and the **RejectUnencryptedAccess** registry key is set to a nonzero value. + +[<113> Section 3.3.5.4](#Appendix_A_Target_113): Windows 2000 never sets the SMB_UNIQUE_FILE_NAME bit in the **OptionalSupport** field. + +Windows XP sets the SMB_UNIQUE_FILE_NAME bit in the **OptionalSupport** field only if short file name generation is disabled by setting the NtfsDisable8dot3NameCreation registry key to 1; see [\[MSKB-121007\]](http://go.microsoft.com/fwlink/?LinkId=228457). + +Windows Server 2003, Windows Server 2003 R2, Windows Vista, Windows Server 2008, Windows 7, Windows Server 2008 R2, Windows 8, Windows Server 2012, Windows 8.1, Windows Server 2012 R2, Windows 10, and Windows Server 2016 also set the SMB_UNIQUE_FILE_NAME bit in the **OptionalSupport** field if the NoAliasingOnFilesystem registry key is set to 1 (enabled). + +[<114> Section 3.3.5.4](#Appendix_A_Target_114): Windows 2000, Windows Server 2003, and Windows Server 2003 R2 set **GuestMaximalAccessRights** to access rights granted for null session. Windows Vista, Windows Server 2008, Windows 7, Windows Server 2008 R2, Windows 8, Windows Server 2012, Windows 8.1, Windows Server 2012 R2, Windows 10, and Windows Server 2016 set **GuestMaximalAccessRights** to zero. + +[<115> Section 3.3.5.5](#Appendix_A_Target_115): Windows servers open or create files in the object store as described in [\[MS-FSA\]](file:///E:\Target\Windows\Published\Books\MS-SMB%5bMS-FSA%5d.pdf#Section_860b1516c45247b4bdbc625d344e2041) section 2.1.5.1 Server Requests an Open of a File, with the following mapping of input elements: + +- **RootOpen** is provided in one of two ways: + - If the **SMB_Parameters.Words.RootDirectoryFID** field is zero, **RootOpen** is provided by using the **SMB_Header.TID** field to find the matching **Server.TreeConnect** in the **Server.Connection.TreeConnectTable**. The server then acquires an **Open** on the **Server.TreeConnect.Share.LocalPath**, which is passed as **RootOpen**. + - If the **SMB_Parameters.Words.RootDirectoryFID** field is non-zero, **RootOpen** is provided by looking up the **RootDirectoryFID** field in the **Server.Connection.FileOpenTable**. +- **PathName** is the **SMB_Data.Bytes.FileName** field of the request. +- **SecurityContext** is found by using the **SMB_Header.UID** field to look up the matching **Session** entry in the **Server.Connection.SessionTable**. The **Server.Session.UserSecurityContext** is passed as **SecurityContext**. +- **UserCertificate** is the certificate returned by the User-Certificate binding obtained during request processing. +- **DesiredAccess** is the **SMB_Parameters.Words.DesiredAccess** field of the request. The FILE_READ_ATTRIBUTES option is added (using a bitwise OR) to the set provided by the client. If the FILE_NO_INTERMEDIATE_BUFFERING flag is set, it is cleared, and FILE_WRITE_THROUGH is set. +- **ShareAccess** is the **SMB_Parameters.Words.ShareAccess** field of the request. +- **CreateOptions** is the **SMB_Parameters.Words.CreateOptions** field of the request. The FILE_COMPLETE_IF_OPLOCKED option is added (using a bitwise OR) to the set provided by the client. If the FILE_NO_INTERMEDIATE_BUFFERING flag is set, it is cleared, and FILE_WRITE_THROUGH is set. +- **CreateDisposition** is the **SMB_Parameters.Words.CreateDisposition** field of the request. +- **DesiredFileAttributes** is the **SMB_Parameters.Words.ExtFileAttributes** field of the request. +- **IsCaseSensitive** is set to FALSE if the SMB_FLAGS_CASE_INSENSITIVE bit is set in the **SMB_Header.Flags** field of the request. Otherwise, **IsCaseSensitive** is set depending upon system defaults. +- **OpLockKey** is empty. + +The returned **Status** is copied into the **SMB_Header.Status** field of the response. If the operation fails, the **Status** is returned in an Error Response, and processing is complete. + +If the operation is successful, processing continues as follows: + +- If either the NT_CREATE_REQUEST_OPLOCK or the NT_CREATE_REQUEST_OPBATCH flag is set in the **SMB_Parameters.Words.Flags** field of the request, an OpLock is requested. Windows servers obtain OpLocks as described in \[MS-FSA\], section 3.1.5.17 Server Requests an Oplock, with the following mapping of input elements: + - **Open** is the **Open** passed through from the preceding operation. + - **Type** is LEVEL_BATCH if the NT_CREATE_REQUEST_OPBATCH flag is set, or LEVEL_ONE if the NT_CREATE_REQUEST_OPLOCK flag is set. + +If an OpLock is granted, the **SMB_Parameters.Words.OpLockLevel** field of the response is set. + +- Windows servers obtain the extended file attribute and timestamp response information by querying file information from the [**object store**](#gt_0cc469e1-4b1f-41c4-9f94-d6209fcf468e) as described in \[MS-FSA\], section 3.1.5.11 Server Requests a Query of File Information, with the following mapping of input elements: + - **Open** is the **Open** passed through from the preceding operations. + - **FileInformationClass** is **FileBasicInformation** (\[MS-FSCC\] section 2.4.7). + +If the query fails, the **Status** is returned in an Error Response, and processing is complete. Otherwise: + +- - **SMB_Parameters.Words.ExtFileAttributes** is set to **OutputBuffer.FileAttributes**. + - **SMB_Parameters.Words.CreateTime** is set to **OutputBuffer.CreateTime**. + - **SMB_Parameters.Words.LastAccessTime** is set to **OutputBuffer.LastAccessTime**. + - **SMB_Parameters.Words.LastWriteTime** is set to **OutputBuffer.LastWriteTime**. + - **SMB_Parameters.Words.LastChangeTime** is set to **OutputBuffer.ChangeTime**. +- Windows servers obtain the file size response field values by querying file information from the object store as described in \[MS-FSA\], section 3.1.5.11 Server Requests a Query of File Information, with the following mapping of input elements: + - **Open** is the **Open** passed through from the preceding operations. + - **FileInformationClass** is **FileStandardInformation** (\[MS-FSCC\] section 2.4.38). + +If the query fails, the **Status** is returned in an Error Response, and processing is complete. Otherwise: + +- - **SMB_Parameters.Words.AllocationSize** is set to **OutputBuffer.AllocationSize**. + - **SMB_Parameters.Words.EndOfFile** is set to **OutputBuffer.EndOfFile**. + +If the query fails, the **Status** is returned in an Error Response, and processing is complete. + +- **Open.File.FileType** is used to set the **SMB_Parameters.Words.ResourceType** and **SMB_Parameters.Words.Directory** fields of the response. +- A new **FID** is generated for the **Open** returned. All of the other results of the **Open** operation are ignored. The **FID** is copied into the **SMB_Parameters.Words.FID** field of the response. + +[<116> Section 3.3.5.5](#Appendix_A_Target_116): Windows 2000, Windows XP, Windows Server 2003, Windows Server 2003 R2, Windows Vista, Windows Server 2008, Windows 7, Windows Server 2008 R2, Windows 8, and Windows Server 2012 do not perform this verification. + +[<117> Section 3.3.5.5](#Appendix_A_Target_117): When the client sends a batched request that begins with an SMB_COM_NT_CREATE_ANDX request with the NT_CREATE_REQUEST_EXTENDED_RESPONSE bit set in the **Flags** field, Windows-based servers return the DOS error code ERRSRV/ERRerror and return an extended response only for the SMB_COM_NT_CREATE_ANDX request. + +[<118> Section 3.3.5.5](#Appendix_A_Target_118): Windows-based servers set the **FileStatusFlags** using the following mapping of output elements specified in \[MS-FSA\] section 2.1.5.1: + +- NO_EAS is set if the returned **Open.File.ExtendedAttributesLength** is zero, otherwise it is not set. +- NO_SUBSTREAMS is set if the returned **Open.File.StreamList** is less than or equal to one, otherwise it is not set. +- NO_REPARSETAG is set if the returned Open.File.ReparseTag is empty, otherwise it is not set. + +[<119> Section 3.3.5.5](#Appendix_A_Target_119): **[NTFS](#gt_86f79a17-c0be-4937-8660-0cf6ce5ddc1a)** supports streams. [**FAT**](#gt_f2bf797b-e733-4fb9-b5e5-7e122f4abbe0) and FAT32 file systems do not support streams. + +[<120> Section 3.3.5.5](#Appendix_A_Target_120): SMB servers on Windows 2000 Server, Windows Server 2003, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, and Windows Server 2016 return zero for the **VolumeGUID** and **FileId**. All other Windows-based servers set the **VolumeGUID** and **FileId** fields using the following mapping of output elements, specified in \[MS-FSA\] section 2.1.5.1: + +- **VolumeGUID** is set to the returned **Open.File.Volume.VolumeId**. +- **FileId** is set to the returned **Open.File.FileId**. + +[<121> Section 3.3.5.5](#Appendix_A_Target_121): Windows-based servers set the **MaximalAccessRights** and **GuestMaximalAccessRights** fields using the following mapping of output elements, specified in \[MS-FSA\] section 2.1.5.1: + +- **MaximalAccessRights** is set to the returned **Open.GrantedAcess**. +- Windows 2000, Windows Server 2003, and Windows Server 2003 R2 set **GuestMaximalAccessRights** to access rights granted for null session. +- Windows Vista, Windows Server 2008, Windows 7, Windows Server 2008 R2, Windows 8, Windows Server 2012, Windows 8.1, Windows Server 2012 R2, Windows 10, and Windows Server 2016 set **GuestMaximalAccessRights** to zero. + +[<122> Section 3.3.5.6](#Appendix_A_Target_122): Windows servers open existing files in the object store as described in \[MS-FSA\] section 2.1.5.1 Server Requests an Open of a File, with the following mapping of input elements: + +- **RootOpen** is provided by using the **SMB_Header.TID** to find the matching **Server.TreeConnect** in the **Server.Connection.TreeConnectTable**. The server then acquires an **Open** on **Server.TreeConnect.Share.LocalPath**, which is passed as **RootOpen**. +- **PathName** is the **SMB_Data.Bytes.FileName** field from the request. +- **SecurityContext** is found by using the **SMB_Header.UID** to look up the matching **Session** entry in the **Server.Connection.SessionTable**. The **Server.Session.UserSecurityContext** is passed as **SecurityContext**. +- **UserCertificate** is the certificate returned by the User-Certificate binding obtained during request processing. +- **DesiredAccess** is set as follows: + - The **AccessMode** subfield of the **AccessMode** field in the request is used to set the value of **DesiredAccess**. The **AccessMode** subfield represents the lowest-order four bits of the **AccessMode** field (0x0007), as shown in the table in \[MS-CIFS\] section 2.2.4.3.1. The mapping of values is as follows: + +| AccessMode.AccessMode | DesiredAccess | +| --------------------- | -------------------------------------------------------------- | +| 0 | GENERIC_READ 0x80000000 | +| 1 | GENERIC_WRITE \| FILE_READ_ATTRIBUTES 0x40000000 \| 0x00000080 | +| 2 | GENERIC_READ \| GENERIC_WRITE 0x80000000 \| 0x40000000 | +| 3 | GENERIC_READ \| GENERIC_EXECUTE 0x80000000 \| 0x20000000 | + +For any other value of **AccessMode.AccessMode**, this algorithm returns STATUS_OS2_INVALID_ACCESS (ERRDOS/ERRbadaccess). + +- **ShareAccess** is set as follows: + - The **SharingMode** subfield of the **AccessMode** field in the request is used to set the value of **ShareAccess**. The **SharingMode** subfield is a 4-bit subfield of the **AccessMode** field (0x0070), as shown in the table in \[MS-CIFS\] section 2.2.4.3.1. The mapping of values is as follows: + +| AccessMode.SharingMode | ShareAccess | +| ---------------------- | ----------------------------------- | +| 0 | Compatibility mode (see below) | +| 1 | 0x0L (don't share, exclusive use) | +| 2 | FILE_SHARE_READ | +| 3 | FILE_SHARE_WRITE | +| 4 | FILE_SHARE_READ \| FILE_SHARE_WRITE | +| 0xFF | FCB mode (see below) | + +- - For Compatibility mode, special filename suffixes (after the '.' in the filename) are mapped to **SharingMode** 4. The special filename suffix set is: "EXE", "DLL", "SYM", and "COM". All other file names are mapped to **SharingMode** 3. + - For FCB mode, if the file is already open on the server, the current sharing mode of the existing Open is preserved, and a **FID** for the file is returned. If the file is not already open on the server, the server attempts to open the file using **SharingMode** 1. + - For any other value of **AccessMode.SharingMode**, this algorithm returns STATUS_OS2_INVALID_ACCESS (ERRDOS/ERRbadaccess). +- **CreateOptions** bits are set as follows: + +| CreateOptions value | SMB_COM_OPEN_ANDX equivalent | +| ------------------------------ | ---------------------------------------------------------------------- | +| FILE_WRITE_THROUGH | AccessMode.WritethroughMode == 1 | +| FILE_SEQUENTIAL_ONLY | AccessMode.ReferenceLocality == 1 | +| FILE_RANDOM_ACCESS | AccessMode.ReferenceLocality == 2 or AccessMode.ReferenceLocality == 3 | +| FILE_NO_INTERMEDIATE_BUFFERING | AccessMode.CacheMode == 1 | +| FILE_NON_DIRECTORY_FILE | Is set | +| FILE_COMPLETE_IF_OPLOCKED | Is set | +| FILE_NO_EA_KNOWLEDGE | SMB_Header.Flags2.SMB_FLAGS2_KNOWS_EAS == 0 | + +- - All other bits are unused. +- **CreateDisposition** is set as follows: + +| CreateDisposition value | SMB_Parameters.Word.OpenMode equivalent | +| --------------------------------------------------------------------------- | --------------------------------------- | +| Invalid combination; return STATUS_OS2_INVALID_ACCESS (ERRDOS/ERRbadaccess) | FileExistsOpts = 0 & CreateFile = 0 | +| FILE_CREATE | FileExistsOpts = 0 & CreateFile = 1 | +| FILE_OPEN | FileExistsOpts = 1 & CreateFile = 0 | +| FILE_OPEN_IF | FileExistsOpts = 1 & CreateFile = 1 | +| FILE_OVERWRITE | FileExistsOpts = 2 & CreateFile = 0 | +| FILE_OVERWRITE_IF | FileExistsOpts = 2 & CreateFile = 1 | + +[<123> Section 3.3.5.6](#Appendix_A_Target_123): Windows-based servers set the **MaximalAccessRights** and **GuestMaximalAccessRights** fields using the following mapping of output elements specified in \[MS-FSA\] section 2.1.5.1: + +- **MaximalAccessRights** is set to the returned **Open.GrantedAcess**. +- Windows 2000, Windows Server 2003, and Windows Server 2003 R2 set **GuestMaximalAccessRights** to access rights granted for null session. +- Windows Vista, Windows Server 2008, Windows 7, Windows Server 2008 R2, Windows 8, Windows Server 2012, Windows 8.1, Windows Server 2012 R2, Windows 10, and Windows Server 2016 set **GuestMaximalAccessRights** to zero. + +[<124> Section 3.3.5.7](#Appendix_A_Target_124): Windows Vista, Windows Server 2008, Windows 7, Windows Server 2008 R2, Windows 8, Windows Server 2012, Windows 8.1, Windows Server 2012 R2, Windows 10, and Windows Server 2016 SMB servers fail the SMB_COM_READ_ANDX request with STATUS_INVALID_SMB if it is compounded with an SMB_COM_CLOSE request. + +[<125> Section 3.3.5.7](#Appendix_A_Target_125): If the read operation is on a file and the count of bytes to read is greater than or equal to 0x00010000 (64K), Windows SMB servers set **DataLength** and **DataLengthHigh** fields to 0 and do not return any data but return STATUS_SUCCESS. + +[<126> Section 3.3.5.8](#Appendix_A_Target_126): Windows-based servers ignore the **ByteCount** field, and calculate the number of bytes to be written as **DataLength** | **DataLengthHigh** <<16. + +[<127> Section 3.3.5.9](#Appendix_A_Target_127): Windows 2000 Server and Windows Server 2003 return STATUS_NO_MORE_FILES if the **FileName** field of the SMB_COM_SEARCH request is an empty string. + +[<128> Section 3.3.5.10.1](#Appendix_A_Target_128): Windows behavior for each Information Class is specified in each Information Class' corresponding subsection of either \[MS-FSA\] sections 2.1.5.11 or 2.1.5.12. + +[<129> Section 3.3.5.10.2](#Appendix_A_Target_129): Windows servers support these new Information Levels for directory queries. + +[<130> Section 3.3.5.10.2](#Appendix_A_Target_130): Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows 8.1, Windows Server 2012 R2, Windows 10, and Windows Server 2016 support previous versions but do not support this method of enumerating them, by default. This feature can be configured to be active by the administrator. The purpose is to allow an application (on a client that does not support the IOCTL command) to have a method of enumerating the previous versions. + +[<131> Section 3.3.5.10.6](#Appendix_A_Target_131): If the requested Information Class is FileRenameInformation, then the following validation is performed: + +- If **RootDirectory** is not NULL, then the request fails with STATUS_INVALID_PARAMETER. +- If the file name pointed to by the _FileName_ parameter of the FILE_RENAME_INFORMATION structure contains a separator character, then the request fails with STATUS_NOT_SUPPORTED. + +If the server file system does not support this **Information Level**, then it fails the request with STATUS_OS2_INVALID_LEVEL. Otherwise, it attempts to apply the attributes to the target file and return the success or failure code in the response. + +[<132> Section 3.3.5.10.7](#Appendix_A_Target_132): Windows 2000 Server, Windows Server 2003, Windows Server 2003 R2, and Windows Server 2008 do not break a batch oplock when processing a TRANS2_SET_PATH_INFORMATION request. Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, and Windows Server 2016 break a batch oplock when processing the request. + +[<133> Section 3.3.5.11.1](#Appendix_A_Target_133): Windows 2000, Windows XP, Windows Server 2003, Windows Server 2003 R2, Windows Vista, Windows Server 2008, Windows 7, Windows Server 2008 R2, Windows 8.1, Windows Server 2012 R2, Windows 10, and Windows Server 2016 SMB servers pass IOCTL requests through to the underlying object store. + +[<134> Section 3.3.5.11.1](#Appendix_A_Target_134): The server blocks certain FSCTL requests by not passing them through to the underlying file system for processing. The following FSCTLs are explicitly blocked by the server and are failed with STATUS_NOT_SUPPORTED. + +| Name | Value | +| ------------------------------- | ---------- | +| FSCTL_REQUEST_OPLOCK_LEVEL_1 | 0x00090000 | +| FSCTL_REQUEST_OPLOCK_LEVEL_2 | 0x00090004 | +| FSCTL_REQUEST_BATCH_OPLOCK | 0x00090008 | +| FSCTL_OPLOCK_BREAK_ACKNOWLEDGE | 0x0009000C | +| FSCTL_OPBATCH_ACK_CLOSE_PENDING | 0x00090010 | +| FSCTL_OPLOCK_BREAK_NOTIFY | 0x00090014 | +| FSCTL_MOVE_FILE | 0x00090074 | +| FSCTL_MARK_HANDLE | 0x000900FC | +| FSCTL_QUERY_RETRIEVAL_POINTERS | 0x0009003B | +| FSCTL_PIPE_ASSIGN_EVENT | 0x00110000 | +| FSCTL_GET_VOLUME_BITMAP | 0x0009006F | +| FSCTL_GET_NTFS_FILE_RECORD | 0x00090068 | +| FSCTL_INVALIDATE_VOLUMES | 0x00090054 | + +Windows does not support USN journal calls because they require a volume handle. The following USN journal calls are also failed with STATUS_NOT_SUPPORTED. + +| Name | Value | +| ------------------------ | ---------- | +| FSCTL_READ_USN_JOURNAL | 0x000900BB | +| FSCTL_CREATE_USN_JOURNAL | 0x000900E7 | +| FSCTL_QUERY_USN_JOURNAL | 0x000900F4 | +| FSCTL_DELETE_USN_JOURNAL | 0x000900F8 | +| FSCTL_ENUM_USN_DATA | 0x000900B3 | + +The following FSCTLs are explicitly blocked by Windows Server 2008 R2, Windows Server 2012, and Windows Server 2012 R2 and are not passed through to the object store. They are failed with STATUS_NOT_SUPPORTED. + +| Name | Value | +| ------------------------------------ | ---------- | +| FSCTL_REQUEST_OPLOCK_LEVEL_1 | 0x00090000 | +| FSCTL_REQUEST_OPLOCK_LEVEL_2 | 0x00090004 | +| FSCTL_REQUEST_BATCH_OPLOCK | 0x00090008 | +| FSCTL_REQUEST_FILTER_OPLOCK | 0x0009005C | +| FSCTL_OPLOCK_BREAK_ACKNOWLEDGE | 0x0009000C | +| FSCTL_OPBATCH_ACK_CLOSE_PENDING | 0x00090010 | +| FSCTL_OPLOCK_BREAK_NOTIFY | 0x00090014 | +| FSCTL_MOVE_FILE | 0x00090074 | +| FSCTL_MARK_HANDLE | 0x000900FC | +| FSCTL_QUERY_RETRIEVAL_POINTERS | 0x0009003B | +| FSCTL_PIPE_ASSIGN_EVENT | 0x00110000 | +| FSCTL_GET_VOLUME_BITMAP | 0x0009006F | +| FSCTL_GET_NTFS_FILE_RECORD | 0x00090068 | +| FSCTL_INVALIDATE_VOLUMES | 0x00090054 | +| FSCTL_READ_USN_JOURNAL | 0x000900BB | +| FSCTL_CREATE_USN_JOURNAL | 0x000900E7 | +| FSCTL_QUERY_USN_JOURNAL | 0x000900F4 | +| FSCTL_DELETE_USN_JOURNAL | 0x000900F8 | +| FSCTL_ENUM_USN_DATA | 0x000900B3 | +| FSCTL_QUERY_DEPENDENT_VOLUME | 0x000901F0 | +| FSCTL_SD_GLOBAL_CHANGE | 0x000901F4 | +| FSCTL_GET_BOOT_AREA_INFO | 0x00090230 | +| FSCTL_GET_RETRIEVAL_POINTER_BASE | 0x00090234 | +| FSCTL_SET_PERSISTENT_VOLUME_STATE | 0x00090238 | +| FSCTL_QUERY_PERSISTENT_VOLUME_STATE | 0x0009023C | +| FSCTL_REQUEST_OPLOCK | 0x00090240 | +| FSCTL_TXFS_MODIFY_RM | 0x00098144 | +| FSCTL_TXFS_QUERY_RM_INFORMATION | 0x00094148 | +| FSCTL_TXFS_ROLLFORW ARD_REDO | 0x00098150 | +| FSCTL_TXFS_ROLLFORWARD_UNDO | 0x00098154 | +| FSCTL_TXFS_START_RM | 0x00098158 | +| FSCTL_TXFS_SHUTDOWN_RM | 0x0009815C | +| FSCTL_TXFS_READ_BACKUP_INFORMATION | 0x00094160 | +| FSCTL_TXFS_WRITE_BACKUP_INFORMATION | 0x00098164 | +| FSCTL_TXFS_CREATE_SECONDARY_RM | 0x00098168 | +| FSCTL_TXFS_GET_METADATA_INFO | 0x0009416C | +| FSCTL_TXFS_GET_TRANSACTED_VERSION | 0x00094170 | +| FSCTL_TXFS_SAVEPOINT_INFORMATION | 0x00098178 | +| FSCTL_TXFS_CREATE_MINIVERSION | 0x0009817C | +| FSCTL_TXFS_TRANSACTION_ACTIVE | 0x0009418C | +| FSCTL_TXFS_LIST_TRANSACTIONS | 0x000941E4 | +| FSCTL_TXFS_READ_BACKUP_INFORMATION2 | 0x000901F8 | +| FSCTL_TXFS_WRITE_BACKUP_INFORMATION2 | 0x00090200 | + +The following FSCTL is explicitly blocked by Windows 8 and Windows Server 2012 and is failed with STATUS_NOT_SUPPORTED. + +| Name | Value | +| ---------------------------- | ---------- | +| FSCTL_GET_RETRIEVAL_POINTERS | 0x00090073 | + +[<135> Section 3.3.5.11.1.1](#Appendix_A_Target_135): When the **NumberOfSnapShotsReturned** field is zero, Windows-based SMB servers incorrectly append 2 zeroed bytes after NT_Trans_Data in the NT_TRANSACT_IOCTL response buffer of the FSCTL_SRV_ENUMERATE_SNAPSHOTS response. + +[<136> Section 3.3.5.11.2](#Appendix_A_Target_136): Windows-based servers request quota information from the object store, as specified in \[MS-FSA\] section 2.1.5.11.24 if **Server.Open** is a file. If **Server.Open** is on a directory, then the processing follows with the following mapping of input elements: + +- **Open** is an Open of **Server.Open.TreeConnect.Share.LocalPath** for the **Server.Open** indicated by the **SMB_Parameters.Words.FID** field of the request. +- **OutputBufferSize** is the **SMB_Parameters.Words.MaxDataCount** field of the request. +- **ReturnSingle** is the **NT_Trans_Parameters.ReturnSingleEntry** field of the request. +- **RestartScan** is the **NT_Trans_Parameters.RestartScan** field of the request. +- **SidList** is the **NT_Trans_Data.SidList** field of the request. + +The returned **Status** is copied into the **SMB_Header.Status** field of the response. If the operation is successful, then the following additional mapping of output elements applies: + +- **OutputBuffer** is copied into the **NT_Trans_Data** field of the response. +- **ByteCount** is copied into the **SMB_Parameters.TotalDataCount** field of the response. + +If quotas are disabled then the object store returns the **ChangeTime**, **QuotaUsed**, **QuotaThreshold**, and **QuotaLimit** fields set to zero in the FILE_QUOTA_INFORMATION. + +Windows-based servers enumerate and return quota information for all SIDs on the file instead of the SIDs specified in the **SidList** field, if any of the following conditions are TRUE: + +- **SidListLength** is zero. +- **StartSidOffset** is less than **SidListLength**. +- **StartSidOffset** or **SidListLength** is greater than **SMB_Parameters.Words.DataCount**. + +[<137> Section 3.3.5.11.3](#Appendix_A_Target_137): Windows-based servers set the quota information on the object store, as specified in \[MS-FSA\] section 2.1.5.14.10, if **Server.Open** is on a file. If **Server.Open** is on a directory, then processing follows, as specified in \[MS-FSA\] section 2.1.5.21, with the following mapping of input elements: + +- **Open** is an Open of **Server.Open.TreeConnect.Share.LocalPath** for the **Server.Open** indicated by the **NT_Trans_Parameters.FID** field of the request. +- **InputBuffer** is the **NT_Trans_Data.QuotaInformation** field of the request. +- **InputBuffer** is set to the size, in bytes, of the **InputBuffer** field. + +[<138> Section 3.3.5.11.4](#Appendix_A_Target_138): Windows 2000, Windows Server 2003, Windows Server 2003 R2, Windows XP, Windows Vista, and Windows Server 2008 servers fail the request but respond with arbitrary values in the NT_TRANSACT_CREATE Response. Windows 7, Windows Server 2008 R2, Windows 8, Windows Server 2012, Windows 8.1, Windows Server 2012 R2, Windows 10, and Windows Server 2016 send an error response message without the parameter block or the data block. + +# Change Tracking + +This section identifies changes that were made to this document since the last release. Changes are classified as New, Major, Minor, Editorial, or No change. + +The revision class **New** means that a new document is being released. + +The revision class **Major** means that the technical content in the document was significantly revised. Major changes affect protocol interoperability or implementation. Examples of major changes are: + +- A document revision that incorporates changes to interoperability requirements or functionality. +- The removal of a document from the documentation set. + +The revision class **Minor** means that the meaning of the technical content was clarified. Minor changes do not affect protocol interoperability or implementation. Examples of minor changes are updates to clarify ambiguity at the sentence, paragraph, or table level. + +The revision class **Editorial** means that the formatting in the technical content was changed. Editorial changes apply to grammatical, formatting, and style issues. + +The revision class **No change** means that no new technical changes were introduced. Minor editorial and formatting changes may have been made, but the technical content of the document is identical to the last released version. + +Major and minor changes can be described further using the following change types: + +- New content added. +- Content updated. +- Content removed. +- New product behavior note added. +- Product behavior note updated. +- Product behavior note removed. +- New protocol syntax added. +- Protocol syntax updated. +- Protocol syntax removed. +- New content added due to protocol revision. +- Content updated due to protocol revision. +- Content removed due to protocol revision. +- New protocol syntax added due to protocol revision. +- Protocol syntax updated due to protocol revision. +- Protocol syntax removed due to protocol revision. +- Obsolete document removed. + +Editorial changes are always classified with the change type **Editorially updated**. + +Some important terms used in the change type descriptions are defined as follows: + +- **Protocol syntax** refers to data elements (such as packets, structures, enumerations, and methods) as well as interfaces. +- **Protocol revision** refers to changes made to a protocol that affect the bits that are sent over the wire. + +The changes made to this document are listed in the following table. For more information, please contact [dochelp@microsoft.com](mailto:dochelp@microsoft.com). + +| Section | Tracking number (if applicable) and description | Major change (Y or N) | Change type | +| --------------------------------------------------------------------------------- | ----------------------------------------------------------------- | --------------------- | ------------------------------ | +| [2.2.4.6.2](#Section_e5a467bccd364afa825e3f2a7bfd6189) Server Response Extensions | Removed behavior notes from the NativeOS and NativeLanMan fields. | Y | Product behavior note removed. | + +# Index + +\_ + +[\_\_packet\_\_ packet](#section_3527e3a938de444eaed28d300fbf0c09) 73 + +3 + +[32-bit status codes](#section_6ab6ca20b40441fdb91a2ed39e3762ea) 31 + +A + +Abstract data model + +client ([section 3.1.1](#section_1fa7fd17def14bd7b1dd41c5a8ce7362) 97, [section 3.2.1](#section_20e8c664e3ff4d4a95f98f08efcfcac3) 98) + +server ([section 3.1.1](#section_1fa7fd17def14bd7b1dd41c5a8ce7362) 97, [section 3.3.1](#section_abf6ea42519e4245babb5b717919484e) 117) + +Algorithms + +[Copychunk Resume Key generation](#section_14789215fc374f4a81901972cc0fd436) 26 + +[field generation](#section_44c3cf8d093149238fdc738537ba70ba) 26 + +[VolumeId generation](#section_8fd048dcf28a40e896e387c6151706b3) 26 + +[Applicability](#section_4e465d5f123841edb537776b5f08b258) 18 + +C + +[Capability negotiation](#section_57c3e55af0e24b8e9a857837a3738abb) 19 + +[Change tracking](#section_4caa15a3700f479f90ce53e2ecca945d) 177 + +Client + +abstract data model ([section 3.1.1](#section_1fa7fd17def14bd7b1dd41c5a8ce7362) 97, [section 3.2.1](#section_20e8c664e3ff4d4a95f98f08efcfcac3) 98) + +higher-layer triggered events ([section 3.1.4](#section_cdfc37e306b744f0aeba387eeef85592) 97, [section 3.2.4](#section_7ae40ac0eae64c598793350fe14caadd) 100) + +initialization ([section 3.1.3](#section_7eb896348b214a798f490de6ed31d8ee) 97, [section 3.2.3](#section_23f5bb29222c42089352c2f9b4a86382) 100) + +local events ([section 3.1.7](#section_fd49fdab42f84a4e882e519d0fc95fe8) 98, [section 3.2.7](#section_d62a1b92411c4948a04f77e81a5d2d6c) 117) + +message processing ([section 3.1.5](#section_a07570c4cf07416597c8205fbf1b0fb0) 98, [section 3.2.5](#section_dff83b6038e04072b8f58801d1e75c82) 112) + +[other local events](#section_d62a1b92411c4948a04f77e81a5d2d6c) 117 + +sequencing rules ([section 3.1.5](#section_a07570c4cf07416597c8205fbf1b0fb0) 98, [section 3.2.5](#section_dff83b6038e04072b8f58801d1e75c82) 112) + +timer events ([section 3.1.6](#section_65632e87fe1b43409bdda398d91bc647) 98, [section 3.2.6](#section_175a98809cfa4166889b4c324e3111f0) 117) + +timers ([section 3.1.2](#section_7c27252f3548456db434e867fa8baa28) 97, [section 3.2.2](#section_2b70d101bcdf4cb5ab48bff41993d11a) 99) + +Client details ([section 3.1](#section_52cda59356a349a19c9a97ad243c4d4a) 97, [section 3.2](#section_05c920ddb64340e6872f95b4ce1a9104) 98) + +[Copychunk Resume Key generation algorithm](#section_14789215fc374f4a81901972cc0fd436) 26 + +D + +Data model - abstract + +client ([section 3.1.1](#section_1fa7fd17def14bd7b1dd41c5a8ce7362) 97, [section 3.2.1](#section_20e8c664e3ff4d4a95f98f08efcfcac3) 98) + +server ([section 3.1.1](#section_1fa7fd17def14bd7b1dd41c5a8ce7362) 97, [section 3.3.1](#section_abf6ea42519e4245babb5b717919484e) 117) + +[Direct_TCP_Transport packet](#section_f906c680330c43ae9a71f854e24aeee6) 21 + +[Directory_Access_Mask packet](#section_d524144c3cfc49c3903c284e5adbd60a) 28 + +E + +[Examples](#section_2e8fe498ea8c46bdb9fef3cc6ce25159) 134 + +[Extended attribute encoding extensions](#section_65e0c225592544b081046b91339c709f) 23 + +F + +[Field generation algorithm](#section_44c3cf8d093149238fdc738537ba70ba) 26 + +[Fields - vendor-extensible](#section_f99c712ef9984bbc9125cfe2010b6e44) 19 + +[File system attribute extensions](#section_3065351b0b7849769a5a11657d8857c7) 24 + +[File_Pipe_Printer_Access_Mask packet](#section_27f99d2977844684b6dd264e9025b286) 26 + +[FSCTL_SRV_COPYCHUNK Response packet](#section_94a4d71a5e414ddf893cea6ab5388ba3) 81 + +[FSCTL_SRV_ENUMERATE_SNAPSHOTS Response packet](#section_5a43eb2950c846b68319e793a11f6226) 79 + +[FSCTL_SRV_REQUEST_RESUME_KEY Response packet](#section_c2571af45f264bfcba6738d26f16effc) 80 + +G + +[Glossary](#section_c7d64f171ab64151b9e8f15813235c83) 9 + +H + +Higher-layer triggered events + +client ([section 3.1.4](#section_cdfc37e306b744f0aeba387eeef85592) 97, [section 3.2.4](#section_7ae40ac0eae64c598793350fe14caadd) 100) + +server ([section 3.1.4](#section_cdfc37e306b744f0aeba387eeef85592) 97, [section 3.3.4](#section_90ca3cd794d74091987ba099a551602c) 119) + +I + +[Implementer - security considerations](#section_928b1e9424084606846ff7c6111d4ca5) 157 + +[Index of security parameters](#section_0578af7bf36e448d86640e5c5ef62391) 157 + +[Information Levels message](#section_e40abab428d148278c224409d33605b8) 89 + +[Informative references](#section_f8178eacd7d6476e9d97cf61125668a0) 15 + +Initialization + +client ([section 3.1.3](#section_7eb896348b214a798f490de6ed31d8ee) 97, [section 3.2.3](#section_23f5bb29222c42089352c2f9b4a86382) 100) + +server ([section 3.1.3](#section_7eb896348b214a798f490de6ed31d8ee) 97, [section 3.3.3](#section_6d46923dce8c40e190c1d702bf53d0e3) 119) + +[Introduction](#section_fd2a8346941440e281b1ed294f9768ea) 9 + +L + +Local events + +client ([section 3.1.7](#section_fd49fdab42f84a4e882e519d0fc95fe8) 98, [section 3.2.7](#section_d62a1b92411c4948a04f77e81a5d2d6c) 117) + +server ([section 3.1.7](#section_fd49fdab42f84a4e882e519d0fc95fe8) 98, [section 3.3.7](#section_607b3c6417d84f488f92a4d1be96b266) 133) + +M + +Message processing + +client ([section 3.1.5](#section_a07570c4cf07416597c8205fbf1b0fb0) 98, [section 3.2.5](#section_dff83b6038e04072b8f58801d1e75c82) 112) + +server ([section 3.1.5](#section_a07570c4cf07416597c8205fbf1b0fb0) 98, [section 3.3.5](#section_5551a31c17aa43629f2b2d8b2d4bedd6) 121) + +Messages + +[Information Levels](#section_e40abab428d148278c224409d33605b8) 89 + +[syntax](#section_6cdbc7263e4a499982b3f5e3d7f3c37a) 21 + +[transport](#section_f906c680330c43ae9a71f854e24aeee6) 21 + +N + +[Normative references](#section_2d91bdcaf941428a9f89bcabebab4dce) 14 + +[NT_Trans_Parameters Client_Request_Extension packet](#section_25c118f24c5d4afab06c64b71368076c) 71 + +[NT_TRANSACT_CREATE2](#section_75a3a815d2c64c948d668221869c7975) 30 + +[NT_TRANSACT_IOCTL](#section_2f8a9baed8c1462893daadba011e4f17) 76 + +[NT_TRANSACT_IOCTL_Client_Request_Extension packet](#section_2f8a9baed8c1462893daadba011e4f17) 76 + +[NT_TRANSACT_QUERY_QUOTA](#section_75a3a815d2c64c948d668221869c7975) 30 + +[NT_TRANSACT_QUERY_QUOTA_Client_Request packet](#section_9f3f73f99c4a42ba9f56e6352491d714) 84 + +[NT_TRANSACT_QUERY_QUOTA_Server_Response packet](#section_178d375d029c40aeb7b8bd01547fff51) 85 + +[NT_TRANSACT_SET_QUOTA](#section_75a3a815d2c64c948d668221869c7975) 30 + +[NT_TRANSACT_SET_QUOTA_Client_Request packet](#section_5172dc9ce7ad47fa86c0317b047a37eb) 87 + +O + +Other local events + +[client](#section_d62a1b92411c4948a04f77e81a5d2d6c) 117 + +[server](#section_607b3c6417d84f488f92a4d1be96b266) 133 + +[Overview (synopsis)](#section_7c30a2a09c9a423b99827a49979af7d4) 16 + +P + +[Parameters - security index](#section_0578af7bf36e448d86640e5c5ef62391) 157 + +[Preconditions](#section_493935193f254ae9ac28a7b491d6239b) 18 + +[Prerequisites](#section_493935193f254ae9ac28a7b491d6239b) 18 + +[Product behavior](#section_ecd51ae2478c455b8669254b74208d3b) 158 + +Protocol Details + +[overview](#section_1f7aaa2b0b3f4eca908b8a6417dca534) 97 + +R + +[References](#section_62c700dc724d4302b7d270cd7ee86ebc) 14 + +[informative](#section_f8178eacd7d6476e9d97cf61125668a0) 15 + +[normative](#section_2d91bdcaf941428a9f89bcabebab4dce) 14 + +[Relationship to other protocols](#section_592d0cbe41d04b8e8bb9a60edd85e5e8) 16 + +S + +Security + +[implementer considerations](#section_928b1e9424084606846ff7c6111d4ca5) 157 + +[parameter index](#section_0578af7bf36e448d86640e5c5ef62391) 157 + +Sequencing rules + +client ([section 3.1.5](#section_a07570c4cf07416597c8205fbf1b0fb0) 98, [section 3.2.5](#section_dff83b6038e04072b8f58801d1e75c82) 112) + +server ([section 3.1.5](#section_a07570c4cf07416597c8205fbf1b0fb0) 98, [section 3.3.5](#section_5551a31c17aa43629f2b2d8b2d4bedd6) 121) + +Server + +abstract data model ([section 3.1.1](#section_1fa7fd17def14bd7b1dd41c5a8ce7362) 97, [section 3.3.1](#section_abf6ea42519e4245babb5b717919484e) 117) + +higher-layer triggered events ([section 3.1.4](#section_cdfc37e306b744f0aeba387eeef85592) 97, [section 3.3.4](#section_90ca3cd794d74091987ba099a551602c) 119) + +initialization ([section 3.1.3](#section_7eb896348b214a798f490de6ed31d8ee) 97, [section 3.3.3](#section_6d46923dce8c40e190c1d702bf53d0e3) 119) + +local events ([section 3.1.7](#section_fd49fdab42f84a4e882e519d0fc95fe8) 98, [section 3.3.7](#section_607b3c6417d84f488f92a4d1be96b266) 133) + +message processing ([section 3.1.5](#section_a07570c4cf07416597c8205fbf1b0fb0) 98, [section 3.3.5](#section_5551a31c17aa43629f2b2d8b2d4bedd6) 121) + +[other local events](#section_607b3c6417d84f488f92a4d1be96b266) 133 + +sequencing rules ([section 3.1.5](#section_a07570c4cf07416597c8205fbf1b0fb0) 98, [section 3.3.5](#section_5551a31c17aa43629f2b2d8b2d4bedd6) 121) + +timer events ([section 3.1.6](#section_65632e87fe1b43409bdda398d91bc647) 98, [section 3.3.6](#section_13c8b89c0cd24f338b52255383cd4038) 133) + +timers ([section 3.1.2](#section_7c27252f3548456db434e867fa8baa28) 97, [section 3.3.2](#section_a5bf22fb240743d2b975d02512e51a78) 118) + +Server details ([section 3.1](#section_52cda59356a349a19c9a97ad243c4d4a) 97, [section 3.3](#section_0dd233263fdb41a1b950170b52a0879e) 117) + +[SMB_COM_NEGOTIATE_Extended_Security_Response packet](#section_d883d0a55a0a46268e3e87b0b66b79aa) 44 + +[SMB_COM_NEGOTIATE_Non_Extended_Security_Response packet](#section_a8f7396e625147b29d318a83cc230d21) 49 + +[SMB_COM_NT_CREATE_ANDX_Client_Request_Extensions packet](#section_8e14ed93f27544d1bc46dfaf296c91b1) 60 + +[SMB_COM_NT_CREATE_ANDX_Server_Response_Extension packet](#section_9e7d187492bd44098089ffc1a4a4d94e) 62 + +[SMB_COM_NT_TRANSACTION](#section_602802fd5870433a955c79897847053e) 60 + +[SMB_COM_OPEN_ANDX_Client_Request_Extensions packet](#section_5b2e082db4724569a2014efc0b8e0f5f) 36 + +[SMB_COM_OPEN_ANDX_Server_Response_Extensions packet](#section_2e946bbf5e0f4521b68398a7a4801c3c) 37 + +[SMB_COM_READ_ANDX_Client_Request_Extensions packet](#section_df9244e87b2d4714a3836990589a8ff4) 39 + +[SMB_COM_READ_ANDX_Server_Response_Extensions packet](#section_54dd2a6b299c4c9b9f8871c5b0511f6e) 41 + +[SMB_COM_SESSION_SETUP_ANDX_Client_Request_Extensions packet](#section_a00d03613544484596ab309b4bb7705d) 52 + +[SMB_COM_SESSION_SETUP_ANDX_Server_Response_Extensions packet](#section_e5a467bccd364afa825e3f2a7bfd6189) 54 + +[SMB_COM_TRANSACTION2](#section_714bb6fa7fab4dab8ff88a01c273b9ce) 44 + +[SMB_COM_TREE_CONNECT_ANDX_Client_Request_Extensions packet](#section_16b173568eff49c29d21557e07ef085d) 57 + +[SMB_COM_TREE_CONNECT_ANDX_Server_Response_Extensions packet](#section_087860d5391941d5a7531b330d651196) 58 + +[SMB_COM_WRITE_ANDX_Client_Request_Extensions packet](#section_178be656705649ea8bcbcf123737b016) 42 + +[SMB_COM_WRITE_ANDX_Server_Response_Extensions packet](#section_056d7d3304574f9ab7e0ab983ce24ae4) 43 + +[SMB_FIND_FILE_BOTH_DIRECTORY_INFO_Extensions packet](#section_03d05a6fbbaf4a9ea556036581b02737) 90 + +[SMB_FIND_FILE_ID_BOTH_DIRECTORY_INFO packet](#section_fbae2fc37ff24437b0b09536a73bb6ea) 93 + +[SMB_FIND_FILE_ID_FULL_DIRECTORY_INFO packet](#section_714e4211dd39453caf0b846cbf661489) 92 + +[SMB_Header_Extensions_and packet](#section_3c0848a6efe947c2b57af7e8217150b9) 34 + +[SRV_COPYCHUNK packet](#section_e4e201827c714755b638bb75ff1c06ca) 78 + +[Standards assignments](#section_acc6e3bd3aba42beb15f99397399ab51) 19 + +[StatusCodes](#section_6ab6ca20b40441fdb91a2ed39e3762ea) 31 + +[Syntax - message](#section_6cdbc7263e4a499982b3f5e3d7f3c37a) 21 + +T + +Timer events + +client ([section 3.1.6](#section_65632e87fe1b43409bdda398d91bc647) 98, [section 3.2.6](#section_175a98809cfa4166889b4c324e3111f0) 117) + +server ([section 3.1.6](#section_65632e87fe1b43409bdda398d91bc647) 98, [section 3.3.6](#section_13c8b89c0cd24f338b52255383cd4038) 133) + +Timers + +client ([section 3.1.2](#section_7c27252f3548456db434e867fa8baa28) 97, [section 3.2.2](#section_2b70d101bcdf4cb5ab48bff41993d11a) 99) + +server ([section 3.1.2](#section_7c27252f3548456db434e867fa8baa28) 97, [section 3.3.2](#section_a5bf22fb240743d2b975d02512e51a78) 118) + +[Tracking changes](#section_4caa15a3700f479f90ce53e2ecca945d) 177 + +[TRANS_CALL_NMPIPE](#section_75a3a815d2c64c948d668221869c7975) 30 + +[TRANS_RAW_READ_NMPIPE](#section_75a3a815d2c64c948d668221869c7975) 30 + +[TRANS2_SET_FS_INFORMATION](#section_75a3a815d2c64c948d668221869c7975) 30 + +[TRANS2_SET_FS_INFORMATION_Client_Request packet](#section_cf5f012fe1c4499d9df8a95add99221d) 67 + +[Transport](#section_f906c680330c43ae9a71f854e24aeee6) 21 + +[Transport - message](#section_f906c680330c43ae9a71f854e24aeee6) 21 + +Triggered events - higher-layer + +client ([section 3.1.4](#section_cdfc37e306b744f0aeba387eeef85592) 97, [section 3.2.4](#section_7ae40ac0eae64c598793350fe14caadd) 100) + +server ([section 3.1.4](#section_cdfc37e306b744f0aeba387eeef85592) 97, [section 3.3.4](#section_90ca3cd794d74091987ba099a551602c) 119) + +V + +[Vendor-extensible fields](#section_f99c712ef9984bbc9125cfe2010b6e44) 19 + +[Versioning](#section_57c3e55af0e24b8e9a857837a3738abb) 19 + +[VolumeId generation algorithm](#section_8fd048dcf28a40e896e387c6151706b3) 26 \ No newline at end of file diff --git a/spec/nbf2cifs.md b/spec/nbf2cifs.md new file mode 100644 index 0000000..4489761 --- /dev/null +++ b/spec/nbf2cifs.md @@ -0,0 +1,2399 @@ +**NetBIOS, NetBEUI, NBF, NBT, NBIPX, SMB, CIFS Networking** + +  + +**Timothy D Evans** + +**NetBIOS, NetBEUI, NBF, NBT, NBIPX, SMB, CIFS Networking** + +by Timothy D Evans + +Copyright © 1998, 2003 by Timothy D Evans + +Unlimited non-commercial distribution of this document in its entirety is encouraged, please contact the author prior to commercial publication. + +**Important:** This documentation is revised from time to time. Some of the technology described is constantly changing and being developed, especially the higher level protocols. Thus this document may not always be up to date. The reader is encouraged to ensure they have the latest version. + +All trade marks are respectfully acknowledged. + +While every precaution has been taken in the preparation of this documentation the author assumes no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein. + +# **Table of Contents** + +[**Preface**](#_20) [**1**](#_20) + +[Who should read this documentation](#ID_readership) [1](#ID_readership) + +[Organization of this documentation](#_28) [1](#_28) + +[Acknowledgments](#ID_Acknowledgments) [2](#ID_Acknowledgments) + +[Notation](#_77) [2](#_77) + +[Language](#_80) [2](#_80) + +[**1\. Introduction**](#_83) [**1**](#_83) + +[History](#ID_intro_45_History) [1](#ID_intro_45_History) + +[Overview](#_128) [2](#_128) + +[Implementation](#ID_intro_45_Implementation) [3](#ID_intro_45_Implementation) + +[Terminology](#ID_Terminology) [3](#ID_Terminology) + +[**2\. NetBIOS, NetBEUI, NetBIOS Frames Protocol**](#_165) [**5**](#_165) + +[Overview](#_167) [5](#_167) + +[Addressing - NetBIOS names](#ID_nbf_45_addressing) [6](#ID_nbf_45_addressing) + +[Group Names](#_288) [7](#_288) + +[Name Resolution](#_292) [7](#_292) + +[Name Management Protocol](#ID_nmp_45_NMP) [7](#ID_nmp_45_NMP) + +[User Datagram Protocol](#_527) [10](#_527) + +[NetBIOS Non-Session Frames on 802.2 networks](#_537) [11](#_537) + +[NetBIOS Diagnostic and Monitoring Protocol](#_631) [12](#_631) + +[NetBIOS Diagnostic and Monitoring frames on 802.2 networks](#ID_nbf_45_DMP802) [12](#ID_nbf_45_DMP802) + +[NetBIOS Session Management Protocol](#_778) [14](#_778) + +[NetBIOS Session Frames - Name Query - on 802.2 networks](#ID_nbf_45_SMP802Query) [14](#ID_nbf_45_SMP802Query) + +[NetBIOS Session Frames - Establishment and Termination - on 802.2 networks](#ID_nbf_45_SMP802ET) [14](#ID_nbf_45_SMP802ET) + +[NetBIOS Session Frames - Data Transfer - on 802.2 networks](#ID_nbf_45_SMP802DT) [16](#ID_nbf_45_SMP802DT) + +[**3\. Supporting Technology, 802.2, Ethernet and Token Ring**](#_1181) [**19**](#_1181) + +[IEEE 802.2 Logical Link Control](#_1184) [19](#_1184) + +[Token Ring](#_1236) [20](#_1236) + +[Non-MAC Frame Structure](#_1243) [20](#_1243) + +[Further information](#_1286) [21](#_1286) + +[Ethernet](#_1291) [21](#_1291) + +[Ethernet_802.3](#_1312) [21](#_1312) + +[Ethernet_802.2](#_1333) [22](#_1333) + +[Ethernet_SNAP](#_1374) [22](#_1374) + +[Ethernet_II](#_1405) [23](#_1405) + +[Further information](#_1432) [23](#_1432) + +[**4\. Encapsulation in TCP/IP**](#_1436) [**24**](#_1436) + +[RFC1001 and RFC1002](#_1440) [24](#_1440) + +[Name Resolution](#_1490) [25](#_1490) + +[LMHOSTS](#_1497) [26](#_1497) + +[NBNS](#_1527) [27](#_1527) + +[Hosts and DNS](#_1536) [27](#_1536) + +[Client Resolution](#_1544) [27](#_1544) + +[Name management](#_1547) [27](#_1547) + +[CIFS over TCP/IP](#_1559) [28](#_1559) + +[**5\. Encapsulation in various protocols and encapsulating**](#ID_encap_45_encap) [**29**](#ID_encap_45_encap) + +[Introduction](#_1565) [29](#_1565) + +[IPX/SPX](#_1569) [29](#_1569) + +[Microsoft Implementation of NetBIOS over IPX](#_1631) [30](#_1631) + +[NetBIOS Interface and Name Service Support by Lower Layer OSI Protocols](#ID_OSI) [31](#ID_OSI) + +[International Standards Organization (ISO) Protocol Suite](#ID_ISO) [31](#ID_ISO) + +[PPP (Point-to-Point Protocol)](#_1726) [31](#_1726) + +[Encapsulating](#_1745) [31](#_1745) + +[Transmission of IP Datagrams over NetBIOS Networks](#_1748) [31](#_1748) + +[**6\. Server Message Block Protocol**](#_1756) [**33**](#_1756) + +[History](#ID_smb_45_history) [33](#ID_smb_45_history) + +[Overview](#_1797) [34](#_1797) + +[Addressing](#_1835) [34](#_1835) + +[SMB on NBF](#_1862) [35](#_1862) + +[SMB on NBF datagram frames](#_1865) [35](#_1865) + +[SMB on NBF session frames](#_2000) [36](#_2000) + +[SMB frame header](#_2134) [37](#_2134) + +[SMB Command Codes](#ID_smb_45_SMBCommandCode) [38](#ID_smb_45_SMBCommandCode) + +[SMB Error Class](#_2573) [40](#_2573) + +[SMB Return Codes for Error class 0x00](#_2593) [40](#_2593) + +[SMB Return Codes for Error class 0x02](#_2617) [41](#_2617) + +[SMB Dialects](#_2641) [41](#_2641) + +[SAMBA](#_2679) [41](#_2679) + +[Further information](#_2685) [42](#_2685) + +[**7\. Browser Service**](#_2689) [**43**](#_2689) + +[History](#_2694) [43](#_2694) + +[Overview](#_2700) [43](#_2700) + +[Packets](#_2715) [44](#_2715) + +[Further information](#_2753) [44](#_2753) + +[**8\. CIFS and the future**](#_2758) [**45**](#_2758) + +[**A. Open Systems Interconnection (OSI) Reference Model**](#ID_osi_45_OSI) [**46**](#ID_osi_45_OSI) + +[NBF on 802.2 networks](#_2767) [46](#_2767) + +[NetBIOS over TCP/IP](#_2802) [46](#_2802) + +[NetBIOS over IPX](#_2843) [47](#_2843) + +[CIFS over TCP/IP](#_2881) [47](#_2881) + +[**B. NetBIOS protocols in IBM PC Network**](#ID_nbibmpc_45_NetBIOS_45_IBM_45_PC_45_Ne) [**48**](#ID_nbibmpc_45_NetBIOS_45_IBM_45_PC_45_Ne) + +[Name Management Frames in IBM PC Networks](#ID_nbibmpc_45_NMPIBMPC) [48](#ID_nbibmpc_45_NMPIBMPC) + +[Name Claim / Name Cancel Packet in IBM PC Network](#_2933) [48](#_2933) + +[Name Claim Response Packet in IBM PC Network](#_3018) [49](#_3018) + +[Datagram Packet in IBM PC Network](#ID_nbibmpc_45_UDPIBMPC) [50](#ID_nbibmpc_45_UDPIBMPC) + +[User Datagram Protocol Packet in IBM PC Network](#_3110) [50](#_3110) + +[NetBIOS Session Management Protocol in IBM PC Networks](#ID_nbibmpc_45_SMPIBMPC) [50](#ID_nbibmpc_45_SMPIBMPC) + +[Session Request Packet in IBM PC Network](#_3203) [50](#_3203) + +[Comparison of NetBIOS protocols in IBM PC Network](#ID_nbibmpc_45_CompIBMpc) [51](#ID_nbibmpc_45_CompIBMpc) + +[**C. Active Directory**](#_3747) [**56**](#_3747) + +[Domain Name System (DNS)](#_3755) [56](#_3755) + +[Lightweight Directory Access Protocol (LDAP)](#_3768) [56](#_3768) + +[**Glossary**](#_3780) [**58**](#_3780) + +[**Bibliography**](#ID_refs_45_References) [**62**](#ID_refs_45_References) + +[**D. Document History**](#_4056) [**63**](#_4056) + +[Background](#_4093) [63](#_4093) + +[**Colophon**](#_4101) [**65**](#_4101) + +# **Preface** + +While there is documentation readily available for protocol suits such as AppleTalk, DECnet, IPX/SPX and TCP/IP, it is difficult to find documentation for the suite or family of protocols which includes the NetBIOS Frames Protocol, NBF, (often referred to as NetBEUI or sometimes as NetBIOS), the Server Message Block protocol, SMB, and Common Internet File System, CIFS; this documentation attempts to provide some information on these protocols. + +This document is primarily concerned with the networking protocols rather than specific implementations such as Samba, which are well documented elsewhere. Network programming (and discussion of the various APIs) is also outside the scope of this documentation. + +## **Who should read this documentation** + +It is assumed that the reader is familiar with one or more networking protocols. Comparisons are made with other well-known protocols in order to better explain the roles of the various protocols described here and how they fit together. + +## **Organization of this documentation** + +This documentation is organized in to the following chapters: + +Introduction + +  The various protocols to be discussed are introduced and a brief history is provided. + +NetBIOS, NetBEUI, NetBIOS Frames Protocol + +  The NetBIOS Frames Protocol (NBF) is described in terms of the various protocols that were associated with the original NetBIOS implementation. + +Supporting Technology, Ethernet and Token Ring + +  This chapter discusses the various technologies used when NetBIOS is implemented "on the wire". + +Encapsulation in TCP/IP + +  The most popular configuration, NetBIOS over TCP/IP is described here. + +Encapsulation in various protocols and encapsulating + +  NetBIOS can be encapsulated in many protocols and some of the configurations are described in this chapter. + +Server Message Block Protocol + +  The SMB protocol, used for file and print sharing is examined in this chapter. + +Browser Service + +  Although the Browser Service is part of SMB networking (and indeed is implemented over SMB frames), the protocols are sufficiently important to merit particular discussion. + +CIFS and the future + +  This chapter looks at the latest implementation of the SMB protocol, now called CIFS. + +Appendices + +  Three appendices provide some additional information. The way in which the protocols discussed might be mapped to the OSI model is illustrated. Information on the original NetBIOS protocols in the IBM PC Network is provided. A brief look at Microsoft's Active Directory is also included. + +A glossary is included for convenience. Following a Bibliography is a brief history of this documentation. + +## **Acknowledgments** + +I would like to thank the following people for their comments and corrections. + +• Ernie Cooper () + +• Giampaolo Tomassoni () + +## **Notation** + +Hexadecimal numbers are shown either as 0xNNNN or NNNNh. + +## **Language** + +This document has been written in UK English. My apologies for any spelling or grammatical errors. + +# **Chapter 1. Introduction** + +There is a suite or family of protocols which includes the NetBIOS Frames Protocol, NBF, (often referred to as NetBEUI or sometimes as NetBIOS), the Server Message Block protocol, SMB, and Common Internet File System, CIFS. These protocols are associated with the original NetBIOS implementation with which they have a historical link. + +Many systems use SMB including Microsoft's Windows for Workgroups, Windows 95 / 98 / ME, LAN Manager, Windows NT, Windows 2000 and IBM's OS/2 and LAN Server, NetWare 6 and the SAMBA implementation. SAMBA is freely available for a wide range of systems and further information can be found at the SAMBA web site. __ 1 + +This document begins by describing NetBIOS (Network Basic Input / Output System) also known as NetBEUI (NetBIOS Extended User Interface) or NBF (NetBIOS Frames protocol) in terms of an original suite of protocols which includes the Name Management Protocol (NMP), Diagnostic and Monitoring Protocol (DMP), User Datagram Protocol (UDP) and the Session Management Protocol (SMP) that were used in the original implementation. + +Following a brief description of supporting technologies such as Ethernet and Token Ring, encapsulation of these protocols is considered as well as using these protocols to encapsulate other protocols. + +There is no formal standard that defines the protocol(s) used with NetBIOS; in practice the IBM LAN Technical Reference IEEE 802.2 and NetBIOS Application Program Interface is used as a reference (see [_Bibliography_](#ID_refs_45_References)). + +There are many implementations of NetBIOS networking and these implementations are generally incompatible. It is because of the diversity and lack of a formal standard that makes understanding NetBIOS networking difficult. + +It is not clear whether there is only one protocol or several protocols involved in NetBIOS networking. The original implementation for the PC Network certainly seemed to have the above-mentioned protocols (NMP, DMP, UDP and SMP) however the distinction is less clear with NetBIOS on Token-Ring and other implementations. Given that at least network layer and session layer functions are involved, the various packets used will be discussed in terms of the original protocols for convenience, even if the distinctions are somewhat arbitrary. + +Following descriptions of the lower level protocols and encapsulation, important higher level protocols (such as SMB, CIFS and the browser service) that run over these lower protocols are described. The situation with respect to the higher level protocols is also complicated; the protocols (SMB and CIFS) were developed as proprietary protocols and information has been difficult to obtain. Although information has been released from time to time, it is not always easy to obtain information on the latest version. Currently Microsoft continues to develop CIFS for it's range of operating systems. Teams of developers such as the SAMBA group reverse engineer the technology. This documentation presents information that is publicly available. + +## **History** + +The NetBIOS interface was developed for International Business Machines Corporation (IBM) in 1983 by Sytec Inc. (which became Hughes LAN Systems, then Whittaker Communications). This operated over proprietary Sytec protocols on IBM's PC Network which is a broadband local area network. The broadband PC Network is a bus-attached LAN, which can accommodate up to 72 connecting devices. The baseband PC Network is also a bus-attached LAN which can accommodate up to 80 connecting devices; _It is important to note the scale of LAN which NetBIOS was designed for._ NetBIOS was not designed for large networks. + +When IBM announced the Token-Ring, an emulator for NetBIOS was produced allowing applications developed for the PC Network to operate on Token-Ring. The NetBIOS Extended User Interface (NetBEUI) was introduced in 1985. The Token-Ring network can accommodate up to 260 devices on one ring and multiple rings can be connected by Bridges. + +In 1986 Novell released Advanced NetWare version 2.0. With version 2.0 and all subsequent packages a NetBIOS interface has been included; Novell implemented NetBIOS encapsulated in IPX/SPX. Later Microsoft reverse- engineered the technology to provide encapsulation of NetBIOS in IPX/SPX that is compatible with the Novell implementation. + +With the Personal System /2 computer (PS/2) in 1987, IBM announced the PC LAN Support Program which included a NetBIOS driver. + +In March 1987, RFC 1001 was published which described a "Protocol Standard for a NetBIOS Service on a TCP/UDP Transport". + +Prior to the IBM Lan Support Program, versions of NetBIOS were named with version numbers 1.X. With the LAN Support Program the following NetBIOS versions were used: + +**Table 1-1. LAN Support Program versions compared with NetBIOS versions** + +| **LAN Support Program version** | **NetBIOS version** | +| ------------------------------- | ------------------- | +| 1.00 | 2.0 | +| 1.01 | 2.1 | +| 1.02 | 2.2 | + +Version 2.x of NetBIOS has been superseded by NetBIOS version 3.0 and version 4.0. + +In 1987 Microsoft announced the LAN Manager which runs natively over NetBIOS frames. + +Microsoft and Intel introduced the SMB Core Protocol in 1988 (SMB-CORE.PS). SMB has been developed during subsequent years and is widely used be many systems. The protocol began life as a proprietary protocol and documentation was very difficult to find. A Version of the protocol (version 2) was published by the Open Group X/Open 1992. However since that time subsequent versions have been developed by Microsoft which re-named the protocol "Common Internet File System" (CIFS). + +The history of SMB and CIFS is further discussed in: [the section called _History_ in Chapter 6](#ID_smb_45_history) + +## **Overview** + +The protocols considered here are mainly proprietary and documentation is often poor and hard to find. A high level view is presented here that attempts to describe how the protocols relate to each other. + +The original NetBIOS protocol was developed to become the NetBIOS Frames Protocol (NFB) often referred to as NetBEUI or just NetBIOS. This protocol is still used today, but is not popular because it is not routable or scalable. NBF or NetBEUI provides a datagram delivery and session service that can be used for a variety of network applications. + +The above protocol is often encapsulated in other (routable) protocols such as IPX/SPX (which Microsoft refers to as NBIPX) or TCP/IP (which Microsoft refers to as NBT). The use of NetBIOS over TCP/IP is still one of the most popular network protocol configurations. + +Although NBF (either in encapsulated form or "on the wire") can be used for a variety of applications it is often used as a foundation for the Server Message Block (SMB) protocol. One of the most widely used network configurations is SMB running over NetBIOS over TCP/IP. + +SMB has been developed to become the Common Internet File System (CIFS). Recently CIFS has been implemented directly on TCP/IP without requiring the NetBIOS over TCP/IP layer. + +The relationship between the various protocols with respect to the OSI model is illustrated in: [Appendix A](#ID_osi_45_OSI) + +## **Implementation** + +NetBIOS is often described as a "Session Layer" protocol and a variety of transport systems have been used in different implementations. Some of these implementations are described in [Chapter 5](#ID_encap_45_encap) . The protocols used to encapsulate NetBIOS are generally well understood and well documented; what is often not well understood are implementations of NetBIOS "on the wire" in a "raw" un-encapsulated form. + +Two implementations of NetBIOS "on the wire" are considered here: The original NetBIOS in IBM PC Networks (See [the section called _Comparison of NetBIOS protocols in IBM PC Network_ in Appendix B](#ID_nbibmpc_45_CompIBMpc) ) and NetBIOS Frames Protocol on 802.2 networks. Although the IBM PC Network version was developed first, the current NetBIOS Frames Protocol on 802.2 networks is emphasized in this document as being the more relevant. + +It should be noted that the frames in NetBIOS in IBM PC Networks are more complex and seem less consistent than frames in the NetBIOS Frames Protocol on 802.2 networks. The IBM PC Networks implementation separates in to the protocols mentioned above, where as all the frames in NetBIOS Frames Protocol on 802.2 networks are more consistent in their format. + +## **Terminology** + +Because of the history of the protocols being discussed here (See [the section called _History_](#ID_intro_45_History) ) and lack of standards, there is often confusion in the use of some of the terms; it is not uncommon to hear statements of the form "NetBIOS is not a protocol" or "NetBEUI is a protocol". + +NetBIOS is not a protocol + +  As described in the history above, NetBIOS was designed as an interface. NetBIOS was designed to be an extension to the BIOS (Basic Input/Output System) of PCs to provide networking services. At the risk of being pedantic, NetBIOS was designed as an application programming interface (API). It is interesting (and the source of some confusion) that it was the API which was the standard. + +NetBIOS is a protocol + +  The term "protocol" is often used as a shorthand reference to a suite of protocols (a well-known example is the use of the term "TCP/IP protocol" to refer to a collection of protocols). The informal use of the term "protocol" is well-understood and accepted practice. It has become standard practice to use the term "NetBIOS protocol" to refer to the original set of protocols in use with the NetBIOS API and the protocols which followed. The current official term used by IBM is "NetBIOS Frames Protocol" (NBF) and it is not unreasonable to shorten this to "NetBIOS". + +NetBEUI is not a protocol + +  If NetBIOS is not a protocol, but is an API, then an "Extended User Interface" to this API is also not a protocol. As mentioned above, and described in the history, when IBM developed Token Ring it was continuity of the API to ensure applications would continue to function which was important. The NetBIOS API was preserved and extended in the NetBIOS Extended user Interface, NetBEUI. + +NetBEUI is a protocol + +  With the development of NetBEUI, a set of protocols was developed, now known as the NetBIOS Frames Protocol. Since the NetBIOS Frames Protocol was used with the NetBEUI API it became accepted practice to refer to these protocols as the "NetBEUI protocol". It is still common to find documentation which refers to the "NetBEUI protocol". + +**Notes** + +1\. + +# **Chapter 2. NetBIOS, NetBEUI, NetBIOS Frames Protocol** + +## **Overview** + +The use of NetBIOS, (otherwise known as NetBEUI, NetBIOS Frames Protocol, NBF) is not a popular choice. Many networks use some form of encapsulation with the most popular being TCP/IP. It is important to understand that the various encapsulation implementations are designed to emulate the use of NetBIOS "on the wire"; the goal is to allow higher level protocols (such as SMB or CIFS) or applications to make use of the NetBIOS protocol irrespective of whether it is running "on the wire" or encapsulated. Thus in order to fully understand implementations that use encapsulation, it is necessary to understand "NetBIOS on the wire". + +It is not clear whether there is only one protocol or several protocols involved in NetBIOS networking. The original implementation for the PC Network certainly seemed to have the following protocols: Name Management protocol (NMP), Diagnostic and Monitoring Protocol (DMP), User Datagram Protocol (UDP) and Session Management Protocol (SMP). The distinction is less clear with NetBIOS on Token-Ring and other Implementations; the official IBM documentation \[IBM LAN Technical Reference IEEE 802.2 and NetBIOS Application Program Interfaces \] simply describes a collection of 22 frame formats, see [Table 2-1](#ID_NBF_45_NBFFrames) . Given that at least network layer and session layer functions are involved, the various packets used will be discussed in terms of the original protocols for convenience, even if the distinctions are somewhat arbitrary. + +**Table 2-1. NBF Frames** + +| **Frame name** | **Command code** | +| -------------------------------- | ---------------- | +| ADD_NAME_QUERY | 0x01 | +| ADD_GROUP_NAME | 0x00 | +| ADD_NAME_RESPONSE | 0x0D | +| NAME_IN_CONFLICT | 0x02 | +| NAME_QUERY | 0x0A | +| NAME_RECOGNISED | 0x0E | +| DATAGRAM | 0x08 | +| DATAGRAM_BROADCAST | 0x09 | +| STATUS_QUERY | 0x03 | +| STATUS_RESPONSE | 0x0F | +| TERMINATE_TRACE | 0x07 | +| TERMINATE_TRACE local and remote | 0x13 | +| SESSION_ALIVE | 0x1F | +| SESSION_CONFIRM | 0x17 | +| SESSION_END | 0x18 | +| SESSION_INITIALIZE | 0x19 | +| DATA_ACK | 0x14 | +| DATA_FIRST_MIDDLE | 0x15 | +| DATA_ONLY_LAST | 0x16 | +| NO_RECEIVE | 0x1A | +| RECEIVE_OUTSTANDING | 0x1B | +| RECEIVE_CONTINUE | 0x1C | + +NetBIOS systems communicate in one of two manners; the protocols are often described as Session layer protocols because most of the communications occur over sessions established between two nodes on the network. The other form of communication does not involve sessions and uses a simple datagram transmission mechanism for simple communications between systems on a network. Non-session frames are used for functions such as name management or other functions that simply require a datagram delivery service. In general when one system needs to communicate with another it will contact that system and a session will be established between the two nodes; the session will be maintained as long as either node needs to communicate until one of the nodes closes the session. + +Sessions are established using an exchange of packets. The station wishing to establish the session sends an Open request that should be responded to with an Open acknowledgment. The station initiating the session will then send a Session request which will elicit either a Session accept or Session reject. + +Data is transmitted using an established session through the sending system sending data packets which are responded to with either acknowledgment packets (ACK) or negative acknowledgment packets (NACK) prompting re-transmission. + +Sessions are closed by the system that received data sending a close request that should be responded to by the system that initiated the session sending a close response. This is followed by the system that received data sending a packet indicating that the session is closed. + +Obviously in order to communicate, systems need an address scheme and this is described in [the section called _Addressing - NetBIOS names_](#ID_nbf_45_addressing). + +## **Addressing - NetBIOS names** + +To communicate, each node (computer, printer, router etc) needs to be uniquely identified on a network. Within the TCP/IP suite of protocols, under the IPv4 address scheme, a 32 bit address identifies each node and the network it is connected to. In IPX/SPX networks, a 48 bit address identifies a node on a network and a 32 bit address identifies each network. In NetBIOS networks names are used by each node. + +NetBIOS names are 16 bytes (128 bits) long (padded if necessary) and there are very few restraints on the byte values that can be used. Non-alphanumeric characters can be used in NetBIOS names, although some implementations may not support this and applications using NetBIOS may impose other constraints. + +Often an implementation will make use of the 16th byte, for example to indicate a particular service; thus the 16th byte may be used in a way which is broadly analogous to port numbers in TCP/IP. + +It is worth noting that SMB / CIFS names map directly on to NetBIOS names and in this case the 16th byte is particularly important for identifying various services. + +Microsoft has produced a Knowledge Base Article that lists the NetBIOS suffixes (i.e. the sixteenth byte) that Microsoft uses or supports. + +The Knowledge Base Article is Q163409 and can be found at + +Some examples of the 16th byte in Unique names are given below: + +**Table 2-2. Example Unique names** + +| **16th byte (in hex)** | **Description** | +| ---------------------- | -------------------------- | +| 00 | Workstation service | +| 01 | Messenger service | +| 20 | File server service | +| 2B | Lotus Notes Server Service | + +NetBIOS names represent a flat name space; names are non-hierarchical with no provision for subdivision. Because there is no provision for identifying networks with the NetBIOS name scheme, protocols using this name scheme can not be routed. + +A NetBIOS name is often associated with one end of a session between two nodes. + +A station on the network can be known by several names (aliases) originally up to 12 (See BYTE Magazine November 1989 "Two tin cans and some string" Part 2 [_Bibliography_](#ID_refs_45_References) ) or 17 names (See BYTE Magazine January 1989 "Understanding NetBIOS" [_Bibliography_](#ID_refs_45_References)) . Modern implementations allow very many names to be used. Names can be unique names reserved for the station's exclusive use or group names shared with other stations. + +### **Group Names** + +Group Names are NetBIOS names that several stations can use. Each Group Name must be unique and in many situations must be distinct from any unique (node) names. These names allow stations to be grouped together to facilitate management and browsing of the network. Stations can send broadcast messages to all stations that share a particular group name. + +Within SMB / CIFS environments, collections of systems such as workgroups or domains map on to NetBIOS Group names. + +### **Name Resolution** + +One name is the permanent node name, which is the physical adapter card's name; this is usually derived from the Media Access Control (MAC) address of the card i.e. the hardware address and consists of 10 bytes of zeros followed by the 6 bytes of the MAC address. This special permanent node name is often called "NETBIOS_NAME_1". It is because one of the names incorporates the physical MAC address (and because there is only one network) that there is often no name resolution protocol (analogous to the Address Resolution Protocol ARP in TCP/IP networks). + +When NetBIOS is encapsulated within other protocols such as IPX/SPX or TCP/IP there is a mechanism for mapping NetBIOS names to the address schemes of the encapsulating protocol. See [Chapter 5](#ID_encap_45_encap) Encapsulation. + +## **Name Management Protocol** + +The Name Management Protocol (NMP) allows systems to create unique symbolic names that are visible on the network. NMP has some similarities with the AppleTalk Name Binding Protocol: The Name Management Protocol broadcasts a system's intention to use a new name and if no other system objects, the name is registered. NetBIOS broadcasts a name claim packet several times and if no other station contests the name claim the name is added to the local name table. Typically the packets are sent at half second intervals six times, although in principal these parameters can be tuned. Often a node will require three seconds to check each name it is using. + +The original Name Management Protocol is described in [Appendix B](#ID_nbibmpc_45_NetBIOS_45_IBM_45_PC_45_Ne) in the section [the section called _Name Management Frames in IBM PC Networks_ in Appendix B](#ID_nbibmpc_45_NMPIBMPC) . + +In the NetBIOS Frames Protocol on 802.2 networks there are four non-session level Name Management Frames. As described in [the section called _Addressing - NetBIOS names_](#ID_nbf_45_addressing) there are two kinds of names: unique names and group names. + +• The "ADD NAME QUERY" frame (0x01) is used by a node to verify that the name it wishes to add is unique within the network. + +The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x01 identifying it as an "ADD NAME QUERY" frame. + +Five reserved octets are followed by a two byte response correlator, transmitted byte reversed, created by the sender and used to correlate any responses to the query. The next sixteen octets, used for the destination name in other frames, are reserved in this case. The following sixteen octets for the source name are used to identify the name to be added. + +• The "ADD GROUP NAME" frame (0x00) is used by a node to verify that the group name does not exist as a unique name within the network. + +The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x00 identifying it as an "ADD GROUP NAME QUERY" frame. + +Five reserved octets are followed by a two byte response correlator, transmitted byte reversed, created by the sender and used to correlate any responses to the query. The next sixteen octets, used for the destination name in other frames, are reserved in this case. The following sixteen octets for the source name are used to identify the group name to be added. + +The "ADD NAME RESPONSE" frame (0x0D) is used in response to one of the above query frames to inform the node wishing to add the name that the name is already in use. The "ADD NAME RESPONSE" frame (0x0D) is used in response to one of the above query frames to inform the node wishing to add the name that the name is already in use. + +The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x0D identifying it as an "ADD NAME RESPONSE" frame. + +The next octet, the "DATA1" octet is set to 1 or 0; 0 = "add name not in process", 1 = "add name in process". The next two bytes, known as "DATA2", constitutes a define word set to 0 or 1; 0 = "unique name, 1 = "group name"; this is transmitted byte reversed. The next two bytes constitute a correlator, transmitted byte reversed, used to correlate the response with the original query. Two reserved octets are followed by sixteen octets holding the name to be added and a further sixteen octets which again hold the name to be added. + +• The "NAME IN CONFLICT" frame (0x02) is used to indicate a problem with names on the network; it is sent if more than one adapter has the same unique name registered or a name is registered as both a unique name and a group name. + +The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x02 identifying it as an "NAME IN CONFLICT" frame. + +Seven reserved octets are followed by sixteen octets representing the name in conflict. The final sixteen octets represent the special "NAME NUMBER 1" of the node sending the frame. + +The "ADD NAME QUERY" frame (0x01) is used by a node to verify that the name it wishes to add is unique within the network. + +**Table 2-3. Name Management Frames (Octets in order transmitted.)** + +| | | **Management frame** | **Management frame** | **Management frame** | **Management frame** | +| --- | | --- | --- | --- | --- | --- | +| **Field Name** | **Length** | **ADD GROUP NAME QUERY** | **ADD NAME QUERY** | **ADD NAME RESPONSE** | **NAME IN CONFLICT** | +| Length | 2 | 0x2C | 0x2C | 0x2C | 0x2C | +| 0x00 | 0x00 | 0x00 | 0x00 | +| Deliminator | 2 | 0xFF | 0xFF | 0xFF | 0xFF | +| 0xEF | 0xEF | 0xEF | 0xEF | +| _Command_ | 1 | _0x00_ | _0x01_ | _0x0D_ | _0x02_ | +| Data 1 | 1 | Reserved | Reserved | 0 or 1 | Reserved | +| Data 2 | 2 | Reserved | Reserved | 0 or 1 | Reserved | +| Reserved | Reserved | 0 | Reserved | +| XMIT Cor | 2 | Reserved | Reserved | nn | Reserved | +| Reserved | Reserved | nn | Reserved | +| RSP Cor | 2 | nn | nn | Reserved | Reserved | +| nn | nn | Reserved | Reserved | +| Destination Name | 16 | Reserved | Reserved | Name to be added | Name in conflict | +| Source Name | 16 | Group name to add | Name to add | Name to be added | NAME NUMBER 1 | + +In the NetBIOS Frames Protocol on 802.2 networks there are two frames used for managing names in session establishment. Although not part of name management, these frames are included here for convenience. + +• The "NAME QUERY" frame (0x0A) is used to find a name on the network or to request a remote node to establish a session. + +The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x0A identifying it as an "NAME QUERY" frame. + +Following the "DATA1" field which is reserved, the two octets of the "DATA2" field are set to "ttss" where "tt" indicates the type of name being called, 00 for a unique name and 01 for a group name; "ss" is used to indicate the session number. The "DATA2" field is transmitted byte reversed. Two reserved octets are followed by a two byte response correlator, transmitted byte reversed. Sixteen octets identify the name being called. The final sixteen octets identify the name of the node making the call. + +• The "NAME RECOGNISED" frame (0x0E) is used in response to a NAME QUERY frame to indicate that a session can be established with the name or to provide the location of the name. + +The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x0E identifying it as an "NAME RECOGNISED" frame. + +Following the "DATA1" field which is reserved, the two bytes of the "DATA2" field are set to "ttss" where "tt" is set to 0x00 to indicate a unique recognized name or 0x01 to indicate a unique recognized group name. the type of name being called, 00 for a unique name and 01 for a group "ss" is used to indicate the "state" of the name: 0x00 is used when the station is not listening for this name, 0xFF is used when the station is listening for this name, but can not establish a session, 0x01 to 0xFE are used as a number which will identify this session. The "DATA2" field is transmitted byte reversed. + +A two byte transmit correlator is used to correlate the response with the NAME QUERY frame. This is followed by a two byte response correlator used with SESSION INITIALIZE frames; these fields are transmitted byte reversed. Sixteen octets identify the name of the node making the NAME QUERY call. The final sixteen octets identify the name being queried. + +**Table 2-4. Frames for managing names in session establishment (Octets in order transmitted).** + +| | | **Management frame** | **Management frame** | +| --- | | --- | --- | --- | +| **Field Name** | **Length** | **NAME QUERY** | **NAME RECOGNISED** | +| Length | 2 | 0x2C | 0x2C | +| 0x00 | 0x00 | +| Deliminator | 2 | 0xFF | 0xFF | +| 0xEF | 0xEF | +| _Command_ | 1 | _0x0A_ | _0x0E_ | +| Data 1 | 1 | Reserved | Reserved | +| Data 2 | 2 | X ss | X ss | +| X tt | X tt | +| XMIT Cor | 2 | Reserved | nn | +| Reserved | nn | +| RSP Cor | 2 | nn | nn | +| nn | nn | +| Destination Name | 16 | Name of receiver | Name of receiver | +| Source Name | 16 | Name of sender | Name of sender | + +## **User Datagram Protocol** + +The NetBIOS User Datagram Protocol (UDP) provides packet transmission from source to destination. UDP is an unreliable datagram delivery protocol. + +NetBIOS User Datagram Protocol is comparable with the Datagram Delivery Protocol (DDP) in AppleTalk, or IP in the TCP/IP suite of protocols, or IPX in Novell's IPX/SPX protocol suite. It is important to note that the NetBIOS User Datagram Protocol differs from datagram protocols in other protocol suites; the NetBIOS User Datagram Protocol is designed specifically to provide a datagram delivery service and not necessarily to provide a foundation for higher level protocols. Where as in other protocol suites the datagram protocol supports transport and session layer protocols running over the datagram protocol, here there is a separate Session Management Protocol which does not make use of the NetBIOS User Datagram Protocol. The relationship is illustrated in the [Appendix A](#ID_osi_45_OSI) . + +UDP packets are sent between Named systems (see [the section called _Addressing - NetBIOS names_](#ID_nbf_45_addressing) above) or are broadcast from one Named system to all Names on the network. + +The original User Datagram Protocol is described in [Appendix B](#ID_nbibmpc_45_NetBIOS_45_IBM_45_PC_45_Ne) in the section [the section called _Datagram Packet in IBM PC Network_ in Appendix B](#ID_nbibmpc_45_UDPIBMPC) . + +### **NetBIOS Non-Session Frames on 802.2 networks** + +• The "DATAGRAM" frame (0x08) is used to send a datagram to a name. + +The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x08 identifying it as an "DATAGRAM" frame. + +Seven reserved octets are followed by sixteen octets used to identify the destination name of the datagram. The following sixteen octets identify the source name sending the datagram. A variable number of octets contain the data or payload of the datagram. + +• The "DATAGRAM BROADCAST" frame (0x09) is used to broadcast a datagram to all names on the network. + +The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x09 identifying it as an "DATAGRAM" frame. + +Seven reserved octets are followed by a further sixteen octets which are also reserved rather than identifying the destination name as in the case of "DATAGRAM" frames. The following sixteen octets identify the source name sending the datagram. A variable number of octets contain the data or payload of the datagram. + +**Table 2-5. Datagram frames (Octets in order transmitted.)** + +| | | **Data frame** | **Data frame** | +| ---------------- | ---------- | ---------------- | ---------------------- | +| **Field Name** | **Length** | **DATAGRAM** | **DATAGRAM BROADCAST** | +| Length | 2 | 0x2C | 0x2C | +| 0x00 | 0x00 | +| Deliminator | 2 | 0xFF | 0xFF | +| 0xEF | 0xEF | +| _Command_ | 1 | _0x08_ | _0x09_ | +| Data 1 | 1 | Reserved | Reserved | +| Data 2 | 2 | Reserved | Reserved | +| Reserved | Reserved | +| XMIT Cor | 2 | Reserved | Reserved | +| Reserved | Reserved | +| RSP Cor | 2 | Reserved | Reserved | +| Reserved | Reserved | +| Destination Name | 16 | Name of receiver | Reserved | +| Source Name | 16 | Name of sender | Name of sender | +| Optional | | Datagram | Datagram | + +## **NetBIOS Diagnostic and Monitoring Protocol** + +The NetBIOS Diagnostic and Monitoring Protocol (DMP) provides the facilities to obtain status information about local and remote nodes on the network. This protocol is broadly comparable with the basic functionality provided by the Simple Network Monitoring Protocol (SNMP) within the TCP/IP suite of protocols. + +The NetBIOS Diagnostic and Monitoring Protocol (DMP) provides the facilities to obtain information including: + +• Number of "Frame Reject" (FRMR) frames received. + +• Number of "Frame Reject" (FRMR) frames transmitted. + +• Number of I-format "Logical link control Protocol Data Units" (LPDUs) received in error. + +• Number of aborted transmissions. + +• Etc. + +It is worth noting that this facility is part of the protocol and not an advantage of a given Operating System that happens to be using the protocol. + +### **NetBIOS Diagnostic and Monitoring frames on 802.2 networks** + +• The "STATUS QUERY" frame (0x03) is used to request remote adapter status information. + +The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x03 identifying it as an "STATUS QUERY" frame. + +The "DATA1" octet is used to indicate the status of the request, 0x0 indicates a 1.x or 2.0 type request, 0x01 indicates a NetBIOS 2.1 request and values greater than 1 indicate a NetBIOS 2.1 request. The two bytes of the "DATA2" field are used to indicate the length of the user's status buffer. The "DATA2" field is transmitted byte reversed. Two reserved octets are followed by a two octet response correlator, transmitted byte reversed. Sixteen octets identifying the name of the receiver are followed by a further sixteen octets indicating the sending node's NAME NUMBER 1. + +• The "STATUS RESPONSE" frame (0x0F) is used in response to request a status request frame. + +The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x0F identifying it as an "STATUS RESPONSE" frame. + +The "DATA1" octet is used to indicate the status of the response, 0x0 indicates a 1.x or 2.0 type response, and values greater than 0x0 indicate a NetBIOS 2.1 response. The two octets of the "DATA2" field are regarded as a 16 bit string; the first bit x is set to 1 if the length of the status data exceeds the frame size; the second bit y is set to 1 if the length exceeds the size of the user's buffer; the remaining 14 bits indicate the length of the status data sent. The "DATA2" field is transmitted byte reversed. A two octet transmit correlator, transmitted byte reversed, is followed by two reserved octets. Sixteen octets indicate the receiving node's NAME NUMBER 1 and are followed by a further sixteen octets indicating the sending node's name. + +• The "TERMINATE TRACE" frame (0x07) is used to end a trace at a remote node. + +The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x07 identifying it as an "TERMINATE TRACE" frame. + +All the remaining 39 octets are reserved. + +• The "TERMINATE TRACE" frame (0x13) is used to end a local trace and a trace at a remote node. + +The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x13 identifying it as an "TERMINATE TRACE" frame. + +All the remaining 39 octets are reserved. + +**Table 2-6. Diagnostic and Monitoring frames (Octets in order transmitted.)** + +| | | **Special frame** | **Special frame** | **Special frame** | **Special frame** | +| -------------------- | ---------- | -------------------------- | ------------------------ | ------------------- | ---------------------------------- | +| **Field Name** | **Length** | **STATUS QUERY** | **STATUS RESPONSE** | **TERMINATE TRACE** | **Terminate local & remote trace** | +| Length | 2 | 0x2C | 0x2C | 0x2C | 0x2C | +| 0x00 | 0x00 | 0x00 | 0x00 | +| Deliminator | 2 | 0xFF | 0xFF | 0xFF | 0xFF | +| 0xEF | 0xEF | 0xEF | 0xEF | +| _Command_ | 1 | _0x03_ | _0x0F_ | _0x07_ | _0x13_ | +| Data 1 | 1 | nn | nn | Reserved | Reserved | +| Data 2 | 2 | Length of status buf | bbbbbbbb | Reserved | Reserved | +| Length of status buf | xybbbbbb | Reserved | Reserved | +| XMIT Cor | 2 | Reserved | nnnn | Reserved | Reserved | +| Reserved | nnnn | Reserved | Reserved | +| RSP Cor | 2 | nnnn | Reserved | Reserved | Reserved | +| nnnn | Reserved | Reserved | Reserved | +| Destination Name | 16 | Name of receiver | Receiver's NAME NUMBER 1 | Reserved | Reserved | +| Source Name | 16 | Sending node NAME NUMBER 1 | Name of sender | Reserved | Reserved | + +## **NetBIOS Session Management Protocol** + +The NetBIOS Session Management Protocol (SMP) manages sessions between Named processes on the network. NetBIOS Sessions support full duplex operation. One Named process calls another Name on the network which answers. The Session continues until one or both systems hang up. + +The original NetBIOS Session Management Protocol is described in [Appendix B](#ID_nbibmpc_45_NetBIOS_45_IBM_45_PC_45_Ne) Appendix: NetBIOS protocols in IBM PC Network in [the section called _NetBIOS Session Management Protocol in IBM PC Networks_ in Appendix B](#ID_nbibmpc_45_SMPIBMPC) NetBIOS Session Management Protocol in IBM PC Networks. + +### **NetBIOS Session Frames - Name Query - on 802.2 networks** + +In the NetBIOS Frames Protocol on 802.2 networks there are two frames used for managing names in session establishment. Details of these frames are given in [the section called _Name Management Protocol_](#ID_nmp_45_NMP) "Name Management Frames in NetBIOS on 802.2 networks" + +**Table 2-7. Frames for managing names in session establishment (Octets in order transmitted.)** + +| | | **Management frame** | **Management frame** | +| ---------------- | ---------- | -------------------- | -------------------- | +| **Field Name** | **Length** | **NAME QUERY** | **NAME RECOGNISED** | +| Length | 2 | 0x2C | 0x2C | +| 0x00 | 0x00 | +| Deliminator | 2 | 0xFF | 0xFF | +| 0xEF | 0xEF | +| _Command_ | 1 | _0x0A_ | _0x0E_ | +| Data 1 | 1 | Reserved | Reserved | +| Data 2 | 2 | X ss | X ss | +| X tt | X tt | +| XMIT Cor | 2 | Reserved | nn | +| Reserved | nn | +| RSP Cor | 2 | nn | nn | +| nn | nn | +| Destination Name | 16 | Name of receiver | Name of receiver | +| Source Name | 16 | Name of sender | Name of sender | + +### **NetBIOS Session Frames - Establishment and Termination - on 802.2 networks** + +• The "SESSION ALIVE" frame (0x1F) is send as the result of an inactivity timer expiring. + +The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x1F identifying it as an "SESSION ALIVE" frame. + +All the remaining 39 octets are reserved. + +• The "SESSION CONFIRM" frame (0x17) is used to request remote adapter status information. + +The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. these fields are followed by the one octet command frame which has a value of 0x17 identifying it as an "SESSION CONFIRM" frame. + +The "DATA1" octet is an 8 bit binary string; the first bit "y" is set to 0 for versions of NetBIOS prior to version 2.20 and to 1 for higher versions. After 6 bits always set to 0, the last bit "x" is set to 0 for NetBIOS version 1.xx and set to 1 for version 2.00 or above (In practice this will now always be set to 1). The two bytes of the "DATA2" field are used to indicate the length of the user's receive buffer. The "DATA2" field is transmitted byte reversed. + +Two octets used for a transmission correlator are followed by a two octet response correlator; these fields are transmitted byte reversed. A single octet is used for the remote session number and is followed by an octet for the local session number. + +• The "SESSION END" frame (0x18) is used to request remote adapter status information. + +The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x18 identifying it as an "SESSION END" frame. + +The "DATA1" octet is reserved. The two bytes of the "DATA2" field are used to indicate the reason for termination. 0x00 indicates a normal session end, 0x01 indicates an abnormal end. The "DATA2" field is transmitted byte reversed. Four reserved octets are followed by a single octet used for the remote session number. The final octet is for the local session number. + +• The "SESSION INITIALIZE" frame (0x19) is used to request remote adapter status information. + +The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x19 identifying it as an "SESSION INITIALIZE" frame. + +The "DATA1" octet is an 8 bit binary string; the first bit "z" is set to 0 for versions of NetBIOS prior to version 2.20 and to 1 for higher versions (In practice this will now always be set to 1). Three reserved bits "rrr", always set to 0 are followed by 3 bits "xxx" used to indicate the largest frame value as seen by the MAC layer; the last bit "z" is set to 0 for NetBIOS version 1.xx and set to 1 for version 2.00 or above. The two octets of the "DATA2" field are used to indicate the length of the user's receive buffer. The "DATA2" field is transmitted byte reversed. A single octet is used for the remote session number and is followed by an octet for the local session number. + +**Table 2-8. Session Establishment and Termination frames (Octets in order transmitted.)** + +| | | **Session frame** | **Session frame** | **Session frame** | **Session frame** | +| --------------- | ------------------ | --------------------- | --------------------- | --------------------- | ---------------------- | +| **Field Name** | **Length** | **SESSION ALIVE** | **SESSION CONFIRM** | **Session End** | **SESSION INITIALIZE** | +| Length | 2 | 0x0E | 0x0E | 0x0E | 0x0E | +| 0x00 | 0x00 | 0x00 | 0x00 | +| Deliminator | 2 | 0xFF | 0xFF | 0xFF | 0xFF | +| 0xEF | 0xEF | 0xEF | 0xEF | +| _Command_ | 1 | _0x1F_ | _0x17_ | _0x18_ | _0x19_ | +| Data1 | 1 | Reserved | B yrrrrrrx | Reserved | zrrrxxxy | +| Data2 | 2 | Reserved | Max data rec size | Termination indicator | Max data receive size | +| Reserved | Max data rec size | Termination indicator | Max data receive size | +| XMIT Cor | 2 | Reserved | nnnn | Reserved | nnnn | +| Reserved | nnnn | Reserved | nnnn | +| RSP Cor | 2 | Reserved | nnnn Sess init xmit | Reserved | nnnn | +| Reserved | Remote session num | Remote session num | Remote session num | +| Destination Num | 1 | Reserved | Remote session num | Remote session num | Remote session num | +| Source Num | 1 | Reserved | Local session num | Local session num | Local session num | + +### **NetBIOS Session Frames - Data Transfer - on 802.2 networks** + +• The "DATA ACK" frame (0x14) is sent in response to a DATA ONLY LAST frame (see below). + +The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x14 identifying it as an "DATA ACK" frame. + +Three reserved octets are followed by a two octet transmit correlator then a two octet receive correlator; these fields are transmitted byte reversed. A single octet is used for the remote session number and is followed by an octet for the local session number. + +• The "DATA FIRST MIDDLE" frame (0x15) is used to transmit user messages across a session. + +The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x15 identifying it as an "DATA FIRST MIDDLE" frame. + +The "DATA1" octet is an 8 bit binary string; the first four bits are reserved; the fifth bit "x" is set to 1 if an acknowledgment is included; this is followed by a reserved bit; the seventh bit "y" is set to 0 for versions of NetBIOS prior to version 2.20 and set to 1 for later versions (In practice this will now always be set to 1); the last bit "z" is set to 0 if a RECEIVE CONTINUE was not requested, otherwise it is set to 1. The next two octets are for DATA2 and is a re-synchronization indicator set to 0001 if it is the first DATA FIRST MIDDLE frame. The "DATA2" field is transmitted byte reversed. + +This is followed by a transmit correlator then a two octet receive correlator. A single octet is used for the remote session number and is followed by an octet for the local session number. Finally the user data follows. + +• The "DATA ONLY LAST" frame (0x16) is used to transmit user messages across a session and is either the only frame or the last. + +The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x16 identifying it as an "DATA ONLY LAST" frame. + +The "DATA1" octet is an 8 bit binary string; the first four bits are reserved; the fifth bit "x" is set to 1 if an acknowledgment is included; this is followed by the sixth "y" bit which indicates that an "acknowledge with data allowed" is permitted; the seventh bit "z" is a "no.ack" indicator and the final bit is reserved. The next two octets are for DATA2 and is a re-synchronization indicator set to 0001 if this frame is send following receipt of a RECEIVE OUTSTANDING. The "DATA2" field is transmitted byte reversed. This is followed by a transmit correlator then a two octet receive correlator; these fields are transmitted byte reversed. A single octet is used for the remote session number and is followed by an octet for the local session number. Finally the user data follows. + +• The "NO RECEIVE" frame (0x1A) is transmitted in response to a "DATA ONLY LAST" frame or a "DATA FIRST MIDDLE" frame. + +The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x1A identifying it as an "NO RECEIVE" frame. + +The "DATA1" octet is an 8 bit binary string; the first six bits are reserved; the seventh bit "x" is set to 0 for versions of NetBIOS prior to 2.20, otherwise it is set to 1 (In practice this will now always be set to 1); the eighth bit is reserved. The next two bytes are for DATA2 and gives the number of data bytes accepted. The "DATA2" field is transmitted byte reversed. Four reserved octets are followed by a single octet used for the remote session number; this is followed by an octet for the local session number. + +• The "RECEIVE OUTSTANDING" frame (0x1B) is transmitted in response to a "NO RECEIVE" frame. + +The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x1C identifying it as an "RECEIVE OUTSTANDING" frame. + +The "DATA1" octet is reserved. The next two octets are for DATA2 and gives the number of data bytes accepted. The "DATA2" field is transmitted byte reversed. Four reserved octets are followed by a single octet used for the remote session number; this is followed by an octet for the local session number. + +• The "RECEIVE CONTINUE" frame (0x1C) is transmitted in response to a "DATA ONLY LAST" frame which had the RECEIVE CONTINUE bit set. + +The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x1C identifying it as an "RECEIVE CONTINUE" frame. + +Three reserved octets are followed by a two octet transmit correlator, transmitted byte reversed, which is followed by two more reserved octets. A single octet is used for the remote session number and is followed by an octet for the local session number. + +**Table 2-9. Session Data Transfer frames (Octets in order transmitted.)** + +| | | **Data frame** | **Data frame** | **Data frame** | **Data frame** | **Data frame** | **Data frame** | +| -------------- | ------------------ | ------------------ | ----------------------------- | ----------------------------- | ----------------------------- | ----------------------------- | -------------------- | +| **Field Name** | **Length** | **DATA ACK** | **DATA FIRST MIDDLE** | **DATA ONLY LAST** | **NO RECEIVE** | **RECEIVE OUT-STANDING** | **RECEIVE CONTINUE** | +| Length | 2 | 0x0E | 0x0E | 0x0E | 0x0E | 0x0E | 0x0E | +| 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | +| Deliminator | 2 | 0xFF | 0xFF | 0xFF | 0xFF | 0xFF | 0xFF | +| 0xEF | 0xEF | 0xEF | 0xEF | 0xEF | 0xEF | +| _Command_ | 1 | _0x14_ | _0x15_ | _0x16_ | _0x1A_ | _0x1B_ | _0x1C_ | +| Data1 | 1 | Reserved | Brrrxryz | Brrrxryz | Brrrrrrxr | Reserved | Reserved | +| Data2 | 2 | Reserved | Re-synch indicator | Re-synch indicator | Number of data bytes accepted | Number of data bytes accepted | Reserved | +| Reserved | Re-synch indicator | Re-synch indicator | Number of data bytes accepted | Number of data bytes accepted | Reserved | +| XMIT Cor | 2 | nnnn | nnnn | nnnn | Reserved | Reserved | nnnn | +| nnnn | nnnn | nnnn | Reserved | Reserved | nnnn | +| RSP Cor | 2 | Reserved | nnnn | nnnn | Reserved | Reserved | Reserved | +| Reserved | nnnn | nnnn | Reserved | Reserved | Reserved | +| Dest Num | 1 | Remote session num | Remote session num | Remote session num | Remote session num | Remote session num | Remote session num | +| Source Num | 1 | Local session num | Local session num | Local session num | Local session num | Local session num | Local session num | +| Optional data | | | USER DATA Message from send | USER DATA Message from send | | | | + +**Notes** + +1\. + +# **Chapter 3. Supporting Technology, 802.2, Ethernet and Token Ring** + +Although NetBIOS is often encapsulated, it can be implemented "on the wire". This chapter looks at the implementation of NetBIOS on two popular networking technologies, Ethernet and Token Ring as well as the 802.2 Logical Link Control layer used with these technologies. This documentation looks at the technologies in relation to NetBIOS rather than attempting to provide a full description of the protocols; there are many excellent books on 802.2, Ethernet and Token Ring that describe those subjects in detail. + +## **IEEE 802.2 Logical Link Control** + +In the OSI Reference Model, the Datalink layer sits above the Physical layer and below the Network layer. When considering IEEE LAN technology the situation is a little more complex. There are a number of LAN systems such as Token Ring and Ethernet and the physical characteristics of these are defined in the Physical Layer of the OSI model. Characteristics such as the frame format for systems such as Token Ring and Ethernet are defined in the Datalink layer in standards such as 802.3, 802.5 etc. A common interface was required between these standards and the protocols in layer 3 and this is implemented in 802.2. A full description of IEEE 802.2 Logical Link Control is beyond the scope of this document; a brief overview is given below. + +IEEE 802.2 Logical Link Control frames often provide the data link layer support for implementations of NetBIOS. This is the case when NetBIOS frames are being carried "on the wire" rather than encapsulated in another protocol. The relationship is illustrated in the [Appendix A](#ID_osi_45_OSI) Open Systems Interconnection (OSI) Reference Model + +802.2 supports both connection-oriented and connection-less oriented communications. The Logical Link Control offers services to the Network layer through Service Access Points (SAPs). The SAP is used to identify the process at the Network layer. + +IEEE 802.2 frames have the following form: + +DSAP 1 byte + +  Destination Service Access Point + +SSAP 1 byte + +  source Service Access Point + +Control 1 or 2 bytes + +  field length depends on the service + +Information + +  This variable length field carries any data + +Some examples of DSAP and SSAP values are given below. + +For IPX (the network protocol traditionally used with NetWare networks), DSAP = 0xE0 (224), SSAP = 0xE0 and Control is 1 byte 0x03 which denotes the 802.2 unnumbered format. + +For SNAP (Sub-Network Access Protocol), DSAP = 0xAA (170), SSAP = 0xAA + +_For NetBIOS, DSAP = 0xF0 (240) , SSAP = 0xF0_ + +Some IEEE 802.2 Numbers of interest can be found at "The Internet Assigned Numbers Authority" web site, "Protocol Numbers and Assignment Services" in "IEEE 802 Numbers": + + + +In 1985 IBM implemented NetBIOS over Token Ring and established the way in which NetBIOS frames would map to 802.2 frames. + +When NetBIOS is implemented over Token Ring, the NetBIOS frames are mapped directly on to the 802.2 frames; the NetBIOS frame is contained in the information field of the 802.2 frame: + +• DSAP 1 byte Destination Service Access Point 0xF0 + +• SSAP 1 byte source Service Access Point 0xF0 + +• Control 1 or 2 bytes field length depends on the service + +• Information: + +• NetBIOS header + +• Optional data + +The above scheme is general to implementations of NetBIOS over 802.2 where other underlying technologies are used such as Ethernet. + +## **Token Ring** + +Token Ring is becoming less popular with many organizations moving to Ethernet. Token Ring is discussed here because of it's importance in the history of NetBIOS and understanding of NetBIOS. + +When IBM introduced Token-Ring, an emulator for NetBIOS was produced. The NetBIOS Extended User Interface (NetBEUI) was introduced in 1985. NetBIOS was no longer implemented only on a set of propriety protocols, but also on 802.2 frames. The implementation on Token-Ring was the first implementation over 802.2 and provides a reference model. Detailed information can be found in the IBM manual: IBM LAN Technical Reference, see [_Bibliography_](#ID_refs_45_References) IBM LAN Technical Reference IEEE 802.2 and NetBIOS Application Program Interfaces. + +A full description of Token Ring is beyond the scope of this document; some basic information on Token Ring and its use with NetBIOS is given below. + +There are two kinds of Token Ring frames: Media Access Control (MAC) frames and Non-MAC frames. MAC frames carry Token Ring management information between nodes, Non-MAC frames carry user data. The non-MAC frames contain IEEE 802.2 Logical Link Control frames which in turn can contain NetBIOS frames. + +### **Non-MAC Frame Structure** + +**Table 3-1. Non-MAC Token Ring Frame Structure** + +| **Token Ring frame** | **802.2 Frame detail** | **NBF frame** | +| ---------------------------------------- | ---------------------- | ------------- | +| Start Delimiter (SDEL) 1 octet | | | +| Access Control (AC) 1 octet | | | +| Frame Control (FC) 1 octet | | | +| Destination Address 6 octets | | | +| Source Address 6 octets | | | +| IEEE 802.2 Logical Link Control | DSAP 2 octets | | +| SSAP 2 octets | | +| Control 1 or 2 octets | | +| Data 46-1500 octets | NetBIOS header | +| Optional data | +| Frame Check sequence (FCS) 4 octets | +| End Delimiter (EDEL) 1 octet | | | +| Frame Status (FS) Check sequence 1 octet | | | + +### **Further information** + +Many manuals and documents describe Token-Ring in detail including + +Novell's Guide to NetWare LAN Analysis, see [_Bibliography_](#ID_refs_45_References) + +## **Ethernet** + +A full description of Ethernet is beyond the scope of this document; some basic information on Ethernet and its use with NetBIOS is given below. + +Ethernet is widely used today and well documented. Four types of Ethernet frames have been in common use. For convenience the notation used by Novell is used to describe the four Ethernet frame types: + +Ethernet_802.3 + +  Known as Ethernet 802.3 raw, this frame type is used in NetWare networks and was the default type in NetWare v2.x and v3.x + +Ethernet_II + +  Known as Ethernet DIX (Developed by Digital Intel Xerox) + +Ethernet_802.2 + +  IEEE Ethernet + +Ethernet_SNAP + +  SNAP (Sub-Network Access Protocol) derived from the Ethernet 802.2 structure + +### **Ethernet_802.3** + +Known as Ethernet 802.3 raw, this frame type is used in NetWare networks and was the default type in NetWare v2.x and v3.x Because of the nature of these frames they are unlikely to carry NBF frames, unless encapsulated in IPX. + +**Table 3-2. Ethernet_802.3 Frame Structure** + +| Preamble 7 octets | +| ------------------------------- | +| Start frame deliminator 1 octet | +| Destination Address 6 octets | +| Source Address 6 octets | +| Length 2 octets | +| Data 46-1500 octets | +| Frame Check sequence 4 octets | + +### **Ethernet_802.2** + +NBF frames are found in Ethernet_802.2 frames more than in other Ethernet frames when NBF is implemented "on the wire" rather than encapsulated. + +Ethernet_802.2 frames are also used with IPX/SPX and FTAM (File Transfer Access and Management) protocol. + +**Table 3-3. Ethernet_802.2 Frame Structure** + +| **Ethernet frame** | **802.2 Frame detail** | **NBF frame** | +| ------------------------------- | ---------------------- | ------------- | +| Preamble 7 octets | | | +| Start frame deliminator 1 octet | | | +| Destination Address 6 octets | | | +| Source Address 6 octets | | | +| Length 2 octets | | | +| IEEE 802.2 Logical Link Control | DSAP 2 octets | | +| SSAP 2 octets | | +| Control 1 or 2 octets | | +| Data 46-1500 octets | NetBIOS header | +| Optional data | +| Frame Check sequence 4 octets | | | + +### **Ethernet_SNAP** + +Ethernet_SNAP frames are used by IPX/SPX, TCP/IP and AppleTalk Phase II. + +**Table 3-4. Ethernet_SNAP Frame Structure** + +| Preamble 7 octets | +| ------------------------------- | +| Start frame deliminator 1 octet | +| Destination Address 6 octets | +| Source Address 6 octets | +| Length 2 octets | +| DSAP 2 octets value AA | +| SSAP 2 octets value AA | +| Control 1 octets | +| Organizational code 3 octets | +| Ethernet Type 2 octets | +| Data 46-1500 octets | +| Frame Check sequence 4 octets | + +### **Ethernet_II** + +Ethernet_II frames are used with IPX/SPX TCP/IP AppleTalk Phase I + +Following the source address, is an Ethernet frame type. Information on Ethernet frame types can be found at: __ 2 and at: __ 3 + +For SNA (Systems Network Architecture) communications the value registered for the type is _0x80D5_. This value of 0x80D5 is also used for other systems using the IEEE 802.2 API _including NetBIOS_ + +**Table 3-5. Ethernet_II Frame Structure** + +| Preamble 8 octets | +| ----------------------------- | +| Destination Address 6 octets | +| Source Address 6 octets | +| Ethernet Type 2 octets | +| Data 46-1500 octets | +| Frame Check sequence 4 octets | + +### **Further information** + +Many manuals and documents describe Ethernet in detail including Novell's Guide to NetWare LAN Analysis, see [_Bibliography_](#ID_refs_45_References) + +**Notes** + +1\. + +2\. + +3\. + +# **Chapter 4. Encapsulation in TCP/IP** + +NetBIOS is often described as a "Session Layer" protocol and a variety of transport systems have been used in different implementations. Particularly because NetBIOS is a non-routable protocol, it has often been implemented using other routable protocols to provide the transport. + +It has traditionally been the NetBIOS API that has been the "standard". In most implementations (certainly NetBIOS over TCP/IP and NetBIOS over IPX), encapsulation has been implemented to ensure that higher level protocols (such as SMB) can run over the encapsulated protocol in the same way as they would run over NetBIOS Frames Protocol, NBF (otherwise known as NetBEUI or NetBIOS). Thus it is important to understand the NetBIOS Frames Protocol, NBF in order to understand the various encapsulation implementations. + +## **RFC1001 and RFC1002** + +The suite of protocols known as "TCP/IP" is perhaps the best know protocol suite. Currently most systems use IP version 4; the next generation of IP, IPv6 has not yet widely replaced IP version 4. These protocols are well documented in "Request for Comments" (RFCs) and there are many books available on the subject. + +NetBIOS can be carried over TCP/IP (v4) networks. The relevant RFCs describing NetBIOS on a TCP and UDP foundation are: + +RFC 1001 + +  Protocol standard for a NetBIOS service on a TCP/UDP transport: concepts and methods + +RFC 1002 + +  Protocol standard for a NetBIOS service on a TCP/UDP transport: detailed specifications + +The protocol standards described in the above RFCs are designed to preserve existing NetBIOS services, utilize existing standards and minimize new developments. The standards proposed also aimed to be robust and efficient while not necessarily requiring central management or many additional facilities to run. + +Within this system NetBIOS names are aligned with the Domain Name Service (DNS). A "NetBIOS Scope" is defined as a population of computers through out which a NetBIOS name is known. Because many non-intersecting NetBIOS Scopes may exist on an internetwork, each NetBIOS scope has a "scope identifier"; this is a string that is in a DNS compatible format. This can be thought of as a pseudo sub-domain containing all the NetBIOS names in a given Scope. + +NetBIOS names are strings of 16 bytes with few restrictions; NetBIOS names can and often do contain characters that are illegal in DNS names such as spaces, underscores and other non-alphanumeric characters. DNS names may only contain alphanumeric characters, hyphens and stops. An encoding scheme is used to represent the 16 byte NetBIOS names as a 32 character string to which a stop and then the scope identifier is appended to form a DNS name. Each name needs to be registered for use with an IP address. + +There are two servers defined which may be implemented with NetBIOS on a TCP/UDP transport: The NetBIOS Name Server (NBNS) and the NetBIOS Datagram Distribution Server (NBDD). + +The NBNS can be configured to work in a variety of ways either acting simply as a bulletin board where systems can register names, or completely managing names and addresses. Several NBNS system can be configured to work together to provide a distributed service. + +Since multicasting and broadcasting are not widely implemented on internets, the NBDD service provides this function. Datagrams to be sent to individual nodes or broadcast, can be sent to the NBDD which will forward the datagram to the target node or nodes. + +Systems implementing NetBIOS on a TCP/UDP transport, other than NBNS and NBDS servers, are known as "End-Nodes". Two distinct types of "End-Node" are defined: Broadcast nodes ("B" nodes) and Point-to-point nodes ("P" nodes). Broadcast nodes ("B" nodes) communicate using a combination of UDP datagrams and TCP connections. "B" nodes can function within a broadcast area which is a single MAC-bridged LAN. Point-to-point nodes communicate exclusively by directed UDP datagrams and TCP sessions. "P" nodes depend upon NBNS servers to register their name to IP address mappings and discover the names of other End-Nodes. + +Two further kinds of End-Node are used with NetBIOS on a TCP/UDP transport: RFC 1001 defines Mixed mode nodes ("M" nodes) as "P" nodes with "B" node characteristics. "M" nodes use NBNS and NBDD servers, but may continue to function if these servers are temporarily unavailable. An "M" node typically performs functions as a "B" node and then as a "P" node if necessary. Hybrid nodes ("H" nodes) are not defined in RFC 1001 and have not been standardized; these are mixed nodes similar to "M" nodes but function broadly in the opposite manner to "M" nodes. "H" nodes function as a "P" node first and then as a "B" node. + +NetBIOS on a TCP/UDP transport provides the standard NetBIOS services: Adapter Status Transactions, NetBIOS Session Service and NetBIOS Datagram Service. + +Details of packet formats are given in RFC 1002. + +The following UDP and TCP port numbers are used with NetBIOS on a TCP/UDP transport: + +**Table 4-1. UDP and TCP port numbers are used with NetBIOS** + +| **Service** | **UDP Port** | **TCP Port** | +| ---------------- | ------------ | ------------ | +| Name Service | 137 | 137 | +| Session Service | | 139 | +| Datagram Service | 138 | | + +There are several implementations of NetBIOS on a TCP/UDP transport. A free implementation is "SAMBA" which is available for various Unix platforms and non-Unix platforms. Further information about "SAMBA" can be obtained from the "SAMBA" Web page: + +__ 1 + +The product can be obtained from the above web site, which is also a useful source of information. + +## **Name Resolution** + +NetBIOS over TCP/IP is probably the most common implementation and is often used in preference to NetBIOS "on the wire" (NetBIOS Frames Protocol otherwise known as NetBEUI or just NetBIOS) or in preference to NetBIOS over IPX/SPX. NetBIOS over TCP/IP is also probably most often used to carry the SMB / CIFS protocol. + +When implementing NetBIOS over TCP/IP, Name resolution i.e. the mechanisms for converting NetBIOS names to IP addresses is critically important. This topic is sufficiently important (and so often the source of many problems) to merit special discussion. + +It is important to note that Name resolution is separate from the Browser service. Name resolution is specific to NetBIOS over TCP/IP; the Browser service runs over SMB which runs over NetBIOS Frames Protocol, NetBIOS over IPX or NetBIOS over TCP/IP. The mapping of NetBIOS names to IP addresses is distinct from the service that makes lists of systems available (for example in "Network Neighborhood" or "My Network Places") which is provided by the Browser service. Of course services such as the Browser service (that runs over SMB) are unlikely to function correctly if the underlying facilities such as Name resolution are not working properly. + +The Name resolution mechanisms discussed here do not necessarily conflict with the mechanisms discussed in the standards RFC 1001 and RFC 1002, but can be seen as alternative implementations with various enhancements. + +In practice it seems that the main implementations of NetBIOS over TCP/IP utilize a local cache for Name resolution; name to IP address mappings that have recently been resolved are held in a local cache for a short time which can reduce the need to access the network to resolve names to IP addresses. + +### **LMHOSTS** + +Many implementations of NetBIOS over TCP/IP make use of an LMHOSTS file. The LMHOSTS file is similar to the traditional hosts file; both are simple text files listing IPv4 addresses and host names. The LMHOSTS file consists of several lines each of which may have an IPv4 address followed by white space, a NetBIOS name and possibly additional parameters or comments. Most implementations support the use of the hash # character to indicate comments or additional parameters. While the basic structure described above is fairly universal, the use of additional information is implementation dependent. + +In the SAMBA implementation, a NetBIOS hostname can be followed by a hash # and then two hexadecimal digits specifying the NetBIOS name type. In the Microsoft implementation, special characters can be included by enclosing the name in quotes and entering the hexadecimal code as \\0xnn or \\nn; the sixteenth byte can be specified in this manner but the name must be padded with spaces to ensure it is sixteen bytes long. In the Microsoft implementation several "directives" can be included in the file, beginning with the hash # character. + +Microsoft has produced articles describing their use of LMHOSTS files including: + +Article ID: Q101927 + +  "The Lmhosts File for TCP/IP in Windows" + +Article ID: Q102725 + +  "LMHOSTS File Information and Predefined Keywords" + +Article ID: Q104576 + +  "Embedding Non-printable Characters in LMHOSTS Computer Names" + +Article ID: Q108295 + +  "TCP/IP Name Resolution" + +Article ID: Q150800 + +  "Domain Browsing with TCP/IP and LMHOSTS Files" + +Article ID: Q180094 + +  "How to Write an LMHOSTS File for Domain Validation and Other Name Resolution Issues" + +### **NBNS** + +The NetBIOS Name Service is implemented in SAMBA as nmbd. This service can also support the browsing service (which is a separate service). The nmbd service can also be used as a WINS server or WINS proxy. + +Microsoft has produced an implementation of the NetBIOS Name Service (NBNS) called Windows Internet Name Service (WINS). The use of WINS is described in the Microsoft article: + +Article ID: Q119493 + +  "NetBIOS over TCP/IP Name Resolution and WINS" + +### **Hosts and DNS** + +Within Microsoft networks, NetBIOS Name resolution can also make use of the traditional hosts file and the Domain Name System (DNS). For this mechanism to work NetBIOS names need to be the same as the unqualified TPC/IP host name. The implication of this is that the NetBIOS names will also conform to the constraints of the DNS name space (i.e. names can only consist of letters, digits and the dash / hyphen character - and can not contain other special characters otherwise allowed in NetBIOS names such as the underscore character \_ ). Microsoft describe the use of a hosts file and the DNS in the article: + +Article ID: Q142309 + +  "NetBIOS Name Resolution Using DNS and the HOSTS File" + +### **Client Resolution** + +Systems can use a combination of the above services to resolve NetBIOS names to IP addresses for example sequentially searching cache, lmhosts file, nbns service, hosts files and the DNS. + +### **Name management** + +The management of names can be a complex issue. To avoid problems it is important that multiple systems do not attempt to update the same name registration service. + +In Microsoft NT 4.0 networks a typical arrangement will be as follows: + +1\. A DHCP server will allocate IP addresses to client systems when they boot. + +2\. Client systems are allocated NetBIOS names at installation time. The names conforms to the DNS rules for names and are the same as the unqualified DNS name. At boot time the client registers it's NetBIOS name and DHCP assigned address with a NBNS server (often a WINS server). + +3\. The Microsoft DNS server is configured to resolve host names by taking the unqualified DNS name and passing the enquiry to the WINS server. + +Other implementations make use of Dynamic DNS (DDNS) with either a DHCP server or the clients themselves updating the DNS server. In this arrangement provided the NetBIOS names conform to the DNS rules for names and are the same as the unqualified DNS name, the need for a NBNS server (WINS) can be removed. + +## **CIFS over TCP/IP** + +The latest versions of CIFS can run "natively" over TCP/IP without requiring the "NetBIOS over TCP/IP" layer. In this implementation the NetBIOS layer is removed completely. + +With the introduction of Windows 2000 and Active Directory, the latest version of CIFS can use traditional fully qualified DNS names to represent nodes on the network. + +**Notes** + +1\. + +# **Chapter 5. Encapsulation in various protocols and encapsulating** + +## **Introduction** + +NetBIOS is often described as a "Session Layer" protocol and a variety of transport systems have been used in different implementations. Particularly because NetBIOS is a non-routable protocol, it has often been implemented using other routable protocols to provide the transport. + +It has traditionally been the NetBIOS API that has been the "standard". In most implementations (certainly NetBIOS over TCP/IP and NetBIOS over IPX), encapsulation has been implemented to ensure that higher level protocols (such as SMB) can run over the encapsulated protocol in the same way as they would run over NetBIOS Frames Protocol, NBF (otherwise known as NetBEUI or NetBIOS). Thus it is important to understand the NetBIOS Frames Protocol, NBF in order to understand the various encapsulation implementations. + +## **IPX/SPX** + +IPX/SPX are the protocols native to Novell NetWare. Details of these protocols can be found in: Novell's Guide to NetWare LAN Analysis, see [_Bibliography_](#ID_refs_45_References) + +Novell introduced an implementation of NetBIOS over IPX in 1986. The implementation uses IPX datagrams to carry the NetBIOS Frames protocol described above. + +The IPX addressing scheme is compared with the native NetBIOS and other schemes in [the section called _Addressing - NetBIOS names_ in Chapter 2](#ID_nbf_45_addressing) above. In IPX/SPX networks, a 48 bit address (usually a MAC address) identifies a node on a network and a 32 bit address identifies each network. Thus IPX is a routable protocol requiring relatively little administration, which makes it a useful means of implementing NetBIOS. + +IPX packets are broadly analogous to IP packets in the TCP/IP suite of protocols; IPX packets provide an unreliable datagram delivery service. The structure of the IPX Header is given below for reference: + +The IPX Header + +• Checksum (2 bytes) + +• Length (2 bytes) + +• Transport Control (1 byte) + +• Packet Type (1 byte) 0 or 4 for IPX, 5 for SPX, 17 (0x11) for NCP, 20 (0x14) WAN broadcast + +• Destination Node Address (6 bytes) + +• Destination Network Address (4 bytes) + +• Destination Socket (2 bytes) + +• Source Node Address (6 bytes) + +• Source Network Address (4 bytes) + +• source Socket ( 2 bytes) + +The Destination Socket indicates the service being carried over IPX, some examples and the identifier for NetBIOS are given below: + +0x451 + +  NetWare Core Protocol (NCP) + +0x452 + +  Service Advertising Protocol packet (SAP) + +0x453 + +  Routing Information Protocol packet (RIP) + +_0x455_ + +  _NetBIOS packet_ + +0x456 + +  Diagnostic packet + +0x457 + +  Serialization packet + +0x4000 to 0x8000 + +  Dynamically assigned for use with file servers etc. + +### **Microsoft Implementation of NetBIOS over IPX** + +Microsoft have implemented NetBIOS over the NWLink IPX/SPX compatible transport. (NWLink is a clone of Novell's IPX/SPX). The Microsoft implementation is compatible with Novell's NetBIOS over IPX. Microsoft sometimes refers to NetBIOS over IPX as NBIPX. + +**Table 5-1. IPX packets (Octets in order transmitted.)** + +| **Length** | **IPX Field** | **NBIPX** | +| ---------- | --------------------------------------------------- | ------------ | +| 2 | Checksum |   | +| 2 | Length | | +| 1 | Transport Control | | +| 1 | Packet Type 0 or 4 for IPX, 20 (0x14) WAN broadcast | | +| 6 | Destination Node Address | | +| 4 | Destination Network Address | | +| 2 | Destination Socket | | +| 6 | Source Node Address | | +| 4 | Source Network Address | | +| 2 | source Socket | | +| n | Data | NBIXP packet | + +**Table 5-2. NBIPX session packets (Octets in order transmitted.)** + +| **Length** | **Field** | +| ---------- | ----------------------------- | +| 1 | NBIPX Connection Control flag | +| 1 | Data Stream type | +| 2 | Source connection id | +| 2 | Destination connection id | +| 2 | Send Sequence number | +| 2 | Total data length | +| 2 | Offset | +| 2 | Data length | +| 2 | Receive Sequence number | +| 2 | Bytes received | +| n | Data | + +## **NetBIOS Interface and Name Service Support by Lower Layer OSI Protocols** + +The MAP/TOP Users Group Technical Report Specification of NetBIOS Interface and Name Service Support by Lower Layer OSI Protocols, Version 1.0, September 27, 1989, is reproduced as an appendix in The Open Group CAE Specification "Protocols for X/Open PC Interworking: SMB, Version 2." + +## **International Standards Organization (ISO) Protocol Suite** + +Communications Machinery Corporation has implemented a NetBIOS interface for ISO protocols. "Netbios for ISO Networks", see [_Bibliography_](#ID_refs_45_References) + +## **PPP (Point-to-Point Protocol)** + +NetBIOS can be carried over PPP (Point-to-Point Protocol). The relevant RFCs are: + +RFC 2097 + +  The PPP NetBIOS Frames Control Protocol (NBFCP) + +PROPOSED STANDARD + +RFC1661 STD0051 + +  The Point-to-Point Protocol (PPP) + +STANDARD + +RFC 2153 + +  PPP Vendor Extensions + +INFORMATIONAL + +## **Encapsulating** + +NetBIOS can be used to encapsulate other protocols by providing a virtual circuit over which other protocols can be transmitted. This is the opposite situation to those described above where other protocols provide the transport for NetBIOS. + +### **Transmission of IP Datagrams over NetBIOS Networks** + +A standard method of encapsulating the Internet Protocol (IP) datagrams on NetBIOS networks is described in: + +RFC 1088 + +  A Standard for the Transmission of IP Datagrams over NetBIOS Networks + +# **Chapter 6. Server Message Block Protocol** + +There are very many systems which can use the NetBIOS / NetBEUI interface or make use of the NetBIOS Frames Protocol, but perhaps one of the most important is the Server Message Block Protocol (SMB). The Server Message Block Protocol (SMB), is an application level protocol used by networking systems and operating systems such as Microsoft's Windows for Workgroups, Windows 95 / 98 / ME, LAN Manager, Windows NT, Windows 2000 and IBM's OS/2 and LAN Server, NetWare 6 and the SAMBA implementation and as such deserves special attention. The latest versions of the protocol are now known as the "Common Internet File System protocol". + +An implementation of SMB is described in "Protocols for X/Open PC Interworking: SMB, Version 2", see [_Bibliography_](#ID_refs_45_References) + +## **History** + +According to the INTERNET-DRAFT document by christopher R Hertel draft-crhertel-smb-url-03.txt titled "SMB Filesharing URL Scheme" + +" The Server Message Block protocol (SMB) was created in the 1980's by Dr. Barry Feigenbaum at IBM Corporation. It was later extended by IBM, 3Com, Intel, and Microsoft. " + +In 1987 Microsoft announced the LAN Manager program and in 1988 IBM announced the OS/2 LAN Server, both use versions of the Server Message Block Protocol. Enhancements and changes to the protocol have been made and a history can be found at: " History of SMB1 + +<mailto:Dan.Shearer@unisa.edu.au> + +Some dates in the development of the protocol are given below: + +**Table 6-1. History of SMB and CIFS** + +| **Date** | **Development** | +| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| 29 November 1989 | SMB.TXT is the LM 2.0 protocol. Note: In the doc is calls LM 2.0 as LM 1.2 (it's original name before being renamed to LM 2.0).

Microsoft Networks SMB FILE SHARING PROTOCOL EXTENSIONS SMB File Sharing Protocol Extensions Version 3.0 Document Version 1.09 | +| October 1992 | Protocols for X/Open PC Interworking: SMB, Version 2 | +| 26 March 2001 | The Storage Networking Industry Association (SNIA) produced a work-in-progress document: Common Internet File System (CIFS) Version: CIFS-Spec 0.9 Draft SNIA CIFS Work Group Work-in-Progress | + +Microsoft and a number of other companies, have proposed an updated version of SMB as an internet standard The Common Internet File System (CIFS). + +## **Overview** + +The Server Message Block Protocol (SMB), is an application level protocol see [Appendix A](#ID_osi_45_OSI) + +SMB is used to implement network session control, network file and print sharing and messaging. SMB is used to provide functionality that is broadly analogous to the AppleTalk Session Protocol, AppleTalk Filing Protocol and Printer Access Protocol etc in the AppleTalk suite of protocols. SMB is also broadly analogous with Novell's NetWare Core Protocol (NCP). It is difficult to find a non-proprietary protocol or protocols with in the TCP/IP suite which can be compared to SMB; file sharing via FTP or NFS and network printing via LPR are examples of similar functionality. + +SMB requires a transport /session protocol and the early versions of IBM's implementation were closely linked with NetBIOS. In general SMB runs either over the NetBIOS Frames Protocol (NBF), NetBIOS over TCP/IP, or NetBIOS over IPX; the most recent versions of CIFS can run directly over TCP/IP. + +| Server Message Block (SMB) / CIFS | | | | | | | +| --- | | | | | | | --- | --- | --- | --- | --- | --- | +| / | | / | | \\ | | \\ | +| NetBIOS Frames Protocol (NBF) i.e. NetBEUI i.e. NetBIOS | or | NetBIOS over TCP/IP RFC 1001 RFC 1002 | or | NetBIOS over IPX | or | directly over TCP/IP | + +See [Appendix A](#ID_osi_45_OSI) for details of the relationship between the various protocols. + +SMB has inherited some of the advantages and disadvantages of NetBIOS, in particular, prior to the latest versions of CIFS it was directly linked with the NetBIOS addressing scheme. + +## **Addressing** + +Prior to the latest versions of CIFS, SMB uses network names which are strings of 16 bytes. In general these names are mapped directly on to NetBIOS names (see [the section called _Addressing - NetBIOS names_ in Chapter 2](#ID_nbf_45_addressing) above). The traditional SMB names of systems can be up to 15 characters long and are padded with blanks if necessary. The 16th byte is used to indicate whether the name refers to a server or another function. + +In Microsoft networks with NT 3.x and NT 4.0 systems some names are used with NT 3.x and NT 4.0 Domains as well as for computer names. Some examples of names and use of the 16th byte are given below: + +**Table 6-2. SMB Names** + +| **SMB Name** | **Purpose** | +| -------------------- | --------------------------- | +| Computername\[0x00\] | Workstation service | +| Computername\[0x20\] | Server service | +| Domainname\[0x00\] | Register computer in domain | +| Domainname\[0x1C\] | Domain controller | + +Unique NetBIOS names will map to SMB individual system names, and NetBIOS group names will map to workgroup or domain names. + +Like NetBIOS names, traditional SMB names are non hierarchical and constitute a flat non-routable name space which does not scale well. + +## **SMB on NBF** + +The most recent version of CIFS can run directly over TCP/IP; however many implementations of SMB are designed to run over NBF frames. SMB is designed to use NBF frames as a transport. Whether NBF frames are used natively "on the wire" or encapsulated in TCP/IP, IPX or another protocol should be transparent to SMB. + +### **SMB on NBF datagram frames** + +SMB uses both NBF datagram and session frames. As explained in the discussion of NBF the datagram frames are used exclusively to provide a datagram service and not a transport for higher level protocols; within this context NBF datagram frames are generally used with SMB frames that are concerned with address management. + +**Table 6-3. Datagram frames (Octets in order transmitted.)** + +| | | **Data frame** | **Data frame** | +| ---------------- | ---------- | ---------------- | -------------- | +| **Field Name** | **Length** | **DATAGRAM** | **SMB** | +| Length | 2 | 0x2C | | +| 0x00 | | +| Deliminator | 2 | 0xFF | | +| 0xEF | | +| Command | 1 | 0x08 | | +| Data 1 | 1 | Reserved | | +| Data 2 | 2 | Reserved | | +| Reserved | | +| XMIT Cor | 2 | Reserved | | +| Reserved | | +| RSP Cor | 2 | Reserved | | +| Reserved | | +| Destination Name | 16 | Name of receiver | | +| Source Name | 16 | Name of sender | | +| Optional | | Datagram | SMB frame | + +**Table 6-4. Datagram frames (Octets in order transmitted.)** + +| | | **Data frame** | **Data frame** | +| ---------------- | ---------- | ---------------------- | -------------- | +| **Field Name** | **Length** | **DATAGRAM BROADCAST** | **SMB** | +| Length | 2 | 0x2C | | +| 0x00 | | +| Deliminator | 2 | 0xFF | | +| 0xEF | | +| Command | 1 | 0x09 | | +| Data 1 | 1 | Reserved | | +| Data 2 | 2 | Reserved | | +| Reserved | | +| XMIT Cor | 2 | Reserved | | +| Reserved | | +| RSP Cor | 2 | Reserved | | +| Reserved | | +| Destination Name | 16 | Reserved | | +| Source Name | 16 | Name of sender | | +| Optional | | Datagram | SMB frame | + +### **SMB on NBF session frames** + +**Table 6-5. Session Data Transfer frames (Octets in order transmitted.)** + +| | | **Data frame** | **Data frame** | +| ------------------ | ---------- | --------------------------- | -------------- | +| **Field Name** | **Length** | **DATA FIRST MIDDLE** | **SMB** | +| Length | 2 | 0x0E | | +| 0x00 | | +| Deliminator | 2 | 0xFF | | +| 0xEF | | +| Command | 1 | 0x15 | | +| Data1 | 1 | Brrrxryz | | +| Data2 | 2 | Re-synch indicator | | +| Re-synch indicator | | +| XMIT Cor | 2 | nnnn | | +| nnnn | | +| RSP Cor | 2 | nnnn | | +| nnnn | | +| Dest Num | 1 | Remote session num | | +| Source Num | 1 | Local session num | | +| Optional data | | USER DATA Message from send | SMB frame | + +**Table 6-6. Session Data Transfer frames (Octets in order transmitted.)** + +| | | **Data frame** | **Data frame** | +| ------------------ | ---------- | --------------------------- | -------------- | +| **Field Name** | **Length** | **DATA ONLY LAST** | **SMB** | +| Length | 2 | 0x0E | | +| 0x00 | | +| Deliminator | 2 | 0xFF | | +| 0xEF | | +| Command | 1 | 0x16 | | +| Data1 | 1 | Brrrxryz | | +| Data2 | 2 | Re-synch indicator | | +| Re-synch indicator | | +| XMIT Cor | 2 | nnnn | | +| nnnn | | +| RSP Cor | 2 | nnnn | | +| nnnn | | +| Dest Num | 1 | Remote session num | | +| Source Num | 1 | Local session num | | +| Optional data | | USER DATA Message from send | SMB frame | + +## **SMB frame header** + +Each SMB frame begins with a standard header. Following a deliminator of "0xFF", there are three bytes "0x53", "0x4d" and "0x42" corresponding to the values "S", "M", "B" which makes identifying SMB frames easier. The three ID bytes are followed by a command byte which is discussed in [the section called _SMB Command Codes_](#ID_smb_45_SMBCommandCode) + +**Table 6-7. SMB frames (Octets in order transmitted.)** + +| **Field Name** | **Length** | **SMB** | +| ------------------------------------------- | ---------- | -------- | +| Deliminator | 1 | 0xFF | +| ID | 3 | 0x53 "S" | +| 0x4d "M" | +| 0x42 "B" | +| Command | 1 | 0xNN | +| Error class | 1 | 0xNN | +| Reserved | 1 | reserved | +| Error code | 2 | 0xNN | +| 0xNN | +| Flags | 1 | 0xNN | +| Flags 2 / Reserved | 2 | 0xNN | +| 0xNN | +| Reserved? 12? | 12 | 0xNN | +| 0xNN | +| 0xNN | +| 0xNN | +| 0xNN | +| 0xNN | +| 0xNN | +| 0xNN | +| 0xNN | +| 0xNN | +| 0xNN | +| 0xNN | +| authenticated resource identifier / Tree ID | 2 | 0xNN | +| 0xNN | +| caller's Process ID | 2 | 0xNN | +| 0xNN | +| unathenticated User ID | 2 | 0xNN | +| 0xNN | +| Multiplex ID | 2 | 0xNN | +| 0xNN | +| count of 16-bit fields Word count | 1 | 0xNN | +| variable no of 16-bit fields byte count | 2 | 0xNN | +| 0xNN | +| count of 8-bit fields that follow | 2 | 0xNN | +| 0xNN | +| variable number of 8-bit fields | 2 | 0xNN | +| 0xNN | + +SMB is very analogous to the NetWare Core Protocol (NCF); there are numerous functions available for accomplishing various tasks. There are very many SMB frames for different functions and all share the same header format; the second field, "command", determines the function and possibly the format of the rest of the frame following the header. + +## **SMB Command Codes** + +Below is a table giving some of the Core SMB commands: + +**Table 6-8. Core SMB Commands** + +| **Field Name** | **smb_com** | **Description** | +| ------------------------ | ----------- | ------------------------- | +| SMBmkdir | 0x00 | Create directory | +| SMBrmdir | 0x01 | Delete directory | +| SMBopen | 0x02 | Open file | +| SMBcreate | 0x03 | Create file | +| SMBclose | 0x04 | Close file | +| SMBflush | 0x05 | Commit all files | +| SMBunlink | 0x06 | Delete file | +| SMBmv | 0x07 | Rename file | +| SMBgetatr | 0x08 | Get file attribute | +| SMBsetatr | 0x09 | Set file attribute | +| SMBread | 0x0a | Read byte block | +| SMBwrite | 0x0b | Write byte block | +| SMBlock | 0x0c | Lock byte block | +| SMBunlock | 0x0d | Unlock byte block | +| | | | +| SMBmknew | 0x0f | Create new file | +| SMBchkpth | 0x10 | Check directory | +| SMBexit | 0x11 | End of process | +| SMBlseek | 0x12 | LSEEK | +| | | | +| SMBtcon | 0x70 | Start connection | +| SMBtdis | 0x71 | End connection | +| SMBnegprot | 0x72 | Verify dialect | +| | | | +| SMBbskattr | 0x80 | Get disk attributes | +| SMBsearch | 0x81 | Search multiple files | +| | | | +| SMBsplopen | 0xc0 | Create spool file | +| SMBsplwr | 0xc1 | Spool byte block | +| SMBsplclose | 0xc2 | Close spool file | +| SMBsplretq | 0xc3 | Return print queue | +| SMBsends | 0xd0 | Send message | +| SMBsendb | 0xd1 | Send broadcast | +| SMBfwdname | 0xd2 | Forward user name | +| SMBcancelf | 0xd3 | Cancel forward | +| SMBgetmac | 0xd4 | Get machine name | +| SMBsendstrt | 0xd5 | Start multi-block message | +| SMBsendend | 0xd6 | End multi-block message | +| SMBsendtxt | 0xd7 | Multi-block message text | +| Never valid | 0xfe | Invalid | +| Implementation-dependent | 0xff | Implementation-dependent | + +Below is a table giving some of the Core plus commands: + +**Table 6-9. Core plus Commands** + +| **Field Name** | **smb_com** | **Description** | +| -------------- | ----------- | ---------------------- | +| SMBlockreadr | 0x13 | Lock then read data | +| SMBwriteunlock | 0x14 | Write then unlock data | +| SMBreadBraw | 0x1a | Read block raw | +| SMBwriteBraw | 0x1d | Write block raw | + +Below is a table giving some of the LANMAN 1.0 SMB commands: + +**Table 6-10. LANMAN 1.0 SMB Commands** + +| **Field Name** | **smb_com** | **Description** | +| -------------- | ----------- | ------------------------------------------- | +| SMBreadBmpx | 0x1b | Read block multiplexed | +| SMBreadBs | 0x1c | Read block (secondary response) | +| SMBwriteBmpx | 0x1e | Write block multiplexed | +| SMBwriteBs | 0x1f | Write block (secondary response) | +| SMBwriteC | 0x20 | Write complete response | +| SMBsetattrE | 0x22 | Set file attributes expanded | +| SMBgetattrE | 0x23 | Get file attributes expanded | +| SMBlockingX | 0x24 | Lock/unlock byte ranges and X | +| SMBtrans | 0x25 | Transaction (name, bytes in/out) | +| SMBtranss | 0x26 | Transaction (secondary request/response) | +| SMBioctl | 0x27 | Passes the IOCTL to the server | +| SMBioctls | 0x28 | IOCTL (secondary request/response) | +| SMBcopy | 0x29 | Copy | +| SMBmove | 0x2a | Move | +| SMBecho | 0x2b | Echo | +| SMBwriteclose | 0x2c | Write and Close | +| SMBopenX | 0x2d | Open and X | +| SMBreadX | 0x2e | Read and X | +| SMBwriteX | 0x2f | Write and X | +| SMBsesssetup | 0x73 | Session Set Up and X (including User Logon) | +| SMBtconX | 0x75 | Tree connect and X | +| SMBffirst | 0x82 | Find first | +| SMBfunique | 0x83 | Find unique | +| SMBfclose | 0x84 | Find close | +| SMBinvalid | 0xfe | Invalid command | + +## **SMB Error Class** + +Below is a table giving some of the SMB Error class values: + +**Table 6-11. SMB Error Class** + +| **Field Name** | **Value** | **Description** | +| -------------- | --------- | --------------------------------- | +| SUCCESS | 0x00 | The request was successful | +| ERRSRV | 0x02 | Error generated by the LMX server | + +## **SMB Return Codes for Error class 0x00** + +Below is a table giving some of the SMB Return Code Values when the Error class is 0x00: + +**Table 6-12. SMB Return Code** + +| **Field Name** | **Value** | **Description** | +| -------------- | --------- | ------------------------- | +| BUFFERED | 0x54 | The Message was buffered | +| LOGGED | 0x55 | The Message was logged | +| DISPLAYED | 0x56 | The Message was displayed | + +## **SMB Return Codes for Error class 0x02** + +Below is a table giving some of the SMB Return Code Values when the Error class is 0x02: + +**Table 6-13. SMB Return Code** + +| **Field Name** | **Value** | **Description** | +| -------------- | --------- | ----------------------- | +| ERRerror | 0x01 | Non-specific error code | +| ERRbadpw | 0x02 | Bad password | +| ERRbadtype | 0x03 | Reserved | + +## **SMB Dialects** + +The SMB protocol has been developed and enhanced since it was first introduced. The original version is known as the "core protocol" and is understood by systems implementing later versions which are supersets of the original. Systems using SMB negotiate which version i.e. dialect they will support. + +The function SMBnegprot 0x72 is used at the beginning of a session to establish the dialect to be used. See [the section called _SMB Command Codes_](#ID_smb_45_SMBCommandCode) + +When packets are being sent to negotiate the dialect, a string is used to indicate which dialects are supported. So just as the use of the string "SMB" within SMB packets makes identifying such packets easier, the use of readable strings makes understanding which dialects are used easier. Below is a table giving some of the strings used to identify dialects and the terms commonly used to refer to the given dialect. + +**Table 6-14. SMB dialects** + +| **string identifying dialect** | **Reference** | +| ------------------------------ | ---------------------------------------------------------------- | +| PC NETWORK PROGRAM 1.0 | core protocol | +| MICROSOFT NETWORKS 1.03 | core plus dialect | +| MICROSOFT NETWORKS 3.0 | extended 1.0 protocol | +| LANMAN1.0 | extended 1.0 protocol, first version of full LANMAN 1.0 protocol | +| Windows for Workgroups 3.1a | | +| LM1.2X002 | extended 2.0 protocol | +| LANMAN2.1 | | +| NT LM 0.12 | | + +## **SAMBA** + +While this documentation is primarily concerned with protocols rather than implementations; there is one implementation that deserves special mention. A project has been established to provide free implementations of the SMB protocol and file and printing sharing facilities for various platforms. More information can be found about the SAMBA project at the web site: + +SAMBA is freely available for very many platforms and has thus provided a means for file and print sharing between different platforms and Operating Systems. The SAMBA project has had to "reverse engineer" the protocols and continues to work in this manner in order to keep the software free. + +Despite having released a version of SMB to the X-Open organization, Microsoft continues to develop the protocol as a proprietary protocol and details of some of the more recent versions have not been made freely available. + +## **Further information** + +Further information is available on the net: Just what is SMB? V1.0 Richard Sharpe 3 + +**Notes** + +1\. + +2\. + +3\. + +# **Chapter 7. Browser Service** + +Microsoft first implemented the Browser Service as a proprietary protocol. The Browser service makes systems visible in the "Network Neighbourhood" within Windows operating systems such as Windows for Workgroups, Windows 9.x and Windows NT and NT2000. The Browser Service also operates in environments such as LAN Manager, LAN Server and OS/2 networks. The Browser Service has nothing to do with Web browsing or HTTP. The Browser Service registers SMB (NetBIOS) names dynamically and makes this dynamic list available to systems on the network. The Browser Service runs over SMB (and is described as running over a "mail slot" protocol over SMB). SMB runs over either NetBIOS Frames Protocol, NBF, often referred to as NetBEUI, or NetBIOS over TCP/IP, or over NetBIOS over IPX/SPX. Thus the Browser service is independent of the transport used to carry SMB. + +Because the Browser Service is concerned with the registration of SMB (NetBIOS) names and is dynamic, it is sometimes confused with the NetBIOS Name Service (NBNS) that maps NetBIOS names to IP addresses. An example of NBNS is Microsoft WINS. The Browser Service and NBNS are two separate services. + +In very broad terms, the Browser Service can be seen as providing a similar function to the Service Advertising Protocol (SAP) in NetWare environments. Lan Manager servers broadcast their presence over the network and the Browser Service was developed as a solution to the scalability problems of such an arrangement. (Novell developed Novell Directory Services, NDS, to reduce or even replace the need for SAP traffic.) It is important to note that Windows for Workgroups, Windows 9.x systems, Windows NT workstations and NT2000 workstations can share files and thus be servers; in such peer to peer networking environments every system is potentially a server. + +## **History** + +With Lan Manager 1.0, servers broadcast their presence over the network and client systems listened for such broadcasts to discover servers. This is not dissimilar to the early Novell NetWare systems where servers advertised themselves over the network by broadcasting Service Advertising Protocol (SAP) packets. + +When Microsoft introduced Windows for Workgroups, each PC could share it's resources acting as a server as well as acting as a client. Thus the number of servers on the network could potentially equal the number of PCs and become very large. The original broadcast system would not scale in such an environment. It was at this point that the first implementation of the browser service was introduced. + +With the introduction of Windows NT, the browser service was expanded to include domains. + +Following the development of the next version of SMB, CIFS, Microsoft published the latest version of the Browser protocol as a draft of an internet draft "CIFS/E Browser Protocol". This draft document specifies version 1.15 of the browsing protocol. + +## **Overview** + +Browser Servers maintain lists of Servers and the services they offer. Other systems, known as Browser Clients (which may also be Browser servers) query the Browser Servers for information. When Servers come on line they register themselves with the Browser Servers. The Servers are organized in to logical groups according to which group they belong to; these can be "Workgroups" or Domains" and correspond to SMB / NetBIOS group names. + +Browser Servers, sometimes simply known as Browsers, can occupy a number of rolls, serving the needs of a particular group or sub-net: + +• Domain Master Browser (is Local Master Browser for the sub-net it is on) + +• Local Master Browser + +• Backup Browser (maintain a copy of the information on the Local Master Browser; they get it by periodically querying the Local Master) + +• Potential Browser (system that can become a Browser) + +If a client system does not get a response from a Local Master Browser it can initiate an election. The Browser systems and Potential Browser systems communicate to decide which machine will become the Browser. + +Client system will contact Browser servers for a list of servers within a group or for lists of groups. Typically clients will keep a list of several Browsers. + +## **Packets** + +The Browser service uses "Mailslots" and is perhaps the only protocol that does. The mailslot "frames" are carried in SMB "transact" packets. The opcode within the Transact SMB packet is Mailslot Write. Within the data portion of the Transact packet is the mailslot frame. The Transact data itself begins with an opcode as shown below: + +**Table 7-1. Transact data opcodes** + +| **Opcode** | **description** | +| ---------- | ----------------------- | +| 1 | HostAnnouncement | +| 2 | AnnouncementRequest | +| 8 | RequestElection | +| 9 | GetBackupListReq | +| 10 | GetBackupListResp | +| 11 | BecomeBackup | +| 12 | DomainAnnouncment | +| 13 | MasterAnnouncement | +| 15 | LocalMasterAnnouncement | + +## **Further information** + +Microsoft has published the latest version of the Browser protocol as a draft of an internet draft "CIFS/E Browser Protocol". The document is available as a Microsoft Word document at: ftp://ftp.microsoft.com/developer/drg/cifs/cifsbrow.doc1 + +Some information is also available from the MSDN Library: The section "Windows Resource Kits" contains a section "Windows 95 Resource Kit" which contains "Chapter 11 Logon, Browsing, and Resource Sharing". + +**Notes** + +1\. ftp://ftp.microsoft.com/developer/drg/cifs/cifsbrow.doc + +# **Chapter 8. CIFS and the future** + +The SMB protocol has been developed and renamed CIFS. An Internet Draft dated 13 June 1996 was produced by Microsoft that described version 1.0 of CIFS: "Common Internet File System Protocol (CIFS/1.0)" by I. Heizer, P. Leach and D. Perry + +Service Pack 3 for Microsoft's windows NT 4.0 (1996) includes an updated version of the Server Message Block (SMB) authentication protocol, also known as the Common Internet File System (CIFS) file sharing protocol. + +More recent versions of CIFS can run "native" over IP without the "NetBIOS over TCP/IP" layer. The use of CIFS running "native" over IP has been implemented in Microsoft's Windows 2000 operating system and subsequent Microsoft Operating Systems. + +# **Appendix A. Open Systems Interconnection (OSI) Reference Model** + +The Open Systems Interconnection (OSI) Reference Model is traditionally used as a general purpose reference for describing protocols and comparing protocols. It is assumed that the reader is familiar with the OSI model; there are of course numerous resources on the WEB that explain the OSI model. + +The diagrams below attempt to show the components of the NetBIOS protocols and higher level protocols such as SMB in relation to the OSI Reference Model. Because the protocols were not developed specifically to comply with the OSI model any mapping is only approximate and intended as a guide. When protocols (such as NetBIOS) are encapsulated within other protocols (such as TCP/IP or IPX) it is particularly difficult to map these to a reference model, thus the diagrams below are intended to help show the relationships between the protocols rather than provide a definitive mapping to the OSI model. + +## **NBF on 802.2 networks** + +NetBIOS is often described as a session layer protocol but in the IEEE 802.2 implementation there are no transport or datagram delivery protocols between the session layer and the datalink layer. While there is a datagram protocol, this is used exclusively for datagrams and not as a foundation for higher layer protocols. + +**Table A-1. NBF on 802.2 networks** + +| 7 Application | | e.g. Browser Service | +| --------------------------- | -------------------------------------------------------------------------------------------- | --------------------------- | +| 6 Presentation | Higher level protocols e.g. SMB / CIFS | | +| 5 Session |   | Session Management Protocol | +| 4 Transport | | | +| 3 Network | User Datagram Protocol, Name Management Protocol, NetBIOS Diagnostic and Monitoring Protocol | | +| 2 Datalink | IEEE 802.2 | | +| IEEE 802.3 / IEEE 802.5 etc | | +| 1 Physical | Token Ring / Ethernet etc | | + +## **NetBIOS over TCP/IP** + +NetBIOS over TCP/IP is described in RFC 1001 and RFC 1002. Note that when higher level protocols such as SMB or CIFS are implemented over TCP/IP they are in fact implemented over NetBIOS over TCP/IP. + +**Table A-2. NetBIOS over TCP/IP** + +| 7 Application | | | e.g. Browser Service | +| --- | --- | | --- | --- | +| 6 Presentation | Higher level protocols e.g. SMB / CIFS | | | +| 5 Session | Name Service | datagram service | Session Service | +| 4 Transport | UDP | | TCP | +| 3 Network | IP | | | +| 2 Datalink | e.g. IEEE 802.2 | | e.g. Ethernet II etc | +| IEEE 802.3 / IEEE 802.5 etc | | | +| 1 Physical | Token Ring / Ethernet etc | | | + +## **NetBIOS over IPX** + +NetBIOS over IPX uses IPX packets to provide the underlying delivery mechanism for the NetBIOS protocols. + +**Table A-3. NetBIOS over IPX** + +| 7 Application | | e.g. Browser Service | +| --------------------------- | -------------------------------------------------------------------------------------------- | --------------------------- | +| 6 Presentation | Higher level protocols e.g. SMB / CIFS | | +| 5 Session |   | Session Management Protocol | +| 4 Transport | | | +| 3 Network | User Datagram Protocol, Name Management Protocol, NetBIOS Diagnostic and Monitoring Protocol | | +| IPX | | +| 2 Datalink | e.g. IEEE 802.2 | e.g. Ethernet II etc | +| IEEE 802.3 / IEEE 802.5 etc | | +| 1 Physical | Token Ring / Ethernet etc | | + +## **CIFS over TCP/IP** + +The latest version of CIFS can run directly over TCP/IP. + +**Table A-4. CIFS over TCP/IP** + +| 7 Application | CIFS | | +| --- | --- | | --- | +| 6 Presentation | | | +| 5 Session | | | +| 4 Transport | UDP | TCP | +| 3 Network | IP | | +| 2 Datalink | e.g. IEEE 802.2 | e.g. Ethernet II etc | +| IEEE 802.3 / IEEE 802.5 etc | | +| 1 Physical | Token Ring / Ethernet etc | | + +# **Appendix B. NetBIOS protocols in IBM PC Network** + +The NetBIOS interface was developed by Sytec Inc. (which became Hughes LAN Systems, then Whittaker Communications) for International Business Machines Corporation (IBM) in 1983. This operated over proprietary Sytec protocols on IBM's PC Network. + +Information is provided here for reference although these protocols have now been superseded by the NetBIOS Frames protocol running over Token Ring or Ethernet etc. + +## **Name Management Frames in IBM PC Networks** + +In the IBM PC Network name management is performed by the Name Management Protocol which consists of the following packet types: + +Name Claim / Name Cancel Packet + +  A single octet indicates whether the packet is used to claim a name (value 0x10) or release a name (value 0xA0) + +Name Claim Response Packet + +  This packet is used to indicate that the name is already in use. + +Details of packet structures for Name Management in IBM PC Networks are given in the [the section called _Comparison of NetBIOS protocols in IBM PC Network_](#ID_nbibmpc_45_CompIBMpc) + +### **Name Claim / Name Cancel Packet in IBM PC Network** + +From "Inside NetBIOS": + +Name Claim / Name Cancel Packet: + +**Table B-1. Name Claim / Name Cancel Packet** + +| **Field** | **Length** | **Description** | +| ----------------------- | ---------- | ----------------------------------- | +| Start | 1 | Start Deliminator value 0x7E | +| Destination | 6 | Destination Address | +| Source | 6 | Source Address | +| Length | 2 | Length of packet | +| value | 2 | value set to 0x5000 | +| Function | 1 | 10h for Name Claim, 0xA0 for Cancel | +| Accept | 1 | Number of packets willing to accept | +| Connection id | 2 | Connection id | +| value | 2 | value set to 0x0202 | +| Undefined | 2 | value of two octets undefined | +| value | 2 | value set to 0x0400 | +| Undefined | 4 | value of four octets undefined | +| value | 2 | value of 0x10XX | +| value | 4 | value of 0x0000 | +| Dest Name | 16 | ASCII Destination NetBIOS name | +| Dest Node Connection id | 2 | Destination node connection id | +| CRC | 4 | Cyclic Redundancy Check | +| End of Frame | 1 | End of frame marker value of 0x7E | + +### **Name Claim Response Packet in IBM PC Network** + +Name Claim Response Packet: + +**Table B-2. Name Claim Response Packet** + +| **Field** | **Length** | **Description** | +| ------------------------------ | ---------- | ----------------------------------- | +| Start | 1 | Start Deliminator value 0x7E | +| Destination | 6 | Destination Address | +| Source | 1 | Source Address | +| Length | 2 | Length of packet | +| value | 2 | value set to 0x4000 | +| value | 1 | value set to 0x30 | +| Accept | 1 | Number of packets willing to accept | +| Connection id | 2 | Connection id | +| Undefined | 2 | value of two octets undefined | +| Reason packet NAK | 1 | Reason why packet not acknowledged | +| Undefined | 1 | value of octet undefined | +| value | 2 | value set to 0x0400 | +| Undefined | 4 | value of four octets undefined | +| value | 2 | value of 0x10XX | +| value | 4 | value of 0x0000 | +| Dest Name | 16 | ASCII Destination NetBIOS name | +| Destination node connection id | 2 | Destination node connection id | +| CRC | 4 | Cyclic Redundancy Check | +| End of Frame | 1 | End of frame marker value of 0x7E | + +## **Datagram Packet in IBM PC Network** + +Details of packet structures for User Datagram Protocol in IBM PC Networks are given in the [the section called _Comparison of NetBIOS protocols in IBM PC Network_](#ID_nbibmpc_45_CompIBMpc) + +### **User Datagram Protocol Packet in IBM PC Network** + +From "Inside NetBIOS": + +User Datagram Protocol Packet: + +**Table B-3. User Datagram Protocol Packet** + +| **Field** | **Length** | **Description** | +| ------------------------- | ---------- | --------------------------------- | +| Start | 1 | Start Deliminator value 0x7E | +| Destination | 6 | Destination Address | +| Source | 6 | Source Address | +| Length | 2 | Length of packet | +| value | 2 | value set to 0x5100 | +| value | 2 | value set to 0x0100 | +| value | 2 | value set to 0x0001 | +| value | 2 | value set to 0x1010 | +| value | 2 | value set to 0x0000 | +| Source Name | 16 | ASCII Source NetBIOS name | +| Dest Name | 16 | ASCII Destination NetBIOS name | +| Data | variable | data | +| Retransmit Count | 2 | Retransmition Count | +| Source Node Connection id | 2 | Source Node Connection id | +| Destination id | 6 | Destination id | +| Source id | 6 | Source id | +| Prev Node id | 6 | Previous Node id | +| CRC | 4 | Cyclic Redundancy Check | +| End of Frame | 1 | End of frame marker value of 0x7E | + +## **NetBIOS Session Management Protocol in IBM PC Networks** + +Details of packet structures for NetBIOS Session Management in IBM PC Networks are given in the [the section called _Comparison of NetBIOS protocols in IBM PC Network_](#ID_nbibmpc_45_CompIBMpc) + +### **Session Request Packet in IBM PC Network** + +From "Inside NetBIOS": + +Session Request Packet : + +**Table B-4. Session Request Packet** + +| **Field** | **Length** | **Description** | +| -------------------- | ---------- | ------------------------------------------------- | +| Start | 1 | Start Deliminator value 0x7E | +| Destination | 6 | Destination Address | +| Source | 6 | Source Address | +| Length | 2 | Length of packet | +| value | 2 | value set to 0x0040 | +| Function | 1 | value 0x00-0x07=No poll 0x80-0x0F=Send Return Pkt | +| Accept | 1 | Number of packets willing to accept | +| Connection id | 2 | Connection id | +| Sess seq no | 1 | Sess seq no | +| ACK Seq No | 1 | ACK Seq No | +| value | 2 | value set to 0x0001 | +| Response packet size | 2 | Response packet size | +| value | 4 | value of 0x0000 | +| value | 4 | value of 0x1010 | +| Source Name | 16 | ASCII Source NetBIOS name | +| Dest Name | 16 | ASCII Destination NetBIOS name | +| Dest Connection id | 2 | Dest Connection id | +| CRC | 4 | Cyclic Redundancy Check | +| End of Frame | 1 | End of frame marker value of 0x7E | + +## **Comparison of NetBIOS protocols in IBM PC Network** + +**Table B-5. Name Management Packets** + +| **Name Claim / Cancel** | **Name Response** | +| --------------------------------- | --------------------------------- | +| **< - 1 Octet (8 bits) ->** | **< - 1 Octet (8 bits) ->** | +| Start Deliminator = 0x7E | Start Deliminator = 0x7E | +| Destination Address 6 octets | Destination Address 6 octets | +| Source Address 6 octets | Source Address 6 octets | +| Length 2 octets | Length 2 octets | +| Value 0x5000 | Value 0x4000 | +| Claim 0x10 Cancel 0xA0 | Value 0x30 | +| No Packets to accept N | No Packets to accept N | +| Connection id 2 octets | Connection id 2 octets | +| Value 0x02 | Undefined | +| Value 0x02 | Undefined | +| Undefined | Reason NAK | +| Undefined | Undefined | +| Value 0x04 | Value 0x04 | +| Value 0x00 | Value 0x00 | +| Undefined 4 octets | Undefined 4 octets | +| Value 0x10 | Value 10h | +| Value XXh | Value XXh | +| Value 0x00 | Value 0x00 | +| Value 0x00 | Value 0x00 | +| ASCII Dest name 16 octets | ASCII Dest name 16 octets | +| Prev net con id | Dest node conn id | +| Prev net con id | Dest node conn id | +| Retransmit count | CRC 4 octets | +| Retransmit count | | +| Source node con id | | +| Source node con id | | +| Dest id 6 octets | EOF 0x7E | +| Source id 6 octets | | +| Prev node id 6 octets | | +| CRC 4 octets | | +| EOF 0x7E | | + +**Table B-6. Session frames** + +| **Name Query** | **Session Request** | **Session Accept** | **Session** | **Acknowledgment** | +| --------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | +| **< - 1 Octet (8 bits) ->** | **< - 1 Octet (8 bits) ->** | **<- 1 Octet (8 bits) ->** | **< - 1 Octet (8 bits) ->** | **< - 1 Octet (8 bits) ->** | +| Start Deliminator = 0x7E | Start Deliminator = 0x7E | Start Deliminator = 0x7E | Start Deliminator = 0x7E | Start Deliminator = 0x7E | +| Destination Address 6 octets | Destination Address 6 octets | Destination Address 6 octets | Destination Address 6 octets | Destination Address 6 octets | +| Source Address 6 octets | Source Address 6 octets | Source Address 6 octets | Source Address 6 octets | Source Address 6 octets | +| Length 2 octets | Length 2 octets | Length 2 octets | Length 2 octets | Length 2 octets | +| Value 0x5000 | Value 0x0040 | Value 0x0040 | Value 0x4000 | Value 0x4000 | +| Value 0x10 | 0x00 - 0x07 No Poll 0x80 -0x0F Send return packet | 0x00 - 0x07 No Poll 0x80 -0x0F Send return packet | 0x00 - 0x07 No Poll 0x80 -0x0F Send return packet | 0x40 - 0x47 No Poll 0x48 -0x4F Send return packet | +| No Packets to accept 0?h | No Packets to accept 0?h | No Packets to accept 0?h | No Packets to accept 0?h | No Packets to accept N | +| Connection id 2 octets | Connection id 2 octets | Connection id 2 octets | Connection id 2 octets | Connection id 2 octets | +| Value 0x02 | Ses Seq No | Ses Seq No | Ses Seq No | Ses Seq No | +| Value 0x02 | ACK Seq No | ACK Seq No | ACK Seq No | ACK Seq No | +| Undefined | Value 0x00 | Value 0x00 | 0x80-0xF0 End message | Undefined | +| Undefined | Value 0x01 | Value 0x02 | DATA N octets | Dest Node Con | +| Value 0x10 | Response packet size | Response packet size | Dest Node Con | +| Value 0x00 | Response packet size | Response packet size | CRC 4 octets | +| Undefined | Value 0x00 | Dest node conn id | | | +| Undefined | Value 0x00 | Dest node conn id | | | +| Undefined | Value 0x10 | CRC 4 octets | | | +| Undefined | Value 0x10 | | EOF 0x7E | +| Value 0x10 | ASCII Source name | | | +| Value 0xXX | ASCII Source name | | | +| Value 0xXX | ASCII Source name | EOF 7Eh | | | +| Value 0x10 | ASCII Source name | | | | +| ASCII Dest name | ASCII Source name | | | | +| ASCII Dest name | ASCII Source name | | | | +| ASCII Dest name | ASCII Source name | | | | +| ASCII Dest name | ASCII Source name | | | | +| ASCII Dest name | ASCII Source name | | | | +| ASCII Dest name | ASCII Source name | | Dest node con id | | +| ASCII Dest name | ASCII Source name | | | +| ASCII Dest name | ASCII Source name | | CRC 4 octets | | +| ASCII Dest name | ASCII Source name | | | +| ASCII Dest name | ASCII Source name | | | +| ASCII Dest name | ASCII Source name | | | +| ASCII Dest name | ASCII Source name | | EOF 0x7E | | +| ASCII Dest name | ASCII Dest name | | | | +| ASCII Dest name | ASCII Dest name | | | | +| ASCII Dest name | ASCII Dest name | | | | +| ASCII Dest name | ASCII Dest name | | | | +| Prev net con id | ASCII Dest name | | | | +| Prev net con id | ASCII Dest name | | | | +| Retransmit count | ASCII Dest name | | | | +| Retransmit count | ASCII Dest name | | | | +| Source node con id | ASCII Dest name | | | | +| Source node con id | ASCII Dest name | | | | +| Dest id | ASCII Dest name | | | | +| Dest id | ASCII Dest name | | | | +| Dest id | ASCII Dest name | | | | +| Dest id | ASCII Dest name | | | | +| Dest id | ASCII Dest name | | | | +| Dest id | ASCII Dest name | | | | +| Source id | Dest node conn id | | | | +| Source id | CRC | | | | +| Source id | CRC | | | | +| Source id | CRC | | | | +| Source id | CRC | | | | +| Source id | EOF 0x7E | | | | +| Prev node id | | | | | +| Prev node id | | | | | +| Prev node id | | | | | +| Prev node id | | | | | +| Prev node id | | | | | +| Prev node id | | | | | +| CRC | | | | | +| CRC | | | | | +| CRC | | | | | +| CRC | | | | | +| EOF 0x7E | | | | | + +# **Appendix C. Active Directory** + +With the introduction of Windows 2000, Microsoft introduced Active Directory. Active Directory can be described as a hierarchical directory system, broadly similar in concept to Novell's Directory Services or the X.500 directory system. Among the uses of Active Directory is management of resources in a CIFS network; facilities such as the traditional browser service can be "replaced" by Active Directory. Because Active Directory has a significant impact upon CIFS networking, a brief overview is presented here, however a full description is beyond the scope of this documentation; there are many excellent references on Active Directory. + +As described above Active Directory (AD) implements a "tree structure" of objects that is broadly analogues to other directory systems that use "X.500" type technology. Indeed Active Directory is implemented using other standard directory technologies. In particular AD makes use of the Domain Name System (DNS) to establish an overall hierarchical tree structure. The Lightweight Directory Access Protocol (LDAP) directory system is also used to provide further granularity and provide facilities not available in the DNS. Traditional NT Domain technology is also used and provides backwards compatibility. + +In order to use AD the TCP/IP v4 protocol must be configured (both DNS and LDAP run over TCP/IP). While the Browser service also ran over IPX/SPX and the NetBIOS Frames Protocol (otherwise known as NBF or NetBEUI), this is not the case with AD. + +Microsoft has produced a Knowledge Base Article that provides a list of Windows 2000 Domain Controller Default Ports. This provides an insight in to the protocols used with Active Directory. + +The Knowledge Base Article is Q289241 and can be found at + +## **Domain Name System (DNS)** + +Active Directory requires a DNS infrastructure to be in place. AD does require that the DNS support dynamic updates, but uses the standard DNS. Thus in order to understand the impact of Active Directory on a network, it is necessary to understand the impact of DNS. + +Some relevant RFCs are given below: + +• RFC 1035: "DOMAIN NAMES - IMPLEMENTATION AND SPECIFICATION" + +• RFC 3007: "Secure Domain Name System (DNS) Dynamic Update" + +• RFC 2136: "Dynamic Updates in the Domain Name System (DNS UPDATE)" + +• RFC 2782: "A DNS RR for specifying the location of services (DNS SRV)" + +## **Lightweight Directory Access Protocol (LDAP)** + +Active Directory uses Lightweight Directory Access Protocol (LDAP) to provide additional granularity to the "tree" structure. LDAP can be used to create Organizational Units (OUs) within the "tree" structure. + +Some relevant RFCs are given below: + +• RFC 2256: "A Summary of the X.500(96) User Schema for use with LDAPv3" + +• RFC 2251: "Lightweight Directory Access Protocol (v3)" + +• RFC 1777: "Lightweight Directory Access Protocol" + +(Original definition) + +**Notes** + +1\. + +# **Glossary** + +Glossary + +## **A** + +##### **AD** + +Active Directory. + +## **B** + +##### **Baseband** + +Systems that put digital signals from the data communications device on to the cable without modulation; only one data signal can be carried. + +##### **BIOS** + +basic input/output system. + +##### **Broadband** + +Systems that have multiple independent frequency channels, usually achieved by Frequency Division Multiplexing. + +##### **Browser Server** + +Systems which maintain lists of Servers and the services they offer. + +## **C** + +##### **CIFS** + +Common Internet File System - the latest version of SMB + +## **D** + +##### **DMP** + +NetBIOS Diagnostic and Monitoring Protocol + +##### **Domain** + +A logical grouping of systems within an SMB / CIFS network used for management and authentication. Within Microsoft networks a domain might be an NT 4.0 domain or Windows 2000 domain. + +##### **DSAP** + +Destination Service Access Point + +## **G** + +##### **Group Name** + +NetBIOS (and SMB / CIFS) name shared by a number of systems on the network. + +## **H** + +##### **Hybrid node** + +Hybrid nodes ("H" nodes") are nodes on a network using NetBIOS over TCP/IP. Hybrid nodes are not defined in RFC 1001 and have not been standardized; these are mixed nodes (similar to "M" nodes) but function broadly in the opposite manner to "M" nodes. "H" nodes function as a "Point to Point" node first and then as a "Broadcast" node. + +## **I** + +##### **IEEE** + +Institute of Electrical and Electronics Engineers + +##### **IPX** + +Internetwork Packet Exchange + +##### **ISO** + +International Standards Organization + +## **M** + +##### **MAC** + +Media Access Control + +## **N** + +##### **NBDD** + +NetBIOS Datagram Distribution Server + +##### **NBF** + +NetBIOS Frames protocol + +##### **NBFCP** + +NetBIOS Frames Control Protocol + +##### **NBIPX** + +NetBIOS over IPX + +##### **NBNS** + +NetBIOS Name Server + +##### **NBT** + +NetBIOS over TCP/IP (term often seen in Microsoft documentation). + +##### **NetBIOS** + +Network Basic Input / Output System + +##### **NetBEUI** + +NetBIOS Extended User Interface + +##### **NetBT** + +NetBIOS over TCP/IP (term often seen in Microsoft documentation). + +##### **NMP** + +Name Management Protocol + +## **P** + +##### **PPP** + +Point-to-Point Protocol + +## **S** + +##### **SAP** + +Service Access Points + +##### **SMB** + +Server Message Block + +##### **SMP** + +System Message Block protocol + +##### **SNAP** + +Sub-Network Access Protocol + +##### **SPX** + +Sequenced Packet Exchange + +##### **SSAP** + +source Service Access Point + +## **U** + +##### **UDP** + +NetBIOS User Datagram Protocol or User Datagram Protocol in TCP/IP + +## **W** + +##### **WINS** + +Windows Internet Name Service - Microsoft's implementation of NBNS + +# **Bibliography** + +The following texts have been used in the preparation of this documentation: + +Information about NetBIOS, NetBEUI, NBF, SMB, and CIFS networking can be found "On line" at \[ NetBIOS, NetBEUI, NBF, SMB, CIFS networking links page \] 1 + +_BYTE Magazine November 1989 "Two tin cans and some string" Part 2_ , Rick Grehan. + +_BYTE Magazine January 1989 "Understanding NetBIOS"_, Brett Glass. + +_Inside NETBIOS_, 3rd Edition, J. Scott Haugdahl, Architecture Technology corporation, ISBN 0-939405-00-8. + +_Novell's Guide to NetWare LAN Analysis_, 2nd Edition, Laura A. Chappell and Dan E. Hakes, Novell Press SYBEX, ISBN 0-7821-1362-1. + +_Networking Technologies_, 2nd Edition, Dorothy Cady, Drew Heywood, Debra Niedermiller-Chaffins, and Cheryl Wilhite, New Riders Publishing, ISBN 1-56205-309-4. + +_802.2 Logical Link Control: ANSI/IEEE Std 802.2-1985_, _ISO Draft_, _International Standard 8802/2_, ISBN 0-471-82748-7. + +_IBM LAN Technical Reference: IEEE 802.2 and NetBIOS Application Program Interfaces_, Second Edition (May 1996) SC30-3587-01. + +_Netbios for ISO Networks_, Stephen Thomas, Computer Communications Review - A Quarterly Publication of the Special Interest Group on Data Communications , July / August 1987 Volume 17, No 3. + +_Protocols for X/Open PC Interworking: SMB, Version 2: The Open Group_, X/Open Document Number: C209, ISBN 1-87263-045-6. + +Forbury Road + +Reading + +Berkshire + +RG1 1AX + +United Kingdom + +_Windows NT TCP/IP_, Dr.. Karanjit S. Siyan, New Riders Publishing, ISBN 1-56205-887-8. + +**Notes** + +1\. + +# **Appendix D. Document History** + +This document has been revised from time to time. In August 2001 a change history was added. Some of the changes to the document are listed below: + +• 1998 Documentation posted on Web + +• October 2001 + +• Change History added. + +• Document layout changed. + +• Browser Section added. + +• Information about NetBIOS on IBM PC network moved to appendix. + +• Section on NetBIOS Addresses modified. + +• General corrections and formatting changes. + +• January 2002 + +• Section on Name Resolution (in TCP/IP encapsulation) added. + +• Use of CSS introduced. + +• Minor alterations to Contents section, SMB section and glossary. + +• September 2002 + +• Documentation overhauled. All sections edited. + +• Documentation converted to xml docbook format. + +## **Background** + +How this documentation came to be written is described below: + +During the 1990s there was a move towards distributed networked systems from traditional centralized systems; "down-sizing" and "right-sizing" were some of the "buzz-words" of the time. There was a considerable growth in PC Networks including those using the Server Message Block protocol. + +During this time I was in the Network group of the organization I worked for. It seemed sensible to find out a little about the protocols such as NetBIOS and SMB that were being discussed at that time. As I tried to discover a little about these protocols, I found considerable confusion and very little documentation or reliable information. + +During the late 1990s there were many books on other protocol suites such as TCP/IP, IPX/SPX, AppleTalk and others but there seemed to be none dedicated to NetBIOS or SMB. Eventually I found "Inside NETBIOS, 3rd Edition", by J. Scott Haugdahl, Architecture Technology corporation and later I obtained the official documentation from IBM: "IBM LAN Technical Reference: IEEE 802.2 and NetBIOS Application Program Interfaces, Second Edition (May 1996) SC30-3587-01."; these were (and as far as I know still are) the only books specifically describing the NetBIOS Frames Protocol. While there are now several books that include sections on the protocol the above mentioned books are the only ones that are dedicated to the topic. The situation with SMB seems to be worse; apart from "Protocols for X/Open PC Interworking: SMB, Version 2: The Open Group, X/Open Document Number: C209, ISBN 1-87263-045-6.", I am not aware of any book that exclusively describes SMB. + +I decided to post references to information I had found on a web site in the hopes that it might be useful to others and that this might prompt others to point me in the direction of useful information. As it became apparent how little documentation existed, I made some documentation available as a collection of web pages. + +Over the years a number of people have been kind enough to let me know that they found the documentation useful and so I have continued to develop it on an ad-hoc basis. One request that I consistently received was for the documentation in another format, preferably as a single file, and typically as a PDF document. The most sensible approach seemed to be to convert the documentation to xml format as a docbook document that could then be converted to whatever format was desired for which converters were available. + +# **Colophon** + +#### **Colophon** + +This document has been produced as an xml docbook . Tools have been used to convert the document to other forms such as html. + +• To convert to html, docbook2html was used and the resulting html was then process with htmltidy: + +tidy -asxml -q + +• To convert to RTF, docbook2rtf was used. + +• To convert to PDF, docbook2pdf was used. + +**Notes** + +1\. \ No newline at end of file diff --git a/spec/nbf2cifs.pdf b/spec/nbf2cifs.pdf new file mode 100644 index 0000000..417fcba Binary files /dev/null and b/spec/nbf2cifs.pdf differ diff --git a/spec/nbf2cifs.rtf b/spec/nbf2cifs.rtf new file mode 100644 index 0000000..69b387d --- /dev/null +++ b/spec/nbf2cifs.rtf @@ -0,0 +1,16 @@ +{\rtf1\ansi\deff0 +{\fonttbl{\f4\fnil\fcharset0 Courier New;} +{\f2\fnil\fcharset0 Helvetica;} +{\f3\fnil\fcharset0 Arial;} +{\f1\fnil\fcharset0 Palatino;} +{\f0\fnil\fcharset0 Times New Roman;} +} +{\colortbl;}{\stylesheet{\s1 Heading 1;}{\s2 Heading 2;}{\s3 Heading 3;}{\s4 Heading 4;}{\s5 Heading 5;}{\s6 Heading 6;}{\s7 Heading 7;}{\s8 Heading 8;}{\s9 Heading 9;}} +\deflang1024\notabind\facingp\hyphauto1\widowctrl +\sectd\plain\pgwsxn12240\pghsxn15840\marglsxn1920\margrsxn1920\margtsxn960\margbsxn1200\headery0\footery0\pgndec{\headerl\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}{\footerl\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}{\headerr\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}{\footerr\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}\pard\sl20 \fs20\f1 \hyphpar0\par\pard\sb242\sl354\qc \b\fs32\f2 NetBIOS, NetBEUI, NBF, NBT, NBIPX, SMB, CIFS Networking\keepn\hyphpar0\par\pard\sl220 \b0\fs20\f1 \~\hyphpar0\par\pard\sb1288\sl293\qc \b\fs26\f2 Timothy D Evans \hyphpar0\par\sect\sectd\plain\pgwsxn12240\pghsxn15840\marglsxn1920\margrsxn1920\margtsxn960\margbsxn1200\headery0\footery0\pgndec{\headerl\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}{\footerl\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}{\headerr\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}{\footerr\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}\pard\sl20 \fs20\f1 \keepn\hyphpar0\par\pard\sl-240 \b\f2 NetBIOS, NetBEUI, NBF, NBT, NBIPX, SMB, CIFS Networking\hyphpar0\par\pard\sl220 \b0\f1 by\~ Timothy D Evans \hyphpar0\par\pard\sb220\sl220 Copyright\~\'a9\~1998, 2003 by Timothy D Evans\hyphpar0\par\pard\sb200\sl220 \fs16 Unlimited non-commercial distribution of this document in its entirety is encouraged, please contact the author prior to commercial publication.\hyphpar0\par\pard\sb200\li400\sl198 \b\fs18\f2 Important: \b0\f3 This documentation is revised from time to time. Some of the technology described is constantly changing and being developed, especially the higher level protocols. Thus this document may not always be up to date. The reader is encouraged to ensure they have the latest version.\hyphpar0\par\pard\sb200\sl220 \fs16\f1 All trade marks are respectfully acknowledged.\hyphpar0\par\pard\sl220 While every precaution has been taken in the preparation of this documentation the author assumes no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein.\hyphpar0\par\sect\sectd\plain\pgwsxn12240\pghsxn15840\marglsxn1920\margrsxn1920\margtsxn960\margbsxn1200\headery0\footery0\pgnlcrm\pgnrestart\titlepg{\headerf\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}{\footerf\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}{\headerl\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}{\footerl\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 \chpgn }\tab {}\tab {}\par}{\headerr\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}{\footerr\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}\pard\sb220\s1\sl322 \b\fs29\f2 Table of Contents\keepn\hyphpar0\par\pard\sb146\li1440\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _20 }{\fldrslt \fs20\f1 Preface}}\fs20\f1 \tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _20 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _20}{\fldrslt 000}}}}\hyphpar0\par\pard\sb48\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_readership}{\fldrslt \b0 Who should read this documentation}}\b0 \tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_readership}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_readership}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _28 }{\fldrslt Organization of this documentation}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _28 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _28}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_Acknowledgments}{\fldrslt Acknowledgments}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_Acknowledgments}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_Acknowledgments}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _77 }{\fldrslt Notation}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _77 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _77}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _80 }{\fldrslt Language}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _80 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _80}{\fldrslt 000}}}}\hyphpar0\par\pard\sb48\li1440\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _83 }{\fldrslt \b 1. Introduction}}\b \tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _83 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _83}{\fldrslt 000}}}}\hyphpar0\par\pard\sb48\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_intro_45_History}{\fldrslt \b0 History}}\b0 \tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_intro_45_History}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_intro_45_History}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _128 }{\fldrslt Overview}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _128 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _128}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_intro_45_Implementation}{\fldrslt Implementation}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_intro_45_Implementation}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_intro_45_Implementation}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_Terminology}{\fldrslt Terminology}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_Terminology}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_Terminology}{\fldrslt 000}}}}\hyphpar0\par\pard\sb48\li1440\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _165 }{\fldrslt \b 2. NetBIOS, NetBEUI, NetBIOS Frames Protocol}}\b \tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _165 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _165}{\fldrslt 000}}}}\hyphpar0\par\pard\sb48\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _167 }{\fldrslt \b0 Overview}}\b0 \tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _167 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _167}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_nbf_45_addressing}{\fldrslt Addressing - NetBIOS names}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_nbf_45_addressing}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_nbf_45_addressing}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _288 }{\fldrslt Group Names}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _288 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _288}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _292 }{\fldrslt Name Resolution}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _292 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _292}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_nmp_45_NMP}{\fldrslt Name Management Protocol}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_nmp_45_NMP}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_nmp_45_NMP}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _527 }{\fldrslt User Datagram Protocol}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _527 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _527}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _537 }{\fldrslt NetBIOS Non-Session Frames on 802.2 networks}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _537 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _537}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _631 }{\fldrslt NetBIOS Diagnostic and Monitoring Protocol}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _631 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _631}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_nbf_45_DMP802}{\fldrslt NetBIOS Diagnostic and Monitoring frames on 802.2 networks}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_nbf_45_DMP802}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_nbf_45_DMP802}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _778 }{\fldrslt NetBIOS Session Management Protocol}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _778 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _778}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_nbf_45_SMP802Query}{\fldrslt NetBIOS Session Frames - Name Query - on 802.2 networks}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_nbf_45_SMP802Query}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_nbf_45_SMP802Query}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_nbf_45_SMP802ET}{\fldrslt NetBIOS Session Frames - Establishment and Termination - on 802.2 networks}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_nbf_45_SMP802ET}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_nbf_45_SMP802ET}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_nbf_45_SMP802DT}{\fldrslt NetBIOS Session Frames - Data Transfer - on 802.2 networks}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_nbf_45_SMP802DT}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_nbf_45_SMP802DT}{\fldrslt 000}}}}\hyphpar0\par\pard\sb48\li1440\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _1181 }{\fldrslt \b 3. Supporting Technology, 802.2, Ethernet and Token Ring}}\b \tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _1181 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _1181}{\fldrslt 000}}}}\hyphpar0\par\pard\sb48\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _1184 }{\fldrslt \b0 IEEE 802.2 Logical Link Control}}\b0 \tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _1184 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _1184}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _1236 }{\fldrslt Token Ring}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _1236 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _1236}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _1243 }{\fldrslt Non-MAC Frame Structure}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _1243 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _1243}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _1286 }{\fldrslt Further information}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _1286 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _1286}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _1291 }{\fldrslt Ethernet}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _1291 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _1291}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _1312 }{\fldrslt Ethernet_802.3}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _1312 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _1312}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _1333 }{\fldrslt Ethernet_802.2}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _1333 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _1333}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _1374 }{\fldrslt Ethernet_SNAP}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _1374 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _1374}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _1405 }{\fldrslt Ethernet_II}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _1405 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _1405}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _1432 }{\fldrslt Further information}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _1432 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _1432}{\fldrslt 000}}}}\hyphpar0\par\pard\sb48\li1440\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _1436 }{\fldrslt \b 4. Encapsulation in TCP/IP}}\b \tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _1436 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _1436}{\fldrslt 000}}}}\hyphpar0\par\pard\sb48\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _1440 }{\fldrslt \b0 RFC1001 and RFC1002}}\b0 \tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _1440 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _1440}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _1490 }{\fldrslt Name Resolution}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _1490 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _1490}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _1497 }{\fldrslt LMHOSTS}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _1497 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _1497}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _1527 }{\fldrslt NBNS}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _1527 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _1527}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _1536 }{\fldrslt Hosts and DNS}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _1536 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _1536}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _1544 }{\fldrslt Client Resolution}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _1544 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _1544}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _1547 }{\fldrslt Name management}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _1547 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _1547}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _1559 }{\fldrslt CIFS over TCP/IP}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _1559 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _1559}{\fldrslt 000}}}}\hyphpar0\par\pard\sb48\li1440\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_encap_45_encap}{\fldrslt \b 5. Encapsulation in various protocols and encapsulating}}\b \tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_encap_45_encap}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_encap_45_encap}{\fldrslt 000}}}}\hyphpar0\par\pard\sb48\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _1565 }{\fldrslt \b0 Introduction}}\b0 \tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _1565 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _1565}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _1569 }{\fldrslt IPX/SPX}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _1569 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _1569}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _1631 }{\fldrslt Microsoft Implementation of NetBIOS over IPX}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _1631 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _1631}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_OSI}{\fldrslt NetBIOS Interface and Name Service Support by Lower Layer OSI Protocols}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_OSI}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_OSI}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_ISO}{\fldrslt International Standards Organization (ISO) Protocol Suite}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_ISO}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_ISO}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _1726 }{\fldrslt PPP (Point-to-Point Protocol)}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _1726 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _1726}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _1745 }{\fldrslt Encapsulating}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _1745 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _1745}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _1748 }{\fldrslt Transmission of IP Datagrams over NetBIOS Networks}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _1748 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _1748}{\fldrslt 000}}}}\hyphpar0\par\pard\sb48\li1440\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _1756 }{\fldrslt \b 6. Server Message Block Protocol}}\b \tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _1756 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _1756}{\fldrslt 000}}}}\hyphpar0\par\pard\sb48\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_smb_45_history}{\fldrslt \b0 History}}\b0 \tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_smb_45_history}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_smb_45_history}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _1797 }{\fldrslt Overview}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _1797 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _1797}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _1835 }{\fldrslt Addressing}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _1835 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _1835}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _1862 }{\fldrslt SMB on NBF}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _1862 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _1862}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _1865 }{\fldrslt SMB on NBF datagram frames}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _1865 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _1865}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _2000 }{\fldrslt SMB on NBF session frames}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _2000 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _2000}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _2134 }{\fldrslt SMB frame header}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _2134 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _2134}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_smb_45_SMBCommandCode}{\fldrslt SMB Command Codes}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_smb_45_SMBCommandCode}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_smb_45_SMBCommandCode}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _2573 }{\fldrslt SMB Error Class}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _2573 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _2573}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _2593 }{\fldrslt SMB Return Codes for Error class 0x00}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _2593 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _2593}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _2617 }{\fldrslt SMB Return Codes for Error class 0x02}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _2617 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _2617}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _2641 }{\fldrslt SMB Dialects}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _2641 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _2641}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _2679 }{\fldrslt SAMBA}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _2679 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _2679}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _2685 }{\fldrslt Further information}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _2685 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _2685}{\fldrslt 000}}}}\hyphpar0\par\pard\sb48\li1440\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _2689 }{\fldrslt \b 7. Browser Service}}\b \tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _2689 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _2689}{\fldrslt 000}}}}\hyphpar0\par\pard\sb48\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _2694 }{\fldrslt \b0 History}}\b0 \tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _2694 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _2694}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _2700 }{\fldrslt Overview}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _2700 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _2700}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _2715 }{\fldrslt Packets}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _2715 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _2715}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _2753 }{\fldrslt Further information}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _2753 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _2753}{\fldrslt 000}}}}\hyphpar0\par\pard\sb48\li1440\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _2758 }{\fldrslt \b 8. CIFS and the future}}\b \tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _2758 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _2758}{\fldrslt 000}}}}\hyphpar0\par\pard\sb48\li1440\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_osi_45_OSI}{\fldrslt A. Open Systems Interconnection (OSI) Reference Model}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_osi_45_OSI}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_osi_45_OSI}{\fldrslt 000}}}}\hyphpar0\par\pard\sb48\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _2767 }{\fldrslt \b0 NBF on 802.2 networks}}\b0 \tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _2767 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _2767}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _2802 }{\fldrslt NetBIOS over TCP/IP}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _2802 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _2802}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _2843 }{\fldrslt NetBIOS over IPX}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _2843 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _2843}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _2881 }{\fldrslt CIFS over TCP/IP}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _2881 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _2881}{\fldrslt 000}}}}\hyphpar0\par\pard\sb48\li1440\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_nbibmpc_45_NetBIOS_45_IBM_45_PC_45_Network}{\fldrslt \b B. NetBIOS protocols in IBM PC Network}}\b \tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_nbibmpc_45_NetBIOS_45_IBM_45_PC_45_Network}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_nbibmpc_45_NetBIOS_45_IBM_45_PC_45_Network}{\fldrslt 000}}}}\hyphpar0\par\pard\sb48\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_nbibmpc_45_NMPIBMPC}{\fldrslt \b0 Name Management Frames in IBM PC Networks}}\b0 \tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_nbibmpc_45_NMPIBMPC}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_nbibmpc_45_NMPIBMPC}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _2933 }{\fldrslt Name Claim / Name Cancel Packet in IBM PC Network}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _2933 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _2933}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _3018 }{\fldrslt Name Claim Response Packet in IBM PC Network}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _3018 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _3018}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_nbibmpc_45_UDPIBMPC}{\fldrslt Datagram Packet in IBM PC Network}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_nbibmpc_45_UDPIBMPC}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_nbibmpc_45_UDPIBMPC}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _3110 }{\fldrslt User Datagram Protocol Packet in IBM PC Network}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _3110 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _3110}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_nbibmpc_45_SMPIBMPC}{\fldrslt NetBIOS Session Management Protocol in IBM PC Networks}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_nbibmpc_45_SMPIBMPC}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_nbibmpc_45_SMPIBMPC}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _3203 }{\fldrslt Session Request Packet in IBM PC Network}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _3203 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _3203}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_nbibmpc_45_CompIBMpc}{\fldrslt Comparison of NetBIOS protocols in IBM PC Network}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_nbibmpc_45_CompIBMpc}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_nbibmpc_45_CompIBMpc}{\fldrslt 000}}}}\hyphpar0\par\pard\sb48\li1440\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _3747 }{\fldrslt \b C. Active Directory}}\b \tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _3747 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _3747}{\fldrslt 000}}}}\hyphpar0\par\pard\sb48\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _3755 }{\fldrslt \b0 Domain Name System (DNS)}}\b0 \tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _3755 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _3755}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _3768 }{\fldrslt Lightweight Directory Access Protocol (LDAP)}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _3768 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _3768}{\fldrslt 000}}}}\hyphpar0\par\pard\sb48\li1440\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _3780 }{\fldrslt \b Glossary}}\b \tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _3780 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _3780}{\fldrslt 000}}}}\hyphpar0\par\pard\sb48\li1440\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_refs_45_References}{\fldrslt Bibliography}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_refs_45_References}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_refs_45_References}{\fldrslt 000}}}}\hyphpar0\par\pard\sb48\li1440\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _4056 }{\fldrslt D. Document History}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _4056 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _4056}{\fldrslt 000}}}}\hyphpar0\par\pard\sb48\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _4093 }{\fldrslt \b0 Background}}\b0 \tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _4093 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _4093}{\fldrslt 000}}}}\hyphpar0\par\pard\sb48\li1440\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _4101 }{\fldrslt \b Colophon}}\b \tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _4101 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _4101}{\fldrslt 000}}}}\hyphpar0\par\sect\sectd\plain\pgwsxn12240\pghsxn15840\marglsxn1920\margrsxn1920\margtsxn960\margbsxn1200\headery0\footery0\pgnlcrm\pgnrestart\titlepg{\headerf\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}{\footerf\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}{\headerl\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 Preface}\tab {}\tab {}\par}{\footerl\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 \chpgn }\tab {}\tab {}\par}{\headerr\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 Preface}\par}{\footerr\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}\pard\sb220\s1\sl322 {\*\bkmkstart _20}{\*\bkmkend _20}\b\fs29\f2 Preface\keepn\hyphpar0\par\pard\sb146\li960\sl220\qj \b0\fs20\lang1033\f1 While there is documentation readily available for protocol suits such as AppleTalk, DECnet, IPX/SPX and TCP/IP, it is difficult to find documentation for the suite or family of protocols which includes the NetBIOS Frames Protocol, NBF, (often referred to as NetBEUI or sometimes as NetBIOS), the Server Message Block protocol, SMB, and Common Internet File System, CIFS; this documentation attempts to provide some information on these protocols. \hyphpar0\par\pard\sb100\li960\sl220\qj This document is primarily concerned with the networking protocols rather than specific implementations such as Samba, which are well documented elsewhere. Network programming (and discussion of the various APIs) is also outside the scope of this documentation. \hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart ID_readership}{\*\bkmkend ID_readership}\b\fs26\lang1024\f2 Who should read this documentation\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 It is assumed that the reader is familiar with one or more networking protocols. Comparisons are made with other well-known protocols in order to better explain the roles of the various protocols described here and how they fit together. \hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart _28}{\*\bkmkend _28}\b\fs26\lang1024\f2 Organization of this documentation\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 This documentation is organized in to the following chapters:\hyphpar0\par\pard\sb200\li960\sl220\qj \lang1024 Introduction\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab The various protocols to be discussed are introduced and a brief history is provided.\hyphpar0\par\pard\sb200\li960\sl220\qj NetBIOS, NetBEUI, NetBIOS Frames Protocol\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab The NetBIOS Frames Protocol (NBF) is described in terms of the various protocols that were associated with the original NetBIOS implementation.\hyphpar0\par\pard\sb200\li960\sl220\qj Supporting Technology, Ethernet and Token Ring\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab This chapter discusses the various technologies used when NetBIOS is implemented "on the wire".\hyphpar0\par\pard\sb200\li960\sl220\qj Encapsulation in TCP/IP\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab The most popular configuration, NetBIOS over TCP/IP is described here.\hyphpar0\par\pard\sb200\li960\sl220\qj Encapsulation in various protocols and encapsulating\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab NetBIOS can be encapsulated in many protocols and some of the configurations are described in this chapter.\hyphpar0\par\pard\sb200\li960\sl220\qj Server Message Block Protocol\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab The SMB protocol, used for file and print sharing is examined in this chapter.\hyphpar0\par\pard\sb200\li960\sl220\qj Browser Service\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab Although the Browser Service is part of SMB networking (and indeed is implemented over SMB frames), the protocols are sufficiently important to merit particular discussion.\hyphpar0\par\pard\sb200\li960\sl220\qj CIFS and the future\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab This chapter looks at the latest implementation of the SMB protocol, now called CIFS.\hyphpar0\par\pard\sb200\li960\sl220\qj Appendices\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab Three appendices provide some additional information. The way in which the protocols discussed might be mapped to the OSI model is illustrated. Information on the original NetBIOS protocols in the IBM PC Network is provided. A brief look at Microsoft's Active Directory is also included.\hyphpar0\par\pard\sb100\li960\sl220\qj \lang1033 A glossary is included for convenience. Following a Bibliography is a brief history of this documentation.\hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart ID_Acknowledgments}{\*\bkmkend ID_Acknowledgments}\b\fs26\lang1024\f2 Acknowledgments\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 I would like to thank the following people for their comments and corrections. \hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 Ernie Cooper (bama@us.ibm.com) \hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 Giampaolo Tomassoni (tomassoni@ftbcc.it) \hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart _77}{\*\bkmkend _77}\b\fs26\f2 Notation\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 Hexadecimal numbers are shown either as 0xNNNN or NNNNh. \hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart _80}{\*\bkmkend _80}\b\fs26\lang1024\f2 Language\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 This document has been written in UK English. My apologies for any spelling or grammatical errors. \hyphpar0\par\sect\sectd\plain\pgwsxn12240\pghsxn15840\marglsxn1920\margrsxn1920\margtsxn960\margbsxn1200\headery0\footery0\pgndec\pgnrestart\titlepg{\headerf\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}{\footerf\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}{\headerl\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 Chapter 1. Introduction}\tab {}\tab {}\par}{\footerl\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 \chpgn }\tab {}\tab {}\par}{\headerr\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 Chapter 1. Introduction}\par}{\footerr\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}\pard\sb220\s1\sl322 {\*\bkmkstart _83}{\*\bkmkend _83}\b\fs29\f2 Chapter 1. Introduction\keepn\hyphpar0\par\pard\sb146\li960\sl220\qj \b0\fs20\lang1033\f1 There is a suite or family of protocols which includes the NetBIOS Frames Protocol, NBF, (often referred to as NetBEUI or sometimes as NetBIOS), the Server Message Block protocol, SMB, and Common Internet File System, CIFS. These protocols are associated with the original NetBIOS implementation with which they have a historical link. \hyphpar0\par\pard\sb100\li960\sl220\qj Many systems use SMB including Microsoft's Windows for Workgroups, Windows 95 / 98 / ME, LAN Manager, Windows NT, Windows 2000 and IBM's OS/2 and LAN Server, NetWare 6 and the SAMBA implementation. SAMBA is freely available for a wide range of systems and further information can be found at the SAMBA web site. \i http://www.samba.org\i0 \up8\fs12 1\up0\fs20 \hyphpar0\par\pard\sb100\li960\sl220\qj This document begins by describing NetBIOS (Network Basic Input / Output System) also known as NetBEUI (NetBIOS Extended User Interface) or NBF (NetBIOS Frames protocol) in terms of an original suite of protocols which includes the Name Management Protocol (NMP), Diagnostic and Monitoring Protocol (DMP), User Datagram Protocol (UDP) and the Session Management Protocol (SMP) that were used in the original implementation. \hyphpar0\par\pard\sb100\li960\sl220\qj Following a brief description of supporting technologies such as Ethernet and Token Ring, encapsulation of these protocols is considered as well as using these protocols to encapsulate other protocols. \hyphpar0\par\pard\sb100\li960\sl220\qj There is no formal standard that defines the protocol(s) used with NetBIOS; in practice the IBM LAN Technical Reference IEEE 802.2 and NetBIOS Application Program Interface is used as a reference (see {\field{\*\fldinst HYPERLINK \\l ID_refs_45_References}{\fldrslt \i Bibliography}}). \hyphpar0\par\pard\sb100\li960\sl220\qj There are many implementations of NetBIOS networking and these implementations are generally incompatible. It is because of the diversity and lack of a formal standard that makes understanding NetBIOS networking difficult. \hyphpar0\par\pard\sb100\li960\sl220\qj It is not clear whether there is only one protocol or several protocols involved in NetBIOS networking. The original implementation for the PC Network certainly seemed to have the above-mentioned protocols (NMP, DMP, UDP and SMP) however the distinction is less clear with NetBIOS on Token-Ring and other implementations. Given that at least network layer and session layer functions are involved, the various packets used will be discussed in terms of the original protocols for convenience, even if the distinctions are somewhat arbitrary. \hyphpar0\par\pard\sb100\li960\sl220\qj Following descriptions of the lower level protocols and encapsulation, important higher level protocols (such as SMB, CIFS and the browser service) that run over these lower protocols are described. The situation with respect to the higher level protocols is also complicated; the protocols (SMB and CIFS) were developed as proprietary protocols and information has been difficult to obtain. Although information has been released from time to time, it is not always easy to obtain information on the latest version. Currently Microsoft continues to develop CIFS for it's range of operating systems. Teams of developers such as the SAMBA group reverse engineer the technology. This documentation presents information that is publicly available. \hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart ID_intro_45_History}{\*\bkmkend ID_intro_45_History}\b\fs26\lang1024\f2 History\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 The NetBIOS interface was developed for International Business Machines Corporation (IBM) in 1983 by Sytec Inc. (which became Hughes LAN Systems, then Whittaker Communications). This operated over proprietary Sytec protocols on IBM's PC Network which is a broadband local area network. The broadband PC Network is a bus-attached LAN, which can accommodate up to 72 connecting devices. The baseband PC Network is also a bus-attached LAN which can accommodate up to 80 connecting devices; \i It is important to note the scale of LAN which NetBIOS was designed for.\i0 NetBIOS was not designed for large networks. \hyphpar0\par\pard\sb100\li960\sl220\qj When IBM announced the Token-Ring, an emulator for NetBIOS was produced allowing applications developed for the PC Network to operate on Token-Ring. The NetBIOS Extended User Interface (NetBEUI) was introduced in 1985. The Token-Ring network can accommodate up to 260 devices on one ring and multiple rings can be connected by Bridges. \hyphpar0\par\pard\sb100\li960\sl220\qj In 1986 Novell released Advanced NetWare version 2.0. With version 2.0 and all subsequent packages a NetBIOS interface has been included; Novell implemented NetBIOS encapsulated in IPX/SPX. Later Microsoft reverse- engineered the technology to provide encapsulation of NetBIOS in IPX/SPX that is compatible with the Novell implementation. \hyphpar0\par\pard\sb100\li960\sl220\qj With the Personal System /2 computer (PS/2) in 1987, IBM announced the PC LAN Support Program which included a NetBIOS driver. \hyphpar0\par\pard\sb100\li960\sl220\qj In March 1987, RFC 1001 was published which described a "Protocol Standard for a NetBIOS Service on a TCP/UDP Transport". \hyphpar0\par\pard\sb100\li960\sl220\qj Prior to the IBM Lan Support Program, versions of NetBIOS were named with version numbers 1.X. With the LAN Support Program the following NetBIOS versions were used: \hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Table 1-1. LAN Support Program versions compared with NetBIOS versions\sa100\keepn\par\trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 LAN Support Program version\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 NetBIOS version\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1.00\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2.0\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1.01\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2.1\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1.02\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2.2\sa60\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 Version 2.x of NetBIOS has been superseded by NetBIOS version 3.0 and version 4.0. \hyphpar0\par\pard\sb100\li960\sl220\qj In 1987 Microsoft announced the LAN Manager which runs natively over NetBIOS frames. \hyphpar0\par\pard\sb100\li960\sl220\qj Microsoft and Intel introduced the SMB Core Protocol in 1988 (SMB-CORE.PS). SMB has been developed during subsequent years and is widely used be many systems. The protocol began life as a proprietary protocol and documentation was very difficult to find. A Version of the protocol (version 2) was published by the Open Group X/Open 1992. However since that time subsequent versions have been developed by Microsoft which re-named the protocol \'93Common Internet File System\'94 (CIFS). \hyphpar0\par\pard\sb100\li960\sl220\qj The history of SMB and CIFS is further discussed in: {\field{\*\fldinst HYPERLINK \\l ID_smb_45_history}{\fldrslt the section called \i History\i0 in Chapter 6}} \hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart _128}{\*\bkmkend _128}\b\fs26\lang1024\f2 Overview\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 The protocols considered here are mainly proprietary and documentation is often poor and hard to find. A high level view is presented here that attempts to describe how the protocols relate to each other. \hyphpar0\par\pard\sb100\li960\sl220\qj The original NetBIOS protocol was developed to become the NetBIOS Frames Protocol (NFB) often referred to as NetBEUI or just NetBIOS. This protocol is still used today, but is not popular because it is not routable or scalable. NBF or NetBEUI provides a datagram delivery and session service that can be used for a variety of network applications. \hyphpar0\par\pard\sb100\li960\sl220\qj The above protocol is often encapsulated in other (routable) protocols such as IPX/SPX (which Microsoft refers to as NBIPX) or TCP/IP (which Microsoft refers to as NBT). The use of NetBIOS over TCP/IP is still one of the most popular network protocol configurations. \hyphpar0\par\pard\sb100\li960\sl220\qj Although NBF (either in encapsulated form or "on the wire") can be used for a variety of applications it is often used as a foundation for the Server Message Block (SMB) protocol. One of the most widely used network configurations is SMB running over NetBIOS over TCP/IP. \hyphpar0\par\pard\sb100\li960\sl220\qj SMB has been developed to become the Common Internet File System (CIFS). Recently CIFS has been implemented directly on TCP/IP without requiring the NetBIOS over TCP/IP layer. \hyphpar0\par\pard\sb100\li960\sl220\qj The relationship between the various protocols with respect to the OSI model is illustrated in: {\field{\*\fldinst HYPERLINK \\l ID_osi_45_OSI}{\fldrslt Appendix A}} \hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart ID_intro_45_Implementation}{\*\bkmkend ID_intro_45_Implementation}\b\fs26\lang1024\f2 Implementation\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 NetBIOS is often described as a "Session Layer" protocol and a variety of transport systems have been used in different implementations. Some of these implementations are described in {\field{\*\fldinst HYPERLINK \\l ID_encap_45_encap}{\fldrslt Chapter 5}} . The protocols used to encapsulate NetBIOS are generally well understood and well documented; what is often not well understood are implementations of NetBIOS "on the wire" in a "raw" un-encapsulated form. \hyphpar0\par\pard\sb100\li960\sl220\qj Two implementations of NetBIOS "on the wire" are considered here: The original NetBIOS in IBM PC Networks (See {\field{\*\fldinst HYPERLINK \\l ID_nbibmpc_45_CompIBMpc}{\fldrslt the section called \i Comparison of NetBIOS protocols in IBM PC Network\i0 in Appendix B}} ) and NetBIOS Frames Protocol on 802.2 networks. Although the IBM PC Network version was developed first, the current NetBIOS Frames Protocol on 802.2 networks is emphasized in this document as being the more relevant. \hyphpar0\par\pard\sb100\li960\sl220\qj It should be noted that the frames in NetBIOS in IBM PC Networks are more complex and seem less consistent than frames in the NetBIOS Frames Protocol on 802.2 networks. The IBM PC Networks implementation separates in to the protocols mentioned above, where as all the frames in NetBIOS Frames Protocol on 802.2 networks are more consistent in their format. \hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart ID_Terminology}{\*\bkmkend ID_Terminology}\b\fs26\lang1024\f2 Terminology\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 Because of the history of the protocols being discussed here (See {\field{\*\fldinst HYPERLINK \\l ID_intro_45_History}{\fldrslt the section called \i History}} ) and lack of standards, there is often confusion in the use of some of the terms; it is not uncommon to hear statements of the form "NetBIOS is not a protocol" or "NetBEUI is a protocol". \hyphpar0\par\pard\sb200\li960\sl220\qj NetBIOS is not a protocol\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab As described in the history above, NetBIOS was designed as an interface. NetBIOS was designed to be an extension to the BIOS (Basic Input/Output System) of PCs to provide networking services. At the risk of being pedantic, NetBIOS was designed as an application programming interface (API). It is interesting (and the source of some confusion) that it was the API which was the standard. \hyphpar0\par\pard\sb200\li960\sl220\qj NetBIOS is a protocol\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab The term "protocol" is often used as a shorthand reference to a suite of protocols (a well-known example is the use of the term "TCP/IP protocol" to refer to a collection of protocols). The informal use of the term "protocol" is well-understood and accepted practice. It has become standard practice to use the term "NetBIOS protocol" to refer to the original set of protocols in use with the NetBIOS API and the protocols which followed. The current official term used by IBM is "NetBIOS Frames Protocol" (NBF) and it is not unreasonable to shorten this to "NetBIOS". \hyphpar0\par\pard\sb200\li960\sl220\qj NetBEUI is not a protocol\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab If NetBIOS is not a protocol, but is an API, then an "Extended User Interface" to this API is also not a protocol. As mentioned above, and described in the history, when IBM developed Token Ring it was continuity of the API to ensure applications would continue to function which was important. The NetBIOS API was preserved and extended in the NetBIOS Extended user Interface, NetBEUI. \hyphpar0\par\pard\sb200\li960\sl220\qj NetBEUI is a protocol\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab With the development of NetBEUI, a set of protocols was developed, now known as the NetBIOS Frames Protocol. Since the NetBIOS Frames Protocol was used with the NetBEUI API it became accepted practice to refer to these protocols as the "NetBEUI protocol". It is still common to find documentation which refers to the "NetBEUI protocol". \hyphpar0\par\pard\sb100\li960\sl220\qj \hyphpar0\par\pard\sb200\sl293 \b\fs26\lang1024\f2 Notes\keepn\hyphpar0\par\pard\sb133\li1280\sl220\fi-320\qj \tx1280 \b0\fs20\f1 1. \tab http://www.samba.org\hyphpar0\par\sect\sectd\plain\pgwsxn12240\pghsxn15840\marglsxn1920\margrsxn1920\margtsxn960\margbsxn1200\headery0\footery0\pgndec\titlepg{\headerf\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}{\footerf\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}{\headerl\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 Chapter 2. NetBIOS, NetBEUI, NetBIOS Frames Protocol}\tab {}\tab {}\par}{\footerl\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 \chpgn }\tab {}\tab {}\par}{\headerr\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 Chapter 2. NetBIOS, NetBEUI, NetBIOS Frames Protocol}\par}{\footerr\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}\pard\sb220\s1\sl322 {\*\bkmkstart _165}{\*\bkmkend _165}\b\fs29\f2 Chapter 2. NetBIOS, NetBEUI, NetBIOS Frames Protocol\keepn\hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart _167}{\*\bkmkend _167}\fs26 Overview\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 The use of NetBIOS, (otherwise known as NetBEUI, NetBIOS Frames Protocol, NBF) is not a popular choice. Many networks use some form of encapsulation with the most popular being TCP/IP. It is important to understand that the various encapsulation implementations are designed to emulate the use of NetBIOS "on the wire"; the goal is to allow higher level protocols (such as SMB or CIFS) or applications to make use of the NetBIOS protocol irrespective of whether it is running "on the wire" or encapsulated. Thus in order to fully understand implementations that use encapsulation, it is necessary to understand "NetBIOS on the wire". \hyphpar0\par\pard\sb100\li960\sl220\qj It is not clear whether there is only one protocol or several protocols involved in NetBIOS networking. The original implementation for the PC Network certainly seemed to have the following protocols: Name Management protocol (NMP), Diagnostic and Monitoring Protocol (DMP), User Datagram Protocol (UDP) and Session Management Protocol (SMP). The distinction is less clear with NetBIOS on Token-Ring and other Implementations; the official IBM documentation [IBM LAN Technical Reference IEEE 802.2 and NetBIOS Application Program Interfaces ] simply describes a collection of 22 frame formats, see {\field{\*\fldinst HYPERLINK \\l ID_NBF_45_NBFFrames}{\fldrslt Table 2-1}} . Given that at least network layer and session layer functions are involved, the various packets used will be discussed in terms of the original protocols for convenience, even if the distinctions are somewhat arbitrary. \hyphpar0\par\pard\sb200\li960\sl220\qj {\*\bkmkstart ID_NBF_45_NBFFrames}{\*\bkmkend ID_NBF_45_NBFFrames}\b\lang1024 Table 2-1. NBF Frames\sa100\keepn\par\trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Frame name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Command code\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ADD_NAME_QUERY\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x01\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ADD_GROUP_NAME\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x00\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ADD_NAME_RESPONSE\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x0D\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 NAME_IN_CONFLICT\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x02\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 NAME_QUERY\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x0A\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 NAME_RECOGNISED\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x0E\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 DATAGRAM\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x08\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 DATAGRAM_BROADCAST\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x09\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 STATUS_QUERY\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x03\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 STATUS_RESPONSE\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x0F\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 TERMINATE_TRACE\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x07\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 TERMINATE_TRACE local and remote\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x13\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SESSION_ALIVE\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x1F\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SESSION_CONFIRM\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x17\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SESSION_END\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x18\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SESSION_INITIALIZE\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x19\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 DATA_ACK\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x14\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 DATA_FIRST_MIDDLE\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x15\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 DATA_ONLY_LAST\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x16\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 NO_RECEIVE\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x1A\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 RECEIVE_OUTSTANDING\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x1B\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 RECEIVE_CONTINUE\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x1C\sa60\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 NetBIOS systems communicate in one of two manners; the protocols are often described as Session layer protocols because most of the communications occur over sessions established between two nodes on the network. The other form of communication does not involve sessions and uses a simple datagram transmission mechanism for simple communications between systems on a network. Non-session frames are used for functions such as name management or other functions that simply require a datagram delivery service. In general when one system needs to communicate with another it will contact that system and a session will be established between the two nodes; the session will be maintained as long as either node needs to communicate until one of the nodes closes the session. \hyphpar0\par\pard\sb100\li960\sl220\qj Sessions are established using an exchange of packets. The station wishing to establish the session sends an Open request that should be responded to with an Open acknowledgment. The station initiating the session will then send a Session request which will elicit either a Session accept or Session reject. \hyphpar0\par\pard\sb100\li960\sl220\qj Data is transmitted using an established session through the sending system sending data packets which are responded to with either acknowledgment packets (ACK) or negative acknowledgment packets (NACK) prompting re-transmission. \hyphpar0\par\pard\sb100\li960\sl220\qj Sessions are closed by the system that received data sending a close request that should be responded to by the system that initiated the session sending a close response. This is followed by the system that received data sending a packet indicating that the session is closed. \hyphpar0\par\pard\sb100\li960\sl220\qj Obviously in order to communicate, systems need an address scheme and this is described in {\field{\*\fldinst HYPERLINK \\l ID_nbf_45_addressing}{\fldrslt the section called \i Addressing - NetBIOS names}}. \hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart ID_nbf_45_addressing}{\*\bkmkend ID_nbf_45_addressing}\b\fs26\lang1024\f2 Addressing - NetBIOS names\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 To communicate, each node (computer, printer, router etc) needs to be uniquely identified on a network. Within the TCP/IP suite of protocols, under the IPv4 address scheme, a 32 bit address identifies each node and the network it is connected to. In IPX/SPX networks, a 48 bit address identifies a node on a network and a 32 bit address identifies each network. In NetBIOS networks names are used by each node. \hyphpar0\par\pard\sb100\li960\sl220\qj NetBIOS names are 16 bytes (128 bits) long (padded if necessary) and there are very few restraints on the byte values that can be used. Non-alphanumeric characters can be used in NetBIOS names, although some implementations may not support this and applications using NetBIOS may impose other constraints. \hyphpar0\par\pard\sb100\li960\sl220\qj Often an implementation will make use of the 16th byte, for example to indicate a particular service; thus the 16th byte may be used in a way which is broadly analogous to port numbers in TCP/IP. \hyphpar0\par\pard\sb100\li960\sl220\qj It is worth noting that SMB / CIFS names map directly on to NetBIOS names and in this case the 16th byte is particularly important for identifying various services. \hyphpar0\par\pard\sb100\li960\sl220\qj Microsoft has produced a Knowledge Base Article that lists the NetBIOS suffixes (i.e. the sixteenth byte) that Microsoft uses or supports.\hyphpar0\par\pard\sb100\li960\sl220\qj The Knowledge Base Article is Q163409 and can be found at http://support.microsoft.com/default.aspx?scid=kb;en-us;Q163409\up8\fs12 1\hyphpar0\par\pard\sb100\li960\sl220\qj \up0\fs20 Some examples of the 16th byte in Unique names are given below: \hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Table 2-2. Example Unique names\sa100\keepn\par\trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 16th byte (in hex)\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Description\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 00\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Workstation service\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 01\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Messenger service\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 20\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 File server service\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2B\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Lotus Notes Server Service\sa60\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 NetBIOS names represent a flat name space; names are non-hierarchical with no provision for subdivision. Because there is no provision for identifying networks with the NetBIOS name scheme, protocols using this name scheme can not be routed. \hyphpar0\par\pard\sb100\li960\sl220\qj A NetBIOS name is often associated with one end of a session between two nodes. \hyphpar0\par\pard\sb100\li960\sl220\qj A station on the network can be known by several names (aliases) originally up to 12 (See BYTE Magazine November 1989 "Two tin cans and some string" Part 2 {\field{\*\fldinst HYPERLINK \\l ID_refs_45_References}{\fldrslt \i Bibliography}} ) or 17 names (See BYTE Magazine January 1989 "Understanding NetBIOS" {\field{\*\fldinst HYPERLINK \\l ID_refs_45_References}{\fldrslt \i Bibliography}}) . Modern implementations allow very many names to be used. Names can be unique names reserved for the station's exclusive use or group names shared with other stations. \hyphpar0\par\pard\sb200\s3\sl266 {\*\bkmkstart _288}{\*\bkmkend _288}\b\fs24\lang1024\f2 Group Names\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 Group Names are NetBIOS names that several stations can use. Each Group Name must be unique and in many situations must be distinct from any unique (node) names. These names allow stations to be grouped together to facilitate management and browsing of the network. Stations can send broadcast messages to all stations that share a particular group name. \hyphpar0\par\pard\sb100\li960\sl220\qj Within SMB / CIFS environments, collections of systems such as workgroups or domains map on to NetBIOS Group names. \hyphpar0\par\pard\sb200\s3\sl266 {\*\bkmkstart _292}{\*\bkmkend _292}\b\fs24\lang1024\f2 Name Resolution\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 One name is the permanent node name, which is the physical adapter card's name; this is usually derived from the Media Access Control (MAC) address of the card i.e. the hardware address and consists of 10 bytes of zeros followed by the 6 bytes of the MAC address. This special permanent node name is often called "NETBIOS_NAME_1". It is because one of the names incorporates the physical MAC address (and because there is only one network) that there is often no name resolution protocol (analogous to the Address Resolution Protocol ARP in TCP/IP networks). \hyphpar0\par\pard\sb100\li960\sl220\qj When NetBIOS is encapsulated within other protocols such as IPX/SPX or TCP/IP there is a mechanism for mapping NetBIOS names to the address schemes of the encapsulating protocol. See {\field{\*\fldinst HYPERLINK \\l ID_encap_45_encap}{\fldrslt Chapter 5}} Encapsulation. \hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart ID_nmp_45_NMP}{\*\bkmkend ID_nmp_45_NMP}\b\fs26\lang1024\f2 Name Management Protocol\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 The Name Management Protocol (NMP) allows systems to create unique symbolic names that are visible on the network. NMP has some similarities with the AppleTalk Name Binding Protocol: The Name Management Protocol broadcasts a system's intention to use a new name and if no other system objects, the name is registered. NetBIOS broadcasts a name claim packet several times and if no other station contests the name claim the name is added to the local name table. Typically the packets are sent at half second intervals six times, although in principal these parameters can be tuned. Often a node will require three seconds to check each name it is using. \hyphpar0\par\pard\sb100\li960\sl220\qj The original Name Management Protocol is described in {\field{\*\fldinst HYPERLINK \\l ID_nbibmpc_45_NetBIOS_45_IBM_45_PC_45_Network}{\fldrslt Appendix B}} in the section {\field{\*\fldinst HYPERLINK \\l ID_nbibmpc_45_NMPIBMPC}{\fldrslt the section called \i Name Management Frames in IBM PC Networks\i0 in Appendix B}} . \hyphpar0\par\pard\sb100\li960\sl220\qj In the NetBIOS Frames Protocol on 802.2 networks there are four non-session level Name Management Frames. As described in {\field{\*\fldinst HYPERLINK \\l ID_nbf_45_addressing}{\fldrslt the section called \i Addressing - NetBIOS names}} there are two kinds of names: unique names and group names. \hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 The "ADD NAME QUERY" frame (0x01) is used by a node to verify that the name it wishes to add is unique within the network. \hyphpar0\par\pard\sb100\li1160\sl220\qj \lang1033 The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x01 identifying it as an "ADD NAME QUERY" frame. \hyphpar0\par\pard\sb100\li1160\sl220\qj Five reserved octets are followed by a two byte response correlator, transmitted byte reversed, created by the sender and used to correlate any responses to the query. The next sixteen octets, used for the destination name in other frames, are reserved in this case. The following sixteen octets for the source name are used to identify the name to be added. \hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 The "ADD GROUP NAME" frame (0x00) is used by a node to verify that the group name does not exist as a unique name within the network. \hyphpar0\par\pard\sb100\li1160\sl220\qj \lang1033 The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x00 identifying it as an "ADD GROUP NAME QUERY" frame. \hyphpar0\par\pard\sb100\li1160\sl220\qj Five reserved octets are followed by a two byte response correlator, transmitted byte reversed, created by the sender and used to correlate any responses to the query. The next sixteen octets, used for the destination name in other frames, are reserved in this case. The following sixteen octets for the source name are used to identify the group name to be added. \hyphpar0\par\pard\sb100\li1160\sl220\qj The "ADD NAME RESPONSE" frame (0x0D) is used in response to one of the above query frames to inform the node wishing to add the name that the name is already in use. The "ADD NAME RESPONSE" frame (0x0D) is used in response to one of the above query frames to inform the node wishing to add the name that the name is already in use. \hyphpar0\par\pard\sb100\li1160\sl220\qj The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x0D identifying it as an "ADD NAME RESPONSE" frame. \hyphpar0\par\pard\sb100\li1160\sl220\qj The next octet, the "DATA1" octet is set to 1 or 0; 0 = "add name not in process", 1 = "add name in process". The next two bytes, known as "DATA2", constitutes a define word set to 0 or 1; 0 = "unique name, 1 = "group name"; this is transmitted byte reversed. The next two bytes constitute a correlator, transmitted byte reversed, used to correlate the response with the original query. Two reserved octets are followed by sixteen octets holding the name to be added and a further sixteen octets which again hold the name to be added. \hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 The "NAME IN CONFLICT" frame (0x02) is used to indicate a problem with names on the network; it is sent if more than one adapter has the same unique name registered or a name is registered as both a unique name and a group name. \hyphpar0\par\pard\sb100\li1160\sl220\qj \lang1033 The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x02 identifying it as an "NAME IN CONFLICT" frame. \hyphpar0\par\pard\sb100\li1160\sl220\qj Seven reserved octets are followed by sixteen octets representing the name in conflict. The final sixteen octets represent the special "NAME NUMBER 1" of the node sending the frame. \hyphpar0\par\pard\sb100\li1160\sl220\qj The "ADD NAME QUERY" frame (0x01) is used by a node to verify that the name it wishes to add is unique within the network. \hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Table 2-3. Name Management Frames (Octets in order transmitted.)\sa100\keepn\par\trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Management frame\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Management frame\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Management frame\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Management frame\sa60\cell \row \trowd\trleft960\trhdr \clvertalt\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvertalt\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Field Name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Length\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 ADD GROUP NAME QUERY\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 ADD NAME QUERY\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 ADD NAME RESPONSE\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 NAME IN CONFLICT\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Length\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x2C\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x2C\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x2C\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x2C\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x00\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x00\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x00\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x00\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Deliminator\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xFF\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xFF\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xFF\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xFF\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xEF\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xEF\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xEF\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xEF\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \i\fs20\f1 Command\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \i\fs20\f1 0x00\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \i\fs20\f1 0x01\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \i\fs20\f1 0x0D\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \i\fs20\f1 0x02\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Data 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0 or 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Data 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0 or 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 XMIT Cor\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nn\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nn\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 RSP Cor\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nn\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nn\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nn\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nn\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Destination Name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 16\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Name to be added\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Name in conflict\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source Name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 16\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Group name to add\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Name to add\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Name to be added\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 NAME NUMBER 1\sa60\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 In the NetBIOS Frames Protocol on 802.2 networks there are two frames used for managing names in session establishment. Although not part of name management, these frames are included here for convenience. \hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 The "NAME QUERY" frame (0x0A) is used to find a name on the network or to request a remote node to establish a session. \hyphpar0\par\pard\sb100\li1160\sl220\qj \lang1033 The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x0A identifying it as an "NAME QUERY" frame. \hyphpar0\par\pard\sb100\li1160\sl220\qj Following the "DATA1" field which is reserved, the two octets of the "DATA2" field are set to "ttss" where "tt" indicates the type of name being called, 00 for a unique name and 01 for a group name; "ss" is used to indicate the session number. The "DATA2" field is transmitted byte reversed. Two reserved octets are followed by a two byte response correlator, transmitted byte reversed. Sixteen octets identify the name being called. The final sixteen octets identify the name of the node making the call. \hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 The "NAME RECOGNISED" frame (0x0E) is used in response to a NAME QUERY frame to indicate that a session can be established with the name or to provide the location of the name. \hyphpar0\par\pard\sb100\li1160\sl220\qj \lang1033 The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x0E identifying it as an "NAME RECOGNISED" frame. \hyphpar0\par\pard\sb100\li1160\sl220\qj Following the "DATA1" field which is reserved, the two bytes of the "DATA2" field are set to "ttss" where "tt" is set to 0x00 to indicate a unique recognized name or 0x01 to indicate a unique recognized group name. the type of name being called, 00 for a unique name and 01 for a group "ss" is used to indicate the "state" of the name: 0x00 is used when the station is not listening for this name, 0xFF is used when the station is listening for this name, but can not establish a session, 0x01 to 0xFE are used as a number which will identify this session. The "DATA2" field is transmitted byte reversed. \hyphpar0\par\pard\sb100\li1160\sl220\qj A two byte transmit correlator is used to correlate the response with the NAME QUERY frame. This is followed by a two byte response correlator used with SESSION INITIALIZE frames; these fields are transmitted byte reversed. Sixteen octets identify the name of the node making the NAME QUERY call. The final sixteen octets identify the name being queried. \hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Table 2-4. Frames for managing names in session establishment (Octets in order transmitted).\sa100\keepn\par\trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Management frame\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Management frame\sa60\cell \row \trowd\trleft960\trhdr \clvertalt\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Field Name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Length\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 NAME QUERY\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 NAME RECOGNISED\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Length\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x2C\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x2C\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x00\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x00\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Deliminator\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xFF\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xFF\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xEF\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xEF\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \i\fs20\f1 Command\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \i\fs20\f1 0x0A\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \i\fs20\f1 0x0E\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Data 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Data 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 X ss\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 X ss\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 X tt\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 X tt\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 XMIT Cor\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nn\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nn\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 RSP Cor\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nn\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nn\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nn\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nn\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Destination Name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 16\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Name of receiver\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Name of receiver\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source Name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 16\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Name of sender\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Name of sender\sa60\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart _527}{\*\bkmkend _527}\b\fs26\f2 User Datagram Protocol\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 The NetBIOS User Datagram Protocol (UDP) provides packet transmission from source to destination. UDP is an unreliable datagram delivery protocol. \hyphpar0\par\pard\sb100\li960\sl220\qj NetBIOS User Datagram Protocol is comparable with the Datagram Delivery Protocol (DDP) in AppleTalk, or IP in the TCP/IP suite of protocols, or IPX in Novell's IPX/SPX protocol suite. It is important to note that the NetBIOS User Datagram Protocol differs from datagram protocols in other protocol suites; the NetBIOS User Datagram Protocol is designed specifically to provide a datagram delivery service and not necessarily to provide a foundation for higher level protocols. Where as in other protocol suites the datagram protocol supports transport and session layer protocols running over the datagram protocol, here there is a separate Session Management Protocol which does not make use of the NetBIOS User Datagram Protocol. The relationship is illustrated in the {\field{\*\fldinst HYPERLINK \\l ID_osi_45_OSI}{\fldrslt Appendix A}} . \hyphpar0\par\pard\sb100\li960\sl220\qj UDP packets are sent between Named systems (see {\field{\*\fldinst HYPERLINK \\l ID_nbf_45_addressing}{\fldrslt the section called \i Addressing - NetBIOS names}} above) or are broadcast from one Named system to all Names on the network. \hyphpar0\par\pard\sb100\li960\sl220\qj The original User Datagram Protocol is described in {\field{\*\fldinst HYPERLINK \\l ID_nbibmpc_45_NetBIOS_45_IBM_45_PC_45_Network}{\fldrslt Appendix B}} in the section {\field{\*\fldinst HYPERLINK \\l ID_nbibmpc_45_UDPIBMPC}{\fldrslt the section called \i Datagram Packet in IBM PC Network\i0 in Appendix B}} . \hyphpar0\par\pard\sb200\s3\sl266 {\*\bkmkstart _537}{\*\bkmkend _537}\b\fs24\lang1024\f2 NetBIOS Non-Session Frames on 802.2 networks\keepn\hyphpar0\par\pard\sb121\li1160\sl220\fi-200\qj \tx1160 \b0\fs16\f1 \'95\tab \fs20 The "DATAGRAM" frame (0x08) is used to send a datagram to a name. \hyphpar0\par\pard\sb100\li1160\sl220\qj \lang1033 The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x08 identifying it as an "DATAGRAM" frame. \hyphpar0\par\pard\sb100\li1160\sl220\qj Seven reserved octets are followed by sixteen octets used to identify the destination name of the datagram. The following sixteen octets identify the source name sending the datagram. A variable number of octets contain the data or payload of the datagram. \hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 The "DATAGRAM BROADCAST" frame (0x09) is used to broadcast a datagram to all names on the network. \hyphpar0\par\pard\sb100\li1160\sl220\qj \lang1033 The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x09 identifying it as an "DATAGRAM" frame. \hyphpar0\par\pard\sb100\li1160\sl220\qj Seven reserved octets are followed by a further sixteen octets which are also reserved rather than identifying the destination name as in the case of "DATAGRAM" frames. The following sixteen octets identify the source name sending the datagram. A variable number of octets contain the data or payload of the datagram. \hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Table 2-5. Datagram frames (Octets in order transmitted.)\sa100\keepn\par\trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Data frame\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Data frame\sa60\cell \row \trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Field Name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Length\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 DATAGRAM\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 DATAGRAM BROADCAST\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Length\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x2C \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x2C \sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x00 \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x00 \sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Deliminator\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xFF \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xFF \sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xEF \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xEF \sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \i\fs20\f1 Command\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \i\fs20\f1 0x08\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \i\fs20\f1 0x09\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Data 1 \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Data 2 \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 XMIT Cor \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 RSP Cor \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Destination Name \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 16\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Name of receiver\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source Name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 16\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Name of sender\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Name of sender\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Optional \sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Datagram \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Datagram \sa60\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart _631}{\*\bkmkend _631}\b\fs26\f2 NetBIOS Diagnostic and Monitoring Protocol\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 The NetBIOS Diagnostic and Monitoring Protocol (DMP) provides the facilities to obtain status information about local and remote nodes on the network. This protocol is broadly comparable with the basic functionality provided by the Simple Network Monitoring Protocol (SNMP) within the TCP/IP suite of protocols. \hyphpar0\par\pard\sb100\li960\sl220\qj The NetBIOS Diagnostic and Monitoring Protocol (DMP) provides the facilities to obtain information including: \hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 Number of "Frame Reject" (FRMR) frames received. \hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 Number of "Frame Reject" (FRMR) frames transmitted. \hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 Number of I-format "Logical link control Protocol Data Units" (LPDUs) received in error. \hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 Number of aborted transmissions. \hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 Etc. \hyphpar0\par\pard\sb100\li960\sl220\qj \lang1033 It is worth noting that this facility is part of the protocol and not an advantage of a given Operating System that happens to be using the protocol.\hyphpar0\par\pard\sb200\s3\sl266 {\*\bkmkstart ID_nbf_45_DMP802}{\*\bkmkend ID_nbf_45_DMP802}\b\fs24\lang1024\f2 NetBIOS Diagnostic and Monitoring frames on 802.2 networks\keepn\hyphpar0\par\pard\sb121\li1160\sl220\fi-200\qj \tx1160 \b0\fs16\f1 \'95\tab \fs20 The "STATUS QUERY" frame (0x03) is used to request remote adapter status information. \hyphpar0\par\pard\sb100\li1160\sl220\qj \lang1033 The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x03 identifying it as an "STATUS QUERY" frame. \hyphpar0\par\pard\sb100\li1160\sl220\qj The "DATA1" octet is used to indicate the status of the request, 0x0 indicates a 1.x or 2.0 type request, 0x01 indicates a NetBIOS 2.1 request and values greater than 1 indicate a NetBIOS 2.1 request. The two bytes of the "DATA2" field are used to indicate the length of the user's status buffer. The "DATA2" field is transmitted byte reversed. Two reserved octets are followed by a two octet response correlator, transmitted byte reversed. Sixteen octets identifying the name of the receiver are followed by a further sixteen octets indicating the sending node's NAME NUMBER 1. \hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 The "STATUS RESPONSE" frame (0x0F) is used in response to request a status request frame. \hyphpar0\par\pard\sb100\li1160\sl220\qj \lang1033 The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x0F identifying it as an "STATUS RESPONSE" frame. \hyphpar0\par\pard\sb100\li1160\sl220\qj The "DATA1" octet is used to indicate the status of the response, 0x0 indicates a 1.x or 2.0 type response, and values greater than 0x0 indicate a NetBIOS 2.1 response. The two octets of the "DATA2" field are regarded as a 16 bit string; the first bit x is set to 1 if the length of the status data exceeds the frame size; the second bit y is set to 1 if the length exceeds the size of the user's buffer; the remaining 14 bits indicate the length of the status data sent. The "DATA2" field is transmitted byte reversed. A two octet transmit correlator, transmitted byte reversed, is followed by two reserved octets. Sixteen octets indicate the receiving node's NAME NUMBER 1 and are followed by a further sixteen octets indicating the sending node's name. \hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 The "TERMINATE TRACE" frame (0x07) is used to end a trace at a remote node. \hyphpar0\par\pard\sb100\li1160\sl220\qj \lang1033 The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x07 identifying it as an "TERMINATE TRACE" frame. \hyphpar0\par\pard\sb100\li1160\sl220\qj All the remaining 39 octets are reserved. \hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 The "TERMINATE TRACE" frame (0x13) is used to end a local trace and a trace at a remote node. \hyphpar0\par\pard\sb100\li1160\sl220\qj \lang1033 The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x13 identifying it as an "TERMINATE TRACE" frame. \hyphpar0\par\pard\sb100\li1160\sl220\qj All the remaining 39 octets are reserved. \hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Table 2-6. Diagnostic and Monitoring frames (Octets in order transmitted.)\sa100\keepn\par\trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Special frame\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Special frame\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Special frame\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Special frame\sa60\cell \row \trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Field Name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Length\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 STATUS QUERY\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 STATUS RESPONSE\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 TERMINATE TRACE\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Terminate local & remote trace\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Length\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x2C \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x2C \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x2C \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x2C\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x00 \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x00 \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x00 \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x00\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Deliminator\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xFF \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xFF \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xFF \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xFF \sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xEF \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xEF \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xEF \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xEF \sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \i\fs20\f1 Command\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \i\fs20\f1 0x03\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \i\fs20\f1 0x0F\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \i\fs20\f1 0x07\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \i\fs20\f1 0x13\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Data 1 \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nn\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nn\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Data 2 \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Length of status buf\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 bbbbbbbb\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Length of status buf\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 xybbbbbb\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 XMIT Cor \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nnnn\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nnnn\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 RSP Cor \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nnnn \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nnnn \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Destination Name \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 16\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Name of receiver\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Receiver's NAME NUMBER 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source Name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 16\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Sending node NAME NUMBER 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Name of sender\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart _778}{\*\bkmkend _778}\b\fs26\f2 NetBIOS Session Management Protocol\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 The NetBIOS Session Management Protocol (SMP) manages sessions between Named processes on the network. NetBIOS Sessions support full duplex operation. One Named process calls another Name on the network which answers. The Session continues until one or both systems hang up. \hyphpar0\par\pard\sb100\li960\sl220\qj The original NetBIOS Session Management Protocol is described in {\field{\*\fldinst HYPERLINK \\l ID_nbibmpc_45_NetBIOS_45_IBM_45_PC_45_Network}{\fldrslt Appendix B}} Appendix: NetBIOS protocols in IBM PC Network in {\field{\*\fldinst HYPERLINK \\l ID_nbibmpc_45_SMPIBMPC}{\fldrslt the section called \i NetBIOS Session Management Protocol in IBM PC Networks\i0 in Appendix B}} NetBIOS Session Management Protocol in IBM PC Networks. \hyphpar0\par\pard\sb200\s3\sl266 {\*\bkmkstart ID_nbf_45_SMP802Query}{\*\bkmkend ID_nbf_45_SMP802Query}\b\fs24\lang1024\f2 NetBIOS Session Frames - Name Query - on 802.2 networks\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 In the NetBIOS Frames Protocol on 802.2 networks there are two frames used for managing names in session establishment. Details of these frames are given in {\field{\*\fldinst HYPERLINK \\l ID_nmp_45_NMP}{\fldrslt the section called \i Name Management Protocol}} "Name Management Frames in NetBIOS on 802.2 networks" \hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Table 2-7. Frames for managing names in session establishment (Octets in order transmitted.)\sa100\keepn\par\trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Management frame\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Management frame\sa60\cell \row \trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Field Name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Length\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 NAME QUERY\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 NAME RECOGNISED\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Length\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x2C\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x2C\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x00\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x00\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Deliminator\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xFF \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xFF \sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xEF \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xEF \sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \i\fs20\f1 Command\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \i\fs20\f1 0x0A\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \i\fs20\f1 0x0E\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Data 1 \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Data 2 \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 X ss \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 X ss \sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 X tt \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 X tt \sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 XMIT Cor \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nn \sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nn \sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 RSP Cor \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nn \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nn \sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nn \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nn \sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Destination Name \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 16\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Name of receiver \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Name of receiver \sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source Name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 16\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Name of sender\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Name of sender\sa60\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\s3\sl266 {\*\bkmkstart ID_nbf_45_SMP802ET}{\*\bkmkend ID_nbf_45_SMP802ET}\b\f2 NetBIOS Session Frames - Establishment and Termination - on 802.2 networks\keepn\hyphpar0\par\pard\sb121\li1160\sl220\fi-200\qj \tx1160 \b0\fs16\f1 \'95\tab \fs20 The "SESSION ALIVE" frame (0x1F) is send as the result of an inactivity timer expiring. \hyphpar0\par\pard\sb100\li1160\sl220\qj \lang1033 The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x1F identifying it as an "SESSION ALIVE" frame. \hyphpar0\par\pard\sb100\li1160\sl220\qj All the remaining 39 octets are reserved. \hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 The "SESSION CONFIRM" frame (0x17) is used to request remote adapter status information. \hyphpar0\par\pard\sb100\li1160\sl220\qj \lang1033 The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. these fields are followed by the one octet command frame which has a value of 0x17 identifying it as an "SESSION CONFIRM" frame. \hyphpar0\par\pard\sb100\li1160\sl220\qj The "DATA1" octet is an 8 bit binary string; the first bit "y" is set to 0 for versions of NetBIOS prior to version 2.20 and to 1 for higher versions. After 6 bits always set to 0, the last bit "x" is set to 0 for NetBIOS version 1.xx and set to 1 for version 2.00 or above (In practice this will now always be set to 1). The two bytes of the "DATA2" field are used to indicate the length of the user's receive buffer. The "DATA2" field is transmitted byte reversed. \hyphpar0\par\pard\sb100\li1160\sl220\qj Two octets used for a transmission correlator are followed by a two octet response correlator; these fields are transmitted byte reversed. A single octet is used for the remote session number and is followed by an octet for the local session number. \hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 The "SESSION END" frame (0x18) is used to request remote adapter status information. \hyphpar0\par\pard\sb100\li1160\sl220\qj \lang1033 The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x18 identifying it as an "SESSION END" frame. \hyphpar0\par\pard\sb100\li1160\sl220\qj The "DATA1" octet is reserved. The two bytes of the "DATA2" field are used to indicate the reason for termination. 0x00 indicates a normal session end, 0x01 indicates an abnormal end. The "DATA2" field is transmitted byte reversed. Four reserved octets are followed by a single octet used for the remote session number. The final octet is for the local session number. \hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 The "SESSION INITIALIZE" frame (0x19) is used to request remote adapter status information. \hyphpar0\par\pard\sb100\li1160\sl220\qj \lang1033 The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x19 identifying it as an "SESSION INITIALIZE" frame. \hyphpar0\par\pard\sb100\li1160\sl220\qj The "DATA1" octet is an 8 bit binary string; the first bit "z" is set to 0 for versions of NetBIOS prior to version 2.20 and to 1 for higher versions (In practice this will now always be set to 1). Three reserved bits "rrr", always set to 0 are followed by 3 bits "xxx" used to indicate the largest frame value as seen by the MAC layer; the last bit "z" is set to 0 for NetBIOS version 1.xx and set to 1 for version 2.00 or above. The two octets of the "DATA2" field are used to indicate the length of the user's receive buffer. The "DATA2" field is transmitted byte reversed. A single octet is used for the remote session number and is followed by an octet for the local session number. \hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Table 2-8. Session Establishment and Termination frames (Octets in order transmitted.)\sa100\keepn\par\trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Session frame\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Session frame\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Session frame\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Session frame\sa60\cell \row \trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Field Name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Length\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 SESSION ALIVE\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 SESSION CONFIRM\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Session End\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 SESSION INITIALIZE\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Length\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x0E \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x0E \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x0E \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x0E \sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x00 \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x00 \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x00 \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x00 \sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Deliminator\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xFF \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xFF \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xFF \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xFF \sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xEF \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xEF \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xEF \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xEF \sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \i\fs20\f1 Command\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \i\fs20\f1 0x1F\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \i\fs20\f1 0x17\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \i\fs20\f1 0x18\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \i\fs20\f1 0x19\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Data1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 B yrrrrrrx\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 zrrrxxxy\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Data2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Max data rec size\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Termination indicator\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Max data receive size\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Max data rec size\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Termination indicator\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Max data receive size\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 XMIT Cor \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nnnn\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nnnn\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nnnn\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nnnn\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 RSP Cor \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nnnn Sess init xmit\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nnnn\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Remote session num\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Remote session num\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Remote session num\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Destination Num\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Remote session num\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Remote session num\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Remote session num\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2200\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7160\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source Num\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Local session num\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Local session num\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Local session num\sa60\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\s3\sl266 {\*\bkmkstart ID_nbf_45_SMP802DT}{\*\bkmkend ID_nbf_45_SMP802DT}\b\f2 NetBIOS Session Frames - Data Transfer - on 802.2 networks\keepn\hyphpar0\par\pard\sb121\li1160\sl220\fi-200\qj \tx1160 \b0\fs16\f1 \'95\tab \fs20 The "DATA ACK" frame (0x14) is sent in response to a DATA ONLY LAST frame (see below). \hyphpar0\par\pard\sb100\li1160\sl220\qj \lang1033 The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x14 identifying it as an "DATA ACK" frame. \hyphpar0\par\pard\sb100\li1160\sl220\qj Three reserved octets are followed by a two octet transmit correlator then a two octet receive correlator; these fields are transmitted byte reversed. A single octet is used for the remote session number and is followed by an octet for the local session number. \hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 The "DATA FIRST MIDDLE" frame (0x15) is used to transmit user messages across a session. \hyphpar0\par\pard\sb100\li1160\sl220\qj \lang1033 The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x15 identifying it as an "DATA FIRST MIDDLE" frame. \hyphpar0\par\pard\sb100\li1160\sl220\qj The "DATA1" octet is an 8 bit binary string; the first four bits are reserved; the fifth bit "x" is set to 1 if an acknowledgment is included; this is followed by a reserved bit; the seventh bit "y" is set to 0 for versions of NetBIOS prior to version 2.20 and set to 1 for later versions (In practice this will now always be set to 1); the last bit "z" is set to 0 if a RECEIVE CONTINUE was not requested, otherwise it is set to 1. The next two octets are for DATA2 and is a re-synchronization indicator set to 0001 if it is the first DATA FIRST MIDDLE frame. The "DATA2" field is transmitted byte reversed. \hyphpar0\par\pard\sb100\li1160\sl220\qj This is followed by a transmit correlator then a two octet receive correlator. A single octet is used for the remote session number and is followed by an octet for the local session number. Finally the user data follows. \hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 The "DATA ONLY LAST" frame (0x16) is used to transmit user messages across a session and is either the only frame or the last. \hyphpar0\par\pard\sb100\li1160\sl220\qj \lang1033 The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x16 identifying it as an "DATA ONLY LAST" frame. \hyphpar0\par\pard\sb100\li1160\sl220\qj The "DATA1" octet is an 8 bit binary string; the first four bits are reserved; the fifth bit "x" is set to 1 if an acknowledgment is included; this is followed by the sixth "y" bit which indicates that an "acknowledge with data allowed" is permitted; the seventh bit "z" is a "no.ack" indicator and the final bit is reserved. The next two octets are for DATA2 and is a re-synchronization indicator set to 0001 if this frame is send following receipt of a RECEIVE OUTSTANDING. The "DATA2" field is transmitted byte reversed. This is followed by a transmit correlator then a two octet receive correlator; these fields are transmitted byte reversed. A single octet is used for the remote session number and is followed by an octet for the local session number. Finally the user data follows. \hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 The "NO RECEIVE" frame (0x1A) is transmitted in response to a "DATA ONLY LAST" frame or a "DATA FIRST MIDDLE" frame. \hyphpar0\par\pard\sb100\li1160\sl220\qj \lang1033 The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x1A identifying it as an "NO RECEIVE" frame. \hyphpar0\par\pard\sb100\li1160\sl220\qj The "DATA1" octet is an 8 bit binary string; the first six bits are reserved; the seventh bit "x" is set to 0 for versions of NetBIOS prior to 2.20, otherwise it is set to 1 (In practice this will now always be set to 1); the eighth bit is reserved. The next two bytes are for DATA2 and gives the number of data bytes accepted. The "DATA2" field is transmitted byte reversed. Four reserved octets are followed by a single octet used for the remote session number; this is followed by an octet for the local session number. \hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 The "RECEIVE OUTSTANDING" frame (0x1B) is transmitted in response to a "NO RECEIVE" frame. \hyphpar0\par\pard\sb100\li1160\sl220\qj \lang1033 The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x1C identifying it as an "RECEIVE OUTSTANDING" frame. \hyphpar0\par\pard\sb100\li1160\sl220\qj The "DATA1" octet is reserved. The next two octets are for DATA2 and gives the number of data bytes accepted. The "DATA2" field is transmitted byte reversed. Four reserved octets are followed by a single octet used for the remote session number; this is followed by an octet for the local session number. \hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 The "RECEIVE CONTINUE" frame (0x1C) is transmitted in response to a "DATA ONLY LAST" frame which had the RECEIVE CONTINUE bit set. \hyphpar0\par\pard\sb100\li1160\sl220\qj \lang1033 The frame begins with a two byte length field with a value of 0x002C followed by the two byte frame deliminator field 0xEFFF; these fields are transmitted byte reversed. These fields are followed by the one octet command frame which has a value of 0x1C identifying it as an "RECEIVE CONTINUE" frame. \hyphpar0\par\pard\sb100\li1160\sl220\qj Three reserved octets are followed by a two octet transmit correlator, transmitted byte reversed, which is followed by two more reserved octets. A single octet is used for the remote session number and is followed by an octet for the local session number. \hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Table 2-9. Session Data Transfer frames (Octets in order transmitted.)\sa100\keepn\par\trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx1890\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3750\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5610\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7470\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Data frame\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Data frame\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Data frame\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Data frame\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Data frame\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Data frame\sa60\cell \row \trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx1890\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3750\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5610\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7470\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Field Name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Length\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 DATA ACK\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 DATA FIRST MIDDLE\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 DATA ONLY LAST\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 NO RECEIVE\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 RECEIVE OUT-STANDING\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 RECEIVE CONTINUE\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx1890\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3750\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5610\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7470\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Length\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2 \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x0E \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x0E \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x0E \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x0E \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x0E \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x0E \sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx1890\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3750\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5610\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7470\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x00 \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x00 \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x00 \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x00 \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x00 \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x00 \sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx1890\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3750\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5610\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7470\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Deliminator\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xFF \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xFF \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xFF \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xFF \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xFF \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xFF \sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx1890\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3750\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5610\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7470\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xEF \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xEF \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xEF \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xEF \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xEF \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xEF \sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx1890\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3750\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5610\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7470\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \i\fs20\f1 Command\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \i\fs20\f1 0x14\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \i\fs20\f1 0x15\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \i\fs20\f1 0x16\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \i\fs20\f1 0x1A\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \i\fs20\f1 0x1B\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \i\fs20\f1 0x1C\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx1890\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3750\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5610\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7470\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Data1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Brrrxryz\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Brrrxryz\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Brrrrrrxr\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx1890\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3750\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5610\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7470\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Data2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Re-synch indicator\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Re-synch indicator\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Number of data bytes accepted\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Number of data bytes accepted\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx1890\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3750\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5610\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7470\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Re-synch indicator\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Re-synch indicator\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Number of data bytes accepted\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Number of data bytes accepted\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx1890\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3750\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5610\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7470\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 XMIT Cor \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nnnn\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nnnn\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nnnn\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nnnn\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx1890\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3750\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5610\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7470\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nnnn\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nnnn\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nnnn\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nnnn\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx1890\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3750\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5610\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7470\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 RSP Cor \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nnnn\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nnnn\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx1890\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3750\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5610\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7470\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nnnn\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nnnn\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx1890\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3750\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5610\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7470\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Dest Num \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Remote session num\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Remote session num\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Remote session num\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Remote session num\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Remote session num\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Remote session num\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx1890\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3750\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5610\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7470\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source Num\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Local session num\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Local session num\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Local session num\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Local session num\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Local session num\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Local session num\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx1890\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3750\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5610\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx7470\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Optional data\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 USER DATA Message from send\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 USER DATA Message from send\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\sl293 \b\fs26\f2 Notes\keepn\hyphpar0\par\pard\sb133\li1280\sl220\fi-320\qj \tx1280 \b0\fs20\f1 1. \tab http://support.microsoft.com/default.aspx?scid=kb;en-us;Q163409\hyphpar0\par\sect\sectd\plain\pgwsxn12240\pghsxn15840\marglsxn1920\margrsxn1920\margtsxn960\margbsxn1200\headery0\footery0\pgndec\titlepg{\headerf\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}{\footerf\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}{\headerl\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 Chapter 3. Supporting Technology, 802.2, Ethernet and Token Ring}\tab {}\tab {}\par}{\footerl\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 \chpgn }\tab {}\tab {}\par}{\headerr\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 Chapter 3. Supporting Technology, 802.2, Ethernet and Token Ring}\par}{\footerr\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}\pard\sb220\s1\sl322 {\*\bkmkstart _1181}{\*\bkmkend _1181}\b\fs29\f2 Chapter 3. Supporting Technology, 802.2, Ethernet and Token Ring\keepn\hyphpar0\par\pard\sb146\li960\sl220\qj \b0\fs20\lang1033\f1 Although NetBIOS is often encapsulated, it can be implemented "on the wire". This chapter looks at the implementation of NetBIOS on two popular networking technologies, Ethernet and Token Ring as well as the 802.2 Logical Link Control layer used with these technologies. This documentation looks at the technologies in relation to NetBIOS rather than attempting to provide a full description of the protocols; there are many excellent books on 802.2, Ethernet and Token Ring that describe those subjects in detail. \hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart _1184}{\*\bkmkend _1184}\b\fs26\lang1024\f2 IEEE 802.2 Logical Link Control\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 In the OSI Reference Model, the Datalink layer sits above the Physical layer and below the Network layer. When considering IEEE LAN technology the situation is a little more complex. There are a number of LAN systems such as Token Ring and Ethernet and the physical characteristics of these are defined in the Physical Layer of the OSI model. Characteristics such as the frame format for systems such as Token Ring and Ethernet are defined in the Datalink layer in standards such as 802.3, 802.5 etc. A common interface was required between these standards and the protocols in layer 3 and this is implemented in 802.2. A full description of IEEE 802.2 Logical Link Control is beyond the scope of this document; a brief overview is given below. \hyphpar0\par\pard\sb100\li960\sl220\qj IEEE 802.2 Logical Link Control frames often provide the data link layer support for implementations of NetBIOS. This is the case when NetBIOS frames are being carried "on the wire" rather than encapsulated in another protocol. The relationship is illustrated in the {\field{\*\fldinst HYPERLINK \\l ID_osi_45_OSI}{\fldrslt Appendix A}} Open Systems Interconnection (OSI) Reference Model \hyphpar0\par\pard\sb100\li960\sl220\qj 802.2 supports both connection-oriented and connection-less oriented communications. The Logical Link Control offers services to the Network layer through Service Access Points (SAPs). The SAP is used to identify the process at the Network layer. \hyphpar0\par\pard\sb100\li960\sl220\qj IEEE 802.2 frames have the following form: \hyphpar0\par\pard\sb200\li960\sl220\qj \lang1024 DSAP 1 byte \keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab Destination Service Access Point \hyphpar0\par\pard\sb200\li960\sl220\qj SSAP 1 byte \keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab source Service Access Point \hyphpar0\par\pard\sb200\li960\sl220\qj Control 1 or 2 bytes \keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab field length depends on the service \hyphpar0\par\pard\sb200\li960\sl220\qj Information \keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab This variable length field carries any data \hyphpar0\par\pard\sb100\li960\sl220\qj \lang1033 Some examples of DSAP and SSAP values are given below.\hyphpar0\par\pard\sb100\li960\sl220\qj For IPX (the network protocol traditionally used with NetWare networks), DSAP = 0xE0 (224), SSAP = 0xE0 and Control is 1 byte 0x03 which denotes the 802.2 unnumbered format. \hyphpar0\par\pard\sb100\li960\sl220\qj For SNAP (Sub-Network Access Protocol), DSAP = 0xAA (170), SSAP = 0xAA \hyphpar0\par\pard\sb100\li960\sl220\qj \i For NetBIOS, DSAP = 0xF0 (240) , SSAP = 0xF0\i0 \hyphpar0\par\pard\sb100\li960\sl220\qj Some IEEE 802.2 Numbers of interest can be found at \'93The Internet Assigned Numbers Authority\'94 web site, \'93Protocol Numbers and Assignment Services\'94 in \'93IEEE 802 Numbers\'94: \hyphpar0\par\pard\sb100\li960\sl220\qj http://www.iana.org/assignments/ieee-802-numbers\up8\fs12 1\up0\fs20 \hyphpar0\par\pard\sb100\li960\sl220\qj In 1985 IBM implemented NetBIOS over Token Ring and established the way in which NetBIOS frames would map to 802.2 frames. \hyphpar0\par\pard\sb100\li960\sl220\qj When NetBIOS is implemented over Token Ring, the NetBIOS frames are mapped directly on to the 802.2 frames; the NetBIOS frame is contained in the information field of the 802.2 frame: \hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 DSAP 1 byte Destination Service Access Point 0xF0 \hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 SSAP 1 byte source Service Access Point 0xF0 \hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 Control 1 or 2 bytes field length depends on the service \hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 Information: \hyphpar0\par\pard\sb100\li1360\sl220\fi-200\qj \tx1360 \fs14 \'95\tab \fs20 NetBIOS header\hyphpar0\par\pard\sb100\li1360\sl220\fi-200\qj \tx1360 \fs14 \'95\tab \fs20 Optional data\hyphpar0\par\pard\sb100\li1160\sl220\qj \hyphpar0\par\pard\sb100\li960\sl220\qj \lang1033 The above scheme is general to implementations of NetBIOS over 802.2 where other underlying technologies are used such as Ethernet. \hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart _1236}{\*\bkmkend _1236}\b\fs26\lang1024\f2 Token Ring\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 Token Ring is becoming less popular with many organizations moving to Ethernet. Token Ring is discussed here because of it's importance in the history of NetBIOS and understanding of NetBIOS.\hyphpar0\par\pard\sb100\li960\sl220\qj When IBM introduced Token-Ring, an emulator for NetBIOS was produced. The NetBIOS Extended User Interface (NetBEUI) was introduced in 1985. NetBIOS was no longer implemented only on a set of propriety protocols, but also on 802.2 frames. The implementation on Token-Ring was the first implementation over 802.2 and provides a reference model. Detailed information can be found in the IBM manual: IBM LAN Technical Reference, see {\field{\*\fldinst HYPERLINK \\l ID_refs_45_References}{\fldrslt \i Bibliography}} IBM LAN Technical Reference IEEE 802.2 and NetBIOS Application Program Interfaces. \hyphpar0\par\pard\sb100\li960\sl220\qj A full description of Token Ring is beyond the scope of this document; some basic information on Token Ring and its use with NetBIOS is given below. \hyphpar0\par\pard\sb100\li960\sl220\qj There are two kinds of Token Ring frames: Media Access Control (MAC) frames and Non-MAC frames. MAC frames carry Token Ring management information between nodes, Non-MAC frames carry user data. The non-MAC frames contain IEEE 802.2 Logical Link Control frames which in turn can contain NetBIOS frames. \hyphpar0\par\pard\sb200\s3\sl266 {\*\bkmkstart _1243}{\*\bkmkend _1243}\b\fs24\lang1024\f2 Non-MAC Frame Structure\keepn\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\f1 Table 3-1. Non-MAC Token Ring Frame Structure\sa100\keepn\par\trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Token Ring frame\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 802.2 Frame detail\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 NBF frame\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Start Delimiter (SDEL) 1 octet\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 \sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Access Control (AC) 1 octet\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Frame Control (FC) 1 octet\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Destination Address 6 octets\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source Address 6 octets\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 IEEE 802.2 Logical Link Control\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 DSAP 2 octets\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmrg\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SSAP 2 octets\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmrg\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Control 1 or 2 octets\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmrg\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Data 46-1500 octets\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 NetBIOS header\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvmrg\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Optional data\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Frame Check sequence (FCS) 4 octets\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 End Delimiter (EDEL) 1 octet\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 \sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Frame Status (FS) Check sequence 1 octet\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\s3\sl266 {\*\bkmkstart _1286}{\*\bkmkend _1286}\b\f2 Further information\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 Many manuals and documents describe Token-Ring in detail including \hyphpar0\par\pard\sb100\li960\sl220\qj Novell's Guide to NetWare LAN Analysis, see {\field{\*\fldinst HYPERLINK \\l ID_refs_45_References}{\fldrslt \i Bibliography}} \hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart _1291}{\*\bkmkend _1291}\b\fs26\lang1024\f2 Ethernet\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 A full description of Ethernet is beyond the scope of this document; some basic information on Ethernet and its use with NetBIOS is given below. \hyphpar0\par\pard\sb100\li960\sl220\qj Ethernet is widely used today and well documented. Four types of Ethernet frames have been in common use. For convenience the notation used by Novell is used to describe the four Ethernet frame types: \hyphpar0\par\pard\sb200\li960\sl220\qj \lang1024 Ethernet_802.3\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab Known as Ethernet 802.3 raw, this frame type is used in NetWare networks and was the default type in NetWare v2.x and v3.x \hyphpar0\par\pard\sb200\li960\sl220\qj Ethernet_II\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab Known as Ethernet DIX (Developed by Digital Intel Xerox) \hyphpar0\par\pard\sb200\li960\sl220\qj Ethernet_802.2\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab IEEE Ethernet \hyphpar0\par\pard\sb200\li960\sl220\qj Ethernet_SNAP\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab SNAP (Sub-Network Access Protocol) derived from the Ethernet 802.2 structure \hyphpar0\par\pard\sb200\s3\sl266 {\*\bkmkstart _1312}{\*\bkmkend _1312}\b\fs24\f2 Ethernet_802.3\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 Known as Ethernet 802.3 raw, this frame type is used in NetWare networks and was the default type in NetWare v2.x and v3.x Because of the nature of these frames they are unlikely to carry NBF frames, unless encapsulated in IPX. \hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Table 3-2. Ethernet_802.3 Frame Structure\sa100\keepn\par\trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Preamble 7 octets\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Start frame deliminator 1 octet\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Destination Address 6 octets\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source Address 6 octets\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Length 2 octets\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Data 46-1500 octets\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Frame Check sequence 4 octets\sa60\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\s3\sl266 {\*\bkmkstart _1333}{\*\bkmkend _1333}\b\f2 Ethernet_802.2\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 NBF frames are found in Ethernet_802.2 frames more than in other Ethernet frames when NBF is implemented "on the wire" rather than encapsulated. \hyphpar0\par\pard\sb100\li960\sl220\qj Ethernet_802.2 frames are also used with IPX/SPX and FTAM (File Transfer Access and Management) protocol. \hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Table 3-3. Ethernet_802.2 Frame Structure\sa100\keepn\par\trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Ethernet frame\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 802.2 Frame detail\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 NBF frame\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Preamble 7 octets\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 \sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Start frame deliminator 1 octet\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Destination Address 6 octets\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source Address 6 octets\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Length 2 octets\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 IEEE 802.2 Logical Link Control\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 DSAP 2 octets\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmrg\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SSAP 2 octets\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmrg\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Control 1 or 2 octets\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmrg\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Data 46-1500 octets\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 NetBIOS header\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Optional data\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Frame Check sequence 4 octets\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 \sa60\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\s3\sl266 {\*\bkmkstart _1374}{\*\bkmkend _1374}\b\f2 Ethernet_SNAP\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 Ethernet_SNAP frames are used by IPX/SPX, TCP/IP and AppleTalk Phase II. \hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Table 3-4. Ethernet_SNAP Frame Structure\sa100\keepn\par\trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Preamble 7 octets\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Start frame deliminator 1 octet\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Destination Address 6 octets\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source Address 6 octets\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Length 2 octets\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 DSAP 2 octets value AA\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SSAP 2 octets value AA\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Control 1 octets\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Organizational code 3 octets\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Ethernet Type 2 octets\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Data 46-1500 octets\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Frame Check sequence 4 octets\sa60\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\s3\sl266 {\*\bkmkstart _1405}{\*\bkmkend _1405}\b\f2 Ethernet_II\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 Ethernet_II frames are used with IPX/SPX TCP/IP AppleTalk Phase I \hyphpar0\par\pard\sb100\li960\sl220\qj Following the source address, is an Ethernet frame type. Information on Ethernet frame types can be found at: \i http://www.iana.org/assignments/ethernet-numbers \i0 \up8\fs12 2\up0\fs20 and at: \i http://www.cavebear.com/CaveBear/Ethernet/type.html \i0 \up8\fs12 3\up0\fs20 \hyphpar0\par\pard\sb100\li960\sl220\qj For SNA (Systems Network Architecture) communications the value registered for the type is \i 0x80D5\i0 . This value of 0x80D5 is also used for other systems using the IEEE 802.2 API \i including NetBIOS\i0 \hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Table 3-5. Ethernet_II Frame Structure\sa100\keepn\par\trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Preamble 8 octets\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Destination Address 6 octets\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source Address 6 octets\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Ethernet Type 2 octets\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Data 46-1500 octets\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Frame Check sequence 4 octets\sa60\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\s3\sl266 {\*\bkmkstart _1432}{\*\bkmkend _1432}\b\f2 Further information\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 Many manuals and documents describe Ethernet in detail including Novell's Guide to NetWare LAN Analysis, see {\field{\*\fldinst HYPERLINK \\l ID_refs_45_References}{\fldrslt \i Bibliography}} \hyphpar0\par\pard\sb200\sl293 \b\fs26\lang1024\f2 Notes\keepn\hyphpar0\par\pard\sb133\li1280\sl220\fi-320\qj \tx1280 \b0\fs20\f1 1. \tab http://www.iana.org/assignments/ieee-802-numbers\hyphpar0\par\pard\sb100\li1280\sl220\fi-320\qj \tx1280 2. \tab http://www.iana.org/assignments/ethernet-numbers\hyphpar0\par\pard\sb100\li1280\sl220\fi-320\qj \tx1280 3. \tab http://www.cavebear.com/CaveBear/Ethernet/type.html\hyphpar0\par\sect\sectd\plain\pgwsxn12240\pghsxn15840\marglsxn1920\margrsxn1920\margtsxn960\margbsxn1200\headery0\footery0\pgndec\titlepg{\headerf\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}{\footerf\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}{\headerl\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 Chapter 4. Encapsulation in TCP/IP}\tab {}\tab {}\par}{\footerl\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 \chpgn }\tab {}\tab {}\par}{\headerr\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 Chapter 4. Encapsulation in TCP/IP}\par}{\footerr\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}\pard\sb220\s1\sl322 {\*\bkmkstart _1436}{\*\bkmkend _1436}\b\fs29\f2 Chapter 4. Encapsulation in TCP/IP\keepn\hyphpar0\par\pard\sb146\li960\sl220\qj \b0\fs20\lang1033\f1 NetBIOS is often described as a "Session Layer" protocol and a variety of transport systems have been used in different implementations. Particularly because NetBIOS is a non-routable protocol, it has often been implemented using other routable protocols to provide the transport. \hyphpar0\par\pard\sb100\li960\sl220\qj It has traditionally been the NetBIOS API that has been the "standard". In most implementations (certainly NetBIOS over TCP/IP and NetBIOS over IPX), encapsulation has been implemented to ensure that higher level protocols (such as SMB) can run over the encapsulated protocol in the same way as they would run over NetBIOS Frames Protocol, NBF (otherwise known as NetBEUI or NetBIOS). Thus it is important to understand the NetBIOS Frames Protocol, NBF in order to understand the various encapsulation implementations. \hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart _1440}{\*\bkmkend _1440}\b\fs26\lang1024\f2 RFC1001 and RFC1002\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 The suite of protocols known as "TCP/IP" is perhaps the best know protocol suite. Currently most systems use IP version 4; the next generation of IP, IPv6 has not yet widely replaced IP version 4. These protocols are well documented in "Request for Comments" (RFCs) and there are many books available on the subject. \hyphpar0\par\pard\sb100\li960\sl220\qj NetBIOS can be carried over TCP/IP (v4) networks. The relevant RFCs describing NetBIOS on a TCP and UDP foundation are: \hyphpar0\par\pard\sb200\li960\sl220\qj \lang1024 RFC 1001\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab Protocol standard for a NetBIOS service on a TCP/UDP transport: concepts and methods \hyphpar0\par\pard\sb200\li960\sl220\qj RFC 1002\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab Protocol standard for a NetBIOS service on a TCP/UDP transport: detailed specifications \hyphpar0\par\pard\sb100\li960\sl220\qj \lang1033 The protocol standards described in the above RFCs are designed to preserve existing NetBIOS services, utilize existing standards and minimize new developments. The standards proposed also aimed to be robust and efficient while not necessarily requiring central management or many additional facilities to run. \hyphpar0\par\pard\sb100\li960\sl220\qj Within this system NetBIOS names are aligned with the Domain Name Service (DNS). A "NetBIOS Scope" is defined as a population of computers through out which a NetBIOS name is known. Because many non-intersecting NetBIOS Scopes may exist on an internetwork, each NetBIOS scope has a "scope identifier"; this is a string that is in a DNS compatible format. This can be thought of as a pseudo sub-domain containing all the NetBIOS names in a given Scope. \hyphpar0\par\pard\sb100\li960\sl220\qj NetBIOS names are strings of 16 bytes with few restrictions; NetBIOS names can and often do contain characters that are illegal in DNS names such as spaces, underscores and other non-alphanumeric characters. DNS names may only contain alphanumeric characters, hyphens and stops. An encoding scheme is used to represent the 16 byte NetBIOS names as a 32 character string to which a stop and then the scope identifier is appended to form a DNS name. Each name needs to be registered for use with an IP address. \hyphpar0\par\pard\sb100\li960\sl220\qj There are two servers defined which may be implemented with NetBIOS on a TCP/UDP transport: The NetBIOS Name Server (NBNS) and the NetBIOS Datagram Distribution Server (NBDD). \hyphpar0\par\pard\sb100\li960\sl220\qj The NBNS can be configured to work in a variety of ways either acting simply as a bulletin board where systems can register names, or completely managing names and addresses. Several NBNS system can be configured to work together to provide a distributed service. \hyphpar0\par\pard\sb100\li960\sl220\qj Since multicasting and broadcasting are not widely implemented on internets, the NBDD service provides this function. Datagrams to be sent to individual nodes or broadcast, can be sent to the NBDD which will forward the datagram to the target node or nodes. \hyphpar0\par\pard\sb100\li960\sl220\qj Systems implementing NetBIOS on a TCP/UDP transport, other than NBNS and NBDS servers, are known as "End-Nodes". Two distinct types of "End-Node" are defined: Broadcast nodes ("B" nodes) and Point-to-point nodes ("P" nodes). Broadcast nodes ("B" nodes) communicate using a combination of UDP datagrams and TCP connections. "B" nodes can function within a broadcast area which is a single MAC-bridged LAN. Point-to-point nodes communicate exclusively by directed UDP datagrams and TCP sessions. "P" nodes depend upon NBNS servers to register their name to IP address mappings and discover the names of other End-Nodes. \hyphpar0\par\pard\sb100\li960\sl220\qj Two further kinds of End-Node are used with NetBIOS on a TCP/UDP transport: RFC 1001 defines Mixed mode nodes ("M" nodes) as "P" nodes with "B" node characteristics. "M" nodes use NBNS and NBDD servers, but may continue to function if these servers are temporarily unavailable. An "M" node typically performs functions as a "B" node and then as a "P" node if necessary. Hybrid nodes ("H" nodes) are not defined in RFC 1001 and have not been standardized; these are mixed nodes similar to "M" nodes but function broadly in the opposite manner to "M" nodes. "H" nodes function as a "P" node first and then as a "B" node. \hyphpar0\par\pard\sb100\li960\sl220\qj NetBIOS on a TCP/UDP transport provides the standard NetBIOS services: Adapter Status Transactions, NetBIOS Session Service and NetBIOS Datagram Service. \hyphpar0\par\pard\sb100\li960\sl220\qj Details of packet formats are given in RFC 1002. \hyphpar0\par\pard\sb100\li960\sl220\qj The following UDP and TCP port numbers are used with NetBIOS on a TCP/UDP transport: \hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Table 4-1. UDP and TCP port numbers are used with NetBIOS\sa100\keepn\par\trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Service\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 UDP Port\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 TCP Port\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Name Service\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 137\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 137\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Session Service\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 139\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Datagram Service\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 138\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 There are several implementations of NetBIOS on a TCP/UDP transport. A free implementation is "SAMBA" which is available for various Unix platforms and non-Unix platforms. Further information about "SAMBA" can be obtained from the "SAMBA" Web page: \hyphpar0\par\pard\sb100\li960\sl220\qj \i http://www.samba.org \i0 \up8\fs12 1\up0\fs20 \hyphpar0\par\pard\sb100\li960\sl220\qj The product can be obtained from the above web site, which is also a useful source of information. \hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart _1490}{\*\bkmkend _1490}\b\fs26\lang1024\f2 Name Resolution\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 NetBIOS over TCP/IP is probably the most common implementation and is often used in preference to NetBIOS "on the wire" (NetBIOS Frames Protocol otherwise known as NetBEUI or just NetBIOS) or in preference to NetBIOS over IPX/SPX. NetBIOS over TCP/IP is also probably most often used to carry the SMB / CIFS protocol. \hyphpar0\par\pard\sb100\li960\sl220\qj When implementing NetBIOS over TCP/IP, Name resolution i.e. the mechanisms for converting NetBIOS names to IP addresses is critically important. This topic is sufficiently important (and so often the source of many problems) to merit special discussion. \hyphpar0\par\pard\sb100\li960\sl220\qj It is important to note that Name resolution is separate from the Browser service. Name resolution is specific to NetBIOS over TCP/IP; the Browser service runs over SMB which runs over NetBIOS Frames Protocol, NetBIOS over IPX or NetBIOS over TCP/IP. The mapping of NetBIOS names to IP addresses is distinct from the service that makes lists of systems available (for example in "Network Neighborhood" or "My Network Places") which is provided by the Browser service. Of course services such as the Browser service (that runs over SMB) are unlikely to function correctly if the underlying facilities such as Name resolution are not working properly. \hyphpar0\par\pard\sb100\li960\sl220\qj The Name resolution mechanisms discussed here do not necessarily conflict with the mechanisms discussed in the standards RFC 1001 and RFC 1002, but can be seen as alternative implementations with various enhancements. \hyphpar0\par\pard\sb100\li960\sl220\qj In practice it seems that the main implementations of NetBIOS over TCP/IP utilize a local cache for Name resolution; name to IP address mappings that have recently been resolved are held in a local cache for a short time which can reduce the need to access the network to resolve names to IP addresses. \hyphpar0\par\pard\sb200\s3\sl266 {\*\bkmkstart _1497}{\*\bkmkend _1497}\b\fs24\lang1024\f2 LMHOSTS\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 Many implementations of NetBIOS over TCP/IP make use of an LMHOSTS file. The LMHOSTS file is similar to the traditional hosts file; both are simple text files listing IPv4 addresses and host names. The LMHOSTS file consists of several lines each of which may have an IPv4 address followed by white space, a NetBIOS name and possibly additional parameters or comments. Most implementations support the use of the hash # character to indicate comments or additional parameters. While the basic structure described above is fairly universal, the use of additional information is implementation dependent. \hyphpar0\par\pard\sb100\li960\sl220\qj In the SAMBA implementation, a NetBIOS hostname can be followed by a hash # and then two hexadecimal digits specifying the NetBIOS name type. In the Microsoft implementation, special characters can be included by enclosing the name in quotes and entering the hexadecimal code as \\0xnn or \\nn; the sixteenth byte can be specified in this manner but the name must be padded with spaces to ensure it is sixteen bytes long. In the Microsoft implementation several "directives" can be included in the file, beginning with the hash # character. \hyphpar0\par\pard\sb100\li960\sl220\qj Microsoft has produced articles describing their use of LMHOSTS files including: \hyphpar0\par\pard\sb200\li960\sl220\qj \lang1024 Article ID: Q101927\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab "The Lmhosts File for TCP/IP in Windows"\hyphpar0\par\pard\sb200\li960\sl220\qj Article ID: Q102725\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab "LMHOSTS File Information and Predefined Keywords"\hyphpar0\par\pard\sb200\li960\sl220\qj Article ID: Q104576\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab "Embedding Non-printable Characters in LMHOSTS Computer Names"\hyphpar0\par\pard\sb200\li960\sl220\qj Article ID: Q108295\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab "TCP/IP Name Resolution"\hyphpar0\par\pard\sb200\li960\sl220\qj Article ID: Q150800\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab "Domain Browsing with TCP/IP and LMHOSTS Files"\hyphpar0\par\pard\sb200\li960\sl220\qj Article ID: Q180094\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab "How to Write an LMHOSTS File for Domain Validation and Other Name Resolution Issues"\hyphpar0\par\pard\sb200\s3\sl266 {\*\bkmkstart _1527}{\*\bkmkend _1527}\b\fs24\f2 NBNS\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 The NetBIOS Name Service is implemented in SAMBA as nmbd. This service can also support the browsing service (which is a separate service). The nmbd service can also be used as a WINS server or WINS proxy. \hyphpar0\par\pard\sb100\li960\sl220\qj Microsoft has produced an implementation of the NetBIOS Name Service (NBNS) called Windows Internet Name Service (WINS). The use of WINS is described in the Microsoft article: \hyphpar0\par\pard\sb200\li960\sl220\qj \lang1024 Article ID: Q119493\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab "NetBIOS over TCP/IP Name Resolution and WINS"\hyphpar0\par\pard\sb200\s3\sl266 {\*\bkmkstart _1536}{\*\bkmkend _1536}\b\fs24\f2 Hosts and DNS\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 Within Microsoft networks, NetBIOS Name resolution can also make use of the traditional hosts file and the Domain Name System (DNS). For this mechanism to work NetBIOS names need to be the same as the unqualified TPC/IP host name. The implication of this is that the NetBIOS names will also conform to the constraints of the DNS name space (i.e. names can only consist of letters, digits and the dash / hyphen character - and can not contain other special characters otherwise allowed in NetBIOS names such as the underscore character _ ). Microsoft describe the use of a hosts file and the DNS in the article: \hyphpar0\par\pard\sb200\li960\sl220\qj \lang1024 Article ID: Q142309\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab "NetBIOS Name Resolution Using DNS and the HOSTS File"\hyphpar0\par\pard\sb200\s3\sl266 {\*\bkmkstart _1544}{\*\bkmkend _1544}\b\fs24\f2 Client Resolution\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 Systems can use a combination of the above services to resolve NetBIOS names to IP addresses for example sequentially searching cache, lmhosts file, nbns service, hosts files and the DNS. \hyphpar0\par\pard\sb200\s3\sl266 {\*\bkmkstart _1547}{\*\bkmkend _1547}\b\fs24\lang1024\f2 Name management\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 The management of names can be a complex issue. To avoid problems it is important that multiple systems do not attempt to update the same name registration service. \hyphpar0\par\pard\sb100\li960\sl220\qj In Microsoft NT 4.0 networks a typical arrangement will be as follows: \hyphpar0\par\pard\sb100\li1520\sl220\fi-560\qj \tqr\tx1470\tx1520\tab \lang1024 1.\tab A DHCP server will allocate IP addresses to client systems when they boot. \hyphpar0\par\pard\sb100\li1520\sl220\fi-560\qj \tqr\tx1470\tx1520\tab 2.\tab Client systems are allocated NetBIOS names at installation time. The names conforms to the DNS rules for names and are the same as the unqualified DNS name. At boot time the client registers it's NetBIOS name and DHCP assigned address with a NBNS server (often a WINS server). \hyphpar0\par\pard\sb100\li1520\sl220\fi-560\qj \tqr\tx1470\tx1520\tab 3.\tab The Microsoft DNS server is configured to resolve host names by taking the unqualified DNS name and passing the enquiry to the WINS server. \hyphpar0\par\pard\sb100\li960\sl220\qj \lang1033 Other implementations make use of Dynamic DNS (DDNS) with either a DHCP server or the clients themselves updating the DNS server. In this arrangement provided the NetBIOS names conform to the DNS rules for names and are the same as the unqualified DNS name, the need for a NBNS server (WINS) can be removed. \hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart _1559}{\*\bkmkend _1559}\b\fs26\lang1024\f2 CIFS over TCP/IP\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 The latest versions of CIFS can run "natively" over TCP/IP without requiring the "NetBIOS over TCP/IP" layer. In this implementation the NetBIOS layer is removed completely.\hyphpar0\par\pard\sb100\li960\sl220\qj With the introduction of Windows 2000 and Active Directory, the latest version of CIFS can use traditional fully qualified DNS names to represent nodes on the network.\hyphpar0\par\pard\sb200\sl293 \b\fs26\lang1024\f2 Notes\keepn\hyphpar0\par\pard\sb133\li1280\sl220\fi-320\qj \tx1280 \b0\fs20\f1 1. \tab http://www.samba.org\hyphpar0\par\sect\sectd\plain\pgwsxn12240\pghsxn15840\marglsxn1920\margrsxn1920\margtsxn960\margbsxn1200\headery0\footery0\pgndec\titlepg{\headerf\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}{\footerf\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}{\headerl\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 Chapter 5. Encapsulation in various protocols and encapsulating}\tab {}\tab {}\par}{\footerl\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 \chpgn }\tab {}\tab {}\par}{\headerr\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 Chapter 5. Encapsulation in various protocols and encapsulating}\par}{\footerr\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}\pard\sb220\s1\sl322 {\*\bkmkstart ID_encap_45_encap}{\*\bkmkend ID_encap_45_encap}\b\fs29\f2 Chapter 5. Encapsulation in various protocols and encapsulating\keepn\hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart _1565}{\*\bkmkend _1565}\fs26 Introduction\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 NetBIOS is often described as a "Session Layer" protocol and a variety of transport systems have been used in different implementations. Particularly because NetBIOS is a non-routable protocol, it has often been implemented using other routable protocols to provide the transport. \hyphpar0\par\pard\sb100\li960\sl220\qj It has traditionally been the NetBIOS API that has been the "standard". In most implementations (certainly NetBIOS over TCP/IP and NetBIOS over IPX), encapsulation has been implemented to ensure that higher level protocols (such as SMB) can run over the encapsulated protocol in the same way as they would run over NetBIOS Frames Protocol, NBF (otherwise known as NetBEUI or NetBIOS). Thus it is important to understand the NetBIOS Frames Protocol, NBF in order to understand the various encapsulation implementations. \hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart _1569}{\*\bkmkend _1569}\b\fs26\lang1024\f2 IPX/SPX\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 IPX/SPX are the protocols native to Novell NetWare. Details of these protocols can be found in: Novell's Guide to NetWare LAN Analysis, see {\field{\*\fldinst HYPERLINK \\l ID_refs_45_References}{\fldrslt \i Bibliography}} \hyphpar0\par\pard\sb100\li960\sl220\qj Novell introduced an implementation of NetBIOS over IPX in 1986. The implementation uses IPX datagrams to carry the NetBIOS Frames protocol described above. \hyphpar0\par\pard\sb100\li960\sl220\qj The IPX addressing scheme is compared with the native NetBIOS and other schemes in {\field{\*\fldinst HYPERLINK \\l ID_nbf_45_addressing}{\fldrslt the section called \i Addressing - NetBIOS names\i0 in Chapter 2}} above. In IPX/SPX networks, a 48 bit address (usually a MAC address) identifies a node on a network and a 32 bit address identifies each network. Thus IPX is a routable protocol requiring relatively little administration, which makes it a useful means of implementing NetBIOS. \hyphpar0\par\pard\sb100\li960\sl220\qj IPX packets are broadly analogous to IP packets in the TCP/IP suite of protocols; IPX packets provide an unreliable datagram delivery service. The structure of the IPX Header is given below for reference: \hyphpar0\par\pard\sb100\li960\sl220\qj The IPX Header \hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 Checksum (2 bytes)\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 Length (2 bytes)\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 Transport Control (1 byte)\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 Packet Type (1 byte) 0 or 4 for IPX, 5 for SPX, 17 (0x11) for NCP, 20 (0x14) WAN broadcast\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 Destination Node Address (6 bytes)\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 Destination Network Address (4 bytes)\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 Destination Socket (2 bytes)\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 Source Node Address (6 bytes)\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 Source Network Address (4 bytes)\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 source Socket ( 2 bytes)\hyphpar0\par\pard\sb100\li960\sl220\qj \lang1033 The Destination Socket indicates the service being carried over IPX, some examples and the identifier for NetBIOS are given below: \hyphpar0\par\pard\sb200\li960\sl220\qj \lang1024 0x451\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab NetWare Core Protocol (NCP)\hyphpar0\par\pard\sb200\li960\sl220\qj 0x452\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab Service Advertising Protocol packet (SAP)\hyphpar0\par\pard\sb200\li960\sl220\qj 0x453\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab Routing Information Protocol packet (RIP)\hyphpar0\par\pard\sb200\li960\sl220\qj \i 0x455\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0 \~\tab \i NetBIOS packet\hyphpar0\par\pard\sb200\li960\sl220\qj \i0 0x456\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab Diagnostic packet\hyphpar0\par\pard\sb200\li960\sl220\qj 0x457\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab Serialization packet\hyphpar0\par\pard\sb200\li960\sl220\qj 0x4000 to 0x8000\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab Dynamically assigned for use with file servers etc.\hyphpar0\par\pard\sb200\s3\sl266 {\*\bkmkstart _1631}{\*\bkmkend _1631}\b\fs24\f2 Microsoft Implementation of NetBIOS over IPX\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 Microsoft have implemented NetBIOS over the NWLink IPX/SPX compatible transport. (NWLink is a clone of Novell's IPX/SPX). The Microsoft implementation is compatible with Novell's NetBIOS over IPX. Microsoft sometimes refers to NetBIOS over IPX as NBIPX. \hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Table 5-1. IPX packets (Octets in order transmitted.)\sa100\keepn\par\trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Length\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 IPX Field\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 NBIPX\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalc\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Checksum\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 \~\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Length\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Transport Control\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Packet Type 0 or 4 for IPX, 20 (0x14) WAN broadcast\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 6\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Destination Node Address\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 4\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Destination Network Address\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Destination Socket\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 6\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source Node Address\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 4\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source Network Address\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 source Socket\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 n\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Data\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 NBIXP packet\sa60\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\li960\sl220\qj \b\fs20\f1 Table 5-2. NBIPX session packets (Octets in order transmitted.)\sa100\keepn\par\trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Length\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Field\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 NBIPX Connection Control flag\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Data Stream type\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source connection id\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Destination connection id\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Send Sequence number\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Total data length\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Offset\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Data length\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Receive Sequence number\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Bytes received\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 n\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Data\sa60\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart ID_OSI}{\*\bkmkend ID_OSI}\b\fs26\f2 NetBIOS Interface and Name Service Support by Lower Layer OSI Protocols\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 The MAP/TOP Users Group Technical Report Specification of NetBIOS Interface and Name Service Support by Lower Layer OSI Protocols, Version 1.0, September 27, 1989, is reproduced as an appendix in The Open Group CAE Specification "Protocols for X/Open PC Interworking: SMB, Version 2." \hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart ID_ISO}{\*\bkmkend ID_ISO}\b\fs26\lang1024\f2 International Standards Organization (ISO) Protocol Suite\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 Communications Machinery Corporation has implemented a NetBIOS interface for ISO protocols. "Netbios for ISO Networks", see {\field{\*\fldinst HYPERLINK \\l ID_refs_45_References}{\fldrslt \i Bibliography}} \hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart _1726}{\*\bkmkend _1726}\b\fs26\lang1024\f2 PPP (Point-to-Point Protocol)\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 NetBIOS can be carried over PPP (Point-to-Point Protocol). The relevant RFCs are: \hyphpar0\par\pard\sb200\li960\sl220\qj \lang1024 RFC 2097\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab The PPP NetBIOS Frames Control Protocol (NBFCP)\hyphpar0\par\pard\sb100\li1360\sl220\qj \lang1033 PROPOSED STANDARD\hyphpar0\par\pard\sb200\li960\sl220\qj \lang1024 RFC1661 STD0051\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab The Point-to-Point Protocol (PPP)\hyphpar0\par\pard\sb100\li1360\sl220\qj \lang1033 STANDARD\hyphpar0\par\pard\sb200\li960\sl220\qj \lang1024 RFC 2153\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab PPP Vendor Extensions \hyphpar0\par\pard\sb100\li1360\sl220\qj \lang1033 INFORMATIONAL\hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart _1745}{\*\bkmkend _1745}\b\fs26\lang1024\f2 Encapsulating\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 NetBIOS can be used to encapsulate other protocols by providing a virtual circuit over which other protocols can be transmitted. This is the opposite situation to those described above where other protocols provide the transport for NetBIOS. \hyphpar0\par\pard\sb200\s3\sl266 {\*\bkmkstart _1748}{\*\bkmkend _1748}\b\fs24\lang1024\f2 Transmission of IP Datagrams over NetBIOS Networks\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 A standard method of encapsulating the Internet Protocol (IP) datagrams on NetBIOS networks is described in: \hyphpar0\par\pard\sb200\li960\sl220\qj \lang1024 RFC 1088\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab A Standard for the Transmission of IP Datagrams over NetBIOS Networks\hyphpar0\par\sect\sectd\plain\pgwsxn12240\pghsxn15840\marglsxn1920\margrsxn1920\margtsxn960\margbsxn1200\headery0\footery0\pgndec\titlepg{\headerf\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}{\footerf\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}{\headerl\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 Chapter 6. Server Message Block Protocol}\tab {}\tab {}\par}{\footerl\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 \chpgn }\tab {}\tab {}\par}{\headerr\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 Chapter 6. Server Message Block Protocol}\par}{\footerr\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}\pard\sb220\s1\sl322 {\*\bkmkstart _1756}{\*\bkmkend _1756}\b\fs29\f2 Chapter 6. Server Message Block Protocol\keepn\hyphpar0\par\pard\sb146\li960\sl220\qj \b0\fs20\lang1033\f1 There are very many systems which can use the NetBIOS / NetBEUI interface or make use of the NetBIOS Frames Protocol, but perhaps one of the most important is the Server Message Block Protocol (SMB). The Server Message Block Protocol (SMB), is an application level protocol used by networking systems and operating systems such as Microsoft's Windows for Workgroups, Windows 95 / 98 / ME, LAN Manager, Windows NT, Windows 2000 and IBM's OS/2 and LAN Server, NetWare 6 and the SAMBA implementation and as such deserves special attention. The latest versions of the protocol are now known as the \'93Common Internet File System protocol\'94. \hyphpar0\par\pard\sb100\li960\sl220\qj An implementation of SMB is described in "Protocols for X/Open PC Interworking: SMB, Version 2", see {\field{\*\fldinst HYPERLINK \\l ID_refs_45_References}{\fldrslt \i Bibliography}} \hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart ID_smb_45_history}{\*\bkmkend ID_smb_45_history}\b\fs26\lang1024\f2 History\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 According to the INTERNET-DRAFT document by christopher R Hertel draft-crhertel-smb-url-03.txt titled \'93SMB Filesharing URL Scheme\'94 \hyphpar0\par\pard\sb100\li960\sl220\qj \'93 The Server Message Block protocol (SMB) was created in the 1980's by Dr. Barry Feigenbaum at IBM Corporation. It was later extended by IBM, 3Com, Intel, and Microsoft. \'94 \hyphpar0\par\pard\sb100\li960\sl220\qj In 1987 Microsoft announced the LAN Manager program and in 1988 IBM announced the OS/2 LAN Server, both use versions of the Server Message Block Protocol. Enhancements and changes to the protocol have been made and a history can be found at: http://samba.anu.edu.au/cifs/docs/smb-history.html" History of SMB\up8\fs12 1\up0\fs20 \hyphpar0\par\pard\sb100\li960\sl220\qj <\fs18\f4 mailto:Dan.Shearer@unisa.edu.au\fs20\f1 >\hyphpar0\par\pard\sb100\li960\sl220\qj Some dates in the development of the protocol are given below:\hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Table 6-1. History of SMB and CIFS\sa100\keepn\par\trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Date\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Development\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 29 November 1989\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 \hyphpar0\par\pard\intbl\sb100\li40\ri100\sl220\qj \lang1033 SMB.TXT is the LM 2.0 protocol. Note: In the doc is calls LM 2.0 as LM 1.2 (it's original name before being renamed to LM 2.0). \hyphpar0\par\pard\intbl\sb100\li40\ri100\sl220 \lang1024 \hyphpar0\par\pard\intbl\sb100\li40\ri100\sl220\qj \lang1033 Microsoft Networks SMB FILE SHARING PROTOCOL EXTENSIONS SMB File Sharing Protocol Extensions Version 3.0 Document Version 1.09\hyphpar0\par\pard\intbl\sb100\li40\ri100\sl220 \lang1024 \sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 October 1992\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Protocols for X/Open PC Interworking: SMB, Version 2\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 26 March 2001\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 The Storage Networking Industry Association (SNIA) produced a work-in-progress document: Common Internet File System (CIFS) Version: CIFS-Spec 0.9 Draft SNIA CIFS Work Group Work-in-Progress \sa60\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 Microsoft and a number of other companies, have proposed an updated version of SMB as an internet standard The Common Internet File System (CIFS). \hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart _1797}{\*\bkmkend _1797}\b\fs26\lang1024\f2 Overview\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 The Server Message Block Protocol (SMB), is an application level protocol see {\field{\*\fldinst HYPERLINK \\l ID_osi_45_OSI}{\fldrslt Appendix A}} \hyphpar0\par\pard\sb100\li960\sl220\qj SMB is used to implement network session control, network file and print sharing and messaging. SMB is used to provide functionality that is broadly analogous to the AppleTalk Session Protocol, AppleTalk Filing Protocol and Printer Access Protocol etc in the AppleTalk suite of protocols. SMB is also broadly analogous with Novell's NetWare Core Protocol (NCP). It is difficult to find a non-proprietary protocol or protocols with in the TCP/IP suite which can be compared to SMB; file sharing via FTP or NFS and network printing via LPR are examples of similar functionality. \hyphpar0\par\pard\sb100\li960\sl220\qj SMB requires a transport /session protocol and the early versions of IBM's implementation were closely linked with NetBIOS. In general SMB runs either over the NetBIOS Frames Protocol (NBF), NetBIOS over TCP/IP, or NetBIOS over IPX; the most recent versions of CIFS can run directly over TCP/IP. \sa200\par\trowd\trleft960 \clvertalt\cellx8394 \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 Server Message Block (SMB) / CIFS\sa60\cell \row \trowd\trleft960 \clvertalt\cellx2022\clvertalt\cellx3084\clvertalt\cellx4146\clvertalt\cellx5208\clvertalt\cellx6270\clvertalt\cellx7332\clvertalt\cellx8394 \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 /\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 /\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 \\\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 \\\sa60\cell \row \trowd\trleft960 \clvertalt\cellx2022\clvertalt\cellx3084\clvertalt\cellx4146\clvertalt\cellx5208\clvertalt\cellx6270\clvertalt\cellx7332\clvertalt\cellx8394 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 NetBIOS Frames Protocol (NBF) i.e. NetBEUI i.e. NetBIOS\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 or\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 NetBIOS over TCP/IP RFC 1001 RFC 1002\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 or\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 NetBIOS over IPX\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 or\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 directly over TCP/IP\sa60\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 See {\field{\*\fldinst HYPERLINK \\l ID_osi_45_OSI}{\fldrslt Appendix A}} for details of the relationship between the various protocols. \hyphpar0\par\pard\sb100\li960\sl220\qj SMB has inherited some of the advantages and disadvantages of NetBIOS, in particular, prior to the latest versions of CIFS it was directly linked with the NetBIOS addressing scheme. \hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart _1835}{\*\bkmkend _1835}\b\fs26\lang1024\f2 Addressing\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 Prior to the latest versions of CIFS, SMB uses network names which are strings of 16 bytes. In general these names are mapped directly on to NetBIOS names (see {\field{\*\fldinst HYPERLINK \\l ID_nbf_45_addressing}{\fldrslt the section called \i Addressing - NetBIOS names\i0 in Chapter 2}} above). The traditional SMB names of systems can be up to 15 characters long and are padded with blanks if necessary. The 16th byte is used to indicate whether the name refers to a server or another function. \hyphpar0\par\pard\sb100\li960\sl220\qj In Microsoft networks with NT 3.x and NT 4.0 systems some names are used with NT 3.x and NT 4.0 Domains as well as for computer names. Some examples of names and use of the 16th byte are given below: \hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Table 6-2. SMB Names\sa100\keepn\par\trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 SMB Name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Purpose\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Computername[0x00]\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Workstation service\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Computername[0x20]\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Server service\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Domainname[0x00]\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Register computer in domain\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Domainname[0x1C]\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Domain controller\sa60\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 Unique NetBIOS names will map to SMB individual system names, and NetBIOS group names will map to workgroup or domain names. \hyphpar0\par\pard\sb100\li960\sl220\qj Like NetBIOS names, traditional SMB names are non hierarchical and constitute a flat non-routable name space which does not scale well. \hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart _1862}{\*\bkmkend _1862}\b\fs26\lang1024\f2 SMB on NBF\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 The most recent version of CIFS can run directly over TCP/IP; however many implementations of SMB are designed to run over NBF frames. SMB is designed to use NBF frames as a transport. Whether NBF frames are used natively "on the wire" or encapsulated in TCP/IP, IPX or another protocol should be transparent to SMB. \hyphpar0\par\pard\sb200\s3\sl266 {\*\bkmkstart _1865}{\*\bkmkend _1865}\b\fs24\lang1024\f2 SMB on NBF datagram frames\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 SMB uses both NBF datagram and session frames. As explained in the discussion of NBF the datagram frames are used exclusively to provide a datagram service and not a transport for higher level protocols; within this context NBF datagram frames are generally used with SMB frames that are concerned with address management. \hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Table 6-3. Datagram frames (Octets in order transmitted.)\sa100\keepn\par\trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Data frame\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Data frame\sa60\cell \row \trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Field Name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Length\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 DATAGRAM\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 SMB\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Length\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x2C \sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x00 \sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Deliminator\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xFF \sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xEF \sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Command\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x08\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Data 1 \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Data 2 \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 XMIT Cor \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 RSP Cor \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Destination Name \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 16\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Name of receiver\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source Name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 16\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Name of sender\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Optional \sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Datagram \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMB frame \sa60\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\li960\sl220\qj \b\fs20\f1 Table 6-4. Datagram frames (Octets in order transmitted.)\sa100\keepn\par\trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Data frame\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Data frame\sa60\cell \row \trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Field Name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Length\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 DATAGRAM BROADCAST\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 SMB\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Length\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x2C \sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x00 \sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Deliminator\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xFF \sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xEF \sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Command\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x09\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Data 1 \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Data 2 \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 XMIT Cor \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 RSP Cor \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Destination Name \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 16\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved \sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source Name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 16\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Name of sender\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Optional \sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Datagram \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMB frame \sa60\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\s3\sl266 {\*\bkmkstart _2000}{\*\bkmkend _2000}\b\f2 SMB on NBF session frames\keepn\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\f1 Table 6-5. Session Data Transfer frames (Octets in order transmitted.)\sa100\keepn\par\trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Data frame\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Data frame\sa60\cell \row \trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Field Name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Length\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 DATA FIRST MIDDLE\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 SMB\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Length\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2 \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x0E \sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x00 \sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Deliminator\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xFF \sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xEF \sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Command\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x15\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Data1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Brrrxryz\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Data2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Re-synch indicator\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Re-synch indicator\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 XMIT Cor \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nnnn\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nnnn\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 RSP Cor \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nnnn\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nnnn\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Dest Num \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Remote session num\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source Num\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Local session num\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Optional data\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 USER DATA Message from send\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMB frame\sa60\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\li960\sl220\qj \b\fs20\f1 Table 6-6. Session Data Transfer frames (Octets in order transmitted.)\sa100\keepn\par\trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Data frame\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Data frame\sa60\cell \row \trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Field Name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Length\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 DATA ONLY LAST\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 SMB\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Length\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2 \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x0E \sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x00 \sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Deliminator\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xFF \sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xEF \sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Command\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x16\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Data1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Brrrxryz\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Data2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Re-synch indicator\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Re-synch indicator\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 XMIT Cor \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nnnn\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nnnn\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 RSP Cor \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nnnn\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 nnnn\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Dest Num \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Remote session num\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source Num\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Local session num\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2820\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6540\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Optional data\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 USER DATA Message from send\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMB frame\sa60\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart _2134}{\*\bkmkend _2134}\b\fs26\f2 SMB frame header\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 Each SMB frame begins with a standard header. Following a deliminator of "0xFF", there are three bytes "0x53", "0x4d" and "0x42" corresponding to the values "S", "M", "B" which makes identifying SMB frames easier. The three ID bytes are followed by a command byte which is discussed in {\field{\*\fldinst HYPERLINK \\l ID_smb_45_SMBCommandCode}{\fldrslt the section called \i SMB Command Codes}} \hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Table 6-7. SMB frames (Octets in order transmitted.)\sa100\keepn\par\trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Field Name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Length\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 SMB\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Deliminator\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xFF\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ID\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 3\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x53 "S"\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvmrg\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x4d "M"\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x42 "B"\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Command\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xNN\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Error class\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xNN\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 reserved\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Error code\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xNN\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xNN\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Flags\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xNN\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Flags 2 / Reserved\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xNN\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xNN\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved? 12?\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 12\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xNN\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvmrg\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xNN\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvmrg\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xNN\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvmrg\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xNN\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvmrg\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xNN\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvmrg\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xNN\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvmrg\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xNN\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvmrg\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xNN\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvmrg\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xNN\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvmrg\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xNN\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvmrg\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xNN\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xNN\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 authenticated resource identifier / Tree ID\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xNN\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xNN\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 caller's Process ID\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xNN\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xNN\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 unathenticated User ID\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xNN\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xNN\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Multiplex ID\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xNN\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xNN\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 count of 16-bit fields Word count\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xNN\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 variable no of 16-bit fields byte count\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xNN\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xNN\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 count of 8-bit fields that follow\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xNN\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xNN\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 variable number of 8-bit fields\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xNN\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xNN\sa60\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 SMB is very analogous to the NetWare Core Protocol (NCF); there are numerous functions available for accomplishing various tasks. There are very many SMB frames for different functions and all share the same header format; the second field, \'93command\'94, determines the function and possibly the format of the rest of the frame following the header. \hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart ID_smb_45_SMBCommandCode}{\*\bkmkend ID_smb_45_SMBCommandCode}\b\fs26\lang1024\f2 SMB Command Codes\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 Below is a table giving some of the Core SMB commands: \hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Table 6-8. Core SMB Commands\sa100\keepn\par\trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Field Name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 smb_com\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Description\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBmkdir\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x00\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Create directory\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBrmdir\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x01\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Delete directory\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBopen\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x02\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Open file\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBcreate\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x03\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Create file\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBclose\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x04\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Close file\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBflush\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x05\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Commit all files\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBunlink\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x06\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Delete file\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBmv\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x07\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Rename file\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBgetatr\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x08\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Get file attribute\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBsetatr\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x09\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Set file attribute\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBread\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x0a\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Read byte block\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBwrite\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x0b\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Write byte block\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBlock\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x0c\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Lock byte block\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBunlock\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x0d\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Unlock byte block\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBmknew\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x0f\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Create new file\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBchkpth\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x10\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Check directory\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBexit\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x11\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 End of process\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBlseek\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x12\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 LSEEK\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBtcon\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x70\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Start connection\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBtdis\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x71\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 End connection\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBnegprot\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x72\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Verify dialect\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBbskattr\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x80\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Get disk attributes\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBsearch\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x81\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Search multiple files\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBsplopen\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xc0\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Create spool file\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBsplwr\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xc1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Spool byte block\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBsplclose\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xc2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Close spool file\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBsplretq\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xc3\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Return print queue\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBsends\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xd0\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Send message\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBsendb\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xd1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Send broadcast\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBfwdname\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xd2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Forward user name\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBcancelf\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xd3\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Cancel forward\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBgetmac\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xd4\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Get machine name\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBsendstrt\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xd5\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Start multi-block message\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBsendend\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xd6\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 End multi-block message\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBsendtxt\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xd7\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Multi-block message text\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Never valid\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xfe\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Invalid\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Implementation-dependent\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xff\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Implementation-dependent\sa60\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 Below is a table giving some of the Core plus commands: \hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Table 6-9. Core plus Commands\sa100\keepn\par\trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Field Name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 smb_com\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Description\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBlockreadr\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x13\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Lock then read data\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBwriteunlock\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x14\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Write then unlock data\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBreadBraw\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x1a\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Read block raw\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBwriteBraw\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x1d\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Write block raw\sa60\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 Below is a table giving some of the LANMAN 1.0 SMB commands: \hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Table 6-10. LANMAN 1.0 SMB Commands\sa100\keepn\par\trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Field Name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 smb_com\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Description\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBreadBmpx\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x1b\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Read block multiplexed\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBreadBs\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x1c\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Read block (secondary response)\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBwriteBmpx\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x1e\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Write block multiplexed\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBwriteBs\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x1f\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Write block (secondary response)\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBwriteC\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x20\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Write complete response\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBsetattrE\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x22\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Set file attributes expanded\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBgetattrE\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x23\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Get file attributes expanded\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBlockingX\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x24\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Lock/unlock byte ranges and X\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBtrans\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x25\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Transaction (name, bytes in/out)\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBtranss\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x26\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Transaction (secondary request/response)\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBioctl\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x27\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Passes the IOCTL to the server\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBioctls\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x28\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 IOCTL (secondary request/response)\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBcopy\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x29\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Copy\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBmove\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x2a\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Move\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBecho\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x2b\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Echo\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBwriteclose\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x2c\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Write and Close\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBopenX\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x2d\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Open and X\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBreadX\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x2e\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Read and X\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBwriteX\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x2f\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Write and X\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBsesssetup\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x73\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Session Set Up and X (including User Logon)\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBtconX\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x75\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Tree connect and X\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBffirst\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x82\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Find first\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBfunique\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x83\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Find unique\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBfclose\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x84\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Find close\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SMBinvalid\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0xfe\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Invalid command\sa60\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart _2573}{\*\bkmkend _2573}\b\fs26\f2 SMB Error Class\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 Below is a table giving some of the SMB Error class values: \hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Table 6-11. SMB Error Class\sa100\keepn\par\trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Field Name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Value\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Description\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 SUCCESS\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x00\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 The request was successful\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ERRSRV\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x02\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Error generated by the LMX server\sa60\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart _2593}{\*\bkmkend _2593}\b\fs26\f2 SMB Return Codes for Error class 0x00\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 Below is a table giving some of the SMB Return Code Values when the Error class is 0x00: \hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Table 6-12. SMB Return Code\sa100\keepn\par\trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Field Name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Value\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Description\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 BUFFERED\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x54\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 The Message was buffered\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 LOGGED\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x55\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 The Message was logged\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 DISPLAYED\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x56\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 The Message was displayed\sa60\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart _2617}{\*\bkmkend _2617}\b\fs26\f2 SMB Return Codes for Error class 0x02\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 Below is a table giving some of the SMB Return Code Values when the Error class is 0x02: \hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Table 6-13. SMB Return Code\sa100\keepn\par\trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Field Name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Value\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Description\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ERRerror\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x01\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Non-specific error code\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ERRbadpw\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x02\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Bad password\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ERRbadtype\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x03\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reserved\sa60\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart _2641}{\*\bkmkend _2641}\b\fs26\f2 SMB Dialects\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 The SMB protocol has been developed and enhanced since it was first introduced. The original version is known as the "core protocol" and is understood by systems implementing later versions which are supersets of the original. Systems using SMB negotiate which version i.e. dialect they will support. \hyphpar0\par\pard\sb100\li960\sl220\qj The function SMBnegprot 0x72 is used at the beginning of a session to establish the dialect to be used. See {\field{\*\fldinst HYPERLINK \\l ID_smb_45_SMBCommandCode}{\fldrslt the section called \i SMB Command Codes}} \hyphpar0\par\pard\sb100\li960\sl220\qj When packets are being sent to negotiate the dialect, a string is used to indicate which dialects are supported. So just as the use of the string "SMB" within SMB packets makes identifying such packets easier, the use of readable strings makes understanding which dialects are used easier. Below is a table giving some of the strings used to identify dialects and the terms commonly used to refer to the given dialect. \hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Table 6-14. SMB dialects\sa100\keepn\par\trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 string identifying dialect\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Reference\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 PC NETWORK PROGRAM 1.0\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 core protocol\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 MICROSOFT NETWORKS 1.03\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 core plus dialect\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 MICROSOFT NETWORKS 3.0\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 extended 1.0 protocol\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 LANMAN1.0\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 extended 1.0 protocol, first version of full LANMAN 1.0 protocol\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Windows for Workgroups 3.1a\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 LM1.2X002\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 extended 2.0 protocol\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 LANMAN2.1\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 NT LM 0.12\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart _2679}{\*\bkmkend _2679}\b\fs26\f2 SAMBA\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 While this documentation is primarily concerned with protocols rather than implementations; there is one implementation that deserves special mention. A project has been established to provide free implementations of the SMB protocol and file and printing sharing facilities for various platforms. More information can be found about the SAMBA project at the web site: www.samba.org\up8\fs12 2\up0\fs20 \hyphpar0\par\pard\sb100\li960\sl220\qj SAMBA is freely available for very many platforms and has thus provided a means for file and print sharing between different platforms and Operating Systems. The SAMBA project has had to "reverse engineer" the protocols and continues to work in this manner in order to keep the software free.\hyphpar0\par\pard\sb100\li960\sl220\qj Despite having released a version of SMB to the X-Open organization, Microsoft continues to develop the protocol as a proprietary protocol and details of some of the more recent versions have not been made freely available.\hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart _2685}{\*\bkmkend _2685}\b\fs26\lang1024\f2 Further information\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 Further information is available on the net: Just what is SMB? V1.0 Richard Sharpe \up8\fs12 3\up0\fs20 \hyphpar0\par\pard\sb200\sl293 \b\fs26\lang1024\f2 Notes\keepn\hyphpar0\par\pard\sb133\li1280\sl220\fi-320\qj \tx1280 \b0\fs20\f1 1. \tab http://samba.anu.edu.au/cifs/docs/smb-history.html\hyphpar0\par\pard\sb100\li1280\sl220\fi-320\qj \tx1280 2. \tab http://www.samba.org\hyphpar0\par\pard\sb100\li1280\sl220\fi-320\qj \tx1280 3. \tab http://samba.anu.edu.au/cifs/docs/what-is-smb.html\hyphpar0\par\sect\sectd\plain\pgwsxn12240\pghsxn15840\marglsxn1920\margrsxn1920\margtsxn960\margbsxn1200\headery0\footery0\pgndec\titlepg{\headerf\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}{\footerf\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}{\headerl\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 Chapter 7. Browser Service}\tab {}\tab {}\par}{\footerl\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 \chpgn }\tab {}\tab {}\par}{\headerr\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 Chapter 7. Browser Service}\par}{\footerr\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}\pard\sb220\s1\sl322 {\*\bkmkstart _2689}{\*\bkmkend _2689}\b\fs29\f2 Chapter 7. Browser Service\keepn\hyphpar0\par\pard\sb146\li960\sl220\qj \b0\fs20\lang1033\f1 Microsoft first implemented the Browser Service as a proprietary protocol. The Browser service makes systems visible in the "Network Neighbourhood" within Windows operating systems such as Windows for Workgroups, Windows 9.x and Windows NT and NT2000. The Browser Service also operates in environments such as LAN Manager, LAN Server and OS/2 networks. The Browser Service has nothing to do with Web browsing or HTTP. The Browser Service registers SMB (NetBIOS) names dynamically and makes this dynamic list available to systems on the network. The Browser Service runs over SMB (and is described as running over a "mail slot" protocol over SMB). SMB runs over either NetBIOS Frames Protocol, NBF, often referred to as NetBEUI, or NetBIOS over TCP/IP, or over NetBIOS over IPX/SPX. Thus the Browser service is independent of the transport used to carry SMB. \hyphpar0\par\pard\sb100\li960\sl220\qj Because the Browser Service is concerned with the registration of SMB (NetBIOS) names and is dynamic, it is sometimes confused with the NetBIOS Name Service (NBNS) that maps NetBIOS names to IP addresses. An example of NBNS is Microsoft WINS. The Browser Service and NBNS are two separate services. \hyphpar0\par\pard\sb100\li960\sl220\qj In very broad terms, the Browser Service can be seen as providing a similar function to the Service Advertising Protocol (SAP) in NetWare environments. Lan Manager servers broadcast their presence over the network and the Browser Service was developed as a solution to the scalability problems of such an arrangement. (Novell developed Novell Directory Services, NDS, to reduce or even replace the need for SAP traffic.) It is important to note that Windows for Workgroups, Windows 9.x systems, Windows NT workstations and NT2000 workstations can share files and thus be servers; in such peer to peer networking environments every system is potentially a server. \hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart _2694}{\*\bkmkend _2694}\b\fs26\lang1024\f2 History\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 With Lan Manager 1.0, servers broadcast their presence over the network and client systems listened for such broadcasts to discover servers. This is not dissimilar to the early Novell NetWare systems where servers advertised themselves over the network by broadcasting Service Advertising Protocol (SAP) packets. \hyphpar0\par\pard\sb100\li960\sl220\qj When Microsoft introduced Windows for Workgroups, each PC could share it's resources acting as a server as well as acting as a client. Thus the number of servers on the network could potentially equal the number of PCs and become very large. The original broadcast system would not scale in such an environment. It was at this point that the first implementation of the browser service was introduced. \hyphpar0\par\pard\sb100\li960\sl220\qj With the introduction of Windows NT, the browser service was expanded to include domains. \hyphpar0\par\pard\sb100\li960\sl220\qj Following the development of the next version of SMB, CIFS, Microsoft published the latest version of the Browser protocol as a draft of an internet draft "CIFS/E Browser Protocol". This draft document specifies version 1.15 of the browsing protocol. \hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart _2700}{\*\bkmkend _2700}\b\fs26\lang1024\f2 Overview\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 Browser Servers maintain lists of Servers and the services they offer. Other systems, known as Browser Clients (which may also be Browser servers) query the Browser Servers for information. When Servers come on line they register themselves with the Browser Servers. The Servers are organized in to logical groups according to which group they belong to; these can be "Workgroups" or Domains" and correspond to SMB / NetBIOS group names. \hyphpar0\par\pard\sb100\li960\sl220\qj Browser Servers, sometimes simply known as Browsers, can occupy a number of rolls, serving the needs of a particular group or sub-net: \hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 Domain Master Browser (is Local Master Browser for the sub-net it is on)\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 Local Master Browser\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 Backup Browser (maintain a copy of the information on the Local Master Browser; they get it by periodically querying the Local Master)\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 Potential Browser (system that can become a Browser)\hyphpar0\par\pard\sb100\li960\sl220\qj \lang1033 If a client system does not get a response from a Local Master Browser it can initiate an election. The Browser systems and Potential Browser systems communicate to decide which machine will become the Browser. \hyphpar0\par\pard\sb100\li960\sl220\qj Client system will contact Browser servers for a list of servers within a group or for lists of groups. Typically clients will keep a list of several Browsers. \hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart _2715}{\*\bkmkend _2715}\b\fs26\lang1024\f2 Packets\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 The Browser service uses "Mailslots" and is perhaps the only protocol that does. The mailslot "frames" are carried in SMB "transact" packets. The opcode within the Transact SMB packet is Mailslot Write. Within the data portion of the Transact packet is the mailslot frame. The Transact data itself begins with an opcode as shown below: \hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Table 7-1. Transact data opcodes\sa100\keepn\par\trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Opcode\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 description\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 HostAnnouncement\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 AnnouncementRequest\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 8\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 RequestElection\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 9\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 GetBackupListReq\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 10\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 GetBackupListResp\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 11\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 BecomeBackup\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 12\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 DomainAnnouncment\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 13\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 MasterAnnouncement\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 15\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 LocalMasterAnnouncement\sa60\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart _2753}{\*\bkmkend _2753}\b\fs26\f2 Further information\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 Microsoft has published the latest version of the Browser protocol as a draft of an internet draft "CIFS/E Browser Protocol". The document is available as a Microsoft Word document at: ftp://ftp.microsoft.com/developer/drg/cifs/cifsbrow.doc\up8\fs12 1\up0\fs20 \hyphpar0\par\pard\sb100\li960\sl220\qj Some information is also available from the MSDN Library: The section "Windows Resource Kits" contains a section "Windows 95 Resource Kit" which contains "Chapter 11 Logon, Browsing, and Resource Sharing". \hyphpar0\par\pard\sb200\sl293 \b\fs26\lang1024\f2 Notes\keepn\hyphpar0\par\pard\sb133\li1280\sl220\fi-320\qj \tx1280 \b0\fs20\f1 1. \tab ftp://ftp.microsoft.com/developer/drg/cifs/cifsbrow.doc\hyphpar0\par\sect\sectd\plain\pgwsxn12240\pghsxn15840\marglsxn1920\margrsxn1920\margtsxn960\margbsxn1200\headery0\footery0\pgndec\titlepg{\headerf\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}{\footerf\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}{\headerl\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 Chapter 8. CIFS and the future}\tab {}\tab {}\par}{\footerl\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 \chpgn }\tab {}\tab {}\par}{\headerr\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 Chapter 8. CIFS and the future}\par}{\footerr\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}\pard\sb220\s1\sl322 {\*\bkmkstart _2758}{\*\bkmkend _2758}\b\fs29\f2 Chapter 8. CIFS and the future\keepn\hyphpar0\par\pard\sb146\li960\sl220\qj \b0\fs20\lang1033\f1 The SMB protocol has been developed and renamed CIFS. An Internet Draft dated 13 June 1996 was produced by Microsoft that described version 1.0 of CIFS: "Common Internet File System Protocol (CIFS/1.0)" by I. Heizer, P. Leach and D. Perry \hyphpar0\par\pard\sb100\li960\sl220\qj Service Pack 3 for Microsoft's windows NT 4.0 (1996) includes an updated version of the Server Message Block (SMB) authentication protocol, also known as the Common Internet File System (CIFS) file sharing protocol. \hyphpar0\par\pard\sb100\li960\sl220\qj More recent versions of CIFS can run "native" over IP without the "NetBIOS over TCP/IP" layer. The use of CIFS running "native" over IP has been implemented in Microsoft's Windows 2000 operating system and subsequent Microsoft Operating Systems.\hyphpar0\par\sect\sectd\plain\pgwsxn12240\pghsxn15840\marglsxn1920\margrsxn1920\margtsxn960\margbsxn1200\headery0\footery0\pgndec\titlepg{\headerf\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}{\footerf\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}{\headerl\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 Appendix A. Open Systems Interconnection (OSI) Reference Model}\tab {}\tab {}\par}{\footerl\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 \chpgn }\tab {}\tab {}\par}{\headerr\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 Appendix A. Open Systems Interconnection (OSI) Reference Model}\par}{\footerr\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}\pard\sb220\s1\sl322 {\*\bkmkstart ID_osi_45_OSI}{\*\bkmkend ID_osi_45_OSI}\b\fs29\f2 Appendix A. Open Systems Interconnection (OSI) Reference Model\keepn\hyphpar0\par\pard\sb146\li960\sl220\qj \b0\fs20\lang1033\f1 The Open Systems Interconnection (OSI) Reference Model is traditionally used as a general purpose reference for describing protocols and comparing protocols. It is assumed that the reader is familiar with the OSI model; there are of course numerous resources on the WEB that explain the OSI model. \hyphpar0\par\pard\sb100\li960\sl220\qj The diagrams below attempt to show the components of the NetBIOS protocols and higher level protocols such as SMB in relation to the OSI Reference Model. Because the protocols were not developed specifically to comply with the OSI model any mapping is only approximate and intended as a guide. When protocols (such as NetBIOS) are encapsulated within other protocols (such as TCP/IP or IPX) it is particularly difficult to map these to a reference model, thus the diagrams below are intended to help show the relationships between the protocols rather than provide a definitive mapping to the OSI model. \hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart _2767}{\*\bkmkend _2767}\b\fs26\lang1024\f2 NBF on 802.2 networks\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 NetBIOS is often described as a session layer protocol but in the IEEE 802.2 implementation there are no transport or datagram delivery protocols between the session layer and the datalink layer. While there is a datagram protocol, this is used exclusively for datagrams and not as a foundation for higher layer protocols. \hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Table A-1. NBF on 802.2 networks\sa100\keepn\par\trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 7 Application\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 e.g. Browser Service\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 6 Presentation\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 Higher level protocols e.g. SMB / CIFS\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalc\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalc\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 5 Session\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 \~\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 Session Management Protocol\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx5424\clvertalt\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 4 Transport\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 3 Network\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 User Datagram Protocol, Name Management Protocol, NetBIOS Diagnostic and Monitoring Protocol\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2 Datalink\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 IEEE 802.2\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 IEEE 802.3 / IEEE 802.5 etc\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1 Physical\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 Token Ring / Ethernet etc\sa60\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart _2802}{\*\bkmkend _2802}\b\fs26\f2 NetBIOS over TCP/IP\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 NetBIOS over TCP/IP is described in RFC 1001 and RFC 1002. Note that when higher level protocols such as SMB or CIFS are implemented over TCP/IP they are in fact implemented over NetBIOS over TCP/IP. \hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Table A-2. NetBIOS over TCP/IP\sa100\keepn\par\trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2022\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6272\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8397 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 7 Application\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 e.g. Browser Service\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2022\clvertalt\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8397 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 6 Presentation\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 Higher level protocols e.g. SMB / CIFS\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2022\clvertalt\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4147\clvertalt\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6272\clvertalt\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8397 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 5 Session\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 Name Service\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 datagram service\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 Session Service\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2022\clvertalt\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6272\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8397 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 4 Transport\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 UDP\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 TCP\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2022\clvertalt\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8397 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 3 Network \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 IP\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2022\clvertalt\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6272\clvertalt\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8397 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2 Datalink\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 e.g. IEEE 802.2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 e.g. Ethernet II etc\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2022\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6272\clvertalt\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8397 \intbl\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 IEEE 802.3 / IEEE 802.5 etc\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2022\clvertalt\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8397 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1 Physical\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 Token Ring / Ethernet etc\sa60\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart _2843}{\*\bkmkend _2843}\b\fs26\f2 NetBIOS over IPX\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 NetBIOS over IPX uses IPX packets to provide the underlying delivery mechanism for the NetBIOS protocols. \hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Table A-3. NetBIOS over IPX\sa100\keepn\par\trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 7 Application\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 e.g. Browser Service\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 6 Presentation\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 Higher level protocols e.g. SMB / CIFS\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalc\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalc\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 5 Session\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 \~\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 Session Management Protocol\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 4 Transport\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmgf\clvertalc\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 3 Network\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 User Datagram Protocol, Name Management Protocol, NetBIOS Diagnostic and Monitoring Protocol\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 IPX\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2 Datalink\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 e.g. IEEE 802.2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 e.g. Ethernet II etc\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 IEEE 802.3 / IEEE 802.5 etc\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1 Physical\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 Token Ring / Ethernet etc\sa60\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart _2881}{\*\bkmkend _2881}\b\fs26\f2 CIFS over TCP/IP\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 The latest version of CIFS can run directly over TCP/IP. \hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Table A-4. CIFS over TCP/IP\sa100\keepn\par\trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalc\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 7 Application\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 CIFS\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 6 Presentation\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 5 Session\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 4 Transport\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 UDP\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 TCP\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 3 Network\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 IP\sa60\cell \row \trowd\trleft960 \clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalc\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2 Datalink\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 e.g. IEEE 802.2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 e.g. Ethernet II etc\sa60\cell \row \trowd\trleft960 \clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \intbl\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 IEEE 802.3 / IEEE 802.5 etc\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1 Physical\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220\qc \fs20\f1 Token Ring / Ethernet etc\sa60\cell \row \pard\plain\sl-1\hyphpar0\par\sect\sectd\plain\pgwsxn12240\pghsxn15840\marglsxn1920\margrsxn1920\margtsxn960\margbsxn1200\headery0\footery0\pgndec\titlepg{\headerf\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}{\footerf\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}{\headerl\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 Appendix B. NetBIOS protocols in IBM PC Network}\tab {}\tab {}\par}{\footerl\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 \chpgn }\tab {}\tab {}\par}{\headerr\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 Appendix B. NetBIOS protocols in IBM PC Network}\par}{\footerr\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}\pard\sb220\s1\sl322 {\*\bkmkstart ID_nbibmpc_45_NetBIOS_45_IBM_45_PC_45_Network}{\*\bkmkend ID_nbibmpc_45_NetBIOS_45_IBM_45_PC_45_Network}\b\fs29\f2 Appendix B. NetBIOS protocols in IBM PC Network\keepn\hyphpar0\par\pard\sb146\li960\sl220\qj \b0\fs20\lang1033\f1 The NetBIOS interface was developed by Sytec Inc. (which became Hughes LAN Systems, then Whittaker Communications) for International Business Machines Corporation (IBM) in 1983. This operated over proprietary Sytec protocols on IBM's PC Network. \hyphpar0\par\pard\sb100\li960\sl220\qj Information is provided here for reference although these protocols have now been superseded by the NetBIOS Frames protocol running over Token Ring or Ethernet etc. \hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart ID_nbibmpc_45_NMPIBMPC}{\*\bkmkend ID_nbibmpc_45_NMPIBMPC}\b\fs26\lang1024\f2 Name Management Frames in IBM PC Networks\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 In the IBM PC Network name management is performed by the Name Management Protocol which consists of the following packet types: \hyphpar0\par\pard\sb200\li960\sl220\qj Name Claim / Name Cancel Packet\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab A single octet indicates whether the packet is used to claim a name (value 0x10) or release a name (value 0xA0) \hyphpar0\par\pard\sb200\li960\sl220\qj Name Claim Response Packet\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab This packet is used to indicate that the name is already in use. \hyphpar0\par\pard\sb100\li960\sl220\qj \hyphpar0\par\pard\sb100\li960\sl220\qj Details of packet structures for Name Management in IBM PC Networks are given in the {\field{\*\fldinst HYPERLINK \\l ID_nbibmpc_45_CompIBMpc}{\fldrslt the section called \i Comparison of NetBIOS protocols in IBM PC Network}} \hyphpar0\par\pard\sb200\s3\sl266 {\*\bkmkstart _2933}{\*\bkmkend _2933}\b\fs24\lang1024\f2 Name Claim / Name Cancel Packet in IBM PC Network\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 From "Inside NetBIOS": \hyphpar0\par\pard\sb100\li960\sl220\qj Name Claim / Name Cancel Packet: \hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Table B-1. Name Claim / Name Cancel Packet\sa100\keepn\par\trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Field\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Length\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Description\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Start\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Start Deliminator value 0x7E\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Destination\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 6\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Destination Address\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 6\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source Address\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Length\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Length of packet\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value set to 0x5000\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Function\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 10h for Name Claim, 0xA0 for Cancel\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Accept\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Number of packets willing to accept\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Connection id\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Connection id\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value set to 0x0202\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Undefined\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value of two octets undefined\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value set to 0x0400\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Undefined\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 4\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value of four octets undefined\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value of 0x10XX\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 4\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value of 0x0000\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Dest Name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 16\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Destination NetBIOS name\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Dest Node Connection id\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Destination node connection id\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 CRC\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 4\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Cyclic Redundancy Check\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 End of Frame\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 End of frame marker value of 0x7E\sa60\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\s3\sl266 {\*\bkmkstart _3018}{\*\bkmkend _3018}\b\f2 Name Claim Response Packet in IBM PC Network\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 Name Claim Response Packet:\hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Table B-2. Name Claim Response Packet\sa100\keepn\par\trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Field\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Length\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Description\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Start\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Start Deliminator value 0x7E\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Destination\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 6\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Destination Address\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source Address\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Length\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Length of packet\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value set to 0x4000\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value set to 0x30\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Accept\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Number of packets willing to accept\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Connection id\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Connection id\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Undefined\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value of two octets undefined\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reason packet NAK\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reason why packet not acknowledged\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Undefined\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value of octet undefined\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value set to 0x0400\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Undefined\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 4\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value of four octets undefined\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value of 0x10XX\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 4\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value of 0x0000\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Dest Name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 16\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Destination NetBIOS name\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Destination node connection id\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Destination node connection id\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 CRC\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 4\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Cyclic Redundancy Check\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 End of Frame\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 End of frame marker value of 0x7E\sa60\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart ID_nbibmpc_45_UDPIBMPC}{\*\bkmkend ID_nbibmpc_45_UDPIBMPC}\b\fs26\f2 Datagram Packet in IBM PC Network\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 Details of packet structures for User Datagram Protocol in IBM PC Networks are given in the {\field{\*\fldinst HYPERLINK \\l ID_nbibmpc_45_CompIBMpc}{\fldrslt the section called \i Comparison of NetBIOS protocols in IBM PC Network}} \hyphpar0\par\pard\sb200\s3\sl266 {\*\bkmkstart _3110}{\*\bkmkend _3110}\b\fs24\lang1024\f2 User Datagram Protocol Packet in IBM PC Network\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 From "Inside NetBIOS":\hyphpar0\par\pard\sb100\li960\sl220\qj User Datagram Protocol Packet: \hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Table B-3. User Datagram Protocol Packet\sa100\keepn\par\trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Field\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Length\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Description\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Start\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Start Deliminator value 0x7E\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Destination\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 6\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Destination Address\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 6\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source Address\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Length\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Length of packet\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value set to 0x5100\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value set to 0x0100\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value set to 0x0001\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value set to 0x1010\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value set to 0x0000\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source Name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 16\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Source NetBIOS name\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Dest Name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 16\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Destination NetBIOS name\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Data\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 variable\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 data\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Retransmit Count\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Retransmition Count\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source Node Connection id\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source Node Connection id\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Destination id\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 6\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Destination id\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source id\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 6\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source id\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Prev Node id\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 6\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Previous Node id\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 CRC\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 4\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Cyclic Redundancy Check\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 End of Frame\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 End of frame marker value of 0x7E\sa60\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart ID_nbibmpc_45_SMPIBMPC}{\*\bkmkend ID_nbibmpc_45_SMPIBMPC}\b\fs26\f2 NetBIOS Session Management Protocol in IBM PC Networks\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 Details of packet structures for NetBIOS Session Management in IBM PC Networks are given in the {\field{\*\fldinst HYPERLINK \\l ID_nbibmpc_45_CompIBMpc}{\fldrslt the section called \i Comparison of NetBIOS protocols in IBM PC Network}} \hyphpar0\par\pard\sb200\s3\sl266 {\*\bkmkstart _3203}{\*\bkmkend _3203}\b\fs24\lang1024\f2 Session Request Packet in IBM PC Network\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 From "Inside NetBIOS": \hyphpar0\par\pard\sb100\li960\sl220\qj Session Request Packet : \hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Table B-4. Session Request Packet\sa100\keepn\par\trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Field\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Length\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Description\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Start\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Start Deliminator value 0x7E\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Destination\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 6\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Destination Address\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 6\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source Address\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Length\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Length of packet\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value set to 0x0040\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Function\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value 0x00-0x07=No poll 0x80-0x0F=Send Return Pkt\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Accept\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Number of packets willing to accept\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Connection id\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Connection id\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Sess seq no\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Sess seq no\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ACK Seq No\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ACK Seq No\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value set to 0x0001\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Response packet size\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Response packet size\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 4\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value of 0x0000\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 4\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 value of 0x1010\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source Name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 16\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Source NetBIOS name\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Dest Name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 16\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Destination NetBIOS name\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Dest Connection id\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 2\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Dest Connection id\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 CRC\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 4\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Cyclic Redundancy Check\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 End of Frame\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 End of frame marker value of 0x7E\sa60\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart ID_nbibmpc_45_CompIBMpc}{\*\bkmkend ID_nbibmpc_45_CompIBMpc}\b\fs26\f2 Comparison of NetBIOS protocols in IBM PC Network\keepn\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\f1 Table B-5. Name Management Packets\sa100\keepn\par\trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Name Claim / Cancel \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Name Response\sa60\cell \row \trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 < - 1 Octet (8 bits) -> \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 < - 1 Octet (8 bits) -> \sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Start Deliminator = 0x7E \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Start Deliminator = 0x7E \sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Destination Address 6 octets \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Destination Address 6 octets\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source Address 6 octets \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source Address 6 octets \sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Length 2 octets \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Length 2 octets \sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Value 0x5000\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Value 0x4000\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Claim 0x10 Cancel 0xA0\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Value 0x30\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 No Packets to accept N\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 No Packets to accept N\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Connection id 2 octets \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Connection id 2 octets\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Value 0x02\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Undefined \sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Value 0x02\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Undefined \sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Undefined \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Reason NAK\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Undefined \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Undefined \sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Value 0x04\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Value 0x04\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Value 0x00\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Value 0x00\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Undefined 4 octets\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Undefined 4 octets\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Value 0x10\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Value 10h\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Value XXh\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Value XXh\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Value 0x00\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Value 0x00\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Value 0x00\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Value 0x00\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Dest name 16 octets\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Dest name 16 octets\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Prev net con id\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Dest node conn id\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Prev net con id\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Dest node conn id\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Retransmit count\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 CRC 4 octets\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Retransmit count\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source node con id\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source node con id\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Dest id 6 octets\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 EOF 0x7E\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source id 6 octets\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Prev node id 6 octets\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 CRC 4 octets\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx4680\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 EOF 0x7E\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\li960\sl220\qj \b\fs20\f1 Table B-6. Session frames\sa100\keepn\par\trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Name Query\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Session Request\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Session Accept\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Session\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 Acknowledgment\sa60\cell \row \trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 < - 1 Octet (8 bits) -> \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 < - 1 Octet (8 bits) -> \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 <- 1 Octet (8 bits) -> \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 < - 1 Octet (8 bits) -> \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\f2 < - 1 Octet (8 bits) -> \sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Start Deliminator = 0x7E \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Start Deliminator = 0x7E \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Start Deliminator = 0x7E \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Start Deliminator = 0x7E \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Start Deliminator = 0x7E \sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Destination Address 6 octets\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Destination Address 6 octets \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Destination Address 6 octets \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Destination Address 6 octets \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Destination Address 6 octets \sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source Address 6 octets \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source Address 6 octets \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source Address 6 octets \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source Address 6 octets \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source Address 6 octets \sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Length 2 octets \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Length 2 octets \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Length 2 octets \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Length 2 octets \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Length 2 octets \sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Value 0x5000\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Value 0x0040\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Value 0x0040\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Value 0x4000\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Value 0x4000\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Value 0x10\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x00 - 0x07 No Poll 0x80 -0x0F Send return packet\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x00 - 0x07 No Poll 0x80 -0x0F Send return packet\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x00 - 0x07 No Poll 0x80 -0x0F Send return packet\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x40 - 0x47 No Poll 0x48 -0x4F Send return packet\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 No Packets to accept 0?h\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 No Packets to accept 0?h\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 No Packets to accept 0?h\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 No Packets to accept 0?h\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 No Packets to accept N\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Connection id 2 octets\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Connection id 2 octets\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Connection id 2 octets\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Connection id 2 octets\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Connection id 2 octets\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Value 0x02\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Ses Seq No \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Ses Seq No \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Ses Seq No \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Ses Seq No \sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Value 0x02\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ACK Seq No \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ACK Seq No \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ACK Seq No \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ACK Seq No \sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Undefined \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Value 0x00\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Value 0x00\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 0x80-0xF0 End message\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Undefined\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Undefined \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Value 0x01\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Value 0x02\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 DATA N octets\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Dest Node Con\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvmrg\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Value 0x10\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Response packet size\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Response packet size\sa60\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Dest Node Con\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Value 0x00\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Response packet size\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Response packet size\sa60\cell \cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 CRC 4 octets\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Undefined \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Value 0x00\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Dest node conn id\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Undefined \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Value 0x00\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Dest node conn id\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Undefined \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Value 0x10\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 CRC 4 octets\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvmrg\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Undefined \sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Value 0x10\sa60\cell \cell \plain \intbl\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 EOF 0x7E\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvmrg\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrl\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Value 0x10\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Source name\sa60\cell \cell \plain \intbl\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrl\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Value 0xXX\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Source name\sa60\cell \cell \plain \intbl\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrl\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Value 0xXX\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Source name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 EOF 7Eh\sa60\cell \plain \intbl\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrl\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Value 0x10\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Source name\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \intbl\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrl\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Dest name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Source name\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \intbl\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrl\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Dest name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Source name\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \intbl\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrl\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Dest name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Source name\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \intbl\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrl\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Dest name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Source name\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \intbl\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrl\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Dest name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Source name\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \intbl\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvmgf\clvertalt\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Dest name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Source name\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Dest node con id\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Dest name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Source name\sa60\cell \plain \pard\intbl\sl-120\par\cell \cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvmgf\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Dest name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Source name\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 CRC 4 octets\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvmrg\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Dest name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Source name\sa60\cell \plain \pard\intbl\sl-120\par\cell \cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvmrg\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Dest name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Source name\sa60\cell \plain \pard\intbl\sl-120\par\cell \cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvmrg\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Dest name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Source name\sa60\cell \plain \pard\intbl\sl-120\par\cell \cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Dest name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Source name\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 EOF 0x7E\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Dest name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Dest name\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Dest name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Dest name\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Dest name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Dest name\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Dest name\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Dest name\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Prev net con id\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Dest name\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Prev net con id\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Dest name\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Retransmit count\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Dest name\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Retransmit count\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Dest name\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source node con id\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Dest name\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source node con id\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Dest name\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Dest id\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Dest name\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Dest id\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Dest name\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Dest id\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Dest name\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Dest id\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Dest name\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Dest id\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Dest name\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Dest id\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 ASCII Dest name\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source id\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Dest node conn id\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source id\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 CRC\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source id\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 CRC\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source id\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 CRC\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source id\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 CRC\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Source id\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 EOF 0x7E\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Prev node id\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Prev node id\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Prev node id\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Prev node id\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Prev node id\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 Prev node id\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 CRC\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 CRC\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 CRC\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 CRC\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\f1 EOF 0x7E\sa60\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \plain \pard\intbl\sl-120\par\cell \row \pard\plain\sl-1\hyphpar0\par\sect\sectd\plain\pgwsxn12240\pghsxn15840\marglsxn1920\margrsxn1920\margtsxn960\margbsxn1200\headery0\footery0\pgndec\titlepg{\headerf\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}{\footerf\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}{\headerl\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 Appendix C. Active Directory}\tab {}\tab {}\par}{\footerl\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 \chpgn }\tab {}\tab {}\par}{\headerr\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 Appendix C. Active Directory}\par}{\footerr\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}\pard\sb220\s1\sl322 {\*\bkmkstart _3747}{\*\bkmkend _3747}\b\fs29\f2 Appendix C. Active Directory\keepn\hyphpar0\par\pard\sb146\li960\sl220\qj \b0\fs20\lang1033\f1 With the introduction of Windows 2000, Microsoft introduced Active Directory. Active Directory can be described as a hierarchical directory system, broadly similar in concept to Novell's Directory Services or the X.500 directory system. Among the uses of Active Directory is management of resources in a CIFS network; facilities such as the traditional browser service can be "replaced" by Active Directory. Because Active Directory has a significant impact upon CIFS networking, a brief overview is presented here, however a full description is beyond the scope of this documentation; there are many excellent references on Active Directory. \hyphpar0\par\pard\sb100\li960\sl220\qj As described above Active Directory (AD) implements a "tree structure" of objects that is broadly analogues to other directory systems that use "X.500" type technology. Indeed Active Directory is implemented using other standard directory technologies. In particular AD makes use of the Domain Name System (DNS) to establish an overall hierarchical tree structure. The Lightweight Directory Access Protocol (LDAP) directory system is also used to provide further granularity and provide facilities not available in the DNS. Traditional NT Domain technology is also used and provides backwards compatibility. \hyphpar0\par\pard\sb100\li960\sl220\qj In order to use AD the TCP/IP v4 protocol must be configured (both DNS and LDAP run over TCP/IP). While the Browser service also ran over IPX/SPX and the NetBIOS Frames Protocol (otherwise known as NBF or NetBEUI), this is not the case with AD. \hyphpar0\par\pard\sb100\li960\sl220\qj Microsoft has produced a Knowledge Base Article that provides a list of Windows 2000 Domain Controller Default Ports. This provides an insight in to the protocols used with Active Directory. \hyphpar0\par\pard\sb100\li960\sl220\qj The Knowledge Base Article is Q289241 and can be found at http://support.microsoft.com/default.aspx?scid=kb;en-us;289241\up8\fs12 1\up0\fs20 \hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart _3755}{\*\bkmkend _3755}\b\fs26\lang1024\f2 Domain Name System (DNS)\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 Active Directory requires a DNS infrastructure to be in place. AD does require that the DNS support dynamic updates, but uses the standard DNS. Thus in order to understand the impact of Active Directory on a network, it is necessary to understand the impact of DNS.\hyphpar0\par\pard\sb100\li960\sl220\qj Some relevant RFCs are given below:\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 RFC 1035: "DOMAIN NAMES - IMPLEMENTATION AND SPECIFICATION"\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 RFC 3007: "Secure Domain Name System (DNS) Dynamic Update"\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 RFC 2136: "Dynamic Updates in the Domain Name System (DNS UPDATE)"\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 RFC 2782: "A DNS RR for specifying the location of services (DNS SRV)"\hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart _3768}{\*\bkmkend _3768}\b\fs26\f2 Lightweight Directory Access Protocol (LDAP)\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 Active Directory uses Lightweight Directory Access Protocol (LDAP) to provide additional granularity to the "tree" structure. LDAP can be used to create Organizational Units (OUs) within the "tree" structure.\hyphpar0\par\pard\sb100\li960\sl220\qj Some relevant RFCs are given below:\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 RFC 2256: "A Summary of the X.500(96) User Schema for use with LDAPv3"\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 RFC 2251: "Lightweight Directory Access Protocol (v3)"\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 RFC 1777: "Lightweight Directory Access Protocol" \hyphpar0\par\pard\sb100\li1160\sl220\qj \lang1033 (Original definition)\hyphpar0\par\pard\sb200\sl293 \b\fs26\lang1024\f2 Notes\keepn\hyphpar0\par\pard\sb133\li1280\sl220\fi-320\qj \tx1280 \b0\fs20\f1 1. \tab http://support.microsoft.com/default.aspx?scid=kb;en-us;289241\hyphpar0\par\sect\sectd\plain\pgwsxn12240\pghsxn15840\marglsxn1920\margrsxn1920\margtsxn960\margbsxn1200\headery0\footery0\pgndec\titlepg{\headerf\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}{\footerf\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}{\headerl\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 Glossary}\tab {}\tab {}\par}{\footerl\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 \chpgn }\tab {}\tab {}\par}{\headerr\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 Glossary}\par}{\footerr\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}\pard\sb220\s1\sl322 {\*\bkmkstart _3780}{\*\bkmkend _3780}\b\fs29\f2 Glossary\keepn\hyphpar0\par\pard\sb146\li960\sl220\qj \b0\fs20\lang1033\f1 Glossary \hyphpar0\par\pard\sb200\s2\sl293 \b\fs26\lang1024\f2 A\keepn\hyphpar0\par\pard\sb150\s5\li960\sl220 \fs20 AD\keepn\hyphpar0\par\pard\sb100\li1360\sl220\qj \b0\lang1033\f1 Active Directory.\hyphpar0\par\pard\sb200\s2\sl293 \b\fs26\lang1024\f2 B\keepn\hyphpar0\par\pard\sb150\s5\li960\sl220 \fs20 Baseband\keepn\hyphpar0\par\pard\sb100\li1360\sl220\qj \b0\lang1033\f1 Systems that put digital signals from the data communications device on to the cable without modulation; only one data signal can be carried.\hyphpar0\par\pard\sb150\s5\li960\sl220 \b\lang1024\f2 BIOS\keepn\hyphpar0\par\pard\sb100\li1360\sl220\qj \b0\lang1033\f1 basic input/output system.\hyphpar0\par\pard\sb150\s5\li960\sl220 \b\lang1024\f2 Broadband\keepn\hyphpar0\par\pard\sb100\li1360\sl220\qj \b0\lang1033\f1 Systems that have multiple independent frequency channels, usually achieved by Frequency Division Multiplexing.\hyphpar0\par\pard\sb150\s5\li960\sl220 \b\lang1024\f2 Browser Server\keepn\hyphpar0\par\pard\sb100\li1360\sl220\qj \b0\lang1033\f1 Systems which maintain lists of Servers and the services they offer.\hyphpar0\par\pard\sb200\s2\sl293 \b\fs26\lang1024\f2 C\keepn\hyphpar0\par\pard\sb150\s5\li960\sl220 \fs20 CIFS\keepn\hyphpar0\par\pard\sb100\li1360\sl220\qj \b0\lang1033\f1 Common Internet File System - the latest version of SMB \hyphpar0\par\pard\sb200\s2\sl293 \b\fs26\lang1024\f2 D\keepn\hyphpar0\par\pard\sb150\s5\li960\sl220 \fs20 DMP\keepn\hyphpar0\par\pard\sb100\li1360\sl220\qj \b0\lang1033\f1 NetBIOS Diagnostic and Monitoring Protocol \hyphpar0\par\pard\sb150\s5\li960\sl220 \b\lang1024\f2 Domain\keepn\hyphpar0\par\pard\sb100\li1360\sl220\qj \b0\lang1033\f1 A logical grouping of systems within an SMB / CIFS network used for management and authentication. Within Microsoft networks a domain might be an NT 4.0 domain or Windows 2000 domain. \hyphpar0\par\pard\sb150\s5\li960\sl220 \b\lang1024\f2 DSAP\keepn\hyphpar0\par\pard\sb100\li1360\sl220\qj \b0\lang1033\f1 Destination Service Access Point \hyphpar0\par\pard\sb200\s2\sl293 \b\fs26\lang1024\f2 G\keepn\hyphpar0\par\pard\sb150\s5\li960\sl220 \fs20 Group Name\keepn\hyphpar0\par\pard\sb100\li1360\sl220\qj \b0\lang1033\f1 NetBIOS (and SMB / CIFS) name shared by a number of systems on the network. \hyphpar0\par\pard\sb200\s2\sl293 \b\fs26\lang1024\f2 H\keepn\hyphpar0\par\pard\sb150\s5\li960\sl220 \fs20 Hybrid node\keepn\hyphpar0\par\pard\sb100\li1360\sl220\qj \b0\lang1033\f1 Hybrid nodes ("H" nodes") are nodes on a network using NetBIOS over TCP/IP. Hybrid nodes are not defined in RFC 1001 and have not been standardized; these are mixed nodes (similar to "M" nodes) but function broadly in the opposite manner to "M" nodes. "H" nodes function as a "Point to Point" node first and then as a "Broadcast" node. \hyphpar0\par\pard\sb200\s2\sl293 \b\fs26\lang1024\f2 I\keepn\hyphpar0\par\pard\sb150\s5\li960\sl220 \fs20 IEEE\keepn\hyphpar0\par\pard\sb100\li1360\sl220\qj \b0\lang1033\f1 Institute of Electrical and Electronics Engineers \hyphpar0\par\pard\sb150\s5\li960\sl220 \b\lang1024\f2 IPX\keepn\hyphpar0\par\pard\sb100\li1360\sl220\qj \b0\lang1033\f1 Internetwork Packet Exchange \hyphpar0\par\pard\sb150\s5\li960\sl220 \b\lang1024\f2 ISO\keepn\hyphpar0\par\pard\sb100\li1360\sl220\qj \b0\lang1033\f1 International Standards Organization \hyphpar0\par\pard\sb200\s2\sl293 \b\fs26\lang1024\f2 M\keepn\hyphpar0\par\pard\sb150\s5\li960\sl220 \fs20 MAC\keepn\hyphpar0\par\pard\sb100\li1360\sl220\qj \b0\lang1033\f1 Media Access Control \hyphpar0\par\pard\sb200\s2\sl293 \b\fs26\lang1024\f2 N\keepn\hyphpar0\par\pard\sb150\s5\li960\sl220 \fs20 NBDD\keepn\hyphpar0\par\pard\sb100\li1360\sl220\qj \b0\lang1033\f1 NetBIOS Datagram Distribution Server \hyphpar0\par\pard\sb150\s5\li960\sl220 \b\lang1024\f2 NBF\keepn\hyphpar0\par\pard\sb100\li1360\sl220\qj \b0\lang1033\f1 NetBIOS Frames protocol \hyphpar0\par\pard\sb150\s5\li960\sl220 \b\lang1024\f2 NBFCP\keepn\hyphpar0\par\pard\sb100\li1360\sl220\qj \b0\lang1033\f1 NetBIOS Frames Control Protocol \hyphpar0\par\pard\sb150\s5\li960\sl220 \b\lang1024\f2 NBIPX\keepn\hyphpar0\par\pard\sb100\li1360\sl220\qj \b0\lang1033\f1 NetBIOS over IPX \hyphpar0\par\pard\sb150\s5\li960\sl220 \b\lang1024\f2 NBNS\keepn\hyphpar0\par\pard\sb100\li1360\sl220\qj \b0\lang1033\f1 NetBIOS Name Server\hyphpar0\par\pard\sb150\s5\li960\sl220 \b\lang1024\f2 NBT\keepn\hyphpar0\par\pard\sb100\li1360\sl220\qj \b0\lang1033\f1 NetBIOS over TCP/IP (term often seen in Microsoft documentation).\hyphpar0\par\pard\sb150\s5\li960\sl220 \b\lang1024\f2 NetBIOS\keepn\hyphpar0\par\pard\sb100\li1360\sl220\qj \b0\lang1033\f1 Network Basic Input / Output System\hyphpar0\par\pard\sb150\s5\li960\sl220 \b\lang1024\f2 NetBEUI\keepn\hyphpar0\par\pard\sb100\li1360\sl220\qj \b0\lang1033\f1 NetBIOS Extended User Interface\hyphpar0\par\pard\sb150\s5\li960\sl220 \b\lang1024\f2 NetBT\keepn\hyphpar0\par\pard\sb100\li1360\sl220\qj \b0\lang1033\f1 NetBIOS over TCP/IP (term often seen in Microsoft documentation).\hyphpar0\par\pard\sb150\s5\li960\sl220 \b\lang1024\f2 NMP\keepn\hyphpar0\par\pard\sb100\li1360\sl220\qj \b0\lang1033\f1 Name Management Protocol\hyphpar0\par\pard\sb200\s2\sl293 \b\fs26\lang1024\f2 P\keepn\hyphpar0\par\pard\sb150\s5\li960\sl220 \fs20 PPP\keepn\hyphpar0\par\pard\sb100\li1360\sl220\qj \b0\lang1033\f1 Point-to-Point Protocol\hyphpar0\par\pard\sb200\s2\sl293 \b\fs26\lang1024\f2 S\keepn\hyphpar0\par\pard\sb150\s5\li960\sl220 \fs20 SAP\keepn\hyphpar0\par\pard\sb100\li1360\sl220\qj \b0\lang1033\f1 Service Access Points\hyphpar0\par\pard\sb150\s5\li960\sl220 \b\lang1024\f2 SMB\keepn\hyphpar0\par\pard\sb100\li1360\sl220\qj \b0\lang1033\f1 Server Message Block \hyphpar0\par\pard\sb150\s5\li960\sl220 \b\lang1024\f2 SMP\keepn\hyphpar0\par\pard\sb100\li1360\sl220\qj \b0\lang1033\f1 System Message Block protocol\hyphpar0\par\pard\sb150\s5\li960\sl220 \b\lang1024\f2 SNAP\keepn\hyphpar0\par\pard\sb100\li1360\sl220\qj \b0\lang1033\f1 Sub-Network Access Protocol\hyphpar0\par\pard\sb150\s5\li960\sl220 \b\lang1024\f2 SPX\keepn\hyphpar0\par\pard\sb100\li1360\sl220\qj \b0\lang1033\f1 Sequenced Packet Exchange\hyphpar0\par\pard\sb150\s5\li960\sl220 \b\lang1024\f2 SSAP\keepn\hyphpar0\par\pard\sb100\li1360\sl220\qj \b0\lang1033\f1 source Service Access Point\hyphpar0\par\pard\sb200\s2\sl293 \b\fs26\lang1024\f2 U\keepn\hyphpar0\par\pard\sb150\s5\li960\sl220 \fs20 UDP\keepn\hyphpar0\par\pard\sb100\li1360\sl220\qj \b0\lang1033\f1 NetBIOS User Datagram Protocol or User Datagram Protocol in TCP/IP \hyphpar0\par\pard\sb200\s2\sl293 \b\fs26\lang1024\f2 W\keepn\hyphpar0\par\pard\sb150\s5\li960\sl220 \fs20 WINS\keepn\hyphpar0\par\pard\sb100\li1360\sl220\qj \b0\lang1033\f1 Windows Internet Name Service - Microsoft's implementation of NBNS\hyphpar0\par\sect\sectd\plain\pgwsxn12240\pghsxn15840\marglsxn1920\margrsxn1920\margtsxn960\margbsxn1200\headery0\footery0\pgndec\titlepg{\headerf\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}{\footerf\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}{\headerl\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 Bibliography}\tab {}\tab {}\par}{\footerl\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 \chpgn }\tab {}\tab {}\par}{\headerr\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 Bibliography}\par}{\footerr\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}\pard\sb220\s1\sl322 {\*\bkmkstart ID_refs_45_References}{\*\bkmkend ID_refs_45_References}\b\fs29\f2 Bibliography\keepn\hyphpar0\par\pard\sb146\li960\sl220\qj \b0\fs20\lang1033\f1 The following texts have been used in the preparation of this documentation: \hyphpar0\par\pard\sb100\li960\sl220\qj Information about NetBIOS, NetBEUI, NBF, SMB, and CIFS networking can be found "On line" at [http://www.timothydevans.me.uk/nbf.htm NetBIOS, NetBEUI, NBF, SMB, CIFS networking links page ] \up8\fs12 1\up0\fs20 \hyphpar0\par\pard\sb100\li1440\sl220\fi-480\qj \i\lang1024 BYTE Magazine November 1989 "Two tin cans and some string" Part 2 \i0 , Rick Grehan.\hyphpar0\par\pard\sb100\li1440\sl220\fi-480\qj \i BYTE Magazine January 1989 "Understanding NetBIOS"\i0 , Brett Glass.\hyphpar0\par\pard\sb100\li1440\sl220\fi-480\qj \i Inside NETBIOS\i0 , 3rd Edition, J. Scott Haugdahl, Architecture Technology corporation, ISBN 0-939405-00-8.\hyphpar0\par\pard\sb100\li1440\sl220\fi-480\qj {\*\bkmkstart ID_refs_45_ReferencesNOVELLLAN}{\*\bkmkend ID_refs_45_ReferencesNOVELLLAN}\i Novell's Guide to NetWare LAN Analysis\i0 , 2nd Edition, Laura A. Chappell and Dan E. Hakes, Novell Press SYBEX, ISBN 0-7821-1362-1.\hyphpar0\par\pard\sb100\li1440\sl220\fi-480\qj \i Networking Technologies\i0 , 2nd Edition, Dorothy Cady, Drew Heywood, Debra Niedermiller-Chaffins, and Cheryl Wilhite, New Riders Publishing, ISBN 1-56205-309-4.\hyphpar0\par\pard\sb100\li1440\sl220\fi-480\qj \i 802.2 Logical Link Control: ANSI/IEEE Std 802.2-1985\i0 , \i ISO Draft\i0 , \i International Standard 8802/2\i0 , ISBN 0-471-82748-7.\hyphpar0\par\pard\sb100\li1440\sl220\fi-480\qj {\*\bkmkstart ID_refs_45_ReferencesIBMLAN}{\*\bkmkend ID_refs_45_ReferencesIBMLAN}\i IBM LAN Technical Reference: IEEE 802.2 and NetBIOS Application Program Interfaces\i0 , Second Edition (May 1996) SC30-3587-01.\hyphpar0\par\pard\sb100\li1440\sl220\fi-480\qj {\*\bkmkstart ID_refs_45_ReferencesISO}{\*\bkmkend ID_refs_45_ReferencesISO}\i Netbios for ISO Networks\i0 , Stephen Thomas, Computer Communications Review - A Quarterly Publication of the Special Interest Group on Data Communications , July / August 1987 Volume 17, No 3.\hyphpar0\par\pard\sb100\li1440\sl220\fi-480\qj {\*\bkmkstart ID_refs_45_ReferencesXOPENSMB}{\*\bkmkend ID_refs_45_ReferencesXOPENSMB}\i Protocols for X/Open PC Interworking: SMB, Version 2: The Open Group\i0 , X/Open Document Number: C209, ISBN 1-87263-045-6.\hyphpar0\par\pard\sb200\li1440\sl220\qj \sa0\par\fi0\sb0 +Forbury Road\sa0\par\fi0\sb0 +Reading\sa0\par\fi0\sb0 +Berkshire\sa0\par\fi0\sb0 +RG1 1AX\sa0\par\fi0\sb0 +United Kingdom\sa0\par\fi0\sb0 +\hyphpar0\par\pard\sb200\li1440\sl220\fi-480\qj \i Windows NT TCP/IP\i0 , Dr.. Karanjit S. Siyan, New Riders Publishing, ISBN 1-56205-887-8.\hyphpar0\par\pard\sb200\sl293 \b\fs26\f2 Notes\keepn\hyphpar0\par\pard\sb133\li1280\sl220\fi-320\qj \tx1280 \b0\fs20\f1 1. \tab http://www.timothydevans.me.uk/nbf.htm\hyphpar0\par\sect\sectd\plain\pgwsxn12240\pghsxn15840\marglsxn1920\margrsxn1920\margtsxn960\margbsxn1200\headery0\footery0\pgndec\titlepg{\headerf\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}{\footerf\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}{\headerl\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 Appendix D. Document History}\tab {}\tab {}\par}{\footerl\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 \chpgn }\tab {}\tab {}\par}{\headerr\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 Appendix D. Document History}\par}{\footerr\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}\pard\sb220\s1\sl322 {\*\bkmkstart _4056}{\*\bkmkend _4056}\b\fs29\f2 Appendix D. Document History\keepn\hyphpar0\par\pard\sb146\li960\sl220\qj \b0\fs20\lang1033\f1 This document has been revised from time to time. In August 2001 a change history was added. Some of the changes to the document are listed below: \hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 1998 Documentation posted on Web\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 October 2001 \hyphpar0\par\pard\sb100\li1360\sl220\fi-200\qj \tx1360 \fs14 \'95\tab \fs20 Change History added.\hyphpar0\par\pard\sb100\li1360\sl220\fi-200\qj \tx1360 \fs14 \'95\tab \fs20 Document layout changed.\hyphpar0\par\pard\sb100\li1360\sl220\fi-200\qj \tx1360 \fs14 \'95\tab \fs20 Browser Section added.\hyphpar0\par\pard\sb100\li1360\sl220\fi-200\qj \tx1360 \fs14 \'95\tab \fs20 Information about NetBIOS on IBM PC network moved to appendix.\hyphpar0\par\pard\sb100\li1360\sl220\fi-200\qj \tx1360 \fs14 \'95\tab \fs20 Section on NetBIOS Addresses modified.\hyphpar0\par\pard\sb100\li1360\sl220\fi-200\qj \tx1360 \fs14 \'95\tab \fs20 General corrections and formatting changes.\hyphpar0\par\pard\sb100\li1160\sl220\qj \hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 January 2002\hyphpar0\par\pard\sb100\li1360\sl220\fi-200\qj \tx1360 \fs14 \'95\tab \fs20 Section on Name Resolution (in TCP/IP encapsulation) added.\hyphpar0\par\pard\sb100\li1360\sl220\fi-200\qj \tx1360 \fs14 \'95\tab \fs20 Use of CSS introduced.\hyphpar0\par\pard\sb100\li1360\sl220\fi-200\qj \tx1360 \fs14 \'95\tab \fs20 Minor alterations to Contents section, SMB section and glossary.\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 September 2002\hyphpar0\par\pard\sb100\li1360\sl220\fi-200\qj \tx1360 \fs14 \'95\tab \fs20 Documentation overhauled. All sections edited.\hyphpar0\par\pard\sb100\li1360\sl220\fi-200\qj \tx1360 \fs14 \'95\tab \fs20 Documentation converted to xml docbook format.\hyphpar0\par\pard\sb200\s2\sl293 {\*\bkmkstart _4093}{\*\bkmkend _4093}\b\fs26\f2 Background\keepn\hyphpar0\par\pard\sb133\li960\sl220\qj \b0\fs20\lang1033\f1 How this documentation came to be written is described below:\hyphpar0\par\pard\sb100\li960\sl220\qj During the 1990s there was a move towards distributed networked systems from traditional centralized systems; "down-sizing" and "right-sizing" were some of the "buzz-words" of the time. There was a considerable growth in PC Networks including those using the Server Message Block protocol.\hyphpar0\par\pard\sb100\li960\sl220\qj During this time I was in the Network group of the organization I worked for. It seemed sensible to find out a little about the protocols such as NetBIOS and SMB that were being discussed at that time. As I tried to discover a little about these protocols, I found considerable confusion and very little documentation or reliable information.\hyphpar0\par\pard\sb100\li960\sl220\qj During the late 1990s there were many books on other protocol suites such as TCP/IP, IPX/SPX, AppleTalk and others but there seemed to be none dedicated to NetBIOS or SMB. Eventually I found "Inside NETBIOS, 3rd Edition", by J. Scott Haugdahl, Architecture Technology corporation and later I obtained the official documentation from IBM: "IBM LAN Technical Reference: IEEE 802.2 and NetBIOS Application Program Interfaces, Second Edition (May 1996) SC30-3587-01."; these were (and as far as I know still are) the only books specifically describing the NetBIOS Frames Protocol. While there are now several books that include sections on the protocol the above mentioned books are the only ones that are dedicated to the topic. The situation with SMB seems to be worse; apart from "Protocols for X/Open PC Interworking: SMB, Version 2: The Open Group, X/Open Document Number: C209, ISBN 1-87263-045-6.", I am not aware of any book that exclusively describes SMB. \hyphpar0\par\pard\sb100\li960\sl220\qj I decided to post references to information I had found on a web site in the hopes that it might be useful to others and that this might prompt others to point me in the direction of useful information. As it became apparent how little documentation existed, I made some documentation available as a collection of web pages.\hyphpar0\par\pard\sb100\li960\sl220\qj Over the years a number of people have been kind enough to let me know that they found the documentation useful and so I have continued to develop it on an ad-hoc basis. One request that I consistently received was for the documentation in another format, preferably as a single file, and typically as a PDF document. The most sensible approach seemed to be to convert the documentation to xml format as a docbook document that could then be converted to whatever format was desired for which converters were available.\hyphpar0\par\sect\sectd\plain\pgwsxn12240\pghsxn15840\marglsxn1920\margrsxn1920\margtsxn960\margbsxn1200\headery0\footery0\pgndec\titlepg{\headerf\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}{\footerf\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}{\headerl\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 Colophon}\tab {}\tab {}\par}{\footerl\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 \chpgn }\tab {}\tab {}\par}{\headerr\pard\sl-240\sb770\sa-50\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 Colophon}\par}{\footerr\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}\pard\sb220\s1\sl322 {\*\bkmkstart _4101}{\*\bkmkend _4101}\b\fs29\f2 Colophon\keepn\hyphpar0\par\pard\sb165\s4\li960\sl242 \fs22 Colophon\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs20\lang1033\f1 This document has been produced as an xml docbook http://www.docbook.org\up8\fs12 1\up0\fs20 . Tools have been used to convert the document to other forms such as html. \hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 To convert to html, docbook2html was used and the resulting html was then process with htmltidy: \hyphpar0\par\pard\sb100\li1160\sl220\qj \lang1033 tidy -asxml -q \hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 To convert to RTF, docbook2rtf was used.\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 To convert to PDF, docbook2pdf was used.\hyphpar0\par\pard\sb200\sl293 \b\fs26\f2 Notes\keepn\hyphpar0\par\pard\sb133\li1280\sl220\fi-320\qj \tx1280 \b0\fs20\f1 1. \tab http://www.docbook.org\hyphpar0\par}