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_CRYPTO_H |
14 | #define QAPI_TYPES_CRYPTO_H |
15 | |
16 | #include "qapi/qapi-builtin-types.h" |
17 | |
18 | typedef enum QCryptoTLSCredsEndpoint { |
19 | QCRYPTO_TLS_CREDS_ENDPOINT_CLIENT, |
20 | QCRYPTO_TLS_CREDS_ENDPOINT_SERVER, |
21 | QCRYPTO_TLS_CREDS_ENDPOINT__MAX, |
22 | } QCryptoTLSCredsEndpoint; |
23 | |
24 | #define QCryptoTLSCredsEndpoint_str(val) \ |
25 | qapi_enum_lookup(&QCryptoTLSCredsEndpoint_lookup, (val)) |
26 | |
27 | extern const QEnumLookup QCryptoTLSCredsEndpoint_lookup; |
28 | |
29 | typedef enum QCryptoSecretFormat { |
30 | QCRYPTO_SECRET_FORMAT_RAW, |
31 | QCRYPTO_SECRET_FORMAT_BASE64, |
32 | QCRYPTO_SECRET_FORMAT__MAX, |
33 | } QCryptoSecretFormat; |
34 | |
35 | #define QCryptoSecretFormat_str(val) \ |
36 | qapi_enum_lookup(&QCryptoSecretFormat_lookup, (val)) |
37 | |
38 | extern const QEnumLookup QCryptoSecretFormat_lookup; |
39 | |
40 | typedef enum QCryptoHashAlgorithm { |
41 | QCRYPTO_HASH_ALG_MD5, |
42 | QCRYPTO_HASH_ALG_SHA1, |
43 | QCRYPTO_HASH_ALG_SHA224, |
44 | QCRYPTO_HASH_ALG_SHA256, |
45 | QCRYPTO_HASH_ALG_SHA384, |
46 | QCRYPTO_HASH_ALG_SHA512, |
47 | QCRYPTO_HASH_ALG_RIPEMD160, |
48 | QCRYPTO_HASH_ALG__MAX, |
49 | } QCryptoHashAlgorithm; |
50 | |
51 | #define QCryptoHashAlgorithm_str(val) \ |
52 | qapi_enum_lookup(&QCryptoHashAlgorithm_lookup, (val)) |
53 | |
54 | extern const QEnumLookup QCryptoHashAlgorithm_lookup; |
55 | |
56 | typedef enum QCryptoCipherAlgorithm { |
57 | QCRYPTO_CIPHER_ALG_AES_128, |
58 | QCRYPTO_CIPHER_ALG_AES_192, |
59 | QCRYPTO_CIPHER_ALG_AES_256, |
60 | QCRYPTO_CIPHER_ALG_DES_RFB, |
61 | QCRYPTO_CIPHER_ALG_3DES, |
62 | QCRYPTO_CIPHER_ALG_CAST5_128, |
63 | QCRYPTO_CIPHER_ALG_SERPENT_128, |
64 | QCRYPTO_CIPHER_ALG_SERPENT_192, |
65 | QCRYPTO_CIPHER_ALG_SERPENT_256, |
66 | QCRYPTO_CIPHER_ALG_TWOFISH_128, |
67 | QCRYPTO_CIPHER_ALG_TWOFISH_192, |
68 | QCRYPTO_CIPHER_ALG_TWOFISH_256, |
69 | QCRYPTO_CIPHER_ALG__MAX, |
70 | } QCryptoCipherAlgorithm; |
71 | |
72 | #define QCryptoCipherAlgorithm_str(val) \ |
73 | qapi_enum_lookup(&QCryptoCipherAlgorithm_lookup, (val)) |
74 | |
75 | extern const QEnumLookup QCryptoCipherAlgorithm_lookup; |
76 | |
77 | typedef enum QCryptoCipherMode { |
78 | QCRYPTO_CIPHER_MODE_ECB, |
79 | QCRYPTO_CIPHER_MODE_CBC, |
80 | QCRYPTO_CIPHER_MODE_XTS, |
81 | QCRYPTO_CIPHER_MODE_CTR, |
82 | QCRYPTO_CIPHER_MODE__MAX, |
83 | } QCryptoCipherMode; |
84 | |
85 | #define QCryptoCipherMode_str(val) \ |
86 | qapi_enum_lookup(&QCryptoCipherMode_lookup, (val)) |
87 | |
88 | extern const QEnumLookup QCryptoCipherMode_lookup; |
89 | |
90 | typedef enum QCryptoIVGenAlgorithm { |
91 | QCRYPTO_IVGEN_ALG_PLAIN, |
92 | QCRYPTO_IVGEN_ALG_PLAIN64, |
93 | QCRYPTO_IVGEN_ALG_ESSIV, |
94 | QCRYPTO_IVGEN_ALG__MAX, |
95 | } QCryptoIVGenAlgorithm; |
96 | |
97 | #define QCryptoIVGenAlgorithm_str(val) \ |
98 | qapi_enum_lookup(&QCryptoIVGenAlgorithm_lookup, (val)) |
99 | |
100 | extern const QEnumLookup QCryptoIVGenAlgorithm_lookup; |
101 | |
102 | typedef enum QCryptoBlockFormat { |
103 | Q_CRYPTO_BLOCK_FORMAT_QCOW, |
104 | Q_CRYPTO_BLOCK_FORMAT_LUKS, |
105 | Q_CRYPTO_BLOCK_FORMAT__MAX, |
106 | } QCryptoBlockFormat; |
107 | |
108 | #define QCryptoBlockFormat_str(val) \ |
109 | qapi_enum_lookup(&QCryptoBlockFormat_lookup, (val)) |
110 | |
111 | extern const QEnumLookup QCryptoBlockFormat_lookup; |
112 | |
113 | typedef struct QCryptoBlockOptionsBase QCryptoBlockOptionsBase; |
114 | |
115 | typedef struct QCryptoBlockOptionsQCow QCryptoBlockOptionsQCow; |
116 | |
117 | typedef struct QCryptoBlockOptionsLUKS QCryptoBlockOptionsLUKS; |
118 | |
119 | typedef struct QCryptoBlockCreateOptionsLUKS QCryptoBlockCreateOptionsLUKS; |
120 | |
121 | typedef struct QCryptoBlockOpenOptions QCryptoBlockOpenOptions; |
122 | |
123 | typedef struct QCryptoBlockCreateOptions QCryptoBlockCreateOptions; |
124 | |
125 | typedef struct QCryptoBlockInfoBase QCryptoBlockInfoBase; |
126 | |
127 | typedef struct QCryptoBlockInfoLUKSSlot QCryptoBlockInfoLUKSSlot; |
128 | |
129 | typedef struct QCryptoBlockInfoLUKSSlotList QCryptoBlockInfoLUKSSlotList; |
130 | |
131 | typedef struct QCryptoBlockInfoLUKS QCryptoBlockInfoLUKS; |
132 | |
133 | typedef struct QCryptoBlockInfo QCryptoBlockInfo; |
134 | |
135 | struct QCryptoBlockOptionsBase { |
136 | QCryptoBlockFormat format; |
137 | }; |
138 | |
139 | void qapi_free_QCryptoBlockOptionsBase(QCryptoBlockOptionsBase *obj); |
140 | |
141 | struct QCryptoBlockOptionsQCow { |
142 | bool has_key_secret; |
143 | char *key_secret; |
144 | }; |
145 | |
146 | void qapi_free_QCryptoBlockOptionsQCow(QCryptoBlockOptionsQCow *obj); |
147 | |
148 | struct QCryptoBlockOptionsLUKS { |
149 | bool has_key_secret; |
150 | char *key_secret; |
151 | }; |
152 | |
153 | void qapi_free_QCryptoBlockOptionsLUKS(QCryptoBlockOptionsLUKS *obj); |
154 | |
155 | struct QCryptoBlockCreateOptionsLUKS { |
156 | /* Members inherited from QCryptoBlockOptionsLUKS: */ |
157 | bool has_key_secret; |
158 | char *key_secret; |
159 | /* Own members: */ |
160 | bool has_cipher_alg; |
161 | QCryptoCipherAlgorithm cipher_alg; |
162 | bool has_cipher_mode; |
163 | QCryptoCipherMode cipher_mode; |
164 | bool has_ivgen_alg; |
165 | QCryptoIVGenAlgorithm ivgen_alg; |
166 | bool has_ivgen_hash_alg; |
167 | QCryptoHashAlgorithm ivgen_hash_alg; |
168 | bool has_hash_alg; |
169 | QCryptoHashAlgorithm hash_alg; |
170 | bool has_iter_time; |
171 | int64_t iter_time; |
172 | }; |
173 | |
174 | static inline QCryptoBlockOptionsLUKS *qapi_QCryptoBlockCreateOptionsLUKS_base(const QCryptoBlockCreateOptionsLUKS *obj) |
175 | { |
176 | return (QCryptoBlockOptionsLUKS *)obj; |
177 | } |
178 | |
179 | void qapi_free_QCryptoBlockCreateOptionsLUKS(QCryptoBlockCreateOptionsLUKS *obj); |
180 | |
181 | struct QCryptoBlockOpenOptions { |
182 | /* Members inherited from QCryptoBlockOptionsBase: */ |
183 | QCryptoBlockFormat format; |
184 | /* Own members: */ |
185 | union { /* union tag is @format */ |
186 | QCryptoBlockOptionsQCow qcow; |
187 | QCryptoBlockOptionsLUKS luks; |
188 | } u; |
189 | }; |
190 | |
191 | static inline QCryptoBlockOptionsBase *qapi_QCryptoBlockOpenOptions_base(const QCryptoBlockOpenOptions *obj) |
192 | { |
193 | return (QCryptoBlockOptionsBase *)obj; |
194 | } |
195 | |
196 | void qapi_free_QCryptoBlockOpenOptions(QCryptoBlockOpenOptions *obj); |
197 | |
198 | struct QCryptoBlockCreateOptions { |
199 | /* Members inherited from QCryptoBlockOptionsBase: */ |
200 | QCryptoBlockFormat format; |
201 | /* Own members: */ |
202 | union { /* union tag is @format */ |
203 | QCryptoBlockOptionsQCow qcow; |
204 | QCryptoBlockCreateOptionsLUKS luks; |
205 | } u; |
206 | }; |
207 | |
208 | static inline QCryptoBlockOptionsBase *qapi_QCryptoBlockCreateOptions_base(const QCryptoBlockCreateOptions *obj) |
209 | { |
210 | return (QCryptoBlockOptionsBase *)obj; |
211 | } |
212 | |
213 | void qapi_free_QCryptoBlockCreateOptions(QCryptoBlockCreateOptions *obj); |
214 | |
215 | struct QCryptoBlockInfoBase { |
216 | QCryptoBlockFormat format; |
217 | }; |
218 | |
219 | void qapi_free_QCryptoBlockInfoBase(QCryptoBlockInfoBase *obj); |
220 | |
221 | struct QCryptoBlockInfoLUKSSlot { |
222 | bool active; |
223 | bool has_iters; |
224 | int64_t iters; |
225 | bool has_stripes; |
226 | int64_t stripes; |
227 | int64_t key_offset; |
228 | }; |
229 | |
230 | void qapi_free_QCryptoBlockInfoLUKSSlot(QCryptoBlockInfoLUKSSlot *obj); |
231 | |
232 | struct QCryptoBlockInfoLUKSSlotList { |
233 | QCryptoBlockInfoLUKSSlotList *next; |
234 | QCryptoBlockInfoLUKSSlot *value; |
235 | }; |
236 | |
237 | void qapi_free_QCryptoBlockInfoLUKSSlotList(QCryptoBlockInfoLUKSSlotList *obj); |
238 | |
239 | struct QCryptoBlockInfoLUKS { |
240 | QCryptoCipherAlgorithm cipher_alg; |
241 | QCryptoCipherMode cipher_mode; |
242 | QCryptoIVGenAlgorithm ivgen_alg; |
243 | bool has_ivgen_hash_alg; |
244 | QCryptoHashAlgorithm ivgen_hash_alg; |
245 | QCryptoHashAlgorithm hash_alg; |
246 | int64_t payload_offset; |
247 | int64_t master_key_iters; |
248 | char *uuid; |
249 | QCryptoBlockInfoLUKSSlotList *slots; |
250 | }; |
251 | |
252 | void qapi_free_QCryptoBlockInfoLUKS(QCryptoBlockInfoLUKS *obj); |
253 | |
254 | struct QCryptoBlockInfo { |
255 | /* Members inherited from QCryptoBlockInfoBase: */ |
256 | QCryptoBlockFormat format; |
257 | /* Own members: */ |
258 | union { /* union tag is @format */ |
259 | QCryptoBlockInfoLUKS luks; |
260 | } u; |
261 | }; |
262 | |
263 | static inline QCryptoBlockInfoBase *qapi_QCryptoBlockInfo_base(const QCryptoBlockInfo *obj) |
264 | { |
265 | return (QCryptoBlockInfoBase *)obj; |
266 | } |
267 | |
268 | void qapi_free_QCryptoBlockInfo(QCryptoBlockInfo *obj); |
269 | |
270 | #endif /* QAPI_TYPES_CRYPTO_H */ |
271 | |