~ubuntu-branches/ubuntu/precise/trousers/precise-proposed

« back to all changes in this revision

Viewing changes to src/include/auth_mgr.h

  • Committer: Bazaar Package Importer
  • Author(s): William Lima
  • Date: 2007-04-18 16:39:38 UTC
  • Revision ID: james.westby@ubuntu.com-20070418163938-opscl2mvvi76jiec
Tags: upstream-0.2.9.1
ImportĀ upstreamĀ versionĀ 0.2.9.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 _AUTH_MGR_H_
 
12
#define _AUTH_MGR_H_
 
13
 
 
14
struct auth_map
 
15
{
 
16
        TSS_BOOL full;
 
17
        TCS_AUTHHANDLE auth;
 
18
        TCS_CONTEXT_HANDLE ctx;
 
19
};
 
20
 
 
21
/*
 
22
 * it appears that there's no way to query a v1.1 TPM for the
 
23
 * max number of simultaneous auth sessions. We'll make the
 
24
 * default relatively large and let the TPM return
 
25
 * TCPA_RESOURCES to tell us when we cross the line.
 
26
 */
 
27
#define AUTH_TABLE_SIZE                 (2 * tcsd_options.num_threads)
 
28
#define TSS_DEFAULT_OVERFLOW_AUTHS      (AUTH_TABLE_SIZE - 2)
 
29
 
 
30
struct _auth_mgr
 
31
{
 
32
        short max_auth_sessions;
 
33
        short open_auth_sessions;
 
34
        short sleeping_threads;
 
35
        pthread_cond_t **overflow;      /* queue of TCS contexts waiting for an
 
36
                                           auth session to become available */
 
37
        int of_head, of_tail;           /* head and tail of the overflow queue */
 
38
        struct auth_map *auth_mapper; /* table of currently loaded
 
39
                                                         auth sessions */
 
40
} auth_mgr;
 
41
 
 
42
#endif