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;
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, XrdCmsgetVnId )\
95 XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdCryptosslFactoryObject )\
96 XrdVERSIONPLUGIN_Rule(Optional, 4, 0, XrdFileCacheGetDecision )\
97 XrdVERSIONPLUGIN_Rule(DoNotChk, 4, 0, XrdgetProtocol )\
98 XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdgetProtocolPort )\
99 XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdHttpGetSecXtractor )\
100 XrdVERSIONPLUGIN_Rule(Required, 4, 8, XrdHttpGetExtHandler )\
101 XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdSysLogPInit )\
102 XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdOssGetStorageSystem )\
103 XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdOssStatInfoInit )\
104 XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdOssStatInfoInit2 )\
105 XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdOucGetCache )\
106 XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdOucGetCache2 )\
107 XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdOucCacheCMInit )\
108 XrdVERSIONPLUGIN_Rule(Optional, 4, 0, XrdOucgetName2Name )\
109 XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdSecGetProtocol )\
110 XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdSecgetService )\
111 XrdVERSIONPLUGIN_Rule(Optional, 4, 0, XrdSecgsiAuthzFun )\
112 XrdVERSIONPLUGIN_Rule(DoNotChk, 4, 0, XrdSecgsiAuthzInit )\
113 XrdVERSIONPLUGIN_Rule(DoNotChk, 4, 0, XrdSecgsiAuthzKey )\
114 XrdVERSIONPLUGIN_Rule(Optional, 4, 0, XrdSecgsiGMAPFun )\
115 XrdVERSIONPLUGIN_Rule(Optional, 4, 0, XrdSecgsiVOMSFun )\
116 XrdVERSIONPLUGIN_Rule(DoNotChk, 4, 0, XrdSecgsiVOMSInit )\
117 XrdVERSIONPLUGIN_Rule(DoNotChk, 4, 0, XrdSecProtocolgsiInit )\
118 XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdSecProtocolgsiObject )\
119 XrdVERSIONPLUGIN_Rule(DoNotChk, 4, 0, XrdSecProtocolkrb5Init )\
120 XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdSecProtocolkrb5Object )\
121 XrdVERSIONPLUGIN_Rule(DoNotChk, 4, 0, XrdSecProtocolpwdInit )\
122 XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdSecProtocolpwdObject )\
123 XrdVERSIONPLUGIN_Rule(DoNotChk, 4, 0, XrdSecProtocolsssInit )\
124 XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdSecProtocolsssObject )\
125 XrdVERSIONPLUGIN_Rule(DoNotChk, 4, 0, XrdSecProtocolunixInit )\
126 XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdSecProtocolunixObject )\
127 XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdSfsGetFileSystem )\
128 XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdSfsGetFileSystem2 )\
129 XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdSysGetXAttrObject )\
130 XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdSysLogPInit )\
131 XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdClGetMonitor )\
132 XrdVERSIONPLUGIN_Rule(Required, 4, 0, XrdClGetPlugIn )\
133 { 0, 0, 0, 0, 0, 0}
134
135#define XrdVERSIONPLUGIN_Maxim(procMode, majorVer, minorVer, piPfx, piSfx)\
136 {#piPfx #piSfx, static_cast<char>(strlen(#piPfx)),\
137 static_cast<char>(strlen(#piSfx)),\
138 XrdVERSIONPLUGIN_##procMode, majorVer, minorVer},
139
140/* Each generic rule must be defined by the XrdVERSIONPLUGIN_Maxim macro which
141 takes five arguments. The first three are exactly the same as defined for
142 XrdVERSIONPLUGIN_Rule. The last two define a pefix/suffix match for the
143 symbol being looked up, as follows:
144
145 piPfx: The leading characters of the plugin's object creator's unquoted
146 function name. When this symbol is looked-up, the defined version
147 rule is applied if the suffix, if any, also matches.
148
149 piSfx: The trailing characters of the plugin's object creator's unquoted
150 function name. When this symbol is looked-up, the defined version
151 rule is applied if the prefix, if any, also matches.
152
153 Note: An attempt is made to match the symbol using specific rules defined
154 by XRDVERSIONPLUGIN_Rule before using any generic rules. If a match
155 is found the same processing as for specific rules is applied.
156*/
157#define XrdVERSIONPLUGINMAXIMS\
158 XrdVERSIONPLUGIN_Maxim(DoNotChk, 4, 0, XrdSecProtocol, Init )\
159 XrdVERSIONPLUGIN_Maxim(Required, 4, 0, XrdSecProtocol, Object )\
160 XrdVERSIONPLUGIN_Maxim(Optional, 4, 0, XrdCrypto, FactoryObject)\
161 { 0, 0, 0, 0, 0, 0}
162
163/* The following defines the list of plugins that are included in the base
164 code and are to be strictly name versioned upon loading (i.e. fallback
165 to an unversioned name is not allowed). This is enforced by XrdOucVerName.
166*/
167#define XrdVERSIONPLUGINSTRICT \
168 {"libXrdBwm.so", \
169 "libXrdCksCalczcrc32.so", \
170 "libXrdCryptossl.so", \
171 "libXrdFileCache.so", \
172 "libXrdHttp.so", \
173 "libXrdOssSIgpfsT.so", \
174 "libXrdPss.so", \
175 "libXrdSec.so", \
176 "libXrdSecgsi.so", \
177 "libXrdSecgsiAUTHZVO.so", \
178 "libXrdSecgsiGMAPDLAP.so", \
179 "libXrdSeckrb5.so", \
180 "libXrdSecpwd.so", \
181 "libXrdSecsss.so", \
182 "libXrdSecunix.so", \
183 "libXrdXrootd.so", \
184 0}
185#endif
Definition: XrdVersionPlugin.hh:38
char vPfxLen
Generic rule prefix length.
Definition: XrdVersionPlugin.hh:39
int vProcess
version: <0 skip, =0 optional, >0 required
Definition: XrdVersionPlugin.hh:41
const char * pName
-> plugin object creator function name
Definition: XrdVersionPlugin.hh:38
char vSfxLen
Generic rule suffix length for preceeding.
Definition: XrdVersionPlugin.hh:40
short vMajLow
Lowest compatible major version number.
Definition: XrdVersionPlugin.hh:42
short vMinLow
Lowest compatible minor (>99 don't check).
Definition: XrdVersionPlugin.hh:43