Skip to main content

rns_net/
lib.rs

1//! rns-net: Network node for Reticulum.
2//!
3//! Drives `rns-core::TransportEngine` with real TCP/UDP sockets and threads.
4//! Reads standard Python RNS config files, opens TCP server/client, UDP, and
5//! Local interfaces, persists identity and known destinations.
6
7#[cfg(feature = "hooks")]
8extern crate rns_hooks_crate as rns_hooks;
9
10pub mod common;
11pub mod event;
12pub mod hdlc;
13pub mod kiss;
14pub mod logging;
15pub mod rnode_kiss;
16pub use common::time;
17pub mod driver;
18pub mod interface;
19pub mod node;
20pub use common::config;
21pub mod announce_cache;
22pub mod ifac;
23pub mod md5;
24pub mod pickle;
25#[cfg(feature = "iface-local")]
26pub mod remote_management;
27pub mod resource;
28pub mod rpc;
29pub mod serial;
30pub mod storage;
31pub use common::compressor;
32pub use common::link_manager;
33pub mod management;
34#[cfg(feature = "iface-local")]
35pub mod shared_client;
36pub use common::destination;
37pub mod discovery;
38pub mod holepunch;
39#[cfg(feature = "hooks")]
40pub mod provider_bridge;
41
42pub use config::RnsConfig;
43pub use destination::{AnnouncedIdentity, Destination, GroupKeyError};
44#[cfg(feature = "iface-backbone")]
45pub use driver::BackbonePeerPoolSettings;
46pub use driver::{AnnounceRateDefaults, Callbacks};
47pub use event::{
48    BackbonePeerHookEvent, BackbonePeerPoolMemberStatus, BackbonePeerPoolStatus,
49    BackbonePeerStateEntry, BlackholeInfo, Event, HookInfo, InterfaceStatsResponse, LinkInfoEntry,
50    LocalDestinationEntry, NextHopResponse, PathTableEntry, QueryRequest, QueryResponse,
51    RateTableEntry, ResourceInfoEntry, RuntimeConfigApplyMode, RuntimeConfigEntry,
52    RuntimeConfigError, RuntimeConfigErrorCode, RuntimeConfigSource, RuntimeConfigValue,
53    SingleInterfaceStat,
54};
55pub use ifac::IfacState;
56#[cfg(feature = "iface-auto")]
57pub use interface::auto::{AutoConfig, AutoFactory};
58#[cfg(feature = "iface-ax25-kiss")]
59pub use interface::ax25_kiss::{
60    decode_ui_frame as decode_ax25_ui_frame, encode_ui_frame as encode_ax25_ui_frame,
61    validate_address as validate_ax25_address, Ax25KissFactory,
62};
63#[cfg(feature = "iface-backbone")]
64pub use interface::backbone::{
65    BackboneClientConfig, BackboneClientInterfaceFactory, BackboneConfig, BackboneInterfaceFactory,
66};
67#[cfg(feature = "iface-i2p")]
68pub use interface::i2p::{I2pConfig, I2pFactory};
69#[cfg(feature = "iface-ax25-kiss")]
70pub use interface::kiss_iface::Ax25Address;
71#[cfg(feature = "iface-kiss")]
72pub use interface::kiss_iface::{KissFactory, KissIfaceConfig};
73#[cfg(feature = "iface-local")]
74pub use interface::local::{
75    LocalClientConfig, LocalClientFactory, LocalServerConfig, LocalServerFactory,
76};
77#[cfg(feature = "iface-pipe")]
78pub use interface::pipe::{PipeConfig, PipeFactory};
79pub use interface::registry::InterfaceRegistry;
80#[cfg(feature = "iface-rnode")]
81pub use interface::rnode::{RNodeConfig, RNodeFactory, RNodeMultiFactory, RNodeSubConfig};
82#[cfg(feature = "iface-serial")]
83pub use interface::serial_iface::{SerialFactory, SerialIfaceConfig};
84#[cfg(feature = "iface-tcp")]
85pub use interface::tcp::{TcpClientConfig, TcpClientFactory};
86#[cfg(feature = "iface-tcp")]
87pub use interface::tcp_server::{TcpServerConfig, TcpServerFactory};
88#[cfg(feature = "iface-udp")]
89pub use interface::udp::{UdpConfig, UdpFactory};
90#[cfg(all(feature = "iface-weave", target_os = "linux"))]
91pub use interface::weave::{
92    parse_device_frame as parse_weave_device_frame, WdclFrame, WeaveConfig, WeaveFactory,
93    WeaveInput, WeaveLogFrame, WeavePeerState, WeaveState,
94};
95pub use interface::{
96    InterfaceConfigData, InterfaceFactory, StartContext, StartResult, SubInterface,
97};
98pub use link_manager::{LinkManager, LinkManagerAction, RequestFailure, RequestResponse};
99pub use management::ManagementConfig;
100pub use node::{IfacConfig, InterfaceConfig, NodeConfig, RnsNode, SendError};
101#[cfg(feature = "hooks")]
102pub use provider_bridge::{
103    HookProviderEventEnvelope, OverflowPolicy, ProviderBridge, ProviderBridgeConfig,
104    ProviderEnvelope, ProviderMessage,
105};
106pub use resource::{
107    ReceivedResourceFile, ResourceReceiveMode, ResourceTransferError, ResourceTransferId,
108};
109pub use rpc::{RpcAddr, RpcClient, RpcServer};
110pub use serial::Parity;
111#[cfg(feature = "iface-local")]
112pub use shared_client::SharedClientConfig;
113pub use storage::{
114    FsRatchetStore, KnownDestination, RatchetCleanupStats, RatchetEntry, RatchetStore, StoragePaths,
115};
116
117// Re-export commonly used types from rns-core
118pub use rns_core::constants::{
119    MODE_ACCESS_POINT, MODE_BOUNDARY, MODE_FULL, MODE_GATEWAY, MODE_INTERNAL, MODE_POINT_TO_POINT,
120    MODE_ROAMING,
121};
122pub use rns_core::link::TeardownReason;
123pub use rns_core::transport::types::InterfaceId;
124pub use rns_core::types::{
125    DestHash, DestinationType, Direction, IdentityHash, LinkId, PacketHash, ProofStrategy,
126};