XRootD
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 1355 of file XProtocol.hh.


Class Documentation

◆ XProtocol::ServerResponseBody_Attn_asyncdi

struct XProtocol::ServerResponseBody_Attn_asyncdi

Definition at line 1459 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 1465 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 1471 of file XProtocol.hh.

+ Collaboration diagram for XProtocol::ServerResponseBody_Attn_asyncwt:
Class Members
kXR_int32 actnum
kXR_int32 wsec

Member Typedef Documentation

◆ ServerResponseType

Definition at line 1488 of file XProtocol.hh.

Member Enumeration Documentation

◆ XReqErrorType

Enumerator
kGENERICERR 
kREAD 
kWRITE 
kREDIRCONNECT 
kOK 
kNOMORESTREAMS 

Definition at line 1478 of file XProtocol.hh.

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

Member Function Documentation

◆ errName()

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

Definition at line 130 of file XProtocol.cc.

131 {
132 // Mangle request code if the byte orderdoesn't match our host order
133 //
134  if ((errCode < 0 || errCode > kXR_ERRFENCE) && little.Endian[0])
135  errCode = ntohl(errCode);
136 
137 // Validate the request code
138 //
139  if (errCode < kXR_ArgInvalid || errCode >= kXR_ERRFENCE)
140  return "!undefined error";
141 
142 // Return the proper table
143 //
144  return errNames[errCode - kXR_ArgInvalid];
145 }
@ kXR_ArgInvalid
Definition: XProtocol.hh:990
@ kXR_ERRFENCE
Definition: XProtocol.hh:1026

References kXR_ArgInvalid, and kXR_ERRFENCE.

◆ mapError()

static int XProtocol::mapError ( int  rc)
inlinestatic

Definition at line 1361 of file XProtocol.hh.

1362  {if (rc < 0) rc = -rc;
1363  switch(rc)
1364  {case ENOENT: return kXR_NotFound;
1365  case EINVAL: return kXR_ArgInvalid;
1366  case EPERM: return kXR_NotAuthorized;
1367  case EACCES: return kXR_NotAuthorized;
1368  case EIO: return kXR_IOError;
1369  case ENOMEM: return kXR_NoMemory;
1370  case ENOBUFS: return kXR_NoMemory;
1371  case ENOSPC: return kXR_NoSpace;
1372  case ENAMETOOLONG: return kXR_ArgTooLong;
1373  case ENETUNREACH: return kXR_noserver;
1374  case ENOTBLK: return kXR_NotFile;
1375  case ENOTSUP: return kXR_Unsupported;
1376  case EISDIR: return kXR_isDirectory;
1377  case ENOTEMPTY: [[fallthrough]];
1378  // In the case one tries to delete a non-empty directory
1379  // we have decided that until the next major release
1380  // the kXR_ItExists flag will be returned
1381  case EEXIST:
1382  return kXR_ItExists;
1383  case EBADRQC: return kXR_InvalidRequest;
1384  case ETXTBSY: return kXR_inProgress;
1385  case ENODEV: return kXR_FSError;
1386  case EFAULT: return kXR_ServerError;
1387  case EDOM: return kXR_ChkSumErr;
1388  case EDQUOT: return kXR_overQuota;
1389  case EILSEQ: return kXR_SigVerErr;
1390  case ERANGE: return kXR_DecryptErr;
1391  case EUSERS: return kXR_Overloaded;
1392  case EROFS: return kXR_fsReadOnly;
1393  case ENOATTR: return kXR_AttrNotFound;
1394  case EPROTOTYPE: return kXR_TLSRequired;
1395  case EADDRNOTAVAIL: return kXR_noReplicas;
1396  case EAUTH: return kXR_AuthFailed;
1397  case EIDRM: return kXR_Impossible;
1398  case ENOTTY: return kXR_Conflict;
1399  case ETOOMANYREFS: return kXR_TooManyErrs;
1400  case ETIMEDOUT: return kXR_ReqTimedOut;
1401  case EBADF: return kXR_FileNotOpen;
1402  case ECANCELED: return kXR_Cancelled;
1403  case ETIME: return kXR_TimerExpired;
1404  default: return kXR_FSError;
1405  }
1406  }
@ kXR_InvalidRequest
Definition: XProtocol.hh:996
@ kXR_fsReadOnly
Definition: XProtocol.hh:1015
@ kXR_Impossible
Definition: XProtocol.hh:1021
@ kXR_TLSRequired
Definition: XProtocol.hh:1018
@ kXR_SigVerErr
Definition: XProtocol.hh:1012
@ kXR_TimerExpired
Definition: XProtocol.hh:1025
@ kXR_TooManyErrs
Definition: XProtocol.hh:1023
@ kXR_AttrNotFound
Definition: XProtocol.hh:1017
@ kXR_ItExists
Definition: XProtocol.hh:1008
@ kXR_AuthFailed
Definition: XProtocol.hh:1020
@ kXR_NotAuthorized
Definition: XProtocol.hh:1000
@ kXR_NotFound
Definition: XProtocol.hh:1001
@ kXR_ChkSumErr
Definition: XProtocol.hh:1009
@ kXR_DecryptErr
Definition: XProtocol.hh:1013
@ kXR_overQuota
Definition: XProtocol.hh:1011
@ kXR_NoSpace
Definition: XProtocol.hh:999
@ kXR_FileNotOpen
Definition: XProtocol.hh:994
@ kXR_isDirectory
Definition: XProtocol.hh:1006
@ kXR_noReplicas
Definition: XProtocol.hh:1019
@ kXR_inProgress
Definition: XProtocol.hh:1010
@ kXR_NotFile
Definition: XProtocol.hh:1005
@ kXR_Unsupported
Definition: XProtocol.hh:1003
@ kXR_Cancelled
Definition: XProtocol.hh:1007
@ kXR_Conflict
Definition: XProtocol.hh:1022
@ kXR_ServerError
Definition: XProtocol.hh:1002
@ kXR_Overloaded
Definition: XProtocol.hh:1014
@ kXR_ArgTooLong
Definition: XProtocol.hh:992
@ kXR_noserver
Definition: XProtocol.hh:1004
@ kXR_ReqTimedOut
Definition: XProtocol.hh:1024
@ kXR_IOError
Definition: XProtocol.hh:997
@ kXR_FSError
Definition: XProtocol.hh:995
@ kXR_NoMemory
Definition: XProtocol.hh:998
#define EAUTH
Definition: XProtocol.hh:1350
#define ENOATTR
Definition: XProtocol.hh:1342
#define EBADRQC
Definition: XProtocol.hh:1346

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(), 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.

152 {
153 // Mangle request code if the byte orderdoesn't match our host order
154 //
155  if (reqCode > kXR_REQFENCE && little.Endian[0]) reqCode = ntohs(reqCode);
156 
157 // Validate the request code
158 //
159  if (reqCode < kXR_auth || reqCode >= kXR_REQFENCE) return "!unknown";
160 
161 // Return the proper table
162 //
163  return reqNames[reqCode - kXR_auth];
164 }
@ kXR_REQFENCE
Definition: XProtocol.hh:144
@ 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()

static int XProtocol::toErrno ( int  xerr)
inlinestatic

Definition at line 1408 of file XProtocol.hh.

1409 {
1410  switch(xerr)
1411  {case kXR_ArgInvalid: return EINVAL;
1412  case kXR_ArgMissing: return EINVAL;
1413  case kXR_ArgTooLong: return ENAMETOOLONG;
1414  case kXR_FileLocked: return EDEADLK;
1415  case kXR_FileNotOpen: return EBADF;
1416  case kXR_FSError: return ENODEV;
1417  case kXR_InvalidRequest:return EBADRQC;
1418  case kXR_IOError: return EIO;
1419  case kXR_NoMemory: return ENOMEM;
1420  case kXR_NoSpace: return ENOSPC;
1421  case kXR_NotAuthorized: return EACCES;
1422  case kXR_NotFound: return ENOENT;
1423  case kXR_ServerError: return EFAULT;
1424  case kXR_Unsupported: return ENOTSUP;
1425  case kXR_noserver: return EHOSTUNREACH;
1426  case kXR_NotFile: return ENOTBLK;
1427  case kXR_isDirectory: return EISDIR;
1428  case kXR_Cancelled: return ECANCELED;
1429  case kXR_ItExists: return EEXIST;
1430  case kXR_ChkSumErr: return EDOM;
1431  case kXR_inProgress: return EINPROGRESS;
1432  case kXR_overQuota: return EDQUOT;
1433  case kXR_SigVerErr: return EILSEQ;
1434  case kXR_DecryptErr: return ERANGE;
1435  case kXR_Overloaded: return EUSERS;
1436  case kXR_fsReadOnly: return EROFS;
1437  case kXR_BadPayload: return EINVAL;
1438  case kXR_AttrNotFound: return ENOATTR;
1439  case kXR_TLSRequired: return EPROTOTYPE;
1440  case kXR_noReplicas: return EADDRNOTAVAIL;
1441  case kXR_AuthFailed: return EAUTH;
1442  case kXR_Impossible: return EIDRM;
1443  case kXR_Conflict: return ENOTTY;
1444  case kXR_TooManyErrs: return ETOOMANYREFS;
1445  case kXR_ReqTimedOut: return ETIMEDOUT;
1446  case kXR_TimerExpired: return ETIME; // Used for 504 Gateway timeout in proxy
1447  default: return ENOMSG;
1448  }
1449 }
@ kXR_ArgMissing
Definition: XProtocol.hh:991
@ kXR_FileLocked
Definition: XProtocol.hh:993
@ kXR_BadPayload
Definition: XProtocol.hh:1016
void xerr(int x)

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 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: