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