Skip to main content

Crate nexcore_network

Crate nexcore_network 

Source
Expand description

§nexcore-network — NexCore OS Networking Subsystem

Tier: T3 (Σ + μ + ∂ + ς + σ + π + ∝ + N + ν + κ + → + λ + ∃)

Complete networking stack for NexCore OS sitting above nexcore-pal::Network. Manages interfaces, connections, DNS, routing, firewall rules, traffic monitoring, and TLS certificate trust stores across all three form factors (watch, phone, desktop).

§Module Architecture

ModuleTierDominantPurpose
interfaceT2-CΣ + μ + ∃Network interface abstraction
connectionT2-Cς + σ + ∂Connection state machine
dnsT2-Cμ + π + νDNS resolver with caching
firewallT2-C∂ + κ + →Packet filtering rules
routeT2-C→ + κ + λRouting table with prefix matching
monitorT2-CN + ν + σBandwidth, latency, and quality tracking
certificateT2-C∂ + π + ∝TLS certificate trust store

§Example

use nexcore_network::{Interface, InterfaceType, IpAddr, Connection, ConnectionState};

// Create a WiFi interface
let iface = Interface::new("wlan0", "wlan0", InterfaceType::WiFi)
    .up()
    .with_address(IpAddr::v4(192, 168, 1, 100));

assert!(iface.is_up);
assert_eq!(iface.interface_type, InterfaceType::WiFi);

// Create a connection tracking its lifecycle
let conn = Connection::new(iface.id.clone(), iface.interface_type, "HomeWiFi");
assert_eq!(conn.state(), ConnectionState::Disconnected);

Re-exports§

pub use interface::Interface;
pub use interface::InterfaceId;
pub use interface::InterfaceType;
pub use interface::IpAddr;
pub use connection::Connection;
pub use connection::ConnectionError;
pub use connection::ConnectionState;
pub use connection::FailureReason;
pub use dns::DnsCacheStats;
pub use dns::DnsRecord;
pub use dns::DnsResolver;
pub use firewall::Firewall;
pub use firewall::FirewallRule;
pub use firewall::PacketDisposition;
pub use firewall::PortRange;
pub use firewall::Protocol;
pub use firewall::TrafficDirection;
pub use firewall::Action;Deprecated
pub use route::Route;
pub use route::RoutingTable;
pub use monitor::ConnectionQuality;
pub use monitor::InterfaceMonitor;
pub use monitor::LatencySample;
pub use monitor::NetworkMonitor;
pub use monitor::TrafficCounters;
pub use certificate::CertFingerprint;
pub use certificate::CertStatus;
pub use certificate::CertStore;
pub use certificate::Certificate;
pub use certificate::TrustLevel;

Modules§

certificate
TLS certificate management — trust store for secure connections.
composites
Composite Types
connection
Connection state machine — the lifecycle of a network connection.
dns
DNS resolver with caching.
firewall
Firewall — packet filtering rules for OS-level network security.
interface
Network interface abstraction.
monitor
Traffic monitoring — bandwidth, latency, and connection quality tracking.
prelude
Prelude — nexcore-network
route
Routing table — determines which interface handles which traffic.