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
196bool Plugin(XrdAccAuthorize *&piP);
197bool Plugin(XrdCks *&pip);
198bool Plugin(XrdCmsClient_t &piP);
199bool Plugin(XrdOfsFSctl_PI *&piP);
200bool Plugin(XrdOfsPrepare *&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);
257bool AddLibAut(XrdOucEnv *envP);
258bool AddLibCtl(XrdOucEnv *envP);
259bool AddLibOss(XrdOucEnv *envP);
260bool AddLibPrp(XrdOucEnv *envP);
261bool ParseAtrLib();
262bool ParseOssLib();
263bool ParsePrpLib();
264bool RepLib(TheLib what, const char *newLib, const char *newParms=0, bool parseParms=true);
265bool SetupAttr(TheLib what, XrdOucEnv *envP);
266bool SetupAuth(XrdOucEnv *envP);
267bool SetupCtl(XrdOucEnv *envP);
268bool SetupCms();
269bool SetupPrp(XrdOucEnv *envP);
270
271XrdAccAuthorize *autPI;
272XrdCks *cksPI;
273XrdCmsClient_t cmsPI;
274XrdOfsFSctl_PI *ctlPI;
275XrdOfsPrepare *prpPI;
276XrdOss *ossPI;
277XrdSfsFileSystem *sfsPI;
278XrdVersionInfo *urVer;
279
280XrdOucStream *Config;
281XrdSysError *Eroute;
282XrdCksConfig *CksConfig;
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
304 } LP[maxXXXLib];
305std::vector<xxxLP> ALP[maxXXXLib];
306
307struct ctlLP {XrdOfsFSctl_PI *ctlPI; const char *parms;};
308
309std::vector<ctlLP> ctlVec;
310
311char *CksAlg;
312int CksRdsz;
313bool pushOK[maxXXXLib];
314bool defLib[maxXXXLib];
315bool ossXAttr;
316char ossCksio;
317bool prpAuth;
318bool Loaded;
319bool LoadOK;
320bool cksLcl;
321};
322#endif
XrdCmsClient *(* XrdCmsClient_t)(XrdSysLogger *, int, int, XrdOss *)
struct myOpts opts
bool Parse(TheLib what)
bool ConfigCtl(XrdCmsClient *cmscP, XrdOucEnv *envP=0)
void Default(TheLib what, const char *lpath, const char *lparm=0)
void SetCksRdSz(int rdsz)
bool Plugin(XrdAccAuthorize *&piP)
Get Authorization plugin.
static XrdOfsConfigPI * New(const char *cfn, XrdOucStream *cfgP, XrdSysError *errP, XrdVersionInfo *verP=0, XrdSfsFileSystem *sfsP=0)
~XrdOfsConfigPI()
Destructor.
void DefaultCS(const char *alg)
bool Load(int what, XrdOucEnv *envP=0)
bool Push(TheLib what, const char *plugP, const char *parmP=0)
bool Configure(XrdCmsClient *cmscP, XrdOucEnv *envP)
@ theOssLib
Oss plugin.
@ allXXXLib
All plugins (Load() only)
@ maxXXXLib
Maximum different plugins.
@ theCksLib
Checksum manager plugin.
@ thePrpLib
Prp plugin (prepare)
@ theCmsLib
Cms client plugin.
@ theAtrLib
Extended attribute plugin.
@ theAutLib
Authorization plugin.
@ theCtlLib
Ctl plugin (FSCtl)
void Display()
Display configuration settings.