45 #include <sys/param.h>
46 #include <sys/resource.h>
47 #include <sys/types.h>
53 #include "XrdVersion.hh"
95 #if defined(__linux__) || defined(__GNU__)
96 #include <netinet/tcp.h>
98 #if defined(__linux__)
99 #include <sys/epoll.h>
102 #include <AvailabilityMacros.h>
146 void TlsError(
const char *tid,
const char *msg,
bool sslmsg)
154 const char *XrdConfig::TraceID =
"Config";
160 #define TS_Xeq(x,m) if (!strcmp(x,var)) return m(eDest, Config);
191 {
for (
int i = 0; i < numP; i++)
192 if (pnum == portVec[i])
193 {tlsVec[i] = isTLS;
return true;}
195 portVec[numP] = pnum; tlsVec[numP] = isTLS;
200 void Reset(
char *ln,
char *pp,
int np=-1,
bool to=
false)
201 {
if (libpath) free(libpath);
203 if (parms) free(parms);
205 memset(portVec, 0,
sizeof(portVec));
207 memset(tlsVec, 0,
sizeof(tlsVec));
214 : Next(0), proname(pn), libpath(ln), parms(pp), numP(1)
215 {memset(portVec, 0,
sizeof(portVec)); port = np;
216 memset(tlsVec, 0,
sizeof(tlsVec)); dotls =
to;
221 if (libpath) free(libpath);
222 if (parms) free(parms);
237 : KingPin(drctv,
theEnv, errR, &myVer)
261 AdminPath= strdup(
"/tmp");
263 PidPath = strdup(
"/tmp");
287 Firstcp = Lastcp = 0;
289 ProtInfo.eDest = &
Log;
292 ProtInfo.Sched = &
Sched;
293 ProtInfo.ConfigFN= 0;
295 ProtInfo.AdmPath = AdminPath;
296 ProtInfo.AdmMode = AdminMode;
297 ProtInfo.theEnv = &
theEnv;
298 ProtInfo.xrdFlags= 0;
301 memset(ProtInfo.rsvd3, 0,
sizeof(ProtInfo.rsvd3));
303 ProtInfo.ConnMax = -1;
304 ProtInfo.readWait = 3*1000;
305 ProtInfo.idleWait = 0;
306 ProtInfo.hailWait =30*1000;
307 ProtInfo.DebugON = 0;
310 ProtInfo.tlsPort = 0;
335 const char *xrdInst=
"XRDINSTANCE=";
337 int retc, NoGo = 0, clPort = -1;
339 char c, buff[512], *dfltProt, *libProt = 0;
343 extern int optind, opterr;
345 int pipeFD[2] = {-1, -1};
346 const char *pidFN = 0;
347 static const int myMaxc = 80;
348 char **urArgv, *myArgv[myMaxc], argBuff[myMaxc*3+8];
349 char *argbP = argBuff, *argbE = argbP+
sizeof(argBuff)-4;
351 int myArgc = 1, urArgc = argc, i;
352 bool noV6, ipV4 =
false, ipV6 =
false, rootChk =
true, optbg =
false;
357 for (
int k = 1; k < argc; k++)
358 {CmdLine +=
' '; CmdLine += argv[k];}
362 retc = strlen(argv[0]);
363 while(retc--)
if (argv[0][retc] ==
'/')
break;
364 myProg = &argv[0][retc+1];
371 {
char *p = dfltProt = strdup(myProg);
372 while(*p && (*p ==
'.' || *p ==
'-')) p++;
374 {
char *dot = index(p,
'.'), *dash = index(p,
'-');
375 if (dot && (dot < dash || !dash)) p = dot;
376 else if (dash) p = dash;
379 if (!strcmp(
"xrootd", dfltProt)) dfltProt[5] = 0;
380 else if (!strcmp(
"cmsd", dfltProt)) dfltProt[3] = 0;
390 {
if (*(argv[i]) ==
'-' && *(argv[i]+1) ==
'+')
391 {
int n = strlen(argv[i]+2), j = i+1, k = 1;
392 if (urArgc == argc) urArgc = i;
393 if (n) memcpy(buff, argv[i]+2, (n > 256 ? 256 : n));
394 strcpy(&(buff[n]),
".argv**");
395 while(j < argc && (*(argv[j]) !=
'-' || *(argv[j]+1) !=
'+')) j++;
396 urArgv =
new char*[j-i+1];
399 while(i < j) urArgv[k++] = argv[i++];
402 strcpy(&(buff[n]),
".argc");
412 if (argc > 1 &&
'-' == *argv[1])
413 while ((c = getopt(urArgc,argv,
":a:A:bc:dhHI:k:l:L:n:N:p:P:R:s:S:vw:W:z"))
414 && ((
unsigned char)c != 0xff))
417 case 'a':
if (AdminPath) free(AdminPath);
418 AdminPath = strdup(optarg);
419 AdminMode = ProtInfo.AdmMode = S_IRWXU;
422 case 'A':
if (AdminPath) free(AdminPath);
423 AdminPath = strdup(optarg);
424 AdminMode = ProtInfo.AdmMode = S_IRWXU | S_IRWXG;
427 case 'b': optbg =
true;
429 case 'c':
if (ConfigFN) free(ConfigFN);
430 ConfigFN = strdup(optarg);
433 ProtInfo.DebugON = 1;
440 case 'I':
if (!strcmp(
"v4", optarg)) {ipV4 =
true; ipV6 =
false;}
441 else if (!strcmp(
"v6", optarg)) {ipV4 =
false; ipV6 =
true;}
442 else {
Log.
Emsg(
"Config",
"Invalid -I argument -",optarg);
447 {
Log.
Emsg(
"Config",
"Invalid -k argument -",optarg);
451 case 'l': LogInfo.
logArg = optarg;
453 case 'L':
if (!*optarg)
454 {
Log.
Emsg(
"Config",
"Protocol library path not specified.");
457 if (libProt) free(libProt);
458 libProt = strdup(optarg);
460 case 'n': myInsName = (!strcmp(optarg,
"anon")||!strcmp(optarg,
"default")
467 case 'P':
if (dfltProt) free(dfltProt);
468 dfltProt = strdup(optarg);
470 case 'R':
if (!(getUG(optarg, myUid, myGid)))
Usage(1);
473 case 's': pidFN = optarg;
475 case 'S': mySitName = optarg;
477 case ':': buff[0] =
'-'; buff[1] =
optopt; buff[2] = 0;
478 Log.
Emsg(
"Config", buff,
"parameter not specified.");
481 case 'v': std::cerr <<XrdVSTRING <<std::endl;
484 case 'w':
if (HomePath) free(HomePath);
485 HomePath = strdup(optarg);
489 case 'W':
if (HomePath) free(HomePath);
490 HomePath = strdup(optarg);
491 HomeMode = S_IRWXU | S_IRGRP | S_IXGRP;
494 case 'z': LogInfo.
hiRes =
true;
498 {
Log.
Emsg(
"Config",
"Long options are not supported.");
501 if (myArgc >= myMaxc || argbP >= argbE)
502 {
Log.
Emsg(
"Config",
"Too many command line arguments.");
505 myArgv[myArgc++] = argbP;
506 *argbP++ =
'-'; *argbP++ =
optopt; *argbP++ = 0;
514 {
Log.
Emsg(
"Config",
"Command line adminpath is not absolute.");
520 if (HomePath && *HomePath !=
'/')
521 {
Log.
Emsg(
"Config",
"Command line home path is not absolute.");
528 if (ConfigFN) setCFG(
true);
534 else if (ipV6){
if (noV6)
Log.
Say(
"Config warning: ipV6 appears to be broken;"
535 " forced ipV6 mode not advised!");
538 else if (noV6)
Log.
Say(
"Config warning: ipV6 is misconfigured or "
539 "unavailable; reverting to ipV4.");
547 if (myGid && setegid(myGid))
548 {
Log.
Emsg(
"Config", errno,
"set effective gid"); exit(17);}
549 if (myUid && seteuid(myUid))
550 {
Log.
Emsg(
"Config", errno,
"set effective uid"); exit(17);}
554 if (rootChk && geteuid() == 0)
555 {
Log.
Emsg(
"Config",
"Security reasons prohibit running as "
556 "superuser; program is terminating.");
562 if (urArgc-
optind+2 >= myMaxc)
563 {
Log.
Emsg(
"Config",
"Too many command line arguments.");
571 ProtInfo.argc = myArgc;
572 ProtInfo.argv = myArgv;
581 if (pipe( pipeFD ) == -1)
582 {
Log.
Emsg(
"Config", errno,
"create a pipe"); exit(17);}
591 auto envName = getenv(
"XRDHOST");
592 const char *ipAddrName;
596 }
else if ((ipAddrName = myIPAddr->
Name(0, &temp))) {
604 ProtInfo.myName = myName.c_str();
605 ProtInfo.myAddr = myIPAddr->
SockAddr();
607 ProtInfo.myProg = myProg;
613 sprintf(buff,
"%s%s %s@%s", xrdInst, myProg, ProtInfo.myInst, myName.c_str());
614 myInstance = strdup(buff);
616 myInstance += strlen(xrdInst);
625 LogInfo.
iName = myInsName;
626 LogInfo.
cfgFn = ConfigFN;
637 {
Log.
Emsg(
"Config",
"Unable to determine host name; ",
638 (temp ? temp :
"reason unknown"),
639 "; execution terminated.");
649 strcpy(buff,
"Starting on ");
661 {
Log.
Emsg(
"Config",myName.c_str(),
"does not appear to be registered in the DNS.");
662 Log.
Emsg(
"Config",
"Verify that the '/etc/hosts' file is correct and "
663 "this machine is registered in DNS.");
664 Log.
Emsg(
"Config",
"Execution continues but connection failures may occur.");
666 }
else if (!(
myDomain = index(myName.c_str(),
'.')))
667 Log.
Say(
"Config warning: this hostname, ", myName.c_str(),
668 ", is registered without a domain qualification.");
672 Firstcp = Lastcp =
new XrdConfigProt(strdup(dfltProt), libProt, 0);
676 Log.
Say(
"++++++ ", myInstance,
" initialization started.");
680 devNull = XrdSysFD_Open(
"/dev/null", O_RDONLY);
682 {
Log.
Emsg(
"Config", errno,
"open '/dev/null' which is required!");
689 {
Log.
Say(
"Config using configuration file ", ConfigFN);
690 ProtInfo.ConfigFN = ConfigFN;
693 if (clPort >= 0) PortTCP = clPort;
694 if (ProtInfo.DebugON)
701 NoGo |= SetupAPath();
706 {
if (!tlsCert) ProtInfo.tlsCtx= 0;
707 else {
Log.
Say(
"++++++ ", myInstance,
" TLS initialization started.");
709 {
Log.
Say(
"------ ",myInstance,
" TLS initialization ended.");
714 Log.
Say(
"------ ",myInstance,
" TLS initialization failed.");
724 {
Log.
Say(
"Config TLS port specification ignored; TLS not configured!");
728 ProtInfo.tlsPort = (PortTLS > 0 ? PortTLS : 0);
744 {
Log.
Emsg(
"Config",
"Unable to determine interface addresses!");
750 if ((myInsName || HomePath)
759 if (!PidFile(pidFN, optbg)) NoGo = 1;
763 if (!NoGo) Manifest(pidFN);
767 if (!NoGo) NoGo = Setup(dfltProt, libProt);
776 if (tmoInfo && !NoGo)
778 if (!theGS)
Log.
Say(
"Config warning: TCP monitoring not enabled; "
779 "tcpmonlib plugin not loaded!");
780 else {tmoInfo->theEnv.PutPtr(
"TcpMon.gStream*", theGS);
781 TcpMonPin = tmoInfo->KingPin.Load(
"TcpMonPin");
791 int status = NoGo ? 1 : 0;
792 if(
write( pipeFD[1], &status,
sizeof( status ) )) {};
799 temp = (NoGo ?
" initialization failed." :
" initialization completed.");
800 sprintf(buff,
"%s:%d", myInstance, PortTCP);
801 Log.
Say(
"------ ", buff, temp);
803 {strcat(buff,
" running ");
821 if (
eDest) dynamic = 1;
835 TS_Xeq(
"adminpath", xapath);
837 TS_Xeq(
"homepath", xhpath);
841 TS_Xeq(
"protocol", xprot);
844 TS_Xeq(
"tcpmonlib", xtcpmon);
848 TS_Xeq(
"tlsciphers", xtlsci);
853 eDest->
Say(
"Config warning: ignoring unknown xrd directive '",var,
"'.");
865 int XrdConfig::ASocket(
const char *path,
const char *fname, mode_t mode)
867 struct sockaddr_un unixvar;
868 int plen = strlen(path), flen = strlen(fname);
872 if ((plen + flen + 3) > (
int)
sizeof(unixvar.sun_path))
873 {
Log.
Emsg(
"Config",
"admin path", path,
"too long");
908 int XrdConfig::ConfigProc()
911 int cfgFD, retc, NoGo = 0;
917 if ( (cfgFD =
open(ConfigFN, O_RDONLY, 0)) < 0)
918 {
Log.
Emsg(
"Config", errno,
"open config file", ConfigFN);
925 while((var =
Config.GetMyFirstWord()))
926 if (!strncmp(var,
"xrd.", 4)
927 || !strcmp (var,
"all.adminpath")
928 || !strcmp (var,
"all.pidpath")
929 || !strcmp (var,
"all.sitename" ))
930 if (ConfigXeq(var+4,
Config)) {
Config.Echo(); NoGo = 1;}
934 if ((retc =
Config.LastError()))
935 NoGo =
Log.
Emsg(
"Config", retc,
"read config file", ConfigFN);
947 XrdInet *XrdConfig::getNet(
int port,
bool isTLS)
949 int the_Opts, the_Blen;
953 for (
int i = 0; i < (int)NetTCP.size(); i++)
954 if (port == NetTCP[i]->Port())
return NetTCP[i];
959 NetTCP.push_back(newNet);
964 {the_Opts = TLS_Opts; the_Blen = TLS_Blen;
966 the_Opts = Net_Opts; the_Blen = Net_Blen;
968 if (the_Opts || the_Blen) newNet->
setDefaults(the_Opts, the_Blen);
976 if (newNet->
BindSD(port,
"tcp") == 0)
return newNet;
985 int XrdConfig::getUG(
char *parm, uid_t &newUid, gid_t &newGid)
992 {
Log.
Emsg(
"Config",
"-R user not specified.");
return 0;}
995 {
if (!(newUid = atol(parm)))
996 {
Log.
Emsg(
"Config",
"-R", parm,
"is invalid");
return 0;}
997 pp = getpwuid(newUid);
999 else pp = getpwnam(parm);
1004 {
Log.
Emsg(
"Config", errno,
"retrieve -R user password entry");
1007 if (!(newUid = pp->pw_uid))
1008 {
Log.
Emsg(
"Config",
"-R", parm,
"is still unacceptably a superuser!");
1011 newGid = pp->pw_gid;
1019 void XrdConfig::Manifest(
const char *pidfn)
1022 char envBuff[8192], pwdBuff[2048], manBuff[1024], *pidP, *sP, *xP;
1027 if (!getcwd(pwdBuff,
sizeof(pwdBuff)))
1028 {
Log.
Emsg(
"Config",
"Unable to get current working directory!");
1034 if (HomePath) free(HomePath);
1035 HomePath = strdup(pwdBuff);
1039 strcpy(envBuff, ProtInfo.AdmPath);
1040 envLen = strlen(envBuff);
1041 if (envBuff[envLen-1] !=
'/') {envBuff[envLen] =
'/'; envLen++;}
1042 strcpy(envBuff+envLen,
".xrd/");
1043 xP = envBuff+envLen+5;
1047 if ((sP = getenv(
"XRDCONFIGFN")))
1048 {sprintf(xP,
"=/conf/%s.cf", myProg);
1054 sprintf(xP,
"=/core/%s", myProg);
1059 if ((sP = getenv(
"XRDLOGDIR")))
1060 {sprintf(xP,
"=/logs/%s", myProg);
1067 sprintf(xP,
"=/proc/%s", myProg);
1068 sprintf(manBuff,
"/proc/%d", getpid());
1074 envLen = snprintf(envBuff,
sizeof(envBuff),
"pid=%d&host=%s&inst=%s&ver=%s"
1075 "&home=%s&cfgfn=%s&cwd=%s&apath=%s&logfn=%s",
1076 static_cast<int>(getpid()), ProtInfo.myName,
1077 ProtInfo.myInst, XrdVSTRING, HomePath,
1078 (getenv(
"XRDCONFIGFN") ? getenv(
"XRDCONFIGFN") :
""),
1083 if (pidfn && (Slash = rindex(pidfn,
'/')))
1084 {strncpy(manBuff, pidfn, Slash-pidfn); pidP = manBuff+(Slash-pidfn);}
1085 else {strcpy(manBuff, ProtInfo.AdmPath); pidP = manBuff+strlen(ProtInfo.AdmPath);}
1089 snprintf(pidP,
sizeof(manBuff)-(pidP-manBuff),
"/%s.%s.env",
1090 ProtInfo.myProg, ProtInfo.myInst);
1095 if ((envFD =
open(manBuff, O_WRONLY|O_CREAT|O_TRUNC, 0664)) < 0)
1096 {
Log.
Emsg(
"Config", errno,
"create envfile", manBuff);
1102 if (
write(envFD, envBuff, envLen) < 0)
1103 Log.
Emsg(
"Config", errno,
"write to envfile", manBuff);
1111 bool XrdConfig::PidFile(
const char *clpFN,
bool optbg)
1114 char *ppath, buff[32], pidFN[1200];
1115 const char *xop = 0;
1129 {xop =
"create"; snprintf(pidFN,
sizeof(pidFN),
"%s", ppath); errno = rc;}
1130 else {snprintf(pidFN,
sizeof(pidFN),
"%s/%s.pid", ppath, myProg);
1132 if ((xfd =
open(pidFN, O_WRONLY|O_CREAT|O_TRUNC,0644)) < 0)
1134 else {
if (
write(xfd,buff,snprintf(buff,
sizeof(buff),
"%d",
1135 static_cast<int>(getpid()))) < 0) xop =
"write";
1143 if (xop)
Log.
Emsg(
"Config", errno, xop, pidFN);
1151 void XrdConfig::setCFG(
bool start)
1156 if (!ConfigFN || !(*ConfigFN))
1180 if (*ConfigFN !=
'/')
1181 {
char cwdBuff[1024];
1182 if (getcwd(cwdBuff,
sizeof(cwdBuff)-strlen(ConfigFN)-2))
1183 {
int n = strlen(cwdBuff);
1184 if (cwdBuff[n-1] !=
'/') cwdBuff[n++] =
'/';
1185 strcpy(cwdBuff+n, ConfigFN);
1187 ConfigFN = strdup(cwdBuff);
1200 const char *cvec[] = {
"*** ", myProg,
" config from '", ConfigFN,
"':", 0 };
1208 int XrdConfig::setFDL()
1215 if (getrlimit(RLIMIT_NOFILE, &rlim) < 0)
1216 return Log.
Emsg(
"Config", errno,
"get FD limit");
1220 if (rlim.rlim_max == RLIM_INFINITY || (isStrict && rlim.rlim_max > maxFD))
1221 rlim.rlim_cur = maxFD;
1222 else rlim.rlim_cur = rlim.rlim_max;
1223 #if (defined(__APPLE__) && defined(MAC_OS_X_VERSION_10_5))
1224 if (rlim.rlim_cur > OPEN_MAX) rlim.rlim_max = rlim.rlim_cur = OPEN_MAX;
1226 #if defined(__linux__)
1228 unsigned int epoll_max_fd = (INT_MAX /
sizeof(
struct epoll_event));
1229 if (rlim.rlim_cur > (rlim_t)epoll_max_fd) rlim.rlim_max = rlim.rlim_cur = epoll_max_fd;
1231 if (setrlimit(RLIMIT_NOFILE, &rlim) < 0)
1232 return Log.
Emsg(
"Config", errno,
"set FD limit");
1236 if (getrlimit(RLIMIT_NOFILE, &rlim) < 0)
1237 return Log.
Emsg(
"Config", errno,
"get FD limit");
1241 ProtInfo.ConnMax = rlim.rlim_cur;
1242 sprintf(buff,
"%d", ProtInfo.ConnMax);
1243 Log.
Say(
"Config maximum number of connections restricted to ", buff);
1247 #if !defined( __solaris__ ) && defined(RLIMIT_CORE)
1249 {
if (getrlimit(RLIMIT_CORE, &rlim) < 0)
1250 Log.
Emsg(
"Config", errno,
"get core limit");
1251 else {rlim.rlim_cur = (coreV ? rlim.rlim_max : 0);
1252 if (setrlimit(RLIMIT_CORE, &rlim) < 0)
1253 Log.
Emsg(
"Config", errno,
"set core limit");
1260 #if ( defined(__linux__) || defined(__GNU__) || (defined(__FreeBSD_kernel__) && defined(__GLIBC__)) ) && defined(RLIMIT_NPROC)
1264 if (getrlimit(RLIMIT_NPROC, &rlim) < 0)
1265 return Log.
Emsg(
"Config", errno,
"get thread limit");
1269 int nthr =
static_cast<int>(rlim.rlim_cur);
1270 if (nthr < 8192 || ProtInfo.DebugON)
1271 {sprintf(buff,
"%d",
static_cast<int>(rlim.rlim_cur));
1272 Log.
Say(
"Config maximum number of threads restricted to ", buff);
1283 int XrdConfig::Setup(
char *dfltp,
char *libProt)
1286 int xport, protNum = 0;
1290 if (setFDL())
return 1;
1294 #if ( defined(__linux__) || defined(__GNU__) ) && defined(TCP_CORK)
1295 {
int sokFD, setON = 1;
1296 if ((sokFD = socket(PF_INET, SOCK_STREAM, 0)) >= 0)
1298 &setON,
sizeof(setON));
1299 if (setsockopt(sokFD, SOL_TCP, TCP_CORK, &setON,
sizeof(setON)) < 0)
1335 for (
int i = 0; i < cp->
numP; i++)
1338 "configured with a TLS-only port "
1339 "but TLS is not configured!");
1343 xport = (cp->dotls ? PortTLS : PortTCP);
1344 ProtInfo.Port = (cp->port < 0 ? xport : cp->port);
1347 if (cp->port < 0)
return 1;
1348 for (
int i = 1; i < cp->
numP; i++)
1349 if (cp->port == cp->portVec[i]) cp->portVec[i] = -1;
1357 ProtInfo.myName, Firstcp->port,
1358 ProtInfo.myInst, ProtInfo.myProg, mySitName);
1359 ProtInfo.Stats->Export(
theEnv);
1365 xport = (strcmp(
"xroot", Firstcp->proname) ? 0 : Firstcp->port);
1374 while((cp = Firstcp))
1375 {
for (
int i = 0; i < cp->
numP; i++)
1376 {
if (cp->portVec[i] < 0)
continue;
1377 if (!(cp->portVec[i]) && arbNet) theNet = arbNet;
1378 else {theNet = getNet(cp->portVec[i], cp->tlsVec[i]);
1379 if (!theNet)
return 1;
1380 if (!(cp->portVec[i])) arbNet = theNet;
1383 ProtInfo.
Port = theNet->Port();
1384 ProtInfo.NetTCP = theNet;
1385 ProtInfo.WSize = theNet->WSize();
1392 cp->
parms, &ProtInfo,
1394 if (!protNum)
return 1;
1397 if (!strcmp(
"http", cp->
proname) && xport)
1398 {
for (
int i = 0; i < cp->
numP; i++)
1399 {
if (cp->portVec[i] == xport) {xport = 0;
break;}}
1402 Firstcp = cp->
Next;
delete cp;
1414 if (repDest[0] != 0 && (repOpts[0] || repOpts[1]))
1415 ProtInfo.Stats->Init(repDest, repInt, repOpts[0], repOpts[1]);
1426 int XrdConfig::SetupAPath()
1435 else ProtInfo.AdmPath = AdminPath;
1444 {
Log.
Emsg(
"Config", rc,
"create admin path", AdminPath);
1451 if (chmod(AdminPath, AdminMode & ~S_IWGRP))
1452 {
Log.
Emsg(
"Config", errno,
"set permission for admin path", AdminPath);
1460 return ASocket(AdminPath,
"admin", (mode_t)AdminMode);
1467 bool XrdConfig::SetupTLS()
1472 if (!caDir && !caFile && !tlsNoVer)
1474 Log.
Say(
"Config failure: the tlsca directive was not specified!");
1475 else Log.
Say(
"Config failure: the tlsca directive did not specify "
1476 "a certdir or certfile!");
1482 if (caDir && !getenv(
"X509_CERT_DIR"))
1484 if (caFile && !getenv(
"X509_CERT_FILE"))
1505 static XrdTlsContext xrdTLS(tlsCert, tlsKey, caDir, caFile, tlsOpts);
1509 if (!xrdTLS.isOK())
return false;
1521 void XrdConfig::Usage(
int rc)
1527 std::cerr <<
"\nUsage: " <<myProg <<
" [-b] [-c <cfn>] [-d] [-h] [-H] [-I {v4|v6}]\n"
1528 "[-k {n|sz|sig}] [-l [=]<fn>] [-n <name>] [-N <hname>] [-p <port>]\n"
1529 "[-P <prot>] [-L <libprot>] [-R] [-s pidfile] [-S site] [-v] [-z]\n"
1530 "[<protocol_options>]" <<std::endl;
1531 _exit(rc > 0 ? rc : 0);
1554 mode_t mode = S_IRWXU;
1559 if (!pval || !pval[0])
1560 {
eDest->
Emsg(
"Config",
"adminpath not specified");
return 1;}
1565 {
eDest->
Emsg(
"Config",
"adminpath not absolute");
return 1;}
1569 if (AdminPath) free(AdminPath);
1570 AdminPath = strdup(pval);
1574 if ((val =
Config.GetWord()) && val[0])
1575 {
if (!strcmp(
"group", val)) mode |= S_IRWXG;
1576 else {
eDest->
Emsg(
"Config",
"invalid admin path modifier -", val);
1580 AdminMode = ProtInfo.AdmMode = mode;
1604 if (!(val =
Config.GetWord()))
1605 {
eDest->
Emsg(
"Config",
"allow type not specified");
return 1;}
1607 if (!strcmp(val,
"host")) ishost = 1;
1608 else if (!strcmp(val,
"netgroup")) ishost = 0;
1609 else {
eDest->
Emsg(
"Config",
"invalid allow type -", val);
1613 if (!(val =
Config.GetWord()))
1614 {
eDest->
Emsg(
"Config",
"allow target name not specified");
return 1;}
1619 if (ishost) Police->AddHost(val);
1620 else Police->AddNetGroup(val);
1645 {
eDest->
Say(
"Config warning: command line homepath cannot be overridden.");
1652 if (HomePath) {free(HomePath); HomePath = 0;}
1657 return (HomePath ? 0 : 1);
1678 static const long long minBSZ = 1024*1024*2+1;
1679 static const long long maxBSZ = 1024*1024*1024;
1684 if (!(val =
Config.GetWord()))
1685 {
eDest->
Emsg(
"Config",
"buffer memory limit not specified");
return 1;}
1687 if (!strcmp(
"maxbsz", val))
1688 {
if (!(val =
Config.GetWord()))
1689 {
eDest->
Emsg(
"Config",
"max buffer size not specified");
return 1;}
1693 if (!(val =
Config.GetWord()))
return 0;
1697 (
long long)1024*1024))
return 1;
1699 if ((val =
Config.GetWord()))
1725 long long minV = 1024, maxV = 1024LL*1024LL;
1729 if ((val =
Config.GetWord()))
1730 {
if (!strcmp(val,
"strict"))
1733 }
else isStrict =
false;
1737 {
eDest->
Emsg(
"Config",
"file descriptor limit not specified");
return 1;}
1742 maxFD =
static_cast<unsigned int>(fdVal);
1779 int i, n, V_keep = -1, V_nodnr = 0, V_istls = 0, V_blen = -1, V_ct = -1;
1780 int V_assumev4 = -1, v_rpip = -1, V_dyndns = -1, V_udpref = -1;
1782 struct netopts {
const char *opname;
int hasarg;
int opval;
1783 int *oploc;
const char *etxt;}
1786 {
"assumev4", 0, 1, &V_assumev4,
"option"},
1787 {
"keepalive", 0, 1, &V_keep,
"option"},
1788 {
"nokeepalive",0, 0, &V_keep,
"option"},
1789 {
"kaparms", 4, 0, &V_keep,
"option"},
1790 {
"buffsz", 1, 0, &V_blen,
"network buffsz"},
1791 {
"cache", 2, 0, &V_ct,
"cache time"},
1792 {
"dnr", 0, 0, &V_nodnr,
"option"},
1793 {
"nodnr", 0, 1, &V_nodnr,
"option"},
1794 {
"dyndns", 0, 1, &V_dyndns,
"option"},
1795 {
"nodyndns", 0, 0, &V_dyndns,
"option"},
1796 {
"routes", 3, 1, 0,
"routes"},
1797 {
"rpipa", 0, 1, &v_rpip,
"rpipa"},
1798 {
"norpipa", 0, 0, &v_rpip,
"norpipa"},
1799 {
"tls", 0, 1, &V_istls,
"option"},
1800 {
"udprefresh", 2, 1, &V_udpref,
"udprefresh"}
1802 int numopts =
sizeof(ntopts)/
sizeof(
struct netopts);
1804 if (!(val =
Config.GetWord()))
1805 {
eDest->
Emsg(
"Config",
"net option not specified");
return 1;}
1808 {
for (i = 0; i < numopts; i++)
1809 if (!strcmp(val, ntopts[i].opname))
1810 {
if (!ntopts[i].hasarg) *ntopts[i].oploc = ntopts[i].opval;
1811 else {
if (!(val =
Config.GetWord()))
1813 ntopts[i].opname,
"argument missing");
1816 if (ntopts[i].hasarg == 4)
1817 {
if (xnkap(
eDest, val))
return 1;
1820 if (ntopts[i].hasarg == 3)
1821 {
if (!strcmp(val,
"split"))
1823 else if (!strcmp(val,
"common"))
1825 else if (!strcmp(val,
"local"))
1827 else {
eDest->
Emsg(
"Config",
"Invalid routes argument -",val);
1830 if (!(val =
Config.GetWord())|| !(*val))
break;
1831 if (strcmp(val,
"use"))
continue;
1832 if (!(val =
Config.GetWord())|| !(*val))
1833 {
eDest->
Emsg(
"Config",
"network routes i/f names "
1841 if (ntopts[i].hasarg == 2)
1844 *ntopts[i].oploc = n;
1848 *ntopts[i].oploc = (int)llp;
1854 eDest->
Say(
"Config warning: ignoring invalid net option '",val,
"'.");
1855 else if (!val)
break;
1860 {
if (V_blen >= 0) TLS_Blen = V_blen;
1864 if (V_blen >= 0) Net_Blen = V_blen;
1872 {
if (V_dyndns && V_ct < 0) V_ct = 0;
1908 if ((comma = index(val,
','))) {val = comma+1; *comma = 0;}
1915 if (!(karg = val))
return 0;
1916 if ((comma = index(val,
','))) {val = comma+1; *comma = 0;}
1952 if (!val || !val[0])
1953 {
eDest->
Emsg(
"Config",
"pidpath not specified");
return 1;}
1957 if (PidPath) free(PidPath);
1958 PidPath = strdup(val);
1979 {
int rc, istls = 0, pnum = 0;
1980 char *val, cport[32];
1982 do {
if (!(val =
Config.GetWord()))
1983 {
eDest->
Emsg(
"Config",
"tcp port not specified");
return 1;}
1984 if (strcmp(
"tls", val) || istls)
break;
1988 strncpy(cport, val,
sizeof(cport)-1); cport[
sizeof(cport)-1] =
'\0';
1990 if ((val =
Config.GetWord()) && !strcmp(
"if", val))
1992 ProtInfo.myInst, myProg)) <= 0)
1993 {
if (!rc)
Config.noEcho();
return (rc < 0);}
1996 if (istls) PortTLS = pnum;
1997 else PortTCP = PortUDP = pnum;
2024 char *val, *parms, *lib, proname[64], buff[2048];
2028 do {
if (!(val =
Config.GetWord()))
2029 {
eDest->
Emsg(
"Config",
"protocol name not specified");
return 1;}
2030 if (dotls || strcmp(
"tls", val))
break;
2034 if (strlen(val) >
sizeof(proname)-1)
2035 {
eDest->
Emsg(
"Config",
"protocol name is too long");
return 1;}
2036 strcpy(proname, val);
2038 if ((val = index(proname,
':')))
2043 if (!(val =
Config.GetWord()))
2044 {
eDest->
Emsg(
"Config",
"protocol library not specified");
return 1;}
2045 if (!strcmp(
"*", val)) lib = 0;
2046 else if (*val ==
'+')
2047 {
if (strcmp(val,
"+port"))
2048 {
eDest->
Emsg(
"Config",
"invalid library specification -",val);
2051 if ((cpp = Firstcp))
2052 do {
if (!strcmp(proname, cpp->
proname))
2053 {
if (cpp->
AddPort(portnum, dotls))
return 0;
2054 eDest->
Emsg(
"Config",
"port add limit exceeded!");
2057 }
while((cpp = cpp->
Next));
2058 eDest->
Emsg(
"Config",
"protocol",proname,
"not previously defined!");
2061 else lib = strdup(val);
2066 if (!lib && Firstcp && strcmp(proname, Firstcp->proname))
2068 snprintf(eBuff,
sizeof(eBuff),
"the %s protocol is '%s' not '%s'; "
2069 "assuming you meant '%s'",
2070 (Firstcp->libpath ?
"assigned" :
"builtin"),
2071 Firstcp->proname, proname, Firstcp->proname);
2072 eDest->
Say(
"Config warning: ", eBuff,
" but please correct "
2073 "the following directive!");
2074 snprintf(proname,
sizeof(proname),
"%s", Firstcp->proname);
2078 if (!
Config.GetRest(buff,
sizeof(buff)))
2079 {
eDest->
Emsg(
"Config",
"Too many parms for protocol", proname);
2082 parms = (*buff ? strdup(buff) : 0);
2084 if ((cpp = Firstcp))
2085 do {
if (!strcmp(proname, cpp->
proname))
2086 {cpp->
Reset(lib, parms, portnum, dotls);
2089 }
while((cpp = cpp->
Next));
2091 cpp =
new XrdConfigProt(strdup(proname), lib, parms, portnum, dotls);
2092 if (!lib) {cpp->
Next = Firstcp; Firstcp = cpp;
2093 if (!Lastcp) Lastcp = cpp;
2095 else {
if (Lastcp) Lastcp->
Next = cpp;
2125 static struct repopts {
const char *opname;
int opval;
bool jOK;} rpopts[] =
2142 int i, neg, numopts =
sizeof(rpopts)/
sizeof(
struct repopts);
2146 if (!(val =
Config.GetWord()))
2147 {
eDest->
Emsg(
"Config",
"report parameters not specified");
return 1;}
2151 if (repDest[0]) {free(repDest[0]); repDest[0] = 0;}
2152 if (repDest[1]) {free(repDest[1]); repDest[1] = 0;}
2153 repOpts[0] = 0; repOpts[1] = 0;
2158 if ((cp = (
char *)index(val,
',')))
2160 {
eDest->
Emsg(
"Config",
"malformed report destination -",val);
return 1;}
2161 else { repDest[1] = cp+1; *cp =
'\0';}
2164 for (i = 0; i < 2; i++)
2165 {
if (!(val = repDest[i]))
break;
2166 if (*val !=
'/' && (!(cp = index(val, (
int)
':')) || !atoi(cp+1)))
2167 {
eDest->
Emsg(
"Config",
"report dest port missing or invalid in",val);
2170 repDest[i] = strdup(val);
2175 if (repDest[0] && repDest[1] && !strcmp(repDest[0], repDest[1]))
2176 {
eDest->
Emsg(
"Config",
"Warning, report dests are identical.");
2177 free(repDest[1]); repDest[1] = 0;
2182 if (!(val =
Config.GetWord()))
2187 if (!strcmp(
"every", val))
2188 {
if (!(val =
Config.GetWord()))
2189 {
eDest->
Emsg(
"Config",
"report every value not specified");
return 1;}
2197 {
if (!strcmp(val,
"json"))
2199 val =
Config.GetWord();
continue;
2201 if (!strcmp(val,
"off"))
2202 {repOpts[isJSON] = 0;
2203 val =
Config.GetWord();
continue;
2205 if ((neg = (val[0] ==
'-' && val[1]))) val++;
2206 for (i = 0; i < numopts; i++)
2207 {
if (!strcmp(val, rpopts[i].opname))
2208 {
if (neg) repOpts[isJSON] &= ~rpopts[i].opval;
2209 else {
if (isJSON && !rpopts[i].jOK)
2210 {
eDest->
Emsg(
"Config",val,
"does not support JSON");
2213 repOpts[isJSON] |= rpopts[i].opval;
2219 eDest->
Say(
"Config warning: ignoring invalid report option '",val,
"'.");
2279 int V_mint = -1, V_maxt = -1, V_idle = -1, V_avlt = -1;
2280 struct schedopts {
const char *opname;
int minv;
int *oploc;
2281 const char *opmsg;} scopts[] =
2283 {
"stksz", 0, 0,
"sched stksz"},
2284 {
"mint", 1, &V_mint,
"sched mint"},
2285 {
"maxt", 1, &V_maxt,
"sched maxt"},
2286 {
"avlt", 1, &V_avlt,
"sched avlt"},
2287 {
"core", 1, 0,
"sched core"},
2288 {
"idle", 0, &V_idle,
"sched idle"}
2290 int numopts =
sizeof(scopts)/
sizeof(
struct schedopts);
2292 if (!(val =
Config.GetWord()))
2293 {
eDest->
Emsg(
"Config",
"sched option not specified");
return 1;}
2296 {
for (i = 0; i < numopts; i++)
2297 if (!strcmp(val, scopts[i].opname))
2298 {
if (!(val =
Config.GetWord()))
2299 {
eDest->
Emsg(
"Config",
"sched", scopts[i].opname,
2300 "value not specified");
2303 if (*scopts[i].opname ==
'i')
2305 &ppp, scopts[i].minv))
return 1;
2307 else if (*scopts[i].opname ==
'c')
2308 {
if (!strcmp(
"asis", val)) coreV = -1;
2309 else if (!strcmp(
"max", val)) coreV = 1;
2310 else if (!strcmp(
"off", val)) coreV = 0;
2311 else {
eDest->
Emsg(
"Config",
"invalid sched core value -",val);
2315 else if (*scopts[i].opname ==
's')
2317 &lpp, scopts[i].minv))
return 1;
2322 &ppp,scopts[i].minv))
return 1;
2323 *scopts[i].oploc = ppp;
2327 eDest->
Say(
"Config warning: ignoring invalid sched option '",val,
"'.");
2334 {
if (V_mint > 0 && V_mint > V_maxt)
2335 {
eDest->
Emsg(
"Config",
"sched mint must be less than maxt");
2338 if (V_avlt > 0 && V_avlt > V_maxt)
2339 {
eDest->
Emsg(
"Config",
"sched avlt must be less than maxt");
2369 if (!(val =
Config.GetWord()))
2370 {
eDest->
Emsg(
"Config",
"sitename value not specified");
return 1;}
2372 if (mySitName)
eDest->
Emsg(
"Config",
"sitename already specified, using '",
2395 char *val, parms[2048];
2400 if ((val =
Config.GetWord()))
2401 {
if (!strcmp(val,
"++"))
2410 {
eDest->
Emsg(
"Config",
"tcpmonlib not specified");
return 1;}
2415 {
eDest->
Emsg(
"Config",
"tcpmonlib path is not absolute");
return 1;}
2423 if (!
Config.GetRest(parms,
sizeof(parms)))
2424 {
eDest->
Emsg(
"Config",
"tcpmonlib parameters too long");
return 1;}
2432 tmoInfo->KingPin.Add(path.c_str(), (*parms ? parms : 0), push);
2461 if (!(val =
Config.GetWord()))
2462 {
eDest->
Emsg(
"Config",
"tls cert path not specified");
return 1;}
2465 {
eDest->
Emsg(
"Config",
"tls cert path not absolute");
return 1;}
2467 if (tlsCert) free(tlsCert);
2468 tlsCert = strdup(val);
2469 if (tlsKey) free(tlsKey);
2472 if (!(val =
Config.GetWord()))
return 0;
2474 if (*val ==
'/' || !strncmp(val,
"pkcs11:", 7))
2475 {tlsKey = strdup(val);
2476 if (!(val =
Config.GetWord()))
return 0;
2479 do {
if (!strcmp(val,
"detail")) SSLmsgs =
true;
2480 else if (!strcmp(val,
"nodetail")) SSLmsgs =
false;
2481 else if (!strcmp(val,
"hsto" ))
2482 {
if (!(val =
Config.GetWord()))
2483 {
eDest->
Emsg(
"Config",
"tls hsto value not specified");
2490 else {
eDest->
Emsg(
"Config",
"invalid tls option -",val);
return 1;}
2491 }
while ((val =
Config.GetWord()));
2528 char *val, **cadest, kword[16];
2532 if (!(val =
Config.GetWord()))
2533 {
eDest->
Emsg(
"Config",
"tlsca parameter not specified");
return 1;}
2536 if (!strcmp(val,
"noverify"))
2538 if (caDir) {free(caDir); caDir = 0;}
2539 if (caFile) {free(caFile); caFile = 0;}
2545 do {
if (!strcmp(val,
"proxies") || !strcmp(
"noproxies", val))
2551 if (strlen(val) >= (
int)
sizeof(kword))
2552 {
eDest->
Emsg(
"Config",
"Invalid tlsca parameter -", val);
2557 if (!(val =
Config.GetWord()))
2558 {
eDest->
Emsg(
"Config",
"tlsca", kword,
"value not specified");
2561 if ((isdir = !strcmp(kword,
"certdir"))
2562 || !strcmp(kword,
"certfile"))
2564 {
eDest->
Emsg(
"Config",
"tlsca",kword,
"path is not absolute.");
2567 cadest = (isdir ? &caDir : &caFile);
2568 if (*cadest) free(*cadest);
2569 *cadest = strdup(val);
2571 else if (!strcmp(kword,
"crlcheck"))
2575 else if ( strcmp(val,
"external"))
2576 {
eDest->
Emsg(
"Config",
"Invalid tlsca crlcheck "
2581 else if (!strcmp(kword,
"log"))
2582 {
if (!strcmp(val,
"off"))
2584 else if (!strcmp(val,
"failure"))
2586 else {
eDest->
Emsg(
"Config",
"Invalid tlsca log argument -",val);
2590 else if (!strcmp(kword,
"refresh"))
2593 if (rt < 60) rt = 60;
2594 else if (rt % 60) rt += 60;
2598 else if (!strcmp(kword,
"verdepth"))
2603 else {
eDest->
Emsg(
"Config",
"invalid tlsca option -",kword);
return 1;}
2605 }
while((val =
Config.GetWord()));
2625 char *val, *ciphers;
2627 if (!(val =
Config.GetWord()))
2628 {
eDest->
Emsg(
"Config",
"tlsciphers parameter not specified");
return 1;}
2630 ciphers = strdup(val);
2632 if ((val =
Config.GetWord()))
2633 {
eDest->
Emsg(
"Config",
"Invalid tlsciphers argument -",val);
2667 int V_read = -1, V_idle = -1, V_hail = -1, V_kill = -1;
2668 struct tmoopts {
const char *opname;
int istime;
int minv;
2669 int *oploc;
const char *etxt;}
2672 {
"read", 1, 1, &V_read,
"timeout read"},
2673 {
"hail", 1, 1, &V_hail,
"timeout hail"},
2674 {
"idle", 1, 0, &V_idle,
"timeout idle"},
2675 {
"kill", 1, 0, &V_kill,
"timeout kill"}
2677 int numopts =
sizeof(tmopts)/
sizeof(
struct tmoopts);
2679 if (!(val =
Config.GetWord()))
2680 {
eDest->
Emsg(
"Config",
"timeout option not specified");
return 1;}
2683 {
for (i = 0; i < numopts; i++)
2684 if (!strcmp(val, tmopts[i].opname))
2685 {
if (!(val =
Config.GetWord()))
2686 {
eDest->
Emsg(
"Config",
"timeout", tmopts[i].opname,
2687 "value not specified");
2690 rc = (tmopts[i].istime ?
2696 *tmopts[i].oploc = ppp;
2700 eDest->
Say(
"Config warning: ignoring invalid timeout option '",val,
"'.");
2706 if (V_read > 0) ProtInfo.readWait = V_read*1000;
2707 if (V_hail >= 0) ProtInfo.hailWait = V_hail*1000;
2708 if (V_idle >= 0) ProtInfo.idleWait = V_idle;
2730 static struct traceopts {
const char *opname;
int opval;} tropts[] =
2747 int i, neg, trval = 0, numopts =
sizeof(tropts)/
sizeof(
struct traceopts);
2749 if (!(val =
Config.GetWord()))
2750 {
eDest->
Emsg(
"Config",
"trace option not specified");
return 1;}
2752 {
if (!strcmp(val,
"off")) trval = 0;
2753 else {
if ((neg = (val[0] ==
'-' && val[1]))) val++;
2754 for (i = 0; i < numopts; i++)
2755 {
if (!strcmp(val, tropts[i].opname))
2757 if (tropts[i].opval) trval &= ~tropts[i].opval;
2759 else if (tropts[i].opval) trval |= tropts[i].opval;
2765 eDest->
Say(
"Config warning: ignoring invalid trace option '",val,
"'.");
void Usage(const char *msg)
static XrdSysError eDest(0,"crypto_")
ssize_t write(int fildes, const void *buf, size_t nbyte)
#define TLS_SET_VDEPTH(cOpts, vdv)
#define TLS_SET_HSTO(cOpts, hstv)
#define TLS_SET_REFINT(cOpts, refi)
void Set(int maxmem=-1, int minw=-1)
void Reset(char *ln, char *pp, int np=-1, bool to=false)
XrdConfigProt(char *pn, char *ln, char *pp, int np=-1, bool to=false)
bool AddPort(int pnum, bool isTLS)
int ConfigXeq(char *var, XrdOucStream &Config, XrdSysError *eDest=0)
int Configure(int argc, char **argv)
int BindSD(int port, const char *contype="tcp")
static void SetAssumeV4(bool newVal)
static int Setup(int maxfds, int idlewt)
static void setKWT(int wkSec, int kwSec)
const sockaddr * SockAddr()
const char * Name(const char *eName=0, const char **eText=0)
static void SetCache(int keeptime)
static void SetDynDNS(bool onoff)
static void SetRPIPA(bool rval)
static int GetIF(XrdOucTList **ifList, const char **eText=0)
static void Routing(netType nettype)
static void SetMsgs(XrdSysError *erp)
static bool SetIFNames(char *ifnames)
static void SetFQN(const char *fqn)
static void Start(XrdSysLogger *logP, XrdScheduler *sP)
static int ProtoID(const char *pName)
static int ServPort(const char *sName, bool isUDP=false, const char **eText=0)
void setDomain(const char *dname)
void setDefaults(int options, int buffsz=0)
void PutInt(const char *varname, long value)
static int Export(const char *Var, const char *Val)
void * GetPtr(const char *varname)
void PutPtr(const char *varname, void *value)
void Put(const char *varname, const char *value)
static bool configLog(XrdSysError &eDest, configLogInfo &logInfo)
static const char * Set(const char *name, int maxlen=15)
static XrdOucString * Capture()
const char * c_str() const
static char * parseHome(XrdSysError &eDest, XrdOucStream &Config, int &mode)
static const mode_t pathMode
static char * genPath(const char *path, const char *inst, const char *psfx=0)
static int ReLink(const char *path, const char *target, mode_t mode=0)
static const char * InstName(int TranOpt=0)
static int doIf(XrdSysError *eDest, XrdOucStream &Config, const char *what, const char *hname, const char *nname, const char *pname)
static int makePath(char *path, mode_t mode, bool reset=false)
static bool PidFile(XrdSysError &eDest, const char *path)
static void makeHome(XrdSysError &eDest, const char *inst)
static void Undercover(XrdSysError &eDest, int noLog, int *pipeFD=0)
static int a2i(XrdSysError &, const char *emsg, const char *item, int *val, int minv=-1, int maxv=-1)
static int a2sz(XrdSysError &, const char *emsg, const char *item, long long *val, long long minv=-1, long long maxv=-1)
static int a2tm(XrdSysError &, const char *emsg, const char *item, int *val, int minv=-1, int maxv=-1)
static int a2p(XrdSysError &, const char *ptype, const char *val, bool anyOK=true)
static int Setup(int numfd)
static const int PortoMax
static int Port(const char *lname, const char *pname, char *parms, XrdProtocol_Config *pi)
static int Load(const char *lname, const char *pname, char *parms, XrdProtocol_Config *pi, bool istls)
int Stats(char *buff, int blen, int do_sync=0)
void setParms(int minw, int maxw, int avlt, int maxi, int once=0)
void setNproc(const bool limlower)
int Emsg(const char *esfx, int ecode, const char *text1, const char *text2=0)
void Say(const char *text1, const char *text2=0, const char *txt3=0, const char *text4=0, const char *text5=0, const char *txt6=0)
XrdSysLogger * logger(XrdSysLogger *lp=0)
void AddMsg(const char *msg)
int ParseKeep(const char *arg)
static void setDebug(XrdSysError *erp)
static void setStackSize(size_t stsz, bool force=false)
static int FmtUname(char *buff, int blen)
XrdOucPinKing< XrdTcpMonPin > KingPin
XrdTcpMonInfo(const char *drctv, const char *cfn, XrdSysError &errR)
static const int crlRS
Bits to shift vdept.
static void SetDefaultCiphers(const char *ciphers)
static const uint64_t servr
This is a server context.
static const uint64_t nopxy
Do not allow proxy certs.
static const uint64_t logVF
Log verify failures.
static const uint64_t crlFC
Full crl chain checking.
static const uint64_t crlON
Enables crl checking.
static const uint64_t crlRF
Mask to isolate crl refresh in min.
static void SetMsgCB(msgCB_t cbP)
static const int dbgSIO
Turn debugging in for socket I/O.
static const int dbgSOK
Turn debugging in for socket operations.
static const int dbgALL
Turn debugging for everything.
static const int dbgCTX
Turn debugging in for context operations.
static void SetDebug(int opts, XrdSysLogger *logP=0)
XrdVERSIONINFODEF(myVersion, cmsclient, XrdVNUMBER, XrdVERSION)
XrdNetRefresh * NetRefresh
static INT to(const char *buffer)