Move mesh networking logic into the SDK and fix lifecycle bugs

SDK:
- Add build_config/migrate_config, mesh_cidrs, route_generation, health
  and start_bridged; expose abi_info (capability revision 2).
- Add wait_routes long-poll; stop wakes waiters, and context_free now
  stops the network immediately instead of waiting for waiters to time out.

Hosts:
- Dart: waitRoutes(), MeshProxySession route watcher, ABI capability check.
- Android: fix a deadlock where every VPN request waited on its own
  single-thread worker; requests are now async, status is served from a
  snapshot, and combined mode reports Partial when the mesh stops.
- macOS helper: mesh-only unified mode stops when the mesh is lost;
  installed_subnet_routes excludes the overlay.
- Lab: restore Partial sessions, write migrated profiles back, remove the
  unreachable TOML import dialog; native test now connects via the form.

Docs updated accordingly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-10-15 18:17:42 +09:00
co-authored by Claude Opus 5.5
parent 29d236f3fe
commit dc1bfc99d2
34 changed files with 1724 additions and 715 deletions
+8
View File
@@ -4,6 +4,9 @@ mod system_probe;
use anyhow::{Result, ensure};
use meshport_easytier::Engine;
pub use meshport_easytier::parse_config as validate_config;
pub use meshport_easytier::{
MeshRoutes, build_config, check_local_overlap, migrate_config, overlay_projection,
};
pub use meshport_netstack::{TcpListener, TcpStream, UdpSocket};
use std::{
net::SocketAddr,
@@ -27,6 +30,11 @@ impl Network {
pub async fn stop(&self) {
self.engine.stop().await;
}
/// Destinations to route through this network; changes as advertisements
/// are accepted or withdrawn. Use instead of polling `snapshot`.
pub fn watch_mesh_routes(&self) -> tokio::sync::watch::Receiver<MeshRoutes> {
self.engine.watch_mesh_routes()
}
/// Removes this network's secret from diagnostic text before export.
pub fn redact_diagnostic(&self, text: &str) -> String {
self.engine.redact_diagnostic(text)