def checkValidationVersion(self, chifLib, versionToCheck):
        """
        Check if the validation version matched the chifLib's validation version

        :param chifLib: reference to the ilorest-chif library
        :type chifLib: library handle

        :param version: the Scalable PMEM validation version to check
        :type integer

        :returns: True if the version is supported by the CHIF library, False if not
        :type Boolean
        """
        isSupported = False
        if chifLib:
            try:
                chifLib.supportsPMEMValidationVersion.argtypes = [ctypes.c_int]
                chifLib.supportsPMEMValidationVersion.restype = ctypes.c_bool
                isSupported = chifLib.supportsPMEMValidationVersion(
                    versionToCheck)
            except AttributeError:
                print(
                    "Old version of iLO CHIF library detected. Please get the latest version.\n"
                )
                Helpers.failNoChifLibrary()

        return isSupported
    def calculateMaxPmemGiB_inner(self, chifLib, configData,
                                  selectedDriveCollection):
        """ calls the function in the library given the structured inputs

        :param chifLib: ilorest-chif library
        :type chifLib: library handle

        :param configData: the configuration data.
        :type configData: LOGICALNVDIMMCONFIGDATA.

        :param selectedDriveCollection: the user selected backup drives.
        :type selectedDriveCollection: SELECTEDDRIVECOLLECTION.

        :returns: maximum available persistent memory (GiB).
        :rtype: long
        """
        maxPmemGiB = 0
        if chifLib:
            try:
                chifLib.calculateMaxPmemGiB.argtypes = [
                    ctypes.POINTER(LOGICALNVDIMMCONFIGDATA),
                    ctypes.POINTER(SELECTEDDRIVECOLLECTION)
                ]
                chifLib.calculateMaxPmemGiB.restype = c_ulonglong
                if selectedDriveCollection != None and selectedDriveCollection.count > 0:
                    maxPmemGiB = chifLib.calculateMaxPmemGiB(
                        ctypes.byref(configData),
                        ctypes.byref(selectedDriveCollection))
            except AttributeError:
                print(
                    "Unsupported version of iLO CHIF library detected. Please get the latest version.\n"
                )
                Helpers.failNoChifLibrary()

        return maxPmemGiB
    def calculateMaxPmemGiBAndBackupTime(self, chifLib, configured_pmem_GiB,
                                         configResource, listOfDrives):
        """ calculateMaxPmemGiBAndBackupTime Calculates the maximum available amount of persistent memory available,
        based on the system hardware and settings. 
        Also estimates the backup boot time based on configured Scalable PMEM size and drives.

        :param chifLib: ilorest-chif DLL
        :type chifLib: library handle
        
        :param configured_pmem_GiB: amount of Scalable PMEM configured
        :type configured_pmem_GiB: number to be converted to ctypes.clonglong

        :param configResource: dictionary of Scalable PMEM configuration data
        :type configResource: dictionary

        :param listOfDrives: list of ALL drives to be backup storage
        :type listOfDrives: list of drive objects

        :returns: maximum available persistent memory (GiB).
        :rtype: long
        """
        maxPmemGiB = 0
        backupBootSec = 0

        # get the configuration data
        if configResource:
            configData = self.constructConfigData(configResource)
            selectedDriveCollection = self.createSelectedDriveCollection(
                listOfDrives)
            if configData and selectedDriveCollection.count > 0:
                # first, check the validation version
                isSupportedVersion = self.checkValidationVersion(
                    chifLib, configData.validationVersion)
                if not isSupportedVersion:
                    print(
                        "Unsupported version of iLO CHIF library detected. Please get the latest version.\n"
                    )
                    Helpers.failNoChifLibrary()
                # then calculate maximum persistent memory, based on the configuration
                maxPmemGiB = self.calculateMaxPmemGiB_inner(
                    chifLib, configData, selectedDriveCollection)
                backupBootSec = self.estimateBackupBootTimeSec_inner(
                    chifLib, configured_pmem_GiB, configData,
                    selectedDriveCollection)
            else:
                return (0, 0)
        else:
            return (0, 0)

        return (maxPmemGiB, backupBootSec)
    def estimateBackupBootTimeSec_inner(self, chifLib, configured_pmem_GiB,
                                        configData, selectedDriveCollection):
        """
        Estimate the backup boot time (sec)
        
        :param chifLib: reference to the ilorest-chif-library
        :type chifLib: library handle
        
        :param: configured_pmem_GiB: amount of Scalable PMEM configured
        :type configured_pmem_GiB: number to be casted to a ctypes.ulonglong
        
        :param configData: the configuration data.
        :type configData: LOGICALNVDIMMCONFIGDATA.

        :param selectedDriveCollection: the user selected backup drives.
        :type selectedDriveCollection: SELECTEDDRIVECOLLECTION.

        :returns: estimated backup boot time (sec)
        :rtype: long
        """
        backupBootSec = 0
        if chifLib:
            try:
                chifLib.estimatePMEMBackupBootTimeSec.argtypes = [
                    c_ulonglong,
                    ctypes.POINTER(LOGICALNVDIMMCONFIGDATA),
                    ctypes.POINTER(SELECTEDDRIVECOLLECTION)
                ]
                chifLib.estimatePMEMBackupBootTimeSec.restype = c_ulonglong
                if selectedDriveCollection != None and selectedDriveCollection.count > 0:
                    backupBootSec = chifLib.estimatePMEMBackupBootTimeSec(
                        c_ulonglong(configured_pmem_GiB),
                        ctypes.byref(configData),
                        ctypes.byref(selectedDriveCollection))
            except AttributeError:
                print(
                    "Unsupported version of iLO CHIF library detected. Please get the latest version.\n"
                )
                Helpers.failNoChifLibrary()

        return backupBootSec