diff --git a/libc-test/semver/dragonfly.txt b/libc-test/semver/dragonfly.txt index b9ccffb681ad3..e01fe55d72ff3 100644 --- a/libc-test/semver/dragonfly.txt +++ b/libc-test/semver/dragonfly.txt @@ -873,6 +873,31 @@ RLIMIT_STACK RLIMIT_VMEM RLIM_INFINITY RLIM_NLIMITS +RTF_XRESOLVE +RTF_LLINFO +RTF_PROTO3 +RTF_PINNED +RTF_LOCAL +RTF_BROADCAST +RTF_MULTICAST +RTM_LOCK +RTM_RESOLVE +RTM_NEWADDR +RTM_DELADDR +RTM_IFINFO +RTM_NEWMADDR +RTM_DELMADDR +RTM_IFANNOUNCE +RTM_IEEE80211 +RTF_CLONING +RTF_PRCLONING +RTF_WASCLONED +RTF_MPLSOPS +RTM_VERSION +RTAX_MPLS1 +RTAX_MPLS2 +RTAX_MPLS3 +RTAX_MAX RTLD_NEXT RTLD_NODELETE RTLD_NOLOAD diff --git a/libc-test/semver/freebsd.txt b/libc-test/semver/freebsd.txt index cb36429fb36ab..5d4253029e5e6 100644 --- a/libc-test/semver/freebsd.txt +++ b/libc-test/semver/freebsd.txt @@ -1222,6 +1222,26 @@ RLIMIT_UMTXP RLIMIT_VMEM RLIM_INFINITY RLIM_NLIMITS +RTF_XRESOLVE +RTF_LLINFO +RTF_PROTO3 +RTF_PINNED +RTF_LOCAL +RTF_BROADCAST +RTF_MULTICAST +RTM_LOCK +RTM_RESOLVE +RTM_NEWADDR +RTM_DELADDR +RTM_IFINFO +RTM_NEWMADDR +RTM_DELMADDR +RTM_IFANNOUNCE +RTM_IEEE80211 +RTF_LLDATA +RTF_FIXEDMTU +RTM_VERSION +RTAX_MAX RTLD_NEXT RTLD_NODELETE RTLD_NOLOAD diff --git a/libc-test/semver/netbsd.txt b/libc-test/semver/netbsd.txt index e07a7dbf08ae6..cfde7caca0c55 100644 --- a/libc-test/semver/netbsd.txt +++ b/libc-test/semver/netbsd.txt @@ -929,6 +929,28 @@ RLIM_INFINITY RLIM_NLIMITS RLIM_SAVED_CUR RLIM_SAVED_MAX +RTF_MASK +RTF_CONNECTED +RTF_ANNOUNCE +RTF_SRC +RTF_LOCAL +RTF_BROADCAST +RTF_UPDATING +RTF_DONTCHANGEIFA +RTM_VERSION +RTM_LOCK +RTM_IFANNOUNCE +RTM_IEEE80211 +RTM_SETGATE +RTM_LLINFO_UPD +RTM_IFINFO +RTM_OCHGADDR +RTM_NEWADDR +RTM_DELADDR +RTM_CHGADDR +RTA_TAG +RTAX_TAG +RTAX_MAX RTLD_NEXT RTLD_NOLOAD RTLD_SELF diff --git a/libc-test/semver/openbsd.txt b/libc-test/semver/openbsd.txt index 019ab53d34ff0..9297c4ac4b81e 100644 --- a/libc-test/semver/openbsd.txt +++ b/libc-test/semver/openbsd.txt @@ -761,8 +761,50 @@ RLIM_INFINITY RLIM_NLIMITS RLIM_SAVED_CUR RLIM_SAVED_MAX +RTA_BFD +RTA_DNS +RTA_LABEL +RTA_SEARCH +RTA_SRC +RTA_SRCMASK +RTA_STATIC +RTAX_BFD +RTAX_DNS +RTAX_LABEL +RTAX_MAX +RTAX_SEARCH +RTAX_SRC +RTAX_SRCMASK +RTAX_STATIC +RTF_ANNOUNCE +RTF_BFD +RTF_BROADCAST +RTF_CACHED +RTF_CLONED +RTF_CLONING +RTF_CONNECTED +RTF_FMASK +RTF_LLINFO +RTF_LOCAL +RTF_MPATH +RTF_MPLS +RTF_MULTICAST +RTF_PROTO3 RTLD_NEXT RTLD_SELF +RTM_80211INFO +RTM_BFD +RTM_CHGADDRATTR +RTM_DELADDR +RTM_DESYNC +RTM_IFANNOUNCE +RTM_IFINFO +RTM_INVALIDATE +RTM_NEWADDR +RTM_PROPOSAL +RTM_RESOLVE +RTM_SOURCE +RTM_VERSION RUSAGE_CHILDREN RUSAGE_SELF RUSAGE_THREAD diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index 54735b3f9801b..9c12439e54cbd 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -4914,22 +4914,11 @@ pub const XATTR_SHOWCOMPRESSION: ::c_int = 0x0020; pub const NET_RT_IFLIST2: ::c_int = 0x0006; // net/route.h -pub const RTF_UP: ::c_int = 0x1; -pub const RTF_GATEWAY: ::c_int = 0x2; -pub const RTF_HOST: ::c_int = 0x4; -pub const RTF_REJECT: ::c_int = 0x8; -pub const RTF_DYNAMIC: ::c_int = 0x10; -pub const RTF_MODIFIED: ::c_int = 0x20; -pub const RTF_DONE: ::c_int = 0x40; pub const RTF_DELCLONE: ::c_int = 0x80; pub const RTF_CLONING: ::c_int = 0x100; pub const RTF_XRESOLVE: ::c_int = 0x200; pub const RTF_LLINFO: ::c_int = 0x400; -pub const RTF_STATIC: ::c_int = 0x800; -pub const RTF_BLACKHOLE: ::c_int = 0x1000; pub const RTF_NOIFREF: ::c_int = 0x2000; -pub const RTF_PROTO2: ::c_int = 0x4000; -pub const RTF_PROTO1: ::c_int = 0x8000; pub const RTF_PRCLONING: ::c_int = 0x10000; pub const RTF_WASCLONED: ::c_int = 0x20000; pub const RTF_PROTO3: ::c_int = 0x40000; @@ -4948,13 +4937,6 @@ pub const RTF_GLOBAL: ::c_int = 0x40000000; pub const RTM_VERSION: ::c_int = 5; // Message types -pub const RTM_ADD: ::c_int = 0x1; -pub const RTM_DELETE: ::c_int = 0x2; -pub const RTM_CHANGE: ::c_int = 0x3; -pub const RTM_GET: ::c_int = 0x4; -pub const RTM_LOSING: ::c_int = 0x5; -pub const RTM_REDIRECT: ::c_int = 0x6; -pub const RTM_MISS: ::c_int = 0x7; pub const RTM_LOCK: ::c_int = 0x8; pub const RTM_OLDADD: ::c_int = 0x9; pub const RTM_OLDDEL: ::c_int = 0xa; @@ -4978,25 +4960,6 @@ pub const RTV_SSTHRESH: ::c_int = 0x20; pub const RTV_RTT: ::c_int = 0x40; pub const RTV_RTTVAR: ::c_int = 0x80; -// Bitmask values for rtm_addrs. -pub const RTA_DST: ::c_int = 0x1; -pub const RTA_GATEWAY: ::c_int = 0x2; -pub const RTA_NETMASK: ::c_int = 0x4; -pub const RTA_GENMASK: ::c_int = 0x8; -pub const RTA_IFP: ::c_int = 0x10; -pub const RTA_IFA: ::c_int = 0x20; -pub const RTA_AUTHOR: ::c_int = 0x40; -pub const RTA_BRD: ::c_int = 0x80; - -// Index offsets for sockaddr array for alternate internal encoding. -pub const RTAX_DST: ::c_int = 0; -pub const RTAX_GATEWAY: ::c_int = 1; -pub const RTAX_NETMASK: ::c_int = 2; -pub const RTAX_GENMASK: ::c_int = 3; -pub const RTAX_IFP: ::c_int = 4; -pub const RTAX_IFA: ::c_int = 5; -pub const RTAX_AUTHOR: ::c_int = 6; -pub const RTAX_BRD: ::c_int = 7; pub const RTAX_MAX: ::c_int = 8; pub const KERN_PROCARGS2: ::c_int = 49; diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs index 489b82adb84b9..e00e60290369d 100644 --- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs +++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs @@ -1522,6 +1522,19 @@ pub const NGROUPS: usize = 16; pub const RB_PAUSE: ::c_int = 0x40000; pub const RB_VIDEO: ::c_int = 0x20000000; +// net/route.h +pub const RTF_CLONING: ::c_int = 0x100; +pub const RTF_PRCLONING: ::c_int = 0x10000; +pub const RTF_WASCLONED: ::c_int = 0x20000; +pub const RTF_MPLSOPS: ::c_int = 0x1000000; + +pub const RTM_VERSION: ::c_int = 7; + +pub const RTAX_MPLS1: ::c_int = 8; +pub const RTAX_MPLS2: ::c_int = 9; +pub const RTAX_MPLS3: ::c_int = 10; +pub const RTAX_MAX: ::c_int = 11; + const_fn! { {const} fn _CMSG_ALIGN(n: usize) -> usize { (n + (::mem::size_of::<::c_long>() - 1)) & !(::mem::size_of::<::c_long>() - 1) diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index fc01d8e5463b8..0905d3c94f7f4 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -4697,6 +4697,14 @@ pub const CPU_WHICH_CPUSET: ::c_int = 3; pub const CPU_WHICH_IRQ: ::c_int = 4; pub const CPU_WHICH_JAIL: ::c_int = 5; +// net/route.h +pub const RTF_LLDATA: ::c_int = 0x400; +pub const RTF_FIXEDMTU: ::c_int = 0x80000; + +pub const RTM_VERSION: ::c_int = 5; + +pub const RTAX_MAX: ::c_int = 8; + // sys/signal.h pub const SIGTHR: ::c_int = 32; pub const SIGLWP: ::c_int = SIGTHR; diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs index af0632882cdbc..5ce3600d94ac9 100644 --- a/src/unix/bsd/freebsdlike/mod.rs +++ b/src/unix/bsd/freebsdlike/mod.rs @@ -1009,6 +1009,25 @@ pub const SO_TYPE: ::c_int = 0x1008; pub const LOCAL_PEERCRED: ::c_int = 1; +// net/route.h +pub const RTF_XRESOLVE: ::c_int = 0x200; +pub const RTF_LLINFO: ::c_int = 0x400; +pub const RTF_PROTO3: ::c_int = 0x40000; +pub const RTF_PINNED: ::c_int = 0x100000; +pub const RTF_LOCAL: ::c_int = 0x200000; +pub const RTF_BROADCAST: ::c_int = 0x400000; +pub const RTF_MULTICAST: ::c_int = 0x800000; + +pub const RTM_LOCK: ::c_int = 0x8; +pub const RTM_RESOLVE: ::c_int = 0xb; +pub const RTM_NEWADDR: ::c_int = 0xc; +pub const RTM_DELADDR: ::c_int = 0xd; +pub const RTM_IFINFO: ::c_int = 0xe; +pub const RTM_NEWMADDR: ::c_int = 0xf; +pub const RTM_DELMADDR: ::c_int = 0x10; +pub const RTM_IFANNOUNCE: ::c_int = 0x11; +pub const RTM_IEEE80211: ::c_int = 0x12; + pub const SHUT_RD: ::c_int = 0; pub const SHUT_WR: ::c_int = 1; pub const SHUT_RDWR: ::c_int = 2; diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs index 61f764d1d2dee..918007159862e 100644 --- a/src/unix/bsd/mod.rs +++ b/src/unix/bsd/mod.rs @@ -543,6 +543,49 @@ pub const ITIMER_REAL: ::c_int = 0; pub const ITIMER_VIRTUAL: ::c_int = 1; pub const ITIMER_PROF: ::c_int = 2; +// net/route.h + +pub const RTF_UP: ::c_int = 0x1; +pub const RTF_GATEWAY: ::c_int = 0x2; +pub const RTF_HOST: ::c_int = 0x4; +pub const RTF_REJECT: ::c_int = 0x8; +pub const RTF_DYNAMIC: ::c_int = 0x10; +pub const RTF_MODIFIED: ::c_int = 0x20; +pub const RTF_DONE: ::c_int = 0x40; +pub const RTF_STATIC: ::c_int = 0x800; +pub const RTF_BLACKHOLE: ::c_int = 0x1000; +pub const RTF_PROTO2: ::c_int = 0x4000; +pub const RTF_PROTO1: ::c_int = 0x8000; + +// Message types +pub const RTM_ADD: ::c_int = 0x1; +pub const RTM_DELETE: ::c_int = 0x2; +pub const RTM_CHANGE: ::c_int = 0x3; +pub const RTM_GET: ::c_int = 0x4; +pub const RTM_LOSING: ::c_int = 0x5; +pub const RTM_REDIRECT: ::c_int = 0x6; +pub const RTM_MISS: ::c_int = 0x7; + +// Bitmask values for rtm_addrs. +pub const RTA_DST: ::c_int = 0x1; +pub const RTA_GATEWAY: ::c_int = 0x2; +pub const RTA_NETMASK: ::c_int = 0x4; +pub const RTA_GENMASK: ::c_int = 0x8; +pub const RTA_IFP: ::c_int = 0x10; +pub const RTA_IFA: ::c_int = 0x20; +pub const RTA_AUTHOR: ::c_int = 0x40; +pub const RTA_BRD: ::c_int = 0x80; + +// Index offsets for sockaddr array for alternate internal encoding. +pub const RTAX_DST: ::c_int = 0; +pub const RTAX_GATEWAY: ::c_int = 1; +pub const RTAX_NETMASK: ::c_int = 2; +pub const RTAX_GENMASK: ::c_int = 3; +pub const RTAX_IFP: ::c_int = 4; +pub const RTAX_IFA: ::c_int = 5; +pub const RTAX_AUTHOR: ::c_int = 6; +pub const RTAX_BRD: ::c_int = 7; + f! { pub fn CMSG_FIRSTHDR(mhdr: *const ::msghdr) -> *mut ::cmsghdr { if (*mhdr).msg_controllen as usize >= ::mem::size_of::<::cmsghdr>() { diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs index 318557daf52b8..0921d56912cd2 100644 --- a/src/unix/bsd/netbsdlike/netbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs @@ -2402,6 +2402,33 @@ pub const fn MAP_ALIGNED(alignment: ::c_int) -> ::c_int { alignment << MAP_ALIGNMENT_SHIFT } +// net/route.h +pub const RTF_MASK: ::c_int = 0x80; +pub const RTF_CONNECTED: ::c_int = 0x100; +pub const RTF_ANNOUNCE: ::c_int = 0x20000; +pub const RTF_SRC: ::c_int = 0x10000; +pub const RTF_LOCAL: ::c_int = 0x40000; +pub const RTF_BROADCAST: ::c_int = 0x80000; +pub const RTF_UPDATING: ::c_int = 0x100000; +pub const RTF_DONTCHANGEIFA: ::c_int = 0x200000; + +pub const RTM_VERSION: ::c_int = 4; +pub const RTM_LOCK: ::c_int = 0x8; +pub const RTM_IFANNOUNCE: ::c_int = 0x10; +pub const RTM_IEEE80211: ::c_int = 0x11; +pub const RTM_SETGATE: ::c_int = 0x12; +pub const RTM_LLINFO_UPD: ::c_int = 0x13; +pub const RTM_IFINFO: ::c_int = 0x14; +pub const RTM_OCHGADDR: ::c_int = 0x15; +pub const RTM_NEWADDR: ::c_int = 0x16; +pub const RTM_DELADDR: ::c_int = 0x17; +pub const RTM_CHGADDR: ::c_int = 0x18; + +pub const RTA_TAG: ::c_int = 0x100; + +pub const RTAX_TAG: ::c_int = 8; +pub const RTAX_MAX: ::c_int = 9; + const_fn! { {const} fn _ALIGN(p: usize) -> usize { (p + _ALIGNBYTES) & !_ALIGNBYTES diff --git a/src/unix/bsd/netbsdlike/openbsd/mod.rs b/src/unix/bsd/netbsdlike/openbsd/mod.rs index 357662547b8e3..9e14e89515e47 100644 --- a/src/unix/bsd/netbsdlike/openbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/openbsd/mod.rs @@ -1881,6 +1881,54 @@ pub const RB_RESET: ::c_int = 0x08000; pub const RB_GOODRANDOM: ::c_int = 0x10000; pub const RB_UNHIBERNATE: ::c_int = 0x20000; +// net/route.h +pub const RTF_CLONING: ::c_int = 0x100; +pub const RTF_MULTICAST: ::c_int = 0x200; +pub const RTF_LLINFO: ::c_int = 0x400; +pub const RTF_PROTO3: ::c_int = 0x2000; +pub const RTF_ANNOUNCE: ::c_int = ::RTF_PROTO2; + +pub const RTF_CLONED: ::c_int = 0x10000; +pub const RTF_CACHED: ::c_int = 0x20000; +pub const RTF_MPATH: ::c_int = 0x40000; +pub const RTF_MPLS: ::c_int = 0x100000; +pub const RTF_LOCAL: ::c_int = 0x200000; +pub const RTF_BROADCAST: ::c_int = 0x400000; +pub const RTF_CONNECTED: ::c_int = 0x800000; +pub const RTF_BFD: ::c_int = 0x1000000; +pub const RTF_FMASK: ::c_int = b'\\' as _; + +pub const RTM_VERSION: ::c_int = 5; +pub const RTM_RESOLVE: ::c_int = 0xb; +pub const RTM_NEWADDR: ::c_int = 0xc; +pub const RTM_DELADDR: ::c_int = 0xd; +pub const RTM_IFINFO: ::c_int = 0xe; +pub const RTM_IFANNOUNCE: ::c_int = 0xf; +pub const RTM_DESYNC: ::c_int = 0x10; +pub const RTM_INVALIDATE: ::c_int = 0x11; +pub const RTM_BFD: ::c_int = 0x12; +pub const RTM_PROPOSAL: ::c_int = 0x13; +pub const RTM_CHGADDRATTR: ::c_int = 0x14; +pub const RTM_80211INFO: ::c_int = 0x15; +pub const RTM_SOURCE: ::c_int = 0x16; + +pub const RTA_SRC: ::c_int = 0x100; +pub const RTA_SRCMASK: ::c_int = 0x200; +pub const RTA_LABEL: ::c_int = 0x400; +pub const RTA_BFD: ::c_int = 0x800; +pub const RTA_DNS: ::c_int = 0x1000; +pub const RTA_STATIC: ::c_int = 0x2000; +pub const RTA_SEARCH: ::c_int = 0x4000; + +pub const RTAX_SRC: ::c_int = 8; +pub const RTAX_SRCMASK: ::c_int = 9; +pub const RTAX_LABEL: ::c_int = 10; +pub const RTAX_BFD: ::c_int = 11; +pub const RTAX_DNS: ::c_int = 12; +pub const RTAX_STATIC: ::c_int = 13; +pub const RTAX_SEARCH: ::c_int = 14; +pub const RTAX_MAX: ::c_int = 15; + const_fn! { {const} fn _ALIGN(p: usize) -> usize { (p + _ALIGNBYTES) & !_ALIGNBYTES