torrentdht 0.1.1

DHT discovery with mTLS handshake handoff; optional BitTorrent when the host opts in
Documentation
//! Trust boundaries, decode limits, and validators for untrusted inputs.
//!
//! Control-flow zones are documented in `SECURITY.kdl` at the repo root.
//! Ingress sites use the `security::ingress!` macro for uniform annotation.

mod fs;
mod limits;
mod paths;
mod validate;

pub use limits::{
    DecodeLimits, MAX_DHT_DATAGRAM, MAX_EXTENDED_PAYLOAD, MAX_HTTP_HEADER_SLACK,
    MAX_METADATA_BYTES, MAX_PEER_MESSAGE_PAYLOAD, MAX_PEER_READ_BUF, MAX_PIECE_LENGTH,
    MAX_TORRENT_CONTENT_BYTES, MAX_TORRENT_FILE_BYTES, MAX_TRACKER_HTTP_RESPONSE, MIN_PIECE_LENGTH,
};
/// Mark an untrusted ingress point in source (visible in review and `rg ingress`).
#[macro_export]
macro_rules! ingress {
    ($zone:expr) => {
        // SECURITY ingress: untrusted input — zone = $zone
    };
}

pub use fs::{
    create_content_with_len, create_content_with_len_async, ensure_dir_under_root, open_content_read,
    open_content_read_async, open_content_rw, open_content_rw_async, open_nofollow_read,
    read_bytes_under_root, read_bytes_under_root_async, read_bytes_under_root_capped,
    write_bytes_under_root, write_bytes_under_root_async,
};
pub use paths::{join_under_root, sanitize_torrent_relative_path};
pub use validate::{
    reject_http_token, validate_block_request, validate_metadata_piece, validate_piece_block_write,
    validate_upload_request,
};