00001 #ifndef _XRD_FRMCONFIG_H
00002 #define _XRD_FRMCONFIG_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include <string.h>
00016 #include <unistd.h>
00017
00018 #include "XrdOss/XrdOssSpace.hh"
00019
00020 class XrdCmsNotify;
00021 class XrdOss;
00022 class XrdOucMsubs;
00023 class XrdOucName2Name;
00024 class XrdOucProg;
00025 class XrdOucStream;
00026 class XrdOucTList;
00027
00028 class XrdFrmConfigSE;
00029
00030 class XrdFrmConfig
00031 {
00032 public:
00033
00034 const char *myProg;
00035 const char *myName;
00036 const char *myInst;
00037 const char *myInsName;
00038 const char *myFrmid;
00039 const char *myFrmID;
00040 const char *lockFN;
00041 char *AdminPath;
00042 char *myInstance;
00043 char *StopFile;
00044 char *qPath;
00045 char *c2sFN;
00046 char *MSSCmd;
00047 XrdOucProg *MSSProg;
00048 char *xfrCmd;
00049 XrdOucMsubs *xfrVec;
00050 XrdOucName2Name *the_N2N;
00051 XrdOss *ossFS;
00052 XrdCmsNotify *cmsPath;
00053 uid_t myUid;
00054 gid_t myGid;
00055 long long cmdFree;
00056 int cmdHold;
00057 int AdminMode;
00058 int isAgent;
00059 int xfrMax;
00060 int WaitTime;
00061 int monStage;
00062 int sSpec;
00063 int isOTO;
00064 int Fix;
00065 int Test;
00066 int Verbose;
00067 char **vectArg;
00068 int nextArg;
00069 int numcArg;
00070
00071 struct VPInfo
00072 {VPInfo *Next;
00073 char *Name;
00074 XrdOucTList *Dir;
00075 int Val;
00076 VPInfo(char *n, int m=0, struct VPInfo *p=0)
00077 : Next(p), Name(strdup(n)), Dir(0), Val(m) {}
00078 ~VPInfo() {}
00079 } *VPList;
00080 VPInfo *pathList;
00081 XrdOucTList *spacList;
00082
00083 struct Policy
00084 {long long minFree;
00085 long long maxFree;
00086 int Hold;
00087 int Ext;
00088 Policy *Next;
00089 char Sname[XrdOssSpace::minSNbsz];
00090 Policy(const char *snv, long long minV, long long maxV,
00091 int hV, int xV) : minFree(minV), maxFree(maxV),
00092 Hold(hV), Ext(xV), Next(0) {strcpy(Sname, snv);}
00093 ~Policy() {}
00094 };
00095 Policy dfltPolicy;
00096
00097 int dirHold;
00098 int pVecNum;
00099 static const int pVecMax=8;
00100 char pVec[pVecMax];
00101 char *pProg;
00102
00103 enum PPVar {PP_atime=0, PP_ctime, PP_fname, PP_fsize, PP_fspace,
00104 PP_mtime, PP_pfn, PP_sname, PP_tspace, PP_usage};
00105
00106 int Configure(int argc, char **argv, int (*ppf)());
00107
00108 int LocalPath (const char *oldp, char *newp, int newpsz);
00109
00110 int RemotePath(const char *oldp, char *newp, int newpsz);
00111
00112 XrdOucTList *Space(const char *Name, const char *Path=0);
00113
00114 enum SubSys {ssAdmin, ssMigr, ssPstg, ssPurg};
00115
00116 XrdFrmConfig(SubSys ss, const char *vopts, const char *uinfo);
00117 ~XrdFrmConfig() {}
00118
00119 private:
00120 XrdOucMsubs *ConfigCmd(const char *cname, char *cdata);
00121 int ConfigMum(XrdFrmConfigSE &theSE);
00122 int ConfigN2N();
00123 int ConfigMP(const char *);
00124 int ConfigMss();
00125 int ConfigOTO(char *Parms);
00126 int ConfigPaths();
00127 int ConfigProc();
00128 int ConfigXeq(char *var, int mbok);
00129 int getTime(const char *, const char *, int *, int mnv=-1, int mxv=-1);
00130 int Grab(const char *var, char **Dest, int nosubs);
00131 XrdOucTList *InsertPL(XrdOucTList *pP, const char *Path, int Plen, int isRW);
00132 void InsertXD(const char *Path);
00133 void Usage(int rc);
00134 int xapath();
00135 int xcache(int isPrg=0);
00136 void xcacheBuild(char *grp, char *fn, int isxa);
00137 int xdpol();
00138 int xmaxx();
00139 int xnml();
00140 int xmon();
00141 int xpol();
00142 int xpolprog();
00143 int xwtm();
00144
00145 char *ConfigFN;
00146 char *ossLib;
00147 char *LocalRoot;
00148 char *RemoteRoot;
00149 XrdOucStream *cFile;
00150
00151 int plnDTS;
00152 const char *pfxDTS;
00153 const char *vOpts;
00154 const char *uInfo;
00155 char *N2N_Lib;
00156 char *N2N_Parms;
00157 XrdOucName2Name *lcl_N2N;
00158 XrdOucName2Name *rmt_N2N;
00159 SubSys ssID;
00160 };
00161 namespace XrdFrm
00162 {
00163 extern XrdFrmConfig Config;
00164 }
00165 #endif