XrdPssCks Class Reference

#include <XrdPssCks.hh>

Inheritance diagram for XrdPssCks:
Inheritance graph
[legend]
Collaboration diagram for XrdPssCks:
Collaboration graph
[legend]

List of all members.

Classes

struct  csInfo

Public Member Functions

virtual int Calc (const char *Pfn, XrdCksData &Cks, int doSet=1)
virtual int Del (const char *Pfn, XrdCksData &Cks)
virtual int Get (const char *Pfn, XrdCksData &Cks)
virtual int Config (const char *Token, char *Line)
virtual int Init (const char *ConfigFN, const char *DfltCalc=0)
virtual char * List (const char *Pfn, char *Buff, int Blen, char Sep=' ')
virtual const char * Name (int seqNum=0)
virtual int Size (const char *Name=0)
virtual int Set (const char *Pfn, XrdCksData &Cks, int myTime=0)
virtual int Ver (const char *Pfn, XrdCksData &Cks)
 XrdPssCks (XrdSysError *erP)
virtual ~XrdPssCks ()

Private Member Functions

csInfoFind (const char *Name)

Private Attributes

csInfo csTab [csMax]
int csLast

Static Private Attributes

static const int csMax = 4

Constructor & Destructor Documentation

XrdPssCks::XrdPssCks ( XrdSysError erP  ) 
virtual XrdPssCks::~XrdPssCks (  )  [inline, virtual]

Member Function Documentation

virtual int XrdPssCks::Calc ( const char *  Pfn,
XrdCksData Cks,
int  doSet = 1 
) [inline, virtual]

Calculate a new checksum for a physical file using the checksum algorithm named in the Cks parameter.

Parameters:
Pfn The physical name of the file to be checksumed.
Cks For input, it specifies the checksum algorithm to be used. For output, the checksum value is returned upon success.
doSet When true, the new value must replace any existing value in the Pfn's extended file attributes.
Returns:
Success: zero with Cks structure holding the checksum value. Failure: -errno (see significant error numbers below).

Implements XrdCks.

References Get().

virtual int XrdPssCks::Config ( const char *  Token,
char *  Line 
) [inline, virtual]

Parse a configuration directives specific to the checksum manager.

Parameters:
Token Points to the directive that triggered the call.
Line All the characters after the directive.
Returns:
Success: 1 Failure: 0

Implements XrdCks.

virtual int XrdPssCks::Del ( const char *  Pfn,
XrdCksData Cks 
) [inline, virtual]

Delete the checksum from the Pfn's xattrs.

Returns:
Success: 0 Failure: -errno (see significant error numbers below).

Implements XrdCks.

csInfo* XrdPssCks::Find ( const char *  Name  )  [private]
virtual int XrdPssCks::Get ( const char *  Pfn,
XrdCksData Cks 
) [virtual]

Retreive the checksum from the Pfn's xattrs and return it and indicate whether or not it is stale (i.e. the file modification has changed or the name and length are not the expected values).

Parameters:
Pfn The physical name of the file to be checksumed.
Cks For input, it specifies the checksum type to return. For output, the checksum value is returned upon success.
Returns:
Success: The length of the binary checksum in the Cks structure. Failure: -errno (see significant error numbers below).

Implements XrdCks.

Referenced by Calc().

virtual int XrdPssCks::Init ( const char *  ConfigFN,
const char *  DfltCalc = 0 
) [virtual]

Fully initialize the manager which includes loading any plugins.

Parameters:
ConfigFN Points to the configuration file path.
DfltCalc Is the default checksum and should be defaulted if NULL. The default implementation defaults this to adler32. A default is only needed should the checksum name in the XrdCksData object be omitted.
Returns:
Success: 1 Failure: 0

Implements XrdCks.

virtual char* XrdPssCks::List ( const char *  Pfn,
char *  Buff,
int  Blen,
char  Sep = ' ' 
) [inline, virtual]

List names of the checksums associated with a Pfn or all supported ones.

Parameters:
Pfn The name of the physical file whose checksum names are to be returned. When Pfn is null, return all supported checksum algorithm names.
Buff Points to a buffer, at least 64 bytes in length, to hold a "Sep" separated list of checksum names.
Blen The length of the buffer.
Sep The separation character to be used between adjacent names.
Returns:
Success: Pointer to Buff holding at least one checksum name. Failure: A nil pointer is returned.

Implements XrdCks.

virtual const char* XrdPssCks::Name ( int  seqNum = 0  )  [virtual]

Get the name of the checksums associated with a sequence number. Note that Name() may be called prior to final config to see if there are any chksums to configure and avoid unintended errors.

Parameters:
seqNum The sequence number. Zero signifies the default name. Higher numbers are alternates.
Returns:
Success: Pointer to the name. Failure: A nil pointer is returned (no more alternates exist).

Implements XrdCks.

virtual int XrdPssCks::Set ( const char *  Pfn,
XrdCksData Cks,
int  myTime = 0 
) [inline, virtual]

Set a file's checksum in the extended attributes along with the file's mtime and the time of setting.

Parameters:
Pfn The physical name of the file to be set.
Cks Specifies the checksum name and value.
myTime When true then the fmTime and gmTime in the Cks structure are to be used; as opposed to the current time.
Returns:
Success: zero is returned. Failure: -errno (see significant error numbers below).

Implements XrdCks.

virtual int XrdPssCks::Size ( const char *  Name = 0  )  [virtual]

Get the binary length of the checksum with the corresponding name.

Parameters:
Name The checksum algorithm name. If null, use the default name.
Returns:
Success: checksum length. Failure: Zero if the checksum name does not exist.

Implements XrdCks.

virtual int XrdPssCks::Ver ( const char *  Pfn,
XrdCksData Cks 
) [virtual]

Retreive the checksum from the Pfn's xattrs and compare it to the supplied checksum. If the checksum is not available or is stale, a new checksum is calculated and written to the extended attributes.

Parameters:
Pfn The physical name of the file to be verified.
Cks Specifies the checksum name and value.
Returns:
Success: True Failure: False (the checksums do not match) or -errno indicating that verification could not be performed (see significant error numbers below).

Implements XrdCks.


Member Data Documentation

int XrdPssCks::csLast [private]
const int XrdPssCks::csMax = 4 [static, private]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 2 Aug 2019 for xrootd by  doxygen 1.6.1