private DhcpServerScopeReservation(DhcpServerScope scope, DhcpServerIpAddress address, DhcpServerHardwareAddress hardwareAddress, DhcpServerClientTypes allowedClientTypes) { Scope = scope; Address = address; HardwareAddress = hardwareAddress; AllowedClientTypes = allowedClientTypes; Options = new DhcpServerScopeReservationOptionValueCollection(this); }
public IDhcpServerClient AddClient(DhcpServerIpAddress address, DhcpServerHardwareAddress hardwareAddress, string name, string comment, DateTime leaseExpires, IDhcpServerHost ownerHost, DhcpServerClientTypes clientType, DhcpServerClientAddressStates addressState, DhcpServerClientQuarantineStatuses quarantineStatus, DateTime probationEnds, bool quarantineCapable) => DhcpServerClient.CreateClient(Scope, address, hardwareAddress, name, comment, leaseExpires, (DhcpServerHost)ownerHost, clientType, addressState, quarantineStatus, probationEnds, quarantineCapable);
/// <summary> /// Creates a DHCP scope reservation /// </summary> /// <param name="address">IP Address to reserve</param> /// <param name="hardwareAddress">Hardware address (MAC address) of client associated with this reservation</param> /// <param name="allowedClientTypes">Protocols this reservation supports</param> /// <returns>The scope reservation</returns> public IDhcpServerScopeReservation AddReservation(DhcpServerIpAddress address, DhcpServerHardwareAddress hardwareAddress, DhcpServerClientTypes allowedClientTypes) => DhcpServerScopeReservation.CreateReservation(Scope, address, hardwareAddress, allowedClientTypes);
internal static DhcpServerScopeReservation CreateReservation(DhcpServerScope scope, DhcpServerIpAddress address, DhcpServerHardwareAddress hardwareAddress, DhcpServerClientTypes allowedClientTypes) { if (!scope.IpRange.Contains(address)) { throw new ArgumentOutOfRangeException(nameof(address), "The DHCP scope does not include the provided address"); } DhcpServerScope.AddSubnetReservationElement(scope.Server, scope.Address, address, hardwareAddress, allowedClientTypes); return(new DhcpServerScopeReservation(scope, address, hardwareAddress, allowedClientTypes)); }
public DHCP_IP_RESERVATION_V4_Managed(DhcpServerIpAddress address, DhcpServerHardwareAddress reservedForClient, DhcpServerClientTypes allowedClientTypes) : this(reservedIpAddress : address.ToNativeAsNetwork(), reservedForClient : reservedForClient.ToNativeClientUid(), allowedClientTypes : (DHCP_CLIENT_TYPE)allowedClientTypes) { }