aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPhilip Tricca <philip.b.tricca@intel.com>2018-03-03 09:07:48 -0800
committerAndreas Fuchs <andreas.fuchs@sit.fraunhofer.de>2018-03-05 10:07:49 +0100
commitc21dbf3e2bc3fe37cfcff2147e1bad167a8c89cb (patch)
tree6b88bf3d658b165842f4ef90a1ab7e740ed78886 /include
parentc560204d4b0151776cad75f4f812a76206d3c120 (diff)
downloadtpm2-tss-c21dbf3e2bc3fe37cfcff2147e1bad167a8c89cb.tar.gz
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 <philip.b.tricca@intel.com>
Diffstat (limited to 'include')
-rw-r--r--include/tcti/tcti_socket.h31
1 files changed, 5 insertions, 26 deletions
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 <sapi/tss2_tcti.h>
/*
* 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,