mirror of
https://git.proxmox.com/git/pve-network
synced 2025-08-13 17:57:20 +00:00
remove vxlan|vlan allowed zone option
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
parent
3709a20378
commit
a069f0b4a4
@ -39,7 +39,6 @@ sub options {
|
||||
|
||||
return {
|
||||
'uplink-id' => { optional => 0 },
|
||||
'vxlan-allowed' => { optional => 1 },
|
||||
'vrf' => { optional => 0 },
|
||||
'vrf-vxlan' => { optional => 0 },
|
||||
'controller' => { optional => 0 },
|
||||
@ -57,7 +56,6 @@ sub generate_sdn_config {
|
||||
my $mac = $vnet->{mac};
|
||||
|
||||
my $uplink = $plugin_config->{'uplink-id'};
|
||||
my $vxlanallowed = $plugin_config->{'vxlan-allowed'};
|
||||
my $vrf = $plugin_config->{'vrf'};
|
||||
my $vrfvxlan = $plugin_config->{'vrf-vxlan'};
|
||||
|
||||
@ -136,29 +134,6 @@ sub generate_sdn_config {
|
||||
sub on_update_hook {
|
||||
my ($class, $transportid, $sdn_cfg) = @_;
|
||||
|
||||
my $transport = $sdn_cfg->{ids}->{$transportid};
|
||||
|
||||
# verify that vxlan-allowed don't conflict with another vxlan-allowed transport
|
||||
|
||||
# verify that vxlan-allowed is matching currently vnet tag in this transport
|
||||
my $vxlanallowed = $transport->{'vxlan-allowed'};
|
||||
if ($vxlanallowed) {
|
||||
foreach my $id (keys %{$sdn_cfg->{ids}}) {
|
||||
my $sdn = $sdn_cfg->{ids}->{$id};
|
||||
if ($sdn->{type} eq 'vnet' && defined($sdn->{tag})) {
|
||||
if(defined($sdn->{zone}) && $sdn->{zone} eq $transportid) {
|
||||
my $tag = $sdn->{tag};
|
||||
eval {
|
||||
PVE::Network::SDN::Zones::Plugin::parse_tag_number_or_range($vxlanallowed, '16777216', $tag);
|
||||
};
|
||||
if($@) {
|
||||
die "vnet $id - vlan $tag is not allowed in transport $transportid";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# verify that router exist
|
||||
if (defined($sdn_cfg->{ids}->{$transportid}->{router})) {
|
||||
my $router = $sdn_cfg->{ids}->{$transportid}->{router};
|
||||
|
@ -31,7 +31,6 @@ sub options {
|
||||
'dp-id' => { optional => 0 },
|
||||
'uplink-id' => { optional => 0 },
|
||||
'controller' => { optional => 0 },
|
||||
'vlan-allowed' => { optional => 1 },
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,6 @@ sub options {
|
||||
return {
|
||||
'uplink-id' => { optional => 0 },
|
||||
'tag' => { optional => 0 },
|
||||
'vlan-allowed' => { optional => 1 },
|
||||
'vlan-protocol' => { optional => 1 },
|
||||
};
|
||||
}
|
||||
@ -46,7 +45,6 @@ sub generate_sdn_config {
|
||||
my $alias = $vnet->{alias};
|
||||
my $vlanprotocol = $plugin_config->{'vlan-protocol'};
|
||||
my $uplink = $plugin_config->{'uplink-id'};
|
||||
my $vlanallowed = $plugin_config->{'vlan-allowed'};
|
||||
|
||||
die "missing vlan tag" if !$tag;
|
||||
die "missing transport vlan tag" if !$transport_tag;
|
||||
|
@ -26,10 +26,6 @@ sub properties {
|
||||
minimum => 1, maximum => 4096,
|
||||
description => 'Uplink interface',
|
||||
},
|
||||
'vlan-allowed' => {
|
||||
type => 'string', format => 'pve-sdn-vlanrange',
|
||||
description => "Allowed vlan range",
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@ -37,7 +33,6 @@ sub options {
|
||||
|
||||
return {
|
||||
'uplink-id' => { optional => 0 },
|
||||
'vlan-allowed' => { optional => 1 },
|
||||
};
|
||||
}
|
||||
|
||||
@ -87,28 +82,6 @@ sub on_delete_hook {
|
||||
sub on_update_hook {
|
||||
my ($class, $transportid, $sdn_cfg) = @_;
|
||||
|
||||
my $transport = $sdn_cfg->{ids}->{$transportid};
|
||||
|
||||
# verify that vlan-allowed don't conflict with another vlan-allowed transport
|
||||
|
||||
# verify that vlan-allowed is matching currently vnet tag in this transport
|
||||
my $vlanallowed = $transport->{'vlan-allowed'};
|
||||
if ($vlanallowed) {
|
||||
foreach my $id (keys %{$sdn_cfg->{ids}}) {
|
||||
my $sdn = $sdn_cfg->{ids}->{$id};
|
||||
if ($sdn->{type} eq 'vnet' && defined($sdn->{tag})) {
|
||||
if(defined($sdn->{zone}) && $sdn->{zone} eq $transportid) {
|
||||
my $tag = $sdn->{tag};
|
||||
eval {
|
||||
PVE::Network::SDN::Zones::Plugin::parse_tag_number_or_range($vlanallowed, '4096', $tag);
|
||||
};
|
||||
if($@) {
|
||||
die "vlan $tag is not allowed in transport $transportid";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
|
@ -42,10 +42,6 @@ sub type {
|
||||
|
||||
sub properties {
|
||||
return {
|
||||
'vxlan-allowed' => {
|
||||
type => 'string', format => 'pve-sdn-vxlanrange',
|
||||
description => "Allowed vlan range",
|
||||
},
|
||||
'multicast-address' => {
|
||||
description => "Multicast address.",
|
||||
type => 'string', format => 'ipv4-multicast'
|
||||
@ -63,7 +59,6 @@ sub options {
|
||||
'uplink-id' => { optional => 0 },
|
||||
'multicast-address' => { optional => 1 },
|
||||
'unicast-address' => { optional => 1 },
|
||||
'vxlan-allowed' => { optional => 1 },
|
||||
};
|
||||
}
|
||||
|
||||
@ -80,7 +75,6 @@ sub generate_sdn_config {
|
||||
my @unicastaddress = split(',', $plugin_config->{'unicast-address'}) if $plugin_config->{'unicast-address'};
|
||||
|
||||
my $uplink = $plugin_config->{'uplink-id'};
|
||||
my $vxlanallowed = $plugin_config->{'vxlan-allowed'};
|
||||
|
||||
die "missing vxlan tag" if !$tag;
|
||||
my $iface = "uplink$uplink";
|
||||
@ -142,29 +136,6 @@ sub on_delete_hook {
|
||||
sub on_update_hook {
|
||||
my ($class, $transportid, $sdn_cfg) = @_;
|
||||
|
||||
my $transport = $sdn_cfg->{ids}->{$transportid};
|
||||
|
||||
# verify that vxlan-allowed don't conflict with another vxlan-allowed transport
|
||||
|
||||
# verify that vxlan-allowed is matching currently vnet tag in this transport
|
||||
my $vxlanallowed = $transport->{'vxlan-allowed'};
|
||||
if ($vxlanallowed) {
|
||||
foreach my $id (keys %{$sdn_cfg->{ids}}) {
|
||||
my $sdn = $sdn_cfg->{ids}->{$id};
|
||||
if ($sdn->{type} eq 'vnet' && defined($sdn->{tag})) {
|
||||
if(defined($sdn->{zone}) && $sdn->{zone} eq $transportid) {
|
||||
my $tag = $sdn->{tag};
|
||||
eval {
|
||||
PVE::Network::SDN::Zones::Plugin::parse_tag_number_or_range($vxlanallowed, '16777216', $tag);
|
||||
};
|
||||
if($@) {
|
||||
die "vnet $id - vlan $tag is not allowed in transport $transportid";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# verify that router exist
|
||||
if (defined($sdn_cfg->{ids}->{$transportid}->{router})) {
|
||||
my $router = $sdn_cfg->{ids}->{$transportid}->{router};
|
||||
|
Loading…
Reference in New Issue
Block a user