Profile module
Feature API » Internals of Feature API

## Functions

void | ifapi_profiles_finalize (IFAPI_PROFILES *profiles)
TSS2_RC | ifapi_profiles_get (const IFAPI_PROFILES *profiles, const char *name, const IFAPI_PROFILE **profile)
TSS2_RC | ifapi_profiles_initialize_async (IFAPI_PROFILES *profiles, IFAPI_IO *io, const char *profilesdir, const char *defaultprofile)
TSS2_RC | ifapi_profiles_initialize_finish (IFAPI_PROFILES *profiles, IFAPI_IO *io)

## Detailed Description

Provides functions for the handling of profiles stored in the object store.

## Function Documentation

## ifapi_profiles_finalize()

void ifapi_profiles_finalize | ( | IFAPI_PROFILES * | profiles | ) |

Sanitizes and frees internal data structures of loaded profiles' information.

Parameters

  [in,out] | profiles | The context for the profiles information.

## ifapi_profiles_get()

TSS2_RC ifapi_profiles_get | ( | const IFAPI_PROFILES * | profiles,
|  | const char * | name,
|  | const IFAPI_PROFILE ** | profile )

Return the profile data for a given profile name.

Returns a (const, not to be free'd) pointer to the profile data for a requested profile. If a NULL profile is requesten, then the default profile is returned. If a keypath is passed in, then the prefix is analysed. If that keypath starts with a profile then this profile is returned. Otherwise the default profile is returned.

Parameters

  [in] | profiles | The profiles context
  [in] | name | The name of the profile or the keypath
  [out] | profile | The pointer to the profile data.

Return values

  TSS2_RC_SUCCESS | on success.
  TSS2_FAPI_RC_BAD_REFERENCE | if NULL pointers were passed in.
  TSS2_FAPI_RC_BAD_VALUE | if a profile is not found.

## ifapi_profiles_initialize_async()

TSS2_RC ifapi_profiles_initialize_async | ( | IFAPI_PROFILES * | profiles,
|  | IFAPI_IO * | io,
|  | const char * | profilesdir,
|  | const char * | defaultprofile )

Initialize the profiles information in the context in an asynchronous way

Load the profile information from disk, fill the dictionary of loaded profiles and fill the default profile information into the context.

Call ifapi_profiles_initialize_finish to complete the operation.

Parameters

  [in,out] | profiles | The context for the profiles information.
  [in,out] | io | The input/output context being used for file I/O.
  [in] | profilesdir | The directory to load profile information from.
  [in] | defaultprofile | The name of the default profile to use.

Return values

  TSS2_RC_SUCCESS | on success.
  TSS2_FAPI_RC_BAD_REFERENCE | if NULL pointers were passed in.
  TSS2_FAPI_RC_BAD_VALUE | if the profilesdir does not exist or is empty.
  TSS2_FAPI_RC_IO_ERROR | if creation of log_dir failed or log_dir is not writable.
  TSS2_FAPI_RC_MEMORY | if memory allocation failed.

## ifapi_profiles_initialize_finish()

TSS2_RC ifapi_profiles_initialize_finish | ( | IFAPI_PROFILES * | profiles,
|  | IFAPI_IO * | io )

Initialize the profiles information in the context in an asynchronous way

Call after ifapi_profiles_initialize_async to complete the operation.

Parameters

  [in,out] | profiles | The context for the profiles information.
  [in,out] | io | The input/output context being used for file I/O.

Return values

  TSS2_RC_SUCCESS | on success.
  TSS2_FAPI_RC_BAD_REFERENCE | if NULL pointers were passed in.
  TSS2_FAPI_RC_BAD_VALUE | if a profile could not be loaded.
  TSS2_FAPI_RC_IO_ERROR | if creation of log_dir failed or log_dir is not writable.
  TSS2_FAPI_RC_MEMORY | if memory allocation failed.
  TSS2_FAPI_RC_TRY_AGAIN | if the I/O operation is not finished yet and this function needs to be called again.