feat: 完成 M2 mosh(LAN + tsnet 端到端验证)

- mosh(blinksh/ios C++)+protobuf-lite 交叉编译为 MoshCore.xcframework
  (CommonCrypto 后端、含 arm64 模拟器 slice;绕 autotools 用 CMake 直编 + 手写 config.h)
- tsnet 桥新增 UDP relay(StartMoshRelay:loopback↔tsnet.Dial 逐包搬运)
- MoshSession(pipe↔FILE*/pthread/SIGWINCH)+ MoshConnectScanner(TXCore,+4 单测=39)
- SSHTerminalModel 编排:SSH 引导 mosh-server→解析 MOSH CONNECT→relay→mosh 接管
- LAN 直连 + mosh-over-tsnet 均端到端验证通过,R1(tsnet UDP 数据报语义) 证伪

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
kid
2026-07-24 16:14:40 +08:00
parent aa92d0e676
commit 32520f09e0
1232 changed files with 728138 additions and 37 deletions

View File

@@ -0,0 +1,4 @@
module CMosh {
header "moshiosbridge.h"
export *
}

View File

@@ -0,0 +1,17 @@
/* CMosh — Swift 可 import 的 mosh 客户端入口头(库符号来自 MoshCore.xcframework
* 对应 vendor/mosh/src/frontend/moshiosbridge.h保持签名一致。
* mosh_main 是阻塞式主循环:读 f_in(用户输入字节)、写 f_out(终端输出字节)
* 经 UDP 连 ip:portmosh SSPAES-128-OCBwindow_size 供 SIGWINCH resize。 */
#ifndef CMOSH_MOSHIOSBRIDGE_H
#define CMOSH_MOSHIOSBRIDGE_H
#include <stdio.h>
#include <sys/ioctl.h>
#if __cplusplus
extern "C"
#endif
int mosh_main(FILE *f_in, FILE *f_out, struct winsize *window_size,
const char *ip, const char *port, const char *key, const char *predict_mode);
#endif /* CMOSH_MOSHIOSBRIDGE_H */

View File

@@ -0,0 +1,3 @@
// CMosh 是 mosh_main 头文件 + modulemap 的载体 target供 `import CMosh`
// 实际库符号来自 MoshCore.xcframework静态库。此处仅需一个非空翻译单元。
typedef int cmosh_shim_placeholder;