You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to get the IP and MAC addresses from a Neighbour object and print them, similar to the ip neigh show command. However, I noticed that the match attr arm didn’t auto-complete.
This happens because NeighbourAttribute comes from the netlink_packet_route crate, and it’s not re-exported by rtnetlink.
Here’s my code:
let(conn, handle, _) = rtnetlink::new_connection()?;
tokio::spawn(conn);letmut neigh_entries = handle
.neighbours().get().set_family(rtnetlink::IpVersion::V4).execute();// extract ip & mac addresses for each neighbor entrywhileletSome(neigh) = neigh_entries.try_next().await? {
neigh.attributes.iter().for_each(|attr| {// ✅ this pointmatch attr {}}}
It’s not usable even though it’s necessary for extracting IP and MAC addresses.
To match them, I have to explicitly add the netlink_packet_route crate and ensure the versions align.
I just want to understand the reasoning behind this. If it’s an intended design, why does it work this way?
I’m not arguing, I’m just a newbie who wants to understand the thoughts and philosophy of experts.
Thank you.
The text was updated successfully, but these errors were encountered:
Hello.
I tried to get the IP and MAC addresses from a Neighbour object and print them, similar to the ip neigh show command. However, I noticed that the match attr arm didn’t auto-complete.
This happens because NeighbourAttribute comes from the netlink_packet_route crate, and it’s not re-exported by rtnetlink.
Here’s my code:
It’s not usable even though it’s necessary for extracting IP and MAC addresses.
To match them, I have to explicitly add the netlink_packet_route crate and ensure the versions align.
I just want to understand the reasoning behind this. If it’s an intended design, why does it work this way?
I’m not arguing, I’m just a newbie who wants to understand the thoughts and philosophy of experts.
Thank you.
The text was updated successfully, but these errors were encountered: