]> git.proxmox.com Git - pve-network.git/blobdiff - PVE/Network/SDN/Zones/VlanPlugin.pm
evpn: remove uplink-id
[pve-network.git] / PVE / Network / SDN / Zones / VlanPlugin.pm
index dd03838d0d9be8fd1d18ebe6e60c91ea3281e461..8951e9ba2687efb325910a5b83f296cbfac25c6f 100644 (file)
@@ -26,24 +26,20 @@ sub properties {
            minimum => 1, maximum => 4096,
            description => 'Uplink interface',
        },
-       'vlan-allowed' => {
-           type => 'string', format => 'pve-sdn-vlanrange',
-           description => "Allowed vlan range",
-       },
     };
 }
 
 sub options {
 
     return {
+        nodes => { optional => 1},
        'uplink-id' => { optional => 0 },
-        'vlan-allowed' => { optional => 1 },
     };
 }
 
 # Plugin implementation
 sub generate_sdn_config {
-    my ($class, $plugin_config, $zoneid, $vnetid, $vnet, $uplinks, $config) = @_;
+    my ($class, $plugin_config, $zoneid, $vnetid, $vnet, $uplinks, $controller, $config) = @_;
 
     my $tag = $vnet->{tag};
     my $mtu = $vnet->{mtu};
@@ -73,44 +69,6 @@ sub generate_sdn_config {
     return $config;
 }
 
-sub on_delete_hook {
-    my ($class, $transportid, $sdn_cfg) = @_;
-
-    # verify that no vnet are associated to this transport
-    foreach my $id (keys %{$sdn_cfg->{ids}}) {
-       my $sdn = $sdn_cfg->{ids}->{$id};
-       die "transport $transportid is used by vnet $id"
-           if ($sdn->{type} eq 'vnet' && defined($sdn->{zone}) && $sdn->{zone} eq $transportid);
-    }
-}
-
-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;