Librepo library  1.18.1
C library for downloading linux repository metadata and packages
Basic types and constants

Macros

#define LR_YUM_FULL   NULL
 
#define LR_RPMMD_FULL   NULL
 
#define LR_YUM_REPOMDONLY   {NULL}
 
#define LR_RPMMD_REPOMDONLY   {NULL}
 
#define LR_YUM_BASEXML   {"primary", "filelists", "other", NULL}
 
#define LR_RPMMD_BASEXML   {"primary", "filelists", "other", NULL}
 
#define LR_YUM_BASEDB   {"primary_db", "filelists_db", "other_db", NULL}
 
#define LR_RPMMD_BASEDB   {"primary_db", "filelists_db", "other_db", NULL}
 
#define LR_YUM_HAWKEY   {"primary", "filelists", "prestodelta", NULL}
 
#define LR_RPMMD_HAWKEY   {"primary", "filelists", "prestodelta", NULL}
 

Typedefs

typedef enum LrCbReturnCode_e LrCbReturnCode
 
typedef int(* LrProgressCb) (void *clientp, double total_to_download, double now_downloaded)
 
typedef int(* LrEndCb) (void *clientp, LrTransferStatus status, const char *msg)
 
typedef int(* LrMirrorFailureCb) (void *clientp, const char *msg, const char *url)
 
typedef int(* LrHandleMirrorFailureCb) (void *clientp, const char *msg, const char *url, const char *metadata)
 
typedef void(* LrFastestMirrorCb) (void *clientp, LrFastestMirrorStages stage, void *ptr)
 

Enumerations

enum  LrChecks { LR_CHECK_GPG = (1<<0), LR_CHECK_CHECKSUM = (1<<1) }
 
enum  LrRepotype { LR_YUMREPO = (1<<1), LR_RPMMDREPO = LR_YUMREPO, LR_SUSEREPO = (1<<2), LR_DEBREPO = (1<<3) }
 
enum  LrProxyType {
  LR_PROXY_HTTP, LR_PROXY_HTTP_1_0, LR_PROXY_SOCKS4, LR_PROXY_SOCKS5,
  LR_PROXY_SOCKS4A, LR_PROXY_SOCKS5_HOSTNAME
}
 
enum  LrIpResolveType { LR_IPRESOLVE_WHATEVER, LR_IPRESOLVE_V4, LR_IPRESOLVE_V6 }
 
enum  LrAuth {
  LR_AUTH_NONE = 0, LR_AUTH_BASIC = (1<<0), LR_AUTH_DIGEST = (1<<1), LR_AUTH_NEGOTIATE = (1<<2),
  LR_AUTH_NTLM = (1<<3), LR_AUTH_DIGEST_IE = (1<<4), LR_AUTH_NTLM_WB = (1<<5), LR_AUTH_ONLY = ((int)(1u<<31)),
  LR_AUTH_ANY = (~LR_AUTH_DIGEST_IE)
}
 
enum  LrCbReturnCode_e { LR_CB_OK = 0, LR_CB_ABORT, LR_CB_ERROR }
 
enum  LrTransferStatus { LR_TRANSFER_SUCCESSFUL, LR_TRANSFER_ALREADYEXISTS, LR_TRANSFER_ALREDYEXISTS = LR_TRANSFER_ALREADYEXISTS, LR_TRANSFER_ERROR }
 
enum  LrFastestMirrorStages {
  LR_FMSTAGE_INIT, LR_FMSTAGE_CACHELOADING, LR_FMSTAGE_CACHELOADINGSTATUS, LR_FMSTAGE_DETECTION,
  LR_FMSTAGE_FINISHING, LR_FMSTAGE_STATUS
}
 

Detailed Description

Macro Definition Documentation

#define LR_YUM_BASEDB   {"primary_db", "filelists_db", "other_db", NULL}

Predefined value for LRO_YUMDLIST option - Download only base db files.

Definition at line 101 of file types.h.

#define LR_YUM_BASEXML   {"primary", "filelists", "other", NULL}

Predefined value for LRO_YUMDLIST option - Download only base xml files.

Definition at line 97 of file types.h.

#define LR_YUM_FULL   NULL

Predefined value for LRO_YUMDLIST option - Download whole repo.

Definition at line 89 of file types.h.

#define LR_YUM_HAWKEY   {"primary", "filelists", "prestodelta", NULL}

Predefined value for LRO_YUMDLIST option - Download only primary, filelists and prestodelta.

Definition at line 107 of file types.h.

#define LR_YUM_REPOMDONLY   {NULL}

Predefined value for LRO_YUMDLIST option - Download only repomd.xml.

Definition at line 93 of file types.h.

Typedef Documentation

typedef int(* LrEndCb) (void *clientp, LrTransferStatus status, const char *msg)

Called when a transfer is done (use transfer status to check if successful or failed).

Parameters
clientpPointer to user data.
statusTransfer status
msgError message or NULL.
Returns
See LrCbReturnCode codes

Definition at line 144 of file types.h.

typedef void(* LrFastestMirrorCb) (void *clientp, LrFastestMirrorStages stage, void *ptr)

Fastest mirror status callback

Parameters
clientpPointer to user data.
stageStage of fastest mirror detection.
ptrValue specific for each stage of detection.

Definition at line 206 of file types.h.

typedef int(* LrHandleMirrorFailureCb) (void *clientp, const char *msg, const char *url, const char *metadata)

MirrorFailure callback

Parameters
clientpPointer to user data.
msgError message.
urlMirror URL
metadataMetadata type "primary", etc.
Returns
See LrCbReturnCode codes

Definition at line 165 of file types.h.

typedef int(* LrMirrorFailureCb) (void *clientp, const char *msg, const char *url)

MirrorFailure callback prototype

Parameters
clientpPointer to user data.
msgError message.
urlMirror URL
Returns
See LrCbReturnCode codes

Definition at line 154 of file types.h.

typedef int(* LrProgressCb) (void *clientp, double total_to_download, double now_downloaded)

Progress callback prototype

Parameters
clientpPointer to user data.
total_to_downloadTotal number of bytes to download
now_downloadedNumber of bytes currently downloaded
Returns
See LrCbReturnCode codes

Definition at line 125 of file types.h.

Enumeration Type Documentation

enum LrAuth

LrAuth methods

Enumerator
LR_AUTH_NONE 

None auth method

LR_AUTH_BASIC 

HTTP Basic authentication (Default)

LR_AUTH_DIGEST 

HTTP Digest authentication

LR_AUTH_NEGOTIATE 

HTTP Negotiate (SPNEGO) authentication

LR_AUTH_NTLM 

HTTP NTLM authentication

LR_AUTH_DIGEST_IE 

HTTP Digest authentication with an IE flavor

LR_AUTH_NTLM_WB 

NTLM delegating to winbind helper

LR_AUTH_ONLY 

This is a meta symbol. OR this value together with a single specific auth value to force libcurl to probe for un-restricted auth and if not, only that single auth algorithm is acceptable.

LR_AUTH_ANY 

All suitable methods

Definition at line 69 of file types.h.

Enumerator
LR_CB_OK 

All fine

LR_CB_ABORT 

Abort the transfer - if no failfast is set, then, it just abort the current download

LR_CB_ERROR 

Error - Fatal error, abort all downloading and return from the download function (e.g. lr_download_packages, ...)

Definition at line 110 of file types.h.

enum LrChecks

Handle object containing configration for repository metadata and package downloading.Flags for available checks.

Enumerator
LR_CHECK_GPG 

GPG check

LR_CHECK_CHECKSUM 

Checksum check

Definition at line 38 of file types.h.

Enumerator
LR_FMSTAGE_INIT 

Fastest mirror detection just started. ptr is NULL

LR_FMSTAGE_CACHELOADING 

ptr is (char *) pointer to string with path to the cache file. (Do not modify or free the string).

LR_FMSTAGE_CACHELOADINGSTATUS 

if cache was loaded successfully, ptr is NULL, otherwise ptr is (char *) string with error message. (Do not modify or free the string)

LR_FMSTAGE_DETECTION 

Detection (pinging) in progress. If all data was loaded from cache, this stage is skipped. ptr is pointer to long. This is the number of how much mirrors have to be "pinged"

LR_FMSTAGE_FINISHING 

Detection is done, sorting mirrors, updating cache, etc. ptr is NULL

LR_FMSTAGE_STATUS 

The very last invocation of fastest mirror callback. If fastest mirror detection was successful ptr is NULL, otherwise ptr contain (char *) string with error message. (Do not modify or free the string)

Definition at line 170 of file types.h.

IpResolve types

Enumerator
LR_IPRESOLVE_WHATEVER 

Default - resolves addresses to all IP versions

LR_IPRESOLVE_V4 

Resolve to IPv4 addresses

LR_IPRESOLVE_V6 

Resolve to IPv6 addresses

Definition at line 62 of file types.h.

Proxy types.

Enumerator
LR_PROXY_HTTP 

HTTP proxy (Default)

LR_PROXY_HTTP_1_0 

HTTP 1.0 proxy

LR_PROXY_SOCKS4 

SOCKS4 proxy

LR_PROXY_SOCKS5 

SOCKS5 proxy

LR_PROXY_SOCKS4A 

SOCKS4A proxy

LR_PROXY_SOCKS5_HOSTNAME 

SOCKS5 proxy

Definition at line 52 of file types.h.

enum LrRepotype

Repo types flags.

Enumerator
LR_YUMREPO 

Yum repository

LR_SUSEREPO 

YaST2 repository - Not implemented yet

LR_DEBREPO 

Debian repository - Not implemented yet

Definition at line 44 of file types.h.

Transfer status codes

Definition at line 130 of file types.h.