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:
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.
If the Param_addressfamily is InterNetwork, initialize Result_scope to DhcpScopeV4. If the Param_addressfamily is InterNetworkV6, initialize Result_scope to DhcpScopeV6:
Set Result_scope.RecordId to RecordId.
Set Result_scope.ParentDhcpServerRecordId to DHCPServerRecordId.
Copy ScopeDetails of the row to Result_scope.
Call the procedure GetDhcpOptions of ADM_DhcpOptionsTable with the following parameters:
Param_addressfamily is set to InterNetwork.
Param_ScopeRecordId is set to Result_scope.RecordId.
Param_serverRecordId is set to Result_scope.ParentDhcpServerRecordId.
Assign the Result_optionCollection to Result_scope.Options.
Call GetAccessScopeForObjectIdAndType of ADM_AccessScopeAssociationTable passing the following parameters:
Param_objectId is set to Param_Id.
Param_objectType is set to IpamObjectType.DhcpScopeV4 if addressfamily is InterNetwork or IpamObjectType.DhcpScopeV6 if addressfamily is InterNetworkV6.
Param_accessScopeId.
Param_objectInheritanceStatus.
Param_inheritanceId.
Assign Param_accessScopeId to Result_scope.AccessScopeId.
Assign Param_objectInheritanceStatus to Result_scope.IsInheritedAccessScope.
Return Result_scope from the procedure.