Source
pub const PF = if (builtin.abi.isAndroid()) struct {
pub const UNSPEC = AF.UNSPEC;
pub const UNIX = AF.UNIX;
pub const LOCAL = AF.LOCAL;
pub const INET = AF.INET;
pub const AX25 = AF.AX25;
pub const IPX = AF.IPX;
pub const APPLETALK = AF.APPLETALK;
pub const NETROM = AF.NETROM;
pub const BRIDGE = AF.BRIDGE;
pub const ATMPVC = AF.ATMPVC;
pub const X25 = AF.X25;
pub const PF_INET6 = AF.INET6;
pub const PF_ROSE = AF.ROSE;
pub const PF_DECnet = AF.DECnet;
pub const PF_NETBEUI = AF.NETBEUI;
pub const PF_SECURITY = AF.SECURITY;
pub const PF_KEY = AF.KEY;
pub const PF_NETLINK = AF.NETLINK;
pub const PF_ROUTE = AF.ROUTE;
pub const PF_PACKET = AF.PACKET;
pub const PF_ASH = AF.ASH;
pub const PF_ECONET = AF.ECONET;
pub const PF_ATMSVC = AF.ATMSVC;
pub const PF_RDS = AF.RDS;
pub const PF_SNA = AF.SNA;
pub const PF_IRDA = AF.IRDA;
pub const PF_PPPOX = AF.PPPOX;
pub const PF_WANPIPE = AF.WANPIPE;
pub const PF_LLC = AF.LLC;
pub const PF_CAN = AF.CAN;
pub const PF_TIPC = AF.TIPC;
pub const PF_BLUETOOTH = AF.BLUETOOTH;
pub const PF_IUCV = AF.IUCV;
pub const PF_RXRPC = AF.RXRPC;
pub const PF_ISDN = AF.ISDN;
pub const PF_PHONET = AF.PHONET;
pub const PF_IEEE802154 = AF.IEEE802154;
pub const PF_CAIF = AF.CAIF;
pub const PF_ALG = AF.ALG;
pub const PF_NFC = AF.NFC;
pub const PF_VSOCK = AF.VSOCK;
pub const PF_KCM = AF.KCM;
pub const PF_QIPCRTR = AF.QIPCRTR;
pub const PF_MAX = AF.MAX;
} else switch (native_os) {
.linux, .emscripten => linux.PF,
.macos, .ios, .tvos, .watchos, .visionos => struct {
pub const UNSPEC = AF.UNSPEC;
pub const LOCAL = AF.LOCAL;
pub const UNIX = PF.LOCAL;
pub const INET = AF.INET;
pub const IMPLINK = AF.IMPLINK;
pub const PUP = AF.PUP;
pub const CHAOS = AF.CHAOS;
pub const NS = AF.NS;
pub const ISO = AF.ISO;
pub const OSI = AF.ISO;
pub const ECMA = AF.ECMA;
pub const DATAKIT = AF.DATAKIT;
pub const CCITT = AF.CCITT;
pub const SNA = AF.SNA;
pub const DECnet = AF.DECnet;
pub const DLI = AF.DLI;
pub const LAT = AF.LAT;
pub const HYLINK = AF.HYLINK;
pub const APPLETALK = AF.APPLETALK;
pub const ROUTE = AF.ROUTE;
pub const LINK = AF.LINK;
pub const XTP = AF.XTP;
pub const COIP = AF.COIP;
pub const CNT = AF.CNT;
pub const SIP = AF.SIP;
pub const IPX = AF.IPX;
pub const RTIP = AF.RTIP;
pub const PIP = AF.PIP;
pub const ISDN = AF.ISDN;
pub const KEY = AF.KEY;
pub const INET6 = AF.INET6;
pub const NATM = AF.NATM;
pub const SYSTEM = AF.SYSTEM;
pub const NETBIOS = AF.NETBIOS;
pub const PPP = AF.PPP;
pub const MAX = AF.MAX;
},
.freebsd => struct {
pub const UNSPEC = AF.UNSPEC;
pub const LOCAL = AF.LOCAL;
pub const UNIX = PF.LOCAL;
pub const INET = AF.INET;
pub const IMPLINK = AF.IMPLINK;
pub const PUP = AF.PUP;
pub const CHAOS = AF.CHAOS;
pub const NETBIOS = AF.NETBIOS;
pub const ISO = AF.ISO;
pub const OSI = AF.ISO;
pub const ECMA = AF.ECMA;
pub const DATAKIT = AF.DATAKIT;
pub const CCITT = AF.CCITT;
pub const DECnet = AF.DECnet;
pub const DLI = AF.DLI;
pub const LAT = AF.LAT;
pub const HYLINK = AF.HYLINK;
pub const APPLETALK = AF.APPLETALK;
pub const ROUTE = AF.ROUTE;
pub const LINK = AF.LINK;
pub const XTP = AF.pseudo_XTP;
pub const COIP = AF.COIP;
pub const CNT = AF.CNT;
pub const SIP = AF.SIP;
pub const IPX = AF.IPX;
pub const RTIP = AF.pseudo_RTIP;
pub const PIP = AF.pseudo_PIP;
pub const ISDN = AF.ISDN;
pub const KEY = AF.pseudo_KEY;
pub const INET6 = AF.pseudo_INET6;
pub const NATM = AF.NATM;
pub const ATM = AF.ATM;
pub const NETGRAPH = AF.NETGRAPH;
pub const SLOW = AF.SLOW;
pub const SCLUSTER = AF.SCLUSTER;
pub const ARP = AF.ARP;
pub const BLUETOOTH = AF.BLUETOOTH;
pub const IEEE80211 = AF.IEEE80211;
pub const INET_SDP = AF.INET_SDP;
pub const INET6_SDP = AF.INET6_SDP;
pub const MAX = AF.MAX;
},
.solaris, .illumos => struct {
pub const UNSPEC = AF.UNSPEC;
pub const UNIX = AF.UNIX;
pub const LOCAL = UNIX;
pub const FILE = UNIX;
pub const INET = AF.INET;
pub const IMPLINK = AF.IMPLINK;
pub const PUP = AF.PUP;
pub const CHAOS = AF.CHAOS;
pub const NS = AF.NS;
pub const NBS = AF.NBS;
pub const ECMA = AF.ECMA;
pub const DATAKIT = AF.DATAKIT;
pub const CCITT = AF.CCITT;
pub const SNA = AF.SNA;
pub const DECnet = AF.DECnet;
pub const DLI = AF.DLI;
pub const LAT = AF.LAT;
pub const HYLINK = AF.HYLINK;
pub const APPLETALK = AF.APPLETALK;
pub const NIT = AF.NIT;
pub const @"802" = AF.@"802";
pub const OSI = AF.OSI;
pub const X25 = AF.X25;
pub const OSINET = AF.OSINET;
pub const GOSIP = AF.GOSIP;
pub const IPX = AF.IPX;
pub const ROUTE = AF.ROUTE;
pub const LINK = AF.LINK;
pub const INET6 = AF.INET6;
pub const KEY = AF.KEY;
pub const NCA = AF.NCA;
pub const POLICY = AF.POLICY;
pub const TRILL = AF.TRILL;
pub const PACKET = AF.PACKET;
pub const LX_NETLINK = AF.LX_NETLINK;
pub const MAX = AF.MAX;
},
.netbsd => struct {
pub const UNSPEC = AF.UNSPEC;
pub const LOCAL = AF.LOCAL;
pub const UNIX = PF.LOCAL;
pub const INET = AF.INET;
pub const IMPLINK = AF.IMPLINK;
pub const PUP = AF.PUP;
pub const CHAOS = AF.CHAOS;
pub const NS = AF.NS;
pub const ISO = AF.ISO;
pub const OSI = AF.ISO;
pub const ECMA = AF.ECMA;
pub const DATAKIT = AF.DATAKIT;
pub const CCITT = AF.CCITT;
pub const SNA = AF.SNA;
pub const DECnet = AF.DECnet;
pub const DLI = AF.DLI;
pub const LAT = AF.LAT;
pub const HYLINK = AF.HYLINK;
pub const APPLETALK = AF.APPLETALK;
pub const OROUTE = AF.OROUTE;
pub const LINK = AF.LINK;
pub const COIP = AF.COIP;
pub const CNT = AF.CNT;
pub const INET6 = AF.INET6;
pub const IPX = AF.IPX;
pub const ISDN = AF.ISDN;
pub const E164 = AF.E164;
pub const NATM = AF.NATM;
pub const ARP = AF.ARP;
pub const BLUETOOTH = AF.BLUETOOTH;
pub const MPLS = AF.MPLS;
pub const ROUTE = AF.ROUTE;
pub const CAN = AF.CAN;
pub const ETHER = AF.ETHER;
pub const MAX = AF.MAX;
},
.dragonfly => struct {
pub const INET6 = AF.INET6;
pub const IMPLINK = AF.IMPLINK;
pub const ROUTE = AF.ROUTE;
pub const ISO = AF.ISO;
pub const PIP = AF.pseudo_PIP;
pub const CHAOS = AF.CHAOS;
pub const DATAKIT = AF.DATAKIT;
pub const INET = AF.INET;
pub const APPLETALK = AF.APPLETALK;
pub const SIP = AF.SIP;
pub const OSI = AF.ISO;
pub const CNT = AF.CNT;
pub const LINK = AF.LINK;
pub const HYLINK = AF.HYLINK;
pub const MAX = AF.MAX;
pub const KEY = AF.pseudo_KEY;
pub const PUP = AF.PUP;
pub const COIP = AF.COIP;
pub const SNA = AF.SNA;
pub const LOCAL = AF.LOCAL;
pub const NETBIOS = AF.NETBIOS;
pub const NATM = AF.NATM;
pub const BLUETOOTH = AF.BLUETOOTH;
pub const UNSPEC = AF.UNSPEC;
pub const NETGRAPH = AF.NETGRAPH;
pub const ECMA = AF.ECMA;
pub const IPX = AF.IPX;
pub const DLI = AF.DLI;
pub const ATM = AF.ATM;
pub const CCITT = AF.CCITT;
pub const ISDN = AF.ISDN;
pub const RTIP = AF.pseudo_RTIP;
pub const LAT = AF.LAT;
pub const UNIX = PF.LOCAL;
pub const XTP = AF.pseudo_XTP;
pub const DECnet = AF.DECnet;
},
.haiku => struct {
pub const UNSPEC = AF.UNSPEC;
pub const INET = AF.INET;
pub const ROUTE = AF.ROUTE;
pub const LINK = AF.LINK;
pub const INET6 = AF.INET6;
pub const LOCAL = AF.LOCAL;
pub const UNIX = AF.UNIX;
pub const BLUETOOTH = AF.BLUETOOTH;
},
.openbsd => struct {
pub const UNSPEC = AF.UNSPEC;
pub const LOCAL = AF.LOCAL;
pub const UNIX = AF.UNIX;
pub const INET = AF.INET;
pub const APPLETALK = AF.APPLETALK;
pub const INET6 = AF.INET6;
pub const DECnet = AF.DECnet;
pub const KEY = AF.KEY;
pub const ROUTE = AF.ROUTE;
pub const SNA = AF.SNA;
pub const MPLS = AF.MPLS;
pub const BLUETOOTH = AF.BLUETOOTH;
pub const ISDN = AF.ISDN;
pub const MAX = AF.MAX;
},
// https://github.com/SerenityOS/serenity/blob/ac44ec5ebc707f9dd0c3d4759a1e17e91db5d74f/Kernel/API/POSIX/sys/socket.h#L24-L29
.serenity => struct {
pub const LOCAL = AF.LOCAL;
pub const UNIX = AF.LOCAL;
pub const INET = AF.INET;
pub const INET6 = AF.INET6;
pub const UNSPEC = AF.UNSPEC;
pub const MAX = AF.MAX;
},
else => void,
}