what is this
This commit is contained in:
@@ -21,8 +21,19 @@
|
||||
|
||||
use super::AddrInfo;
|
||||
|
||||
pub async fn get(dev: Option<&str>) -> anyhow::Result<Vec<AddrInfo>> {
|
||||
let mut cmd = tokio::process::Command::new("ip");
|
||||
cmd.args(["-j", "address", "show"]);
|
||||
|
||||
if let Some(d) = dev {
|
||||
cmd.args(["dev", d]);
|
||||
}
|
||||
|
||||
pub async fn get() -> Vec<AddrInfo> {
|
||||
todo!()
|
||||
}
|
||||
let output = cmd.output().await?;
|
||||
|
||||
if !output.status.success() {
|
||||
anyhow::bail!(String::from_utf8_lossy(&output.stderr).into_owned());
|
||||
}
|
||||
|
||||
Ok(serde_json::from_slice(&output.stdout)?)
|
||||
}
|
||||
|
||||
@@ -118,3 +118,8 @@ async fn ball_compare_backends() -> anyhow::Result<()> {
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn cidr_filter() {
|
||||
unimplemented!("never. i aint add what i dont need")
|
||||
}
|
||||
Reference in New Issue
Block a user