RPMIO.


Files

file  rpmio.c
file  rpmgi.h
file  argv.c
file  argv.h
file  macro.c
file  rpmlog.c
file  rpmlog.h
 Yet Another syslog(3) API clone.
file  rpmerr.h
file  rpmio.c
file  rpmio.h
file  rpmio_internal.h
file  rpmmacro.h
file  rpmmalloc.c
file  rpmmessages.h
file  rpmpgp.c
 Routines to handle RFC-2440 detached signatures.
file  rpmpgp.h
 OpenPGP constants and structures from RFC-2440.
file  rpmrpc.c
file  rpmsq.c
file  rpmsq.h
file  rpmsw.c
file  rpmsw.h
file  rpmurl.h
file  strcasecmp.c
file  ugid.c
file  ugid.h
file  url.c

Data Structures

struct  FDIO_s
struct  pgpDigParams_s
 Values parsed from OpenPGP signature/pubkey packet(s). More...
struct  pgpDig_s
 Container for values parsed from an OpenPGP signature and public key. More...
struct  _FDSTACK_s
struct  _FDDIGEST_s
struct  _FD_s
 The FD_t File Handle data structure. More...
struct  rpmsw_s
struct  rpmop_s
 Cumulative statistics for an operation. More...
typedef off_t _libio_off_t
 Hide libio API lossage.
typedef off_t _libio_pos_t

Typedefs

typedef struct _FD_sFD_t
typedef struct FDIO_sFDIO_t
typedef struct _FDSTACK_s FDSTACK_t
typedef enum fdOpX_e fdOpX
 Identify per-desciptor I/O operation statistics.
struct {
   struct rpmop_s   ops [FDSTAT_MAX]
FDSTAT_t
 Cumulative statistics for a descriptor.
typedef struct _FDDIGEST_sFDDIGEST_t
typedef enum rpmDigestFlags_e rpmDigestFlags
 Bit(s) to control digest operation.
typedef unsigned long int rpmtime_t
typedef struct rpmsw_srpmsw
typedef struct rpmop_srpmop

Enumerations

enum  fdOpX_e {
  FDSTAT_READ = 0, FDSTAT_WRITE = 1, FDSTAT_SEEK = 2, FDSTAT_CLOSE = 3,
  FDSTAT_DIGEST = 4, FDSTAT_MAX = 5
}
 Identify per-desciptor I/O operation statistics. More...
enum  rpmDigestFlags_e { RPMDIGEST_NONE = 0 }
 Bit(s) to control digest operation. More...

Functions

int xstrcasecmp (const char *s1, const char *s2)
 Locale insensitive strcasecmp(3).
int xstrncasecmp (const char *s1, const char *s2, size_t n)
 Locale insensitive strncasecmp(3).
int fdFgets (FD_t fd, char *buf, size_t len)
FD_t ftpOpen (const char *url, int flags, mode_t mode, urlinfo *uret)
int ftpReq (FD_t data, const char *ftpCmd, const char *ftpArg)
int ftpCmd (const char *cmd, const char *url, const char *arg2)
int ufdClose (void *cookie)
static FDIO_t fdGetIo (FD_t fd)
static void fdSetIo (FD_t fd, FDIO_t io)
static FILE * fdGetFILE (FD_t fd)
static void * fdGetFp (FD_t fd)
static void fdSetFp (FD_t fd, void *fp)
static int fdGetFdno (FD_t fd)
static void fdSetFdno (FD_t fd, int fdno)
static void fdSetContentLength (FD_t fd, ssize_t contentLength)
static void fdPush (FD_t fd, FDIO_t io, void *fp, int fdno)
static void fdPop (FD_t fd)
static rpmop fdstat_op (FD_t fd, fdOpX opx)
static void fdstat_enter (FD_t fd, int opx)
static void fdstat_exit (FD_t fd, int opx, ssize_t rc)
static void fdstat_print (FD_t fd, const char *msg, FILE *fp)
static void fdSetSyserrno (FD_t fd, int syserrno, const void *errcookie)
static int fdGetRdTimeoutSecs (FD_t fd)
static long int fdGetCpioPos (FD_t fd)
static void fdSetCpioPos (FD_t fd, long int cpioPos)
static FD_t c2f (void *cookie)
static void fdInitDigest (FD_t fd, pgpHashAlgo hashalgo, int flags)
 Attach digest to fd.
static void fdUpdateDigests (FD_t fd, const unsigned char *buf, ssize_t buflen)
 Update digest(s) attached to fd.
static void fdFiniDigest (FD_t fd, pgpHashAlgo hashalgo, void **datap, size_t *lenp, int asAscii)
static int fdFileno (void *cookie)
int rpmInitCrypto (void)
 Perform cryptography initialization.
DIGEST_CTX rpmDigestDup (DIGEST_CTX octx)
 Duplicate a digest context.
size_t rpmDigestLength (pgpHashAlgo hashalgo)
 Obtain digest length in bytes.
DIGEST_CTX rpmDigestInit (pgpHashAlgo hashalgo, rpmDigestFlags flags)
 Initialize digest.
int rpmDigestUpdate (DIGEST_CTX ctx, const void *data, size_t len)
 Update context with next plain text buffer.
int rpmDigestFinal (DIGEST_CTX ctx, void **datap, size_t *lenp, int asAscii)
 Return digest and destroy context.
static rpmtime_t tvsub (const struct timeval *etv, const struct timeval *btv)
 Return difference of 2 timeval stamps in micro-seconds.
int rpmswEnter (rpmop op, ssize_t rc)
 Enter timed operation.
rpmtime_t rpmswExit (rpmop op, ssize_t rc)
 Exit timed operation.
rpmtime_t rpmswAdd (rpmop to, rpmop from)
 Sum statistic counters.
rpmtime_t rpmswSub (rpmop to, rpmop from)
 Subtract statistic counters.

Typedef Documentation

typedef off_t _libio_off_t

Hide libio API lossage.

The libio interface changed after glibc-2.1.3 to pass the seek offset argument as a pointer rather than as an off_t. The snarl below defines typedefs to isolate the lossage.

Definition at line 40 of file rpmio.h.

typedef off_t _libio_pos_t

Definition at line 41 of file rpmio.h.

typedef struct _FD_s* FD_t

Definition at line 47 of file rpmio.h.

typedef struct _FDDIGEST_s * FDDIGEST_t

typedef struct FDIO_s* FDIO_t

Definition at line 51 of file rpmio.h.

typedef enum fdOpX_e fdOpX

Identify per-desciptor I/O operation statistics.

typedef struct _FDSTACK_s FDSTACK_t

typedef { ... } * FDSTAT_t

Cumulative statistics for a descriptor.

Bit(s) to control digest operation.

typedef struct rpmop_s* rpmop

Definition at line 18 of file rpmsw.h.

typedef struct rpmsw_s* rpmsw

Definition at line 14 of file rpmsw.h.

typedef unsigned long int rpmtime_t

Definition at line 10 of file rpmsw.h.


Enumeration Type Documentation

enum fdOpX_e

Identify per-desciptor I/O operation statistics.

Enumerator:
FDSTAT_READ  Read statistics index.
FDSTAT_WRITE  Write statistics index.
FDSTAT_SEEK  Seek statistics index.
FDSTAT_CLOSE  Close statistics index
FDSTAT_DIGEST  Digest statistics index.
FDSTAT_MAX 

Definition at line 94 of file rpmio_internal.h.

Bit(s) to control digest operation.

Enumerator:
RPMDIGEST_NONE 

Definition at line 973 of file rpmpgp.h.


Function Documentation

static FD_t c2f ( void *  cookie  )  [inline, static]

int fdFgets ( FD_t  fd,
char *  buf,
size_t  len 
)

Definition at line 623 of file rpmio.c.

References _rpmio_debug, errno, fdFileno, fdRead, fdReadable(), _FD_s::rd_timeoutsecs, strerror, and _FD_s::syserrno.

Referenced by checkResponse(), and ftpNLST().

static int fdFileno ( void *  cookie  )  [inline, static]

Definition at line 587 of file rpmio_internal.h.

References c2f(), _FDSTACK_s::fdno, and _FD_s::fps.

static void fdFiniDigest ( FD_t  fd,
pgpHashAlgo  hashalgo,
void **  datap,
size_t *  lenp,
int  asAscii 
) [inline, static]

static long int fdGetCpioPos ( FD_t  fd  )  [inline, static]

Definition at line 476 of file rpmio_internal.h.

References _FD_s::fd_cpioPos, and FDSANE.

Referenced by fsmSetup(), and fsmStage().

static int fdGetFdno ( FD_t  fd  )  [inline, static]

Definition at line 303 of file rpmio_internal.h.

References _FDSTACK_s::fdno, FDSANE, _FD_s::fps, and _FD_s::nfps.

Referenced by Fclose(), Fopen(), and ufdWrite().

static FILE* fdGetFILE ( FD_t  fd  )  [inline, static]

Definition at line 261 of file rpmio_internal.h.

References FDSANE, _FDSTACK_s::fp, _FD_s::fps, and _FD_s::nfps.

static void* fdGetFp ( FD_t  fd  )  [inline, static]

static FDIO_t fdGetIo ( FD_t  fd  )  [inline, static]

Definition at line 233 of file rpmio_internal.h.

References FDSANE, _FD_s::fps, _FDSTACK_s::io, and _FD_s::nfps.

Referenced by Fflush(), Fread(), Fseek(), Fwrite(), getFdErrstr(), ufdRead(), and ufdWrite().

static int fdGetRdTimeoutSecs ( FD_t  fd  )  [inline, static]

Definition at line 466 of file rpmio_internal.h.

References FDSANE, and _FD_s::rd_timeoutsecs.

static void fdInitDigest ( FD_t  fd,
pgpHashAlgo  hashalgo,
int  flags 
) [inline, static]

static void fdPop ( FD_t  fd  )  [inline, static]

Definition at line 352 of file rpmio_internal.h.

References FDSANE, fdSetFdno(), fdSetFp(), fdSetIo(), and _FD_s::nfps.

Referenced by Fclose().

static void fdPush ( FD_t  fd,
FDIO_t  io,
void *  fp,
int  fdno 
) [inline, static]

Definition at line 337 of file rpmio_internal.h.

References FDSANE, fdSetFdno(), fdSetFp(), fdSetIo(), _FD_s::fps, and _FD_s::nfps.

Referenced by Fdopen(), Fopen(), and XurlFree().

static void fdSetContentLength ( FD_t  fd,
ssize_t  contentLength 
) [inline, static]

Definition at line 327 of file rpmio_internal.h.

References _FD_s::bytesRemain, _FD_s::contentLength, and FDSANE.

static void fdSetCpioPos ( FD_t  fd,
long int  cpioPos 
) [inline, static]

Definition at line 486 of file rpmio_internal.h.

References _FD_s::fd_cpioPos, and FDSANE.

Referenced by fsmSetup(), and fsmStage().

static void fdSetFdno ( FD_t  fd,
int  fdno 
) [inline, static]

Definition at line 315 of file rpmio_internal.h.

References _FDSTACK_s::fdno, FDSANE, _FD_s::fps, and _FD_s::nfps.

Referenced by __fdClose(), __fdOpen(), fdDup(), fdPop(), fdPush(), ftpReq(), and tcpConnect().

static void fdSetFp ( FD_t  fd,
void *  fp 
) [inline, static]

Definition at line 288 of file rpmio_internal.h.

References FDSANE, _FDSTACK_s::fp, _FD_s::fps, and _FD_s::nfps.

Referenced by Fclose(), Fdopen(), fdPop(), fdPush(), and ufdClose().

static void fdSetIo ( FD_t  fd,
FDIO_t  io 
) [inline, static]

Definition at line 246 of file rpmio_internal.h.

References FDSANE, _FD_s::fps, _FDSTACK_s::io, and _FD_s::nfps.

Referenced by fdPop(), fdPush(), ftpOpen(), httpOpen(), ufdOpen(), and urlConnect().

static void fdSetSyserrno ( FD_t  fd,
int  syserrno,
const void *  errcookie 
) [inline, static]

Definition at line 453 of file rpmio_internal.h.

References _FD_s::errcookie, FDSANE, and _FD_s::syserrno.

Referenced by ftpLogin(), ftpReq(), httpReq(), and tcpConnect().

static void fdstat_enter ( FD_t  fd,
int  opx 
) [inline, static]

static void fdstat_exit ( FD_t  fd,
int  opx,
ssize_t  rc 
) [inline, static]

static rpmop fdstat_op ( FD_t  fd,
fdOpX  opx 
) [inline, static]

Definition at line 366 of file rpmio_internal.h.

References FDSTAT_MAX, and _FD_s::stats.

Referenced by fdstat_enter(), fdstat_exit(), fsmStage(), and rpmpsmStage().

static void fdstat_print ( FD_t  fd,
const char *  msg,
FILE *  fp 
) [inline, static]

static void fdUpdateDigests ( FD_t  fd,
const unsigned char *  buf,
ssize_t  buflen 
) [inline, static]

Update digest(s) attached to fd.

Definition at line 528 of file rpmio_internal.h.

References _FD_s::digests, FDSTAT_DIGEST, fdstat_enter(), fdstat_exit(), _FDDIGEST_s::hashctx, _FD_s::ndigests, and rpmDigestUpdate().

Referenced by __fdRead(), and __fdWrite().

int ftpCmd ( const char *  cmd,
const char *  url,
const char *  arg2 
)

Definition at line 1614 of file rpmio.c.

References urlinfo_s::ctrl, fdFree, ftpCommand(), urlConnect(), and urlPath().

Referenced by ftpChdir(), ftpMkdir(), ftpRename(), ftpRmdir(), and ftpUnlink().

FD_t ftpOpen ( const char *  url,
int  flags,
mode_t  mode,
urlinfo uret 
)

int ftpReq ( FD_t  data,
const char *  ftpCmd,
const char *  ftpArg 
)

DIGEST_CTX rpmDigestDup ( DIGEST_CTX  octx  ) 

Duplicate a digest context.

Parameters:
octx existing digest context
Returns:
duplicated digest context

Definition at line 27 of file digest.c.

References EXIT_FAILURE, DIGEST_CTX_s::hashctx, and xcalloc().

Referenced by verifyDSASignature(), verifyMD5Signature(), verifyRSASignature(), and verifySHA1Signature().

int rpmDigestFinal ( DIGEST_CTX  ctx,
void **  datap,
size_t *  lenp,
int  asAscii 
)

Return digest and destroy context.

Final wrapup - pad to 64-byte boundary with the bit pattern 1 0* (64-bit count of bits processed, MSB-first)

Parameters:
ctx digest context
Return values:
datap address of returned digest
lenp address of digest length
Parameters:
asAscii return digest as ascii string?
Returns:
0 on success

Definition at line 129 of file digest.c.

References DPRINTF, DIGEST_CTX_s::hashctx, and xmalloc().

Referenced by domd5(), fdFiniDigest(), makeHDRSignature(), pgpFreeDig(), pgpPubkeyFingerprint(), rhnUnload(), verifyDSASignature(), verifyMD5Signature(), verifyRSASignature(), verifySHA1Signature(), and XfdFree().

DIGEST_CTX rpmDigestInit ( pgpHashAlgo  hashalgo,
rpmDigestFlags  flags 
)

Initialize digest.

Set bit count to 0 and buffer to mysterious initialization constants.

Parameters:
hashalgo type of digest
flags bit(s) to control digest operation
Returns:
digest context

Definition at line 76 of file digest.c.

References DPRINTF, DIGEST_CTX_s::flags, getHashType(), DIGEST_CTX_s::hashctx, and xcalloc().

Referenced by domd5(), fdInitDigest(), headerCheck(), makeHDRSignature(), pgpPubkeyFingerprint(), readFile(), rhnUnload(), and rpmReadPackageFile().

size_t rpmDigestLength ( pgpHashAlgo  hashalgo  ) 

Obtain digest length in bytes.

Parameters:
hashalgo type of digest
Returns:
digest length

Definition at line 70 of file digest.c.

References getHashType().

int rpmDigestUpdate ( DIGEST_CTX  ctx,
const void *  data,
size_t  len 
)

Update context with next plain text buffer.

Parameters:
ctx digest context
data next data buffer
len no. bytes of data
Returns:
0 on success

Definition at line 103 of file digest.c.

References DPRINTF, and DIGEST_CTX_s::hashctx.

Referenced by domd5(), fdUpdateDigests(), headerCheck(), makeHDRSignature(), pgpPubkeyFingerprint(), readFile(), rhnUnload(), rpmReadPackageFile(), verifyDSASignature(), and verifyRSASignature().

int rpmInitCrypto ( void   ) 

Perform cryptography initialization.

It must be called before any cryptography can be used within rpm. It's not normally necessary to call it directly as it's called in general rpm initialization routines.

Returns:
0 on success, -1 on failure

Definition at line 1419 of file rpmpgp.c.

References _crypto_initialized.

Referenced by rpmReadConfigFiles().

rpmtime_t rpmswAdd ( rpmop  to,
rpmop  from 
)

Sum statistic counters.

Parameters:
to result statistics
from operation statistics
Returns:
cumulative usecs for operation

Definition at line 133 of file rpmsw.c.

References rpmop_s::bytes, rpmop_s::count, and rpmop_s::usecs.

Referenced by fsmStage(), psmWait(), rpmpsmStage(), rpmtsCloseDB(), and rpmtsCloseSDB().

int rpmswEnter ( rpmop  op,
ssize_t  rc 
)

Enter timed operation.

Parameters:
op operation statistics
rc -1 clears usec counter
Returns:
0 always

Definition at line 101 of file rpmsw.c.

References rpmop_s::begin, rpmop_s::bytes, rpmop_s::count, rpmswNow(), and rpmop_s::usecs.

Referenced by dbiDel(), dbiGet(), dbiPget(), dbiPut(), fdstat_enter(), headerCheck(), rpmpsmStage(), rpmReadPackageFile(), rpmsqWaitUnregister(), rpmtsCheck(), rpmtsCreate(), rpmtsOrder(), rpmtsRun(), verifyDSASignature(), verifyMD5Signature(), verifyRSASignature(), and verifySHA1Signature().

rpmtime_t rpmswExit ( rpmop  op,
ssize_t  rc 
)

Exit timed operation.

Parameters:
op operation statistics
rc per-operation data (e.g. bytes transferred)
Returns:
cumulative usecs for operation

Definition at line 117 of file rpmsw.c.

References rpmop_s::begin, rpmop_s::bytes, rpmswDiff(), rpmswNow(), and rpmop_s::usecs.

Referenced by dbiDel(), dbiGet(), dbiPget(), dbiPut(), fdstat_exit(), headerCheck(), rpmpsmStage(), rpmReadPackageFile(), rpmsqWaitUnregister(), rpmtsCheck(), rpmtsOrder(), rpmtsPrintStats(), rpmtsRun(), verifyDSASignature(), verifyMD5Signature(), verifyRSASignature(), and verifySHA1Signature().

rpmtime_t rpmswSub ( rpmop  to,
rpmop  from 
)

Subtract statistic counters.

Parameters:
to result statistics
from operation statistics
Returns:
cumulative usecs for operation

Definition at line 145 of file rpmsw.c.

References rpmop_s::bytes, rpmop_s::count, and rpmop_s::usecs.

static rpmtime_t tvsub ( const struct timeval *  etv,
const struct timeval *  btv 
) [inline, static]

Return difference of 2 timeval stamps in micro-seconds.

Parameters:
*etv end timeval
*btv begin timeval
Returns:
difference in milli-seconds

Definition at line 45 of file rpmsw.c.

References rpmop_s::usecs.

Referenced by rpmswDiff().

int ufdClose ( void *  cookie  ) 

int xstrcasecmp ( const char *  s1,
const char *  s2 
)

int xstrncasecmp ( const char *  s1,
const char *  s2,
size_t  n 
)

Locale insensitive strncasecmp(3).

Definition at line 32 of file strcasecmp.c.

References xtolower().

Referenced by db3New(), findPreambleTag(), getTagVal(), isPart(), Link(), matchTok(), and Rename().


Variable Documentation

struct { ... } ops[FDSTAT_MAX] [read, inherited]

Cumulative statistics.

Definition at line 107 of file rpmio_internal.h.


Generated on Fri Dec 12 13:02:12 2008 for rpm by  doxygen 1.5.6