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
13
#include "
Xrd/XrdProtocol.hh
"
14
#include "
XrdCms/XrdCmsParser.hh
"
15
#include "
XrdCms/XrdCmsTypes.hh
"
16
#include "
XrdSys/XrdSysPthread.hh
"
17
18
class
XrdLink
;
19
class
XrdCmsNode
;
20
class
XrdCmsRRData
;
21
class
XrdCmsRouting
;
22
23
class
XrdCmsProtocol
:
public
XrdProtocol
24
{
25
friend
class
XrdCmsJob
;
26
public
:
27
28
static
XrdCmsProtocol
*
Alloc
(
const
char
*theRole =
""
,
29
const
char
*theMan = 0,
int
thePort=0);
30
31
void
DoIt
();
32
33
int
Execute
(
XrdCmsRRData
&Data);
34
35
XrdProtocol
*
Match
(
XrdLink
*lp);
// Upon accept
36
37
int
Process
(
XrdLink
*lp);
// Initial entry
38
39
void
Recycle
(
XrdLink
*lp,
int
consec,
const
char
*reason);
40
41
int
Stats
(
char
*buff,
int
blen,
int
do_sync=0);
42
43
XrdCmsProtocol
() :
XrdProtocol
(
"cms protocol handler"
),
44
ProtLink
(0),
myRole
(
"?"
),
myNode
(0),
RSlot
(0)
45
{}
46
~XrdCmsProtocol
() {}
47
48
private
:
49
50
XrdCmsRouting
*
Admit
();
51
XrdCmsRouting
*
Admit_DataServer
(
int
);
52
XrdCmsRouting
*
Admit_Redirector
(
int
);
53
XrdCmsRouting
*
Admit_Supervisor
(
int
);
54
SMask_t
AddPath
(
XrdCmsNode
*nP,
const
char
*pType,
const
char
*
Path
);
55
int
Authenticate
();
56
void
ConfigCheck
(
unsigned
char
*theConfig);
57
enum
Bearing
{
isDown
,
isLateral
,
isUp
};
58
const
char
*
Dispatch
(
Bearing
cDir,
int
maxWait,
int
maxTries);
59
XrdCmsRouting
*
Login_Failed
(
const
char
*Reason);
60
void
Pander
(
const
char
*manager,
int
mport);
61
void
Reissue
(
XrdCmsRRData
&Data);
62
void
Reply_Delay
(
XrdCmsRRData
&Data,
kXR_unt32
theDelay);
63
void
Reply_Error
(
XrdCmsRRData
&Data,
int
ecode,
const
char
*etext);
64
65
static
XrdSysMutex
ProtMutex
;
66
static
XrdCmsProtocol
*
ProtStack
;
67
static
XrdCmsParser
ProtArgs
;
68
XrdCmsProtocol
*
ProtLink
;
69
70
XrdCmsRouting
*
Routing
;
// Request routing for this instance
71
72
static
const
int
maxReqSize
= 16384;
73
74
XrdLink
*
Link
;
75
static
int
readWait
;
76
const
char
*
myRole
;
77
const
char
*
myMan
;
78
int
myManPort
;
79
XrdCmsNode
*
myNode
;
80
short
RSlot
;
// True only for redirectors
81
char
loggedIn
;
// True of login succeeded
82
};
83
#endif
Generated by
1.8.1.2