Can create network filter rules

This commit is contained in:
2024-01-02 13:14:11 +01:00
parent 388a1ed478
commit 81f60ce766
8 changed files with 102 additions and 192 deletions

View File

@ -1,4 +1,5 @@
use crate::libvirt_lib_structures::XMLUuid;
use crate::libvirt_rest_structures::nw_filter::NetworkFilterName;
use clap::Parser;
use std::net::IpAddr;
use std::path::{Path, PathBuf};
@ -252,6 +253,11 @@ impl AppConfig {
pub fn net_definition_path(&self, name: &str) -> PathBuf {
self.definitions_path().join(format!("net-{name}.json"))
}
pub fn net_filter_definition_path(&self, name: &NetworkFilterName) -> PathBuf {
self.definitions_path()
.join(format!("nwfilter-{}.json", name.0))
}
}
#[derive(Debug, Clone, serde::Serialize)]