mirror of
https://github.com/jmcorgan/fips.git
synced 2026-08-05 06:14:36 +00:00
Move the PromotionResult enum (and its impl) out of peer::mod and into proto/fmp/core.rs, alongside the cross_connection_winner tie-break helper that was relocated the same way. This is FMP connection-lifecycle result vocabulary, so it belongs in the FMP subsystem home rather than the peer module. Behavior-neutral pure type relocation: consumers import it from crate::proto::fmp, and the crate-root public path crate::PromotionResult is preserved via a re-export in lib.rs (mirroring cross_connection_winner). Full lib suite green at baseline.
101 lines
3.4 KiB
Rust
101 lines
3.4 KiB
Rust
//! FIPS: Free Internetworking Peering System
|
|
//!
|
|
//! A distributed, decentralized network routing protocol for mesh nodes
|
|
//! connecting over arbitrary transports.
|
|
|
|
// Name the `alloc` crate directly so the sans-IO protocol cores can spell their
|
|
// heap-type imports in `no_std`-forward form (`alloc::sync::Arc`,
|
|
// `alloc::collections::BTreeMap`). The crate remains `std`; this only reduces the
|
|
// distance to extracting the pure cores into a `no_std` crate later.
|
|
extern crate alloc;
|
|
|
|
pub mod cache;
|
|
pub mod config;
|
|
pub mod control;
|
|
#[cfg(target_os = "linux")]
|
|
pub mod gateway;
|
|
pub mod identity;
|
|
pub mod mdns;
|
|
pub mod node;
|
|
pub mod noise;
|
|
pub mod nostr;
|
|
pub mod peer;
|
|
pub mod perf_profile;
|
|
pub(crate) mod proto;
|
|
#[cfg(test)]
|
|
pub(crate) mod testutil;
|
|
mod time;
|
|
pub mod transport;
|
|
pub mod upper;
|
|
pub mod utils;
|
|
pub mod version;
|
|
|
|
// Re-export identity types
|
|
pub use identity::{
|
|
AuthChallenge, AuthResponse, FipsAddress, Identity, IdentityError, NodeAddr, PeerIdentity,
|
|
decode_npub, decode_nsec, decode_secret, encode_npub, encode_nsec,
|
|
};
|
|
|
|
// Re-export config types
|
|
pub use config::{Config, ConfigError, IdentityConfig, NymConfig, TorConfig, UdpConfig};
|
|
pub use upper::config::{DnsConfig, TunConfig};
|
|
|
|
// Re-export nostr rendezvous handoff types
|
|
pub use nostr::{BootstrapHandoffResult, EstablishedTraversal, is_punch_packet};
|
|
|
|
// Re-export tree types (relocated from tree:: to proto::stp)
|
|
pub use proto::stp::{
|
|
CoordEntry, CoordError, ParentDeclaration, TreeCoordinate, TreeError, TreeState,
|
|
};
|
|
|
|
// Re-export bloom filter types (relocated from bloom:: to proto::bloom)
|
|
pub use proto::bloom::{BloomError, BloomFilter, BloomState};
|
|
|
|
// Re-export transport types
|
|
pub use transport::udp::UdpTransport;
|
|
pub use transport::{
|
|
DiscoveredPeer, Link, LinkDirection, LinkId, LinkState, LinkStats, PacketRx, PacketTx,
|
|
ReceivedPacket, Transport, TransportAddr, TransportError, TransportHandle, TransportId,
|
|
TransportState, TransportType, packet_channel,
|
|
};
|
|
|
|
// Re-export link-layer types (relocated from protocol:: to proto::link)
|
|
pub use proto::link::{LinkMessageType, SessionDatagram};
|
|
|
|
// Re-export the shared protocol error (relocated from protocol:: to proto::Error)
|
|
pub use proto::Error;
|
|
|
|
// Re-export FSP session wire types (relocated from protocol:: to proto::fsp)
|
|
pub use proto::fsp::{SessionAck, SessionFlags, SessionMessageType, SessionSetup};
|
|
|
|
// Re-export STP wire types (relocated from protocol:: to proto::stp)
|
|
pub use proto::stp::TreeAnnounce;
|
|
|
|
// Re-export bloom wire types (relocated from protocol:: to proto::bloom)
|
|
pub use proto::bloom::FilterAnnounce;
|
|
|
|
// Re-export discovery wire types (relocated from protocol:: to proto::lookup)
|
|
pub use proto::lookup::{LookupRequest, LookupResponse};
|
|
|
|
// Re-export routing wire types (relocated from protocol:: to proto::routing)
|
|
pub use proto::routing::{
|
|
COORDS_REQUIRED_SIZE, CoordsRequired, MTU_EXCEEDED_SIZE, MtuExceeded, PathBroken,
|
|
};
|
|
|
|
// Re-export FMP link-framing wire type (relocated from protocol:: to proto::fmp)
|
|
pub use proto::fmp::HandshakeMessageType;
|
|
|
|
// Re-export cache types
|
|
pub use cache::{CacheEntry, CacheError, CacheStats, CoordCache};
|
|
|
|
// Re-export FMP tie-break helper and promotion result (relocated from peer:: to proto::fmp)
|
|
pub use proto::fmp::{PromotionResult, cross_connection_winner};
|
|
|
|
// Re-export peer types
|
|
pub use peer::{
|
|
ActivePeer, ConnectivityState, HandshakeState, PeerConnection, PeerError, PeerSlot,
|
|
};
|
|
|
|
// Re-export node types
|
|
pub use node::{Node, NodeError, NodeState, UpdatePeersOutcome};
|