GetNitoMetadataFromMemory Function

The GetNitoMetadataFromMemory function receives information about the NITO file in nitoMem and nitoMemLength, which is a pointer to a memory buffer loaded with the NITO file contents and an integer indicating the size of the NITO memory buffer, respectively. Once metadata is retrieved, it copies the data for each parameter set into metadataArray, an array of NvSIPLNitoMetadata struct (defined in the NvSIPLNitoMetadata and Related Constants section above). metadataArrayLength is an integer which represents length of this array (for example, the maximum number of elements that can be stored), used to guarantee there is enough storage space for all retrieved metadata tuples (ID, schema hash, data hash). The function also updates the metadataCount variable to indicate the number of metadata tuples retrieved.

Declaration

    SIPLStatus GetNitoMetadataFromMemory(
        uint8_t const *const nitoMem, 
        size_t const nitoMemLength, 
        NvSIPLNitoMetadata *const metadataArray, 
        size_t const metadataArrayLength, 
        size_t *const metadataCount)

Parameters

  • nitoMem: Specifies the input pointer to the memory containing the NITO buffer.
  • nitoMemLength: Specifies the length (in bytes) of the input NITO buffer. The buffer length must be between 1 byte and 6MB (maximum NITO file size).
  • metadataArray: Specifies the output pointer to the NvSIPLNitoMetadata struct array that will store the retrieved metadata.
  • metadataArrayLength: Specifies the maximum number of elements that can be stored in the NvSIPLNitoMetadata struct array.
  • metadataCount: Specifies the output pointer to a location to store how many metadata tuples (ID, Schema Hash, Data Hash) were retrieved by the operation.

Return Value

NVSIPL_STATUS_OK – Success

NVSIPL_STATUS_BAD_ARGUMENT – Invalid parameters received, or more metadata tuples retrieved than maximum NvSIPLNitoMetadata struct array length indicated by metadataArrayLength.

NVSIPL_STATUS_INVALID_STATE – Invalid state occurred

NVSIPL_STATUS_OUT_OF_MEMORY – Memory allocation failed

NVSIPL_STATUS_ERROR – Error occurred