]> git.proxmox.com Git - pve-network.git/commitdiff
ipam: phpipam: add_range_next_freeip
authorAlexandre Derumier <aderumier@odiso.com>
Thu, 4 Jan 2024 16:11:39 +0000 (17:11 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 20 Feb 2024 13:40:00 +0000 (14:40 +0100)
Currently is not possible in phpipam to search in specific range,
fallback to full subnet search

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
src/PVE/Network/SDN/Ipams/PhpIpamPlugin.pm

index ecefd7722fcffaeca7bbbac1f9d813a279c26aef..c3e545f2ae0e79339b83a3ef26119dc423c2a3f3 100644 (file)
@@ -184,6 +184,18 @@ sub add_next_freeip {
     return $ip;
 }
 
+sub add_range_next_freeip {
+    my ($class, $plugin_config, $subnet, $range, $data, $noerr) = @_;
+
+    #not implemented in phpipam, we search in the full subnet
+
+    my $vmid = $data->{vmid};
+    my $mac = $data->{mac};
+    my $hostname = $data->{hostname};
+
+    return $class->add_next_freeip($plugin_config, undef, $subnet, $hostname, $mac, $vmid);
+}
+
 sub del_ip {
     my ($class, $plugin_config, $subnetid, $subnet, $ip, $noerr) = @_;