1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//! `dig-stun` — the DIG ecosystem's single home for reflexive-address discovery: how a node learns
//! the public address the outside world sees its traffic arrive from, and how it decides whether to
//! believe what it was told. `SPEC.md` at the repository root is the normative contract this crate
//! implements; every public item here is cross-referenced to the section that specifies it.
//!
//! It owns exactly four things (`SPEC.md` §1):
//!
//! 1. **The RFC 5389 Binding codec** ([`encode_binding_request`], [`parse_binding_response`],
//! [`parse_binding_request`], [`encode_binding_success`]) — request and success-response, both
//! directions.
//! 2. **The UDP STUN client** ([`query_reflexive_address`]) — one Binding transaction against one
//! server over one socket. This is the crate's only I/O and its only `async fn`; every other
//! public item is a pure function.
//! 3. **The address-scope classifier** ([`scope`]) — the single predicate every consumer uses to
//! ask "could this address be a legitimate reflexive candidate, and could a stranger route to
//! it?".
//! 4. **The peer-observation role** ([`observe`]) and **the agreement rule** ([`establish`]) — the
//! parts that let every directly-reachable DIG node act as a reflexive-address source for its
//! peers, and let a requesting node combine what several sources said without trusting any one
//! of them.
//!
//! It deliberately does NOT own the happy-eyeballs walk over several STUN servers (that is
//! `dig_nat::stun::discover_reflexive_address`, which composes this crate with `dig-ip`), a UDP STUN
//! listener for DIG nodes (nodes never open one — [`observe`]), tier policy (which servers to ask,
//! in what order — the consumer's job), or any proof of inbound reachability (`SPEC.md` §1, §10).
pub use query_reflexive_address;
pub use ;
pub use new_transaction_id;