//! FIPS: Free Internetworking Peering System
//!
//! A distributed, decentralized network routing protocol for mesh nodes
//! connecting over arbitrary transports.

pub mod bloom;
pub mod cache;
pub mod config;
pub mod control;
pub mod discovery;
pub mod endpoint;
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
pub mod gateway;
pub mod host_firewall;
pub mod identity {
    pub use fips_identity::*;
}
pub mod mmp;
pub mod node;
pub mod noise;
pub mod peer;
pub(crate) mod perf_profile;
pub mod protocol;
pub(crate) mod time;
pub mod transport;
pub mod tree;
pub mod upper;
pub mod utils;
pub mod version;

// Re-export identity types
pub use fips_identity::{
    AuthChallenge, AuthResponse, FipsAddress, Identity, IdentityError, NodeAddr, PeerIdentity,
    decode_npub, decode_nsec, decode_secret, encode_npub, encode_nsec,
};

// Re-export config types
#[cfg(feature = "sim-transport")]
pub use config::SimTransportConfig;
pub use config::{Config, ConfigError, IdentityConfig, TorConfig, UdpConfig, WebRtcConfig};
pub use upper::config::{DnsConfig, TunConfig};

// Re-export discovery types
pub use discovery::{BootstrapHandoffResult, EstablishedTraversal};

// Re-export tree types
pub use tree::{CoordEntry, ParentDeclaration, TreeCoordinate, TreeError, TreeState};

// Re-export bloom filter types
pub use bloom::{BloomError, BloomFilter, BloomState};

// Re-export transport types
#[cfg(feature = "sim-transport")]
pub use transport::sim::{
    SimLink, SimNetwork, SimNetworkStats, SimNodeBehavior, SimTransport, register_sim_network,
    unregister_sim_network,
};
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 protocol types
pub use protocol::{
    CoordsRequired, FilterAnnounce, HandshakeMessageType, LinkMessageType, LookupRequest,
    LookupResponse, PathBroken, ProtocolError, SessionAck, SessionDatagram, SessionFlags,
    SessionMessageType, SessionSetup, TreeAnnounce,
};

// Re-export cache types
pub use cache::{CacheEntry, CacheError, CacheStats, CoordCache};

// Re-export peer types
pub use peer::{
    ActivePeer, ConnectivityState, HandshakeState, PeerConnection, PeerError, PeerSlot,
    PromotionResult, cross_connection_winner,
};

// Re-export node types
pub use endpoint::{
    FipsEndpoint, FipsEndpointBuilder, FipsEndpointError, FipsEndpointMessage, FipsEndpointPayload,
};
pub use node::{
    EndpointPayloadClass, EndpointPayloadLane, ExternalPacketIo, Node, NodeDeliveredPacket,
    NodeError, NodeState, classify_endpoint_payload, endpoint_payload_is_latency_sensitive,
};
