XRootD
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 47 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;
278  tlsOpts = 9ULL | XrdTlsContext::servr | XrdTlsContext::logVF;
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 
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;
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:58
XrdInet * NetADM
Definition: XrdConfig.hh:59
static void SetCache(int keeptime)
Definition: XrdNetAddr.cc:507
XrdBuffManager * BPool
Definition: XrdProtocol.hh:63
XrdScheduler * Sched
Definition: XrdProtocol.hh:64
XrdTlsContext * tlsCtx
Definition: XrdProtocol.hh:99
const char * AdmPath
Definition: XrdProtocol.hh:76
XrdSysError * eDest
Definition: XrdProtocol.hh:61
XrdOucString * totalCF
Definition: XrdProtocol.hh:100
XrdOucEnv * theEnv
Definition: XrdProtocol.hh:66
XrdStats * Stats
Definition: XrdProtocol.hh:65
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, XrdGlobal::Sched, XrdTlsContext::servr, XrdNetAddr::SetCache(), XrdScheduler::setNproc(), XrdScheduler::Stats(), XrdCms::theEnv, XrdGlobal::totalCF, XrdFORMATB, XRDNET_KEEPALIVE, and XRDNET_USETLS.

+ Here is the call graph for this function:

◆ ~XrdConfig()

XrdConfig::~XrdConfig ( )
inline

Definition at line 56 of file XrdConfig.hh.

56 {}

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  if (!(myName = myIPAddr->Name(0, &temp))) myName = "";
592 
593 // Get our IP address and FQN
594 //
595  ProtInfo.myName = myName;
596  ProtInfo.myAddr = myIPAddr->SockAddr();
598  ProtInfo.myProg = myProg;
599 
600 // Set the Environmental variable to hold the instance name
601 // XRDINSTANCE=<pgm> <instance name>@<host name>
602 // XrdOucEnv::Export("XRDINSTANCE")
603 //
604  sprintf(buff,"%s%s %s@%s", xrdInst, myProg, ProtInfo.myInst, myName);
605  myInstance = strdup(buff);
606  putenv(myInstance); // XrdOucEnv::Export("XRDINSTANCE",...)
607  myInstance += strlen(xrdInst);
608  XrdOucEnv::Export("XRDHOST", myName);
609  XrdOucEnv::Export("XRDNAME", ProtInfo.myInst);
610  XrdOucEnv::Export("XRDPROG", myProg);
611 
612 // Bind the log file if we have one
613 //
614  if (LogInfo.logArg)
615  {LogInfo.xrdEnv = &theEnv;
616  LogInfo.iName = myInsName;
617  LogInfo.cfgFn = ConfigFN;
618  if (!XrdOucLogging::configLog(Log, LogInfo)) _exit(16);
619  Log.logger()->AddMsg(CmdLine.c_str());
621  }
622 
623 // We now test for host name. In theory, we should always get some kind of name.
624 // We can't really continue without some kind of name at this point. Note that
625 // vriable temp should still be valid from the previous NetAddr call.
626 //
627  if (!(*myName))
628  {Log.Emsg("Config", "Unable to determine host name; ",
629  (temp ? temp : "reason unknown"),
630  "; execution terminated.");
631  _exit(16);
632  }
633 
634 // Tell NetIF what logger to use as it's been properly setup by now.
635 //
637 
638 // Put out the herald
639 //
640  strcpy(buff, "Starting on ");
641  retc = strlen(buff);
642  XrdSysUtils::FmtUname(buff+retc, sizeof(buff)-retc);
643  Log.Say(0, buff);
644  Log.Say(0, CmdLine.c_str());
645  Log.Say(XrdBANNER);
646 
647 // Verify that we have a real name. We've had problems with people setting up
648 // bad /etc/hosts files that can cause connection failures if "allow" is used.
649 // Otherwise, determine our domain name.
650 //
651  if (!myIPAddr->isRegistered())
652  {Log.Emsg("Config",myName,"does not appear to be registered in the DNS.");
653  Log.Emsg("Config","Verify that the '/etc/hosts' file is correct and "
654  "this machine is registered in DNS.");
655  Log.Emsg("Config", "Execution continues but connection failures may occur.");
656  myDomain = 0;
657  } else if (!(myDomain = index(myName, '.')))
658  Log.Say("Config warning: this hostname, ", myName,
659  ", is registered without a domain qualification.");
660 
661 // Setup the initial required protocol.
662 //
663  Firstcp = Lastcp = new XrdConfigProt(strdup(dfltProt), libProt, 0);
664 
665 // Let start it up!
666 //
667  Log.Say("++++++ ", myInstance, " initialization started.");
668 
669 // Allocate /dev/null as we need it and can't live without it
670 //
671  devNull = XrdSysFD_Open("/dev/null", O_RDONLY);
672  if (devNull < 0)
673  {Log.Emsg("Config", errno, "open '/dev/null' which is required!");
674  NoGo = 1;
675  }
676 
677 // Process the configuration file, if one is present
678 //
679  if (ConfigFN)
680  {Log.Say("Config using configuration file ", ConfigFN);
681  ProtInfo.ConfigFN = ConfigFN;
682  NoGo = ConfigProc();
683  }
684  if (clPort >= 0) PortTCP = clPort;
685  if (ProtInfo.DebugON)
688  }
689 
690 // Setup the admin path now
691 //
692  NoGo |= SetupAPath();
693 
694 // If tls enabled, set it up. We skip this if we failed to avoid confusing msgs
695 //
696  if (!NoGo)
697  {if (!tlsCert) ProtInfo.tlsCtx= 0;
698  else {Log.Say("++++++ ", myInstance, " TLS initialization started.");
699  if (SetupTLS())
700  {Log.Say("------ ",myInstance," TLS initialization ended.");
702  theEnv.PutPtr("XrdTlsContext*", XrdGlobal::tlsCtx);
703  } else {
704  NoGo = 1;
705  Log.Say("------ ",myInstance," TLS initialization failed.");
706  }
707  }
708  }
709 
710 // If there is TLS port verify that it can be used. We ignore this if we
711 // will fail anyway so as to not issue confusing messages.
712 //
713  if (!NoGo)
714  {if (PortTLS > 0 && !XrdGlobal::tlsCtx)
715  {Log.Say("Config TLS port specification ignored; TLS not configured!");
716  PortTLS = -1;
717  } else {
719  ProtInfo.tlsPort = (PortTLS > 0 ? PortTLS : 0);
720  }
721  }
722 
723 // Put largest buffer size in the env
724 //
725  theEnv.PutInt("MaxBuffSize", XrdGlobal::xlBuff.MaxSize());
726 
727 // Export the network interface list at this point
728 //
729  if (ppNet && XrdNetIF::GetIF(ifList, 0, true))
730  XrdOucEnv::Export("XRDIFADDRS",ifList);
731 
732 // Configure network routing
733 //
734  if (!XrdInet::netIF.SetIF(myIPAddr, ifList))
735  {Log.Emsg("Config", "Unable to determine interface addresses!");
736  NoGo = 1;
737  }
738 
739 // If we have an instance name change the working directory
740 //
741  if ((myInsName || HomePath)
742  && !XrdOucUtils::makeHome(Log, myInsName, HomePath, HomeMode)) NoGo = 1;
743 
744 // Start the UDP network address refresher.
745 //
747 
748 // Create the pid file
749 //
750  if (!PidFile(pidFN, optbg)) NoGo = 1;
751 
752 // Establish a manifest file for auto-collection
753 //
754  if (!NoGo) Manifest(pidFN);
755 
756 // Now initialize the protocols and other stuff
757 //
758  if (!NoGo) NoGo = Setup(dfltProt, libProt);
759 
760 // End config capture
761 //
762  setCFG(false);
763 
764 // If we have a tcpmon plug-in try loading it now. We won't do that unless
765 // tcp monitoring was enabled by the monitoring framework.
766 //
767  if (tmoInfo && !NoGo)
768  {void *theGS = theEnv.GetPtr("TcpMon.gStream*");
769  if (!theGS) Log.Say("Config warning: TCP monitoring not enabled; "
770  "tcpmonlib plugin not loaded!");
771  else {tmoInfo->theEnv.PutPtr("TcpMon.gStream*", theGS);
772  TcpMonPin = tmoInfo->KingPin.Load("TcpMonPin");
773  if (!TcpMonPin) NoGo = 1;
774  }
775  }
776 
777  // if we call this it means that the daemon has forked and we are
778  // in the child process
779 #ifndef WIN32
780  if (optbg)
781  {
782  int status = NoGo ? 1 : 0;
783  if(write( pipeFD[1], &status, sizeof( status ) )) {};
784  close( pipeFD[1]);
785  }
786 #endif
787 
788 // All done, close the stream and return the return code.
789 //
790  temp = (NoGo ? " initialization failed." : " initialization completed.");
791  sprintf(buff, "%s:%d", myInstance, PortTCP);
792  Log.Say("------ ", buff, temp);
793  if (LogInfo.logArg)
794  {strcat(buff, " running ");
795  retc = strlen(buff);
796  XrdSysUtils::FmtUname(buff+retc, sizeof(buff)-retc);
797  Log.logger()->AddMsg(buff);
798  }
799  return NoGo;
800 }
void Usage(const char *msg)
Definition: XrdAccTest.cc:105
#define XrdBANNER
Definition: XrdInfo.hh:38
int optopt
int optind
ssize_t write(int fildes, const void *buf, size_t nbyte)
#define close(a)
Definition: XrdPosix.hh:48
#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()
Definition: XrdNetAddr.cc:527
static void SetIPV6()
Definition: XrdNetAddr.cc:553
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:870
static void SetFQN(const char *fqn)
static void Start(XrdSysLogger *logP, XrdScheduler *sP)
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)
Definition: XrdOucUtils.cc:809
static void makeHome(XrdSysError &eDest, const char *inst)
Definition: XrdOucUtils.cc:927
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
Definition: XrdProtocol.hh:79
const char * myName
Definition: XrdProtocol.hh:82
const char * myProg
Definition: XrdProtocol.hh:83
const char * myInst
Definition: XrdProtocol.hh:81
int Emsg(const char *esfx, int ecode, const char *text1, const char *text2=0)
Definition: XrdSysError.cc:95
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)
Definition: XrdSysError.cc:141
XrdSysLogger * logger(XrdSysLogger *lp=0)
Definition: XrdSysError.hh:141
void AddMsg(const char *msg)
int ParseKeep(const char *arg)
static void setDebug(XrdSysError *erp)
static int FmtUname(char *buff, int blen)
Definition: XrdSysUtils.cc:117
XrdOucPinKing< XrdTcpMonPin > KingPin
Definition: XrdConfig.cc:234
XrdOucEnv theEnv
Definition: XrdConfig.cc:242
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
int devNull
Definition: XrdGlobals.cc:55
const char * myDomain

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, XrdGlobal::Log, XrdOucLogging::configLogInfo::logArg, XrdGlobal::Logger, XrdSysError::logger(), XrdOucUtils::makeHome(), XrdNetPMarkConfig::myDomain, XrdNetAddrInfo::Name(), XrdInet::netIF, optind, optopt, XrdSysLogger::ParseKeep(), XrdOucEnv::PutInt(), XrdOucEnv::PutPtr(), XrdSysError::Say(), XrdGlobal::Sched, XrdOucSiteName::Set(), XrdSysThread::setDebug(), XrdNetIdentity::SetFQN(), XrdNetAddr::SetIPV4(), XrdNetAddr::SetIPV6(), XrdNetIF::SetMsgs(), XrdNetAddrInfo::SockAddr(), XrdNetRefresh::Start(), XrdGlobal::TcpMonPin, XrdCms::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 806 of file XrdConfig.cc.

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

References XrdCms::Config, 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 59 of file XrdConfig.hh.

Referenced by main().

◆ NetTCP

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

Definition at line 60 of file XrdConfig.hh.

Referenced by main().

◆ ProtInfo

XrdProtocol_Config XrdConfig::ProtInfo

Definition at line 58 of file XrdConfig.hh.

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


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