xrootd
Loading...
Searching...
No Matches
XrdOfsConfigPI.hh
Go to the documentation of this file.
1#ifndef __XRDOFSCONFIGPI_HH__
2#define __XRDOFSCONFIGPI_HH__
3/******************************************************************************/
4/* */
5/* X r d O f s C o n f i g P I . h h */
6/* */
7/* (c) 2014 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 <vector>
34
36
37class XrdAccAuthorize;
38class XrdCks;
39class XrdCksConfig;
40class XrdOfs;
41class XrdOfsFSctl_PI;
42class XrdOfsPrepare;
43class XrdOss;
44class XrdOucEnv;
45class XrdOucStream;
47class XrdSysError;
48class XrdSysXAttr;
49struct XrdVersionInfo;
50
51//-----------------------------------------------------------------------------
58//-----------------------------------------------------------------------------
59
61{
62public:
63
64//-----------------------------------------------------------------------------
67//-----------------------------------------------------------------------------
68
69enum TheLib {theAtrLib = 0x0100,
70 theAutLib = 0x0201,
71 theCksLib = 0x0402,
72 theCmsLib = 0x0803,
73 theCtlLib = 0x1004,
74 theOssLib = 0x2005,
75 thePrpLib = 0x4006,
76 allXXXLib = 0x7f07,
77 maxXXXLib = 0x0007,
78 libIXMask = 0x00ff
79 };
80
81//-----------------------------------------------------------------------------
89//-----------------------------------------------------------------------------
90
91bool Configure(XrdCmsClient *cmscP, XrdOucEnv *envP);
92
93//-----------------------------------------------------------------------------
98//-----------------------------------------------------------------------------
99
100bool ConfigCtl(XrdCmsClient *cmscP, XrdOucEnv *envP=0);
101
102//-----------------------------------------------------------------------------
109//-----------------------------------------------------------------------------
110
111void Default(TheLib what, const char *lpath, const char *lparm=0);
112
113//-----------------------------------------------------------------------------
118//-----------------------------------------------------------------------------
119
120void DefaultCS(const char *alg);
121
122//-----------------------------------------------------------------------------
124//-----------------------------------------------------------------------------
125
126void Display();
127
128//-----------------------------------------------------------------------------
137//-----------------------------------------------------------------------------
138
139bool Load(int what, XrdOucEnv *envP=0);
140
141//-----------------------------------------------------------------------------
156//-----------------------------------------------------------------------------
157
158static
159XrdOfsConfigPI *New(const char *cfn, XrdOucStream *cfgP, XrdSysError *errP,
160 XrdVersionInfo *verP=0, XrdSfsFileSystem *sfsP=0);
161
162//-----------------------------------------------------------------------------
166//-----------------------------------------------------------------------------
167
168bool LclCks() {return cksLcl;}
169
170//-----------------------------------------------------------------------------
174//-----------------------------------------------------------------------------
175
176bool OssCks();
177
178//-----------------------------------------------------------------------------
183//-----------------------------------------------------------------------------
184
185bool Parse(TheLib what);
186
187//-----------------------------------------------------------------------------
194//-----------------------------------------------------------------------------
195
197bool Plugin(XrdCks *&pip);
201bool Plugin(XrdOss *&piP);
202
203//-----------------------------------------------------------------------------
207//-----------------------------------------------------------------------------
208
209bool PrepAuth();
210
211//-----------------------------------------------------------------------------
219//-----------------------------------------------------------------------------
220
221bool Push(TheLib what, const char *plugP, const char *parmP=0);
222
223//-----------------------------------------------------------------------------
227//-----------------------------------------------------------------------------
228
229void SetCksRdSz(int rdsz);
230
231//-----------------------------------------------------------------------------
233//-----------------------------------------------------------------------------
234
236
237private:
238
239//-----------------------------------------------------------------------------
250//-----------------------------------------------------------------------------
251
252 XrdOfsConfigPI(const char *cfn, XrdOucStream *cfgP, XrdSysError *errP,
253 XrdSfsFileSystem *sfsP, XrdVersionInfo *verP=0);
254
255bool AddLib(TheLib what);
256bool AddLibAtr(XrdOucEnv *envP, XrdSysXAttr *&atrPI);
264bool RepLib(TheLib what, const char *newLib, const char *newParms=0, bool parseParms=true);
265bool SetupAttr(TheLib what, XrdOucEnv *envP);
267bool SetupCtl(XrdOucEnv *envP);
268bool SetupCms();
269bool SetupPrp(XrdOucEnv *envP);
270
278XrdVersionInfo *urVer;
279
283const char *ConfigFN;
284
285struct xxxLP
286 {char *lib;
287 char *parms;
288 char *opts;
289 xxxLP() : lib(0), parms(0), opts(0) {}
290 ~xxxLP() {if (lib) free(lib);
291 if (parms) free(parms);
292 if (opts) free(opts);
293 }
294 xxxLP& operator=(const xxxLP& rhs)
295 {if (this != &rhs)
296 {lib = (rhs.lib ? strdup(rhs.lib) : 0);
297 parms = (rhs.parms ? strdup(rhs.parms) : 0);
298 opts = (rhs.opts ? strdup(rhs.opts) : 0);
299 }
300 return *this;
301 }
302 xxxLP(const xxxLP& rhs) {*this = rhs;}
303
305std::vector<xxxLP> ALP[maxXXXLib];
306
307struct ctlLP {XrdOfsFSctl_PI *ctlPI; const char *parms;};
308
309std::vector<ctlLP> ctlVec;
310
311char *CksAlg;
321};
322#endif
XrdCmsClient *(* XrdCmsClient_t)(XrdSysLogger *, int, int, XrdOss *)
Definition XrdCmsClient.hh:427
Definition XrdAccAuthorize.hh:68
Definition XrdCksConfig.hh:44
Definition XrdCks.hh:92
Definition XrdCmsClient.hh:116
Definition XrdOfsConfigPI.hh:61
XrdOfsConfigPI(const char *cfn, XrdOucStream *cfgP, XrdSysError *errP, XrdSfsFileSystem *sfsP, XrdVersionInfo *verP=0)
bool AddLibCtl(XrdOucEnv *envP)
bool Plugin(XrdOfsPrepare *&piP)
Get Prp plugin (prepare)
XrdOss * ossPI
-> Oss plugin
Definition XrdOfsConfigPI.hh:276
XrdCksConfig * CksConfig
Definition XrdOfsConfigPI.hh:282
bool AddLib(TheLib what)
XrdVersionInfo * urVer
-> Version information
Definition XrdOfsConfigPI.hh:278
bool Parse(TheLib what)
bool ConfigCtl(XrdCmsClient *cmscP, XrdOucEnv *envP=0)
void Default(TheLib what, const char *lpath, const char *lparm=0)
bool SetupPrp(XrdOucEnv *envP)
bool ParsePrpLib()
bool ossXAttr
Definition XrdOfsConfigPI.hh:315
bool SetupAttr(TheLib what, XrdOucEnv *envP)
bool SetupAuth(XrdOucEnv *envP)
bool Loaded
Definition XrdOfsConfigPI.hh:318
void SetCksRdSz(int rdsz)
bool Plugin(XrdOfsFSctl_PI *&piP)
Get Ctl plugin.
bool ParseAtrLib()
bool Plugin(XrdAccAuthorize *&piP)
Get Authorization plugin.
bool prpAuth
Definition XrdOfsConfigPI.hh:317
XrdOfsFSctl_PI * ctlPI
-> Ctl plugin (FSCtl)
Definition XrdOfsConfigPI.hh:274
bool AddLibAtr(XrdOucEnv *envP, XrdSysXAttr *&atrPI)
bool AddLibAut(XrdOucEnv *envP)
static XrdOfsConfigPI * New(const char *cfn, XrdOucStream *cfgP, XrdSysError *errP, XrdVersionInfo *verP=0, XrdSfsFileSystem *sfsP=0)
std::vector< ctlLP > ctlVec
Definition XrdOfsConfigPI.hh:309
int CksRdsz
Definition XrdOfsConfigPI.hh:312
bool RepLib(TheLib what, const char *newLib, const char *newParms=0, bool parseParms=true)
bool AddLibOss(XrdOucEnv *envP)
struct XrdOfsConfigPI::xxxLP LP[maxXXXLib]
bool LclCks()
Definition XrdOfsConfigPI.hh:168
bool SetupCtl(XrdOucEnv *envP)
~XrdOfsConfigPI()
Destructor.
bool ParseOssLib()
const char * ConfigFN
Definition XrdOfsConfigPI.hh:283
XrdCks * cksPI
-> Checksum manager plugin
Definition XrdOfsConfigPI.hh:272
void DefaultCS(const char *alg)
bool Plugin(XrdCmsClient_t &piP)
Get Cms client object generator.
XrdSysError * Eroute
Definition XrdOfsConfigPI.hh:281
bool LoadOK
Definition XrdOfsConfigPI.hh:319
bool defLib[maxXXXLib]
Definition XrdOfsConfigPI.hh:314
std::vector< xxxLP > ALP[maxXXXLib]
Definition XrdOfsConfigPI.hh:305
bool Plugin(XrdCks *&pip)
Get Checksum manager plugin.
bool Plugin(XrdOss *&piP)
Get Oss plugin.
XrdOfsPrepare * prpPI
-> Prp plugin (prepare)
Definition XrdOfsConfigPI.hh:275
bool cksLcl
Definition XrdOfsConfigPI.hh:320
bool Load(int what, XrdOucEnv *envP=0)
XrdCmsClient_t cmsPI
-> Cms client object generator plugin
Definition XrdOfsConfigPI.hh:273
char * CksAlg
Definition XrdOfsConfigPI.hh:311
bool Push(TheLib what, const char *plugP, const char *parmP=0)
XrdOucStream * Config
Definition XrdOfsConfigPI.hh:280
bool Configure(XrdCmsClient *cmscP, XrdOucEnv *envP)
bool AddLibPrp(XrdOucEnv *envP)
XrdSfsFileSystem * sfsPI
-> Ofs plugin
Definition XrdOfsConfigPI.hh:277
char ossCksio
Definition XrdOfsConfigPI.hh:316
XrdAccAuthorize * autPI
-> Authorization plugin
Definition XrdOfsConfigPI.hh:271
TheLib
Definition XrdOfsConfigPI.hh:69
@ theOssLib
Oss plugin.
Definition XrdOfsConfigPI.hh:74
@ allXXXLib
All plugins (Load() only)
Definition XrdOfsConfigPI.hh:76
@ maxXXXLib
Maximum different plugins.
Definition XrdOfsConfigPI.hh:77
@ libIXMask
Definition XrdOfsConfigPI.hh:78
@ theCksLib
Checksum manager plugin.
Definition XrdOfsConfigPI.hh:71
@ thePrpLib
Prp plugin (prepare)
Definition XrdOfsConfigPI.hh:75
@ theCmsLib
Cms client plugin.
Definition XrdOfsConfigPI.hh:72
@ theAtrLib
Extended attribute plugin.
Definition XrdOfsConfigPI.hh:69
@ theAutLib
Authorization plugin.
Definition XrdOfsConfigPI.hh:70
@ theCtlLib
Ctl plugin (FSCtl)
Definition XrdOfsConfigPI.hh:73
bool pushOK[maxXXXLib]
Definition XrdOfsConfigPI.hh:313
void Display()
Display configuration settings.
Definition XrdOfsFSctl_PI.hh:52
Definition XrdOfsPrepare.hh:47
Definition XrdOfs.hh:236
Definition XrdOss.hh:498
Definition XrdOucEnv.hh:42
Definition XrdOucStream.hh:47
Definition XrdSfsInterface.hh:845
Definition XrdSysError.hh:90
Definition XrdSysXAttr.hh:43
Definition XrdOfsConfigPI.hh:307
const char * parms
Definition XrdOfsConfigPI.hh:307
XrdOfsFSctl_PI * ctlPI
Definition XrdOfsConfigPI.hh:307
Definition XrdOfsConfigPI.hh:286
char * parms
Definition XrdOfsConfigPI.hh:287
char * lib
Definition XrdOfsConfigPI.hh:286
xxxLP()
Definition XrdOfsConfigPI.hh:289
xxxLP(const xxxLP &rhs)
Definition XrdOfsConfigPI.hh:302
char * opts
Definition XrdOfsConfigPI.hh:288
xxxLP & operator=(const xxxLP &rhs)
Definition XrdOfsConfigPI.hh:294
~xxxLP()
Definition XrdOfsConfigPI.hh:290