xrootd
Main Page
Namespaces
Classes
Files
File List
File Members
src
XrdCms
XrdCmsProtocol.hh
Go to the documentation of this file.
1
#ifndef __CMS_PROTOCOL_H__
2
#define __CMS_PROTOCOL_H__
3
/******************************************************************************/
4
/* */
5
/* X r d C m s P r o t o c o l . h h */
6
/* */
7
/* (c) 2007 by the Board of Trustees of the Leland Stanford, Jr., University */
8
/* All Rights Reserved */
9
/* Produced by Andrew Hanushevsky for Stanford University under contract */
10
/* DE-AC02-76-SFO0515 with the Department of Energy */
11
/* */
12
/* This file is part of the XRootD software suite. */
13
/* */
14
/* XRootD is free software: you can redistribute it and/or modify it under */
15
/* the terms of the GNU Lesser General Public License as published by the */
16
/* Free Software Foundation, either version 3 of the License, or (at your */
17
/* option) any later version. */
18
/* */
19
/* XRootD is distributed in the hope that it will be useful, but WITHOUT */
20
/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
21
/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
22
/* License for more details. */
23
/* */
24
/* You should have received a copy of the GNU Lesser General Public License */
25
/* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
26
/* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
27
/* */
28
/* The copyright holder's institutional names and contributor's names may not */
29
/* be used to endorse or promote products derived from this software without */
30
/* specific prior written permission of the institution or contributor. */
31
/******************************************************************************/
32
33
#include "
Xrd/XrdProtocol.hh
"
34
#include "
XrdCms/XrdCmsParser.hh
"
35
#include "
XrdCms/XrdCmsTypes.hh
"
36
#include "
XrdSys/XrdSysPthread.hh
"
37
38
class
XrdLink
;
39
class
XrdCmsNode
;
40
class
XrdCmsRRData
;
41
class
XrdCmsRouting
;
42
43
class
XrdCmsProtocol
:
public
XrdProtocol
44
{
45
friend
class
XrdCmsJob
;
46
public
:
47
48
static
XrdCmsProtocol
*
Alloc
(
const
char
*theRole =
""
,
49
const
char
*theMan = 0,
int
thePort=0);
50
51
void
DoIt
();
52
53
int
Execute
(
XrdCmsRRData
&Data);
54
55
XrdProtocol
*
Match
(
XrdLink
*lp);
// Upon accept
56
57
int
Process
(
XrdLink
*lp);
// Initial entry
58
59
void
Recycle
(
XrdLink
*lp,
int
consec,
const
char
*reason);
60
61
int
Stats
(
char
*buff,
int
blen,
int
do_sync=0);
62
63
XrdCmsProtocol
() :
XrdProtocol
(
"cms protocol handler"
),
64
ProtLink
(0),
myRole
(
"?"
),
myNode
(0),
RSlot
(0)
65
{}
66
~XrdCmsProtocol
() {}
67
68
private
:
69
70
XrdCmsRouting
*
Admit
();
71
XrdCmsRouting
*
Admit_DataServer
(
int
);
72
XrdCmsRouting
*
Admit_Redirector
(
int
);
73
XrdCmsRouting
*
Admit_Supervisor
(
int
);
74
SMask_t
AddPath
(
XrdCmsNode
*nP,
const
char
*pType,
const
char
*
Path
);
75
int
Authenticate
();
76
void
ConfigCheck
(
unsigned
char
*theConfig);
77
enum
Bearing
{
isDown
,
isLateral
,
isUp
};
78
const
char
*
Dispatch
(
Bearing
cDir,
int
maxWait,
int
maxTries);
79
XrdCmsRouting
*
Login_Failed
(
const
char
*Reason);
80
void
Pander
(
const
char
*manager,
int
mport);
81
void
Reissue
(
XrdCmsRRData
&Data);
82
void
Reply_Delay
(
XrdCmsRRData
&Data,
kXR_unt32
theDelay);
83
void
Reply_Error
(
XrdCmsRRData
&Data,
int
ecode,
const
char
*etext);
84
85
static
XrdSysMutex
ProtMutex
;
86
static
XrdCmsProtocol
*
ProtStack
;
87
static
XrdCmsParser
ProtArgs
;
88
XrdCmsProtocol
*
ProtLink
;
89
90
XrdCmsRouting
*
Routing
;
// Request routing for this instance
91
92
static
const
int
maxReqSize
= 16384;
93
94
XrdLink
*
Link
;
95
static
int
readWait
;
96
const
char
*
myRole
;
97
const
char
*
myMan
;
98
int
myManPort
;
99
XrdCmsNode
*
myNode
;
100
short
RSlot
;
// True only for redirectors
101
char
loggedIn
;
// True of login succeeded
102
};
103
#endif
Generated by
1.8.3.1