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