Skip to content

Commit

Permalink
Merge pull request #35 from kayabaNerve/rtnetlink-0.13
Browse files Browse the repository at this point in the history
rtnetlink 0.13
  • Loading branch information
jxs authored Nov 12, 2024
2 parents c85f744 + 943a412 commit fb9ce1c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ ipnet = "2.3.1"
log = "0.4.14"

[target.'cfg(target_os = "linux")'.dependencies]
rtnetlink = { version = "0.10.0", default-features = false }
netlink-sys = { version = "0.8.0", default-features = false }
netlink-packet-core = { version = "0.7.0", default-features = false }
netlink-packet-route = { version = "0.17.0", default-features = false }
netlink-proto = { version = "0.11.0", default-features = false }
rtnetlink = { version = "0.13.0", default-features = false }

[target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies]
core-foundation = "0.9.2"
Expand Down
17 changes: 9 additions & 8 deletions src/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ use fnv::FnvHashSet;
use futures::ready;
use futures::stream::{FusedStream, Stream, TryStreamExt};
use futures::StreamExt;
use netlink_packet_core::NetlinkPayload;
use netlink_packet_route::rtnl::address::nlas::Nla;
use netlink_packet_route::rtnl::{AddressMessage, RtnlMessage};
use netlink_proto::Connection;
use netlink_sys::{AsyncSocket, SocketAddr};
use rtnetlink::constants::{RTMGRP_IPV4_IFADDR, RTMGRP_IPV6_IFADDR};
use rtnetlink::packet::address::nlas::Nla;
use rtnetlink::packet::{AddressMessage, RtnlMessage};
use rtnetlink::proto::{Connection, NetlinkPayload};
use rtnetlink::sys::{AsyncSocket, SocketAddr};
use std::collections::VecDeque;
use std::future::Future;
use std::io::{Error, ErrorKind, Result};
Expand All @@ -17,17 +18,17 @@ use std::task::{Context, Poll};

#[cfg(feature = "tokio")]
pub mod tokio {
//! An interface watcher that uses `rtnetlink`'s [`TokioSocket`](rtnetlink::sys::TokioSocket)
use rtnetlink::sys::TokioSocket;
//! An interface watcher that uses `netlink`'s [`TokioSocket`](netlink_sys::TokioSocket)
use netlink_sys::TokioSocket;

/// Watches for interface changes.
pub type IfWatcher = super::IfWatcher<TokioSocket>;
}

#[cfg(feature = "smol")]
pub mod smol {
//! An interface watcher that uses `rtnetlink`'s [`SmolSocket`](rtnetlink::sys::SmolSocket)
use rtnetlink::sys::SmolSocket;
//! An interface watcher that uses `netlink`'s [`SmolSocket`](netlink_sys::SmolSocket)
use netlink_sys::SmolSocket;

/// Watches for interface changes.
pub type IfWatcher = super::IfWatcher<SmolSocket>;
Expand Down

0 comments on commit fb9ce1c

Please sign in to comment.