A Mac could install PF rules and advertise itself while IPv4 forwarding was still off. Check and enable forwarding when applying the offer and refresh the physical route when the uplink changes. Try the agent's existing privileges first. When an existing utun needs additional permission, the foreground tray or CLI can obtain an administrator grant scoped to the local UID and overlay subnet. Reconcile the current offer after the dialog so a withdrawal during authorization stays effective. A user agent denied a host utun can serve peers over bounded TCP, UDP and ICMP echo sockets bound to the physical interface. Keep host routes and ordinary local application traffic on the system-utun path. Preserve the saved choice for intentionally off-host setups and report readiness separately. Report exit selection directly to the selected peer over its authenticated session. Older peers appear for one minute following forwarded traffic. The optional announcement trailer remains compatible with control v8. Local IPC v29 carries the new status and authorization results. Keep the exit user count, left-aligned names and one-row scroll controls in a single fixed-height block alongside the network details. Show health and a small traffic trace on folded cards. Open desktop Devices at a usable width and keep the exit action clickable in its compact layout. Replace Android's per-card exit buttons with a fixed thumb-sized control. The chooser and Quick Settings share one list with a single local option, network groups, measured latency and an accessible confirmation sheet. Release the applications and packages as 1.0.9. On macOS, checked formatting, strict workspace Clippy and the workspace all-target test suite, including real encrypted agents and loopback TCP, UDP and ICMP. Ran the opt-in user-mode exit UDP round trip on a physical IPv4 interface. Verified the authorization scripts and syntax of their PF, sudoers and AppleScript components. The privileged two-utun kernel test is reserved for an isolated macOS runner. Rendered phone and desktop layouts in both themes, built the arm64 Android debug APK and cross- checked all workspace targets for Windows GNU.
89 lines
3.5 KiB
Rust
89 lines
3.5 KiB
Rust
//! The overlay interface: the one network interface an agent owns.
|
|
//!
|
|
//! One agent, one interface. It belongs to the system level rather than to
|
|
//! any protocol, and that is the whole point: a packet leaving it is routed
|
|
//! to whichever peer owns its destination address, over whichever protocol
|
|
//! currently has a link to that peer. Several protocols can be live at once
|
|
//! without arguing over who holds the address, because neither of them
|
|
//! holds it — the agent does.
|
|
//!
|
|
//! What lives here:
|
|
//!
|
|
//! * [`provision`] creates the interface and configures it, and removes it
|
|
//! again. Platform mechanics behind one decision function.
|
|
//! * [`hostrules`] installs the route and firewall allowance that let a
|
|
//! game's LAN discovery reach the interface, while broadcast is on.
|
|
//! * [`tun`] is the packet interface itself, real or in memory.
|
|
//! * [`packet`] reads just enough of an IP header to route by it.
|
|
//! * [`config`] names interfaces and describes addresses.
|
|
//!
|
|
//! What does not live here: encryption, peer discovery, and how a packet
|
|
//! actually reaches another machine. Those belong to a protocol plugin,
|
|
//! which this level hands packets to and takes packets from.
|
|
|
|
/// Why the overlay interface cannot be brought into the state asked for.
|
|
///
|
|
/// Its own error rather than the plugin one it used to borrow: this level
|
|
/// owns the interface now, and a plugin failing is a different event from
|
|
/// the interface failing.
|
|
#[derive(Debug, thiserror::Error)]
|
|
#[non_exhaustive]
|
|
pub enum OverlayError {
|
|
/// The interface cannot be created or configured right now, with the
|
|
/// reason and, where there is one, what to do about it.
|
|
#[error("overlay unavailable: {0}")]
|
|
Unavailable(String),
|
|
/// The OS denied creation of a macOS host utun.
|
|
#[cfg(target_os = "macos")]
|
|
#[error("overlay unavailable: {0}")]
|
|
UtunDenied(String),
|
|
/// Anything else.
|
|
#[error("{0}")]
|
|
Other(String),
|
|
}
|
|
|
|
pub mod broadcast;
|
|
pub mod config;
|
|
#[cfg(any(windows, target_os = "macos", test))]
|
|
mod egress;
|
|
pub mod exit;
|
|
mod exit_activity;
|
|
pub mod hostrules;
|
|
pub mod interface;
|
|
pub mod packet;
|
|
pub mod provision;
|
|
pub mod router;
|
|
pub mod source;
|
|
pub mod tun;
|
|
|
|
pub use config::{Cidr, DEFAULT_INTERFACE_PREFIX, MAX_INTERFACE_NAME_LEN, interface_name};
|
|
pub use exit::{ExitRulesReport, RuleSetReport};
|
|
pub use hostrules::{
|
|
BroadcastHostRules, BroadcastRulesPlan, BroadcastRulesReport, ExitHostPlan, ExitHostReport,
|
|
ExitHostRules, MockExitRules, MockHostRules, RuleOutcome, UnsupportedHostRules,
|
|
};
|
|
pub use interface::{Counters, Interface, PacketCarrier, Rejected};
|
|
pub use packet::IpHeader;
|
|
pub use provision::{
|
|
Changes, InterfacePlan, InterfaceProvisioner, InterfaceState, LinkKind, ManagedTunFactory,
|
|
MockHost, MockProvisioner, Privilege, Provisioned, UnsupportedProvisioner, plan_changes,
|
|
probe_net_admin,
|
|
};
|
|
pub use router::{ExitPolicy, NetworkRoutes, Route, RouteError, RoutingTable};
|
|
pub use tun::{MemoryTun, MemoryTunFactory, TunDevice, TunFactory, TunRequest, address_is_local};
|
|
|
|
#[cfg(all(feature = "tun-device", target_os = "linux"))]
|
|
pub use hostrules::LinuxHostRules;
|
|
#[cfg(all(feature = "tun-device", target_os = "macos"))]
|
|
pub use hostrules::MacosHostRules;
|
|
#[cfg(all(feature = "tun-device", target_os = "windows"))]
|
|
pub use hostrules::WindowsHostRules;
|
|
#[cfg(all(feature = "tun-device", target_os = "linux"))]
|
|
pub use provision::NetlinkProvisioner;
|
|
|
|
#[cfg(all(feature = "tun-device", target_os = "macos"))]
|
|
pub use provision::UtunProvisioner;
|
|
|
|
#[cfg(all(feature = "tun-device", target_os = "windows"))]
|
|
pub use provision::WintunProvisioner;
|