context-util.h 1022 B

12345678910111213141516171819202122232425262728
  1. /* SPDX-License-Identifier: BSD-2-Clause */
  2. /***********************************************************************
  3. * Copyright (c) 2017-2018, Intel Corporation
  4. *
  5. * All rights reserved.
  6. ***********************************************************************/
  7. #ifndef CONTEXT_UTIL_H
  8. #define CONTEXT_UTIL_H
  9. #include "tss2_tcti.h"
  10. #include "tss2_sys.h"
  11. #include "test-options.h"
  12. /**
  13. * functions to setup TCTIs and SYS contexts using data from the common
  14. * options
  15. */
  16. TSS2_TCTI_CONTEXT *tcti_device_init(char const *device_name);
  17. TSS2_TCTI_CONTEXT *tcti_socket_init(char const *address, uint16_t port);
  18. TSS2_TCTI_CONTEXT *tcti_init_from_opts(test_opts_t * options);
  19. TSS2_SYS_CONTEXT *sys_init_from_opts(test_opts_t * options);
  20. TSS2_SYS_CONTEXT *sys_init_from_tcti_ctx(TSS2_TCTI_CONTEXT * tcti_ctx);
  21. void tcti_teardown(TSS2_TCTI_CONTEXT * tcti_context);
  22. void sys_teardown(TSS2_SYS_CONTEXT * sys_context);
  23. void sys_teardown_full(TSS2_SYS_CONTEXT * sys_context);
  24. #endif /* CONTEXT_UTIL_H */