use crate::{sa_family_t, socklen_t, ssize_t};
pub const SOCK_STREAM: i32 = 1;
pub const SOCK_DGRAM: i32 = 2;
pub const SOCK_RAW: i32 = 3;
pub const SOCK_RDM: i32 = 4;
pub const SOCK_SEQPACKET: i32 = 5;
pub const SOCK_CLOEXEC: i32 = 0x1000_0000;
pub const SOCK_NONBLOCK: i32 = 0x2000_0000;
pub const ACCEPT4_INHERIT: i32 = 0x1;
pub const ACCEPT4_COMPAT: i32 = 0x2;
pub const SO_DEBUG: i32 = 0x0000_0001;
pub const SO_ACCEPTCONN: i32 = 0x0000_0002;
pub const SO_REUSEADDR: i32 = 0x0000_0004;
pub const SO_KEEPALIVE: i32 = 0x0000_0008;
pub const SO_DONTROUTE: i32 = 0x0000_0010;
pub const SO_BROADCAST: i32 = 0x0000_0020;
pub const SO_USELOOPBACK: i32 = 0x0000_0040;
pub const SO_LINGER: i32 = 0x0000_0080;
pub const SO_OOBINLINE: i32 = 0x0000_0100;
pub const SO_REUSEPORT: i32 = 0x0000_0200;
pub const SO_TIMESTAMP: i32 = 0x0000_0400;
pub const SO_NOSIGPIPE: i32 = 0x0000_0800;
pub const SO_ACCEPTFILTER: i32 = 0x0000_1000;
pub const SO_BINTIME: i32 = 0x0000_2000;
pub const SO_NO_OFFLOAD: i32 = 0x0000_4000;
pub const SO_NO_DDP: i32 = 0x0000_8000;
pub const SO_REUSEPORT_LB: i32 = 0x0001_0000;
pub const SO_RERROR: i32 = 0x0002_0000;
pub const SO_SNDBUF: i32 = 0x1001;
pub const SO_RCVBUF: i32 = 0x1002;
pub const SO_SNDLOWAT: i32 = 0x1003;
pub const SO_RCVLOWAT: i32 = 0x1004;
pub const SO_SNDTIMEO: i32 = 0x1005;
pub const SO_RCVTIMEO: i32 = 0x1006;
pub const SO_ERROR: i32 = 0x1007;
pub const SO_TYPE: i32 = 0x1008;
pub const SO_LABEL: i32 = 0x1009;
pub const SO_PEERLABEL: i32 = 0x1010;
pub const SO_LISTENQLIMIT: i32 = 0x1011;
pub const SO_LISTENQLEN: i32 = 0x1012;
pub const SO_LISTENINCQLEN: i32 = 0x1013;
pub const SO_SETFIB: i32 = 0x1014;
pub const SO_USER_COOKIE: i32 = 0x1015;
pub const SO_PROTOCOL: i32 = 0x1016;
pub const SO_PROTOTYPE: i32 = SO_PROTOCOL;
pub const SO_TS_CLOCK: i32 = 0x1017;
pub const SO_MAX_PACING_RATE: i32 = 0x1018;
pub const SO_DOMAIN: i32 = 0x1019;
pub const SO_TS_REALTIME_MICRO: i32 = 0;
pub const SO_TS_BINTIME: i32 = 1;
pub const SO_TS_REALTIME: i32 = 2;
pub const SO_TS_MONOTONIC: i32 = 3;
pub const SO_TS_DEFAULT: i32 = SO_TS_REALTIME_MICRO;
pub const SO_TS_CLOCK_MAX: i32 = SO_TS_MONOTONIC;
#[allow(overflowing_literals)]
pub const SO_VENDOR: i32 = 0x8000_0000;
pub const SOL_SOCKET: i32 = 0xffff;
pub const AF_UNSPEC: i32 = 0;
pub const AF_LOCAL: i32 = AF_UNIX;
pub const AF_UNIX: i32 = 1;
pub const AF_INET: i32 = 2;
pub const AF_IMPLINK: i32 = 3;
pub const AF_PUP: i32 = 4;
pub const AF_CHAOS: i32 = 5;
pub const AF_NETBIOS: i32 = 6;
pub const AF_ISO: i32 = 7;
pub const AF_OSI: i32 = AF_ISO;
pub const AF_ECMA: i32 = 8;
pub const AF_DATAKIT: i32 = 9;
pub const AF_CCITT: i32 = 10;
pub const AF_SNA: i32 = 11;
pub const AF_DECNET: i32 = 12;
pub const AF_DLI: i32 = 13;
pub const AF_LAT: i32 = 14;
pub const AF_HYLINK: i32 = 15;
pub const AF_APPLETALK: i32 = 16;
pub const AF_ROUTE: i32 = 17;
pub const AF_LINK: i32 = 18;
pub const PSEUDO_AF_XTP: i32 = 19;
pub const AF_COIP: i32 = 20;
pub const AF_CNT: i32 = 21;
pub const PSEUDO_AF_RTIP: i32 = 22;
pub const AF_IPX: i32 = 23;
pub const AF_SIP: i32 = 24;
pub const PSEUDO_AF_PIP: i32 = 25;
pub const AF_ISDN: i32 = 26;
pub const AF_E164: i32 = AF_ISDN;
pub const PSEUDO_AF_KEY: i32 = 27;
pub const AF_INET6: i32 = 28;
pub const AF_NATM: i32 = 29;
pub const AF_ATM: i32 = 30;
pub const PSEUDO_AF_HDRCMPLT: i32 = 31;
pub const AF_NETGRAPH: i32 = 32;
pub const AF_SLOW: i32 = 33;
pub const AF_SCLUSTER: i32 = 34;
pub const AF_ARP: i32 = 35;
pub const AF_BLUETOOTH: i32 = 36;
pub const AF_IEEE80211: i32 = 37;
pub const AF_INET_SDP: i32 = 40;
pub const AF_INET6_SDP: i32 = 42;
pub const AF_HYPERV: i32 = 43;
pub const AF_MAX: i32 = 43;
pub const AF_VENDOR00: i32 = 39;
pub const AF_VENDOR01: i32 = 41;
pub const AF_VENDOR03: i32 = 45;
pub const AF_VENDOR04: i32 = 47;
pub const AF_VENDOR05: i32 = 49;
pub const AF_VENDOR06: i32 = 51;
pub const AF_VENDOR07: i32 = 53;
pub const AF_VENDOR08: i32 = 55;
pub const AF_VENDOR09: i32 = 57;
pub const AF_VENDOR10: i32 = 59;
pub const AF_VENDOR11: i32 = 61;
pub const AF_VENDOR12: i32 = 63;
pub const AF_VENDOR13: i32 = 65;
pub const AF_VENDOR14: i32 = 67;
pub const AF_VENDOR15: i32 = 69;
pub const AF_VENDOR16: i32 = 71;
pub const AF_VENDOR17: i32 = 73;
pub const AF_VENDOR18: i32 = 75;
pub const AF_VENDOR19: i32 = 77;
pub const AF_VENDOR20: i32 = 79;
pub const AF_VENDOR21: i32 = 81;
pub const AF_VENDOR22: i32 = 83;
pub const AF_VENDOR23: i32 = 85;
pub const AF_VENDOR24: i32 = 87;
pub const AF_VENDOR25: i32 = 89;
pub const AF_VENDOR26: i32 = 91;
pub const AF_VENDOR27: i32 = 93;
pub const AF_VENDOR28: i32 = 95;
pub const AF_VENDOR29: i32 = 97;
pub const AF_VENDOR30: i32 = 99;
pub const AF_VENDOR31: i32 = 101;
pub const AF_VENDOR32: i32 = 103;
pub const AF_VENDOR33: i32 = 105;
pub const AF_VENDOR34: i32 = 107;
pub const AF_VENDOR35: i32 = 109;
pub const AF_VENDOR36: i32 = 111;
pub const AF_VENDOR37: i32 = 113;
pub const AF_VENDOR38: i32 = 115;
pub const AF_VENDOR39: i32 = 117;
pub const AF_VENDOR40: i32 = 119;
pub const AF_VENDOR41: i32 = 121;
pub const AF_VENDOR42: i32 = 123;
pub const AF_VENDOR43: i32 = 125;
pub const AF_VENDOR44: i32 = 127;
pub const AF_VENDOR45: i32 = 129;
pub const AF_VENDOR46: i32 = 131;
pub const AF_VENDOR47: i32 = 133;
#[repr(C)]
#[derive(Debug, Default)]
pub struct sockaddr_t {
pub sa_len: u8,
pub sa_family: sa_family_t,
pub sa_data: [u8; 14],
}
pub const SOCK_MAXADDRLEN: i32 = 255;
pub struct sockproto_t {
pub sp_family: u16,
pub sp_protocol: u16,
}
pub const PF_UNSPEC: i32 = AF_UNSPEC;
pub const PF_LOCAL: i32 = AF_LOCAL;
pub const PF_UNIX: i32 = PF_LOCAL;
pub const PF_INET: i32 = AF_INET;
pub const PF_IMPLINK: i32 = AF_IMPLINK;
pub const PF_PUP: i32 = AF_PUP;
pub const PF_CHAOS: i32 = AF_CHAOS;
pub const PF_NETBIOS: i32 = AF_NETBIOS;
pub const PF_ISO: i32 = AF_ISO;
pub const PF_OSI: i32 = AF_ISO;
pub const PF_ECMA: i32 = AF_ECMA;
pub const PF_DATAKIT: i32 = AF_DATAKIT;
pub const PF_CCITT: i32 = AF_CCITT;
pub const PF_SNA: i32 = AF_SNA;
pub const PF_DECNET: i32 = AF_DECNET;
pub const PF_DLI: i32 = AF_DLI;
pub const PF_LAT: i32 = AF_LAT;
pub const PF_HYLINK: i32 = AF_HYLINK;
pub const PF_APPLETALK: i32 = AF_APPLETALK;
pub const PF_ROUTE: i32 = AF_ROUTE;
pub const PF_LINK: i32 = AF_LINK;
pub const PF_XTP: i32 = PSEUDO_AF_XTP;
pub const PF_COIP: i32 = AF_COIP;
pub const PF_CNT: i32 = AF_CNT;
pub const PF_SIP: i32 = AF_SIP;
pub const PF_IPX: i32 = AF_IPX;
pub const PF_RTIP: i32 = PSEUDO_AF_RTIP;
pub const PF_PIP: i32 = PSEUDO_AF_PIP;
pub const PF_ISDN: i32 = AF_ISDN;
pub const PF_KEY: i32 = PSEUDO_AF_KEY;
pub const PF_INET6: i32 = AF_INET6;
pub const PF_NATM: i32 = AF_NATM;
pub const PF_ATM: i32 = AF_ATM;
pub const PF_NETGRAPH: i32 = AF_NETGRAPH;
pub const PF_SLOW: i32 = AF_SLOW;
pub const PF_SCLUSTER: i32 = AF_SCLUSTER;
pub const PF_ARP: i32 = AF_ARP;
pub const PF_BLUETOOTH: i32 = AF_BLUETOOTH;
pub const PF_IEEE80211: i32 = AF_IEEE80211;
pub const PF_INET_SDP: i32 = AF_INET_SDP;
pub const PF_INET6_SDP: i32 = AF_INET6_SDP;
pub const PF_MAX: i32 = AF_MAX;
pub const NET_RT_DUMP: i32 = 1;
pub const NET_RT_FLAGS: i32 = 2;
pub const NET_RT_IFLIST: i32 = 3;
pub const NET_RT_IFMALIST: i32 = 4;
pub const NET_RT_IFLISTL: i32 = 5;
pub const NET_RT_NHOP: i32 = 6;
pub const NET_RT_NHGRP: i32 = 7;
pub const SOMAXCONN: i32 = 128;
#[repr(C)]
#[derive(Debug, Default)]
pub struct msghdr_t {
pub msg_name: usize,
pub msg_namelen: socklen_t,
pub msg_iov: usize,
pub msg_iovlen: i32,
pub msg_control: usize,
pub msg_controllen: socklen_t,
pub msg_flags: i32,
}
pub const MSG_OOB: i32 = 0x0000_0001;
pub const MSG_PEEK: i32 = 0x0000_0002;
pub const MSG_DONTROUTE: i32 = 0x0000_0004;
pub const MSG_EOR: i32 = 0x0000_0008;
pub const MSG_TRUNC: i32 = 0x0000_0010;
pub const MSG_CTRUNC: i32 = 0x0000_0020;
pub const MSG_WAITALL: i32 = 0x0000_0040;
pub const MSG_DONTWAIT: i32 = 0x0000_0080;
pub const MSG_EOF: i32 = 0x0000_0100;
pub const MSG_NOTIFICATION: i32 = 0x0000_2000;
pub const MSG_NBIO: i32 = 0x0000_4000;
pub const MSG_COMPAT: i32 = 0x0000_8000;
pub const MSG_SOCALLBCK: i32 = 0x0001_0000;
pub const MSG_NOSIGNAL: i32 = 0x0002_0000;
pub const MSG_CMSG_CLOEXEC: i32 = 0x0004_0000;
pub const MSG_WAITFORONE: i32 = 0x0008_0000;
pub const MSG_MORETOCOME: i32 = 0x0010_0000;
pub const MSG_TLSAPPDATA: i32 = 0x0020_0000;
pub const SCM_RIGHTS: i32 = 0x01;
pub const SCM_TIMESTAMP: i32 = 0x02;
pub const SCM_CREDS: i32 = 0x03;
pub const SCM_BINTIME: i32 = 0x04;
pub const SCM_REALTIME: i32 = 0x05;
pub const SCM_MONOTONIC: i32 = 0x06;
pub const SCM_TIME_INFO: i32 = 0x07;
pub const SCM_CREDS2: i32 = 0x08;
pub const SHUT_RD: i32 = 0;
pub const SHUT_WR: i32 = 1;
pub const SHUT_RDWR: i32 = 2;
pub const PRU_FLUSH_RD: i32 = SHUT_RD;
pub const PRU_FLUSH_WR: i32 = SHUT_WR;
pub const PRU_FLUSH_RDWR: i32 = SHUT_RDWR;
#[repr(C)]
#[derive(Debug, Default)]
pub struct sf_hdtr_t {
pub headers: usize,
pub hdr_cnt: i32,
pub trailers: usize,
pub trl_cnt: i32,
}
pub const SF_NODISKIO: i32 = 0x0000_0001;
pub const SF_MNOWAIT: i32 = 0x0000_0002;
pub const SF_SYNC: i32 = 0x0000_0004;
pub const SF_USER_READAHEAD: i32 = 0x0000_0008;
pub const SF_NOCACHE: i32 = 0x0000_0010;
#[must_use]
pub const fn SF_READAHEAD(flags: i32) -> i32 {
flags >> 16
}
#[repr(C)]
#[derive(Debug, Default)]
pub struct mmsghdr_t {
pub msg_hdr: msghdr_t,
pub msg_len: ssize_t,
}