1
- use super :: { consts , sa_family_t} ;
1
+ use super :: sa_family_t;
2
2
use { Errno , Error , Result , NixPath } ;
3
3
use libc;
4
4
use std:: { fmt, hash, mem, net, ptr} ;
@@ -23,15 +23,15 @@ use ::sys::socket::addr::sys_control::SysControlAddr;
23
23
#[ repr( i32 ) ]
24
24
#[ derive( Copy , Clone , PartialEq , Eq , Debug , Hash ) ]
25
25
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 ,
29
29
#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
30
- Netlink = consts :: AF_NETLINK ,
30
+ Netlink = libc :: AF_NETLINK ,
31
31
#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
32
- Packet = consts :: AF_PACKET ,
32
+ Packet = libc :: AF_PACKET ,
33
33
#[ cfg( any( target_os = "macos" , target_os = "ios" ) ) ]
34
- System = consts :: AF_SYSTEM ,
34
+ System = libc :: AF_SYSTEM ,
35
35
}
36
36
37
37
#[ derive( Copy ) ]
@@ -252,7 +252,7 @@ impl Ipv4Addr {
252
252
}
253
253
254
254
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
256
256
}
257
257
258
258
pub fn octets ( & self ) -> [ u8 ; 4 ] {
@@ -702,7 +702,7 @@ pub mod sys_control {
702
702
let addr = sockaddr_ctl {
703
703
sc_len : mem:: size_of :: < sockaddr_ctl > ( ) as c_uchar ,
704
704
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 ,
706
706
sc_id : id,
707
707
sc_unit : unit,
708
708
sc_reserved : [ 0 ; 5 ]
0 commit comments