3.1.1.1.3.2.2 GetIPAddressFromTable

The GetIPAddressFromTable procedure retrieves the IP address information in the form of IpamIPv4Address or IpamIPv6Address. The type of data returned is either IpamIPv4Address or IpamIPv6Address based on the simple table within ADM_IPAddressTable against which the processing steps are performed.

The following are the input parameters for this procedure:

Param_Id: A 64-bit signed integer that identifies the address for which the information is being retrieved.

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.

The following is the output parameter from this procedure.

result: This is the address information in the form of IpamIPv4Address or IpamIPv6Address, corresponding to the Param_Id specified in the input parameter. If the Param_addressfamily is InterNetwork, the procedure returns IpamIPv4Address, and if it is InterNetworkV6, the procedure returns IpamIPv6Address.

The following are the processing steps involved:

  1. Look up the row with RecordId equal to Param_Id from ADM_IPAddressTable.

  2. If no valid row is present, assign NULL to result and return the same.

  3. Initialize result with IpamIPv4Address if Param_addressfamily is InterNetwork or with IpamIPv6Address if Param_addressfamily is InterNetworkV6:

    1. Assign RecordId to result.RecordId.

    2. Assign RangeRecordId to result.ParentIPRangeRecordId.

    3. Copy AddressDetails to result.

  4. If RangeRecordId is not 0, the address is mapped to an address range. Perform the following additional processing:

    1. Retrieve the range row from ADM_IPRangeTable having RecordId being RangeRecordId.

    2. Copy the StartIPAddress and EndIPAddress of the range row into result.ParentIPRangeStartIP and result.ParentIPRangeEndIP respectively.

  5. If the AddressAssignment is Dynamic for the range row, the details pertaining to the DHCP configuration related to the address are retrieved as follows:

    1. Look up the ADM_DHCPScopesTable for the row having RecordId value being the ScopeRecordId in the range row:

      1. Copy the ScopeRecordId into result.DhcpScopeId.

      2. Copy Description into result.DhcpScopeDescription.

      3. Copy the ScopeName into result.DhcpScopeName.

      4. Copy the ScopeId into result.DhcpScopeId.

  6. If there is an associated reservation, the reservation details are retrieved as follows:

    1. Look up ADM_DHCPReservationTable having ScopeRecordId value being result.DhcpScopeId and IPAddressRecordId value being result.RecordId.

    2. If an entry is found, retrieve the following values:

      1. Copy ReservationDescription to result.ReservationDescription.

      2. Copy RecordId to result.ReservationId.

      3. Copy ReservationName to result.ReservationName.

      4. Copy ReservationSyncStatus to result.ReservationSyncStatus.

  7. Retrieve the DHCP server information by invoking the GetDHCPServerFromTable by passing the DhcpServerRecordId as Param_Id and Param_addressfamily. Let the result returned be Result_DhcpServer. Copy Result_DhcpServer.ServerRoleInfo.ServerInfo.Name to result.ReservationServerName.

  8. If there is an associated forward lookup DNS zone registration, the registration details are retrieved as follows:

    1. Look up ADM_AddressDNSForwardLookupTable for a row with AddressRecordId value being result.RecordId. If an entry is found, retrieve the following values:

      1. Copy RecordId as result.DnsForwardLookupZoneRecordId.

      2. Copy DNSZoneRecordId as result.DnsZoneId.

      3. Copy DNSForwardLookupRegistrationDetails to result.

    2. Look up the DNS zone information from ADM_DNSForwardLookupTable having RecordId equal to result.DnsZoneId. If an entry is found, retrieve the following values:

      1. Copy Name to result.DnsZoneName.

      2. Copy DNSServerRecordId to result.DnsForwardLookupZoneDnsServerId.

    3. Retrieve DNS server information by invoking the GetDNSServerFromTable by passing the result.DnsForwardLookupZoneDnsServerId as Param_Id and Param_addressfamily. Let the result returned be Result_DnsServer and copy the following value:

      1. Copy Result_DnsServer.ServerRoleInfo.ServerInfo.Name to result.DnsForwardLookupZoneServerName.

  9. If an associated reverse lookup DNS zone registration is found, the registration details are retrieved as follows:

    1. Look up ADM_AddressDNSReverseLookupTable for a row with AddressRecordId being result.RecordId. If an entry is found, retrieve the following values:

      1. Copy RecordId to result.DnsReverseLookupZoneRecordId.

      2. Copy DNSZoneRecordId to result.DnsReverseLookupZoneId.

      3. Copy DNSServerRecordId to result.DnsReverseLookupZoneServerId.

      4. Copy DNSReverseLookupRegistrationDetails to result.

    2. Look up the DNS zone information from ADM_DNSReverseLookupTable having RecordId equal to result.DnsReverseLookupZoneId and copy the following values:

      1. Copy Name to result.DnsReverseLookupZoneName.

      2. Copy ZoneDetails.Prefix to result.DnsReverseLookupZonePrefix.

  10. Retrieve the DNS server information by invoking the GetDNSServerFromTable by passing the result.DnsReverseLookupZoneDnsServerId as Param_Id and Param_addressfamily. Let the result returned be Result_DnsServer. Copy Result_DnsServer.ServerRoleInfo.Name to result.DnsReverseLookupZoneServerName.

  11. If result.ExpiryDate is set and is already past when compared to the current date, set result.IsExpired to TRUE. Otherwise set result.IsExpired to FALSE.

  12. If result.ExpiryDate is set, result.IsExpired is FALSE and the difference between current date and result.ExpiryDate is less than ADM_CommonProperties.ExpiryAlertThreshold, set result.InWarningPeriod to TRUE. Otherwise set result.InWarningPeriod to FALSE.

  13. Retrieve the custom field values for the address object by calling the GetCustomFieldValues procedure of ADM_CustomFieldValuesAssociationTable passing the following parameters:

    1. Param_ObjectType is set to EnumerationObjectType.IPAddress.

    2. Param_addressFamily is passed as is.

    3. Result.RecordId is passed as Param_ObjectRecordId.

  14. Assign the Result_CustomFieldValueList to result.CustomFieldValues.

  15. Assign the Result_CustomFieldPartialList to result.PartialCustomFieldValues.

  16. Return result as the output of the procedure.