~ubuntu-branches/ubuntu/utopic/xen/utopic

« back to all changes in this revision

Viewing changes to tools/vtpm_manager/migration/vtpm_migrator.h

  • Committer: Bazaar Package Importer
  • Author(s): Bastian Blank
  • Date: 2010-05-06 15:47:38 UTC
  • mto: (1.3.1) (15.1.1 sid) (4.1.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20100506154738-agoz0rlafrh1fnq7
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// ===================================================================
 
2
// 
 
3
// Copyright (c) 2005, Intel Corp.
 
4
// All rights reserved.
 
5
//
 
6
// Redistribution and use in source and binary forms, with or without 
 
7
// modification, are permitted provided that the following conditions 
 
8
// are met:
 
9
//
 
10
//   * Redistributions of source code must retain the above copyright 
 
11
//     notice, this list of conditions and the following disclaimer.
 
12
//   * Redistributions in binary form must reproduce the above 
 
13
//     copyright notice, this list of conditions and the following 
 
14
//     disclaimer in the documentation and/or other materials provided 
 
15
//     with the distribution.
 
16
//   * Neither the name of Intel Corporation nor the names of its 
 
17
//     contributors may be used to endorse or promote products derived
 
18
//     from this software without specific prior written permission.
 
19
//
 
20
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 
21
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
 
22
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
 
23
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
 
24
// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 
25
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 
26
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
 
27
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 
28
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
 
29
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
 
30
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 
31
// OF THE POSSIBILITY OF SUCH DAMAGE.
 
32
// ===================================================================
 
33
// 
 
34
// vtpm_migrator.h
 
35
// 
 
36
//  Public Interface header for VTPM Migrator 
 
37
//
 
38
// ==================================================================
 
39
 
 
40
#ifndef __VTPM_MIGRATOR_H__
 
41
#define __VTPM_MIGRATOR_H__
 
42
 
 
43
#define VTPM_MTAG_REQ 0x02c1
 
44
#define VTPM_MTAG_RSP 0x02c4
 
45
 
 
46
// Header sizes. 
 
47
#define VTPM_COMMAND_HEADER_SIZE ( 2 + 4 + 4)
 
48
//               sizeof(TPM_TAG + UINT32 + TPM_COMMAND_CODE)
 
49
 
 
50
//*********************** Connection Info **************************
 
51
#define VTPM_MIG_PORT 48879 
 
52
 
 
53
//************************ Command Codes ***************************
 
54
#define VTPM_MORD_MIG_STEP1     0x00
 
55
#define VTPM_MORD_MIG_STEP2     0x01
 
56
#define VTPM_MORD_MIG_STEP3     0x02
 
57
#define VTPM_MORD_MIG_STEP4     0x03
 
58
 
 
59
//************************ Return Codes ****************************
 
60
#define VTPM_SUCCESS               0
 
61
#define VTPM_FAIL                  1
 
62
 
 
63
/******************* Command Parameter API *************************
 
64
 
 
65
VTPM Command Format
 
66
  tpm tag: 2 bytes
 
67
  command size: 4 bytes         // Size of command including header but not DMI
 
68
  ord: 4 bytes                  // Command ordinal above
 
69
  parameters: size - 10 bytes   // Command Parameter
 
70
 
 
71
VTPM Response Format
 
72
  tpm tag: 2 bytes
 
73
  response_size: 4 bytes
 
74
  status: 4 bytes         
 
75
  parameters: size - 10 bytes
 
76
 
 
77
 
 
78
VTPM_Mig_Phase1:
 
79
    Unsupported: (Handled by scripts)
 
80
    
 
81
VTPM_Mig_Phase2
 
82
  Input Parameters:
 
83
    domain_name_size: 4 bytes
 
84
    domain_name : domain_name_size bytes
 
85
  Output Parameters:
 
86
    pub_exp_size: 4 bytes
 
87
    pub_exp: pub_exp_size bytes
 
88
    pub_mod_size: 4 bytes
 
89
    pub_mod: pub_mod_size bytes
 
90
 
 
91
VTPM_Mig_Phase3
 
92
  Input Parameters:
 
93
    vtpm_state_size: 4 bytes
 
94
    vtpm_state: vtpm_state_size bytes
 
95
  Output Parameters:
 
96
    none
 
97
 
 
98
VTPM_Mig_Phase4
 
99
    Unsupported: (Handled by scripts)
 
100
 
 
101
 
 
102
*********************************************************************/
 
103
 
 
104
#endif //_VTPM_MANAGER_H_