NingSun | 535535b | 2018-02-28 18:24:31 -0800 | [diff] [blame] | 1 | //**********************************************************************; |
| 2 | // Copyright (c) 2018, Intel Corporation |
| 3 | // All rights reserved. |
| 4 | // |
| 5 | // Redistribution and use in source and binary forms, with or without |
| 6 | // modification, are permitted provided that the following conditions are met: |
| 7 | // |
| 8 | // 1. Redistributions of source code must retain the above copyright notice, |
| 9 | // this list of conditions and the following disclaimer. |
| 10 | // |
| 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, |
| 12 | // this list of conditions and the following disclaimer in the documentation |
| 13 | // and/or other materials provided with the distribution. |
| 14 | // |
| 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 17 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 18 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
| 19 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 20 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 21 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 22 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 23 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 24 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
| 25 | // THE POSSIBILITY OF SUCH DAMAGE. |
| 26 | //**********************************************************************; |
| 27 | |
| 28 | #include <sapi/tpm20.h> |
| 29 | |
| 30 | #ifndef LIB_TPM2_TCTI_LDR_H_ |
| 31 | #define LIB_TPM2_TCTI_LDR_H_ |
| 32 | |
| 33 | /** |
| 34 | * Loads a TCTI from a friendly name, library name, or path. |
| 35 | * For example |
| 36 | * friendly: path = tabrmd |
| 37 | * library name: path = libtcti-socket.so |
| 38 | * full path: path = /home/user/lib/libtcti-custom.so |
| 39 | * @param path |
| 40 | * The path/library to load. |
| 41 | * @param opts |
| 42 | * The tcti option configs. |
| 43 | * @return |
| 44 | * A tcti context on success or NULL on failure. |
| 45 | */ |
| 46 | TSS2_TCTI_CONTEXT *tpm2_tcti_ldr_load(const char *path, const char *opts); |
| 47 | |
| 48 | /** |
| 49 | * Returns the loaded TCTIs information structure, |
| 50 | * which contains the initialization routine, description |
| 51 | * and help string amongst other things. |
| 52 | * @return |
| 53 | * NULL if no TCTI is loaded, else the info structure pointer. |
| 54 | */ |
| 55 | const TSS2_TCTI_INFO *tpm2_tcti_ldr_getinfo(void); |
| 56 | |
| 57 | /** |
| 58 | * Unloads the tcti loaded via tpm2_tcti_ldr_load(); |
| 59 | */ |
| 60 | void tpm2_tcti_ldr_unload(void); |
| 61 | |
| 62 | #endif /* LIB_TPM2_TCTI_LDR_H_ */ |