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
18typedef 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
27extern const QEnumLookup QCryptoTLSCredsEndpoint_lookup;
28
29typedef 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
38extern const QEnumLookup QCryptoSecretFormat_lookup;
39
40typedef 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
54extern const QEnumLookup QCryptoHashAlgorithm_lookup;
55
56typedef 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
75extern const QEnumLookup QCryptoCipherAlgorithm_lookup;
76
77typedef 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
88extern const QEnumLookup QCryptoCipherMode_lookup;
89
90typedef 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
100extern const QEnumLookup QCryptoIVGenAlgorithm_lookup;
101
102typedef 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
111extern const QEnumLookup QCryptoBlockFormat_lookup;
112
113typedef struct QCryptoBlockOptionsBase QCryptoBlockOptionsBase;
114
115typedef struct QCryptoBlockOptionsQCow QCryptoBlockOptionsQCow;
116
117typedef struct QCryptoBlockOptionsLUKS QCryptoBlockOptionsLUKS;
118
119typedef struct QCryptoBlockCreateOptionsLUKS QCryptoBlockCreateOptionsLUKS;
120
121typedef struct QCryptoBlockOpenOptions QCryptoBlockOpenOptions;
122
123typedef struct QCryptoBlockCreateOptions QCryptoBlockCreateOptions;
124
125typedef struct QCryptoBlockInfoBase QCryptoBlockInfoBase;
126
127typedef struct QCryptoBlockInfoLUKSSlot QCryptoBlockInfoLUKSSlot;
128
129typedef struct QCryptoBlockInfoLUKSSlotList QCryptoBlockInfoLUKSSlotList;
130
131typedef struct QCryptoBlockInfoLUKS QCryptoBlockInfoLUKS;
132
133typedef struct QCryptoBlockInfo QCryptoBlockInfo;
134
135struct QCryptoBlockOptionsBase {
136 QCryptoBlockFormat format;
137};
138
139void qapi_free_QCryptoBlockOptionsBase(QCryptoBlockOptionsBase *obj);
140
141struct QCryptoBlockOptionsQCow {
142 bool has_key_secret;
143 char *key_secret;
144};
145
146void qapi_free_QCryptoBlockOptionsQCow(QCryptoBlockOptionsQCow *obj);
147
148struct QCryptoBlockOptionsLUKS {
149 bool has_key_secret;
150 char *key_secret;
151};
152
153void qapi_free_QCryptoBlockOptionsLUKS(QCryptoBlockOptionsLUKS *obj);
154
155struct 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
174static inline QCryptoBlockOptionsLUKS *qapi_QCryptoBlockCreateOptionsLUKS_base(const QCryptoBlockCreateOptionsLUKS *obj)
175{
176 return (QCryptoBlockOptionsLUKS *)obj;
177}
178
179void qapi_free_QCryptoBlockCreateOptionsLUKS(QCryptoBlockCreateOptionsLUKS *obj);
180
181struct 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
191static inline QCryptoBlockOptionsBase *qapi_QCryptoBlockOpenOptions_base(const QCryptoBlockOpenOptions *obj)
192{
193 return (QCryptoBlockOptionsBase *)obj;
194}
195
196void qapi_free_QCryptoBlockOpenOptions(QCryptoBlockOpenOptions *obj);
197
198struct 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
208static inline QCryptoBlockOptionsBase *qapi_QCryptoBlockCreateOptions_base(const QCryptoBlockCreateOptions *obj)
209{
210 return (QCryptoBlockOptionsBase *)obj;
211}
212
213void qapi_free_QCryptoBlockCreateOptions(QCryptoBlockCreateOptions *obj);
214
215struct QCryptoBlockInfoBase {
216 QCryptoBlockFormat format;
217};
218
219void qapi_free_QCryptoBlockInfoBase(QCryptoBlockInfoBase *obj);
220
221struct 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
230void qapi_free_QCryptoBlockInfoLUKSSlot(QCryptoBlockInfoLUKSSlot *obj);
231
232struct QCryptoBlockInfoLUKSSlotList {
233 QCryptoBlockInfoLUKSSlotList *next;
234 QCryptoBlockInfoLUKSSlot *value;
235};
236
237void qapi_free_QCryptoBlockInfoLUKSSlotList(QCryptoBlockInfoLUKSSlotList *obj);
238
239struct 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
252void qapi_free_QCryptoBlockInfoLUKS(QCryptoBlockInfoLUKS *obj);
253
254struct 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
263static inline QCryptoBlockInfoBase *qapi_QCryptoBlockInfo_base(const QCryptoBlockInfo *obj)
264{
265 return (QCryptoBlockInfoBase *)obj;
266}
267
268void qapi_free_QCryptoBlockInfo(QCryptoBlockInfo *obj);
269
270#endif /* QAPI_TYPES_CRYPTO_H */
271