const std = @import("std");
pub fn main() void {
const addr = std.net.parseIp4("127.0.0.1") catch unreachable;
const ip_addr = std.net.Address.initIp4(addr, 80);
}
zig fmt . && zig build-exe main.zig && ./main
/usr/local/Cellar/zig/HEAD-057a5d4/lib/zig/std/net.zig:24:40: error: missing field: 'len'
.in = posix.sockaddr_in{
looks like len is a required arg: https://github.com/ziglang/zig/blob/057a5d4898f70c6a8169c99375fbb8631e539051/std/c/darwin.zig#L68-L74
And while we are at it; I'm surprised that the format method of std.net.Address;
https://github.com/ziglang/zig/blob/057a5d4898f70c6a8169c99375fbb8631e539051/std/net.zig#L57
has a signature that is unlike the one of std.fmt.format; https://github.com/ziglang/zig/blob/057a5d4898f70c6a8169c99375fbb8631e539051/std/fmt.zig#L16
std/net hasn't been updated in some time, so things might not work as intended or be broken.
I started work on my own version of IPv4/IPv6 structures not too long ago after seeing what was misisng in std/net (including no support for formatting IPv6 addresses or parsing short form IPv6 addresses). All that I've got left to do is parsing IPv4 comaptible/mapped IPv6 addresses (and probably a bunch more tests).
fixed in master