|
xrootd
|
00001 #ifndef __XrdProtLoad_H__ 00002 #define __XrdProtLoad_H__ 00003 /******************************************************************************/ 00004 /* */ 00005 /* X r d P r o t L o a d . h h */ 00006 /* */ 00007 /* (c) 2006 by the Board of Trustees of the Leland Stanford, Jr., University */ 00008 /* All Rights Reserved. See XrdInfo.cc for complete License Terms */ 00009 /* Produced by Andrew Hanushevsky for Stanford University under contract */ 00010 /* DE-AC03-76-SFO0515 with the Department of Energy */ 00011 /******************************************************************************/ 00012 00013 #include "Xrd/XrdProtocol.hh" 00014 00015 class XrdSysPlugin; 00016 00017 // This class load and allows the selection of the appropriate link protocol. 00018 // 00019 class XrdProtLoad : public XrdProtocol 00020 { 00021 public: 00022 00023 void DoIt() {} 00024 00025 static void Init(XrdSysError *eP, XrdOucTrace *tP) 00026 {XrdLog = eP; XrdTrace = tP;} 00027 00028 static int Load(const char *lname, const char *pname, char *parms, 00029 XrdProtocol_Config *pi); 00030 00031 static int Port(const char *lname, const char *pname, char *parms, 00032 XrdProtocol_Config *pi); 00033 00034 XrdProtocol *Match(XrdLink *) {return 0;} 00035 00036 int Process(XrdLink *lp); 00037 00038 void Recycle(XrdLink *lp, int ctime, const char *txt); 00039 00040 int Stats(char *buff, int blen, int do_sync=0) {return 0;} 00041 00042 static int Statistics(char *buff, int blen, int do_sync=0); 00043 00044 XrdProtLoad(int port=-1); 00045 ~XrdProtLoad(); 00046 00047 static const int ProtoMax = 8; 00048 00049 private: 00050 00051 static XrdProtocol *getProtocol (const char *lname, const char *pname, 00052 char *parms, XrdProtocol_Config *pi); 00053 static int getProtocolPort(const char *lname, const char *pname, 00054 char *parms, XrdProtocol_Config *pi); 00055 00056 static XrdSysError *XrdLog; 00057 static XrdOucTrace *XrdTrace; 00058 00059 static char *ProtName[ProtoMax]; // ->Supported protocol names 00060 static XrdProtocol *Protocol[ProtoMax]; // ->Supported protocol objects 00061 static int ProtPort[ProtoMax]; // ->Supported protocol ports 00062 static XrdProtocol *ProtoWAN[ProtoMax]; // ->Supported protocol objects WAN 00063 static int ProtoCnt; // Number in table (at least 1) 00064 static int ProtWCnt; // Number in table (WAN may be 0) 00065 00066 static char *liblist[ProtoMax]; // -> Path used for shared library 00067 static XrdSysPlugin *libhndl[ProtoMax]; // -> Plugin object 00068 static int libcnt; // Number in table 00069 00070 int myPort; 00071 }; 00072 #endif
1.7.5