Files
DomiStream/crates/domistream/src/lib.rs
T

50 lines
2.2 KiB
Rust

//! DomiStream: a sans-I/O GameStream client (the protocol Sunshine hosts and Moonlight clients speak), for
//! Arena Domi TV and the other Play remotely clients.
//!
//! **Phase A.** This crate holds the public API only. Every function that does protocol work returns
//! [`Error::Unimplemented`] (or `None` for `poll_*` functions); QA writes the mandatory tests against these
//! signatures before the logic lands. Plain data (constants, enum codes, field structs) is final.
//!
//! # Shape
//!
//! Nothing here opens a socket, reads a clock, spawns a thread or touches a file. The caller:
//! - feeds received bytes in (`handle_*` / `push` / `parse_*`, always `&[u8]`),
//! - passes the current time in as [`Instant`] and randomness as a [`RandomSource`],
//! - sends the bytes the state machines hand out (`poll_transmit`, [`http::HttpRequest`]),
//! - reacts to events (`poll_event`) and wakes the machine at its deadline (`poll_timeout` / `handle_timeout`).
//!
//! Every parser has a `MAX_*` constant and refuses larger input before it allocates.
//!
//! # Modules, in session order
//!
//! | Module | Protocol (see `docs/PROTOCOL.md`) |
//! | :-- | :-- |
//! | [`http`] | serverinfo, applist, launch/resume/cancel (section 1) |
//! | [`pairing`] | the PIN handshake and the client certificate (section 1.5) |
//! | [`rtsp`] | OPTIONS, DESCRIBE, SETUP, ANNOUNCE, PLAY and SDP (section 2) |
//! | [`enet`] | the ENet-compatible reliable UDP layer under the control stream (section 3.1) |
//! | [`control`] | AES-GCM framing and control messages (sections 3.2, 3.3) |
//! | [`input`] | input and gamepad packets (section 4) |
//! | [`rtp`] | the RTP header shared by video and audio |
//! | [`fec`] | Reed-Solomon erasure coding over GF(2^8) |
//! | [`video`] | video depacketizer with FEC recovery and decryption (section 5) |
//! | [`audio`] | audio depacketizer with FEC recovery and decryption (section 6) |
//!
//! Opus and video decoding are not here: they belong to the platform layer (ArenaTV).
#![forbid(unsafe_code)]
#![deny(missing_docs)]
pub mod entropy;
pub mod error;
pub mod http;
pub mod keys;
pub mod pairing;
pub mod rtsp;
pub mod time;
pub use entropy::RandomSource;
pub use error::{Error, Result};
pub use keys::SessionKeys;
pub use time::Instant;