return {
'uplink-id' => { optional => 0 },
- 'vxlan-allowed' => { optional => 1 },
'vrf' => { optional => 0 },
'vrf-vxlan' => { optional => 0 },
'controller' => { optional => 0 },
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'};
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};
'dp-id' => { optional => 0 },
'uplink-id' => { optional => 0 },
'controller' => { optional => 0 },
- 'vlan-allowed' => { optional => 1 },
};
}
return {
'uplink-id' => { optional => 0 },
'tag' => { optional => 0 },
- 'vlan-allowed' => { optional => 1 },
'vlan-protocol' => { optional => 1 },
};
}
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;
minimum => 1, maximum => 4096,
description => 'Uplink interface',
},
- 'vlan-allowed' => {
- type => 'string', format => 'pve-sdn-vlanrange',
- description => "Allowed vlan range",
- },
};
}
return {
'uplink-id' => { optional => 0 },
- 'vlan-allowed' => { optional => 1 },
};
}
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;
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'
'uplink-id' => { optional => 0 },
'multicast-address' => { optional => 1 },
'unicast-address' => { optional => 1 },
- 'vxlan-allowed' => { optional => 1 },
};
}
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";
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};