]>
git.proxmox.com Git - pve-network.git/blob - PVE/Network/SDN/VnetPlugin.pm
e8aa2042002fd0efbeebd5bbae71df50615d07e2
1 package PVE
::Network
::SDN
::VnetPlugin
;
5 use PVE
::Network
::SDN
::Plugin
;
7 use base
('PVE::Network::SDN::Plugin');
19 description
=> "transportzone id",
23 description
=> "vlan or vxlan id",
27 description
=> "alias name of the vnet",
36 description
=> "Anycast router ipv4 address.",
37 type
=> 'string', format
=> 'CIDRv4',
41 description
=> "Anycast router ipv6 address.",
42 type
=> 'string', format
=> 'CIDRv6',
47 description
=> "Anycast router mac address",
48 optional
=> 1, format
=> 'mac-addr'
55 transportzone
=> { optional
=> 0},
56 tag
=> { optional
=> 0},
57 alias
=> { optional
=> 1 },
58 ipv4
=> { optional
=> 1 },
59 ipv6
=> { optional
=> 1 },
60 mtu
=> { optional
=> 1 },
61 mac
=> { optional
=> 1 },
66 my ($class, $sdnid, $sdn_cfg) = @_;
72 my ($class, $sdnid, $sdn_cfg) = @_;
73 # verify that tag is not already defined in another vnet
74 if (defined($sdn_cfg->{ids
}->{$sdnid}->{tag
})) {
75 my $tag = $sdn_cfg->{ids
}->{$sdnid}->{tag
};
76 foreach my $id (keys %{$sdn_cfg->{ids
}}) {
77 next if $id eq $sdnid;
78 my $sdn = $sdn_cfg->{ids
}->{$id};
79 if ($sdn->{type
} eq 'vnet' && defined($sdn->{tag
})) {
80 die "tag $tag already exist in vnet $id" if $tag eq $sdn->{tag
};