feat: refactor core+network+protocol: use platform abstractions,

transport vtable
This commit is contained in:
2026-02-19 11:32:30 -03:00
parent 63e5ac59ce
commit b466979bc7
33 changed files with 884 additions and 624 deletions

View File

@@ -17,6 +17,8 @@
//! ```
const std = @import("std");
const builtin = @import("builtin");
const is_wasm = builtin.target.cpu.arch == .wasm32 or builtin.target.cpu.arch == .wasm64;
const posix = std.posix;
const Allocator = std.mem.Allocator;
@@ -319,6 +321,8 @@ fn verifySourceAddress(src: *const posix.sockaddr.storage, expected_ip: [4]u8) b
/// Discover the default gateway IP address
pub fn discoverGateway() ![4]u8 {
if (is_wasm) return error.UnsupportedPlatform;
// Platform-specific gateway discovery
if (@import("builtin").os.tag == .macos or @import("builtin").os.tag == .ios) {
return discoverGatewayDarwin();