3.1.1.1.5.2.4 GetDhcpReservationsForScope

The GetDhcpReservationsForScope procedure retrieves all the reservation entries that exist in ADM_DHCPReservationTable for a specified DHCP scope. The following are the input parameters to this procedure:

Param_addressfamily: The address family to specify the table against which the reservation processing has to be performed.

Param_scopeId: This is the RecordId of the DHCP scope for which the DHCP Reservations need to be retrieved.

The procedure returns the following as the output parameter.

Result_reservations: This is the collection of reservation information in the form of DhcpReservationV4 or DhcpReservationV6, corresponding to Param_scopeId specified in the input parameter. If Param_addressfamily is InterNetwork, the procedure returns a collection of instances of DhcpReservationV4, and if it is InterNetworkV6, the procedure returns a collection of instances of type DhcpReservationV6.

The following are the processing steps involved:

  1. Use the Param_addressfamily to determine the simple table within the ADM_DHCPReservationTable compound table to perform the rest of the processing.

  2. Initialize Result_reservations as a collection of instances of DhcpReservationV4 or DhcpReservationV6, based on Param_addressfamily value being InterNetwork or InterNetworkV6 respectively.

  3. If Param_scopeId is NULL, return. Otherwise look up all the rows with ScopeId as Param_scopeId.

  4. For each row found in the previous step:

    1. Create a Reservation instance of type DhcpReservationV4 if Param_addressfamily is InterNetwork or of type DhcpReservationV6 if Param_addressfamily is InterNetworkV6.

    2. Copy RecordId, ScopeId, IPAddressRecordId, ReservationDetails to instance Reservation.

    3. Add Reservation to Result_reservations.

  5. Return Result_reservations from the procedure.