- Split TUN implementation into platform-specific files: - tun_if.c: Common code (queues, callbacks, statistics) - tun_linux.c: Linux TUN/TAP implementation (/dev/net/tun + ioctl) - tun_windows.c: Windows Wintun implementation (wintun.dll + IP Helper) - Update tun_if.h with platform abstraction layer: - tun_platform_init/cleanup/read/write/get_poll_fd - Platform handles: fd (Linux), WINTUN handles (Windows) - Windows implementation features: - Dynamic loading of wintun.dll with graceful error handling - IP Helper API for IP address and MTU configuration - HANDLE-based uasync integration - Clear error message if wintun.dll is not found - Update build system: - configure.ac: Detect Windows (mingw/msys/cygwin) - src/Makefile.am: Conditional compilation of tun_linux/tun_windows - tests/Makefile.am: Link platform-specific TUN objects - Add wintun.dll and wintun.h to lib/ directory - All 22 tests pass on Linux - Ready for MSYS2 UCRT64 Windows build
418 KiB
418 KiB