76d8e57a44
- PacketTunnel 链 Libbox.xcframework(静态,只Link不Embed)+ NetworkExtension + SystemConfiguration + libresolv.tbd + UIKit(libbox iOS 引用 UIApplication); OTHER_LDFLAGS="" 切 CocoaPods 继承,FRAMEWORK_SEARCH_PATHS 指 Frameworks/ - 桥接头手动声明 sockaddr_ctl/ctl_info(iOS SDK 无 kern_control.h,稳定内核 ABI) - 部署目标 iOS 12→14(os.Logger 需 14;低版老机不再兼容,用户拍板) - 修预存脚手架坑: Podfile 删悬空 RunnerTests; Info.plist 移出 Resources(双产出); Runner 构建阶段重排(Embed App Extensions 前置, Thin Binary 殿后) 解依赖环 - 验证: flutter build ios 通过, C1 Provider 编译通过, otool -L 扩展零外部 @rpath Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
35 lines
944 B
C
35 lines
944 B
C
//
|
||
// PacketTunnel-Bridging-Header.h
|
||
// 暴露内核控制 (kern_control) 类型给 Swift。
|
||
//
|
||
// iOS SDK 不发布 <sys/kern_control.h> / <sys/sys_domain.h>(macOS 才有),
|
||
// 但 sockaddr_ctl / ctl_info 是稳定的内核 ABI(WireGuard / Tailscale 的 iOS 端
|
||
// 同样手动声明)。PangolinPlatformInterface.tunFd() 扫描 utun 控制 fd 需要它们。
|
||
// 字段布局与 XNU bsd/sys/kern_control.h 一致,勿改。
|
||
//
|
||
|
||
#ifndef PacketTunnel_Bridging_Header_h
|
||
#define PacketTunnel_Bridging_Header_h
|
||
|
||
#include <sys/types.h>
|
||
#include <sys/socket.h>
|
||
#include <sys/ioctl.h>
|
||
|
||
#define PANGOLIN_MAX_KCTL_NAME 96
|
||
|
||
struct ctl_info {
|
||
u_int32_t ctl_id;
|
||
char ctl_name[PANGOLIN_MAX_KCTL_NAME];
|
||
};
|
||
|
||
struct sockaddr_ctl {
|
||
u_char sc_len;
|
||
u_char sc_family;
|
||
u_int16_t ss_sysaddr;
|
||
u_int32_t sc_id;
|
||
u_int32_t sc_unit;
|
||
u_int32_t sc_reserved[5];
|
||
};
|
||
|
||
#endif /* PacketTunnel_Bridging_Header_h */
|