Loading...
Searching...
No Matches
XProtocol Class Reference

`#include <XProtocol.hh>`

Collaboration diagram for XProtocol:

## Classes

struct | ServerResponseBody_Attn_asyncdi
struct | ServerResponseBody_Attn_asyncrd
struct | ServerResponseBody_Attn_asyncwt

## Public Types

typedef kXR_int32 | ServerResponseType
enum | XReqErrorType { kGENERICERR = 0 , kREAD , kWRITE , kREDIRCONNECT , kOK , kNOMORESTREAMS }

## Static Public Member Functions

static const char * | errName (kXR_int32 errCode)
static int | mapError (int rc)
static const char * | reqName (kXR_unt16 reqCode)
static int | toErrno (int xerr)

## Detailed Description

Definition at line 1356 of file XProtocol.hh.

## Class Documentation

## XProtocol::ServerResponseBody_Attn_asyncdi

struct XProtocol::ServerResponseBody_Attn_asyncdi

Definition at line 1462 of file XProtocol.hh.

Collaboration diagram for XProtocol::ServerResponseBody_Attn_asyncdi:

Class Members
kXR_int32 | actnum |
kXR_int32 | msec |
kXR_int32 | wsec |

## XProtocol::ServerResponseBody_Attn_asyncrd

struct XProtocol::ServerResponseBody_Attn_asyncrd

Definition at line 1468 of file XProtocol.hh.

Collaboration diagram for XProtocol::ServerResponseBody_Attn_asyncrd:

Class Members
kXR_int32 | actnum |
char | host[4092] |
kXR_int32 | port |

## XProtocol::ServerResponseBody_Attn_asyncwt

struct XProtocol::ServerResponseBody_Attn_asyncwt

Definition at line 1474 of file XProtocol.hh.

Collaboration diagram for XProtocol::ServerResponseBody_Attn_asyncwt:

Class Members
kXR_int32 | actnum |
kXR_int32 | wsec |

## Member Typedef Documentation

## ServerResponseType

typedef kXR_int32 XProtocol::ServerResponseType

Definition at line 1491 of file XProtocol.hh.

## Member Enumeration Documentation

## XReqErrorType

enum XProtocol::XReqErrorType

Enumerator
kGENERICERR |
kREAD |
kWRITE |
kREDIRCONNECT |
kOK |
kNOMORESTREAMS |

Definition at line 1481 of file XProtocol.hh.

{
kGENERICERR = 0, // Generic error
kREAD, // Error while reading from stream
kWRITE, // Error while writing to stream
kREDIRCONNECT, // Error redirecting to a given host
kOK, // Everything seems ok
kNOMORESTREAMS // No more available stream IDs for
// async processing
};
XProtocol::kGENERICERR
@ kGENERICERR
Definition XProtocol.hh:1482
XProtocol::kWRITE
@ kWRITE
Definition XProtocol.hh:1484
XProtocol::kREAD
@ kREAD
Definition XProtocol.hh:1483
XProtocol::kREDIRCONNECT
@ kREDIRCONNECT
Definition XProtocol.hh:1485
XProtocol::kOK
@ kOK
Definition XProtocol.hh:1486
XProtocol::kNOMORESTREAMS
@ kNOMORESTREAMS
Definition XProtocol.hh:1487

## Member Function Documentation

## errName()

const char * XProtocol::errName | ( | kXR_int32 | errCode | ) |

static

Definition at line 130 of file XProtocol.cc.

{
// Mangle request code if the byte orderdoesn't match our host order
//
if ((errCode < 0 || errCode > kXR_ERRFENCE) && little.Endian[0])
errCode = ntohl(errCode);
// Validate the request code
//
if (errCode < kXR_ArgInvalid || errCode >= kXR_ERRFENCE)
return "!undefined error";
// Return the proper table
//
return errNames[errCode - kXR_ArgInvalid];
}
kXR_ArgInvalid
@ kXR_ArgInvalid
Definition XProtocol.hh:990
kXR_ERRFENCE
@ kXR_ERRFENCE
Definition XProtocol.hh:1026

References kXR_ArgInvalid, and kXR_ERRFENCE.

## mapError()

int XProtocol::mapError | ( | int | rc | ) |

inline static

Definition at line 1362 of file XProtocol.hh.

{if (rc < 0) rc = -rc;
switch(rc)
{case ENOENT: return kXR_NotFound;
case EINVAL: return kXR_ArgInvalid;
case EPERM: return kXR_NotAuthorized;
case EACCES: return kXR_NotAuthorized;
case EIO: return kXR_IOError;
case ENOMEM: return kXR_NoMemory;
case ENOBUFS: return kXR_NoMemory;
case ENOSPC: return kXR_NoSpace;
case ENAMETOOLONG: return kXR_ArgTooLong;
case ENETUNREACH: return kXR_noserver;
case EHOSTUNREACH: return kXR_noserver;
case ECONNREFUSED: return kXR_noserver;
case ENOTBLK: return kXR_NotFile;
case ENOTSUP: return kXR_Unsupported;
case EISDIR: return kXR_isDirectory;
case ENOTEMPTY: [[fallthrough]];
// In the case one tries to delete a non-empty directory
// we have decided that until the next major release
// the kXR_ItExists flag will be returned
case EEXIST:
return kXR_ItExists;
case EBADRQC: return kXR_InvalidRequest;
case ETXTBSY: return kXR_inProgress;
case ENODEV: return kXR_FSError;
case EFAULT: return kXR_ServerError;
case EDOM: return kXR_ChkSumErr;
case EDQUOT: return kXR_overQuota;
case EILSEQ: return kXR_SigVerErr;
case ERANGE: return kXR_DecryptErr;
case EUSERS: return kXR_Overloaded;
case EROFS: return kXR_fsReadOnly;
case ENOATTR: return kXR_AttrNotFound;
case EPROTOTYPE: return kXR_TLSRequired;
case EADDRNOTAVAIL: return kXR_noReplicas;
case EAUTH: return kXR_AuthFailed;
case EIDRM: return kXR_Impossible;
case ENOTTY: return kXR_Conflict;
case ETOOMANYREFS: return kXR_TooManyErrs;
case ETIMEDOUT: return kXR_ReqTimedOut;
case EBADF: return kXR_FileNotOpen;
case ECANCELED: return kXR_Cancelled;
case ETIME: return kXR_TimerExpired;
default: return kXR_FSError;
}
}
kXR_InvalidRequest
@ kXR_InvalidRequest
Definition XProtocol.hh:996
kXR_fsReadOnly
@ kXR_fsReadOnly
Definition XProtocol.hh:1015
kXR_Impossible
@ kXR_Impossible
Definition XProtocol.hh:1021
kXR_TLSRequired
@ kXR_TLSRequired
Definition XProtocol.hh:1018
kXR_SigVerErr
@ kXR_SigVerErr
Definition XProtocol.hh:1012
kXR_TimerExpired
@ kXR_TimerExpired
Definition XProtocol.hh:1025
kXR_TooManyErrs
@ kXR_TooManyErrs
Definition XProtocol.hh:1023
kXR_AttrNotFound
@ kXR_AttrNotFound
Definition XProtocol.hh:1017
kXR_ItExists
@ kXR_ItExists
Definition XProtocol.hh:1008
kXR_AuthFailed
@ kXR_AuthFailed
Definition XProtocol.hh:1020
kXR_NotAuthorized
@ kXR_NotAuthorized
Definition XProtocol.hh:1000
kXR_NotFound
@ kXR_NotFound
Definition XProtocol.hh:1001
kXR_ChkSumErr
@ kXR_ChkSumErr
Definition XProtocol.hh:1009
kXR_DecryptErr
@ kXR_DecryptErr
Definition XProtocol.hh:1013
kXR_overQuota
@ kXR_overQuota
Definition XProtocol.hh:1011
kXR_NoSpace
@ kXR_NoSpace
Definition XProtocol.hh:999
kXR_FileNotOpen
@ kXR_FileNotOpen
Definition XProtocol.hh:994
kXR_isDirectory
@ kXR_isDirectory
Definition XProtocol.hh:1006
kXR_noReplicas
@ kXR_noReplicas
Definition XProtocol.hh:1019
kXR_inProgress
@ kXR_inProgress
Definition XProtocol.hh:1010
kXR_NotFile
@ kXR_NotFile
Definition XProtocol.hh:1005
kXR_Unsupported
@ kXR_Unsupported
Definition XProtocol.hh:1003
kXR_Cancelled
@ kXR_Cancelled
Definition XProtocol.hh:1007
kXR_Conflict
@ kXR_Conflict
Definition XProtocol.hh:1022
kXR_ServerError
@ kXR_ServerError
Definition XProtocol.hh:1002
kXR_Overloaded
@ kXR_Overloaded
Definition XProtocol.hh:1014
kXR_ArgTooLong
@ kXR_ArgTooLong
Definition XProtocol.hh:992
kXR_noserver
@ kXR_noserver
Definition XProtocol.hh:1004
kXR_ReqTimedOut
@ kXR_ReqTimedOut
Definition XProtocol.hh:1024
kXR_IOError
@ kXR_IOError
Definition XProtocol.hh:997
kXR_FSError
@ kXR_FSError
Definition XProtocol.hh:995
kXR_NoMemory
@ kXR_NoMemory
Definition XProtocol.hh:998
EAUTH
#define EAUTH
Definition XProtocol.hh:1351
ENOATTR
#define ENOATTR
Definition XProtocol.hh:1343
EBADRQC
#define EBADRQC
Definition XProtocol.hh:1347
ETIME
#define ETIME
Definition XrdLink.cc:74

References EAUTH, EBADRQC, ENOATTR, ETIME, kXR_ArgInvalid, kXR_ArgTooLong, kXR_AttrNotFound, kXR_AuthFailed, kXR_Cancelled, kXR_ChkSumErr, kXR_Conflict, kXR_DecryptErr, kXR_FileNotOpen, kXR_FSError, kXR_fsReadOnly, kXR_Impossible, kXR_inProgress, kXR_InvalidRequest, kXR_IOError, kXR_isDirectory, kXR_ItExists, kXR_NoMemory, kXR_noReplicas, kXR_noserver, kXR_NoSpace, kXR_NotAuthorized, kXR_NotFile, kXR_NotFound, kXR_Overloaded, kXR_overQuota, kXR_ReqTimedOut, kXR_ServerError, kXR_SigVerErr, kXR_TimerExpired, kXR_TLSRequired, kXR_TooManyErrs, and kXR_Unsupported.

Referenced by XrdCl::LocalFileHandler::ListXAttr(), main(), XrdSsiUtils::MapErr(), XrdXrootdAioTask::SendError(), XrdXrootdCallBack::sendError(), XrdXrootdAioTask::SendFSError(), XrdCl::LocalFileHandler::Sync(), XrdCl::FileStateHandler::Write(), and XrdCl::FileStateHandler::Write().

Here is the caller graph for this function:

## reqName()

const char * XProtocol::reqName | ( | kXR_unt16 | reqCode | ) |

static

Definition at line 151 of file XProtocol.cc.

{
// Mangle request code if the byte orderdoesn't match our host order
//
if (reqCode > kXR_REQFENCE && little.Endian[0]) reqCode = ntohs(reqCode);
// Validate the request code
//
if (reqCode < kXR_auth || reqCode >= kXR_REQFENCE) return "!unknown";
// Return the proper table
//
return reqNames[reqCode - kXR_auth];
}
kXR_REQFENCE
@ kXR_REQFENCE
Definition XProtocol.hh:144
kXR_auth
@ kXR_auth
Definition XProtocol.hh:112

References kXR_auth, and kXR_REQFENCE.

Referenced by XrdXrootdProtocol::Process(), and XrdXrootdProtocol::Process2().

Here is the caller graph for this function:

## toErrno()

int XProtocol::toErrno | ( | int | xerr | ) |

inline static

Definition at line 1411 of file XProtocol.hh.

{
switch(xerr)
{case kXR_ArgInvalid: return EINVAL;
case kXR_ArgMissing: return EINVAL;
case kXR_ArgTooLong: return ENAMETOOLONG;
case kXR_FileLocked: return EDEADLK;
case kXR_FileNotOpen: return EBADF;
case kXR_FSError: return ENODEV;
case kXR_InvalidRequest:return EBADRQC;
case kXR_IOError: return EIO;
case kXR_NoMemory: return ENOMEM;
case kXR_NoSpace: return ENOSPC;
case kXR_NotAuthorized: return EACCES;
case kXR_NotFound: return ENOENT;
case kXR_ServerError: return EFAULT;
case kXR_Unsupported: return ENOTSUP;
case kXR_noserver: return EHOSTUNREACH;
case kXR_NotFile: return ENOTBLK;
case kXR_isDirectory: return EISDIR;
case kXR_Cancelled: return ECANCELED;
case kXR_ItExists: return EEXIST;
case kXR_ChkSumErr: return EDOM;
case kXR_inProgress: return EINPROGRESS;
case kXR_overQuota: return EDQUOT;
case kXR_SigVerErr: return EILSEQ;
case kXR_DecryptErr: return ERANGE;
case kXR_Overloaded: return EUSERS;
case kXR_fsReadOnly: return EROFS;
case kXR_BadPayload: return EINVAL;
case kXR_AttrNotFound: return ENOATTR;
case kXR_TLSRequired: return EPROTOTYPE;
case kXR_noReplicas: return EADDRNOTAVAIL;
case kXR_AuthFailed: return EAUTH;
case kXR_Impossible: return EIDRM;
case kXR_Conflict: return ENOTTY;
case kXR_TooManyErrs: return ETOOMANYREFS;
case kXR_ReqTimedOut: return ETIMEDOUT;
case kXR_TimerExpired: return ETIME; // Used for 504 Gateway timeout in proxy
default: return ENOMSG;
}
}
kXR_ArgMissing
@ kXR_ArgMissing
Definition XProtocol.hh:991
kXR_FileLocked
@ kXR_FileLocked
Definition XProtocol.hh:993
kXR_BadPayload
@ kXR_BadPayload
Definition XProtocol.hh:1016
xerr
void xerr(int x)
Definition XrdSectestServer.cc:305

References EAUTH, EBADRQC, ENOATTR, ETIME, kXR_ArgInvalid, kXR_ArgMissing, kXR_ArgTooLong, kXR_AttrNotFound, kXR_AuthFailed, kXR_BadPayload, kXR_Cancelled, kXR_ChkSumErr, kXR_Conflict, kXR_DecryptErr, kXR_FileLocked, kXR_FileNotOpen, kXR_FSError, kXR_fsReadOnly, kXR_Impossible, kXR_inProgress, kXR_InvalidRequest, kXR_IOError, kXR_isDirectory, kXR_ItExists, kXR_NoMemory, kXR_noReplicas, kXR_noserver, kXR_NoSpace, kXR_NotAuthorized, kXR_NotFile, kXR_NotFound, kXR_Overloaded, kXR_overQuota, kXR_ReqTimedOut, kXR_ServerError, kXR_SigVerErr, kXR_TimerExpired, kXR_TLSRequired, kXR_TooManyErrs, kXR_Unsupported, and xerr().

Referenced by mapXrdErrToHttp(), XrdPosixMap::Result(), and XrdCl::Status::ToString().

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

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

- XProtocol.hh
- XProtocol.cc