xrootd
Public Member Functions | Static Public Member Functions | List of all members
XrdOucPgrwUtils Class Reference

#include <XrdOucPgrwUtils.hh>

Public Member Functions

 XrdOucPgrwUtils ()
 
 ~XrdOucPgrwUtils ()
 

Static Public Member Functions

static void csCalc (const char *data, ssize_t offs, size_t count, uint32_t *csval)
 
static int csNum (ssize_t offs, size_t count)
 Compute the required size of a checksum vector based on offset & length. More...
 
static int csVer (const char *data, ssize_t offs, size_t count, const uint32_t *csval, ssize_t &bado, size_t &badc)
 

Constructor & Destructor Documentation

◆ XrdOucPgrwUtils()

XrdOucPgrwUtils::XrdOucPgrwUtils ( )
inline

◆ ~XrdOucPgrwUtils()

XrdOucPgrwUtils::~XrdOucPgrwUtils ( )
inline

Member Function Documentation

◆ csCalc()

static void XrdOucPgrwUtils::csCalc ( const char *  data,
ssize_t  offs,
size_t  count,
uint32_t *  csval 
)
static

Compute a CRC32C checksums for a pgRead request.

Parameters
dataPointer to the data whose checksum it to be computed.
offsThe offset at which the read or write occurs.
countThe number of bytes pointed to by data.
csvalPointer to a vector to hold individual page checksums. The vector must be sized as computed by csNum().
asnboReturn checksum values in network bytes order.
Returns
Each element of csval holds the checksum for the associated page.

◆ csNum()

static int XrdOucPgrwUtils::csNum ( ssize_t  offs,
size_t  count 
)
static

Compute the required size of a checksum vector based on offset & length.

Parameters
offsThe offset at which the read or write occurs.
countThe number of bytes read or to write.
Returns
The number of checksums that are needed.

◆ csVer()

static int XrdOucPgrwUtils::csVer ( const char *  data,
ssize_t  offs,
size_t  count,
const uint32_t *  csval,
ssize_t &  bado,
size_t &  badc 
)
static

Verify CRC32C checksums for a pgWrite request.

Parameters
dataPointer to the data whose checksum it to be verified.
offsThe offset at which the read or write occurs.
countThe number of bytes pointed to by data.
csvalPointer to a vector of expected page checksums. The vector must be sized as returned by csNum().
badoThe offset in error when return > 0.
badcThe length of erroneous data at bado.
Returns
0 if all the checksums match. Otherwise, the index+1 in the checksum vector containing the bad checksum (i.e. resumption point).

The documentation for this class was generated from the following file: