-
Notifications
You must be signed in to change notification settings - Fork 411
/
fwupd-client.h
570 lines (558 loc) · 18.1 KB
/
fwupd-client.h
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
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
/*
* Copyright (C) 2016 Richard Hughes <richard@hughsie.com>
*
* SPDX-License-Identifier: LGPL-2.1+
*/
#pragma once
#include <gio/gio.h>
#include "fwupd-device.h"
#include "fwupd-enums.h"
#include "fwupd-plugin.h"
#include "fwupd-remote.h"
#include "fwupd-request.h"
G_BEGIN_DECLS
#define FWUPD_TYPE_CLIENT (fwupd_client_get_type())
G_DECLARE_DERIVABLE_TYPE(FwupdClient, fwupd_client, FWUPD, CLIENT, GObject)
struct _FwupdClientClass {
GObjectClass parent_class;
void (*changed)(FwupdClient *client);
void (*status_changed)(FwupdClient *client, FwupdStatus status);
void (*device_added)(FwupdClient *client, FwupdDevice *result);
void (*device_removed)(FwupdClient *client, FwupdDevice *result);
void (*device_changed)(FwupdClient *client, FwupdDevice *result);
void (*device_request)(FwupdClient *client, FwupdRequest *request);
/*< private >*/
void (*_fwupd_reserved1)(void);
void (*_fwupd_reserved2)(void);
void (*_fwupd_reserved3)(void);
void (*_fwupd_reserved4)(void);
void (*_fwupd_reserved5)(void);
void (*_fwupd_reserved6)(void);
};
/**
* FwupdClientDownloadFlags:
* @FWUPD_CLIENT_DOWNLOAD_FLAG_NONE: No flags set
* @FWUPD_CLIENT_DOWNLOAD_FLAG_ONLY_IPFS: Only use IPFS when downloading URIs
*
* The options to use for downloading.
**/
typedef enum {
FWUPD_CLIENT_DOWNLOAD_FLAG_NONE = 0, /* Since: 1.4.5 */
FWUPD_CLIENT_DOWNLOAD_FLAG_ONLY_IPFS = 1 << 0, /* Since: 1.5.6 */
/*< private >*/
FWUPD_CLIENT_DOWNLOAD_FLAG_LAST
} FwupdClientDownloadFlags;
/**
* FwupdClientUploadFlags:
* @FWUPD_CLIENT_UPLOAD_FLAG_NONE: No flags set
* @FWUPD_CLIENT_UPLOAD_FLAG_ALWAYS_MULTIPART: Always use multipart/form-data
*
* The options to use for uploading.
**/
typedef enum {
FWUPD_CLIENT_UPLOAD_FLAG_NONE = 0, /* Since: 1.4.5 */
FWUPD_CLIENT_UPLOAD_FLAG_ALWAYS_MULTIPART = 1 << 0, /* Since: 1.4.5 */
/*< private >*/
FWUPD_CLIENT_UPLOAD_FLAG_LAST
} FwupdClientUploadFlags;
FwupdClient *
fwupd_client_new(void);
GMainContext *
fwupd_client_get_main_context(FwupdClient *self);
void
fwupd_client_set_main_context(FwupdClient *self, GMainContext *main_ctx);
void
fwupd_client_connect_async(FwupdClient *self,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
gboolean
fwupd_client_connect_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
gboolean
fwupd_client_disconnect(FwupdClient *self, GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fwupd_client_quit_async(FwupdClient *self,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
gboolean
fwupd_client_quit_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fwupd_client_get_devices_async(FwupdClient *self,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
GPtrArray *
fwupd_client_get_devices_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fwupd_client_get_plugins_async(FwupdClient *self,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
GPtrArray *
fwupd_client_get_plugins_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fwupd_client_get_history_async(FwupdClient *self,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
GPtrArray *
fwupd_client_get_history_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fwupd_client_get_releases_async(FwupdClient *self,
const gchar *device_id,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
GPtrArray *
fwupd_client_get_releases_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fwupd_client_get_downgrades_async(FwupdClient *self,
const gchar *device_id,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
GPtrArray *
fwupd_client_get_downgrades_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fwupd_client_get_upgrades_async(FwupdClient *self,
const gchar *device_id,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
GPtrArray *
fwupd_client_get_upgrades_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fwupd_client_get_details_bytes_async(FwupdClient *self,
GBytes *bytes,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
GPtrArray *
fwupd_client_get_details_bytes_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fwupd_client_verify_async(FwupdClient *self,
const gchar *device_id,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
gboolean
fwupd_client_verify_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fwupd_client_verify_update_async(FwupdClient *self,
const gchar *device_id,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
gboolean
fwupd_client_verify_update_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fwupd_client_unlock_async(FwupdClient *self,
const gchar *device_id,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
gboolean
fwupd_client_unlock_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fwupd_client_modify_config_async(FwupdClient *self,
const gchar *key,
const gchar *value,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
gboolean
fwupd_client_modify_config_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fwupd_client_activate_async(FwupdClient *self,
const gchar *device_id,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
gboolean
fwupd_client_activate_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fwupd_client_clear_results_async(FwupdClient *self,
const gchar *device_id,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
gboolean
fwupd_client_clear_results_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fwupd_client_get_results_async(FwupdClient *self,
const gchar *device_id,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
FwupdDevice *
fwupd_client_get_results_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fwupd_client_modify_bios_setting_async(FwupdClient *self,
GHashTable *settings,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
gboolean
fwupd_client_modify_bios_setting_finish(FwupdClient *self, GAsyncResult *res, GError **error);
void
fwupd_client_get_bios_settings_async(FwupdClient *self,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
GPtrArray *
fwupd_client_get_bios_settings_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fwupd_client_get_host_security_attrs_async(FwupdClient *self,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
GPtrArray *
fwupd_client_get_host_security_attrs_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fwupd_client_get_host_security_events_async(FwupdClient *self,
guint limit,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
GPtrArray *
fwupd_client_get_host_security_events_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fwupd_client_get_device_by_id_async(FwupdClient *self,
const gchar *device_id,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
FwupdDevice *
fwupd_client_get_device_by_id_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fwupd_client_get_devices_by_guid_async(FwupdClient *self,
const gchar *guid,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
GPtrArray *
fwupd_client_get_devices_by_guid_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fwupd_client_install_async(FwupdClient *self,
const gchar *device_id,
const gchar *filename,
FwupdInstallFlags install_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
gboolean
fwupd_client_install_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fwupd_client_install_bytes_async(FwupdClient *self,
const gchar *device_id,
GBytes *bytes,
FwupdInstallFlags install_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
gboolean
fwupd_client_install_bytes_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fwupd_client_install_release_async(FwupdClient *self,
FwupdDevice *device,
FwupdRelease *release,
FwupdInstallFlags install_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data)
G_DEPRECATED_FOR(fwupd_client_install_release2_async);
void
fwupd_client_install_release2_async(FwupdClient *self,
FwupdDevice *device,
FwupdRelease *release,
FwupdInstallFlags install_flags,
FwupdClientDownloadFlags download_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
gboolean
fwupd_client_install_release_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fwupd_client_update_metadata_bytes_async(FwupdClient *self,
const gchar *remote_id,
GBytes *metadata,
GBytes *signature,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
gboolean
fwupd_client_update_metadata_bytes_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fwupd_client_refresh_remote_async(FwupdClient *self,
FwupdRemote *remote,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
gboolean
fwupd_client_refresh_remote_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fwupd_client_modify_remote_async(FwupdClient *self,
const gchar *remote_id,
const gchar *key,
const gchar *value,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
gboolean
fwupd_client_modify_remote_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fwupd_client_modify_device_async(FwupdClient *self,
const gchar *device_id,
const gchar *key,
const gchar *value,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
gboolean
fwupd_client_modify_device_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fwupd_client_get_report_metadata_async(FwupdClient *self,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
GHashTable *
fwupd_client_get_report_metadata_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fwupd_client_inhibit_async(FwupdClient *self,
const gchar *reason,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
gchar *
fwupd_client_inhibit_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fwupd_client_uninhibit_async(FwupdClient *self,
const gchar *inhibit_id,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
gboolean
fwupd_client_uninhibit_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fwupd_client_emulation_load_async(FwupdClient *self,
GBytes *data,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
gboolean
fwupd_client_emulation_load_finish(FwupdClient *self, GAsyncResult *res, GError **error);
void
fwupd_client_emulation_save_async(FwupdClient *self,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
GBytes *
fwupd_client_emulation_save_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
FwupdStatus
fwupd_client_get_status(FwupdClient *self);
gboolean
fwupd_client_get_tainted(FwupdClient *self);
gboolean
fwupd_client_get_only_trusted(FwupdClient *self);
gboolean
fwupd_client_get_daemon_interactive(FwupdClient *self);
guint
fwupd_client_get_percentage(FwupdClient *self);
const gchar *
fwupd_client_get_daemon_version(FwupdClient *self);
void
fwupd_client_set_daemon_version(FwupdClient *self, const gchar *daemon_version);
const gchar *
fwupd_client_get_host_bkc(FwupdClient *self);
const gchar *
fwupd_client_get_host_vendor(FwupdClient *self);
const gchar *
fwupd_client_get_host_product(FwupdClient *self);
const gchar *
fwupd_client_get_host_machine_id(FwupdClient *self);
const gchar *
fwupd_client_get_host_security_id(FwupdClient *self);
guint32
fwupd_client_get_battery_level(FwupdClient *self);
guint32
fwupd_client_get_battery_threshold(FwupdClient *self);
void
fwupd_client_get_remotes_async(FwupdClient *self,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
GPtrArray *
fwupd_client_get_remotes_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fwupd_client_get_remote_by_id_async(FwupdClient *self,
const gchar *remote_id,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
FwupdRemote *
fwupd_client_get_remote_by_id_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fwupd_client_get_approved_firmware_async(FwupdClient *self,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
GPtrArray *
fwupd_client_get_approved_firmware_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fwupd_client_set_approved_firmware_async(FwupdClient *self,
GPtrArray *checksums,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
gboolean
fwupd_client_set_approved_firmware_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fwupd_client_get_blocked_firmware_async(FwupdClient *self,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
GPtrArray *
fwupd_client_get_blocked_firmware_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fwupd_client_set_blocked_firmware_async(FwupdClient *self,
GPtrArray *checksums,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
gboolean
fwupd_client_set_blocked_firmware_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fwupd_client_self_sign_async(FwupdClient *self,
const gchar *value,
FwupdSelfSignFlags flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
gchar *
fwupd_client_self_sign_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fwupd_client_set_feature_flags_async(FwupdClient *self,
FwupdFeatureFlags feature_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
gboolean
fwupd_client_set_feature_flags_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
const gchar *
fwupd_client_get_user_agent(FwupdClient *self);
void
fwupd_client_set_user_agent(FwupdClient *self, const gchar *user_agent);
void
fwupd_client_set_user_agent_for_package(FwupdClient *self,
const gchar *package_name,
const gchar *package_version);
void
fwupd_client_download_bytes_async(FwupdClient *self,
const gchar *url,
FwupdClientDownloadFlags flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
GBytes *
fwupd_client_download_bytes_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fwupd_client_upload_bytes_async(FwupdClient *self,
const gchar *url,
const gchar *payload,
const gchar *signature,
FwupdClientUploadFlags flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer callback_data);
GBytes *
fwupd_client_upload_bytes_finish(FwupdClient *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
gboolean
fwupd_client_ensure_networking(FwupdClient *self, GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fwupd_client_add_hint(FwupdClient *self, const gchar *key, const gchar *value);
G_END_DECLS