#include <string>
#include <vector>
#include <time.h>
Go to the source code of this file.
|
std::vector< char > | XrdCksAttrData (const char *cstype, const char *csval, time_t mtime) |
|
std::string | XrdCksAttrName (const char *cstype, const char *nspfx="") |
|
std::string | XrdCksAttrValue (const char *cstype, const char *csbuff, int csblen) |
|
◆ XrdCksAttrData()
std::vector< char > XrdCksAttrData |
( |
const char * |
cstype, |
|
|
const char * |
csval, |
|
|
time_t |
mtime |
|
) |
| |
|
extern |
This header file defines linkages to various XRootD checksum assistants. The functions described here are located in libXrdUtils.so. Generate the extended attribute data for a particular checksum that can be used to set the corresponding checksum attribute variable.
- Parameters
-
cstype | A null terminated string holding the checksum type (e.g. "adler32", "md5", "sha2", etc). |
csval | A null terminated string holding the corresonding checksum value. This must be an ASCII hex representation of the value and must be of appropriate length. |
mtime | The subject file's modification time. |
- Returns
- A vector of bytes that should be usedto set the attribute variable. If the size of the vector is zero, then the supplied parameters were incorrect and valid data cannot be generated; errno is: EINVAL - csval length is incorrect for checksum type or contains a non-hex digit. ENAMETOOLONG - checksum type is too long. EOVERFLOW - csval could not be represented in the data.
◆ XrdCksAttrName()
std::string XrdCksAttrName |
( |
const char * |
cstype, |
|
|
const char * |
nspfx = "" |
|
) |
| |
|
extern |
Generate the extended attribute variable name for a particular checksum.
- Parameters
-
cstype | A null terminated string holding the checksum type (e.g. "adler32", "md5", "sha2", etc). |
nspfx | Is the namespace prefix to add to the variable name. By default no prefix os used. Certain platforms and/or filesystems require that user attributes start with a particular prefix (e.g. Linux requires 'user.') others do not. If your are going to use the variable name to get or set an attribute you should specify any required prefix. If specified and it does not end with a dot, a dot is automatically added to the nspfx. |
- Returns
- A string holding the variable name that should be used to get or set the extended attribute holding the correspnding checksum. If a null string is returned, the variable could not be generated; errno is set to: ENAMETOOLONG - checksum type is too long.
◆ XrdCksAttrValue()
std::string XrdCksAttrValue |
( |
const char * |
cstype, |
|
|
const char * |
csbuff, |
|
|
int |
csblen |
|
) |
| |
|
extern |
Extract th checksum value from checksum extended attribute data.
- Parameters
-
cstype | A null terminated string holding the checksum type (e.g. "adler32", "md5", "sha2", etc). |
csbuff | A pointer to a buffer hlding the checksum data. |
csblen | The length of the checksum data (i.e. the length of the retrieved extended attribute). |
- Returns
- A string holding the ASCII hexstring correspoding to the checksum value. If a null string is returned then the checksum data was invalid or did not correspond to the specified checksum type, the errno is set to: EINVAL - the checksum length in csbuff is incorrect. EMSGSIZE - csblen was not the expected value. ENOENT - the specified cstype did not match the one in csbuff. EOVERFLOW - checksum value could not be generated from csbuff.