00001 #ifndef _XRDOUCPSX_H
00002 #define _XRDOUCPSX_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #include <stdlib.h>
00034 #include <string.h>
00035 #include <sys/types.h>
00036
00037 #include "XrdOuc/XrdOucCacheCM.hh"
00038
00039 class XrdOucEnv;
00040 class XrdOucName2Name;
00041 class XrdSysError;
00042 class XrdOucStream;
00043 class XrdOucTList;
00044
00045 struct XrdVersionInfo;
00046
00047 class XrdOucPsx
00048 {
00049 public:
00050
00051 const
00052 char *CCMInfo(const char *&path) {path = mPath; return mParm;}
00053
00054 bool ClientConfig(const char *pfx, bool hush=false);
00055
00056 bool ConfigSetup(XrdSysError &eDest, bool hush=false);
00057
00058 bool hasCache() {return mCache != 0 || cPath != 0;}
00059
00060 bool ParseCache(XrdSysError *Eroute, XrdOucStream &Config);
00061
00062 bool ParseCio(XrdSysError *Eroute, XrdOucStream &Config);
00063
00064 bool ParseCLib(XrdSysError *Eroute, XrdOucStream &Config);
00065
00066 bool ParseMLib(XrdSysError *Eroute, XrdOucStream &Config);
00067
00068 bool ParseINet(XrdSysError *Eroute, XrdOucStream &Config);
00069
00070 bool ParseNLib(XrdSysError *Eroute, XrdOucStream &Config);
00071
00072 bool ParseSet(XrdSysError *Eroute, XrdOucStream &Config);
00073
00074 bool ParseTrace(XrdSysError *Eroute, XrdOucStream &Config);
00075
00076 void SetRoot(const char *lroot, const char *oroot=0);
00077
00078 char *configFN;
00079 XrdSysLogger *theLogger;
00080 XrdOucEnv *theEnv;
00081 XrdOucName2Name *theN2N;
00082 XrdOucCache *theCache;
00083 XrdOucCacheCMInit_t initCCM;
00084 char *mCache;
00085 XrdOucTList *setFirst;
00086 XrdOucTList *setLast;
00087 int maxRHCB;
00088 int traceLvl;
00089 int debugLvl;
00090 int cioWait;
00091 int cioTries;
00092 bool useV4;
00093 bool xLfn2Pfn;
00094 char xPfn2Lfn;
00095 bool xNameLib;
00096
00097 static const int xP2Loff = 0;
00098 static const int xP2Lon = 1;
00099 static const int xP2Lsrc = 2;
00100 static const int xP2Lsgi = 3;
00101
00102 XrdOucPsx(XrdVersionInfo *vInfo, const char *cfn,
00103 XrdSysLogger *lp=0, XrdOucEnv *vp=0)
00104 : configFN(strdup(cfn)), theLogger(lp), theEnv(vp),
00105 theN2N(0), theCache(0), initCCM(0),
00106 mCache(0), setFirst(0), setLast(0), maxRHCB(0),
00107 traceLvl(0), debugLvl(0), cioWait(0), cioTries(0),
00108 useV4(false), xLfn2Pfn(false), xPfn2Lfn(xP2Loff),
00109 xNameLib(false),
00110 LocalRoot(0), RemotRoot(0), N2NLib(0), N2NParms(0),
00111 cPath(0), cParm(0), mPath(0), mParm(0),
00112 myVersion(vInfo) {}
00113 ~XrdOucPsx();
00114
00115 private:
00116
00117 char *LocalRoot;
00118 char *RemotRoot;
00119 char *N2NLib;
00120 char *N2NParms;
00121 char *cPath;
00122 char *cParm;
00123 char *mPath;
00124 char *mParm;
00125 XrdVersionInfo *myVersion;
00126
00127 bool ConfigCache(XrdSysError &eDest);
00128 bool ConfigN2N(XrdSysError &eDest);
00129 bool LoadCCM(XrdSysError &eDest);
00130 bool Parse(char*, XrdOucStream&, XrdSysError&);
00131 char *ParseCache(XrdSysError *Eroute, XrdOucStream &Config, char *pBuff);
00132 void ParseSet(const char *kword, int kval);
00133 void WarnConfig(XrdSysError &eDest, XrdOucTList *tList, bool fatal);
00134 void WarnPlugin(XrdSysError &eDest, XrdOucTList *tList,
00135 const char *txt1, const char *txt2);
00136 };
00137 #endif