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

Constructor & Destructor Documentation

◆ XrdConfig()

XrdConfig::XrdConfig ( )

Definition at line 246 of file XrdConfig.cc.

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

57 {}

Member Function Documentation

◆ Configure()

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

Definition at line 325 of file XrdConfig.cc.

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

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

Referenced by 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 main(), mainAccept(), and mainAdmin().


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