mirror of
https://git.proxmox.com/git/proxmox-ve-rs
synced 2025-10-04 10:01:27 +00:00
firewall: add sdn scope for ipsets
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
This commit is contained in:
parent
f41170ba15
commit
3ba791747f
@ -14,6 +14,7 @@ use crate::guest::vm::NetworkConfig;
|
||||
pub enum IpsetScope {
|
||||
Datacenter,
|
||||
Guest,
|
||||
Sdn,
|
||||
}
|
||||
|
||||
impl FromStr for IpsetScope {
|
||||
@ -23,6 +24,7 @@ impl FromStr for IpsetScope {
|
||||
Ok(match s {
|
||||
"+dc" => IpsetScope::Datacenter,
|
||||
"+guest" => IpsetScope::Guest,
|
||||
"+sdn" => IpsetScope::Sdn,
|
||||
_ => bail!("invalid scope for ipset: {s}"),
|
||||
})
|
||||
}
|
||||
@ -33,6 +35,7 @@ impl Display for IpsetScope {
|
||||
let prefix = match self {
|
||||
Self::Datacenter => "dc",
|
||||
Self::Guest => "guest",
|
||||
Self::Sdn => "sdn",
|
||||
};
|
||||
|
||||
f.write_str(prefix)
|
||||
|
Loading…
Reference in New Issue
Block a user