Skip to content

Commit e5a380f

Browse files
tgross35AkhilTThomas
authored andcommitted
Merge pull request rust-lang#3980 from tgross35/backport-squash
[0.2] Backports
2 parents 38a801f + 8f64c4a commit e5a380f

File tree

4 files changed

+112
-0
lines changed

4 files changed

+112
-0
lines changed

src/unix/bsd/freebsdlike/dragonfly/mod.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,6 +1539,19 @@ pub const RTAX_MPLS2: c_int = 9;
15391539
pub const RTAX_MPLS3: c_int = 10;
15401540
pub const RTAX_MAX: c_int = 11;
15411541

1542+
// net/route.h
1543+
pub const RTF_CLONING: ::c_int = 0x100;
1544+
pub const RTF_PRCLONING: ::c_int = 0x10000;
1545+
pub const RTF_WASCLONED: ::c_int = 0x20000;
1546+
pub const RTF_MPLSOPS: ::c_int = 0x1000000;
1547+
1548+
pub const RTM_VERSION: ::c_int = 7;
1549+
1550+
pub const RTAX_MPLS1: ::c_int = 8;
1551+
pub const RTAX_MPLS2: ::c_int = 9;
1552+
pub const RTAX_MPLS3: ::c_int = 10;
1553+
pub const RTAX_MAX: ::c_int = 11;
1554+
15421555
const_fn! {
15431556
{const} fn _CMSG_ALIGN(n: usize) -> usize {
15441557
(n + (mem::size_of::<c_long>() - 1)) & !(mem::size_of::<c_long>() - 1)

src/unix/bsd/freebsdlike/freebsd/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4693,6 +4693,14 @@ pub const RTM_VERSION: c_int = 5;
46934693

46944694
pub const RTAX_MAX: c_int = 8;
46954695

4696+
// net/route.h
4697+
pub const RTF_LLDATA: ::c_int = 0x400;
4698+
pub const RTF_FIXEDMTU: ::c_int = 0x80000;
4699+
4700+
pub const RTM_VERSION: ::c_int = 5;
4701+
4702+
pub const RTAX_MAX: ::c_int = 8;
4703+
46964704
// sys/signal.h
46974705
pub const SIGTHR: c_int = 32;
46984706
pub const SIGLWP: c_int = SIGTHR;

src/unix/bsd/mod.rs

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,49 @@ pub const RTAX_IFA: c_int = 5;
593593
pub const RTAX_AUTHOR: c_int = 6;
594594
pub const RTAX_BRD: c_int = 7;
595595

596+
// net/route.h
597+
598+
pub const RTF_UP: ::c_int = 0x1;
599+
pub const RTF_GATEWAY: ::c_int = 0x2;
600+
pub const RTF_HOST: ::c_int = 0x4;
601+
pub const RTF_REJECT: ::c_int = 0x8;
602+
pub const RTF_DYNAMIC: ::c_int = 0x10;
603+
pub const RTF_MODIFIED: ::c_int = 0x20;
604+
pub const RTF_DONE: ::c_int = 0x40;
605+
pub const RTF_STATIC: ::c_int = 0x800;
606+
pub const RTF_BLACKHOLE: ::c_int = 0x1000;
607+
pub const RTF_PROTO2: ::c_int = 0x4000;
608+
pub const RTF_PROTO1: ::c_int = 0x8000;
609+
610+
// Message types
611+
pub const RTM_ADD: ::c_int = 0x1;
612+
pub const RTM_DELETE: ::c_int = 0x2;
613+
pub const RTM_CHANGE: ::c_int = 0x3;
614+
pub const RTM_GET: ::c_int = 0x4;
615+
pub const RTM_LOSING: ::c_int = 0x5;
616+
pub const RTM_REDIRECT: ::c_int = 0x6;
617+
pub const RTM_MISS: ::c_int = 0x7;
618+
619+
// Bitmask values for rtm_addrs.
620+
pub const RTA_DST: ::c_int = 0x1;
621+
pub const RTA_GATEWAY: ::c_int = 0x2;
622+
pub const RTA_NETMASK: ::c_int = 0x4;
623+
pub const RTA_GENMASK: ::c_int = 0x8;
624+
pub const RTA_IFP: ::c_int = 0x10;
625+
pub const RTA_IFA: ::c_int = 0x20;
626+
pub const RTA_AUTHOR: ::c_int = 0x40;
627+
pub const RTA_BRD: ::c_int = 0x80;
628+
629+
// Index offsets for sockaddr array for alternate internal encoding.
630+
pub const RTAX_DST: ::c_int = 0;
631+
pub const RTAX_GATEWAY: ::c_int = 1;
632+
pub const RTAX_NETMASK: ::c_int = 2;
633+
pub const RTAX_GENMASK: ::c_int = 3;
634+
pub const RTAX_IFP: ::c_int = 4;
635+
pub const RTAX_IFA: ::c_int = 5;
636+
pub const RTAX_AUTHOR: ::c_int = 6;
637+
pub const RTAX_BRD: ::c_int = 7;
638+
596639
f! {
597640
pub fn CMSG_FIRSTHDR(mhdr: *const crate::msghdr) -> *mut cmsghdr {
598641
if (*mhdr).msg_controllen as usize >= mem::size_of::<cmsghdr>() {

src/unix/bsd/netbsdlike/openbsd/mod.rs

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1917,6 +1917,54 @@ pub const RTAX_STATIC: c_int = 13;
19171917
pub const RTAX_SEARCH: c_int = 14;
19181918
pub const RTAX_MAX: c_int = 15;
19191919

1920+
// net/route.h
1921+
pub const RTF_CLONING: ::c_int = 0x100;
1922+
pub const RTF_MULTICAST: ::c_int = 0x200;
1923+
pub const RTF_LLINFO: ::c_int = 0x400;
1924+
pub const RTF_PROTO3: ::c_int = 0x2000;
1925+
pub const RTF_ANNOUNCE: ::c_int = ::RTF_PROTO2;
1926+
1927+
pub const RTF_CLONED: ::c_int = 0x10000;
1928+
pub const RTF_CACHED: ::c_int = 0x20000;
1929+
pub const RTF_MPATH: ::c_int = 0x40000;
1930+
pub const RTF_MPLS: ::c_int = 0x100000;
1931+
pub const RTF_LOCAL: ::c_int = 0x200000;
1932+
pub const RTF_BROADCAST: ::c_int = 0x400000;
1933+
pub const RTF_CONNECTED: ::c_int = 0x800000;
1934+
pub const RTF_BFD: ::c_int = 0x1000000;
1935+
pub const RTF_FMASK: ::c_int = b'\\' as _;
1936+
1937+
pub const RTM_VERSION: ::c_int = 5;
1938+
pub const RTM_RESOLVE: ::c_int = 0xb;
1939+
pub const RTM_NEWADDR: ::c_int = 0xc;
1940+
pub const RTM_DELADDR: ::c_int = 0xd;
1941+
pub const RTM_IFINFO: ::c_int = 0xe;
1942+
pub const RTM_IFANNOUNCE: ::c_int = 0xf;
1943+
pub const RTM_DESYNC: ::c_int = 0x10;
1944+
pub const RTM_INVALIDATE: ::c_int = 0x11;
1945+
pub const RTM_BFD: ::c_int = 0x12;
1946+
pub const RTM_PROPOSAL: ::c_int = 0x13;
1947+
pub const RTM_CHGADDRATTR: ::c_int = 0x14;
1948+
pub const RTM_80211INFO: ::c_int = 0x15;
1949+
pub const RTM_SOURCE: ::c_int = 0x16;
1950+
1951+
pub const RTA_SRC: ::c_int = 0x100;
1952+
pub const RTA_SRCMASK: ::c_int = 0x200;
1953+
pub const RTA_LABEL: ::c_int = 0x400;
1954+
pub const RTA_BFD: ::c_int = 0x800;
1955+
pub const RTA_DNS: ::c_int = 0x1000;
1956+
pub const RTA_STATIC: ::c_int = 0x2000;
1957+
pub const RTA_SEARCH: ::c_int = 0x4000;
1958+
1959+
pub const RTAX_SRC: ::c_int = 8;
1960+
pub const RTAX_SRCMASK: ::c_int = 9;
1961+
pub const RTAX_LABEL: ::c_int = 10;
1962+
pub const RTAX_BFD: ::c_int = 11;
1963+
pub const RTAX_DNS: ::c_int = 12;
1964+
pub const RTAX_STATIC: ::c_int = 13;
1965+
pub const RTAX_SEARCH: ::c_int = 14;
1966+
pub const RTAX_MAX: ::c_int = 15;
1967+
19201968
const_fn! {
19211969
{const} fn _ALIGN(p: usize) -> usize {
19221970
(p + _ALIGNBYTES) & !_ALIGNBYTES

0 commit comments

Comments
 (0)