xrootd
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 "XrdCms/XrdCmsClient.hh"
34 
35 class XrdAccAuthorize;
36 class XrdCks;
37 class XrdCksConfig;
38 class XrdOfs;
39 class XrdOfsPrepare;
40 class XrdOss;
41 class XrdOucEnv;
42 class XrdOucStream;
43 class XrdSysError;
44 struct XrdVersionInfo;
45 
46 //-----------------------------------------------------------------------------
53 //-----------------------------------------------------------------------------
54 
56 {
57 public:
58 
59 //-----------------------------------------------------------------------------
62 //-----------------------------------------------------------------------------
63 
64 enum TheLib {theAtrLib = 0x0100,
65  theAutLib = 0x0201,
66  theCksLib = 0x0402,
67  theCmsLib = 0x0803,
68  theOssLib = 0x1004,
69  thePrpLib = 0x2005,
70  allXXXLib = 0x3f06,
71  maxXXXLib = 0x0006,
72  libIXMask = 0x00ff
73  };
74 
75 //-----------------------------------------------------------------------------
83 //-----------------------------------------------------------------------------
84 
85 bool Configure(XrdCmsClient *cmscP, XrdOucEnv *envP);
86 
87 //-----------------------------------------------------------------------------
94 //-----------------------------------------------------------------------------
95 
96 void Default(TheLib what, const char *lpath, const char *lparm=0);
97 
98 //-----------------------------------------------------------------------------
103 //-----------------------------------------------------------------------------
104 
105 void DefaultCS(const char *alg);
106 
107 //-----------------------------------------------------------------------------
109 //-----------------------------------------------------------------------------
110 
111 void Display();
112 
113 //-----------------------------------------------------------------------------
123 //-----------------------------------------------------------------------------
124 
125 bool Load(int what, XrdOfs *ofsP=0, XrdOucEnv *envP=0);
126 
127 //-----------------------------------------------------------------------------
141 //-----------------------------------------------------------------------------
142 
143 static
144 XrdOfsConfigPI *New(const char *cfn, XrdOucStream *cfgP, XrdSysError *errP,
145  XrdVersionInfo *verP=0);
146 
147 //-----------------------------------------------------------------------------
151 //-----------------------------------------------------------------------------
152 
153 bool LclCks() {return cksLcl;}
154 
155 //-----------------------------------------------------------------------------
159 //-----------------------------------------------------------------------------
160 
161 bool OssCks();
162 
163 //-----------------------------------------------------------------------------
168 //-----------------------------------------------------------------------------
169 
170 bool Parse(TheLib what);
171 
172 //-----------------------------------------------------------------------------
179 //-----------------------------------------------------------------------------
180 
181 bool Plugin(XrdAccAuthorize *&piP);
182 bool Plugin(XrdCks *&pip);
183 bool Plugin(XrdCmsClient_t &piP);
184 bool Plugin(XrdOfsPrepare *&piP);
185 bool Plugin(XrdOss *&piP);
186 
187 //-----------------------------------------------------------------------------
191 //-----------------------------------------------------------------------------
192 
193 bool PrepAuth();
194 
195 //-----------------------------------------------------------------------------
199 //-----------------------------------------------------------------------------
200 
201 void SetCksRdSz(int rdsz);
202 
203 //-----------------------------------------------------------------------------
205 //-----------------------------------------------------------------------------
206 
208 
209 private:
210 
211 //-----------------------------------------------------------------------------
221 //-----------------------------------------------------------------------------
222 
223  XrdOfsConfigPI(const char *cfn, XrdOucStream *cfgP, XrdSysError *errP,
224  XrdVersionInfo *verP=0);
225 
226 bool ParseAtrLib();
227 bool ParseOssLib();
228 bool ParsePrpLib();
229 bool RepLib(TheLib what, const char *newLib, const char *newParms=0, bool parseParms=true);
230 bool SetupAttr(TheLib what);
231 bool SetupAuth();
232 bool SetupCms();
233 bool SetupPrp(XrdOfs *ofsP, XrdOucEnv *envP);
234 
240 XrdVersionInfo *urVer;
241 
245 const char *ConfigFN;
246 
247 struct xxxLP
248  {char *lib;
249  char *parms;
250  char *opts;
251  xxxLP() : lib(0), parms(0), opts(0) {}
252  ~xxxLP() {if (lib) free(lib);
253  if (parms) free(parms);
254  if (opts) free(opts);
255  }
257 char *CksAlg;
260 bool ossXAttr;
261 bool ossCksio;
262 bool prpAuth;
263 bool Loaded;
264 bool LoadOK;
265 bool cksLcl;
266 };
267 #endif
XrdOfsConfigPI::Parse
bool Parse(TheLib what)
XrdOss
Definition: XrdOss.hh:174
XrdOfsConfigPI::ossCksio
bool ossCksio
Definition: XrdOfsConfigPI.hh:261
XrdOfsConfigPI::xxxLP::~xxxLP
~xxxLP()
Definition: XrdOfsConfigPI.hh:252
XrdOfsConfigPI::theCksLib
@ theCksLib
Checksum manager plugin.
Definition: XrdOfsConfigPI.hh:66
XrdOfsConfigPI::ParseOssLib
bool ParseOssLib()
XrdOfsConfigPI::SetupCms
bool SetupCms()
XrdOfsConfigPI
Definition: XrdOfsConfigPI.hh:56
XrdOfsConfigPI::maxXXXLib
@ maxXXXLib
Maximum different plugins.
Definition: XrdOfsConfigPI.hh:71
XrdOfsConfigPI::ParseAtrLib
bool ParseAtrLib()
XrdOfsConfigPI::Plugin
bool Plugin(XrdCks *&pip)
Get Checksum manager plugin.
XrdOfsConfigPI::ParsePrpLib
bool ParsePrpLib()
XrdOfsConfigPI::OssCks
bool OssCks()
XrdOfsConfigPI::allXXXLib
@ allXXXLib
All plugins (Load() only)
Definition: XrdOfsConfigPI.hh:70
XrdOfsConfigPI::Plugin
bool Plugin(XrdOss *&piP)
Get Oss plugin.
XrdCmsClient
Definition: XrdCmsClient.hh:116
XrdOfsConfigPI::theCmsLib
@ theCmsLib
Cms client plugin.
Definition: XrdOfsConfigPI.hh:67
XrdOfsConfigPI::cksPI
XrdCks * cksPI
-> Checksum manager plugin
Definition: XrdOfsConfigPI.hh:236
XrdOfsConfigPI::Plugin
bool Plugin(XrdCmsClient_t &piP)
Get Cms client object generator.
XrdOfsConfigPI::cksLcl
bool cksLcl
Definition: XrdOfsConfigPI.hh:265
XrdOfsConfigPI::thePrpLib
@ thePrpLib
Prp plugin (prepare)
Definition: XrdOfsConfigPI.hh:69
XrdOfsConfigPI::autPI
XrdAccAuthorize * autPI
-> Authorization plugin
Definition: XrdOfsConfigPI.hh:235
XrdOfsConfigPI::Plugin
bool Plugin(XrdOfsPrepare *&piP)
Get Prp plugin (prepare)
XrdOucStream
Definition: XrdOucStream.hh:46
XrdOfsConfigPI::Configure
bool Configure(XrdCmsClient *cmscP, XrdOucEnv *envP)
XrdOfsConfigPI::XrdOfsConfigPI
XrdOfsConfigPI(const char *cfn, XrdOucStream *cfgP, XrdSysError *errP, XrdVersionInfo *verP=0)
XrdCks
Definition: XrdCks.hh:49
XrdOfsConfigPI::SetupPrp
bool SetupPrp(XrdOfs *ofsP, XrdOucEnv *envP)
XrdOfsConfigPI::SetCksRdSz
void SetCksRdSz(int rdsz)
XrdOfsConfigPI::CksRdsz
int CksRdsz
Definition: XrdOfsConfigPI.hh:258
XrdOfsConfigPI::LP
struct XrdOfsConfigPI::xxxLP LP[maxXXXLib]
XrdCksConfig
Definition: XrdCksConfig.hh:43
XrdOfsConfigPI::CksAlg
char * CksAlg
Definition: XrdOfsConfigPI.hh:257
XrdOfsConfigPI::xxxLP::xxxLP
xxxLP()
Definition: XrdOfsConfigPI.hh:251
XrdOfsConfigPI::Display
void Display()
Display configuration settings.
XrdOfsConfigPI::New
static XrdOfsConfigPI * New(const char *cfn, XrdOucStream *cfgP, XrdSysError *errP, XrdVersionInfo *verP=0)
XrdCmsClient.hh
XrdAccAuthorize
Definition: XrdAccAuthorize.hh:65
XrdOfsConfigPI::prpAuth
bool prpAuth
Definition: XrdOfsConfigPI.hh:262
XrdOfsConfigPI::LclCks
bool LclCks()
Definition: XrdOfsConfigPI.hh:153
XrdOfsConfigPI::CksConfig
XrdCksConfig * CksConfig
Definition: XrdOfsConfigPI.hh:244
XrdOucEnv
Definition: XrdOucEnv.hh:42
XrdOfsConfigPI::Plugin
bool Plugin(XrdAccAuthorize *&piP)
Get Authorization plugin.
XrdOfsConfigPI::Loaded
bool Loaded
Definition: XrdOfsConfigPI.hh:263
XrdOfsConfigPI::xxxLP::opts
char * opts
Definition: XrdOfsConfigPI.hh:250
XrdOfsConfigPI::PrepAuth
bool PrepAuth()
XrdOfsConfigPI::defLib
bool defLib[maxXXXLib]
Definition: XrdOfsConfigPI.hh:259
XrdOfsConfigPI::theOssLib
@ theOssLib
Oss plugin.
Definition: XrdOfsConfigPI.hh:68
XrdOfsConfigPI::xxxLP::parms
char * parms
Definition: XrdOfsConfigPI.hh:249
XrdOfsConfigPI::DefaultCS
void DefaultCS(const char *alg)
XrdOfsConfigPI::prpPI
XrdOfsPrepare * prpPI
-> Prp plugin (prepare)
Definition: XrdOfsConfigPI.hh:238
XrdOfsConfigPI::urVer
XrdVersionInfo * urVer
-> Version information
Definition: XrdOfsConfigPI.hh:240
XrdOfsConfigPI::xxxLP::lib
char * lib
Definition: XrdOfsConfigPI.hh:248
XrdOfsConfigPI::cmsPI
XrdCmsClient_t cmsPI
-> Cms client object generator plugin
Definition: XrdOfsConfigPI.hh:237
XrdOfsConfigPI::Load
bool Load(int what, XrdOfs *ofsP=0, XrdOucEnv *envP=0)
XrdOfsConfigPI::theAutLib
@ theAutLib
Authorization plugin.
Definition: XrdOfsConfigPI.hh:65
XrdOfsConfigPI::RepLib
bool RepLib(TheLib what, const char *newLib, const char *newParms=0, bool parseParms=true)
XrdOfsConfigPI::Eroute
XrdSysError * Eroute
Definition: XrdOfsConfigPI.hh:243
XrdOfsConfigPI::ossXAttr
bool ossXAttr
Definition: XrdOfsConfigPI.hh:260
XrdOfsConfigPI::ossPI
XrdOss * ossPI
-> Oss plugin
Definition: XrdOfsConfigPI.hh:239
XrdOfsConfigPI::theAtrLib
@ theAtrLib
Extended attribute plugin.
Definition: XrdOfsConfigPI.hh:64
XrdOfsConfigPI::TheLib
TheLib
Definition: XrdOfsConfigPI.hh:64
XrdOfsConfigPI::ConfigFN
const char * ConfigFN
Definition: XrdOfsConfigPI.hh:245
XrdOfs
Definition: XrdOfs.hh:186
XrdOfsConfigPI::~XrdOfsConfigPI
~XrdOfsConfigPI()
Destructor.
XrdSysError
Definition: XrdSysError.hh:90
XrdCmsClient_t
XrdCmsClient *(* XrdCmsClient_t)(XrdSysLogger *, int, int, XrdOss *)
Definition: XrdCmsClient.hh:413
XrdOfsConfigPI::SetupAuth
bool SetupAuth()
XrdOfsConfigPI::SetupAttr
bool SetupAttr(TheLib what)
XrdOfsConfigPI::libIXMask
@ libIXMask
Definition: XrdOfsConfigPI.hh:72
XrdOfsPrepare
Definition: XrdOfsPrepare.hh:47
XrdOfsConfigPI::LoadOK
bool LoadOK
Definition: XrdOfsConfigPI.hh:264
XrdOfsConfigPI::Default
void Default(TheLib what, const char *lpath, const char *lparm=0)
XrdOfsConfigPI::Config
XrdOucStream * Config
Definition: XrdOfsConfigPI.hh:242
XrdOfsConfigPI::xxxLP
Definition: XrdOfsConfigPI.hh:248