Loading...
Searching...
No Matches
XrdCksData Class Reference

`#include <XrdCksData.hh>`

Collaboration diagram for XrdCksData:

## Public Member Functions

| XrdCksData ()
int | Get (char *Buff, int Blen)
bool | HasValue ()
int | operator!= (const XrdCksData &oth)
int | operator== (const XrdCksData &oth)
void | Reset ()
int | Set (const char *csName)
int | Set (const char *csVal, int csLen)
int | Set (const void *csVal, int csLen)

## Public Attributes

union { |
XrdOucEnv * | envP
long long | fmTime
}; |
int | csTime
char | Length
char | Name [NameSize]
short | Rsvd1
char | Rsvd2
char | Value [ValuSize]

## Static Public Attributes

static const int | NameSize = 16
static const int | ValuSize = 64

## Detailed Description

Definition at line 37 of file XrdCksData.hh.

## Constructor & Destructor Documentation

## XrdCksData()

XrdCksData::XrdCksData | ( |  | ) |

inline

Definition at line 122 of file XrdCksData.hh.

{Reset();}
XrdCksData::Reset
void Reset()
Definition XrdCksData.hh:112

References Reset().

Referenced by operator!=(), and operator==().

Here is the call graph for this function:
Here is the caller graph for this function:

## Member Function Documentation

## Get()

int XrdCksData::Get | ( | char * | Buff,
|  | int | Blen )

inline

Definition at line 69 of file XrdCksData.hh.

{const char *hv = "0123456789abcdef";
int i, j = 0;
if (Blen < Length*2+1) return 0;
for (i = 0; i < Length; i++)
{Buff[j++] = hv[(Value[i] >> 4) & 0x0f];
Buff[j++] = hv[ Value[i] & 0x0f];
}
Buff[j] = '\0';
return Length*2;
}
XrdCksData::Value
char Value[ValuSize]
Definition XrdCksData.hh:53
XrdCksData::Length
char Length
Definition XrdCksData.hh:52

References Length, and Value.

Referenced by XrdOfs::chksum(), XrdCl::CheckSumHelper::GetCheckSum(), XrdCl::Utils::GetLocalCheckSum(), and XrdCksAttrValue().

Here is the caller graph for this function:

## HasValue()

bool XrdCksData::HasValue | ( |  | ) |

inline

Definition at line 125 of file XrdCksData.hh.

{
return *Value;
}

References Value.

## operator!=()

int XrdCksData::operator!= | ( | const XrdCksData & | oth | ) |

inline

Definition at line 63 of file XrdCksData.hh.

{return (strncmp(Name, oth.Name, NameSize)
|| Length != oth.Length
|| memcmp(Value, oth.Value, Length));
}
XrdCksData::NameSize
static const int NameSize
Definition XrdCksData.hh:41
XrdCksData::Name
char Name[NameSize]
Definition XrdCksData.hh:44

References XrdCksData(), Length, Name, NameSize, and Value.

Here is the call graph for this function:

## operator==()

int XrdCksData::operator== | ( | const XrdCksData & | oth | ) |

inline

Definition at line 56 of file XrdCksData.hh.

{return (!strncmp(Name, oth.Name, NameSize)
&& Length == oth.Length
&& !memcmp(Value, oth.Value, Length));
}

References XrdCksData(), Length, Name, NameSize, and Value.

Here is the call graph for this function:

## Reset()

void XrdCksData::Reset | ( |  | ) |

inline

Definition at line 112 of file XrdCksData.hh.

{memset(Name, 0, sizeof(Name));
memset(Value,0, sizeof(Value));
fmTime = 0;
csTime = 0;
Rsvd1 = 0;
Rsvd2 = 0;
Length = 0;
}
XrdCksData::csTime
int csTime
Definition XrdCksData.hh:49
XrdCksData::Rsvd1
short Rsvd1
Definition XrdCksData.hh:50
XrdCksData::Rsvd2
char Rsvd2
Definition XrdCksData.hh:51

References csTime, Length, Name, Rsvd1, Rsvd2, and Value.

Referenced by XrdCksData().

Here is the caller graph for this function:

## Set() [1/3]

int XrdCksData::Set | ( | const char * | csName | ) |

inline

Definition at line 81 of file XrdCksData.hh.

{size_t len = strlen(csName);
if (len >= sizeof(Name)) return 0;
memcpy(Name, csName, len);
Name[len]=0;
return 1;
}

References Name.

Referenced by XrdCksManager::Calc(), XrdCl::CheckSumManager::Calculate(), XrdOfs::chksum(), XrdCksManager::Get(), XrdPssCks::Get(), XrdCl::CheckSumHelper::GetCheckSum(), XrdCl::Utils::GetLocalCheckSum(), and XrdCksAttrData().

Here is the caller graph for this function:

## Set() [2/3]

int XrdCksData::Set | ( | const char * | csVal,
|  | int | csLen )

inline

Definition at line 96 of file XrdCksData.hh.

{int n, i = 0, Odd = 0;
if (csLen > (int)sizeof(Value)*2 || (csLen & 1)) return 0;
Length = csLen/2;
while(csLen--)
{ if (*csVal >= '0' && *csVal <= '9') n = *csVal-48;
else if (*csVal >= 'a' && *csVal <= 'f') n = *csVal-87;
else if (*csVal >= 'A' && *csVal <= 'F') n = *csVal-55;
else return 0;
if (Odd) Value[i++] |= n;
else Value[i ] = n << 4;
csVal++; Odd = ~Odd;
}
return 1;
}

References Length, and Value.

## Set() [3/3]

int XrdCksData::Set | ( | const void * | csVal,
|  | int | csLen )

inline

Definition at line 89 of file XrdCksData.hh.

{if (csLen > ValuSize || csLen < 1) return 0;
memcpy(Value, csVal, csLen);
Length = csLen;
return 1;
}
XrdCksData::ValuSize
static const int ValuSize
Definition XrdCksData.hh:42

References Length, Value, and ValuSize.

## Member Data Documentation

## [union]

union { ... } XrdCksData

## csTime

int XrdCksData::csTime

Definition at line 49 of file XrdCksData.hh.

Referenced by XrdCksManager::Calc(), XrdPssCks::Get(), XrdCksXAttr::preSet(), Reset(), and XrdCksAttrData().

## Length

char XrdCksData::Length

Definition at line 52 of file XrdCksData.hh.

Referenced by XrdCksManager::Calc(), Get(), XrdCksManager::Get(), XrdPssCks::Get(), operator!=(), operator==(), Reset(), Set(), Set(), XrdCksManager::Set(), XrdCksManager::Ver(), XrdPssCks::Ver(), and XrdCksAttrValue().

## Name

char XrdCksData::Name[NameSize]

Definition at line 44 of file XrdCksData.hh.

Referenced by XrdCksManager::Calc(), XrdCksManager::Del(), XrdCksManager::Get(), XrdPssCks::Get(), operator!=(), operator==(), Reset(), Set(), XrdCksManager::Set(), XrdCksManager::Ver(), XrdPssCks::Ver(), and XrdCksAttrValue().

## NameSize

const int XrdCksData::NameSize = 16

static

Definition at line 41 of file XrdCksData.hh.

Referenced by XrdCksManager::Config(), operator!=(), operator==(), XrdCksConfig::ParseLib(), XrdCksAttrData(), XrdCksAttrName(), and XrdCksAttrValue().

## Rsvd1

short XrdCksData::Rsvd1

Definition at line 50 of file XrdCksData.hh.

Referenced by Reset().

## Rsvd2

char XrdCksData::Rsvd2

Definition at line 51 of file XrdCksData.hh.

Referenced by Reset().

## Value

char XrdCksData::Value[ValuSize]

Definition at line 53 of file XrdCksData.hh.

Referenced by XrdCksManager::Calc(), Get(), HasValue(), operator!=(), operator==(), Reset(), Set(), Set(), XrdCksManager::Ver(), and XrdPssCks::Ver().

## ValuSize

const int XrdCksData::ValuSize = 64

static

Definition at line 42 of file XrdCksData.hh.

Referenced by XrdCksManager::Get(), Set(), and XrdCksAttrValue().

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

- XrdCksData.hh