Librepo library 1.22.1
C library for downloading linux repository metadata and packages
Loading...
Searching...
No Matches
handle.h
1/* librepo - A library providing (libcURL like) API to downloading repository
2 * Copyright (C) 2012 Tomas Mlcoch
3 *
4 * Licensed under the GNU Lesser General Public License Version 2.1
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, see <https://www.gnu.org/licenses/>.
18 */
19
20#ifndef __LR_HANDLE_H__
21#define __LR_HANDLE_H__
22
23#include <glib.h>
24#include <gio/gio.h>
25
26#include <librepo/result.h>
27
28G_BEGIN_DECLS
29
34
38typedef struct _LrHandle LrHandle;
39
40#if 1
43#define LRO_SUPPORTS_CACHEDIR
44#endif /* 1 */
45
47#define LRO_FASTESTMIRRORMAXAGE_DEFAULT 2592000L // 30 days
48
50#define LRO_FASTESTMIRRORMAXAGE_MIN 0L
51
53#define LRO_PROXYPORT_DEFAULT 1080L
54
56#define LRO_PROXYTYPE_DEFAULT LR_PROXY_HTTP
57
59#define LRO_MAXSPEED_DEFAULT G_GINT64_CONSTANT(0)
60
62#define LRO_CONNECTTIMEOUT_DEFAULT 30L
63
65#define LRO_MAXMIRRORTRIES_DEFAULT 0L
66
68#define LRO_MAXMIRRORTRIES_MIN 0L
69
71#define LRO_MAXPARALLELDOWNLOADS_DEFAULT 3L
72
74#define LRO_MAXPARALLELDOWNLOADS_MIN 1L
75
77#define LRO_MAXPARALLELDOWNLOADS_MAX 20L
78
80#define LRO_MAXDOWNLOADSPERMIRROR_DEFAULT 3L
81
83#define LRO_MAXDOWNLOADSPERMIRROR_MIN 1L
84
86#define LRO_LOWSPEEDTIME_MIN 0L
87
89#define LRO_LOWSPEEDTIME_DEFAULT 30L
90
92#define LRO_LOWSPEEDLIMIT_MIN 0L
93
95#define LRO_LOWSPEEDLIMIT_DEFAULT 1000L
96
98#define LRO_IPRESOLVE_DEFAULT LR_IPRESOLVE_WHATEVER
99
101#define LRO_ALLOWEDMIRRORFAILURES_DEFAULT 4L
102
104#define LRO_ADAPTIVEMIRRORSORTING_DEFAULT 1L
105
107#define LRO_GNUPGHOMEDIR_DEFAULT NULL
108
110#define LRO_FASTESTMIRRORTIMEOUT_DEFAULT 2.0
111
113#define LRO_OFFLINE_DEFAULT 0L
114
116#define LRO_HTTPAUTHMETHODS_DEFAULT LR_AUTH_BASIC
117
119#define LRO_PROXYAUTHMETHODS_DEFAULT LR_AUTH_BASIC
120
122#define LRO_FTPUSEEPSV_DEFAULT 1L
123
124
126typedef enum {
127
131
134
139
142
145
148
153
159
162
165
168
173
178
181
184
188
191
194
198
204
210
214
218
222
225
228
236
241
246
247 LRO_FASTESTMIRRORMAXAGE, /*< (long)
248 Maximum age of a record in cache (seconds).
249 Default: 2592000 (30 days). */
250
251 LRO_FASTESTMIRRORCB, /* (LrFastestMirrorCb)
252 Fastest mirror status callback */
253
254 LRO_FASTESTMIRRORDATA, /* (void *)
255 User data for LRO_FASTESTMIRRORCB */
256
257 LRO_LOWSPEEDTIME, /*< (long)
258 The time in seconds that the transfer should be below the
259 LRO_LOWSPEEDLIMIT for the library to consider it too slow
260 and abort. */
261
262 LRO_LOWSPEEDLIMIT, /*< (long)
263 The transfer speed in bytes per second that the transfer
264 should be below during LRO_LOWSPEEDTIME seconds for
265 the library to consider it too slow and abort. */
266
267 /* Repo common options */
268
271
274
275 /* LR_YUMREPO specific options */
276
281
282 LRO_RPMMDDLIST = LRO_YUMDLIST,
283
287
288 LRO_RPMMDBLIST = LRO_YUMBLIST,
289
294
300
304
307
321
327
330
334
338
343
347
352
356
359
363
366
373
377
381
405
412
418
422
426
431
435
438
441
448
455
457
459
534
538LrHandle *
540
544void
546
554gboolean
556 GError **err,
557 LrHandleOption option,
558 ...);
559
573gboolean
575 GError **err,
576 LrHandleInfoOption option,
577 ...);
578
585gboolean
586lr_handle_perform(LrHandle *handle, LrResult *result, GError **err);
587
595gboolean
596lr_handle_network_wait(LrHandle *handle, GError **err, guint seconds, GCancellable *cancellable);
597
599
600G_END_DECLS
601
602#endif
LrHandleOption
Definition handle.h:126
void lr_handle_free(LrHandle *handle)
struct _LrHandle LrHandle
Definition handle.h:38
gboolean lr_handle_setopt(LrHandle *handle, GError **err, LrHandleOption option,...)
gboolean lr_handle_getinfo(LrHandle *handle, GError **err, LrHandleInfoOption option,...)
LrHandle * lr_handle_init(void)
gboolean lr_handle_perform(LrHandle *handle, LrResult *result, GError **err)
gboolean lr_handle_network_wait(LrHandle *handle, GError **err, guint seconds, GCancellable *cancellable)
LrHandleInfoOption
Definition handle.h:461
@ LRO_REPOTYPE
Definition handle.h:192
@ LRO_IPRESOLVE
Definition handle.h:305
@ LRO_FTPUSEEPSV
Definition handle.h:364
@ LRO_MAXSPEED
Definition handle.h:185
@ LRO_MIRRORLISTURL
Definition handle.h:140
@ LRO_VARSUB
Definition handle.h:229
@ LRO_PROXY_SSLCLIENTKEY
Definition handle.h:427
@ LRO_INTERRUPTIBLE
Definition handle.h:205
@ LRO_PROXYAUTH
Definition handle.h:169
@ LRO_PROXY_SSLVERIFYHOST
Definition handle.h:419
@ LRO_ONETIMEFLAG
Definition handle.h:382
@ LRO_CONNECTTIMEOUT
Definition handle.h:195
@ LRO_PROXYAUTHMETHODS
Definition handle.h:360
@ LRO_PROGRESSDATA
Definition handle.h:182
@ LRO_FASTESTMIRRORTIMEOUT
Definition handle.h:331
@ LRO_METALINK_EXCLUDE_DOMAIN
Definition handle.h:442
@ LRO_ADAPTIVEMIRRORSORTING
Definition handle.h:322
@ LRO_CHECKSUM
Definition handle.h:272
@ LRO_HTTPHEADER
Definition handle.h:335
@ LRO_USERAGENT
Definition handle.h:211
@ LRO_IGNOREMISSING
Definition handle.h:199
@ LRO_MAXMIRRORTRIES
Definition handle.h:219
@ LRO_PROGRESSCB
Definition handle.h:179
@ LRO_OFFLINE
Definition handle.h:339
@ LRO_GNUPGHOMEDIR
Definition handle.h:328
@ LRO_YUMDLIST
Definition handle.h:277
@ LRO_PROXY_SSLCACERT
Definition handle.h:432
@ LRO_MIRRORLIST
Definition handle.h:135
@ LRO_METALINKURL
Definition handle.h:143
@ LRO_FASTESTMIRROR
Definition handle.h:237
@ LRO_PROXY_SSLCLIENTCERT
Definition handle.h:423
@ LRO_USERPWD
Definition handle.h:154
@ LRO_HMFCB
Definition handle.h:290
@ LRO_SSLCLIENTCERT
Definition handle.h:344
@ LRO_PROXYUSERPWD
Definition handle.h:174
@ LRO_URLS
Definition handle.h:132
@ LRO_UPDATE
Definition handle.h:128
@ LRO_HTTPAUTH
Definition handle.h:149
@ LRO_SSLVERIFYSTATUS
Definition handle.h:406
@ LRO_LOCAL
Definition handle.h:146
@ LRO_PRESERVETIME
Definition handle.h:378
@ LRO_PROXY_SSLVERIFYPEER
Definition handle.h:413
@ LRO_METALINK_EXCLUDE_LOCATION
Definition handle.h:449
@ LRO_PROXY
Definition handle.h:160
@ LRO_FETCHMIRRORS
Definition handle.h:215
@ LRO_MAXPARALLELDOWNLOADS
Definition handle.h:223
@ LRO_SSLCLIENTKEY
Definition handle.h:348
@ LRO_PROXYPORT
Definition handle.h:163
@ LRO_MAXDOWNLOADSPERMIRROR
Definition handle.h:226
@ LRO_YUMSLIST
Definition handle.h:367
@ LRO_PROXYTYPE
Definition handle.h:166
@ LRO_PASSWORD
Definition handle.h:439
@ LRO_FASTESTMIRRORCACHE
Definition handle.h:242
@ LRO_SSLCACERT
Definition handle.h:353
@ LRO_ALLOWEDMIRRORFAILURES
Definition handle.h:308
@ LRO_YUMBLIST
Definition handle.h:284
@ LRO_HTTPAUTHMETHODS
Definition handle.h:357
@ LRO_USERNAME
Definition handle.h:436
@ LRO_CACHEDIR
Definition handle.h:374
@ LRO_DESTDIR
Definition handle.h:189
@ LRO_GPGCHECK
Definition handle.h:269
@ LRO_SSLVERIFYHOST
Definition handle.h:301
@ LRO_SSLVERIFYPEER
Definition handle.h:295
@ LRO_SENTINEL
Definition handle.h:456
@ LRI_USERAGENT
Definition handle.h:474
@ LRI_UPDATE
Definition handle.h:462
@ LRI_METALINK
Definition handle.h:498
@ LRI_GNUPGHOMEDIR
Definition handle.h:508
@ LRI_PROGRESSCB
Definition handle.h:470
@ LRI_ALLOWEDMIRRORFAILURES
Definition handle.h:506
@ LRI_ADAPTIVEMIRRORSORTING
Definition handle.h:507
@ LRI_PROXY_SSLCACERT
Definition handle.h:530
@ LRI_SSLCLIENTCERT
Definition handle.h:514
@ LRI_YUMDLIST
Definition handle.h:475
@ LRI_LOCAL
Definition handle.h:469
@ LRI_METALINKURL
Definition handle.h:468
@ LRI_YUMBLIST
Definition handle.h:479
@ LRI_HTTPHEADER
Definition handle.h:510
@ LRI_VARSUB
Definition handle.h:485
@ LRI_PROXY_SSLCLIENTCERT
Definition handle.h:528
@ LRI_YUMSLIST
Definition handle.h:522
@ LRI_MIRRORLIST
Definition handle.h:466
@ LRI_HTTPAUTHMETHODS
Definition handle.h:519
@ LRI_REPOTYPE
Definition handle.h:473
@ LRI_FASTESTMIRROR
Definition handle.h:499
@ LRI_DESTDIR
Definition handle.h:472
@ LRI_HMFCB
Definition handle.h:502
@ LRI_FASTESTMIRRORMAXAGE
Definition handle.h:501
@ LRI_SSLVERIFYSTATUS
Definition handle.h:524
@ LRI_LOWSPEEDLIMIT
Definition handle.h:518
@ LRI_PROGRESSDATA
Definition handle.h:471
@ LRI_MIRRORLISTURL
Definition handle.h:467
@ LRI_URLS
Definition handle.h:463
@ LRI_OFFLINE
Definition handle.h:513
@ LRI_MAXMIRRORTRIES
Definition handle.h:484
@ LRI_PROXYAUTHMETHODS
Definition handle.h:520
@ LRI_PROXY_SSLVERIFYPEER
Definition handle.h:526
@ LRI_SSLCACERT
Definition handle.h:516
@ LRI_SSLVERIFYHOST
Definition handle.h:504
@ LRI_PROXY_SSLVERIFYHOST
Definition handle.h:527
@ LRI_FASTESTMIRRORTIMEOUT
Definition handle.h:509
@ LRI_IPRESOLVE
Definition handle.h:505
@ LRI_LOWSPEEDTIME
Definition handle.h:517
@ LRI_CACHEDIR
Definition handle.h:523
@ LRI_SSLCLIENTKEY
Definition handle.h:515
@ LRI_MIRRORS
Definition handle.h:486
@ LRI_FETCHMIRRORS
Definition handle.h:483
@ LRI_PROXY_SSLCLIENTKEY
Definition handle.h:529
@ LRI_FTPUSEEPSV
Definition handle.h:521
@ LRI_FASTESTMIRRORCACHE
Definition handle.h:500
@ LRI_SSLVERIFYPEER
Definition handle.h:503
struct _LrResult LrResult
Definition result.h:36