|
| 1 | +# AGENTS.md |
| 2 | + |
| 3 | +## Project Overview |
| 4 | + |
| 5 | +`dcsctp` is a Rust implementation of the Stream Control Transmission Protocol |
| 6 | +(SCTP, [RFC 9260](https://www.rfc-editor.org/rfc/rfc9260.txt)) designed for |
| 7 | +WebRTC Data Channels ([RFC 8831](https://www.rfc-editor.org/rfc/rfc8831.txt)). |
| 8 | +It is a user-space library intended to be embedded in larger systems (like |
| 9 | +WebRTC implementations), not a standalone server or in an operating system |
| 10 | +kernel. |
| 11 | + |
| 12 | +## Architecture |
| 13 | + |
| 14 | +- **Core Design**: The library is **single-threaded** and **event-driven**. |
| 15 | + It does not perform I/O directly. The consumer drives the loop by feeding |
| 16 | + packets/timer events and handling outgoing commands. |
| 17 | +- **Entry Point**: The primary public interface is the `DcSctpSocket` trait |
| 18 | + (`src/api/mod.rs`). The implementation is `Socket` (`src/socket/mod.rs`). |
| 19 | +- **Internal**: |
| 20 | + - `src/socket/`: State machine, connection establishment/teardown. |
| 21 | + - `src/rx/`: Receiver logic (congestion control, reassembly). |
| 22 | + - `src/tx/`: Transmitter logic (congestion control, retransmission). |
| 23 | + - `src/timer/`: Timer abstractions (does not use system timers). |
| 24 | +- **C++ Bindings**: `src/ffi.rs` uses `cxx` to expose the Rust API to C++. |
| 25 | + Changes to `src/api/` must often be reflected in `src/ffi.rs`. |
| 26 | + |
| 27 | +## Development Workflow |
| 28 | + |
| 29 | +- **Build**: `cargo build` |
| 30 | +- **Test**: `cargo test` (Runs extensive unit and integration tests). |
| 31 | +- **Lint**: `cargo clippy --all-features --all-targets -- -D warnings` |
| 32 | +- **Format**: `cargo +nightly fmt --all -- --check` |
| 33 | + |
| 34 | +## Contribution Rules |
| 35 | + |
| 36 | +- **Changelog**: All functional changes must be documented in `CHANGELOG.md` |
| 37 | + under the *Unreleased* section (categories: Added, Changed, Deprecated, |
| 38 | + Removed, Fixed, Security). |
0 commit comments