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(crate) mod dataplane;
19pub mod mmp;
20pub mod node;
21pub mod noise;
22pub mod peer;
23pub mod peer_rating;
24pub(crate) mod perf_profile;
25pub(crate) mod proto;
26pub mod protocol;
27pub(crate) mod time;
28pub mod transport;
29pub mod tree;
30pub mod upper;
31pub mod utils;
32pub mod version;
33
34// Re-export identity types
35pub use fips_identity::{
36    AuthChallenge, AuthResponse, FipsAddress, Identity, IdentityError, NodeAddr, PeerIdentity,
37    decode_npub, decode_nsec, decode_secret, encode_npub, encode_nsec,
38};
39
40// Re-export config types
41#[cfg(feature = "sim-transport")]
42pub use config::SimTransportConfig;
43pub use config::{Config, ConfigError, IdentityConfig, TorConfig, UdpConfig, WebRtcConfig};
44pub use upper::config::{DnsConfig, TunConfig};
45
46// Re-export discovery types
47pub use discovery::{BootstrapHandoffResult, EstablishedTraversal};
48
49// Re-export tree types
50pub use tree::{CoordEntry, ParentDeclaration, TreeCoordinate, TreeError, TreeState};
51
52// Re-export bloom filter types
53pub use bloom::{BloomError, BloomFilter, BloomState};
54
55// Re-export transport types
56#[cfg(feature = "sim-transport")]
57pub use transport::sim::{
58    SimLink, SimNetwork, SimNetworkStats, SimNodeBehavior, SimTransport, register_sim_network,
59    unregister_sim_network,
60};
61pub use transport::udp::UdpTransport;
62pub use transport::{
63    DiscoveredPeer, Link, LinkDirection, LinkId, LinkState, LinkStats, PacketRx, PacketTx,
64    ReceivedPacket, Transport, TransportAddr, TransportError, TransportHandle, TransportId,
65    TransportState, TransportType, packet_channel,
66};
67
68// Re-export protocol types
69pub use protocol::{
70    CoordsRequired, FilterAnnounce, HandshakeMessageType, LinkMessageType, LookupRequest,
71    LookupResponse, PathBroken, ProtocolError, SessionAck, SessionDatagram, SessionFlags,
72    SessionMessageType, SessionSetup, TreeAnnounce,
73};
74
75// Re-export cache types
76pub use cache::{CacheEntry, CacheError, CacheStats, CoordCache};
77
78// Re-export peer types
79pub use peer::{
80    ActivePeer, ConnectivityState, HandshakeState, PeerConnection, PeerError, PeerSlot,
81    PromotionResult, cross_connection_winner,
82};
83
84// Re-export node types
85pub use endpoint::{
86    FipsEndpoint, FipsEndpointBuilder, FipsEndpointDirectDeliveryError,
87    FipsEndpointDirectPacketBatch, FipsEndpointDirectPacketRun, FipsEndpointDirectSink,
88    FipsEndpointError, FipsEndpointMessage, FipsEndpointOutboundDatagram,
89    FipsEndpointServiceDatagram,
90};
91pub use node::{ExternalPacketIo, Node, NodeDeliveredPacket, NodeError, NodeState};