xref: /netbsd-src/crypto/external/cpl/trousers/dist/src/include/hosttable.h (revision 9573673d78c64ea1eac42d7f2e9521be89932ae5)
1 
2 /*
3  * Licensed Materials - Property of IBM
4  *
5  * trousers - An open source TCG Software Stack
6  *
7  * (C) Copyright International Business Machines Corp. 2004-2006
8  *
9  */
10 
11 #ifndef _HOSTTABLE_H_
12 #define _HOSTTABLE_H_
13 
14 #include "rpc_tcstp.h"
15 #include "threads.h"
16 
17 
18 #define CONNECTION_TYPE_TCP_PERSISTANT	1
19 
20 struct host_table_entry {
21 	struct host_table_entry *next;
22 	TSS_HCONTEXT tspContext;
23 	TCS_CONTEXT_HANDLE tcsContext;
24 	BYTE *hostname;
25 	int type;
26 	int socket;
27 	struct tcsd_comm_data comm;
28 	MUTEX_DECLARE(lock);
29 };
30 
31 struct host_table {
32 	struct host_table_entry *entries;
33 	MUTEX_DECLARE(lock);
34 };
35 
36 extern struct host_table *ht;
37 struct host_table_entry *get_table_entry(TCS_CONTEXT_HANDLE);
38 void put_table_entry(struct host_table_entry *);
39 TSS_RESULT __tspi_add_table_entry(TSS_HCONTEXT, BYTE *, int, struct host_table_entry **);
40 void remove_table_entry(TCS_CONTEXT_HANDLE);
41 
42 
43 #endif
44