예제 #1
0
        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));
        }
예제 #2
0
        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));
        }
예제 #3
0
        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));
        }