diff --git a/src/unix/notbsd/linux/mod.rs b/src/unix/notbsd/linux/mod.rs index 7cc059a3..a6ac3b56 100644 --- a/src/unix/notbsd/linux/mod.rs +++ b/src/unix/notbsd/linux/mod.rs @@ -1407,6 +1407,9 @@ pub const SIOCSRARP: ::c_ulong = 0x00008962; pub const SIOCGIFMAP: ::c_ulong = 0x00008970; pub const SIOCSIFMAP: ::c_ulong = 0x00008971; +pub const IPTOS_TOS_MASK: u8 = 0x1E; +pub const IPTOS_PREC_MASK: u8 = 0xE0; + f! { pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () { for slot in cpuset.bits.iter_mut() { @@ -1462,6 +1465,14 @@ f! { dev |= (minor & 0xffffff00) << 12; dev } + + pub fn IPTOS_TOS(tos: u8) -> u8 { + tos & IPTOS_TOS_MASK + } + + pub fn IPTOS_PREC(tos: u8) -> u8 { + tos & IPTOS_PREC_MASK + } } extern { diff --git a/src/unix/notbsd/mod.rs b/src/unix/notbsd/mod.rs index 31a520d0..2a6d616e 100644 --- a/src/unix/notbsd/mod.rs +++ b/src/unix/notbsd/mod.rs @@ -824,14 +824,11 @@ pub const POLLNVAL: ::c_short = 0x20; pub const POLLRDNORM: ::c_short = 0x040; pub const POLLRDBAND: ::c_short = 0x080; -pub const IPTOS_TOS_MASK: u8 = 0x1E; pub const IPTOS_LOWDELAY: u8 = 0x10; pub const IPTOS_THROUGHPUT: u8 = 0x08; pub const IPTOS_RELIABILITY: u8 = 0x04; pub const IPTOS_MINCOST: u8 = 0x02; -pub const IPTOS_PREC_MASK: u8 = 0xE0; - pub const IPTOS_PREC_NETCONTROL: u8 = 0xe0; pub const IPTOS_PREC_INTERNETCONTROL: u8 = 0xc0; pub const IPTOS_PREC_CRITIC_ECP: u8 = 0xa0; @@ -936,14 +933,6 @@ f! { (cmd << 8) | (type_ & 0x00ff) } - pub fn IPTOS_TOS(tos: u8) -> u8 { - tos & IPTOS_TOS_MASK - } - - pub fn IPTOS_PREC(tos: u8) -> u8 { - tos & IPTOS_PREC_MASK - } - pub fn IPOPT_COPIED(o: u8) -> u8 { o & IPOPT_COPY }