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