xrootd
Loading...
Searching...
No Matches
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"
35#include "XrdCms/XrdCmsTypes.hh"
37
38class XrdLink;
39class XrdCmsManager;
40class XrdCmsNode;
41class XrdCmsRRData;
42class XrdCmsRouting;
43
45{
46friend class XrdCmsJob;
47public:
48
49static XrdCmsProtocol *Alloc(const char *theRole = "", XrdCmsManager *mP=0,
50 const char *theMan = 0, int thePort=0);
51
52 void DoIt();
53
55
56 XrdProtocol *Match(XrdLink *lp); // Upon accept
57
58 int Process(XrdLink *lp); // Initial entry
59
60 void Recycle(XrdLink *lp, int consec, const char *reason);
61
62 void Ref(int rcnt);
63
64 int Stats(char *buff, int blen, int do_sync=0);
65
66 XrdCmsProtocol() : XrdProtocol("cms protocol handler") {Init();}
68
69private:
70
75SMask_t AddPath(XrdCmsNode *nP, const char *pType, const char *Path);
77void ConfigCheck(unsigned char *theConfig);
79const char *Dispatch(Bearing cDir, int maxWait, int maxTries);
80void Init(const char *iRole="?", XrdCmsManager *uMan=0,
81 const char *iMan="?", int iPort=0);
82XrdCmsRouting *Login_Failed(const char *Reason);
83void Pander(const char *manager, int mport);
85void Reply_Delay(XrdCmsRRData &Data, kXR_unt32 theDelay);
86void Reply_Error(XrdCmsRRData &Data, int ecode, const char *etext);
87bool SendPing();
88void Sync();
89
94
95 XrdCmsRouting *Routing; // Request routing for this instance
96
97static const int maxReqSize = 16384;
101static int readWait;
102const char *myRole;
105const char *myMan;
108 short RSlot; // True only for redirectors
109 char loggedIn; // True if login succeeded
110 bool isNBSQ; // True if nbsq is active
111};
112#endif
unsigned int kXR_unt32
Definition XPtypes.hh:90
unsigned long long SMask_t
Definition XrdCmsTypes.hh:33
Definition XrdCmsJob.hh:43
Definition XrdCmsManager.hh:56
Definition XrdCmsNode.hh:58
Definition XrdCmsParser.hh:46
Definition XrdCmsProtocol.hh:45
XrdCmsRouting * Login_Failed(const char *Reason)
bool isNBSQ
Definition XrdCmsProtocol.hh:110
XrdLink * Link
Definition XrdCmsProtocol.hh:100
~XrdCmsProtocol()
Definition XrdCmsProtocol.hh:67
void Init(const char *iRole="?", XrdCmsManager *uMan=0, const char *iMan="?", int iPort=0)
XrdCmsProtocol()
Definition XrdCmsProtocol.hh:66
void Recycle(XrdLink *lp, int consec, const char *reason)
const char * myMan
Definition XrdCmsProtocol.hh:105
XrdCmsRouting * Routing
Definition XrdCmsProtocol.hh:95
static XrdCmsParser ProtArgs
Definition XrdCmsProtocol.hh:92
XrdCmsRouting * Admit()
short RSlot
Definition XrdCmsProtocol.hh:108
SMask_t AddPath(XrdCmsNode *nP, const char *pType, const char *Path)
void Reply_Delay(XrdCmsRRData &Data, kXR_unt32 theDelay)
void Reply_Error(XrdCmsRRData &Data, int ecode, const char *etext)
int Process(XrdLink *lp)
XrdSysSemaphore * refWait
Definition XrdCmsProtocol.hh:99
XrdCmsNode * myNode
Definition XrdCmsProtocol.hh:103
void Ref(int rcnt)
int Execute(XrdCmsRRData &Data)
static XrdCmsProtocol * Alloc(const char *theRole="", XrdCmsManager *mP=0, const char *theMan=0, int thePort=0)
const char * Dispatch(Bearing cDir, int maxWait, int maxTries)
XrdCmsRouting * Admit_DataServer(int)
int refCount
Definition XrdCmsProtocol.hh:107
XrdCmsRouting * Admit_Supervisor(int)
const char * myRole
Definition XrdCmsProtocol.hh:102
char loggedIn
Definition XrdCmsProtocol.hh:109
XrdCmsProtocol * ProtLink
Definition XrdCmsProtocol.hh:93
static const int maxReqSize
Definition XrdCmsProtocol.hh:97
int Stats(char *buff, int blen, int do_sync=0)
static XrdCmsProtocol * ProtStack
Definition XrdCmsProtocol.hh:91
static XrdSysMutex ProtMutex
Definition XrdCmsProtocol.hh:90
void ConfigCheck(unsigned char *theConfig)
XrdSysMutex refMutex
Definition XrdCmsProtocol.hh:98
void Pander(const char *manager, int mport)
XrdCmsRouting * Admit_Redirector(int)
Bearing
Definition XrdCmsProtocol.hh:78
@ isDown
Definition XrdCmsProtocol.hh:78
@ isLateral
Definition XrdCmsProtocol.hh:78
@ isUp
Definition XrdCmsProtocol.hh:78
XrdCmsManager * Manager
Definition XrdCmsProtocol.hh:104
void Reissue(XrdCmsRRData &Data)
static int readWait
Definition XrdCmsProtocol.hh:101
int myManPort
Definition XrdCmsProtocol.hh:106
XrdProtocol * Match(XrdLink *lp)
Definition XrdCmsRRData.hh:52
Definition XrdCmsRouting.hh:36
Definition XrdProtocol.hh:125
Definition XrdSysPthread.hh:165
Definition XrdSysPthread.hh:494