File tree Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,9 @@ This project adheres to [Semantic Versioning](https://semver.org/).
22
22
- Added ` MntFlags ` and ` unmount ` on all of the BSDs.
23
23
- Added ` any() ` and ` all() ` to ` poll::PollFd ` .
24
24
([ #1877 ] ( https://github.com/nix-rust/nix/pull/1877 ) )
25
+ - Add ` PF_ROUTE ` to ` SockType ` on macOS.
26
+ - Add ` PF_ROUTE ` to ` SockType ` on macOS, all of the BSDs and Linux.
27
+ ([ #1867 ] ( https://github.com/nix-rust/nix/pull/1867 ) )
25
28
- Add ` MntFlags ` and ` unmount ` on all of the BSDs.
26
29
([ #1849 ] ( https://github.com/nix-rust/nix/pull/1849 ) )
27
30
- Added a ` Statfs::flags ` method.
Original file line number Diff line number Diff line change @@ -80,6 +80,9 @@ pub enum AddressFamily {
80
80
#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
81
81
#[ cfg_attr( docsrs, doc( cfg( all( ) ) ) ) ]
82
82
Netlink = libc:: AF_NETLINK ,
83
+ /// Kernel interface for interacting with the routing table
84
+ #[ cfg( not( any( target_os = "redox" , target_os = "linux" , target_os = "android" ) ) ) ]
85
+ Route = libc:: PF_ROUTE ,
83
86
/// Low level packet interface (see [`packet(7)`](https://man7.org/linux/man-pages/man7/packet.7.html))
84
87
#[ cfg( any(
85
88
target_os = "android" ,
@@ -421,6 +424,8 @@ impl AddressFamily {
421
424
libc:: AF_NETLINK => Some ( AddressFamily :: Netlink ) ,
422
425
#[ cfg( any( target_os = "macos" , target_os = "macos" ) ) ]
423
426
libc:: AF_SYSTEM => Some ( AddressFamily :: System ) ,
427
+ #[ cfg( not( any( target_os = "redox" , target_os = "linux" , target_os = "android" ) ) ) ]
428
+ libc:: PF_ROUTE => Some ( AddressFamily :: Route ) ,
424
429
#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
425
430
libc:: AF_PACKET => Some ( AddressFamily :: Packet ) ,
426
431
#[ cfg( any(
Original file line number Diff line number Diff line change @@ -2484,4 +2484,16 @@ mod tests {
2484
2484
fn can_use_cmsg_space ( ) {
2485
2485
let _ = cmsg_space ! ( u8 ) ;
2486
2486
}
2487
+
2488
+ #[ cfg( not( any( target_os = "redox" , target_os = "linux" , target_os = "android" ) ) ) ]
2489
+ #[ test]
2490
+ fn can_open_routing_socket ( ) {
2491
+ let _ = super :: socket (
2492
+ super :: AddressFamily :: Route ,
2493
+ super :: SockType :: Raw ,
2494
+ super :: SockFlag :: empty ( ) ,
2495
+ None ,
2496
+ )
2497
+ . expect ( "Failed to open routing socket" ) ;
2498
+ }
2487
2499
}
You can’t perform that action at this time.
0 commit comments