XrdVersionPlugin.hh

Go to the documentation of this file.
00001 #ifndef __XRDVERSIONPLUGIN_HH__
00002 #define __XRDVERSIONPLUGIN_HH__
00003 /******************************************************************************/
00004 /*                                                                            */
00005 /*                   X r d V e r s i o n P l u g i n . h h                    */
00006 /*                                                                            */
00007 /* (c) 2012 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 /* The following section defines the versioning rules for plugins. The rules are
00034    applied by 'XrdSysPlugin.cc'. The rules defined by the XrdVERSIONPLUGIN_RULE
00035    macro (see below) are used to initialize a data the following data structure.
00036 */
00037    struct XrdVersionPlugin
00038          {const char *pName;    
00039           char        vPfxLen;  
00040           char        vSfxLen;  
00041           int         vProcess; 
00042           short       vMajLow;  
00043           short       vMinLow;  
00044          };
00045 
00046 /* The rules are defined here because they apply to every class that uses a
00047    plugin.  This file *must* be updated whenever a plugin interface materially
00048    changes; including any material changes (layout or size) to any classes
00049    passed as arguments to the plugin.
00050 */
00051 
00052 // Macros used to define version checking rule values (see explanation below).
00053 //
00054 #define XrdVERSIONPLUGIN_DoNotChk -1
00055 #define XrdVERSIONPLUGIN_Optional  0
00056 #define XrdVERSIONPLUGIN_Required  1
00057 
00058 #define XrdVERSIONPLUGIN_Rule(procMode, majorVer, minorVer, piSymbol)\
00059            {#piSymbol, 0, 0, XrdVERSIONPLUGIN_##procMode, majorVer, minorVer},
00060 
00061 /* Each rule must be defined by the XrdVERSIONPLUGIN_Rule macro which takes four
00062    arguments, as follows:
00063 
00064    procMode: Version procsessing mode:
00065              DoNotChk -> Skip version check as it's already been done by a
00066                          previous getPlugin() call for a library symbol.
00067              Optional -> Version check is optional, do it if version information
00068                          present but warn if it is missing.
00069              Required -> Version check required; plugin must define a version
00070                          number and issue error message if it is missing.
00071 
00072    majorVer: The required major version number. It is checked as follows:
00073              <   0: major version numbers must be identical.
00074              >=  0: is the lowest valid major version number allowed.
00075 
00076    minorVer: The required minor version number, It is check as follows:
00077              <   0: minor version numbers must be identical.
00078              >=  0: the lowest valid minor version for the major number allowed.
00079              >  99: Do not check the minor version number, it's immaterial.
00080 
00081    piSymbol: The plugin's object creator's unquoted function name. When this
00082              symbol is looked-up, the defined version rule is applied.
00083 
00084    Note: a plugin may not have a major.minor version number greater than the
00085          program's major.minor version number unless either one is unreleased.
00086          Unreleased versions can use any version. However, a message is issued.
00087 */
00088 #define XrdVERSIONPLUGINRULES \
00089         XrdVERSIONPLUGIN_Rule(Required,  4,  0, XrdAccAuthorizeObject         )\
00090         XrdVERSIONPLUGIN_Rule(Optional,  4,  0, XrdBwmPolicyObject            )\
00091         XrdVERSIONPLUGIN_Rule(Required,  4,  0, XrdCksCalcInit                )\
00092         XrdVERSIONPLUGIN_Rule(Required,  4,  0, XrdCksInit                    )\
00093         XrdVERSIONPLUGIN_Rule(Required,  4,  0, XrdCmsGetClient               )\
00094         XrdVERSIONPLUGIN_Rule(Required,  4,  0, XrdCryptosslFactoryObject     )\
00095         XrdVERSIONPLUGIN_Rule(Optional,  4,  0, XrdFileCacheGetDecision       )\
00096         XrdVERSIONPLUGIN_Rule(DoNotChk,  4,  0, XrdgetProtocol                )\
00097         XrdVERSIONPLUGIN_Rule(Required,  4,  0, XrdgetProtocolPort            )\
00098         XrdVERSIONPLUGIN_Rule(Optional,  4,  0, XrdHttpGetSecXtractor         )\
00099         XrdVERSIONPLUGIN_Rule(Required,  4,  0, XrdOssGetStorageSystem        )\
00100         XrdVERSIONPLUGIN_Rule(Required,  4,  0, XrdOssStatInfoInit            )\
00101         XrdVERSIONPLUGIN_Rule(Required,  4,  0, XrdOucGetCache                )\
00102         XrdVERSIONPLUGIN_Rule(Optional,  4,  0, XrdOucgetName2Name            )\
00103         XrdVERSIONPLUGIN_Rule(Required,  4,  0, XrdSecGetProtocol             )\
00104         XrdVERSIONPLUGIN_Rule(Required,  4,  0, XrdSecgetService              )\
00105         XrdVERSIONPLUGIN_Rule(Optional,  4,  0, XrdSecgsiAuthzFun             )\
00106         XrdVERSIONPLUGIN_Rule(DoNotChk,  4,  0, XrdSecgsiAuthzInit            )\
00107         XrdVERSIONPLUGIN_Rule(DoNotChk,  4,  0, XrdSecgsiAuthzKey             )\
00108         XrdVERSIONPLUGIN_Rule(Optional,  4,  0, XrdSecgsiGMAPFun              )\
00109         XrdVERSIONPLUGIN_Rule(Optional,  4,  0, XrdSecgsiVOMSFun              )\
00110         XrdVERSIONPLUGIN_Rule(DoNotChk,  4,  0, XrdSecgsiVOMSInit             )\
00111         XrdVERSIONPLUGIN_Rule(DoNotChk,  4,  0, XrdSecProtocolgsiInit         )\
00112         XrdVERSIONPLUGIN_Rule(Required,  4,  0, XrdSecProtocolgsiObject       )\
00113         XrdVERSIONPLUGIN_Rule(DoNotChk,  4,  0, XrdSecProtocolkrb5Init        )\
00114         XrdVERSIONPLUGIN_Rule(Required,  4,  0, XrdSecProtocolkrb5Object      )\
00115         XrdVERSIONPLUGIN_Rule(DoNotChk,  4,  0, XrdSecProtocolpwdInit         )\
00116         XrdVERSIONPLUGIN_Rule(Required,  4,  0, XrdSecProtocolpwdObject       )\
00117         XrdVERSIONPLUGIN_Rule(DoNotChk,  4,  0, XrdSecProtocolsssInit         )\
00118         XrdVERSIONPLUGIN_Rule(Required,  4,  0, XrdSecProtocolsssObject       )\
00119         XrdVERSIONPLUGIN_Rule(DoNotChk,  4,  0, XrdSecProtocolunixInit        )\
00120         XrdVERSIONPLUGIN_Rule(Required,  4,  0, XrdSecProtocolunixObject      )\
00121         XrdVERSIONPLUGIN_Rule(Required,  4,  0, XrdSfsGetFileSystem           )\
00122         XrdVERSIONPLUGIN_Rule(Required,  4,  0, XrdSfsGetFileSystem2          )\
00123         XrdVERSIONPLUGIN_Rule(Required,  4,  0, XrdSysGetXAttrObject          )\
00124         XrdVERSIONPLUGIN_Rule(Required,  4,  0, XrdClGetMonitor               )\
00125         XrdVERSIONPLUGIN_Rule(Required,  4,  0, XrdClGetPlugIn                )\
00126                              { 0, 0, 0,  0,  0, 0}
00127 
00128 #define XrdVERSIONPLUGIN_Maxim(procMode, majorVer, minorVer, piPfx, piSfx)\
00129            {#piPfx #piSfx, static_cast<char>(strlen(#piPfx)),\
00130                            static_cast<char>(strlen(#piSfx)),\
00131             XrdVERSIONPLUGIN_##procMode, majorVer, minorVer},
00132 
00133 /* Each generic rule must be defined by the XrdVERSIONPLUGIN_Maxim macro which
00134    takes five arguments. The first three are exactly the same as defined for
00135    XrdVERSIONPLUGIN_Rule. The last two define a pefix/suffix match for the
00136    symbol being looked up, as follows:
00137 
00138    piPfx:    The leading  characters of the plugin's object creator's unquoted
00139              function name. When this symbol is looked-up, the defined version
00140              rule is applied if the suffix, if any, also matches.
00141 
00142    piSfx:    The trailing characters of the plugin's object creator's unquoted
00143              function name. When this symbol is looked-up, the defined version
00144              rule is applied if the prefix, if any, also matches.
00145 
00146    Note: An attempt is made to match the symbol using specific rules defined
00147          by XRDVERSIONPLUGIN_Rule before using any generic rules. If a match
00148          is found the same processing as for specific rules is applied.
00149 */
00150 #define XrdVERSIONPLUGINMAXIMS\
00151         XrdVERSIONPLUGIN_Maxim(DoNotChk,  4,  0, XrdSecProtocol, Init         )\
00152         XrdVERSIONPLUGIN_Maxim(Required,  4,  0, XrdSecProtocol, Object       )\
00153         XrdVERSIONPLUGIN_Maxim(Optional,  4,  0, XrdCrypto,      FactoryObject)\
00154                              { 0, 0, 0,  0,  0, 0}
00155 
00156 /* The following defines the list of plugins that are included in the base
00157    code and are to be strictly name versioned upon loading (i.e. fallback
00158    to an unversioned name is not allowed). This is enforced by XrdOucVerName.
00159 */
00160 #define XrdVERSIONPLUGINSTRICT       \
00161         {"libXrdBwm.so",             \
00162          "libXrdCksCalczcrc32.so",   \
00163          "libXrdCryptossl.so",       \
00164          "libXrdFileCache.so",       \
00165          "libXrdHttp.so",            \
00166          "libXrdOssSIgpfsT.so",      \
00167          "libXrdPss.so",             \
00168          "libXrdSec.so",             \
00169          "libXrdSecgsi.so",          \
00170          "libXrdSecgsiAUTHZVO.so",   \
00171          "libXrdSecgsiGMAPDLAP.so",  \
00172          "libXrdSecgsiGMAPLDAP.so",  \
00173          "libXrdSeckrb5.so",         \
00174          "libXrdSecpwd.so",          \
00175          "libXrdSecsss.so",          \
00176          "libXrdSecunix.so",         \
00177          "libXrdXrootd.so",          \
00178          0}
00179 #endif

Generated on 12 Dec 2014 for xrootd by  doxygen 1.4.7