zebra_network/protocol/external/
addr.rs

1//! Zcash node address types and serialization for Zcash network messages.
2//!
3//! Zcash has 3 different node address formats:
4//! - `AddrV1`: the format used in `addr` (v1) messages,
5//! - [`AddrInVersion`]: the format used in `version` messages, and
6//! - `AddrV2`: the format used in `addrv2` messages.
7
8pub mod canonical;
9pub mod in_version;
10
11pub(crate) mod v1;
12pub(crate) mod v2;
13
14pub use canonical::{canonical_peer_addr, canonical_socket_addr};
15pub use in_version::AddrInVersion;
16
17// These types and functions should only be visible in the `external` module,
18// so that they don't leak outside the serialization code.
19
20pub(super) use v1::AddrV1;
21pub(super) use v2::AddrV2;
22
23#[allow(unused_imports)]
24#[cfg(any(test, feature = "proptest-impl"))]
25pub(super) use v1::{ipv6_mapped_ip_addr, ADDR_V1_SIZE};
26
27// TODO: write tests for addrv2 deserialization
28#[allow(unused_imports)]
29#[cfg(any(test, feature = "proptest-impl"))]
30pub(super) use v2::ADDR_V2_MIN_SIZE;