1 | /* AUTOMATICALLY GENERATED, DO NOT MODIFY */ |
2 | |
3 | /* |
4 | * Schema-defined QAPI types |
5 | * |
6 | * Copyright IBM, Corp. 2011 |
7 | * Copyright (c) 2013-2018 Red Hat Inc. |
8 | * |
9 | * This work is licensed under the terms of the GNU LGPL, version 2.1 or later. |
10 | * See the COPYING.LIB file in the top-level directory. |
11 | */ |
12 | |
13 | #ifndef QAPI_TYPES_TPM_H |
14 | #define QAPI_TYPES_TPM_H |
15 | |
16 | #include "qapi/qapi-builtin-types.h" |
17 | |
18 | typedef enum TpmModel { |
19 | TPM_MODEL_TPM_TIS, |
20 | TPM_MODEL_TPM_CRB, |
21 | TPM_MODEL__MAX, |
22 | } TpmModel; |
23 | |
24 | #define TpmModel_str(val) \ |
25 | qapi_enum_lookup(&TpmModel_lookup, (val)) |
26 | |
27 | extern const QEnumLookup TpmModel_lookup; |
28 | |
29 | typedef struct TpmModelList TpmModelList; |
30 | |
31 | typedef enum TpmType { |
32 | TPM_TYPE_PASSTHROUGH, |
33 | TPM_TYPE_EMULATOR, |
34 | TPM_TYPE__MAX, |
35 | } TpmType; |
36 | |
37 | #define TpmType_str(val) \ |
38 | qapi_enum_lookup(&TpmType_lookup, (val)) |
39 | |
40 | extern const QEnumLookup TpmType_lookup; |
41 | |
42 | typedef struct TpmTypeList TpmTypeList; |
43 | |
44 | typedef struct TPMPassthroughOptions TPMPassthroughOptions; |
45 | |
46 | typedef struct TPMEmulatorOptions TPMEmulatorOptions; |
47 | |
48 | typedef struct q_obj_TPMPassthroughOptions_wrapper q_obj_TPMPassthroughOptions_wrapper; |
49 | |
50 | typedef struct q_obj_TPMEmulatorOptions_wrapper q_obj_TPMEmulatorOptions_wrapper; |
51 | |
52 | typedef enum TpmTypeOptionsKind { |
53 | TPM_TYPE_OPTIONS_KIND_PASSTHROUGH, |
54 | TPM_TYPE_OPTIONS_KIND_EMULATOR, |
55 | TPM_TYPE_OPTIONS_KIND__MAX, |
56 | } TpmTypeOptionsKind; |
57 | |
58 | #define TpmTypeOptionsKind_str(val) \ |
59 | qapi_enum_lookup(&TpmTypeOptionsKind_lookup, (val)) |
60 | |
61 | extern const QEnumLookup TpmTypeOptionsKind_lookup; |
62 | |
63 | typedef struct TpmTypeOptions TpmTypeOptions; |
64 | |
65 | typedef struct TPMInfo TPMInfo; |
66 | |
67 | typedef struct TPMInfoList TPMInfoList; |
68 | |
69 | struct TpmModelList { |
70 | TpmModelList *next; |
71 | TpmModel value; |
72 | }; |
73 | |
74 | void qapi_free_TpmModelList(TpmModelList *obj); |
75 | |
76 | struct TpmTypeList { |
77 | TpmTypeList *next; |
78 | TpmType value; |
79 | }; |
80 | |
81 | void qapi_free_TpmTypeList(TpmTypeList *obj); |
82 | |
83 | struct TPMPassthroughOptions { |
84 | bool has_path; |
85 | char *path; |
86 | bool has_cancel_path; |
87 | char *cancel_path; |
88 | }; |
89 | |
90 | void qapi_free_TPMPassthroughOptions(TPMPassthroughOptions *obj); |
91 | |
92 | struct TPMEmulatorOptions { |
93 | char *chardev; |
94 | }; |
95 | |
96 | void qapi_free_TPMEmulatorOptions(TPMEmulatorOptions *obj); |
97 | |
98 | struct q_obj_TPMPassthroughOptions_wrapper { |
99 | TPMPassthroughOptions *data; |
100 | }; |
101 | |
102 | struct q_obj_TPMEmulatorOptions_wrapper { |
103 | TPMEmulatorOptions *data; |
104 | }; |
105 | |
106 | struct TpmTypeOptions { |
107 | TpmTypeOptionsKind type; |
108 | union { /* union tag is @type */ |
109 | q_obj_TPMPassthroughOptions_wrapper passthrough; |
110 | q_obj_TPMEmulatorOptions_wrapper emulator; |
111 | } u; |
112 | }; |
113 | |
114 | void qapi_free_TpmTypeOptions(TpmTypeOptions *obj); |
115 | |
116 | struct TPMInfo { |
117 | char *id; |
118 | TpmModel model; |
119 | TpmTypeOptions *options; |
120 | }; |
121 | |
122 | void qapi_free_TPMInfo(TPMInfo *obj); |
123 | |
124 | struct TPMInfoList { |
125 | TPMInfoList *next; |
126 | TPMInfo *value; |
127 | }; |
128 | |
129 | void qapi_free_TPMInfoList(TPMInfoList *obj); |
130 | |
131 | #endif /* QAPI_TYPES_TPM_H */ |
132 | |