DhcpServer: Implemented RemoveLease() method to remove lease and update DNS auth zone.

This commit is contained in:
Shreyas Zare
2021-09-18 19:23:34 +05:30
parent 0ec38f6fed
commit 6148e6ef60

View File

@@ -1334,6 +1334,16 @@ namespace DnsServerCore.Dhcp
SaveScopeFile(scope);
}
public void RemoveLease(string scopeName, string hardwareAddress)
{
Scope scope = GetScope(scopeName);
if (scope == null)
throw new DhcpServerException("DHCP scope does not exists: " + scopeName);
Lease removedLease = scope.RemoveLease(hardwareAddress);
UpdateDnsAuthZone(false, scope, removedLease);
}
public IDictionary<string, string> GetAddressHostNameMap()
{
Dictionary<string, string> map = new Dictionary<string, string>();