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 10 #include "tss2_tcti.h" 11 #include "tss2_sys.h" 12 13 #include "test-options.h" 14 15 /** 16 * functions to setup TCTIs and SAPI contexts using data from the common 17 * options 18 */ 19 TSS2_TCTI_CONTEXT *tcti_device_init(char const *device_name); 20 TSS2_TCTI_CONTEXT *tcti_socket_init(char const *address, uint16_t port); 21 TSS2_TCTI_CONTEXT *tcti_init_from_opts(test_opts_t * options); 22 TSS2_SYS_CONTEXT *sapi_init_from_opts(test_opts_t * options); 23 TSS2_SYS_CONTEXT *sapi_init_from_tcti_ctx(TSS2_TCTI_CONTEXT * tcti_ctx); 24 void tcti_teardown(TSS2_TCTI_CONTEXT * tcti_context); 25 void sapi_teardown(TSS2_SYS_CONTEXT * sapi_context); 26 void sapi_teardown_full(TSS2_SYS_CONTEXT * sapi_context); 27 28 #endif /* CONTEXT_UTIL_H */ 29