xrootd
XrdProtLoad.hh
Go to the documentation of this file.
1 #ifndef __XrdProtLoad_H__
2 #define __XrdProtLoad_H__
3 /******************************************************************************/
4 /* */
5 /* X r d P r o t L o a d . h h */
6 /* */
7 /* (c) 2006 by the Board of Trustees of the Leland Stanford, Jr., University */
8 /* All Rights Reserved. See XrdInfo.cc for complete License Terms */
9 /* Produced by Andrew Hanushevsky for Stanford University under contract */
10 /* DE-AC03-76-SFO0515 with the Department of Energy */
11 /******************************************************************************/
12 
13 #include "Xrd/XrdProtocol.hh"
14 
15 class XrdSysPlugin;
16 
17 // This class load and allows the selection of the appropriate link protocol.
18 //
19 class XrdProtLoad : public XrdProtocol
20 {
21 public:
22 
23 void DoIt() {}
24 
25 static void Init(XrdSysError *eP, XrdOucTrace *tP)
26  {XrdLog = eP; XrdTrace = tP;}
27 
28 static int Load(const char *lname, const char *pname, char *parms,
29  XrdProtocol_Config *pi);
30 
31 static int Port(const char *lname, const char *pname, char *parms,
32  XrdProtocol_Config *pi);
33 
34 XrdProtocol *Match(XrdLink *) {return 0;}
35 
36 int Process(XrdLink *lp);
37 
38 void Recycle(XrdLink *lp, int ctime, const char *txt);
39 
40 int Stats(char *buff, int blen, int do_sync=0) {return 0;}
41 
42 static int Statistics(char *buff, int blen, int do_sync=0);
43 
44  XrdProtLoad(int port=-1);
45  ~XrdProtLoad();
46 
47 static const int ProtoMax = 8;
48 
49 private:
50 
51 static XrdProtocol *getProtocol (const char *lname, const char *pname,
52  char *parms, XrdProtocol_Config *pi);
53 static int getProtocolPort(const char *lname, const char *pname,
54  char *parms, XrdProtocol_Config *pi);
55 
58 
59 static char *ProtName[ProtoMax]; // ->Supported protocol names
60 static XrdProtocol *Protocol[ProtoMax]; // ->Supported protocol objects
61 static int ProtPort[ProtoMax]; // ->Supported protocol ports
62 static XrdProtocol *ProtoWAN[ProtoMax]; // ->Supported protocol objects WAN
63 static int ProtoCnt; // Number in table (at least 1)
64 static int ProtWCnt; // Number in table (WAN may be 0)
65 
66 static char *liblist[ProtoMax]; // -> Path used for shared library
67 static XrdSysPlugin *libhndl[ProtoMax]; // -> Plugin object
68 static int libcnt; // Number in table
69 
70  int myPort;
71 };
72 #endif