1 #ifndef __XRD_GSIOPTS_H__
2 #define __XRD_GSIOPTS_H__
38 #define WARN(x) std::cerr <<"Secgsi warning: " << x <<'\n' <<std::flush
40 #define OTINIT(a,b,x) {a, b, sizeof(x)/sizeof(x [0]), x}
42 #define LIB_XRDVOMS "libXrdVoms.so"
53 struct OptsMap *mapOpts;
60 static const int azAlways = 1;
61 static const int azNoVoms = 0;
63 OptsMap azCallKV[] = {{
"always", 1},
67 OptsTab azCallOpts =
OTINIT(
"-authzcall",1,azCallKV);
73 static const int azFull = 0;
74 static const int azLast = 1;
75 static const int azCred = 1;
76 static const int azEndo = 2;
78 OptsMap azPxyKV[] = {{
"creds=fullchain", azCred+(10*azFull)},
79 {
"creds=lastcert", azCred+(10*azLast)},
80 {
"endor=fullchain", azEndo+(10*azFull)},
81 {
"endor=lastcert", azEndo+(10*azLast)}
84 OptsTab azPxyOpts =
OTINIT(
"-authz",0,azPxyKV);
90 static const int caNoVerify = 0;
91 static const int caVerifyss = 1;
92 static const int caVerify = 2;
94 OptsMap caVerKV[] = {{
"noverify", caNoVerify},
95 {
"verifyss", caVerifyss},
99 OptsTab caVerOpts =
OTINIT(
"-ca",caVerifyss,caVerKV);
105 static const int crlIgnore = 0;
106 static const int crlTry = 1;
107 static const int crlUse = 2;
108 static const int crlRequire = 3;
109 static const int crlUpdate = 10;
110 static const int crlNoUpdt = 0;
112 OptsMap crl1KV[] = {{
"ignore", crlIgnore},
115 {
"use,updt", crlUse+crlUpdate},
116 {
"require", crlRequire},
117 {
"require,updt", crlRequire+crlUpdate}
120 OptsTab crlOpts =
OTINIT(
"-crl",crlTry,crl1KV);
126 static const int dlgIgnore = 0;
127 static const int dlgReqSign = 1;
128 static const int dlgSendpxy = 2;
130 OptsMap sDlgKV[] = {{
"ignore", dlgIgnore},
131 {
"request", dlgReqSign}
134 OptsTab sDlgOpts =
OTINIT(
"-dlgpxy",dlgIgnore,sDlgKV);
140 static const int gmoNoMap = 0;
141 static const int gmoTryMap = 1;
142 static const int gmoUseMap = 2;
143 static const int gmoEntDN = 10;
144 static const int gmoEntDNHash = 0;
146 OptsMap gmoKV[] = {{
"nomap", gmoNoMap},
147 {
"nomap,usedn", gmoNoMap+gmoEntDN},
148 {
"trymap", gmoTryMap},
149 {
"trymap,usedn", gmoTryMap+gmoEntDN},
150 {
"usemap", gmoUseMap}
153 OptsTab gmoOpts =
OTINIT(
"-gmopts",gmoTryMap,gmoKV);
159 OptsMap tdnsKV[] = {{
"false", 0},
163 OptsTab tdnsOpts =
OTINIT(
"-trustdns",0,tdnsKV);
169 static const int vatIgnore = 0;
170 static const int vatExtract = 1;
171 static const int vatRequire = 2;
173 OptsMap vomsatKV[] = {{
"ignore", vatIgnore},
174 {
"extract", vatExtract},
175 {
"require", vatRequire}
178 OptsTab vomsatOpts =
OTINIT(
"-vomsat",vatIgnore,vomsatKV);
184 const char *getOptName(OptsTab &oTab,
int opval)
186 for (
int i = 0; i < oTab.numMap; i++)
187 if (opval == oTab.mapOpts[i].optVal)
return oTab.mapOpts[i].optKey;
195 int getOptVal(OptsTab &oTab,
const char *oVal)
199 for (
int i = 0; i < oTab.numMap; i++)
200 if (n == oTab.mapOpts[i].optVal)
return n;
202 for (
int i = 0; i < oTab.numMap; i++)
203 if (!strcmp(oVal, oTab.mapOpts[i].optKey))
204 return oTab.mapOpts[i].optVal;
207 if (oTab.opDflt >= 0)
208 {
WARN(
"invalid " <<oTab.opName <<
" argument '" <<oVal <<
209 "'; using '" <<getOptName(oTab, oTab.opDflt) <<
"' instead!");
#define OTINIT(a, b, x)
Definition: XrdSecgsiOpts.hh:40
#define WARN(x)
Definition: XrdSecgsiOpts.hh:38