3
* Licensed Materials - Property of IBM
5
* trousers - An open source TCG Software Stack
7
* (C) Copyright International Business Machines Corp. 2004-2006
16
#include "trousers/tss.h"
17
#include "trousers/trousers.h"
18
#include "trousers_types.h"
19
#include "spi_utils.h"
21
#include "hosttable.h"
22
#include "tcsd_wrap.h"
23
#include "rpc_tcstp_tsp.h"
27
RPC_OpenContext_TP(struct host_table_entry* hte,
29
TCS_CONTEXT_HANDLE* tcsContext)
33
initData(&hte->comm, 0);
34
hte->comm.hdr.u.ordinal = TCSD_ORD_OPENCONTEXT;
35
result = sendTCSDPacket(hte);
37
if (result == TSS_SUCCESS)
38
result = hte->comm.hdr.u.result;
40
if (result == TSS_SUCCESS) {
41
if (getData(TCSD_PACKET_TYPE_UINT32, 0, tcsContext, 0, &hte->comm))
42
return TSPERR(TSS_E_INTERNAL_ERROR);
44
LogDebugFn("Received TCS Context: 0x%x", *tcsContext);
46
if (getData(TCSD_PACKET_TYPE_UINT32, 1, tpm_version, 0, &hte->comm))
47
return TSPERR(TSS_E_INTERNAL_ERROR);
54
RPC_CloseContext_TP(struct host_table_entry *hte)
58
initData(&hte->comm, 1);
59
hte->comm.hdr.u.ordinal = TCSD_ORD_CLOSECONTEXT;
60
LogDebugFn("TCS Context: 0x%x", hte->tcsContext);
62
if (setData(TCSD_PACKET_TYPE_UINT32, 0, &hte->tcsContext, 0, &hte->comm))
63
return TSPERR(TSS_E_INTERNAL_ERROR);
65
result = sendTCSDPacket(hte);
67
if (result == TSS_SUCCESS)
68
result = hte->comm.hdr.u.result;
74
RPC_FreeMemory_TP(struct host_table_entry *hte,
75
BYTE * pMemory) /* in */