From c21dbf3e2bc3fe37cfcff2147e1bad167a8c89cb Mon Sep 17 00:00:00 2001 From: Philip Tricca Date: Sat, 3 Mar 2018 09:07:48 -0800 Subject: libtcti-socket: Remove old init function, data & refactor std init. Removing all of the old config stuff produced a number of simplification in the new init function. This commit also adds some unit tests for the new function that parses the conf string. Signed-off-by: Philip Tricca --- include/tcti/tcti_socket.h | 31 +++++-------------------------- 1 file changed, 5 insertions(+), 26 deletions(-) (limited to 'include') diff --git a/include/tcti/tcti_socket.h b/include/tcti/tcti_socket.h index d828417f..cdc5e215 100644 --- a/include/tcti/tcti_socket.h +++ b/include/tcti/tcti_socket.h @@ -27,20 +27,7 @@ #ifndef TCTI_SOCKET_H #define TCTI_SOCKET_H -#ifdef __cplusplus -extern "C" { -#endif - -#include "common.h" - -#include "sapi/tpm20.h" - -#define DEFAULT_SIMULATOR_TPM_PORT 2321 -#define TSS2_SIMULATOR_INTERFACE_INIT_FAILED ((TSS2_RC)(1 + TSS2_DRIVER_ERROR_LEVEL)) - -#define DEFAULT_HOSTNAME "127.0.0.1" - -#define TCTI_SOCKET_DEFAULT "tcp://127.0.0.1:2321" +#include /* * Command codes that may be sent to simulator through out of band command @@ -54,22 +41,14 @@ extern "C" { #define MS_SIM_NV_ON 11 #define TPM_SESSION_END 20 +#ifdef __cplusplus +extern "C" { +#endif + TSS2_RC PlatformCommand( TSS2_TCTI_CONTEXT *tctiContext, UINT32 cmd); -typedef struct { - const char *hostname; - uint16_t port; -} TCTI_SOCKET_CONF; - -TSS2_RC InitSocketTcti ( - TSS2_TCTI_CONTEXT *tctiContext, // OUT - size_t *contextSize, // IN/OUT - const TCTI_SOCKET_CONF *config, // IN - const uint8_t serverSockets - ) COMPILER_ATTR (deprecated); - TSS2_RC Tss2_Tcti_Socket_Init ( TSS2_TCTI_CONTEXT *tctiContext, size_t *size, -- cgit v1.2.3