sipx_transport/lib.rs
1//! Async SIP transports.
2//!
3//! This crate is the driver for the sans-IO core in [`sipx_sip`]: it owns sockets,
4//! connections and timers, feeds received bytes in as inputs, and performs the outputs the
5//! core asks for. It also implements the parts of real networks the RFCs leave to the
6//! implementation — `received` and `rport` for NAT, connection reuse, target resolution.
7//!
8//! The shape of it is one event loop per endpoint, owning everything mutable. Nothing in the
9//! signalling path takes a lock, and no transaction is reachable from two tasks.
10//!
11//! See `docs/specs/sip-transport.md`.
12//!
13//! # Stability
14//!
15//! sipx is pre-1.0, so **neither word below means frozen**. `1.0.0` is what freezes an API, and its
16//! predicates are in `docs/roadmap.md`. Until then:
17//!
18//! - **Supported** — meant to be depended on. Breaking changes get a `CHANGELOG.md` entry saying what
19//! to do instead. New enum variants and new struct fields may still appear in a minor release, so a
20//! downstream `match` should carry a `_` arm.
21//! - **Experimental** — may change shape or be removed without a migration note. Depend on it only if
22//! you are prepared to follow it.
23//!
24//!
25//! **Supported.** UDP, TCP, TLS and WebSocket are all in the default feature set and all carry a call.
26//! `respond` guarantees the response is on the wire before it returns — see
27//! `docs/designs/sip-transport.md`, which records that as a guarantee rather than an internal detail.
28//!
29//! **Experimental.** QUIC is enabled by default so its feature-off build is continuously checked,
30//! but its SIP mapping is a sipx specification rather than an RFC. Its API and wire choices may
31//! change if a standard mapping is published; see `docs/specs/sip-quic.md`.
32
33pub mod capture;
34pub mod counters;
35#[cfg(feature = "dns")]
36pub mod dns;
37pub mod endpoint;
38pub mod error;
39pub mod nat;
40pub mod overload;
41pub mod policy;
42#[cfg(feature = "quic")]
43pub mod quic;
44pub mod resolve;
45pub mod stun;
46pub mod target;
47pub mod tcp;
48pub mod timers;
49#[cfg(feature = "tls")]
50pub mod tls;
51#[cfg(feature = "ws")]
52pub mod ws;
53
54pub use capture::{CaptureConfig, Direction, HepConfig};
55pub use counters::{
56 CaptureCounts, Counters, DiscardCounts, ShedCounts, TimeoutCounts, TransportCounts,
57 UnsentCounts,
58};
59pub use endpoint::{
60 CancelInviteOutcome, CancelTransactionOutcome, CleartextTransports, Config, Handle,
61 InProcessEndpoint, InProcessPair, Incoming, InviteCancellation, Responses, Unmatched, bind,
62 in_process_pair, new_branch,
63};
64pub use error::{Error, Result};
65pub use overload::{OverloadConfig, OverloadFeedback, RequestCategory};
66pub use policy::{
67 ConnectionId, ConnectionObservation, ConnectionState, EndpointObservation, MessageDirection,
68 MessageObservation, RequestPolicy, RequestPolicyDecision, RequestPolicyRef, SourcePrefix,
69 TransactionClass,
70};
71pub use resolve::{Naptr, Resolver, Srv, resolve};
72pub use stun::Reply as StunReply;
73pub use target::{ConnectionKey, Target, TransportKind};
74pub use tcp::{Pool, PoolConfig};