XRootD
Loading...
Searching...
No Matches
XrdOucPsx.hh
Go to the documentation of this file.
1#ifndef _XRDOUCPSX_H
2#define _XRDOUCPSX_H
3/******************************************************************************/
4/* */
5/* X r d O u c P s x . h h */
6/* */
7/* (c) 2017 by the Board of Trustees of the Leland Stanford, Jr., University */
8/* All Rights Reserved */
9/* Produced by Andrew Hanushevsky for Stanford University under contract */
10/* DE-AC02-76-SFO0515 with the Department of Energy */
11/* */
12/* This file is part of the XRootD software suite. */
13/* */
14/* XRootD is free software: you can redistribute it and/or modify it under */
15/* the terms of the GNU Lesser General Public License as published by the */
16/* Free Software Foundation, either version 3 of the License, or (at your */
17/* option) any later version. */
18/* */
19/* XRootD is distributed in the hope that it will be useful, but WITHOUT */
20/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
21/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
22/* License for more details. */
23/* */
24/* You should have received a copy of the GNU Lesser General Public License */
25/* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
26/* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
27/* */
28/* The copyright holder's institutional names and contributor's names may not */
29/* be used to endorse or promote products derived from this software without */
30/* specific prior written permission of the institution or contributor. */
31/******************************************************************************/
32
33#include <cstdlib>
34#include <cstring>
35#include <sys/types.h>
36
38
39class XrdOucEnv;
40class XrdOucName2Name;
41class XrdSysError;
42class XrdOucStream;
43class XrdOucTList;
44
45struct XrdVersionInfo;
46
48{
49public:
50
51const
52char *CCMInfo(const char *&path) {path = mPath; return mParm;}
53
54bool ClientConfig(const char *pfx, bool hush=false);
55
56bool ConfigSetup(XrdSysError &eDest, bool hush=false);
57
58bool hasCache() {return mCache != 0 || cPath != 0;}
59
60bool ParseCache(XrdSysError *Eroute, XrdOucStream &Config);
61
62bool ParseCio(XrdSysError *Eroute, XrdOucStream &Config);
63
64bool ParseCLib(XrdSysError *Eroute, XrdOucStream &Config);
65
66bool ParseMLib(XrdSysError *Eroute, XrdOucStream &Config);
67
68bool ParseINet(XrdSysError *Eroute, XrdOucStream &Config);
69
70bool ParseNLib(XrdSysError *Eroute, XrdOucStream &Config);
71
72bool ParseSet(XrdSysError *Eroute, XrdOucStream &Config);
73
74bool ParseTrace(XrdSysError *Eroute, XrdOucStream &Config);
75
76void SetRoot(const char *lroot, const char *oroot=0);
77
78char *configFN; // -> Pointer to the config file name
81XrdOucName2Name *theN2N; // -> File mapper object
82XrdOucCache *theCache; // -> Cache object
83XrdOucCacheCMInit_t initCCM; // -> Cache context manager initializer
84char *mCache; // -> memory cache parameters
92bool useV4;
94char xPfn2Lfn; // See xP2Lxxx definitions below
96
97static const int xP2Loff = 0;
98static const int xP2Lon = 1;
99static const int xP2Lsrc = 2;
100static const int xP2Lsgi = 3;
101
102 XrdOucPsx(XrdVersionInfo *vInfo, const char *cfn,
103 XrdSysLogger *lp=0, XrdOucEnv *vp=0)
104 : configFN(strdup(cfn)), theLogger(lp), theEnv(vp),
105 theN2N(0), theCache(0), initCCM(0),
106 mCache(0), setFirst(0), setLast(0), maxRHCB(0),
107 traceLvl(0), debugLvl(0), cioWait(0), cioTries(0),
108 useV4(false), xLfn2Pfn(false), xPfn2Lfn(xP2Loff),
109 xNameLib(false),
110 LocalRoot(0), RemotRoot(0), N2NLib(0), N2NParms(0),
111 cPath(0), cParm(0), mPath(0), mParm(0),
112 myVersion(vInfo) {}
113 ~XrdOucPsx();
114
115private:
116
117char *LocalRoot;// -> Local n2n root, if any
118char *RemotRoot;// -> Remote n2n root, if any
119char *N2NLib; // -> Name2Name Library Path
120char *N2NParms; // -> Name2Name Object Parameters
121char *cPath; // -> Cache path
122char *cParm; // -> Cache parameters
123char *mPath; // -> CCM path
124char *mParm; // -> CCM parameters
125XrdVersionInfo *myVersion;// -> Compilation version
126
127bool ConfigCache(XrdSysError &eDest);
128bool ConfigN2N(XrdSysError &eDest);
129bool LoadCCM(XrdSysError &eDest);
130bool Parse(char*, XrdOucStream&, XrdSysError&);
131char *ParseCache(XrdSysError *Eroute, XrdOucStream &Config, char *pBuff);
132void ParseSet(const char *kword, int kval);
133void WarnConfig(XrdSysError &eDest, XrdOucTList *tList, bool fatal);
134void WarnPlugin(XrdSysError &eDest, XrdOucTList *tList,
135 const char *txt1, const char *txt2);
136};
137#endif
static XrdSysError eDest(0,"crypto_")
bool(* XrdOucCacheCMInit_t)(XrdPosixCache &Cache, XrdSysLogger *Logger, const char *Config, const char *Parms, XrdOucEnv *envP)
static const int xP2Lon
Definition XrdOucPsx.hh:98
XrdOucEnv * theEnv
Definition XrdOucPsx.hh:80
bool useV4
Definition XrdOucPsx.hh:92
int maxRHCB
Definition XrdOucPsx.hh:87
bool ParseINet(XrdSysError *Eroute, XrdOucStream &Config)
Definition XrdOucPsx.cc:611
static const int xP2Lsgi
Definition XrdOucPsx.hh:100
bool ClientConfig(const char *pfx, bool hush=false)
Definition XrdOucPsx.cc:100
char * configFN
Definition XrdOucPsx.hh:78
bool ParseCio(XrdSysError *Eroute, XrdOucStream &Config)
Definition XrdOucPsx.cc:481
char * mCache
Definition XrdOucPsx.hh:84
int traceLvl
Definition XrdOucPsx.hh:88
int cioTries
Definition XrdOucPsx.hh:91
void SetRoot(const char *lroot, const char *oroot=0)
Definition XrdOucPsx.cc:827
bool ParseMLib(XrdSysError *Eroute, XrdOucStream &Config)
Definition XrdOucPsx.cc:571
bool hasCache()
Definition XrdOucPsx.hh:58
char xPfn2Lfn
Definition XrdOucPsx.hh:94
XrdOucCache * theCache
Definition XrdOucPsx.hh:82
int cioWait
Definition XrdOucPsx.hh:90
XrdOucTList * setFirst
Definition XrdOucPsx.hh:85
bool xNameLib
Definition XrdOucPsx.hh:95
static const int xP2Lsrc
Definition XrdOucPsx.hh:99
int debugLvl
Definition XrdOucPsx.hh:89
bool xLfn2Pfn
Definition XrdOucPsx.hh:93
bool ParseCache(XrdSysError *Eroute, XrdOucStream &Config)
Definition XrdOucPsx.cc:330
XrdOucName2Name * theN2N
Definition XrdOucPsx.hh:81
XrdOucCacheCMInit_t initCCM
Definition XrdOucPsx.hh:83
const char * CCMInfo(const char *&path)
Definition XrdOucPsx.hh:52
static const int xP2Loff
Definition XrdOucPsx.hh:97
XrdOucTList * setLast
Definition XrdOucPsx.hh:86
bool ParseCLib(XrdSysError *Eroute, XrdOucStream &Config)
Definition XrdOucPsx.cc:525
XrdOucPsx(XrdVersionInfo *vInfo, const char *cfn, XrdSysLogger *lp=0, XrdOucEnv *vp=0)
Definition XrdOucPsx.hh:102
bool ConfigSetup(XrdSysError &eDest, bool hush=false)
Definition XrdOucPsx.cc:217
XrdSysLogger * theLogger
Definition XrdOucPsx.hh:79
bool ParseNLib(XrdSysError *Eroute, XrdOucStream &Config)
Definition XrdOucPsx.cc:646
bool ParseTrace(XrdSysError *Eroute, XrdOucStream &Config)
Definition XrdOucPsx.cc:791
bool ParseSet(XrdSysError *Eroute, XrdOucStream &Config)
Definition XrdOucPsx.cc:702