00001 #ifndef _CMS_CONFIG_H_
00002 #define _CMS_CONFIG_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
00035 #include "Xrd/XrdJob.hh"
00036 #include "XrdCms/XrdCmsPList.hh"
00037 #include "XrdCms/XrdCmsTypes.hh"
00038 #include "XrdOuc/XrdOucPList.hh"
00039 #include "XrdOuc/XrdOucTList.hh"
00040
00041 class XrdInet;
00042 class XrdProtocol_Config;
00043 class XrdScheduler;
00044 class XrdNetSecurity;
00045 class XrdNetSocket;
00046 class XrdOss;
00047 class XrdSysError;
00048 class XrdOucEnv;
00049 class XrdOucName2Name;
00050 class XrdOucProg;
00051 class XrdOucStream;
00052 class XrdCmsAdmin;
00053
00054 struct XrdVersionInfo;
00055
00056 class XrdCmsConfig : public XrdJob
00057 {
00058 public:
00059
00060 int Configure0(XrdProtocol_Config *pi);
00061 int Configure1(int argc, char **argv, char *cfn);
00062 int Configure2();
00063 int ConfigXeq(char *var, XrdOucStream &CFile, XrdSysError *eDest);
00064 void DoIt();
00065 int GenLocalPath(const char *oldp, char *newp);
00066 int asManager() {return isManager;}
00067 int asMetaMan() {return isManager && isMeta;}
00068 int asPeer() {return isPeer;}
00069 int asProxy() {return isProxy;}
00070 int asServer() {return isServer;}
00071 int asSolo() {return isSolo;}
00072
00073 int LUPDelay;
00074 int LUPHold;
00075 int DELDelay;
00076 int DRPDelay;
00077 int PSDelay;
00078 int RWDelay;
00079 int QryDelay;
00080 int QryMinum;
00081 int SRVDelay;
00082 int SUPCount;
00083 int SUPLevel;
00084 int SUPDelay;
00085 int SUSDelay;
00086 int MaxLoad;
00087 int MaxDelay;
00088 int MaxRetries;
00089 int MsgTTL;
00090 int RefReset;
00091 int RefTurn;
00092 int AskPerf;
00093 int AskPing;
00094 int PingTick;
00095 int LogPerf;
00096
00097 int PortTCP;
00098 int PortSUP;
00099 XrdInet *NetTCP;
00100
00101 int P_cpu;
00102 int P_dsk;
00103 int P_fuzz;
00104 int P_gsdf;
00105 int P_gshr;
00106 int P_io;
00107 int P_load;
00108 int P_mem;
00109 int P_pag;
00110
00111 char DoMWChk;
00112 char DoHnTry;
00113 char nbSQ;
00114 char MultiSrc;
00115
00116 int DiskMin;
00117 int DiskHWM;
00118 short DiskMinP;
00119 short DiskHWMP;
00120 int DiskLinger;
00121 int DiskAsk;
00122 int DiskWT;
00123 int DiskSS;
00124 int DiskOK;
00125
00126 char sched_RR;
00127 char sched_Pack;
00128 char sched_Level;
00129 char sched_Force;
00130 int doWait;
00131
00132 int adsPort;
00133 int adsMon;
00134 char *adsProt;
00135
00136 char *mrRdrHost;
00137 int mrRdrHLen;
00138 int mrRdrPort;
00139 char *msRdrHost;
00140 int msRdrHLen;
00141 int msRdrPort;
00142
00143 XrdVersionInfo *myVInfo;
00144
00145 XrdOucName2Name *xeq_N2N;
00146 XrdOucName2Name *lcl_N2N;
00147
00148 char *ConfigFN;
00149 char *ossLib;
00150 char *ossParms;
00151 char *prfLib;
00152 char *prfParms;
00153 char *VNID_Lib;
00154 char *VNID_Parms;
00155 char *N2N_Lib;
00156 char *N2N_Parms;
00157 char *LocalRoot;
00158 char *RemotRoot;
00159 char *myPaths;
00160 short RepStats;
00161 char TimeZone;
00162 char myRoleID;
00163 char myRType[4];
00164 char *myRole;
00165 const char *myProg;
00166 const char *myName;
00167 const char *myDomain;
00168 const char *myInsName;
00169 const char *myInstance;
00170 const char *mySID;
00171 const char *myVNID;
00172 const char *mySite;
00173 char *envCGI;
00174 char *cidTag;
00175 const char *ifList;
00176 XrdOucTList *ManList;
00177 XrdOucTList *NanList;
00178 XrdOucTList *SanList;
00179
00180 XrdOss *ossFS;
00181 XrdOucProg *ProgCH;
00182 XrdOucProg *ProgMD;
00183 XrdOucProg *ProgMP;
00184 XrdOucProg *ProgMV;
00185 XrdOucProg *ProgRD;
00186 XrdOucProg *ProgRM;
00187 XrdOucProg *ProgTR;
00188
00189 unsigned long long DirFlags;
00190 XrdCmsPList_Anchor PathList;
00191 XrdOucPListAnchor PexpList;
00192 XrdNetSocket *AdminSock;
00193 XrdNetSocket *AnoteSock;
00194 XrdNetSocket *RedirSock;
00195 XrdNetSecurity *Police;
00196
00197 XrdCmsConfig() : XrdJob("cmsd startup") {ConfigDefaults();}
00198 ~XrdCmsConfig() {}
00199
00200
00201
00202 static const int RepStat_frq = 0x0001;
00203 static const int RepStat_shr = 0x0002;
00204 static const int RepStat_All = 0xffff;
00205
00206 private:
00207
00208 void ConfigDefaults(void);
00209 int ConfigN2N(void);
00210 int ConfigOSS(void);
00211 int ConfigProc(int getrole=0);
00212 int isExec(XrdSysError *eDest, const char *ptype, char *prog);
00213 int Manifest();
00214 int MergeP(void);
00215 int setupManager(void);
00216 int setupServer(void);
00217 char *setupSid();
00218 void Usage(int rc);
00219 int xapath(XrdSysError *edest, XrdOucStream &CFile);
00220 int xallow(XrdSysError *edest, XrdOucStream &CFile);
00221 int xaltds(XrdSysError *edest, XrdOucStream &CFile);
00222 int Fsysadd(XrdSysError *edest, int chk, char *fn);
00223 int xblk(XrdSysError *edest, XrdOucStream &CFile, bool iswl=false);
00224 int xcid(XrdSysError *edest, XrdOucStream &CFile);
00225 int xdelay(XrdSysError *edest, XrdOucStream &CFile);
00226 int xdefs(XrdSysError *edest, XrdOucStream &CFile);
00227 int xdfs(XrdSysError *edest, XrdOucStream &CFile);
00228 int xexpo(XrdSysError *edest, XrdOucStream &CFile);
00229 int xfsxq(XrdSysError *edest, XrdOucStream &CFile);
00230 int xfxhld(XrdSysError *edest, XrdOucStream &CFile);
00231 int xlclrt(XrdSysError *edest, XrdOucStream &CFile);
00232 int xmang(XrdSysError *edest, XrdOucStream &CFile);
00233 int xnbsq(XrdSysError *edest, XrdOucStream &CFile);
00234 int xperf(XrdSysError *edest, XrdOucStream &CFile);
00235 int xping(XrdSysError *edest, XrdOucStream &CFile);
00236 int xprep(XrdSysError *edest, XrdOucStream &CFile);
00237 int xprepm(XrdSysError *edest, XrdOucStream &CFile);
00238 int xreps(XrdSysError *edest, XrdOucStream &CFile);
00239 int xrmtrt(XrdSysError *edest, XrdOucStream &CFile);
00240 int xrole(XrdSysError *edest, XrdOucStream &CFile);
00241 int xsched(XrdSysError *edest, XrdOucStream &CFile);
00242 int xschedm(char *val, XrdSysError *eDest, XrdOucStream &CFile);
00243 int xschedx(char *val, XrdSysError *eDest, XrdOucStream &CFile);
00244 bool xschedy(char *val, XrdSysError *eDest, char *&host, int &hlen, int &port);
00245 int xsecl(XrdSysError *edest, XrdOucStream &CFile);
00246 int xspace(XrdSysError *edest, XrdOucStream &CFile);
00247 int xsubc(XrdSysError *edest, XrdOucStream &CFile);
00248 int xsupp(XrdSysError *edest, XrdOucStream &CFile);
00249 int xtrace(XrdSysError *edest, XrdOucStream &CFile);
00250 int xvnid(XrdSysError *edest, XrdOucStream &CFile);
00251
00252 XrdInet *NetTCPr;
00253 XrdOucEnv *xrdEnv;
00254 char *AdminPath;
00255 int AdminMode;
00256 char **inArgv;
00257 int inArgc;
00258 char *SecLib;
00259 char *blkList;
00260 int blkChk;
00261 int isManager;
00262 int isMeta;
00263 int isPeer;
00264 int isProxy;
00265 int isServer;
00266 int isSolo;
00267 char *perfpgm;
00268 int perfint;
00269 int cachelife;
00270 int emptylife;
00271 int pendplife;
00272 int FSlim;
00273 };
00274 namespace XrdCms
00275 {
00276 extern XrdCmsAdmin Admin;
00277 extern XrdCmsConfig Config;
00278 extern XrdScheduler *Sched;
00279 }
00280 #endif