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 XrdOss; 00039 class XrdOucEnv; 00040 class XrdOucStream; 00041 class XrdSysError; 00042 struct XrdVersionInfo; 00043 00044 //----------------------------------------------------------------------------- 00051 //----------------------------------------------------------------------------- 00052 00053 class XrdOfsConfigPI 00054 { 00055 public: 00056 00057 //----------------------------------------------------------------------------- 00060 //----------------------------------------------------------------------------- 00061 00062 enum TheLib {theAtrLib = 0x0100, 00063 theAutLib = 0x0201, 00064 theCksLib = 0x0402, 00065 theCmsLib = 0x0803, 00066 theOssLib = 0x1004, 00067 allXXXLib = 0x1f05, 00068 maxXXXLib = 0x0005, 00069 libIXMask = 0x00ff 00070 }; 00071 00072 //----------------------------------------------------------------------------- 00080 //----------------------------------------------------------------------------- 00081 00082 bool Configure(XrdCmsClient *cmscP, XrdOucEnv *envP); 00083 00084 //----------------------------------------------------------------------------- 00091 //----------------------------------------------------------------------------- 00092 00093 void Default(TheLib what, const char *lpath, const char *lparm=0); 00094 00095 //----------------------------------------------------------------------------- 00100 //----------------------------------------------------------------------------- 00101 00102 void DefaultCS(const char *alg); 00103 00104 //----------------------------------------------------------------------------- 00106 //----------------------------------------------------------------------------- 00107 00108 void Display(); 00109 00110 //----------------------------------------------------------------------------- 00119 //----------------------------------------------------------------------------- 00120 00121 bool Load(int what, XrdOucEnv *envP=0); 00122 00123 //----------------------------------------------------------------------------- 00137 //----------------------------------------------------------------------------- 00138 00139 static 00140 XrdOfsConfigPI *New(const char *cfn, XrdOucStream *cfgP, XrdSysError *errP, 00141 XrdVersionInfo *verP=0); 00142 00143 //----------------------------------------------------------------------------- 00147 //----------------------------------------------------------------------------- 00148 00149 bool LclCks() {return cksLcl;} 00150 00151 //----------------------------------------------------------------------------- 00155 //----------------------------------------------------------------------------- 00156 00157 bool OssCks(); 00158 00159 //----------------------------------------------------------------------------- 00164 //----------------------------------------------------------------------------- 00165 00166 bool Parse(TheLib what); 00167 00168 //----------------------------------------------------------------------------- 00175 //----------------------------------------------------------------------------- 00176 00177 bool Plugin(XrdAccAuthorize *&piP); 00178 bool Plugin(XrdCks *&pip); 00179 bool Plugin(XrdCmsClient_t &piP); 00180 bool Plugin(XrdOss *&piP); 00181 00182 //----------------------------------------------------------------------------- 00186 //----------------------------------------------------------------------------- 00187 00188 void SetCksRdSz(int rdsz); 00189 00190 //----------------------------------------------------------------------------- 00192 //----------------------------------------------------------------------------- 00193 00194 ~XrdOfsConfigPI(); 00195 00196 private: 00197 00198 //----------------------------------------------------------------------------- 00208 //----------------------------------------------------------------------------- 00209 00210 XrdOfsConfigPI(const char *cfn, XrdOucStream *cfgP, XrdSysError *errP, 00211 XrdVersionInfo *verP=0); 00212 00213 bool ParseAtrLib(); 00214 bool ParseOssLib(); 00215 bool RepLib(TheLib what, const char *newLib, const char *newParms=0, bool parseParms=true); 00216 bool SetupAttr(TheLib what); 00217 bool SetupAuth(); 00218 bool SetupCms(); 00219 00220 XrdAccAuthorize *autPI; 00221 XrdCks *cksPI; 00222 XrdCmsClient_t cmsPI; 00223 XrdOss *ossPI; 00224 XrdVersionInfo *urVer; 00225 00226 XrdOucStream *Config; 00227 XrdSysError *Eroute; 00228 XrdCksConfig *CksConfig; 00229 const char *ConfigFN; 00230 00231 struct xxxLP 00232 {char *lib; 00233 char *parms; 00234 char *opts; 00235 xxxLP() : lib(0), parms(0), opts(0) {} 00236 ~xxxLP() {if (lib) free(lib); 00237 if (parms) free(parms); 00238 if (opts) free(opts); 00239 } 00240 } LP[maxXXXLib]; 00241 char *CksAlg; 00242 int CksRdsz; 00243 bool defLib[maxXXXLib]; 00244 bool ossXAttr; 00245 bool ossCksio; 00246 bool Loaded; 00247 bool LoadOK; 00248 bool cksLcl; 00249 }; 00250 #endif