internal static IEnumerable <DhcpServerOptionValue> GetAllScopeReservationOptionValues(DhcpServerScopeReservation Reservation) { var scopeInfo = new DHCP_OPTION_SCOPE_INFO_RESERVED() { ScopeType = DHCP_OPTION_SCOPE_TYPE.DhcpReservedOptions, ReservedIpAddress = Reservation.ipAddress, ReservedIpSubnetAddress = Reservation.ipAddressMask }; var scopeInfoPtr = Marshal.AllocHGlobal(Marshal.SizeOf(scopeInfo)); Marshal.StructureToPtr(scopeInfo, scopeInfoPtr, true); return(GetAllOptionValues(Reservation.Server, scopeInfoPtr)); }
private static IEnumerable <DhcpServerOptionValue> EnumScopeReservationOptionValues(DhcpServerScopeReservation Reservation, string ClassName, string VendorName) { var scopeInfo = new DHCP_OPTION_SCOPE_INFO_RESERVED() { ScopeType = DHCP_OPTION_SCOPE_TYPE.DhcpReservedOptions, ReservedIpAddress = Reservation.ipAddress, ReservedIpSubnetAddress = Reservation.ipAddressMask }; var scopeInfoPtr = Marshal.AllocHGlobal(Marshal.SizeOf(scopeInfo)); Marshal.StructureToPtr(scopeInfo, scopeInfoPtr, true); return(EnumOptionValues(Reservation.Server, scopeInfoPtr, ClassName, VendorName)); }
internal static DhcpServerOptionValue GetScopeReservationOptionValue(DhcpServerScopeReservation Reservation, int OptionId, string ClassName, string VendorName) { var scopeInfo = new DHCP_OPTION_SCOPE_INFO_RESERVED() { ScopeType = DHCP_OPTION_SCOPE_TYPE.DhcpReservedOptions, ReservedIpAddress = Reservation.ipAddress, ReservedIpSubnetAddress = Reservation.ipAddressMask }; var scopeInfoPtr = Marshal.AllocHGlobal(Marshal.SizeOf(scopeInfo)); Marshal.StructureToPtr(scopeInfo, scopeInfoPtr, true); return(GetOptionValue(Reservation.Server, scopeInfoPtr, OptionId, ClassName, VendorName)); }