xrootd
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 
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  {}
47 
48 private:
49 
54 SMask_t AddPath(XrdCmsNode *nP, const char *pType, const char *Path);
55 int Authenticate();
56 void ConfigCheck(unsigned char *theConfig);
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 
69 
70  XrdCmsRouting *Routing; // Request routing for this instance
71 
72 static const int maxReqSize = 16384;
73 
75 static int readWait;
76 const char *myRole;
77 const char *myMan;
78  int myManPort;
80  short RSlot; // True only for redirectors
81  char loggedIn; // True of login succeeded
82 };
83 #endif