-
Notifications
You must be signed in to change notification settings - Fork 3
/
messages.pb.c
303 lines (243 loc) · 12 KB
/
messages.pb.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
/* Automatically generated nanopb constant definitions */
/* Generated by nanopb-0.3.1 at Thu Dec 10 10:16:47 2015. */
#include "messages.pb.h"
#if PB_PROTO_HEADER_VERSION != 30
#error Regenerate this file with the current version of nanopb generator.
#endif
const uint32_t DeleteWallet_wallet_handle_default = 0u;
const uint32_t NewWallet_wallet_number_default = 0u;
const bool NewWallet_is_hidden_default = false;
const uint32_t LoadWallet_wallet_number_default = 0u;
const bool BackupWallet_is_encrypted_default = false;
const uint32_t BackupWallet_device_default = 0u;
const pb_field_t Initialize_fields[2] = {
PB_FIELD( 1, BYTES , REQUIRED, STATIC , FIRST, Initialize, session_id, session_id, 0),
PB_LAST_FIELD
};
const pb_field_t Features_fields[13] = {
PB_FIELD( 1, BYTES , REQUIRED, STATIC , FIRST, Features, echoed_session_id, echoed_session_id, 0),
PB_FIELD( 2, STRING , OPTIONAL, CALLBACK, OTHER, Features, vendor, echoed_session_id, 0),
PB_FIELD( 3, UINT32 , OPTIONAL, STATIC , OTHER, Features, major_version, vendor, 0),
PB_FIELD( 4, UINT32 , OPTIONAL, STATIC , OTHER, Features, minor_version, major_version, 0),
PB_FIELD( 5, STRING , OPTIONAL, CALLBACK, OTHER, Features, config, minor_version, 0),
PB_FIELD( 6, BOOL , OPTIONAL, STATIC , OTHER, Features, otp, config, 0),
PB_FIELD( 7, BOOL , OPTIONAL, STATIC , OTHER, Features, pin, otp, 0),
PB_FIELD( 8, BOOL , OPTIONAL, STATIC , OTHER, Features, spv, pin, 0),
PB_FIELD( 9, ENUM , REPEATED, STATIC , OTHER, Features, algo, spv, 0),
PB_FIELD( 10, BOOL , OPTIONAL, STATIC , OTHER, Features, debug_link, algo, 0),
PB_FIELD( 11, BOOL , OPTIONAL, STATIC , OTHER, Features, is_formatted, debug_link, 0),
PB_FIELD( 12, BYTES , OPTIONAL, STATIC , OTHER, Features, device_name, is_formatted, 0),
PB_LAST_FIELD
};
const pb_field_t Ping_fields[2] = {
PB_FIELD( 1, STRING , OPTIONAL, STATIC , FIRST, Ping, greeting, greeting, 0),
PB_LAST_FIELD
};
const pb_field_t PingResponse_fields[3] = {
PB_FIELD( 1, STRING , OPTIONAL, STATIC , FIRST, PingResponse, echoed_greeting, echoed_greeting, 0),
PB_FIELD( 2, BYTES , REQUIRED, STATIC , OTHER, PingResponse, echoed_session_id, echoed_greeting, 0),
PB_LAST_FIELD
};
const pb_field_t Success_fields[1] = {
PB_LAST_FIELD
};
const pb_field_t Failure_fields[3] = {
PB_FIELD( 1, UINT32 , REQUIRED, STATIC , FIRST, Failure, error_code, error_code, 0),
PB_FIELD( 2, STRING , REQUIRED, CALLBACK, OTHER, Failure, error_message, error_code, 0),
PB_LAST_FIELD
};
const pb_field_t ButtonRequest_fields[1] = {
PB_LAST_FIELD
};
const pb_field_t ButtonAck_fields[1] = {
PB_LAST_FIELD
};
const pb_field_t ButtonCancel_fields[1] = {
PB_LAST_FIELD
};
const pb_field_t PinRequest_fields[1] = {
PB_LAST_FIELD
};
const pb_field_t PinAck_fields[2] = {
PB_FIELD( 1, BYTES , REQUIRED, CALLBACK, FIRST, PinAck, password, password, 0),
PB_LAST_FIELD
};
const pb_field_t PinCancel_fields[1] = {
PB_LAST_FIELD
};
const pb_field_t OtpRequest_fields[1] = {
PB_LAST_FIELD
};
const pb_field_t OtpAck_fields[2] = {
PB_FIELD( 1, STRING , REQUIRED, STATIC , FIRST, OtpAck, otp, otp, 0),
PB_LAST_FIELD
};
const pb_field_t OtpCancel_fields[1] = {
PB_LAST_FIELD
};
const pb_field_t DeleteWallet_fields[2] = {
PB_FIELD( 1, UINT32 , OPTIONAL, STATIC , FIRST, DeleteWallet, wallet_handle, wallet_handle, &DeleteWallet_wallet_handle_default),
PB_LAST_FIELD
};
const pb_field_t NewWallet_fields[5] = {
PB_FIELD( 1, UINT32 , OPTIONAL, STATIC , FIRST, NewWallet, wallet_number, wallet_number, &NewWallet_wallet_number_default),
PB_FIELD( 2, BYTES , OPTIONAL, CALLBACK, OTHER, NewWallet, password, wallet_number, 0),
PB_FIELD( 3, BYTES , OPTIONAL, STATIC , OTHER, NewWallet, wallet_name, password, 0),
PB_FIELD( 4, BOOL , OPTIONAL, STATIC , OTHER, NewWallet, is_hidden, wallet_name, &NewWallet_is_hidden_default),
PB_LAST_FIELD
};
const pb_field_t Address_fields[4] = {
PB_FIELD( 1, UINT32 , REQUIRED, STATIC , FIRST, Address, address_handle, address_handle, 0),
PB_FIELD( 2, BYTES , REQUIRED, STATIC , OTHER, Address, public_key, address_handle, 0),
PB_FIELD( 3, BYTES , REQUIRED, STATIC , OTHER, Address, address, public_key, 0),
PB_LAST_FIELD
};
const pb_field_t AddressPubKey_fields[2] = {
PB_FIELD( 1, BYTES , REQUIRED, STATIC , FIRST, AddressPubKey, public_key, public_key, 0),
PB_LAST_FIELD
};
const pb_field_t GetAddressAndPublicKey_fields[2] = {
PB_FIELD( 1, UINT32 , REQUIRED, STATIC , FIRST, GetAddressAndPublicKey, address_handle, address_handle, 0),
PB_LAST_FIELD
};
const pb_field_t AddressHandleExtended_fields[4] = {
PB_FIELD( 1, UINT32 , REQUIRED, STATIC , FIRST, AddressHandleExtended, address_handle_root, address_handle_root, 0),
PB_FIELD( 2, UINT32 , REQUIRED, STATIC , OTHER, AddressHandleExtended, address_handle_chain, address_handle_root, 0),
PB_FIELD( 3, UINT32 , REQUIRED, STATIC , OTHER, AddressHandleExtended, address_handle_index, address_handle_chain, 0),
PB_LAST_FIELD
};
const pb_field_t SignTransactionExtended_fields[3] = {
PB_FIELD( 1, MESSAGE , REPEATED, CALLBACK, FIRST, SignTransactionExtended, address_handle_extended, address_handle_extended, &AddressHandleExtended_fields),
PB_FIELD( 2, BYTES , REQUIRED, CALLBACK, OTHER, SignTransactionExtended, transaction_data, address_handle_extended, 0),
PB_LAST_FIELD
};
const pb_field_t SignatureCompleteData_fields[2] = {
PB_FIELD( 1, BYTES , REQUIRED, STATIC , FIRST, SignatureCompleteData, signature_data_complete, signature_data_complete, 0),
PB_LAST_FIELD
};
const pb_field_t SignatureComplete_fields[2] = {
PB_FIELD( 1, MESSAGE , REPEATED, CALLBACK, FIRST, SignatureComplete, signature_complete_data, signature_complete_data, &SignatureCompleteData_fields),
PB_LAST_FIELD
};
const pb_field_t LoadWallet_fields[2] = {
PB_FIELD( 1, UINT32 , OPTIONAL, STATIC , FIRST, LoadWallet, wallet_number, wallet_number, &LoadWallet_wallet_number_default),
PB_LAST_FIELD
};
const pb_field_t FormatWalletArea_fields[2] = {
PB_FIELD( 1, BYTES , REQUIRED, STATIC , FIRST, FormatWalletArea, initial_entropy_pool, initial_entropy_pool, 0),
PB_LAST_FIELD
};
const pb_field_t ChangeEncryptionKey_fields[2] = {
PB_FIELD( 1, BYTES , OPTIONAL, CALLBACK, FIRST, ChangeEncryptionKey, password, password, 0),
PB_LAST_FIELD
};
const pb_field_t ChangeWalletName_fields[2] = {
PB_FIELD( 1, BYTES , REQUIRED, STATIC , FIRST, ChangeWalletName, wallet_name, wallet_name, 0),
PB_LAST_FIELD
};
const pb_field_t ChangeDeviceName_fields[2] = {
PB_FIELD( 1, BYTES , REQUIRED, STATIC , FIRST, ChangeDeviceName, device_name, device_name, 0),
PB_LAST_FIELD
};
const pb_field_t ListWallets_fields[1] = {
PB_LAST_FIELD
};
const pb_field_t WalletInfo_fields[5] = {
PB_FIELD( 1, UINT32 , REQUIRED, STATIC , FIRST, WalletInfo, wallet_number, wallet_number, 0),
PB_FIELD( 2, BYTES , REQUIRED, STATIC , OTHER, WalletInfo, wallet_name, wallet_number, 0),
PB_FIELD( 3, BYTES , REQUIRED, STATIC , OTHER, WalletInfo, wallet_uuid, wallet_name, 0),
PB_FIELD( 4, UINT32 , OPTIONAL, STATIC , OTHER, WalletInfo, version, wallet_uuid, 0),
PB_LAST_FIELD
};
const pb_field_t Wallets_fields[2] = {
PB_FIELD( 1, MESSAGE , REPEATED, CALLBACK, FIRST, Wallets, wallet_info, wallet_info, &WalletInfo_fields),
PB_LAST_FIELD
};
const pb_field_t BackupWallet_fields[3] = {
PB_FIELD( 1, BOOL , OPTIONAL, STATIC , FIRST, BackupWallet, is_encrypted, is_encrypted, &BackupWallet_is_encrypted_default),
PB_FIELD( 2, UINT32 , OPTIONAL, STATIC , OTHER, BackupWallet, device, is_encrypted, &BackupWallet_device_default),
PB_LAST_FIELD
};
const pb_field_t RestoreWallet_fields[3] = {
PB_FIELD( 1, MESSAGE , REQUIRED, STATIC , FIRST, RestoreWallet, new_wallet, new_wallet, &NewWallet_fields),
PB_FIELD( 2, BYTES , REQUIRED, STATIC , OTHER, RestoreWallet, seed, new_wallet, 0),
PB_LAST_FIELD
};
const pb_field_t GetDeviceUUID_fields[1] = {
PB_LAST_FIELD
};
const pb_field_t DeviceUUID_fields[2] = {
PB_FIELD( 1, BYTES , REQUIRED, STATIC , FIRST, DeviceUUID, device_uuid, device_uuid, 0),
PB_LAST_FIELD
};
const pb_field_t GetEntropy_fields[2] = {
PB_FIELD( 1, UINT32 , REQUIRED, STATIC , FIRST, GetEntropy, number_of_bytes, number_of_bytes, 0),
PB_LAST_FIELD
};
const pb_field_t Entropy_fields[2] = {
PB_FIELD( 1, BYTES , REQUIRED, CALLBACK, FIRST, Entropy, entropy, entropy, 0),
PB_LAST_FIELD
};
const pb_field_t GetBulk_fields[1] = {
PB_LAST_FIELD
};
const pb_field_t Bulk_fields[2] = {
PB_FIELD( 1, BYTES , REQUIRED, CALLBACK, FIRST, Bulk, bulk, bulk, 0),
PB_LAST_FIELD
};
const pb_field_t SetBulk_fields[2] = {
PB_FIELD( 1, BYTES , REQUIRED, STATIC , FIRST, SetBulk, bulk, bulk, 0),
PB_LAST_FIELD
};
const pb_field_t GetMasterPublicKey_fields[1] = {
PB_LAST_FIELD
};
const pb_field_t MasterPublicKey_fields[3] = {
PB_FIELD( 1, BYTES , REQUIRED, STATIC , FIRST, MasterPublicKey, public_key, public_key, 0),
PB_FIELD( 2, BYTES , REQUIRED, STATIC , OTHER, MasterPublicKey, chain_code, public_key, 0),
PB_LAST_FIELD
};
const pb_field_t ResetLang_fields[1] = {
PB_LAST_FIELD
};
const pb_field_t ResetPIN_fields[1] = {
PB_LAST_FIELD
};
const pb_field_t ScanWallet_fields[1] = {
PB_LAST_FIELD
};
const pb_field_t CurrentWalletXPUB_fields[2] = {
PB_FIELD( 1, STRING , REQUIRED, STATIC , FIRST, CurrentWalletXPUB, xpub, xpub, 0),
PB_LAST_FIELD
};
const pb_field_t SignMessage_fields[3] = {
PB_FIELD( 1, MESSAGE , REQUIRED, STATIC , FIRST, SignMessage, address_handle_extended, address_handle_extended, &AddressHandleExtended_fields),
PB_FIELD( 2, BYTES , OPTIONAL, CALLBACK, OTHER, SignMessage, message_data, address_handle_extended, 0),
PB_LAST_FIELD
};
const pb_field_t SignatureMessage_fields[2] = {
PB_FIELD( 1, BYTES , REQUIRED, STATIC , FIRST, SignatureMessage, signature_data_complete_message, signature_data_complete_message, 0),
PB_LAST_FIELD
};
const pb_field_t DisplayAddressAsQR_fields[2] = {
PB_FIELD( 1, UINT32 , OPTIONAL, STATIC , FIRST, DisplayAddressAsQR, address_handle_index, address_handle_index, 0),
PB_LAST_FIELD
};
const pb_field_t SetChangeAddressIndex_fields[2] = {
PB_FIELD( 1, UINT32 , OPTIONAL, STATIC , FIRST, SetChangeAddressIndex, address_handle_index, address_handle_index, 0),
PB_LAST_FIELD
};
/* Check that field information fits in pb_field_t */
#if !defined(PB_FIELD_32BIT)
/* If you get an error here, it means that you need to define PB_FIELD_32BIT
* compile-time option. You can do that in pb.h or on compiler command line.
*
* The reason you need to do this is that some of your messages contain tag
* numbers or field sizes that are larger than what can fit in 8 or 16 bit
* field descriptors.
*/
PB_STATIC_ASSERT((pb_membersize(SignTransactionExtended, address_handle_extended) < 65536 && pb_membersize(SignatureComplete, signature_complete_data) < 65536 && pb_membersize(Wallets, wallet_info) < 65536 && pb_membersize(RestoreWallet, new_wallet) < 65536 && pb_membersize(SignMessage, address_handle_extended) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_Initialize_Features_Ping_PingResponse_Success_Failure_ButtonRequest_ButtonAck_ButtonCancel_PinRequest_PinAck_PinCancel_OtpRequest_OtpAck_OtpCancel_DeleteWallet_NewWallet_Address_AddressPubKey_GetAddressAndPublicKey_AddressHandleExtended_SignTransactionExtended_SignatureCompleteData_SignatureComplete_LoadWallet_FormatWalletArea_ChangeEncryptionKey_ChangeWalletName_ChangeDeviceName_ListWallets_WalletInfo_Wallets_BackupWallet_RestoreWallet_GetDeviceUUID_DeviceUUID_GetEntropy_Entropy_GetBulk_Bulk_SetBulk_GetMasterPublicKey_MasterPublicKey_ResetLang_ResetPIN_ScanWallet_CurrentWalletXPUB_SignMessage_SignatureMessage_DisplayAddressAsQR_SetChangeAddressIndex)
#endif
#if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT)
#error Field descriptor for SetBulk.bulk is too large. Define PB_FIELD_16BIT to fix this.
#endif