WebServiceDhcpApi: updated api to support ignoreClientIdentifierOption.

This commit is contained in:
Shreyas Zare
2024-03-16 14:02:14 +05:30
parent 4b60404153
commit 42a053b3eb

View File

@@ -365,6 +365,7 @@ namespace DnsServerCore
jsonWriter.WriteBoolean("allowOnlyReservedLeases", scope.AllowOnlyReservedLeases);
jsonWriter.WriteBoolean("blockLocallyAdministeredMacAddresses", scope.BlockLocallyAdministeredMacAddresses);
jsonWriter.WriteBoolean("ignoreClientIdentifierOption", scope.IgnoreClientIdentifierOption);
}
public async Task SetDhcpScopeAsync(HttpContext context)
@@ -397,6 +398,7 @@ namespace DnsServerCore
scopeExists = false;
scope = new Scope(scopeName, true, IPAddress.Parse(strStartingAddress), IPAddress.Parse(strEndingAddress), IPAddress.Parse(strSubnetMask), _dnsWebService._log, _dnsWebService.DhcpServer);
scope.IgnoreClientIdentifierOption = true;
}
else
{
@@ -638,6 +640,9 @@ namespace DnsServerCore
if (request.TryGetQueryOrForm("blockLocallyAdministeredMacAddresses", bool.Parse, out bool blockLocallyAdministeredMacAddresses))
scope.BlockLocallyAdministeredMacAddresses = blockLocallyAdministeredMacAddresses;
if (request.TryGetQueryOrForm("ignoreClientIdentifierOption", bool.Parse, out bool ignoreClientIdentifierOption))
scope.IgnoreClientIdentifierOption = ignoreClientIdentifierOption;
if (scopeExists)
{
_dnsWebService.DhcpServer.SaveScope(scopeName);