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
+5 -3
View File
@@ -20,7 +20,7 @@ ARM64 Rust 原生库、JNI 桥接、Android debug/release APK 构建通过。OPP
- 穿透详细日志 opt-in 采集、保留节点 ID、过滤其他应用模块日志。
- Dart后台isolate → C ABI → Rust → 两节点EasyTier UDP通信,校验字节与来源。
- Flutter widget 初始未连接状态、设置入口。
- Flutter TOML 导入 → 实际原生引擎启动 → 状态显示 → 断开连接。
- Flutter 组网表单填写并保存 → 概览连接 → 实际原生引擎启动 → 状态显示 → 断开连接(`native_connect_test.dart`)。
- C 示例编译并读取原生实例状态。
- Flutter Redmi_AX6 打洞直连显示 7.5 ms 实测 RTT,排除错误中继标签。
- Flutter 节点 RTT、路由估算、流量速率和中继统计范围显示测试;已有直连但实际路由经中继时正确区分。
@@ -36,8 +36,10 @@ scripts/cargo-local.sh clippy --workspace --all-targets --no-deps --locked -- -D
cd apps/meshport_lab
flutter analyze
flutter test
# 包含真实原生引擎的界面测试(先构建 Rust 库)
flutter test --dart-define=MESHPORT_LIBRARY="$(cd ../.. && pwd)/target/debug/libmeshport_ffi.dylib"
# 包含真实原生引擎的测试(先构建 Rust 库)。未设置环境变量时这些测试显示为 skip。
MESHPORT_LIBRARY="$(cd ../.. && pwd)/target/debug/libmeshport_ffi.dylib" \
MESHPORT_PROXY_LIBRARY="$(cd ../.. && pwd)/target/debug/libmeshport_proxy.dylib" \
flutter test
dart run tool/native_smoke.dart ../../target/debug/libmeshport_ffi.dylib
```