xrootd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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 XrdOss;
39 class XrdOucEnv;
40 class XrdOucStream;
41 class XrdSysError;
42 struct XrdVersionInfo;
43 
44 //-----------------------------------------------------------------------------
51 //-----------------------------------------------------------------------------
52 
54 {
55 public:
56 
57 //-----------------------------------------------------------------------------
60 //-----------------------------------------------------------------------------
61 
62 enum TheLib {theAtrLib = 0x0100,
63  theAutLib = 0x0201,
64  theCksLib = 0x0402,
65  theCmsLib = 0x0803,
66  theOssLib = 0x1004,
67  allXXXLib = 0x1f05,
68  maxXXXLib = 0x0005,
69  libIXMask = 0x00ff
70  };
71 
72 //-----------------------------------------------------------------------------
80 //-----------------------------------------------------------------------------
81 
82 bool Configure(XrdCmsClient *cmscP, XrdOucEnv *envP);
83 
84 //-----------------------------------------------------------------------------
91 //-----------------------------------------------------------------------------
92 
93 void Default(TheLib what, const char *lpath, const char *lparm=0);
94 
95 //-----------------------------------------------------------------------------
100 //-----------------------------------------------------------------------------
101 
102 void DefaultCS(const char *alg);
103 
104 //-----------------------------------------------------------------------------
106 //-----------------------------------------------------------------------------
107 
108 void Display();
109 
110 //-----------------------------------------------------------------------------
119 //-----------------------------------------------------------------------------
120 
121 bool Load(int what, XrdOucEnv *envP=0);
122 
123 //-----------------------------------------------------------------------------
137 //-----------------------------------------------------------------------------
138 
139 static
140 XrdOfsConfigPI *New(const char *cfn, XrdOucStream *cfgP, XrdSysError *errP,
141  XrdVersionInfo *verP=0);
142 
143 //-----------------------------------------------------------------------------
147 //-----------------------------------------------------------------------------
148 
149 bool LclCks() {return cksLcl;}
150 
151 //-----------------------------------------------------------------------------
155 //-----------------------------------------------------------------------------
156 
157 bool OssCks();
158 
159 //-----------------------------------------------------------------------------
164 //-----------------------------------------------------------------------------
165 
166 bool Parse(TheLib what);
167 
168 //-----------------------------------------------------------------------------
175 //-----------------------------------------------------------------------------
176 
177 bool Plugin(XrdAccAuthorize *&piP);
178 bool Plugin(XrdCks *&pip);
179 bool Plugin(XrdCmsClient_t &piP);
180 bool Plugin(XrdOss *&piP);
181 
182 //-----------------------------------------------------------------------------
186 //-----------------------------------------------------------------------------
187 
188 void SetCksRdSz(int rdsz);
189 
190 //-----------------------------------------------------------------------------
192 //-----------------------------------------------------------------------------
193 
194  ~XrdOfsConfigPI();
195 
196 private:
197 
198 //-----------------------------------------------------------------------------
208 //-----------------------------------------------------------------------------
209 
210  XrdOfsConfigPI(const char *cfn, XrdOucStream *cfgP, XrdSysError *errP,
211  XrdVersionInfo *verP=0);
212 
213 bool ParseAtrLib();
214 bool ParseOssLib();
215 bool RepLib(TheLib what, const char *newLib, const char *newParms=0, bool parseParms=true);
216 bool SetupAttr(TheLib what);
217 bool SetupAuth();
218 bool SetupCms();
219 
224 XrdVersionInfo *urVer;
225 
229 const char *ConfigFN;
230 
231 struct xxxLP
232  {char *lib;
233  char *parms;
234  char *opts;
235  xxxLP() : lib(0), parms(0), opts(0) {}
236  ~xxxLP() {if (lib) free(lib);
237  if (parms) free(parms);
238  if (opts) free(opts);
239  }
240  } LP[maxXXXLib];
241 char *CksAlg;
244 bool ossXAttr;
245 bool ossCksio;
246 bool Loaded;
247 bool LoadOK;
248 bool cksLcl;
249 };
250 #endif
char * parms
Definition: XrdOfsConfigPI.hh:233
XrdSysError * Eroute
Definition: XrdOfsConfigPI.hh:227
XrdOucStream * Config
Definition: XrdOfsConfigPI.hh:226
bool ParseAtrLib()
~xxxLP()
Definition: XrdOfsConfigPI.hh:236
bool Plugin(XrdAccAuthorize *&piP)
Get Authorization plugin.
void SetCksRdSz(int rdsz)
XrdCks * cksPI
-&gt; Checksum manager plugin
Definition: XrdOfsConfigPI.hh:221
Definition: XrdCks.hh:48
char * lib
Definition: XrdOfsConfigPI.hh:232
Maximum different plugins.
Definition: XrdOfsConfigPI.hh:68
XrdCksConfig * CksConfig
Definition: XrdOfsConfigPI.hh:228
Cms client plugin.
Definition: XrdOfsConfigPI.hh:65
Definition: XrdCksConfig.hh:42
Definition: XrdOucStream.hh:45
char * opts
Definition: XrdOfsConfigPI.hh:234
bool cksLcl
Definition: XrdOfsConfigPI.hh:248
bool ossXAttr
Definition: XrdOfsConfigPI.hh:244
Definition: XrdOfsConfigPI.hh:231
All plugins (Load() only)
Definition: XrdOfsConfigPI.hh:67
Definition: XrdCmsClient.hh:115
bool RepLib(TheLib what, const char *newLib, const char *newParms=0, bool parseParms=true)
Definition: XrdAccAuthorize.hh:64
bool Parse(TheLib what)
Definition: XrdSysError.hh:89
bool ossCksio
Definition: XrdOfsConfigPI.hh:245
TheLib
Definition: XrdOfsConfigPI.hh:62
XrdVersionInfo * urVer
-&gt; Version information
Definition: XrdOfsConfigPI.hh:224
Oss plugin.
Definition: XrdOfsConfigPI.hh:66
bool LoadOK
Definition: XrdOfsConfigPI.hh:247
XrdOss * ossPI
-&gt; Oss plugin
Definition: XrdOfsConfigPI.hh:223
xxxLP()
Definition: XrdOfsConfigPI.hh:235
struct XrdOfsConfigPI::xxxLP LP[maxXXXLib]
bool Load(int what, XrdOucEnv *envP=0)
Definition: XrdOfsConfigPI.hh:53
Definition: XrdOucEnv.hh:41
bool LclCks()
Definition: XrdOfsConfigPI.hh:149
char * CksAlg
Definition: XrdOfsConfigPI.hh:241
void Display()
Display configuration settings.
const char * ConfigFN
Definition: XrdOfsConfigPI.hh:229
Authorization plugin.
Definition: XrdOfsConfigPI.hh:63
bool ParseOssLib()
XrdAccAuthorize * autPI
-&gt; Authorization plugin
Definition: XrdOfsConfigPI.hh:220
int CksRdsz
Definition: XrdOfsConfigPI.hh:242
Extended attribute plugin.
Definition: XrdOfsConfigPI.hh:62
static XrdOfsConfigPI * New(const char *cfn, XrdOucStream *cfgP, XrdSysError *errP, XrdVersionInfo *verP=0)
XrdOfsConfigPI(const char *cfn, XrdOucStream *cfgP, XrdSysError *errP, XrdVersionInfo *verP=0)
Definition: XrdOss.hh:173
bool defLib[maxXXXLib]
Definition: XrdOfsConfigPI.hh:243
~XrdOfsConfigPI()
Destructor.
bool Loaded
Definition: XrdOfsConfigPI.hh:246
bool SetupAttr(TheLib what)
Checksum manager plugin.
Definition: XrdOfsConfigPI.hh:64
void DefaultCS(const char *alg)
void Default(TheLib what, const char *lpath, const char *lparm=0)
bool Configure(XrdCmsClient *cmscP, XrdOucEnv *envP)
XrdCmsClient_t cmsPI
-&gt; Cms client object generator plugin
Definition: XrdOfsConfigPI.hh:222
XrdCmsClient *(* XrdCmsClient_t)(XrdSysLogger *, int, int, XrdOss *)
Definition: XrdCmsClient.hh:413
Definition: XrdOfsConfigPI.hh:69