Skip to content

Commit a29c9d7

Browse files
committed
remove sys::sockets::consts module as it's libc goal to define them
1 parent 73ecb15 commit a29c9d7

File tree

4 files changed

+78
-397
lines changed

4 files changed

+78
-397
lines changed

src/sys/socket/addr.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use super::{consts, sa_family_t};
1+
use super::sa_family_t;
22
use {Errno, Error, Result, NixPath};
33
use libc;
44
use std::{fmt, hash, mem, net, ptr};
@@ -23,15 +23,15 @@ use ::sys::socket::addr::sys_control::SysControlAddr;
2323
#[repr(i32)]
2424
#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)]
2525
pub enum AddressFamily {
26-
Unix = consts::AF_UNIX,
27-
Inet = consts::AF_INET,
28-
Inet6 = consts::AF_INET6,
26+
Unix = libc::AF_UNIX,
27+
Inet = libc::AF_INET,
28+
Inet6 = libc::AF_INET6,
2929
#[cfg(any(target_os = "linux", target_os = "android"))]
30-
Netlink = consts::AF_NETLINK,
30+
Netlink = libc::AF_NETLINK,
3131
#[cfg(any(target_os = "linux", target_os = "android"))]
32-
Packet = consts::AF_PACKET,
32+
Packet = libc::AF_PACKET,
3333
#[cfg(any(target_os = "macos", target_os = "ios"))]
34-
System = consts::AF_SYSTEM,
34+
System = libc::AF_SYSTEM,
3535
}
3636

3737
#[derive(Copy)]
@@ -252,7 +252,7 @@ impl Ipv4Addr {
252252
}
253253

254254
pub fn any() -> Ipv4Addr {
255-
Ipv4Addr(libc::in_addr { s_addr: consts::INADDR_ANY })
255+
Ipv4Addr(libc::in_addr { s_addr: 0/*consts::INADDR_ANY*/ }) // TODO: define INADDR_ANY in libc
256256
}
257257

258258
pub fn octets(&self) -> [u8; 4] {
@@ -702,7 +702,7 @@ pub mod sys_control {
702702
let addr = sockaddr_ctl {
703703
sc_len: mem::size_of::<sockaddr_ctl>() as c_uchar,
704704
sc_family: AddressFamily::System as c_uchar,
705-
ss_sysaddr: consts::AF_SYS_CONTROL as uint16_t,
705+
ss_sysaddr: libc::AF_SYS_CONTROL as uint16_t,
706706
sc_id: id,
707707
sc_unit: unit,
708708
sc_reserved: [0; 5]

src/sys/socket/consts.rs

Lines changed: 0 additions & 335 deletions
This file was deleted.

0 commit comments

Comments
 (0)