diff --git a/docs/CLEAN_ROOM.md b/docs/CLEAN_ROOM.md index 93ef6f3..06f5726 100644 --- a/docs/CLEAN_ROOM.md +++ b/docs/CLEAN_ROOM.md @@ -12,16 +12,20 @@ GPL-licensed implementation. This file says what may be read, what may not, and | [Moonshine](https://github.com/hgaiser/moonshine) | BSD-2-Clause | May be read. Facts taken are logged below. Code is not copied; if a snippet is ever borrowed, it keeps Moonshine's copyright line and licence text in the file that holds it. | | RFCs and standards (RTP RFC 3550, RTSP RFC 2326, SDP RFC 4566, Opus RFC 6716 / RFC 7845, AES FIPS 197, GCM/CBC NIST SP 800-38D/38A, PKCS #1 RFC 8017, X.509 RFC 5280) | open standards | Read freely. | | Crate docs (docs.rs, crates.io, crate READMEs) | per crate | Read freely. | -| Our own measurements | ours | Captures between our client and a host on a **lab machine** (never Mark's PC, never Mark's TV, never 192.168.100.217). Captures stay out of git; only the facts and test vectors derived from them go in, with the date and setup. | +| Our own measurements | ours | Captures through our own relay ([tools/lab-relay](../tools/lab-relay)). Mark allowed **one** capture on his PC (answer 16, 2026-11-25), done exactly as [LAB_CAPTURE.md](LAB_CAPTURE.md) says; never his TV, never 192.168.100.217. Recordings stay on F: under `F:\Akce\DomiStream-lab\`, out of git; only facts and test vectors derived from them go in, with the date and setup. | +| Official Sunshine and Moonlight PC **binaries** in that capture | GPL-3.0 (we only run them) | Black-box peers: run, observe their traffic, their `--help` output, their own logs and the files/registry keys they write. Never open their source, never disassemble or decompile them. | | READMEs and wikis of forbidden projects | n/a | For facts only (licence, release notes, compatibility statements). Never their source files. | -### Proposed additions (need the build lead's yes before use) +### Approved by Mark (answer 15, 2026-11-25): "Yes, with attribution" + +Read for the wire format; anything borrowed beyond a fact is attributed in the file that holds it. GPL stays off +limits, and a value with GPL provenance stays out even when one of these sources carries it. | Source | Licence | Why | | :-- | :-- | :-- | -| [Stock ENet](https://github.com/lsalzman/enet) (`protocol.h`, `protocol.c`) | MIT | The ENet 1.3 wire format is not documented anywhere else in prose. The Wolf docs do not describe it. | -| [tokio-enet](https://github.com/hgaiser/tokio-enet) source | BSD-2-Clause | A pure-Rust ENet 1.3 used by Moonshine to talk to Moonlight clients. Its `src/protocol/` files were read for the command list (logged below, S-10). | -| [fec-rs](https://github.com/hgaiser/fec-rs) source | BSD-2-Clause | Its README says its field setup is compatible with Moonlight. Reading its matrix construction would settle UNKNOWN U14 (video FEC). | +| [Stock ENet](https://github.com/lsalzman/enet) | MIT | The ENet 1.3 wire format is documented nowhere else. Read at v1.3.18 (S-17). | +| [tokio-enet](https://github.com/hgaiser/tokio-enet) | BSD-2-Clause | Pure-Rust ENet 1.3 that Moonshine uses with Moonlight clients (S-10, now approved). | +| [fec-rs](https://github.com/hgaiser/fec-rs) | BSD-2-Clause | Reed-Solomon whose README claims Moonlight compatibility; its matrix construction settles U14 (S-18). | ## Forbidden @@ -39,6 +43,7 @@ copied into DomiStream, and settled by our own measurement instead. Known cases: | :-- | :-- | :-- | | `src/session/stream/audio/encoder.rs` | the fixed 2x4 Reed-Solomon parity matrix for audio FEC; the comment cites a moonlight-common-c file | Not taken. I saw the constant while reading the file; it is not in this repo. U16 in [PROTOCOL.md](PROTOCOL.md) says how to measure it ourselves. | | `src/session/stream/control/mod.rs` | HDR mode payload "matches Sunshine's" struct | Field layout logged as `[M*]`, confirm by measurement before relying on it | +| fec-rs `src/reed_solomon.rs` tests (`test_partial_eq_reflects_parity_matrix_changes`) | the same audio parity matrix as Moonshine's encoder | Not taken, same rule. Seen while reading fec-rs on 2026-11-25. | | `src/rtsp.rs` | `surround-params` digit packing "matching moonlight-common-c" | The Wolf example `surround-params=21101` gives the same packing independently, so we use the Wolf source | ## How code gets written @@ -64,10 +69,14 @@ All entries by the DomiStream protocol engineer. Pinned commits are the ones rea | S-7 | 2026-11-25 | [Wolf: input](https://games-on-whales.github.io/wolf/stable/protocols/input-data.html) incl. bytefield sources | INPUT_DATA layout (size BE, type LE); input type codes; layouts and example bytes for mouse move rel/abs, buttons, keys, scroll, hscroll, controller arrival, controller multi; key code table; button flags; controller types and capability bits. | | S-8 | 2026-11-25 | GitHub API for [games-on-whales/wolf](https://github.com/games-on-whales/wolf) (`/repos`, `/git/trees/beta`, `LICENSE`, `docs/README.adoc`) | Repo licence MIT; the docs live in `docs/modules/protocols/pages/*.adoc` of the same repo; latest tag `v2026.11`. No source files of Wolf were read. | | S-9 | 2026-11-25 | [Moonshine](https://github.com/hgaiser/moonshine) at `f184d5e3693e09c3a6ab1025bde6cdb67f36a6bc`: `LICENSE`, `README.md`, `Cargo.toml`, `src/clients.rs`, `src/crypto.rs`, `src/webserver/pairing.rs`, `src/webserver/mod.rs`, `src/rtsp.rs`, `src/session/stream/control/mod.rs`, `src/session/stream/audio/{mod,encoder}.rs`, `src/session/stream/video/{mod,packetizer,shard_batch}.rs` | Facts tagged `[M]` in PROTOCOL.md: pairing query names, AES-128-ECB, key = first 16 bytes of SHA-256(salt + PIN), 16-byte salt/challenge/secret, RSA PKCS#1 v1.5 SHA-256, "certificate signature" = X.509 signatureValue bytes; serverinfo, applist and launch XML and query fields; SDP attribute names, SETUP reply headers, encryption flag bits; control IV layout and direction bytes, START_B starts the streams, INVALIDATE_REF_FRAMES and termination layouts, ENet host settings; audio IV, payload types 97/127, millisecond timestamps; video RTP/NV header byte layout, FEC bit fields and block split, video encryption prefix and IV; `PING` payload. Moonshine depends on `tokio-enet` for the control channel. | -| S-10 | 2026-11-25 | [tokio-enet](https://github.com/hgaiser/tokio-enet) at `364628ed754760c99e0df7bcc88e479ad91475c4`: `README.md`, `CHANGELOG.md`, `src/protocol/{mod,header,commands}.rs` | Claims wire compatibility with C ENet 1.3.x, BSD-2; ENet command numbers 1-12, command sizes, header flags (compressed 1<<14, sent time 1<<15, session bits 12-13), 4-byte command header, big-endian fields. Pending approval as an allowed source (see above). | +| S-10 | 2026-11-25 | [tokio-enet](https://github.com/hgaiser/tokio-enet) at `364628ed754760c99e0df7bcc88e479ad91475c4`: `README.md`, `CHANGELOG.md`, `src/protocol/{mod,header,commands}.rs` | Claims wire compatibility with C ENet 1.3.x, BSD-2; ENet command numbers 1-12, command sizes, header flags (compressed 1<<14, sent time 1<<15, session bits 12-13), 4-byte command header, big-endian fields. **Approved** (Mark, 2026-11-25, answer 15). | | S-11 | 2026-11-25 | crates.io API for `enet`, `enet-rs`, `nsys-enet`, `rusty_enet`, `tokio-enet`, `enet-sys`, `henet`, `enet-cs-sys`, `fec-rs`, `reed-solomon-erasure` and the RustCrypto crates | Licences, versions, repositories (see research/open-point-2.md and the Cargo manifest). | | S-12 | 2026-11-25 | [docs.rs: rusty_enet](https://docs.rs/rusty_enet/latest/rusty_enet/) | Transpiled from C ENet; caller-supplied `Socket` trait and `HostSettings::time`; optional crc32 checksum; MIT. | | S-13 | 2026-11-25 | [fec-rs README](https://github.com/hgaiser/fec-rs) | GF(2^8) with polynomial 0x1D (0x11D), "compatible with the Moonlight streaming protocol", reconstruction supported, BSD-2. | | S-14 | 2026-11-25 | [moonlight-common-c README](https://github.com/moonlight-stream/moonlight-common-c) (README only) | Needs its bundled ENet; other ENet versions are incompatible; GPL-3.0. | | S-15 | 2026-11-25 | [cgutman/enet](https://github.com/cgutman/enet) repository page (description only) | Forked from lsalzman/enet, has a `moonlight` branch. No files opened. | | S-16 | 2026-11-25 | Roadmap brief ยง3.2 ([moonlight-android releases](https://github.com/moonlight-stream/moonlight-android/releases)) | Moonlight Android 12.1 added end-to-end stream encryption with Sunshine. | +| S-17 | 2026-11-25 | [Stock ENet](https://github.com/lsalzman/enet) v1.3.18 (`2662c0d`): `LICENSE`, `include/enet/protocol.h`, `include/enet/enet.h` (constants and peer states), `host.c` (`enet_host_connect`), `peer.c` (default ping and timeout setters), `protocol.c` (header and checksum handling, connect/verify connect session ids, retransmission timeout) | MIT. Wire structs and sizes; header flags; checksum is an optional host setting (4 bytes after the header, no flag on the wire, seeded with the connect id); connect sends session ids 0xFF and channel 0xFF; defaults: MTU 1392, ping interval 500 ms, timeout limit 32 / minimum 5000 ms / maximum 30000 ms, window 4096-65536 derived from bandwidth. | +| S-18 | 2026-11-25 | [fec-rs](https://github.com/hgaiser/fec-rs) at `402f41f970bb8c3ef7c88639821032e3b6460f63`: `LICENSE`, `README.md`, `build.rs` (field tables), `src/galois.rs` (`exp`), `src/matrix.rs` (`vandermonde`), `src/reed_solomon.rs` (`build_matrix`, `new`) | BSD-2. Field GF(2^8) with polynomial 0x11D, generator 2; systematic code whose parity rows are the Cauchy matrix `P[j][i] = 1 / ((m + i) XOR j)`. Its tests also contain the GPL-provenance audio matrix (not taken). | +| S-19 | 2026-11-25 | GitHub release API: [Moonlight PC v6.2.0](https://api.github.com/repos/moonlight-stream/moonlight-qt/releases/latest), [Sunshine v2026.914.233613](https://api.github.com/repos/SunshineStream/Sunshine/releases/tags/v2026.914.233613) | Asset names, sizes and sha256 digests for the lab capture pins. Release metadata only. | +| S-20 | 2026-11-25 | ArenaTV `docs/research/sunshine-api.md` and `docs/research/this-pc.md` (Domi's own research from LizardByte's docs) | Sunshine's API calls, `--creds`, `bind_address`, port offsets, first-run behaviour, this PC's adapters and old install. |