XRootD
Loading...
Searching...
No Matches
XrdConfig Class Reference

#include <XrdConfig.hh>

+ Collaboration diagram for XrdConfig:

Public Member Functions

 XrdConfig ()
 
 ~XrdConfig ()
 
int Configure (int argc, char **argv)
 
int ConfigXeq (char *var, XrdOucStream &Config, XrdSysError *eDest=0)
 

Public Attributes

XrdInetNetADM
 
std::vector< XrdInet * > NetTCP
 
XrdProtocol_Config ProtInfo
 

Detailed Description

Definition at line 48 of file XrdConfig.hh.

Constructor & Destructor Documentation

◆ XrdConfig()

XrdConfig::XrdConfig ( )

Definition at line 249 of file XrdConfig.cc.

250{
251
252// Preset all variables with common defaults
253//
254 PortTCP = -1;
255 PortUDP = -1;
256 PortTLS = -1;
257 ConfigFN = 0;
258 tmoInfo = 0;
259 myInsName= 0;
260 mySitName= 0;
261 AdminPath= strdup("/tmp");
262 HomePath = 0;
263 PidPath = strdup("/tmp");
264 tlsCert = 0;
265 tlsKey = 0;
266 caDir = 0;
267 caFile = 0;
268 AdminMode= S_IRWXU;
269 HomeMode = S_IRWXU;
270 Police = 0;
271 Net_Opts = XRDNET_KEEPALIVE;
272 TLS_Blen = 0; // Accept OS default (leave Linux autotune in effect)
273 TLS_Opts = XRDNET_KEEPALIVE | XRDNET_USETLS;
274 repDest[0] = 0;
275 repDest[1] = 0;
276 repInt = 600;
277 ppNet = 0;
279 tlsNoVer = false;
280 tlsNoCAD = true;
281 NetADM = 0;
282 coreV = 1;
283 Specs = 0;
284 isStrict = false;
285 maxFD = 256*1024; // 256K default
286
287 Firstcp = Lastcp = 0;
288
289 ProtInfo.eDest = &Log; // Stable -> Error Message/Logging Handler
290 ProtInfo.NetTCP = 0; // Stable -> Network Object
291 ProtInfo.BPool = &BuffPool; // Stable -> Buffer Pool Manager
292 ProtInfo.Sched = &Sched; // Stable -> System Scheduler
293 ProtInfo.ConfigFN= 0; // We will fill this in later
294 ProtInfo.Stats = 0; // We will fill this in later
295 ProtInfo.AdmPath = AdminPath; // Stable -> The admin path
296 ProtInfo.AdmMode = AdminMode; // Stable -> The admin path mode
297 ProtInfo.theEnv = &theEnv; // Additional information
298 ProtInfo.xrdFlags= 0; // Additional information
299
300 ProtInfo.Format = XrdFORMATB;
301 memset(ProtInfo.rsvd3, 0, sizeof(ProtInfo.rsvd3));
302 ProtInfo.WSize = 0;
303 ProtInfo.ConnMax = -1; // Max connections (fd limit)
304 ProtInfo.readWait = 3*1000; // Wait time for data before we reschedule
305 ProtInfo.idleWait = 0; // Seconds connection may remain idle (0=off)
306 ProtInfo.hailWait =30*1000; // Wait time for data before we drop connection
307 ProtInfo.DebugON = 0; // 1 if started with -d
308 ProtInfo.argc = 0;
309 ProtInfo.argv = 0;
310 ProtInfo.tlsPort = 0;
311 ProtInfo.tlsCtx = 0;
312 ProtInfo.totalCF = &totalCF;
313
314 XrdNetAddr::SetCache(3*60*60); // Cache address resolutions for 3 hours
315
316 // This may reset the NPROC resource limit, which is done here as we
317 // expect to be operating as a daemon. We set the argument limlower=true
318 // to potentially set a more restrictive limit than the current one.
319 Sched.setNproc(true);
320}
#define XrdFORMATB
Definition XrdInfo.hh:36
#define XRDNET_KEEPALIVE
Definition XrdNetOpts.hh:63
#define XRDNET_USETLS
Definition XrdNetOpts.hh:91
XrdProtocol_Config ProtInfo
Definition XrdConfig.hh:59
XrdInet * NetADM
Definition XrdConfig.hh:60
static void SetCache(int keeptime)
void setNproc(const bool limlower)
static const uint64_t servr
This is a server context.
static const uint64_t logVF
Log verify failures.
XrdOucEnv theEnv
XrdSysError Log
Definition XrdConfig.cc:113
XrdScheduler Sched
Definition XrdLinkCtl.cc:54
XrdOucString totalCF
Definition XrdConfig.cc:111
XrdBuffManager BuffPool
Definition XrdGlobals.cc:51

References XrdGlobal::BuffPool, XrdGlobal::Log, XrdTlsContext::logVF, NetADM, ProtInfo, XrdGlobal::Sched, XrdTlsContext::servr, XrdNetAddr::SetCache(), XrdGlobal::totalCF, XrdFORMATB, XRDNET_KEEPALIVE, and XRDNET_USETLS.

+ Here is the call graph for this function:

◆ ~XrdConfig()

XrdConfig::~XrdConfig ( )
inline

Definition at line 57 of file XrdConfig.hh.

57{}

Member Function Documentation

◆ Configure()

int XrdConfig::Configure ( int argc,
char ** argv )

Definition at line 326 of file XrdConfig.cc.

327{
328/*
329 Function: Establish configuration at start up time.
330
331 Input: None.
332
333 Output: 0 upon success or !0 otherwise.
334*/
335 const char *xrdInst="XRDINSTANCE=";
336
337 int retc, NoGo = 0, clPort = -1;
338 const char *temp;
339 char c, buff[512], *dfltProt, *libProt = 0;
340 uid_t myUid = 0;
341 gid_t myGid = 0;
342 extern char *optarg;
343 extern int optind, opterr;
344 struct XrdOucLogging::configLogInfo LogInfo;
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;
350 char *ifList = 0;
351 int myArgc = 1, urArgc = argc, i;
352 bool noV6, ipV4 = false, ipV6 = false, rootChk = true, optbg = false;
353
354// Reconstruct the command line so we can put it in the log
355//
356 XrdOucString CmdLine(argv[0]);
357 for (int k = 1; k < argc; k++)
358 {CmdLine += ' '; CmdLine += argv[k];}
359
360// Obtain the program name we will be using
361//
362 retc = strlen(argv[0]);
363 while(retc--) if (argv[0][retc] == '/') break;
364 myProg = &argv[0][retc+1];
365
366// Setup the initial required protocol. The program name matches the protocol
367// name but may be arbitrarily suffixed. We need to ignore this suffix. So we
368// look for it here and it it exists we duplicate argv[0] (yes, loosing some
369// bytes - sorry valgrind) without the suffix.
370//
371 {char *p = dfltProt = strdup(myProg);
372 while(*p && (*p == '.' || *p == '-')) p++;
373 if (*p)
374 {char *dot = index(p, '.'), *dash = index(p, '-');
375 if (dot && (dot < dash || !dash)) p = dot;
376 else if (dash) p = dash;
377 else p = 0;
378 if (p) *p = '\0';
379 if (!strcmp("xrootd", dfltProt)) dfltProt[5] = 0;
380 else if (!strcmp("cmsd", dfltProt)) dfltProt[3] = 0;
381 }
382 }
383 myArgv[0] = argv[0];
384
385// Prescan the argument list to see if there is a passthrough option. In any
386// case, we will set the ephemeral argv/arg in the environment.
387//
388 i = 1;
389 while(i < argc)
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];
397 urArgv[0] = argv[0];
398 i++;
399 while(i < j) urArgv[k++] = argv[i++];
400 urArgv[k] = 0;
401 theEnv.PutPtr(buff, urArgv);
402 strcpy(&(buff[n]), ".argc");
403 theEnv.PutInt(buff, static_cast<long>(k));
404 } else i++;
405 }
406 theEnv.PutPtr("argv[0]", argv[0]);
407
408// Process the options. Note that we cannot passthrough long options or
409// options that take arguments because getopt permutes the arguments.
410//
411 opterr = 0;
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))
415 { switch(c)
416 {
417 case 'a': if (AdminPath) free(AdminPath);
418 AdminPath = strdup(optarg);
419 AdminMode = ProtInfo.AdmMode = S_IRWXU;
421 break;
422 case 'A': if (AdminPath) free(AdminPath);
423 AdminPath = strdup(optarg);
424 AdminMode = ProtInfo.AdmMode = S_IRWXU | S_IRWXG;
426 break;
427 case 'b': optbg = true;
428 break;
429 case 'c': if (ConfigFN) free(ConfigFN);
430 ConfigFN = strdup(optarg);
431 break;
432 case 'd': XrdTrace.What |= TRACE_ALL;
433 ProtInfo.DebugON = 1;
434 XrdOucEnv::Export("XRDDEBUG", "1");
435 break;
436 case 'h': Usage(0);
437 break;
438 case 'H': Usage(-1);
439 break;
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);
443 Usage(1);
444 }
445 break;
446 case 'k': if (!(LogInfo.keepV = Log.logger()->ParseKeep(optarg)))
447 {Log.Emsg("Config","Invalid -k argument -",optarg);
448 Usage(1);
449 }
450 break;
451 case 'l': LogInfo.logArg = optarg;
452 break;
453 case 'L': if (!*optarg)
454 {Log.Emsg("Config", "Protocol library path not specified.");
455 Usage(1);
456 }
457 if (libProt) free(libProt);
458 libProt = strdup(optarg);
459 break;
460 case 'n': myInsName = (!strcmp(optarg,"anon")||!strcmp(optarg,"default")
461 ? 0 : optarg);
462 break;
463 case 'N': XrdNetIdentity::SetFQN(optarg);
464 break;
465 case 'p': if ((clPort = XrdOuca2x::a2p(Log,"tcp",optarg)) < 0) Usage(1);
466 break;
467 case 'P': if (dfltProt) free(dfltProt);
468 dfltProt = strdup(optarg);
469 break;
470 case 'R': if (!(getUG(optarg, myUid, myGid))) Usage(1);
471 rootChk = false;
472 break;
473 case 's': pidFN = optarg;
474 break;
475 case 'S': mySitName = optarg;
476 break;
477 case ':': buff[0] = '-'; buff[1] = optopt; buff[2] = 0;
478 Log.Emsg("Config", buff, "parameter not specified.");
479 Usage(1);
480 break;
481 case 'v': std::cerr <<XrdVSTRING <<std::endl;
482 _exit(0);
483 break;
484 case 'w': if (HomePath) free(HomePath);
485 HomePath = strdup(optarg);
486 HomeMode = S_IRWXU;
487 Specs |= hpSpec;
488 break;
489 case 'W': if (HomePath) free(HomePath);
490 HomePath = strdup(optarg);
491 HomeMode = S_IRWXU | S_IRGRP | S_IXGRP;
492 Specs |= hpSpec;
493 break;
494 case 'z': LogInfo.hiRes = true;
495 break;
496
497 default: if (optopt == '-' && *(argv[optind]+1) == '-')
498 {Log.Emsg("Config", "Long options are not supported.");
499 Usage(1);
500 }
501 if (myArgc >= myMaxc || argbP >= argbE)
502 {Log.Emsg("Config", "Too many command line arguments.");
503 Usage(1);
504 }
505 myArgv[myArgc++] = argbP;
506 *argbP++ = '-'; *argbP++ = optopt; *argbP++ = 0;
507 break;
508 }
509 }
510
511// If an adminpath specified, make sure it's absolute
512//
513 if ((ProtInfo.xrdFlags & XrdProtocol_Config::admPSet) && *AdminPath != '/')
514 {Log.Emsg("Config", "Command line adminpath is not absolute.");
515 exit(17);
516 }
517
518// If an homepath specified, make sure it's absolute
519//
520 if (HomePath && *HomePath != '/')
521 {Log.Emsg("Config", "Command line home path is not absolute.");
522 exit(17);
523 }
524
525// If the configuration file is relative to where we are, get the absolute
526// path as we may be changing the home path. This also starts capturing.
527//
528 if (ConfigFN) setCFG(true);
529
530// The first thing we must do is to set the correct networking mode
531//
532 noV6 = XrdNetAddr::IPV4Set();
533 if (ipV4) XrdNetAddr::SetIPV4();
534 else if (ipV6){if (noV6) Log.Say("Config warning: ipV6 appears to be broken;"
535 " forced ipV6 mode not advised!");
537 }
538 else if (noV6) Log.Say("Config warning: ipV6 is misconfigured or "
539 "unavailable; reverting to ipV4.");
540
541// Set the site name if we have one
542//
543 if (mySitName) mySitName = XrdOucSiteName::Set(mySitName, 63);
544
545// Drop into non-privileged state if so requested
546//
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);}
551
552// Prohibit this program from executing as superuser unless -R was specified.
553//
554 if (rootChk && geteuid() == 0)
555 {Log.Emsg("Config", "Security reasons prohibit running as "
556 "superuser; program is terminating.");
557 _exit(8);
558 }
559
560// Pass over any parameters
561//
562 if (urArgc-optind+2 >= myMaxc)
563 {Log.Emsg("Config", "Too many command line arguments.");
564 Usage(1);
565 }
566 for ( ; optind < urArgc; optind++) myArgv[myArgc++] = argv[optind];
567
568// Record the actual arguments that we will pass on
569//
570 myArgv[myArgc] = 0;
571 ProtInfo.argc = myArgc;
572 ProtInfo.argv = myArgv;
573
574// Resolve background/foreground issues
575//
576 if (optbg)
577 {
578#ifdef WIN32
579 XrdOucUtils::Undercover(&Log, !LogInfo.logArg);
580#else
581 if (pipe( pipeFD ) == -1)
582 {Log.Emsg("Config", errno, "create a pipe"); exit(17);}
583 XrdOucUtils::Undercover(Log, !LogInfo.logArg, pipeFD);
584#endif
585 }
586
587// Get the full host name. We must define myIPAddr here because we may need to
588// run in v4 mode and that doesn't get set until after the options are scanned.
589//
590 static XrdNetAddr *myIPAddr = new XrdNetAddr((int)0);
591 auto envName = getenv("XRDHOST");
592 const char *ipAddrName;
593 if (envName) {
594 myName = envName;
595 XrdOucEnv::Export("OVERRIDEXRDHOST", myName.c_str());
596 } else if ((ipAddrName = myIPAddr->Name(0, &temp))) {
597 myName = ipAddrName;
598 } else {
599 myName = "";
600 }
601
602// Get our IP address and FQN
603//
604 ProtInfo.myName = myName.c_str();
605 ProtInfo.myAddr = myIPAddr->SockAddr();
606 ProtInfo.myInst = XrdOucUtils::InstName(myInsName);
607 ProtInfo.myProg = myProg;
608
609// Set the Environmental variable to hold the instance name
610// XRDINSTANCE=<pgm> <instance name>@<host name>
611// XrdOucEnv::Export("XRDINSTANCE")
612//
613 sprintf(buff,"%s%s %s@%s", xrdInst, myProg, ProtInfo.myInst, myName.c_str());
614 myInstance = strdup(buff);
615 putenv(myInstance); // XrdOucEnv::Export("XRDINSTANCE",...)
616 myInstance += strlen(xrdInst);
617 XrdOucEnv::Export("XRDHOST", myName.c_str());
618 XrdOucEnv::Export("XRDNAME", ProtInfo.myInst);
619 XrdOucEnv::Export("XRDPROG", myProg);
620
621// Bind the log file if we have one
622//
623 if (LogInfo.logArg)
624 {LogInfo.xrdEnv = &theEnv;
625 LogInfo.iName = myInsName;
626 LogInfo.cfgFn = ConfigFN;
627 if (!XrdOucLogging::configLog(Log, LogInfo)) _exit(16);
628 Log.logger()->AddMsg(CmdLine.c_str());
630 }
631
632// We now test for host name. In theory, we should always get some kind of name.
633// We can't really continue without some kind of name at this point. Note that
634// vriable temp should still be valid from the previous NetAddr call.
635//
636 if (myName.empty())
637 {Log.Emsg("Config", "Unable to determine host name; ",
638 (temp ? temp : "reason unknown"),
639 "; execution terminated.");
640 _exit(16);
641 }
642
643// Tell NetIF what logger to use as it's been properly setup by now.
644//
646
647// Put out the herald
648//
649 strcpy(buff, "Starting on ");
650 retc = strlen(buff);
651 XrdSysUtils::FmtUname(buff+retc, sizeof(buff)-retc);
652 Log.Say(0, buff);
653 Log.Say(0, CmdLine.c_str());
655
656// Verify that we have a real name. We've had problems with people setting up
657// bad /etc/hosts files that can cause connection failures if "allow" is used.
658// Otherwise, determine our domain name.
659//
660 if (!myIPAddr->isRegistered())
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.");
665 myDomain = 0;
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.");
669
670// Setup the initial required protocol.
671//
672 Firstcp = Lastcp = new XrdConfigProt(strdup(dfltProt), libProt, 0);
673
674// Let start it up!
675//
676 Log.Say("++++++ ", myInstance, " initialization started.");
677
678// Allocate /dev/null as we need it and can't live without it
679//
680 devNull = XrdSysFD_Open("/dev/null", O_RDONLY);
681 if (devNull < 0)
682 {Log.Emsg("Config", errno, "open '/dev/null' which is required!");
683 NoGo = 1;
684 }
685
686// Process the configuration file, if one is present
687//
688 if (ConfigFN)
689 {Log.Say("Config using configuration file ", ConfigFN);
690 ProtInfo.ConfigFN = ConfigFN;
691 NoGo = ConfigProc();
692 }
693 if (clPort >= 0) PortTCP = clPort;
694 if (ProtInfo.DebugON)
697 }
698
699// Setup the admin path now
700//
701 NoGo |= SetupAPath();
702
703// If tls enabled, set it up. We skip this if we failed to avoid confusing msgs
704//
705 if (!NoGo)
706 {if (!tlsCert) ProtInfo.tlsCtx= 0;
707 else {Log.Say("++++++ ", myInstance, " TLS initialization started.");
708 if (SetupTLS())
709 {Log.Say("------ ",myInstance," TLS initialization ended.");
710 if ((ProtInfo.tlsCtx = XrdGlobal::tlsCtx))
711 theEnv.PutPtr("XrdTlsContext*", XrdGlobal::tlsCtx);
712 } else {
713 NoGo = 1;
714 Log.Say("------ ",myInstance," TLS initialization failed.");
715 }
716 }
717 }
718
719// If there is TLS port verify that it can be used. We ignore this if we
720// will fail anyway so as to not issue confusing messages.
721//
722 if (!NoGo)
723 {if (PortTLS > 0 && !XrdGlobal::tlsCtx)
724 {Log.Say("Config TLS port specification ignored; TLS not configured!");
725 PortTLS = -1;
726 } else {
728 ProtInfo.tlsPort = (PortTLS > 0 ? PortTLS : 0);
729 }
730 }
731
732// Put largest buffer size in the env
733//
734 theEnv.PutInt("MaxBuffSize", XrdGlobal::xlBuff.MaxSize());
735
736// Export the network interface list at this point
737//
738 if (ppNet && XrdNetIF::GetIF(ifList, 0, true))
739 XrdOucEnv::Export("XRDIFADDRS",ifList);
740
741// Configure network routing
742//
743 if (!XrdInet::netIF.SetIF(myIPAddr, ifList))
744 {Log.Emsg("Config", "Unable to determine interface addresses!");
745 NoGo = 1;
746 }
747
748// If we have an instance name change the working directory
749//
750 if ((myInsName || HomePath)
751 && !XrdOucUtils::makeHome(Log, myInsName, HomePath, HomeMode)) NoGo = 1;
752
753// Start the UDP network address refresher.
754//
756
757// Create the pid file
758//
759 if (!PidFile(pidFN, optbg)) NoGo = 1;
760
761// Establish a manifest file for auto-collection
762//
763 if (!NoGo) Manifest(pidFN);
764
765// Now initialize the protocols and other stuff
766//
767 if (!NoGo) NoGo = Setup(dfltProt, libProt);
768
769// End config capture
770//
771 setCFG(false);
772
773// If we have a tcpmon plug-in try loading it now. We won't do that unless
774// tcp monitoring was enabled by the monitoring framework.
775//
776 if (tmoInfo && !NoGo)
777 {void *theGS = theEnv.GetPtr("TcpMon.gStream*");
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");
782 if (!TcpMonPin) NoGo = 1;
783 }
784 }
785
786 // if we call this it means that the daemon has forked and we are
787 // in the child process
788#ifndef WIN32
789 if (optbg)
790 {
791 int status = NoGo ? 1 : 0;
792 if(write( pipeFD[1], &status, sizeof( status ) )) {};
793 close( pipeFD[1]);
794 }
795#endif
796
797// All done, close the stream and return the return code.
798//
799 temp = (NoGo ? " initialization failed." : " initialization completed.");
800 sprintf(buff, "%s:%d", myInstance, PortTCP);
801 Log.Say("------ ", buff, temp);
802 if (LogInfo.logArg)
803 {strcat(buff, " running ");
804 retc = strlen(buff);
805 XrdSysUtils::FmtUname(buff+retc, sizeof(buff)-retc);
806 Log.logger()->AddMsg(buff);
807 }
808 return NoGo;
809}
void Usage(const char *msg)
#define XrdBANNER
Definition XrdInfo.hh:38
int optopt
int optind
#define close(a)
Definition XrdPosix.hh:48
#define write(a, b, c)
Definition XrdPosix.hh:115
#define TRACE_ALL
Definition XrdTrace.hh:35
static XrdNetIF netIF
Definition XrdInet.hh:68
const sockaddr * SockAddr()
const char * Name(const char *eName=0, const char **eText=0)
static void SetIPV4()
static void SetIPV6()
static bool IPV4Set()
Definition XrdNetAddr.hh:61
static int GetIF(XrdOucTList **ifList, const char **eText=0)
Definition XrdNetIF.cc:429
static void SetMsgs(XrdSysError *erp)
Definition XrdNetIF.cc:886
static void SetFQN(const char *fqn)
static void Start(XrdSysLogger *logP, XrdScheduler *sP)
void PutInt(const char *varname, long value)
Definition XrdOucEnv.cc:268
static int Export(const char *Var, const char *Val)
Definition XrdOucEnv.cc:188
void * GetPtr(const char *varname)
Definition XrdOucEnv.cc:281
void PutPtr(const char *varname, void *value)
Definition XrdOucEnv.cc:316
static bool configLog(XrdSysError &eDest, configLogInfo &logInfo)
static const char * Set(const char *name, int maxlen=15)
static const char * InstName(int TranOpt=0)
static void makeHome(XrdSysError &eDest, const char *inst)
static void Undercover(XrdSysError &eDest, int noLog, int *pipeFD=0)
static int a2p(XrdSysError &, const char *ptype, const char *val, bool anyOK=true)
Definition XrdOuca2x.cc:140
static const int admPSet
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 int FmtUname(char *buff, int blen)
XrdTlsContext * tlsCtx
Definition XrdGlobals.cc:52
XrdTcpMonPin * TcpMonPin
Definition XrdLinkXeq.cc:80
XrdBuffXL xlBuff
Definition XrdBuffer.cc:68
XrdSysLogger Logger
Definition XrdGlobals.cc:47
XrdSysTrace XrdTrace
Definition XrdTrace.hh:56

References XrdOuca2x::a2p(), XrdProtocol_Config::admPSet, XrdOucString::c_str(), XrdOucLogging::configLogInfo::cfgFn, close, XrdOucLogging::configLog(), XrdGlobal::devNull, XrdOucEnv::Export(), XrdSysUtils::FmtUname(), XrdNetIF::GetIF(), XrdOucEnv::GetPtr(), XrdOucLogging::configLogInfo::hiRes, XrdOucLogging::configLogInfo::iName, XrdOucUtils::InstName(), XrdNetAddr::IPV4Set(), XrdNetAddrInfo::isRegistered(), XrdOucLogging::configLogInfo::keepV, XrdGlobal::Log, XrdOucLogging::configLogInfo::logArg, XrdGlobal::Logger, XrdOucUtils::makeHome(), XrdNetAddrInfo::Name(), XrdInet::netIF, optind, optopt, ProtInfo, XrdOucEnv::PutInt(), XrdOucEnv::PutPtr(), XrdGlobal::Sched, XrdOucSiteName::Set(), XrdSysThread::setDebug(), XrdNetIdentity::SetFQN(), XrdNetAddr::SetIPV4(), XrdNetAddr::SetIPV6(), XrdNetIF::SetMsgs(), XrdNetAddrInfo::SockAddr(), XrdNetRefresh::Start(), XrdGlobal::TcpMonPin, XrdGlobal::tlsCtx, TRACE_ALL, XrdOucUtils::Undercover(), Usage(), write, XrdGlobal::xlBuff, XrdBANNER, XrdOucLogging::configLogInfo::xrdEnv, and XrdGlobal::XrdTrace.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ConfigXeq()

int XrdConfig::ConfigXeq ( char * var,
XrdOucStream & Config,
XrdSysError * eDest = 0 )

Definition at line 815 of file XrdConfig.cc.

816{
817 int dynamic;
818
819 // Determine whether is is dynamic or not
820 //
821 if (eDest) dynamic = 1;
822 else {dynamic = 0; eDest = &Log;}
823
824 // Process common items
825 //
826 TS_Xeq("buffers", xbuf);
827 TS_Xeq("network", xnet);
828 TS_Xeq("sched", xsched);
829 TS_Xeq("trace", xtrace);
830
831 // Process items that can only be processed once
832 //
833 if (!dynamic)
834 {
835 TS_Xeq("adminpath", xapath);
836 TS_Xeq("allow", xallow);
837 TS_Xeq("homepath", xhpath);
838 TS_Xeq("maxfd", xmaxfd);
839 TS_Xeq("pidpath", xpidf);
840 TS_Xeq("port", xport);
841 TS_Xeq("protocol", xprot);
842 TS_Xeq("report", xrep);
843 TS_Xeq("sitename", xsit);
844 TS_Xeq("tcpmonlib", xtcpmon);
845 TS_Xeq("timeout", xtmo);
846 TS_Xeq("tls", xtls);
847 TS_Xeq("tlsca", xtlsca);
848 TS_Xeq("tlsciphers", xtlsci);
849 }
850
851 // No match found, complain.
852 //
853 eDest->Say("Config warning: ignoring unknown xrd directive '",var,"'.");
854 Config.Echo();
855 return 0;
856}
#define TS_Xeq(x, m)
Definition XrdConfig.cc:160
static XrdSysError eDest(0,"crypto_")
XrdCmsConfig Config

References eDest, XrdGlobal::Log, and TS_Xeq.

Member Data Documentation

◆ NetADM

XrdInet* XrdConfig::NetADM

Definition at line 60 of file XrdConfig.hh.

Referenced by XrdConfig(), and main().

◆ NetTCP

std::vector<XrdInet*> XrdConfig::NetTCP

Definition at line 61 of file XrdConfig.hh.

Referenced by main().

◆ ProtInfo

XrdProtocol_Config XrdConfig::ProtInfo

Definition at line 59 of file XrdConfig.hh.

Referenced by XrdConfig(), Configure(), main(), mainAccept(), and mainAdmin().


The documentation for this class was generated from the following files: