]> git.proxmox.com Git - pve-network.git/commitdiff
remove vxlan|vlan allowed zone option
authorAlexandre Derumier <aderumier@odiso.com>
Tue, 26 Nov 2019 09:00:22 +0000 (10:00 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 26 Nov 2019 11:33:40 +0000 (12:33 +0100)
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
PVE/Network/SDN/Zones/EvpnPlugin.pm
PVE/Network/SDN/Zones/FaucetPlugin.pm
PVE/Network/SDN/Zones/QinQPlugin.pm
PVE/Network/SDN/Zones/VlanPlugin.pm
PVE/Network/SDN/Zones/VxlanPlugin.pm

index d294bc3d435de980efa5f335edad904c4d936668..2acb9ae869f62cb4c2cd1d2af48bf231a3b42a93 100644 (file)
@@ -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};
index e914d4d35fd0e1fce2492a697dfd272d1d3dfad5..e9c07a6f8721e13cca3f2d427b03c239c64a1a07 100644 (file)
@@ -31,7 +31,6 @@ sub options {
        'dp-id' => { optional => 0 },
        'uplink-id' => { optional => 0 },
         'controller' => { optional => 0 },
-        'vlan-allowed' => { optional => 1 },
     };
 }
 
index d90382c84e621307cbc9033945612538888d14c6..734c56bbcf582f92bf32cc6584f16cd6b7ac9a90 100644 (file)
@@ -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;
index dd03838d0d9be8fd1d18ebe6e60c91ea3281e461..07188f6ae8324ca974f8951a4fdfa41aa063a8ed 100644 (file)
@@ -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;
index bcabe1e3f175da02d898de990bab7a97195f9d23..8ae3ce8a8a42cc5b2e370cb755e8d134bf66141a 100644 (file)
@@ -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};