Skip to main content

fips_core/
lib.rs

1//! FIPS: Free Internetworking Peering System
2//!
3//! A distributed, decentralized network routing protocol for mesh nodes
4//! connecting over arbitrary transports.
5
6pub mod bloom;
7pub mod cache;
8pub mod config;
9pub mod control;
10pub mod discovery;
11pub mod endpoint;
12#[cfg(all(target_os = "linux", not(target_env = "musl")))]
13pub mod gateway;
14pub mod host_firewall;
15pub mod identity {
16    pub use fips_identity::*;
17}
18pub mod mmp;
19pub mod node;
20pub mod noise;
21pub mod peer;
22pub(crate) mod perf_profile;
23pub mod protocol;
24pub(crate) mod time;
25pub mod transport;
26pub mod tree;
27pub mod upper;
28pub mod utils;
29pub mod version;
30
31// Re-export identity types
32pub use fips_identity::{
33    AuthChallenge, AuthResponse, FipsAddress, Identity, IdentityError, NodeAddr, PeerIdentity,
34    decode_npub, decode_nsec, decode_secret, encode_npub, encode_nsec,
35};
36
37// Re-export config types
38#[cfg(feature = "sim-transport")]
39pub use config::SimTransportConfig;
40pub use config::{Config, ConfigError, IdentityConfig, TorConfig, UdpConfig, WebRtcConfig};
41pub use upper::config::{DnsConfig, TunConfig};
42
43// Re-export discovery types
44pub use discovery::{BootstrapHandoffResult, EstablishedTraversal};
45
46// Re-export tree types
47pub use tree::{CoordEntry, ParentDeclaration, TreeCoordinate, TreeError, TreeState};
48
49// Re-export bloom filter types
50pub use bloom::{BloomError, BloomFilter, BloomState};
51
52// Re-export transport types
53#[cfg(feature = "sim-transport")]
54pub use transport::sim::{
55    SimLink, SimNetwork, SimNetworkStats, SimNodeBehavior, SimTransport, register_sim_network,
56    unregister_sim_network,
57};
58pub use transport::udp::UdpTransport;
59pub use transport::{
60    DiscoveredPeer, Link, LinkDirection, LinkId, LinkState, LinkStats, PacketRx, PacketTx,
61    ReceivedPacket, Transport, TransportAddr, TransportError, TransportHandle, TransportId,
62    TransportState, TransportType, packet_channel,
63};
64
65// Re-export protocol types
66pub use protocol::{
67    CoordsRequired, FilterAnnounce, HandshakeMessageType, LinkMessageType, LookupRequest,
68    LookupResponse, PathBroken, ProtocolError, SessionAck, SessionDatagram, SessionFlags,
69    SessionMessageType, SessionSetup, TreeAnnounce,
70};
71
72// Re-export cache types
73pub use cache::{CacheEntry, CacheError, CacheStats, CoordCache};
74
75// Re-export peer types
76pub use peer::{
77    ActivePeer, ConnectivityState, HandshakeState, PeerConnection, PeerError, PeerSlot,
78    PromotionResult, cross_connection_winner,
79};
80
81// Re-export node types
82pub use endpoint::{FipsEndpoint, FipsEndpointBuilder, FipsEndpointError, FipsEndpointMessage};
83pub use node::{ExternalPacketIo, Node, NodeDeliveredPacket, NodeError, NodeState};