ahh
This commit is contained in:
+10
-1
@@ -5,6 +5,15 @@ linker = "rust-lld"
|
|||||||
target = "armv7-unknown-linux-musleabihf"
|
target = "armv7-unknown-linux-musleabihf"
|
||||||
|
|
||||||
[alias]
|
[alias]
|
||||||
ldabr = "b -r --target=target.armv7-unknown-linux-musleabihf"
|
cl = "c --target=armv7-unknown-linux-musleabihf"
|
||||||
|
bl = "b --target=armv7-unknown-linux-musleabihf"
|
||||||
|
tl = "t --target=armv7-unknown-linux-musleabihf"
|
||||||
|
|
||||||
|
cw = "c --target=x86_64-pc-windows-msvc"
|
||||||
|
bw = "b --target=x86_64-pc-windows-msvc"
|
||||||
|
tw = "t --target=x86_64-pc-windows-msvc"
|
||||||
|
|
||||||
|
# idk below
|
||||||
|
ldabr = "b -r --target=armv7-unknown-linux-musleabihf"
|
||||||
t = "test -- --nocapture --test-threads=1"
|
t = "test -- --nocapture --test-threads=1"
|
||||||
tdebug = "test -- --nocapture --test-threads=1 --show-output"
|
tdebug = "test -- --nocapture --test-threads=1 --show-output"
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ use futures::TryStreamExt;
|
|||||||
use rtnetlink::Handle;
|
use rtnetlink::Handle;
|
||||||
use rtnetlink::packet_route::{AddressFamily, address::AddressAttribute};
|
use rtnetlink::packet_route::{AddressFamily, address::AddressAttribute};
|
||||||
|
|
||||||
|
use crate::subcommands::link::LinkOutput;
|
||||||
use crate::subcommands::{
|
use crate::subcommands::{
|
||||||
address::{AddrInfo, AddrOutput, AddressFamily as IpAddressFamily, InterfaceCidr},
|
address::{AddrInfo, AddrOutput, AddressFamily as IpAddressFamily, InterfaceCidr},
|
||||||
link,
|
link,
|
||||||
@@ -23,7 +24,7 @@ pub async fn get_with_handle(
|
|||||||
dev: Option<&str>,
|
dev: Option<&str>,
|
||||||
) -> anyhow::Result<Vec<AddrOutput>> {
|
) -> anyhow::Result<Vec<AddrOutput>> {
|
||||||
let links = link::nl::get_with_handle(handle, dev).await?;
|
let links = link::nl::get_with_handle(handle, dev).await?;
|
||||||
let link_by_index: BTreeMap<u32, crate::subcommands::link::LinkOutput> =
|
let link_by_index: BTreeMap<u32, LinkOutput> =
|
||||||
links.into_iter().map(|link| (link.ifindex, link)).collect();
|
links.into_iter().map(|link| (link.ifindex, link)).collect();
|
||||||
|
|
||||||
let mut address = handle.address().get();
|
let mut address = handle.address().get();
|
||||||
@@ -56,10 +57,10 @@ pub async fn get_with_handle(
|
|||||||
_ => None,
|
_ => None,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let prefixlen = Some(msg.header.prefix_len);
|
||||||
|
let scope = Some(format!("{:?}", msg.header.scope).to_lowercase());
|
||||||
let mut local = None;
|
let mut local = None;
|
||||||
let mut prefixlen = Some(msg.header.prefix_len);
|
|
||||||
let mut broadcast = None;
|
let mut broadcast = None;
|
||||||
let mut scope = Some(format!("{:?}", msg.header.scope).to_lowercase());
|
|
||||||
let mut label = None;
|
let mut label = None;
|
||||||
|
|
||||||
for attr in msg.attributes {
|
for attr in msg.attributes {
|
||||||
@@ -86,10 +87,10 @@ pub async fn get_with_handle(
|
|||||||
family,
|
family,
|
||||||
cidr: InterfaceCidr {
|
cidr: InterfaceCidr {
|
||||||
local,
|
local,
|
||||||
prefixlen: prefixlen.take(),
|
prefixlen,
|
||||||
},
|
},
|
||||||
broadcast,
|
broadcast,
|
||||||
scope: scope.take(),
|
scope,
|
||||||
label,
|
label,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user