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 46 of file XrdConfig.hh.

Constructor & Destructor Documentation

◆ XrdConfig()

XrdConfig::XrdConfig ( )

Definition at line 244 of file XrdConfig.cc.

245{
246
247// Preset all variables with common defaults
248//
249 PortTCP = -1;
250 PortUDP = -1;
251 PortTLS = -1;
252 ConfigFN = 0;
253 tmoInfo = 0;
254 myInsName= 0;
255 mySitName= 0;
256 AdminPath= strdup("/tmp");
257 HomePath = 0;
258 PidPath = strdup("/tmp");
259 tlsCert = 0;
260 tlsKey = 0;
261 caDir = 0;
262 caFile = 0;
263 AdminMode= S_IRWXU;
264 HomeMode = S_IRWXU;
265 Police = 0;
266 Net_Opts = XRDNET_KEEPALIVE;
267 TLS_Blen = 0; // Accept OS default (leave Linux autotune in effect)
268 TLS_Opts = XRDNET_KEEPALIVE | XRDNET_USETLS;
269 repDest[0] = 0;
270 repDest[1] = 0;
271 repInt = 600;
272 repOpts = 0;
273 ppNet = 0;
275 tlsNoVer = false;
276 tlsNoCAD = true;
277 NetADM = 0;
278 coreV = 1;
279 Specs = 0;
280 isStrict = false;
281 maxFD = 256*1024; // 256K default
282
283 Firstcp = Lastcp = 0;
284
285 ProtInfo.eDest = &Log; // Stable -> Error Message/Logging Handler
286 ProtInfo.NetTCP = 0; // Stable -> Network Object
287 ProtInfo.BPool = &BuffPool; // Stable -> Buffer Pool Manager
288 ProtInfo.Sched = &Sched; // Stable -> System Scheduler
289 ProtInfo.ConfigFN= 0; // We will fill this in later
290 ProtInfo.Stats = 0; // We will fill this in later
291 ProtInfo.AdmPath = AdminPath; // Stable -> The admin path
292 ProtInfo.AdmMode = AdminMode; // Stable -> The admin path mode
293 ProtInfo.theEnv = &theEnv; // Additional information
294 ProtInfo.xrdFlags= 0; // Additional information
295
296 ProtInfo.Format = XrdFORMATB;
297 memset(ProtInfo.rsvd3, 0, sizeof(ProtInfo.rsvd3));
298 ProtInfo.WSize = 0;
299 ProtInfo.ConnMax = -1; // Max connections (fd limit)
300 ProtInfo.readWait = 3*1000; // Wait time for data before we reschedule
301 ProtInfo.idleWait = 0; // Seconds connection may remain idle (0=off)
302 ProtInfo.hailWait =30*1000; // Wait time for data before we drop connection
303 ProtInfo.DebugON = 0; // 1 if started with -d
304 ProtInfo.argc = 0;
305 ProtInfo.argv = 0;
306 ProtInfo.tlsPort = 0;
307 ProtInfo.tlsCtx = 0;
308 ProtInfo.totalCF = &totalCF;
309
310 XrdNetAddr::SetCache(3*60*60); // Cache address resolutions for 3 hours
311}
#define XrdFORMATB
Definition XrdInfo.hh:36
#define XRDNET_KEEPALIVE
Definition XrdNetOpts.hh:63
#define XRDNET_USETLS
Definition XrdNetOpts.hh:91
XrdInet * NetADM
Definition XrdConfig.hh:58
static void SetCache(int keeptime)
int Stats(char *buff, int blen, int do_sync=0)
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:111
XrdScheduler Sched
Definition XrdLinkCtl.cc:54
XrdOucString totalCF
Definition XrdConfig.cc:109
XrdBuffManager BuffPool
Definition XrdGlobals.cc:51

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

+ Here is the call graph for this function:

◆ ~XrdConfig()

XrdConfig::~XrdConfig ( )
inline

Definition at line 55 of file XrdConfig.hh.

55{}

Member Function Documentation

◆ Configure()

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

Definition at line 317 of file XrdConfig.cc.

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

References XrdOuca2x::a2p(), XrdSysLogger::AddMsg(), XrdProtocol_Config::admPSet, XrdOucString::c_str(), XrdOucLogging::configLogInfo::cfgFn, close, XrdOucLogging::configLog(), XrdGlobal::devNull, XrdSysError::Emsg(), XrdOucEnv::Export(), XrdSysUtils::FmtUname(), XrdNetIF::GetIF(), XrdOucEnv::GetPtr(), XrdOucLogging::configLogInfo::hiRes, XrdOucLogging::configLogInfo::iName, XrdOucUtils::InstName(), XrdNetAddr::IPV4Set(), XrdNetAddrInfo::isRegistered(), XrdOucLogging::configLogInfo::keepV, XrdTcpMonInfo::KingPin, XrdOucPinKing< T >::Load(), XrdGlobal::Log, XrdOucLogging::configLogInfo::logArg, XrdSysError::logger(), XrdOucUtils::makeHome(), XrdNetAddrInfo::Name(), XrdInet::netIF, optind, optopt, XrdSysLogger::ParseKeep(), XrdOucEnv::PutInt(), XrdOucEnv::PutPtr(), XrdSysError::Say(), XrdOucSiteName::Set(), XrdSysThread::setDebug(), XrdNetAddr::SetIPV4(), XrdNetAddr::SetIPV6(), XrdNetIF::SetMsgs(), XrdNetAddrInfo::SockAddr(), XrdGlobal::TcpMonPin, XrdTcpMonInfo::theEnv, XrdGlobal::tlsCtx, TRACE_ALL, XrdOucUtils::Undercover(), Usage(), XrdSysTrace::What, 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 791 of file XrdConfig.cc.

792{
793 int dynamic;
794
795 // Determine whether is is dynamic or not
796 //
797 if (eDest) dynamic = 1;
798 else {dynamic = 0; eDest = &Log;}
799
800 // Process common items
801 //
802 TS_Xeq("buffers", xbuf);
803 TS_Xeq("network", xnet);
804 TS_Xeq("sched", xsched);
805 TS_Xeq("trace", xtrace);
806
807 // Process items that can only be processed once
808 //
809 if (!dynamic)
810 {
811 TS_Xeq("adminpath", xapath);
812 TS_Xeq("allow", xallow);
813 TS_Xeq("homepath", xhpath);
814 TS_Xeq("maxfd", xmaxfd);
815 TS_Xeq("pidpath", xpidf);
816 TS_Xeq("port", xport);
817 TS_Xeq("protocol", xprot);
818 TS_Xeq("report", xrep);
819 TS_Xeq("sitename", xsit);
820 TS_Xeq("tcpmonlib", xtcpmon);
821 TS_Xeq("timeout", xtmo);
822 TS_Xeq("tls", xtls);
823 TS_Xeq("tlsca", xtlsca);
824 TS_Xeq("tlsciphers", xtlsci);
825 }
826
827 // No match found, complain.
828 //
829 eDest->Say("Config warning: ignoring unknown xrd directive '",var,"'.");
830 Config.Echo();
831 return 0;
832}
#define TS_Xeq(x, m)
Definition XrdConfig.cc:155
static XrdSysError eDest(0,"crypto_")
XrdCmsConfig Config

References eDest, XrdGlobal::Log, XrdSysError::Say(), and TS_Xeq.

+ Here is the call graph for this function:

Member Data Documentation

◆ NetADM

XrdInet* XrdConfig::NetADM

Definition at line 58 of file XrdConfig.hh.

Referenced by XrdConfig(), and main().

◆ NetTCP

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

Definition at line 59 of file XrdConfig.hh.

Referenced by main().

◆ ProtInfo

XrdProtocol_Config XrdConfig::ProtInfo

Definition at line 57 of file XrdConfig.hh.

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


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