1 #ifndef __XRDOUCPGRWUTILS_HH__
2 #define __XRDOUCPGRWUTILS_HH__
35 #include <sys/types.h>
54 static void csCalc(
const char* data, off_t offs,
size_t count,
57 static void csCalc(
const char* data, off_t offs,
size_t count,
58 std::vector<uint32_t> &csvec);
70 static int csNum(off_t offs,
int count);
85 static int csNum(off_t offs,
int count,
int &fLen,
int &lLen);
106 dataInfo(
const char* dP,
const uint32_t* cP, off_t o,
int n)
107 : data(dP), csval(cP), offs(o), count(n) {}
110 static bool csVer(dataInfo &dInfo, off_t &bado,
int &badc);
const char * data
Pointer to data buffer.
Definition: XrdOucPgrwUtils.hh:101
int lLen
Length to use for iov[csnum*2-1].iov_len)
Definition: XrdOucPgrwUtils.hh:140
off_t bOffset
Buffer offset to apply iov[1].iov_base.
Definition: XrdOucPgrwUtils.hh:136
static int recvLayout(Layout &layout, off_t offs, int dlen, int bsz=0)
int sockLen
Total number of network bytes the iovec will handle.
Definition: XrdOucPgrwUtils.hh:138
Compute the layout for an iovec that receives network bytes applying.
Definition: XrdOucPgrwUtils.hh:134
Definition: XrdOucPgrwUtils.hh:100
static void csCalc(const char *data, off_t offs, size_t count, uint32_t *csval)
~XrdOucPgrwUtils()
Definition: XrdOucPgrwUtils.hh:149
off_t offs
Offset associated with data.
Definition: XrdOucPgrwUtils.hh:103
Definition: XrdOucPgrwUtils.hh:37
static int sendLayout(Layout &layout, off_t offs, int dlen, int bsz=0)
int dataLen
Total number of filesys bytes the iovec will handle.
Definition: XrdOucPgrwUtils.hh:137
const char * eWhy
Reason for failure when zero is returned.
Definition: XrdOucPgrwUtils.hh:141
dataInfo(const char *dP, const uint32_t *cP, off_t o, int n)
Definition: XrdOucPgrwUtils.hh:106
static bool csVer(dataInfo &dInfo, off_t &bado, int &badc)
int fLen
Length to use for iov[1].iov_len.
Definition: XrdOucPgrwUtils.hh:139
int count
Number of bytes to check.
Definition: XrdOucPgrwUtils.hh:104
XrdOucPgrwUtils()
Definition: XrdOucPgrwUtils.hh:148
const uint32_t * csval
Pointer to vector of checksums.
Definition: XrdOucPgrwUtils.hh:102
static int csNum(off_t offs, int count)
Compute the required size of a checksum vector based on offset & length.