00001 #ifndef __XRDOFSCONFIGPI_HH__
00002 #define __XRDOFSCONFIGPI_HH__
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #include <vector>
00034
00035 #include "XrdCms/XrdCmsClient.hh"
00036
00037 class XrdAccAuthorize;
00038 class XrdCks;
00039 class XrdCksConfig;
00040 class XrdOfs;
00041 class XrdOfsFSctl_PI;
00042 class XrdOfsPrepare;
00043 class XrdOss;
00044 class XrdOucEnv;
00045 class XrdOucStream;
00046 class XrdSfsFileSystem;
00047 class XrdSysError;
00048 class XrdSysXAttr;
00049 struct XrdVersionInfo;
00050
00051
00058
00059
00060 class XrdOfsConfigPI
00061 {
00062 public:
00063
00064
00067
00068
00069 enum TheLib {theAtrLib = 0x0100,
00070 theAutLib = 0x0201,
00071 theCksLib = 0x0402,
00072 theCmsLib = 0x0803,
00073 theCtlLib = 0x1004,
00074 theOssLib = 0x2005,
00075 thePrpLib = 0x4006,
00076 allXXXLib = 0x7f07,
00077 maxXXXLib = 0x0007,
00078 libIXMask = 0x00ff
00079 };
00080
00081
00089
00090
00091 bool Configure(XrdCmsClient *cmscP, XrdOucEnv *envP);
00092
00093
00098
00099
00100 bool ConfigCtl(XrdCmsClient *cmscP, XrdOucEnv *envP=0);
00101
00102
00109
00110
00111 void Default(TheLib what, const char *lpath, const char *lparm=0);
00112
00113
00118
00119
00120 void DefaultCS(const char *alg);
00121
00122
00124
00125
00126 void Display();
00127
00128
00137
00138
00139 bool Load(int what, XrdOucEnv *envP=0);
00140
00141
00156
00157
00158 static
00159 XrdOfsConfigPI *New(const char *cfn, XrdOucStream *cfgP, XrdSysError *errP,
00160 XrdVersionInfo *verP=0, XrdSfsFileSystem *sfsP=0);
00161
00162
00166
00167
00168 bool LclCks() {return cksLcl;}
00169
00170
00174
00175
00176 bool OssCks();
00177
00178
00183
00184
00185 bool Parse(TheLib what);
00186
00187
00194
00195
00196 bool Plugin(XrdAccAuthorize *&piP);
00197 bool Plugin(XrdCks *&pip);
00198 bool Plugin(XrdCmsClient_t &piP);
00199 bool Plugin(XrdOfsFSctl_PI *&piP);
00200 bool Plugin(XrdOfsPrepare *&piP);
00201 bool Plugin(XrdOss *&piP);
00202
00203
00207
00208
00209 bool PrepAuth();
00210
00211
00215
00216
00217 void SetCksRdSz(int rdsz);
00218
00219
00221
00222
00223 ~XrdOfsConfigPI();
00224
00225 private:
00226
00227
00238
00239
00240 XrdOfsConfigPI(const char *cfn, XrdOucStream *cfgP, XrdSysError *errP,
00241 XrdSfsFileSystem *sfsP, XrdVersionInfo *verP=0);
00242
00243 bool AddLib(TheLib what);
00244 bool AddLibAtr(XrdOucEnv *envP, XrdSysXAttr *&atrPI);
00245 bool AddLibAut(XrdOucEnv *envP);
00246 bool AddLibCtl(XrdOucEnv *envP);
00247 bool AddLibOss(XrdOucEnv *envP);
00248 bool AddLibPrp(XrdOucEnv *envP);
00249 bool ParseAtrLib();
00250 bool ParseOssLib();
00251 bool ParsePrpLib();
00252 bool RepLib(TheLib what, const char *newLib, const char *newParms=0, bool parseParms=true);
00253 bool SetupAttr(TheLib what, XrdOucEnv *envP);
00254 bool SetupAuth(XrdOucEnv *envP);
00255 bool SetupCtl(XrdOucEnv *envP);
00256 bool SetupCms();
00257 bool SetupPrp(XrdOucEnv *envP);
00258
00259 XrdAccAuthorize *autPI;
00260 XrdCks *cksPI;
00261 XrdCmsClient_t cmsPI;
00262 XrdOfsFSctl_PI *ctlPI;
00263 XrdOfsPrepare *prpPI;
00264 XrdOss *ossPI;
00265 XrdSfsFileSystem *sfsPI;
00266 XrdVersionInfo *urVer;
00267
00268 XrdOucStream *Config;
00269 XrdSysError *Eroute;
00270 XrdCksConfig *CksConfig;
00271 const char *ConfigFN;
00272
00273 struct xxxLP
00274 {char *lib;
00275 char *parms;
00276 char *opts;
00277 xxxLP() : lib(0), parms(0), opts(0) {}
00278 ~xxxLP() {if (lib) free(lib);
00279 if (parms) free(parms);
00280 if (opts) free(opts);
00281 }
00282 xxxLP& operator=(const xxxLP& rhs)
00283 {if (this != &rhs)
00284 {lib = (rhs.lib ? strdup(rhs.lib) : 0);
00285 parms = (rhs.parms ? strdup(rhs.parms) : 0);
00286 opts = (rhs.opts ? strdup(rhs.opts) : 0);
00287 }
00288 return *this;
00289 }
00290 xxxLP(const xxxLP& rhs) {*this = rhs;}
00291
00292 } LP[maxXXXLib];
00293 std::vector<xxxLP> ALP[maxXXXLib];
00294
00295 struct ctlLP {XrdOfsFSctl_PI *ctlPI; const char *parms;};
00296
00297 std::vector<ctlLP> ctlVec;
00298
00299 char *CksAlg;
00300 int CksRdsz;
00301 bool pushOK[maxXXXLib];
00302 bool defLib[maxXXXLib];
00303 bool ossXAttr;
00304 bool ossCksio;
00305 bool prpAuth;
00306 bool Loaded;
00307 bool LoadOK;
00308 bool cksLcl;
00309 };
00310 #endif