authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-02-04 18:09:46 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-02-04 18:09:46 -08:00
log69ac8a251783363d5299df684d947474be60793a
treed831b952927063a7fe0988635f0be8b1bb1e98c4
parent864fd0043032051f066882ee7252a0fb60e04219

add getaddrinfo/freeaddrinfo


1 files changed, 8 insertions(+), 0 deletions(-)

net.zig+8
...@@ -87,6 +87,8 @@ pub const Address = extern union {...@@ -87,6 +87,8 @@ pub const Address = extern union {
87pub const Ip4Address = extern struct {87pub const Ip4Address = extern struct {
88 sa: sys.struct_sockaddr_in,88 sa: sys.struct_sockaddr_in,
8989
90 pub const SockAddr = sys.struct_sockaddr_in;
91
90 pub fn init(addr: [4]u8, port: u16) Ip4Address {92 pub fn init(addr: [4]u8, port: u16) Ip4Address {
91 return Ip4Address{93 return Ip4Address{
92 .sa = .{94 .sa = .{
...@@ -100,6 +102,8 @@ pub const Ip4Address = extern struct {...@@ -100,6 +102,8 @@ pub const Ip4Address = extern struct {
100pub const Ip6Address = extern struct {102pub const Ip6Address = extern struct {
101 sa: sys.struct_sockaddr_in6,103 sa: sys.struct_sockaddr_in6,
102104
105 pub const SockAddr = sys.struct_sockaddr_in6;
106
103 pub fn init(addr: [8]u16, port: u16) Ip6Address {107 pub fn init(addr: [8]u16, port: u16) Ip6Address {
104 return Ip6Address{108 return Ip6Address{
105 .sa = .{109 .sa = .{
...@@ -197,3 +201,7 @@ pub const Server = struct {...@@ -197,3 +201,7 @@ pub const Server = struct {
197 }201 }
198 };202 };
199};203};
204
205pub const getaddrinfo = sys.getaddrinfo;
206
207pub const freeaddrinfo = sys.freeaddrinfo;