XRootD
Loading...
Searching...
No Matches
XrdFrmConfig.hh
Go to the documentation of this file.
1#ifndef _XRD_FRMCONFIG_H
2#define _XRD_FRMCONFIG_H
3/******************************************************************************/
4/* */
5/* X r d F r m C o n f i g . h h */
6/* */
7/* (C) 2009 by the Board of Trustees of the Leland Stanford, Jr., University */
8/* Produced by Andrew Hanushevsky for Stanford University under contract */
9/* DE-AC02-76-SFO0515 with the Deprtment of Energy */
10/* */
11/* This file is part of the XRootD software suite. */
12/* */
13/* XRootD is free software: you can redistribute it and/or modify it under */
14/* the terms of the GNU Lesser General Public License as published by the */
15/* Free Software Foundation, either version 3 of the License, or (at your */
16/* option) any later version. */
17/* */
18/* XRootD is distributed in the hope that it will be useful, but WITHOUT */
19/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
20/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
21/* License for more details. */
22/* */
23/* You should have received a copy of the GNU Lesser General Public License */
24/* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
25/* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
26/* */
27/* The copyright holder's institutional names and contributor's names may not */
28/* be used to endorse or promote products derived from this software without */
29/* specific prior written permission of the institution or contributor. */
30/******************************************************************************/
31
32#include <cstring>
33#include <unistd.h>
34
35#include "XrdOss/XrdOssSpace.hh"
36
37class XrdCks;
38class XrdNetCmsNotify;
39class XrdOfsConfigPI;
40class XrdOss;
41class XrdOucMsubs;
42class XrdOucName2Name;
43class XrdOucProg;
44class XrdOucStream;
45class XrdOucTList;
46class XrdSysLogger;
47
48class XrdFrmConfigSE;
49
50struct XrdVersionInfo;
51struct stat;
52
54{
55public:
56
57const char *myProg;
58const char *myName;
59const char *myInst;
60const char *mySite;
61const char *myFrmid;
62const char *myFrmID;
63const char *lockFN;
65char *QPath;
66char *PidPath;
69char *MSSCmd;
71
72struct Cmd
73 {const char *Desc;
74 char *theCmd;
76 int TLimit;
77 int Opts;
78 } xfrCmd[4];
79static const int cmdAlloc = 0x0001;
80static const int cmdMDP = 0x0002;
81static const int cmdStats = 0x0004;
82static const int cmdXPD = 0x0008;
83static const int cmdRME = 0x0010;
84
87
88XrdOfsConfigPI *OfsCfg; // -> Plugin Configurator
89XrdCks *CksMan; // -> Checksum Manager
90XrdOucName2Name *the_N2N; // -> File mapper object
93uid_t myUid;
94gid_t myGid;
95long long cmdFree;
109int Fix;
113int runOld; // Backward compatibility
114int runNew; // Forward compatibility
115int nonXA; // Backward compatibility for noXA spaces
116int hasCache; // Backward compatibility for noXA spaces
117char **vectArg;
120
121struct VPInfo
123 char *Name;
125 int Val;
126 VPInfo(char *n, int m=0, struct VPInfo *p=0)
127 : Next(p), Name(strdup(n)), Dir(0), Val(m) {}
128 ~VPInfo() {} // Deletes are not important
130VPInfo *pathList; // Migr/Purg list of paths
131XrdOucTList *spacList; // Migr/Purg list of spaces
132
133struct Policy
134 {long long minFree;
135 long long maxFree;
136 int Hold;
137 int Ext;
140 Policy(const char *snv, long long minV, long long maxV,
141 int hV, int xV) : minFree(minV), maxFree(maxV),
142 Hold(hV), Ext(xV), Next(0) {strcpy(Sname, snv);}
144 };
146
148int pVecNum; // Number of policy variables
149static const int pVecMax=8;
151char *pProg;
154
157
158int Configure(int argc, char **argv, int (*ppf)());
159
160int LocalPath (const char *oldp, char *newp, int newpsz);
161
162int LogicalPath(const char *oldp, char *newp, int newpsz);
163
164int NeedsCTA(const char *Lfn);
165
166unsigned
167long long PathOpts(const char *Lfn);
168
169int RemotePath (const char *oldp, char *newp, int newpsz);
170
171XrdOucTList *Space(const char *Name, const char *Path=0);
172
173int Stat(const char *xLfn, const char *xPfn, struct stat *buff);
174
176
177 XrdFrmConfig(SubSys ss, const char *vopts, const char *uinfo);
179
180private:
181XrdOucMsubs *ConfigCmd(const char *cname, char *cdata);
182int ConfigMum(XrdFrmConfigSE &theSE);
183int ConfigN2N();
184int ConfigMon(int isxfr);
185int ConfigMP(const char *);
186int ConfigMss();
187int ConfigOTO(char *Parms);
188int ConfigPaths();
189void ConfigPF(const char *pFN);
190int ConfigProc();
191int ConfigXeq(char *var, int mbok);
192int ConfigXfr();
193int getTime(const char *, const char *, int *, int mnv=-1, int mxv=-1);
194int Grab(const char *var, char **Dest, int nosubs);
195XrdOucTList *InsertPL(XrdOucTList *pP, const char *Path, int Plen, int isRW);
196void InsertXD(const char *Path);
197void Usage(int rc);
198int xapath();
199int xcks();
200int xcnsd();
201int xcopy();
202int xcopy(int &TLim);
203int xcmax();
204int xdpol();
205int xitm(const char *What, int &tDest);
206int xnml();
207int xmon();
208int xpol();
209int xpolprog();
210int xqchk();
211int xsit();
212int xspace(int isPrg=0, int isXA=1);
213void xspaceBuild(char *grp, char *fn, int isxa);
214int xxfr();
215
216char *ConfigFN;
217char *LocalRoot;
218char *RemoteRoot;
219XrdOucStream *cFile;
220XrdVersionInfo *myVersion;
221
222bool doStatPF;
223int plnDTS;
224const char *pfxDTS;
225const char *vOpts;
226const char *uInfo;
227char *N2N_Lib; // -> Name2Name Library Path
228char *N2N_Parms; // -> Name2Name Object Parameters
229XrdOucName2Name *lcl_N2N; // -> File mapper for local files
230XrdOucName2Name *rmt_N2N; // -> File mapper for remote files
231SubSys ssID;
232};
233namespace XrdFrm
234{
235extern XrdFrmConfig Config;
236}
237#endif
void Usage(const char *msg)
struct stat Stat
Definition XrdCks.cc:49
#define stat(a, b)
Definition XrdPosix.hh:101
XrdOucString Path
struct XrdFrmConfig::Cmd xfrCmd[4]
XrdOucTList * Space(const char *Name, const char *Path=0)
int LogicalPath(const char *oldp, char *newp, int newpsz)
int NeedsCTA(const char *Lfn)
XrdOfsConfigPI * OfsCfg
XrdNetCmsNotify * cmsPath
static const int cmdStats
static const int cmdAlloc
struct XrdFrmConfig::VPInfo * VPList
const char * myInst
XrdOucProg * MSSProg
XrdCks * CksMan
static const int cmdRME
int RemotePath(const char *oldp, char *newp, int newpsz)
char * myInstance
XrdOss * ossFS
XrdOucMsubs * theVec
const char * mySite
VPInfo * pathList
static const int cmdXPD
unsigned long long PathOpts(const char *Lfn)
XrdFrmConfig(SubSys ss, const char *vopts, const char *uinfo)
const char * myFrmID
const char * Desc
XrdOucTList * spacList
const char * myFrmid
char pVec[pVecMax]
long long cmdFree
static const int cmdMDP
static const int pVecMax
XrdOucName2Name * the_N2N
int LocalPath(const char *oldp, char *newp, int newpsz)
const char * myProg
int Configure(int argc, char **argv, int(*ppf)())
const char * lockFN
const char * myName
static const int minSNbsz
XrdFrmConfig Config
Policy(const char *snv, long long minV, long long maxV, int hV, int xV)
char Sname[XrdOssSpace::minSNbsz]
VPInfo(char *n, int m=0, struct VPInfo *p=0)