xrootd
XrdVersionPlugin.hh
Go to the documentation of this file.
1 #ifndef __XRDVERSIONPLUGIN_HH__
2 #define __XRDVERSIONPLUGIN_HH__
3 /******************************************************************************/
4 /* */
5 /* X r d V e r s i o n P l u g i n . h h */
6 /* */
7 /* (c) 2012 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 /* The following section defines the versioning rules for plugins. The rules are
34  applied by 'XrdSysPlugin.cc'. The rules defined by the XrdVERSIONPLUGIN_RULE
35  macro (see below) are used to initialize a data the following data structure.
36 */
38  {const char *pName;
39  char vPfxLen;
40  char vSfxLen;
41  int vProcess;
42  short vMajLow;
43  short vMinLow;
44  };
45 
46 /* The rules are defined here because they apply to every class that uses a
47  plugin. This file *must* be updated whenever a plugin interface materially
48  changes; including any material changes (layout or size) to any classes
49  passed as arguments to the plugin.
50 */
51 
52 // Macros used to define version checking rule values (see explanation below).
53 //
54 #define XrdVERSIONPLUGIN_DoNotChk -1
55 #define XrdVERSIONPLUGIN_Optional 0
56 #define XrdVERSIONPLUGIN_Required 1
57 
58 #define XrdVERSIONPLUGIN_Rule(procMode, majorVer, minorVer, piSymbol)\
59  {#piSymbol, 0, 0, XrdVERSIONPLUGIN_##procMode, majorVer, minorVer},
60 
61 /* Each rule must be defined by the XrdVERSIONPLUGIN_Rule macro which takes four
62  arguments, as follows:
63 
64  procMode: Version procsessing mode:
65  DoNotChk -> Skip version check as it's already been done by a
66  previous getPlugin() call for a library symbol.
67  Optional -> Version check is optional, do it if version information
68  present but warn if it is missing.
69  Required -> Version check required; plugin must define a version
70  number and issue error message if it is missing.
71 
72  majorVer: The required major version number. It is checked as follows:
73  < 0: major version numbers must be identical.
74  >= 0: is the lowest valid major version number allowed.
75 
76  minorVer: The required minor version number, It is check as follows:
77  < 0: minor version numbers must be identical.
78  >= 0: the lowest valid minor version for the major number allowed.
79  > 99: Do not check the minor version number, it's immaterial.
80 
81  piSymbol: The plugin's object creator's unquoted function name. When this
82  symbol is looked-up, the defined version rule is applied.
83 
84  Note: a plugin may not have a major.minor version number greater than the
85  program's major.minor version number unless either one is unreleased.
86  Unreleased versions can use any version. However, a message is issued.
87 */
88 #define XrdVERSIONPLUGINRULES \
89  XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdAccAuthorizeObject )\
90  XrdVERSIONPLUGIN_Rule(Optional, 4, 0, XrdBwmPolicyObject )\
91  XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdCksCalcInit )\
92  XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdCksInit )\
93  XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdCmsGetClient )\
94  XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdCryptosslFactoryObject )\
95  XrdVERSIONPLUGIN_Rule(Optional, 4, 0, XrdFileCacheGetDecision )\
96  XrdVERSIONPLUGIN_Rule(DoNotChk, 4, 0, XrdgetProtocol )\
97  XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdgetProtocolPort )\
98  XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdHttpGetSecXtractor )\
99  XrdVERSIONPLUGIN_Rule(Required, 4, 8, XrdHttpGetExtHandler )\
100  XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdSysLogPInit )\
101  XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdOssGetStorageSystem )\
102  XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdOssStatInfoInit )\
103  XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdOucGetCache )\
104  XrdVERSIONPLUGIN_Rule(Optional, 4, 0, XrdOucgetName2Name )\
105  XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdSecGetProtocol )\
106  XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdSecgetService )\
107  XrdVERSIONPLUGIN_Rule(Optional, 4, 0, XrdSecgsiAuthzFun )\
108  XrdVERSIONPLUGIN_Rule(DoNotChk, 4, 0, XrdSecgsiAuthzInit )\
109  XrdVERSIONPLUGIN_Rule(DoNotChk, 4, 0, XrdSecgsiAuthzKey )\
110  XrdVERSIONPLUGIN_Rule(Optional, 4, 0, XrdSecgsiGMAPFun )\
111  XrdVERSIONPLUGIN_Rule(Optional, 4, 0, XrdSecgsiVOMSFun )\
112  XrdVERSIONPLUGIN_Rule(DoNotChk, 4, 0, XrdSecgsiVOMSInit )\
113  XrdVERSIONPLUGIN_Rule(DoNotChk, 4, 0, XrdSecProtocolgsiInit )\
114  XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdSecProtocolgsiObject )\
115  XrdVERSIONPLUGIN_Rule(DoNotChk, 4, 0, XrdSecProtocolkrb5Init )\
116  XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdSecProtocolkrb5Object )\
117  XrdVERSIONPLUGIN_Rule(DoNotChk, 4, 0, XrdSecProtocolpwdInit )\
118  XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdSecProtocolpwdObject )\
119  XrdVERSIONPLUGIN_Rule(DoNotChk, 4, 0, XrdSecProtocolsssInit )\
120  XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdSecProtocolsssObject )\
121  XrdVERSIONPLUGIN_Rule(DoNotChk, 4, 0, XrdSecProtocolunixInit )\
122  XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdSecProtocolunixObject )\
123  XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdSfsGetFileSystem )\
124  XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdSfsGetFileSystem2 )\
125  XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdSysGetXAttrObject )\
126  XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdClGetMonitor )\
127  XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdClGetPlugIn )\
128  { 0, 0, 0, 0, 0, 0}
129 
130 #define XrdVERSIONPLUGIN_Maxim(procMode, majorVer, minorVer, piPfx, piSfx)\
131  {#piPfx #piSfx, static_cast<char>(strlen(#piPfx)),\
132  static_cast<char>(strlen(#piSfx)),\
133  XrdVERSIONPLUGIN_##procMode, majorVer, minorVer},
134 
135 /* Each generic rule must be defined by the XrdVERSIONPLUGIN_Maxim macro which
136  takes five arguments. The first three are exactly the same as defined for
137  XrdVERSIONPLUGIN_Rule. The last two define a pefix/suffix match for the
138  symbol being looked up, as follows:
139 
140  piPfx: The leading characters of the plugin's object creator's unquoted
141  function name. When this symbol is looked-up, the defined version
142  rule is applied if the suffix, if any, also matches.
143 
144  piSfx: The trailing characters of the plugin's object creator's unquoted
145  function name. When this symbol is looked-up, the defined version
146  rule is applied if the prefix, if any, also matches.
147 
148  Note: An attempt is made to match the symbol using specific rules defined
149  by XRDVERSIONPLUGIN_Rule before using any generic rules. If a match
150  is found the same processing as for specific rules is applied.
151 */
152 #define XrdVERSIONPLUGINMAXIMS\
153  XrdVERSIONPLUGIN_Maxim(DoNotChk, 4, 0, XrdSecProtocol, Init )\
154  XrdVERSIONPLUGIN_Maxim(Required, 4, 0, XrdSecProtocol, Object )\
155  XrdVERSIONPLUGIN_Maxim(Optional, 4, 0, XrdCrypto, FactoryObject)\
156  { 0, 0, 0, 0, 0, 0}
157 
158 /* The following defines the list of plugins that are included in the base
159  code and are to be strictly name versioned upon loading (i.e. fallback
160  to an unversioned name is not allowed). This is enforced by XrdOucVerName.
161 */
162 #define XrdVERSIONPLUGINSTRICT \
163  {"libXrdBwm.so", \
164  "libXrdCksCalczcrc32.so", \
165  "libXrdCryptossl.so", \
166  "libXrdFileCache.so", \
167  "libXrdHttp.so", \
168  "libXrdOssSIgpfsT.so", \
169  "libXrdPss.so", \
170  "libXrdSec.so", \
171  "libXrdSecgsi.so", \
172  "libXrdSecgsiAUTHZVO.so", \
173  "libXrdSecgsiGMAPDLAP.so", \
174  "libXrdSeckrb5.so", \
175  "libXrdSecpwd.so", \
176  "libXrdSecsss.so", \
177  "libXrdSecunix.so", \
178  "libXrdXrootd.so", \
179  0}
180 #endif
char vSfxLen
Generic rule suffix length for preceeding.
Definition: XrdVersionPlugin.hh:40
char vPfxLen
Generic rule prefix length.
Definition: XrdVersionPlugin.hh:39
short vMinLow
Lowest compatible minor (&gt;99 don&#39;t check).
Definition: XrdVersionPlugin.hh:43
short vMajLow
Lowest compatible major version number.
Definition: XrdVersionPlugin.hh:42
const char * pName
-&gt; plugin object creator function name
Definition: XrdVersionPlugin.hh:38
Definition: XrdVersionPlugin.hh:37
int vProcess
version: &lt;0 skip, =0 optional, &gt;0 required
Definition: XrdVersionPlugin.hh:41