Main Page | Alphabetical List | Compound List | File List | Compound Members | File Members

hyperblkcodec.cc File Reference

#include "hyperblkcodec.h"
#include <gf256.h>
#include <rsff-f9.h>

Include dependency graph for hyperblkcodec.cc:

Include dependency graph

Go to the source code of this file.

Functions

void hyperblockprotect (const char *blks, char *protblks)
 write error protection info blks: blocks to protect, hblen*blklen bytes protblks: protection info, hbcorr*blklen bytes

template<class T> void setifchanged (T &dst, const T &src)
 sets dst from src iff dst is not equal to src.

bool hyperblockcorrect (char *blks, const char *protblks)
 reconstruct blocks with error protection info blks: blocks to correct, hblen*blklen bytes protblks: protection info, hbcorr*blklen bytes corrects blks; returns true iff block could be corrected or is errorfree.

void checkErrorProtection ()
 testroutine. Set blklen in options.h to 16 or so.


Variables

const int gfblklen = blklen*sizeof(char)/sizeof(GF256)
 hyperblkcodec.cc -*- c++ -*- Hans-Peter Stoerr Fri Nov 7 2003 Protect a number of blocks with a number of error protection information blocks.


Function Documentation

void checkErrorProtection  ) 
 

testroutine. Set blklen in options.h to 16 or so.

Definition at line 74 of file hyperblkcodec.cc.

References blklen, hbcorr, hblen, hyperblockcorrect(), hyperblockprotect(), and P.

Here is the call graph for this function:

bool hyperblockcorrect char *  blks,
const char *  protblks
 

reconstruct blocks with error protection info blks: blocks to correct, hblen*blklen bytes protblks: protection info, hbcorr*blklen bytes corrects blks; returns true iff block could be corrected or is errorfree.

Definition at line 49 of file hyperblkcodec.cc.

References gfblklen, hbcorr, hblen, and setifchanged().

Referenced by checkErrorProtection(), and correctfile().

Here is the call graph for this function:

void hyperblockprotect const char *  blks,
char *  protblks
 

write error protection info blks: blocks to protect, hblen*blklen bytes protblks: protection info, hbcorr*blklen bytes

Definition at line 19 of file hyperblkcodec.cc.

References gfblklen, hbcorr, and hblen.

Referenced by checkErrorProtection(), and protectfile().

template<class T>
void setifchanged T &  dst,
const T &  src
 

sets dst from src iff dst is not equal to src.

So we avoid touching memory segments if they are really unmodified.

Definition at line 40 of file hyperblkcodec.cc.

Referenced by hyperblockcorrect().


Variable Documentation

const int gfblklen = blklen*sizeof(char)/sizeof(GF256)
 

hyperblkcodec.cc -*- c++ -*- Hans-Peter Stoerr Fri Nov 7 2003 Protect a number of blocks with a number of error protection information blocks.

Protection is in stripes: the nth GF256 of the protected blocks are used to generate the protection information stored in the nth GF256 of the protection information.

Id
hyperblkcodec.cc,v 1.2 2003/12/29 18:06:31 stoerr Exp

Definition at line 14 of file hyperblkcodec.cc.

Referenced by hyperblockcorrect(), and hyperblockprotect().


Generated on Tue Dec 30 12:07:38 2003 for ErrorProtect by doxygen 1.3.2