]>
git.proxmox.com Git - pve-network.git/blob - PVE/Network/SDN/VnetPlugin.pm
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
=> 'ipv4',
41 description
=> "Anycast router ipv6 address.",
42 type
=> 'string', format
=> 'ipv6',
47 description
=> "Anycast router mac address",
55 transportzone
=> { optional
=> 0},
56 tag
=> { optional
=> 0},
57 alias
=> { optional
=> 1 },
58 ipv4
=> { optional
=> 1 },
59 ipv6
=> { optional
=> 1 },
60 mtu
=> { optional
=> 1 },
65 my ($class, $sdnid, $sdn_cfg) = @_;
71 my ($class, $sdnid, $sdn_cfg) = @_;
72 # verify that tag is not already defined in another vnet
73 if (defined($sdn_cfg->{ids
}->{$sdnid}->{tag
})) {
74 my $tag = $sdn_cfg->{ids
}->{$sdnid}->{tag
};
75 foreach my $id (keys %{$sdn_cfg->{ids
}}) {
76 next if $id eq $sdnid;
77 my $sdn = $sdn_cfg->{ids
}->{$id};
78 if ($sdn->{type
} eq 'vnet' && defined($sdn->{tag
})) {
79 die "tag $tag already exist in vnet $id" if $tag eq $sdn->{tag
};