xrootd
Main Page
Namespaces
Classes
Files
File List
File Members
src
XrdCl
XrdClStatus.hh
Go to the documentation of this file.
1
//------------------------------------------------------------------------------
2
// Copyright (c) 2011-2012 by European Organization for Nuclear Research (CERN)
3
// Author: Lukasz Janyst <ljanyst@cern.ch>
4
//------------------------------------------------------------------------------
5
// XRootD is free software: you can redistribute it and/or modify
6
// it under the terms of the GNU Lesser General Public License as published by
7
// the Free Software Foundation, either version 3 of the License, or
8
// (at your option) any later version.
9
//
10
// XRootD is distributed in the hope that it will be useful,
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
// GNU General Public License for more details.
14
//
15
// You should have received a copy of the GNU Lesser General Public License
16
// along with XRootD. If not, see <http://www.gnu.org/licenses/>.
17
//------------------------------------------------------------------------------
18
19
#ifndef __XRD_CL_STATUS_HH__
20
#define __XRD_CL_STATUS_HH__
21
22
#include <stdint.h>
23
#include <errno.h>
24
#include <sstream>
25
26
namespace
XrdCl
27
{
28
//----------------------------------------------------------------------------
29
// Constants
30
//----------------------------------------------------------------------------
31
const
uint16_t
stOK
= 0x0000;
32
const
uint16_t
stError
= 0x0001;
33
const
uint16_t
stFatal
= 0x0003;
34
35
//----------------------------------------------------------------------------
36
// Additional info for the stOK status
37
//----------------------------------------------------------------------------
38
const
uint16_t
suDone
= 0;
39
const
uint16_t
suContinue
= 1;
40
const
uint16_t
suRetry
= 2;
41
const
uint16_t
suPartial
= 3;
42
const
uint16_t
suAlreadyDone
= 4;
43
44
const
uint16_t
suXRDRedirect
= 101;
45
46
//----------------------------------------------------------------------------
47
// Generic errors
48
//----------------------------------------------------------------------------
49
const
uint16_t
errNone
= 0;
50
const
uint16_t
errRetry
= 1;
51
const
uint16_t
errUnknown
= 2;
52
const
uint16_t
errInvalidOp
= 3;
53
54
const
uint16_t
errFcntl
= 4;
55
const
uint16_t
errPoll
= 5;
56
const
uint16_t
errConfig
= 6;
57
const
uint16_t
errInternal
= 7;
58
const
uint16_t
errUnknownCommand
= 8;
59
const
uint16_t
errInvalidArgs
= 9;
60
const
uint16_t
errInProgress
= 10;
61
const
uint16_t
errUninitialized
= 11;
62
const
uint16_t
errOSError
= 12;
63
const
uint16_t
errNotSupported
= 13;
64
65
//----------------------------------------------------------------------------
66
// Socket related errors
67
//----------------------------------------------------------------------------
68
const
uint16_t
errInvalidAddr
= 101;
69
const
uint16_t
errSocketError
= 102;
70
const
uint16_t
errSocketTimeout
= 103;
71
const
uint16_t
errSocketDisconnected
= 104;
72
const
uint16_t
errPollerError
= 105;
73
const
uint16_t
errSocketOptError
= 106;
74
const
uint16_t
errStreamDisconnect
= 107;
75
const
uint16_t
errConnectionError
= 108;
76
const
uint16_t
errInvalidSession
= 109;
77
78
//----------------------------------------------------------------------------
79
// Post Master related errors
80
//----------------------------------------------------------------------------
81
const
uint16_t
errInvalidMessage
= 201;
82
const
uint16_t
errHandShakeFailed
= 202;
83
const
uint16_t
errLoginFailed
= 203;
84
const
uint16_t
errAuthFailed
= 204;
85
const
uint16_t
errQueryNotSupported
= 205;
86
const
uint16_t
errOperationExpired
= 206;
87
88
//----------------------------------------------------------------------------
89
// XRootD related errors
90
//----------------------------------------------------------------------------
91
const
uint16_t
errNoMoreFreeSIDs
= 301;
92
const
uint16_t
errInvalidRedirectURL
= 302;
93
const
uint16_t
errInvalidResponse
= 303;
94
const
uint16_t
errNotFound
= 304;
95
const
uint16_t
errCheckSumError
= 305;
96
const
uint16_t
errRedirectLimit
= 306;
97
98
const
uint16_t
errErrorResponse
= 400;
99
100
//----------------------------------------------------------------------------
102
//----------------------------------------------------------------------------
103
struct
Status
104
{
105
//--------------------------------------------------------------------------
107
//--------------------------------------------------------------------------
108
Status
( uint16_t st =
stOK
, uint16_t cod =
errNone
, uint32_t errN = 0 ):
109
status
(st),
code
(cod),
errNo
( errN ) {}
110
111
bool
IsError
()
const
{
return
status
&
stError
; }
112
bool
IsFatal
()
const
{
return
(
status
&0x0002) &
stFatal
; }
113
bool
IsOK
()
const
{
return
status
==
stOK
; }
114
115
//--------------------------------------------------------------------------
117
//--------------------------------------------------------------------------
118
int
GetShellCode
()
const
119
{
120
if
(
IsOK
() )
121
return
0;
122
return
(
code
/100)+50;
123
}
124
125
//--------------------------------------------------------------------------
127
//--------------------------------------------------------------------------
128
std::string
ToString
()
const
;
129
130
uint16_t
status
;
131
uint16_t
code
;
132
uint32_t
errNo
;
133
};
134
}
135
136
#endif // __XRD_CL_STATUS_HH__
Generated by
1.8.3.1