12 #ifndef ZYPP_MEDIA_MEDIABLOCKLIST_H 13 #define ZYPP_MEDIA_MEDIABLOCKLIST_H 15 #include <sys/types.h> 51 size_t addBlock(off_t
off,
size_t size);
70 filesize = newfilesize;
76 return filesize != off_t(-1);
82 void setFileChecksum(std::string ctype,
int cl,
unsigned char *c);
83 bool createFileDigest(
Digest &digest)
const;
84 bool verifyFileDigest(
Digest &digest)
const;
86 return !fsumtype.empty() && fsum.size();
92 void setChecksum(
size_t blkno, std::string cstype,
int csl,
unsigned char *cs,
size_t cspad=0);
93 bool checkChecksum(
size_t blkno,
const unsigned char *buf,
size_t bufl)
const;
94 bool createDigest(
Digest &digest)
const;
95 bool verifyDigest(
size_t blkno,
Digest &digest)
const;
97 return chksumlen && chksums.size() >= chksumlen * (blkno + 1);
103 void setRsum(
size_t blkno,
int rsl,
unsigned int rs,
size_t rspad=0);
104 bool checkRsum(
size_t blkno,
const unsigned char *buf,
size_t bufl)
const;
105 unsigned int updateRsum(
unsigned int rs,
const char *bytes,
size_t len)
const;
106 bool verifyRsum(
size_t blkno,
unsigned int rs)
const;
108 return rsumlen && rsums.size() >= blkno + 1;
115 void reuseBlocks(FILE *wfp, std::string filename);
123 void writeBlock(
size_t blkno, FILE *fp,
const unsigned char *buf,
size_t bufl,
size_t start, std::vector<bool> &found)
const;
124 bool checkChecksumRotated(
size_t blkno,
const unsigned char *buf,
size_t bufl,
size_t start)
const;
128 std::vector<unsigned char>
fsum;
150 #endif // ZYPP_MEDIA_MEDIABLOCKLIST_H
std::string asString(const DefaultIntegral< Tp, TInitial > &obj)
Compute Message Digests (MD5, SHA1 etc)
String related utilities and Regular expression matching.
Easy-to use interface to the ZYPP dependency resolver.