3.1.1.1.13.2.2 GetScopeFromTable

The GetScopeFromTable procedure retrieves the scope information in the form of DhcpScopeV4 or DhcpScopeV6, based on whether it is being invoked against the IPv4-specific table or the IPv6-specific table. The procedure takes the following input parameters:

Param_Id: A 64-bit signed integer specifying the record identifier of the DHCP scope instance for which the DhcpScope data is being requested.

Param_addressfamily: This is of type AddressFamily and it can be either InterNetwork or InterNetworkV6. The value InterNetwork is used to specify the processing to be done on the IPv4-specific simple tables for any compound table involved during the processing. The value InterNetworkV6 is used to specify the processing to be done on IPv6-specific simple tables for any compound table involved during the processing.

This procedure returns the following value as output parameter.

Result_scope: This is of DhcpScope. If the Param_addressfamily is InterNetwork, this will be DhcpScopeV4, and if the Param_addressfamily is InterNetworkV6, this will be DhcpScopeV6 type.

The following are the steps performed against the IPAM data store:

  1. Lookup the row in the ADM_DHCPScopesTable with RecordId equal Param_Id. If the row is not present, set Result_scope to NULL and return.

  2. If the Param_addressfamily is InterNetwork, initialize Result_scope to DhcpScopeV4. If the Param_addressfamily is InterNetworkV6, initialize Result_scope to DhcpScopeV6: 

    1. Set Result_scope.RecordId to RecordId.

    2. Set Result_scope.ParentDhcpServerRecordId to DHCPServerRecordId.

    3. Copy ScopeDetails of the row to Result_scope.

  3. Call the procedure GetDhcpOptions of ADM_DhcpOptionsTable with the following parameters:

    1. Param_addressfamily is set to InterNetwork.

    2. Param_ScopeRecordId is set to Result_scope.RecordId.

    3. Param_serverRecordId is set to Result_scope.ParentDhcpServerRecordId.

  4. Assign the Result_optionCollection to Result_scope.Options.

  5. Call GetAccessScopeForObjectIdAndType of ADM_AccessScopeAssociationTable passing the following parameters:

    1. Param_objectId is set to Param_Id

    2. Param_objectType is set to IpamObjectType.DhcpScopeV4 if addressfamily is InterNetwork or IpamObjectType.DhcpScopeV6 if addressfamily is InterNetworkV6. 

    3. Param_accessScopeId

    4. Param_objectInheritanceStatus

    5. Param_inheritanceId

  6. Assign Param_accessScopeId to Result_scope.AccessScopeId.

  7. Assign Param_objectInheritanceStatus to Result_scope.IsInheritedAccessScope.

  8. Return Result_scope from the procedure.