00001 #ifndef __XRDOFSCONFIGPI_HH__ 00002 #define __XRDOFSCONFIGPI_HH__ 00003 /******************************************************************************/ 00004 /* */ 00005 /* X r d O f s C o n f i g P I . h h */ 00006 /* */ 00007 /* (c) 2014 by the Board of Trustees of the Leland Stanford, Jr., University */ 00008 /* All Rights Reserved */ 00009 /* Produced by Andrew Hanushevsky for Stanford University under contract */ 00010 /* DE-AC02-76-SFO0515 with the Department of Energy */ 00011 /* */ 00012 /* This file is part of the XRootD software suite. */ 00013 /* */ 00014 /* XRootD is free software: you can redistribute it and/or modify it under */ 00015 /* the terms of the GNU Lesser General Public License as published by the */ 00016 /* Free Software Foundation, either version 3 of the License, or (at your */ 00017 /* option) any later version. */ 00018 /* */ 00019 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */ 00020 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */ 00021 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */ 00022 /* License for more details. */ 00023 /* */ 00024 /* You should have received a copy of the GNU Lesser General Public License */ 00025 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */ 00026 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */ 00027 /* */ 00028 /* The copyright holder's institutional names and contributor's names may not */ 00029 /* be used to endorse or promote products derived from this software without */ 00030 /* specific prior written permission of the institution or contributor. */ 00031 /******************************************************************************/ 00032 00033 #include "XrdCms/XrdCmsClient.hh" 00034 00035 class XrdAccAuthorize; 00036 class XrdCks; 00037 class XrdCksConfig; 00038 class XrdOfs; 00039 class XrdOfsPrepare; 00040 class XrdOss; 00041 class XrdOucEnv; 00042 class XrdOucStream; 00043 class XrdSysError; 00044 struct XrdVersionInfo; 00045 00046 //----------------------------------------------------------------------------- 00053 //----------------------------------------------------------------------------- 00054 00055 class XrdOfsConfigPI 00056 { 00057 public: 00058 00059 //----------------------------------------------------------------------------- 00062 //----------------------------------------------------------------------------- 00063 00064 enum TheLib {theAtrLib = 0x0100, 00065 theAutLib = 0x0201, 00066 theCksLib = 0x0402, 00067 theCmsLib = 0x0803, 00068 theOssLib = 0x1004, 00069 thePrpLib = 0x2005, 00070 allXXXLib = 0x3f06, 00071 maxXXXLib = 0x0006, 00072 libIXMask = 0x00ff 00073 }; 00074 00075 //----------------------------------------------------------------------------- 00083 //----------------------------------------------------------------------------- 00084 00085 bool Configure(XrdCmsClient *cmscP, XrdOucEnv *envP); 00086 00087 //----------------------------------------------------------------------------- 00094 //----------------------------------------------------------------------------- 00095 00096 void Default(TheLib what, const char *lpath, const char *lparm=0); 00097 00098 //----------------------------------------------------------------------------- 00103 //----------------------------------------------------------------------------- 00104 00105 void DefaultCS(const char *alg); 00106 00107 //----------------------------------------------------------------------------- 00109 //----------------------------------------------------------------------------- 00110 00111 void Display(); 00112 00113 //----------------------------------------------------------------------------- 00123 //----------------------------------------------------------------------------- 00124 00125 bool Load(int what, XrdOfs *ofsP=0, XrdOucEnv *envP=0); 00126 00127 //----------------------------------------------------------------------------- 00141 //----------------------------------------------------------------------------- 00142 00143 static 00144 XrdOfsConfigPI *New(const char *cfn, XrdOucStream *cfgP, XrdSysError *errP, 00145 XrdVersionInfo *verP=0); 00146 00147 //----------------------------------------------------------------------------- 00151 //----------------------------------------------------------------------------- 00152 00153 bool LclCks() {return cksLcl;} 00154 00155 //----------------------------------------------------------------------------- 00159 //----------------------------------------------------------------------------- 00160 00161 bool OssCks(); 00162 00163 //----------------------------------------------------------------------------- 00168 //----------------------------------------------------------------------------- 00169 00170 bool Parse(TheLib what); 00171 00172 //----------------------------------------------------------------------------- 00179 //----------------------------------------------------------------------------- 00180 00181 bool Plugin(XrdAccAuthorize *&piP); 00182 bool Plugin(XrdCks *&pip); 00183 bool Plugin(XrdCmsClient_t &piP); 00184 bool Plugin(XrdOfsPrepare *&piP); 00185 bool Plugin(XrdOss *&piP); 00186 00187 //----------------------------------------------------------------------------- 00191 //----------------------------------------------------------------------------- 00192 00193 bool PrepAuth(); 00194 00195 //----------------------------------------------------------------------------- 00199 //----------------------------------------------------------------------------- 00200 00201 void SetCksRdSz(int rdsz); 00202 00203 //----------------------------------------------------------------------------- 00205 //----------------------------------------------------------------------------- 00206 00207 ~XrdOfsConfigPI(); 00208 00209 private: 00210 00211 //----------------------------------------------------------------------------- 00221 //----------------------------------------------------------------------------- 00222 00223 XrdOfsConfigPI(const char *cfn, XrdOucStream *cfgP, XrdSysError *errP, 00224 XrdVersionInfo *verP=0); 00225 00226 bool ParseAtrLib(); 00227 bool ParseOssLib(); 00228 bool ParsePrpLib(); 00229 bool RepLib(TheLib what, const char *newLib, const char *newParms=0, bool parseParms=true); 00230 bool SetupAttr(TheLib what); 00231 bool SetupAuth(); 00232 bool SetupCms(); 00233 bool SetupPrp(XrdOfs *ofsP, XrdOucEnv *envP); 00234 00235 XrdAccAuthorize *autPI; 00236 XrdCks *cksPI; 00237 XrdCmsClient_t cmsPI; 00238 XrdOfsPrepare *prpPI; 00239 XrdOss *ossPI; 00240 XrdVersionInfo *urVer; 00241 00242 XrdOucStream *Config; 00243 XrdSysError *Eroute; 00244 XrdCksConfig *CksConfig; 00245 const char *ConfigFN; 00246 00247 struct xxxLP 00248 {char *lib; 00249 char *parms; 00250 char *opts; 00251 xxxLP() : lib(0), parms(0), opts(0) {} 00252 ~xxxLP() {if (lib) free(lib); 00253 if (parms) free(parms); 00254 if (opts) free(opts); 00255 } 00256 } LP[maxXXXLib]; 00257 char *CksAlg; 00258 int CksRdsz; 00259 bool defLib[maxXXXLib]; 00260 bool ossXAttr; 00261 bool ossCksio; 00262 bool prpAuth; 00263 bool Loaded; 00264 bool LoadOK; 00265 bool cksLcl; 00266 }; 00267 #endif