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: Do not check the minor version number, it's immaterial.
78  >= 0: the lowest valid minor version for the major number allowed.
79 
80  piSymbol: The plugin's object creator's unquoted function name. When this
81  symbol is looked-up, the defined version rule is applied.
82 
83  Note: a plugin may not have a major.minor version number greater than the
84  program's major.minor version number unless either one is unreleased.
85  Unreleased versions can use any version. However, a message is issued.
86 */
87 #define XrdVERSIONPLUGINRULES \
88  XrdVERSIONPLUGIN_Rule(Required, 5, 0, SecEntityPin )\
89  XrdVERSIONPLUGIN_Rule(Required, 4, 8, TcpMonPin )\
90  XrdVERSIONPLUGIN_Rule(Required, 5, 0, XrdAccAuthorizeObject )\
91  XrdVERSIONPLUGIN_Rule(Required, 5, 0, XrdAccAuthorizeObjAdd )\
92  XrdVERSIONPLUGIN_Rule(Optional, 5, 0, XrdBwmPolicyObject )\
93  XrdVERSIONPLUGIN_Rule(Required, 5, 0, XrdCksCalcInit )\
94  XrdVERSIONPLUGIN_Rule(Required, 5, 0, XrdCksInit )\
95  XrdVERSIONPLUGIN_Rule(Required, 5, 0, XrdCmsGetClient )\
96  XrdVERSIONPLUGIN_Rule(Required, 5, 0, XrdCmsgetVnId )\
97  XrdVERSIONPLUGIN_Rule(Required, 5, 0, XrdCmsPerfMonitor )\
98  XrdVERSIONPLUGIN_Rule(Required, 5, 0, XrdCryptosslFactoryObject )\
99  XrdVERSIONPLUGIN_Rule(Optional, 5, 0, XrdPfcGetDecision )\
100  XrdVERSIONPLUGIN_Rule(DoNotChk, 5, 0, XrdgetProtocol )\
101  XrdVERSIONPLUGIN_Rule(Required, 5, 0, XrdgetProtocolPort )\
102  XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdHttpGetSecXtractor )\
103  XrdVERSIONPLUGIN_Rule(Required, 4, 8, XrdHttpGetExtHandler )\
104  XrdVERSIONPLUGIN_Rule(Required, 5, 0, XrdSysLogPInit )\
105  XrdVERSIONPLUGIN_Rule(Required, 5, 0, XrdOfsAddPrepare )\
106  XrdVERSIONPLUGIN_Rule(Required, 5, 0, XrdOfsFSctl )\
107  XrdVERSIONPLUGIN_Rule(Required, 5, 0, XrdOfsgetPrepare )\
108  XrdVERSIONPLUGIN_Rule(Required, 5, 0, XrdOssGetStorageSystem )\
109  XrdVERSIONPLUGIN_Rule(Required, 5, 0, XrdOssAddStorageSystem2 )\
110  XrdVERSIONPLUGIN_Rule(Required, 5, 0, XrdOssGetStorageSystem2 )\
111  XrdVERSIONPLUGIN_Rule(Required, 5, 0, XrdOssStatInfoInit )\
112  XrdVERSIONPLUGIN_Rule(Required, 5, 0, XrdOssStatInfoInit2 )\
113  XrdVERSIONPLUGIN_Rule(Required, 5, 0, XrdOucGetCache )\
114  XrdVERSIONPLUGIN_Rule(Required, 5, 0, XrdOucGetCache2 )\
115  XrdVERSIONPLUGIN_Rule(Required, 5, 0, XrdOucCacheCMInit )\
116  XrdVERSIONPLUGIN_Rule(Optional, 5, 0, XrdOucgetName2Name )\
117  XrdVERSIONPLUGIN_Rule(Required, 5, 0, XrdSecGetProtocol )\
118  XrdVERSIONPLUGIN_Rule(Required, 5, 0, XrdSecgetService )\
119  XrdVERSIONPLUGIN_Rule(Optional, 5, 0, XrdSecgsiAuthzFun )\
120  XrdVERSIONPLUGIN_Rule(DoNotChk, 5, 0, XrdSecgsiAuthzInit )\
121  XrdVERSIONPLUGIN_Rule(DoNotChk, 5, 0, XrdSecgsiAuthzKey )\
122  XrdVERSIONPLUGIN_Rule(Optional, 5, 0, XrdSecgsiGMAPFun )\
123  XrdVERSIONPLUGIN_Rule(Optional, 5, 0, XrdSecgsiVOMSFun )\
124  XrdVERSIONPLUGIN_Rule(DoNotChk, 5, 0, XrdSecgsiVOMSInit )\
125  XrdVERSIONPLUGIN_Rule(DoNotChk, 5, 0, XrdSecProtocolgsiInit )\
126  XrdVERSIONPLUGIN_Rule(Required, 5, 0, XrdSecProtocolgsiObject )\
127  XrdVERSIONPLUGIN_Rule(DoNotChk, 5, 0, XrdSecProtocolkrb5Init )\
128  XrdVERSIONPLUGIN_Rule(Required, 5, 0, XrdSecProtocolkrb5Object )\
129  XrdVERSIONPLUGIN_Rule(DoNotChk, 5, 0, XrdSecProtocolpwdInit )\
130  XrdVERSIONPLUGIN_Rule(Required, 5, 0, XrdSecProtocolpwdObject )\
131  XrdVERSIONPLUGIN_Rule(DoNotChk, 5, 0, XrdSecProtocolsssInit )\
132  XrdVERSIONPLUGIN_Rule(Required, 5, 0, XrdSecProtocolsssObject )\
133  XrdVERSIONPLUGIN_Rule(DoNotChk, 5, 0, XrdSecProtocolunixInit )\
134  XrdVERSIONPLUGIN_Rule(Required, 5, 0, XrdSecProtocolunixObject )\
135  XrdVERSIONPLUGIN_Rule(Required, 5, 0, XrdSfsGetFileSystem )\
136  XrdVERSIONPLUGIN_Rule(Required, 5, 0, XrdSfsGetFileSystem2 )\
137  XrdVERSIONPLUGIN_Rule(Required, 5, 0, XrdSysAddXAttrObject )\
138  XrdVERSIONPLUGIN_Rule(Required, 5, 0, XrdSysGetXAttrObject )\
139  XrdVERSIONPLUGIN_Rule(Required, 5, 0, XrdClGetMonitor )\
140  XrdVERSIONPLUGIN_Rule(Required, 5, 0, XrdClGetPlugIn )\
141  { 0, 0, 0, 0, 0, 0}
142 
143 #define XrdVERSIONPLUGIN_Maxim(procMode, majorVer, minorVer, piPfx, piSfx)\
144  {#piPfx #piSfx, static_cast<char>(strlen(#piPfx)),\
145  static_cast<char>(strlen(#piSfx)),\
146  XrdVERSIONPLUGIN_##procMode, majorVer, minorVer},
147 
148 /* Each generic rule must be defined by the XrdVERSIONPLUGIN_Maxim macro which
149  takes five arguments. The first three are exactly the same as defined for
150  XrdVERSIONPLUGIN_Rule. The last two define a pefix/suffix match for the
151  symbol being looked up, as follows:
152 
153  piPfx: The leading characters of the plugin's object creator's unquoted
154  function name. When this symbol is looked-up, the defined version
155  rule is applied if the suffix, if any, also matches.
156 
157  piSfx: The trailing characters of the plugin's object creator's unquoted
158  function name. When this symbol is looked-up, the defined version
159  rule is applied if the prefix, if any, also matches.
160 
161  Note: An attempt is made to match the symbol using specific rules defined
162  by XRDVERSIONPLUGIN_Rule before using any generic rules. If a match
163  is found the same processing as for specific rules is applied.
164 */
165 #define XrdVERSIONPLUGINMAXIMS\
166  XrdVERSIONPLUGIN_Maxim(DoNotChk, 4, 0, XrdSecProtocol, Init )\
167  XrdVERSIONPLUGIN_Maxim(Required, 4, 0, XrdSecProtocol, Object )\
168  XrdVERSIONPLUGIN_Maxim(Optional, 4, 0, XrdCrypto, FactoryObject)\
169  { 0, 0, 0, 0, 0, 0}
170 
171 /* The following defines the list of plugins that are included in the base
172  code and are to be strictly name versioned upon loading (i.e. fallback
173  to an unversioned name is not allowed). This is enforced by XrdOucVerName.
174 */
175 #define XrdVERSIONPLUGINSTRICT \
176  {"libXrdBlacklistDecision.so", \
177  "libXrdBwm.so", \
178  "libXrdCksCalczcrc32.so", \
179  "libXrdClProxyPlugin.so", \
180  "libXrdCmsRedirectLocal.so", \
181  "libXrdCryptossl.so", \
182  "libXrdHttp.so", \
183  "libXrdHttpTPC.so", \
184  "libXrdMacaroons.so", \
185  "libXrdN2No2p.so", \
186  "libXrdOssSIgpfsT.so", \
187  "libXrdPfc.so", \
188  "libXrdPss.so", \
189  "libXrdSec.so", \
190  "libXrdSecgsi.so", \
191  "libXrdSecgsiAUTHZVO.so", \
192  "libXrdSecgsiGMAPDN.so", \
193  "libXrdSecgsiVOMS.so", \
194  "libXrdSeckrb5.so", \
195  "libXrdSecProt.so", \
196  "libXrdSecpwd.so", \
197  "libXrdSecsss.so", \
198  "libXrdSecunix.so", \
199  "libXrdSsi.so", \
200  "libXrdSsiLog.so", \
201  "libXrdThrottle.so", \
202  "libXrdVoms.so", \
203  "libXrdXrootd.so", \
204  0}
205 
206 // The XrdVersionMapD2P maps a directive to the associated plugin creator.
207 // When two or more such creators exist, the newest one should be used.
208 //
210  {const char *dName;
211  const char *pName;
212  };
213 
214 #define XrdVERSIONPLUGIN_Mapd(drctv, piSymbol)\
215  {#drctv, #piSymbol},
216 
217 #define XrdVERSIONPLUGINMAPD2P\
218  XrdVERSIONPLUGIN_Mapd(ofs.authlib, XrdAccAuthorizeObject )\
219  XrdVERSIONPLUGIN_Mapd(bwm.policy, XrdBwmPolicyObject )\
220  XrdVERSIONPLUGIN_Mapd(ofs.ckslib, XrdCksInit )\
221  XrdVERSIONPLUGIN_Mapd(ofs.cmslib, XrdCmsGetClient )\
222  XrdVERSIONPLUGIN_Mapd(cms.vnid, XrdCmsgetVnId )\
223  XrdVERSIONPLUGIN_Mapd(cms.perf, XrdCmsPerfMonitor )\
224  XrdVERSIONPLUGIN_Mapd(pfc.decisionlib, XrdPfcGetDecision )\
225  XrdVERSIONPLUGIN_Mapd(xrd.protocol, XrdgetProtocol )\
226  XrdVERSIONPLUGIN_Mapd(http.secxtractor, XrdHttpGetSecXtractor )\
227  XrdVERSIONPLUGIN_Mapd(http.exthandler, XrdHttpGetExtHandler )\
228  XrdVERSIONPLUGIN_Mapd(@logging, XrdSysLogPInit )\
229  XrdVERSIONPLUGIN_Mapd(ofs.ctllib, XrdOfsFSctl )\
230  XrdVERSIONPLUGIN_Mapd(ofs.preplib, XrdOfsgetPrepare )\
231  XrdVERSIONPLUGIN_Mapd(ofs.osslib, XrdOssGetStorageSystem2 )\
232  XrdVERSIONPLUGIN_Mapd(oss.statlib, XrdOssStatInfoInit2 )\
233  XrdVERSIONPLUGIN_Mapd(pss.cachelib, XrdOucGetCache2 )\
234  XrdVERSIONPLUGIN_Mapd(pss.ccmlib, XrdOucCacheCMInit )\
235  XrdVERSIONPLUGIN_Mapd(oss.namelib, XrdOucgetName2Name )\
236  XrdVERSIONPLUGIN_Mapd(sec.protocol, XrdSecGetProtocol )\
237  XrdVERSIONPLUGIN_Mapd(xrootd.seclib, XrdSecgetService )\
238  XrdVERSIONPLUGIN_Mapd(gsi-authzfun, XrdSecgsiAuthzFun )\
239  XrdVERSIONPLUGIN_Mapd(gsi-gmapfun, XrdSecgsiGMAPFun )\
240  XrdVERSIONPLUGIN_Mapd(gsi-vomsfun, XrdSecgsiVOMSFun )\
241  XrdVERSIONPLUGIN_Mapd(sec.protocol-gsi, XrdSecProtocolgsiObject )\
242  XrdVERSIONPLUGIN_Mapd(sec.protocol-krb5,XrdSecProtocolkrb5Object )\
243  XrdVERSIONPLUGIN_Mapd(sec.protocol-pwd, XrdSecProtocolpwdObject )\
244  XrdVERSIONPLUGIN_Mapd(sec.protocol-sss, XrdSecProtocolsssObject )\
245  XrdVERSIONPLUGIN_Mapd(sec.protocol-unix,XrdSecProtocolunixObject )\
246  XrdVERSIONPLUGIN_Mapd(xrootd.fslib, XrdSfsGetFileSystem2 )\
247  XrdVERSIONPLUGIN_Mapd(ofs.xattrlib, XrdSysGetXAttrObject )\
248  XrdVERSIONPLUGIN_Mapd(xrdcl.monitor, XrdClGetMonitor )\
249  XrdVERSIONPLUGIN_Mapd(xrdcl.plugin, XrdClGetPlugIn )\
250  { 0, 0}
251 #endif
XrdVersionPlugin::vPfxLen
char vPfxLen
Generic rule prefix length.
Definition: XrdVersionPlugin.hh:39
XrdVersionPlugin::vSfxLen
char vSfxLen
Generic rule suffix length for preceeding.
Definition: XrdVersionPlugin.hh:40
XrdVersionMapD2P
Definition: XrdVersionPlugin.hh:210
XrdVersionPlugin::vMinLow
short vMinLow
Lowest compatible minor (< 0 don't check).
Definition: XrdVersionPlugin.hh:43
XrdVersionPlugin::vMajLow
short vMajLow
Lowest compatible major version number.
Definition: XrdVersionPlugin.hh:42
XrdVersionPlugin::pName
const char * pName
-> plugin object creator function name
Definition: XrdVersionPlugin.hh:38
XrdVersionMapD2P::dName
const char * dName
-> plugin directive name
Definition: XrdVersionPlugin.hh:210
XrdVersionPlugin
Definition: XrdVersionPlugin.hh:38
XrdVersionPlugin::vProcess
int vProcess
version: <0 skip, =0 optional, >0 required
Definition: XrdVersionPlugin.hh:41
XrdVersionMapD2P::pName
const char * pName
-> plugin object creator function name
Definition: XrdVersionPlugin.hh:211