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