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;
60static const int azAlways = 1;
61static const int azNoVoms = 0;
63OptsMap azCallKV[] = {{
"always", 1},
67OptsTab azCallOpts =
OTINIT(
"-authzcall",1,azCallKV);
73static const int azFull = 0;
74static const int azLast = 1;
75static const int azCred = 1;
76static const int azEndo = 2;
78OptsMap azPxyKV[] = {{
"creds=fullchain", azCred+(10*azFull)},
79 {
"creds=lastcert", azCred+(10*azLast)},
80 {
"endor=fullchain", azEndo+(10*azFull)},
81 {
"endor=lastcert", azEndo+(10*azLast)}
84OptsTab azPxyOpts =
OTINIT(
"-authz",0,azPxyKV);
90static const int caNoVerify = 0;
91static const int caVerifyss = 1;
92static const int caVerify = 2;
94OptsMap caVerKV[] = {{
"noverify", caNoVerify},
95 {
"verifyss", caVerifyss},
99OptsTab caVerOpts =
OTINIT(
"-ca",caVerifyss,caVerKV);
105static const int crlIgnore = 0;
106static const int crlTry = 1;
107static const int crlUse = 2;
108static const int crlRequire = 3;
109static const int crlUpdate = 10;
110static const int crlNoUpdt = 0;
112OptsMap crl1KV[] = {{
"ignore", crlIgnore},
115 {
"use,updt", crlUse+crlUpdate},
116 {
"require", crlRequire},
117 {
"require,updt", crlRequire+crlUpdate}
120OptsTab crlOpts =
OTINIT(
"-crl",crlTry,crl1KV);
126static const int dlgIgnore = 0;
127static const int dlgReqSign = 1;
128static const int dlgSendpxy = 2;
130OptsMap sDlgKV[] = {{
"ignore", dlgIgnore},
131 {
"request", dlgReqSign}
134OptsTab sDlgOpts =
OTINIT(
"-dlgpxy",dlgIgnore,sDlgKV);
140static const int gmoNoMap = 0;
141static const int gmoTryMap = 1;
142static const int gmoUseMap = 2;
143static const int gmoEntDN = 10;
144static const int gmoEntDNHash = 0;
146OptsMap gmoKV[] = {{
"nomap", gmoNoMap},
147 {
"nomap,usedn", gmoNoMap+gmoEntDN},
148 {
"trymap", gmoTryMap},
149 {
"trymap,usedn", gmoTryMap+gmoEntDN},
150 {
"usemap", gmoUseMap}
153OptsTab gmoOpts =
OTINIT(
"-gmopts",gmoTryMap,gmoKV);
159OptsMap tdnsKV[] = {{
"false", 0},
163OptsTab tdnsOpts =
OTINIT(
"-trustdns",0,tdnsKV);
169static const int vatIgnore = 0;
170static const int vatExtract = 1;
171static const int vatRequire = 2;
173OptsMap vomsatKV[] = {{
"ignore", vatIgnore},
174 {
"extract", vatExtract},
175 {
"require", vatRequire}
178OptsTab vomsatOpts =
OTINIT(
"-vomsat",vatIgnore,vomsatKV);
184const 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;
195int 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 WARN(x)
Definition XrdSecgsiOpts.hh:38
#define OTINIT(a, b, x)
Definition XrdSecgsiOpts.hh:40